Skip to content

Commit 463eb65

Browse files
committed
Prevent inaccurate information in peptide evidences due to differences in how protein N-Term Methionine cleavage is handled and tracked
1 parent 6d483c9 commit 463eb65

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/main/java/edu/ucsd/msjava/mzid/MZIdentMLGen.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,22 @@ public List<PeptideEvidenceRef> getPeptideEvidenceList(DatabaseMatch match, Pept
628628

629629
CompactFastaSequence seq = sa.getSequence();
630630
for (int index : indices) {
631-
boolean isNTermMetCleaved;
632-
isNTermMetCleaved = match.isNTermMetCleaved() && sa.getSequence().getCharAt(index + 1) == 'M';
631+
boolean isNTermMetCleaved = false;
632+
633+
// if the sequence matches to a protein N-term that begins with Methionine
634+
if (sa.getSequence().getByteAt(index) == 0 && sa.getSequence().getCharAt(index + 1) == 'M') {
635+
// match.isNTermMetCleaved() is specific to only one of the matched peptides in most cases
636+
// Do a double-check that the index/protein match is correct for the sequence by checking
637+
// the first residue (if not 'M') or matching the peptide sequence to sequence at index + 1
638+
isNTermMetCleaved = match.isNTermMetCleaved() || peptide.getPeptideSequence().charAt(0) != 'M';
639+
if (!isNTermMetCleaved) {
640+
// peptideSequence begins with M
641+
// TODO: is this considered possible (N-Term Methionine cleavage and peptide begins with M)?
642+
// check if the sequence starting at index + 1 matches the provided peptide sequence
643+
String matchSequence = sa.getSequence().getSubsequence(index + 1, index + 2 + peptide.getPeptideSequence().length());
644+
isNTermMetCleaved = matchSequence.startsWith(peptide.getPeptideSequence());
645+
}
646+
}
633647

634648
PeptideEvidence pepEv = new PeptideEvidence();
635649

@@ -673,12 +687,13 @@ public List<PeptideEvidenceRef> getPeptideEvidenceList(DatabaseMatch match, Pept
673687

674688
if (pepEvMap.get(pepEvKey) != null) {
675689
// Avoid duplicate peptide evidences
676-
// currently only occurs when there are 2 results for a single peptide/mod/dbseq combo,
690+
// currently only observed when there are 2 results for a single peptide/mod/dbseq combo,
677691
// one where match.isNTermMetCleaved() is true and sa.getSequence().getCharAt(index + 1) == 'M' is false,
678692
// and another where match.isNTermMetCleaved() is false.
679693
pepEv = pepEvMap.get(pepEvKey);
680694
}
681695
else {
696+
// New peptide evidence. Add it to the map and to the peptideEvidenceList.
682697
pepEvMap.put(pepEvKey, pepEv);
683698
peptideEvidenceList.add(pepEv);
684699
}

0 commit comments

Comments
 (0)