@@ -628,8 +628,22 @@ public List<PeptideEvidenceRef> getPeptideEvidenceList(DatabaseMatch match, Pept
628
628
629
629
CompactFastaSequence seq = sa .getSequence ();
630
630
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
+ }
633
647
634
648
PeptideEvidence pepEv = new PeptideEvidence ();
635
649
@@ -673,12 +687,13 @@ public List<PeptideEvidenceRef> getPeptideEvidenceList(DatabaseMatch match, Pept
673
687
674
688
if (pepEvMap .get (pepEvKey ) != null ) {
675
689
// 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,
677
691
// one where match.isNTermMetCleaved() is true and sa.getSequence().getCharAt(index + 1) == 'M' is false,
678
692
// and another where match.isNTermMetCleaved() is false.
679
693
pepEv = pepEvMap .get (pepEvKey );
680
694
}
681
695
else {
696
+ // New peptide evidence. Add it to the map and to the peptideEvidenceList.
682
697
pepEvMap .put (pepEvKey , pepEv );
683
698
peptideEvidenceList .add (pepEv );
684
699
}
0 commit comments