Skip to content

Commit ef705f6

Browse files
Adjust peptide map report to only show tryptic matches (#1122)
1 parent 53b1455 commit ef705f6

File tree

4 files changed

+47
-10
lines changed

4 files changed

+47
-10
lines changed

resources/views/scheduleInstrument.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ <h3>Time Scheduled</h3>
175175
instrument = instrument ? parseInt(instrument) || null : null;
176176

177177
if (!project) {
178-
alert('No project selected');
178+
document.getElementById('calendar').innerText = 'Invalid or no project specified';
179179
return;
180180
}
181181

src/org/labkey/targetedms/view/CrossLinkedPeptideInfo.java

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,13 @@ public List<Match> findMatches(List<Protein> proteins)
189189
do
190190
{
191191
index = proteinSequence.indexOf(getUnmodified(), index + 1);
192-
if (index >= 0)
192+
if (index != -1 &&
193+
(index == 0 || proteinSequence.charAt(index - 1) == 'K' || proteinSequence.charAt(index - 1) == 'R'))
193194
{
194195
result.add(new Match(protein, index));
195196
}
196197
}
197-
while (index > 0);
198+
while (index >= 0);
198199
}
199200
}
200201
return result;
@@ -255,6 +256,37 @@ public void testOmittedIndices()
255256
Assert.assertEquals("Link location", Set.of(9), i.getExtraSequences().get(0).getLinkIndices());
256257
Assert.assertEquals("Link location", Set.of(4, 7, 0, 1), i.getExtraSequences().get(4).getLinkIndices());
257258
}
259+
260+
@Test
261+
public void testTrypticMatches()
262+
{
263+
CrossLinkedPeptideInfo info = new CrossLinkedPeptideInfo("PEPTIDE");
264+
PeptideSequence seq = info.getBaseSequence();
265+
266+
// Single protein containing multiple occurrences of PEPTIDE:
267+
// - at start (allowed)
268+
// - preceded by A (disallowed)
269+
// - preceded by K (allowed)
270+
// - preceded by R (allowed)
271+
Protein protein = new Protein();
272+
String proteinSeq = "PEPTIDE" + "APEPTIDE" + "KPEPTIDE" + "RPEPTIDE";
273+
protein.setSequence(proteinSeq);
274+
275+
List<Protein> proteins = Arrays.asList(protein);
276+
List<Match> matches = seq.findMatches(proteins);
277+
278+
// Expect three valid matches: indices 0 (start), 16 (after K), 24 (after R)
279+
Assert.assertEquals("Should find three valid matches within a single protein sequence", 3, matches.size());
280+
281+
Assert.assertSame("First match should be at start (index 0)", protein, matches.get(0).protein());
282+
Assert.assertEquals(0, matches.get(0).index());
283+
284+
Assert.assertSame("Second match should be after K at index 16", protein, matches.get(1).protein());
285+
Assert.assertEquals(16, matches.get(1).index());
286+
287+
Assert.assertSame("Third match should be after R at index 24", protein, matches.get(2).protein());
288+
Assert.assertEquals(24, matches.get(2).index());
289+
}
258290
}
259291

260292
public class Linker
46 Bytes
Binary file not shown.

test/src/org/labkey/test/tests/targetedms/TargetedMSMAMTest.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import org.junit.Test;
2020
import org.junit.experimental.categories.Category;
2121
import org.labkey.test.Locator;
22+
import org.labkey.test.util.DataRegion;
23+
import org.labkey.test.util.DataRegionTable;
2224

2325
import static org.junit.Assert.assertTrue;
2426

@@ -56,10 +58,13 @@ public void testSteps()
5658
assertTextPresent("Chromatograms");
5759

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

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

78-
verifyRunSummaryCountsPep(2,3,0, 3,3, 1, 0, 0);
83+
verifyRunSummaryCountsPep(2,2,0, 2,2, 1, 0, 0);
7984

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

8691
// Ensure that the highlighting is as expected for both crosslinking and modification
87-
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)"));
92+
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)"));
8893
}
8994
}

0 commit comments

Comments
 (0)