Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/views/scheduleInstrument.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ <h3>Time Scheduled</h3>
instrument = instrument ? parseInt(instrument) || null : null;

if (!project) {
alert('No project selected');
document.getElementById('calendar').innerText = 'Invalid or no project specified';
return;
}

Expand Down
36 changes: 34 additions & 2 deletions src/org/labkey/targetedms/view/CrossLinkedPeptideInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,13 @@ public List<Match> findMatches(List<Protein> proteins)
do
{
index = proteinSequence.indexOf(getUnmodified(), index + 1);
if (index >= 0)
if (index != -1 &&
(index == 0 || proteinSequence.charAt(index - 1) == 'K' || proteinSequence.charAt(index - 1) == 'R'))
{
result.add(new Match(protein, index));
}
}
while (index > 0);
while (index >= 0);
}
}
return result;
Expand Down Expand Up @@ -255,6 +256,37 @@ public void testOmittedIndices()
Assert.assertEquals("Link location", Set.of(9), i.getExtraSequences().get(0).getLinkIndices());
Assert.assertEquals("Link location", Set.of(4, 7, 0, 1), i.getExtraSequences().get(4).getLinkIndices());
}

@Test
public void testTrypticMatches()
{
CrossLinkedPeptideInfo info = new CrossLinkedPeptideInfo("PEPTIDE");
PeptideSequence seq = info.getBaseSequence();

// Single protein containing multiple occurrences of PEPTIDE:
// - at start (allowed)
// - preceded by A (disallowed)
// - preceded by K (allowed)
// - preceded by R (allowed)
Protein protein = new Protein();
String proteinSeq = "PEPTIDE" + "APEPTIDE" + "KPEPTIDE" + "RPEPTIDE";
protein.setSequence(proteinSeq);

List<Protein> proteins = Arrays.asList(protein);
List<Match> matches = seq.findMatches(proteins);

// Expect three valid matches: indices 0 (start), 16 (after K), 24 (after R)
Assert.assertEquals("Should find three valid matches within a single protein sequence", 3, matches.size());

Assert.assertSame("First match should be at start (index 0)", protein, matches.get(0).protein());
Assert.assertEquals(0, matches.get(0).index());

Assert.assertSame("Second match should be after K at index 16", protein, matches.get(1).protein());
Assert.assertEquals(16, matches.get(1).index());

Assert.assertSame("Third match should be after R at index 24", protein, matches.get(2).protein());
Assert.assertEquals(24, matches.get(2).index());
}
}

public class Linker
Expand Down
Binary file modified test/sampledata/TargetedMS/CrosslinkPeptideMapTest.sky.zip
Binary file not shown.
19 changes: 12 additions & 7 deletions test/src/org/labkey/test/tests/targetedms/TargetedMSMAMTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.labkey.test.Locator;
import org.labkey.test.util.DataRegion;
import org.labkey.test.util.DataRegionTable;

import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -56,10 +58,13 @@ public void testSteps()
assertTextPresent("Chromatograms");

clickAndWait(Locator.linkContainingText("Peptide Map"));
DataRegionTable table = new DataRegionTable("PeptideIds", getDriver());
table.setPageSize(250);
assertTextPresentInThisOrder("11.3", "14.1", "14.8");
assertTextPresentInThisOrder("1501.75", "1078.50", "1547.71");
assertTextPresentInThisOrder("NU205", "NU205", "1433Z", "UCRI; RL35");
assertTextPresentInThisOrder("70-84", "325-333", "28-41", "190-196; 26-32");
assertTextPresentInThisOrder("NU205", "1433Z", "RL35", "HSP72; HSP7C");
assertTextNotPresent("UCRI; RL35"); // Ensure we don't have non-tryptic matches anymore
assertTextPresentInThisOrder("70-84", "325-333", "28-41", "305-314; 302-311");
assertTextPresentInThisOrder("(K)ASTEGVAIQGQQGTR(L)", "(K)AQYEDIANR(S)", "(K)SVTEQGAELSNEER(N)");
assertTextPresentInThisOrder("Carbamidomethyl Cysteine @ C157", "Carbamidomethyl Cysteine @ C245", "Carbamidomethyl Cysteine @ C94");

Expand All @@ -75,15 +80,15 @@ public void testCrossLinkedPeptideMap()
clickAndWait(Locator.linkContainingText("Panorama Dashboard"));
clickAndWait(Locator.linkContainingText(CROSS_LINKED_SKY_FILE));

verifyRunSummaryCountsPep(2,3,0, 3,3, 1, 0, 0);
verifyRunSummaryCountsPep(2,2,0, 2,2, 1, 0, 0);

clickAndWait(Locator.linkContainingText("Peptide Map"));
assertTextPresentInThisOrder("364-366", "367-369", "364-367");
assertTextPresentInThisOrder("121-124", "342-345", "142-145");
// Disulfide bonds
assertTextPresentInThisOrder("Q364-T369-D364/\nN366-T369-D364", "V121-S345-Q142/\nQ124-S345-Q142");
assertTextPresentInThisOrder("(A)LKPLALV(D)", "(G)AVVQDPA(Y)", "(F)YGEATSR(E)");
assertTextPresentInThisOrder("V121-S345-Q142/\nQ124-S345-Q142", "L11-A137-Y271/\nL11-A137-Y271/\nV17-A137-Y271/");
assertTextPresentInThisOrder("(K)LKPLALV(D)", "(K)AVVQDPA(Y)", "(R)YGEATSR(E)");

// Ensure that the highlighting is as expected for both crosslinking and modification
assertTrue(getHtmlSource().contains("(Y)<span style=\"font-weight:bold;color:green;text-decoration:underline;\">Q</span><span style=\"font-weight:bold;text-decoration:underline;\">M</span><span style=\"font-weight:bold;color:green;\">N</span>(D)"));
assertTrue(getHtmlSource().contains("(R)<span style=\"font-weight:bold;color:green;text-decoration:underline;\">V</span>SS<span style=\"font-weight:bold;color:green;\">Q</span>(Q)"));
}
}