@@ -64,6 +64,7 @@ public Protein(string sequence, string accession, string organism = null, List<T
6464 DatabaseReferences = databaseReferences ?? new List < DatabaseReference > ( ) ;
6565 DisulfideBonds = disulfideBonds ?? new List < DisulfideBond > ( ) ;
6666 SpliceSites = spliceSites ?? new List < SpliceSite > ( ) ;
67+
6768 if ( addBiomarkers )
6869 {
6970 this . AddBiomarkers ( ) ;
@@ -236,7 +237,7 @@ public string GetEnsemblFastaHeader()
236237 /// Gets peptides for digestion of a protein
237238 /// </summary>
238239 public IEnumerable < PeptideWithSetModifications > Digest ( DigestionParams digestionParams , List < Modification > allKnownFixedModifications ,
239- List < Modification > variableModifications , List < SilacLabel > silacLabels = null , ( SilacLabel startLabel , SilacLabel endLabel ) ? turnoverLabels = null )
240+ List < Modification > variableModifications , List < SilacLabel > silacLabels = null , ( SilacLabel startLabel , SilacLabel endLabel ) ? turnoverLabels = null , bool topDownBiomarkerSearch = false )
240241 {
241242 //can't be null
242243 allKnownFixedModifications = allKnownFixedModifications ?? new List < Modification > ( ) ;
@@ -252,7 +253,7 @@ public IEnumerable<PeptideWithSetModifications> Digest(DigestionParams digestion
252253 IEnumerable < ProteolyticPeptide > unmodifiedPeptides =
253254 searchModeType == CleavageSpecificity . Semi ?
254255 digestion . SpeedySemiSpecificDigestion ( this ) :
255- digestion . Digestion ( this ) ;
256+ digestion . Digestion ( this , topDownBiomarkerSearch ) ;
256257
257258 if ( digestionParams . KeepNGlycopeptide || digestionParams . KeepOGlycopeptide )
258259 {
@@ -717,18 +718,18 @@ public void AddBiomarkers(bool addFullProtein = true, bool addForEachOrigninalPr
717718 AddIntactProteoformToProteolysisProducts ( initiatorMethionineBehavior , minProductBaseSequenceLength ) ;
718719 if ( addNterminalDigestionBiomarkers )
719720 {
720- AddBiomarkersToProteolysisProducts ( 1 , BaseSequence . Length , true , false , initiatorMethionineBehavior , minProductBaseSequenceLength , lengthOfProteolysis , "full proteoform biomarker" ) ;
721+ AddBiomarkersToProteolysisProducts ( 1 , BaseSequence . Length , true , false , initiatorMethionineBehavior , minProductBaseSequenceLength , lengthOfProteolysis , "full-length proteoform N-terminal digestion biomarker" ) ;
721722 }
722723 if ( addCterminalDigestionBiomarkers )
723724 {
724- AddBiomarkersToProteolysisProducts ( 1 , BaseSequence . Length , false , true , initiatorMethionineBehavior , minProductBaseSequenceLength , lengthOfProteolysis , "full proteoform biomarker" ) ;
725+ AddBiomarkersToProteolysisProducts ( 1 , BaseSequence . Length , false , true , initiatorMethionineBehavior , minProductBaseSequenceLength , lengthOfProteolysis , "full-length proteoform C-terminal digestion biomarker" ) ;
725726 }
726727 }
727728
728729 if ( addForEachOrigninalProteolysisProduct ) // this does not include the original intact proteoform
729730 {
730731 RemoveMethionineWhenAppropriateFromExistingProduts ( initiatorMethionineBehavior ) ;
731- List < ProteolysisProduct > existingProducts = ProteolysisProducts . Where ( p => ! p . Type . Contains ( "biomarker" ) && ! p . Type . Contains ( "intact " ) ) . ToList ( ) ;
732+ List < ProteolysisProduct > existingProducts = ProteolysisProducts . Where ( p => ! p . Type . Contains ( "biomarker" ) && ! p . Type . Contains ( "full-length proteoform " ) ) . ToList ( ) ;
732733 foreach ( ProteolysisProduct product in existingProducts )
733734 {
734735 if ( product . OneBasedBeginPosition . HasValue && product . OneBasedEndPosition . HasValue )
@@ -795,7 +796,7 @@ public void AddIntactProteoformToProteolysisProducts(InitiatorMethionineBehavior
795796 //when it's variable, we don't have to add anything here, we'll get an additonal proteolysis product later.
796797 if ( BaseSequence . Length >= minProductBaseSequenceLength )
797798 {
798- _proteolysisProducts . Add ( new ProteolysisProduct ( 1 , BaseSequence . Length , "intact proteoform biomarker " ) ) ;
799+ _proteolysisProducts . Add ( new ProteolysisProduct ( 1 , BaseSequence . Length , "full-length proteoform" ) ) ;
799800 }
800801 }
801802 else if ( initiatorMethionineBehavior == InitiatorMethionineBehavior . Cleave )
@@ -804,14 +805,14 @@ public void AddIntactProteoformToProteolysisProducts(InitiatorMethionineBehavior
804805 {
805806 if ( BaseSequence . Length - 1 >= minProductBaseSequenceLength )
806807 {
807- _proteolysisProducts . Add ( new ProteolysisProduct ( 2 , BaseSequence . Length , "intact proteoform biomarker " ) ) ;
808+ _proteolysisProducts . Add ( new ProteolysisProduct ( 2 , BaseSequence . Length , "full-length proteoform" ) ) ;
808809 }
809810 }
810811 else
811812 {
812813 if ( BaseSequence . Length >= minProductBaseSequenceLength )
813814 {
814- _proteolysisProducts . Add ( new ProteolysisProduct ( 1 , BaseSequence . Length , "intact proteoform biomarker " ) ) ;
815+ _proteolysisProducts . Add ( new ProteolysisProduct ( 1 , BaseSequence . Length , "full-length proteoform" ) ) ;
815816 }
816817 }
817818 }
@@ -822,16 +823,17 @@ public void AddIntactProteoformToProteolysisProducts(InitiatorMethionineBehavior
822823 /// This method allows for one missed cleavage between proteolysis products.
823824 /// </summary>
824825 /// <param name="minimumProductLength"></param>
826+
825827 public void CleaveOnceBetweenProteolysisProducts ( int minimumProductLength = 7 )
826828 {
827829 List < int > cleavagePostions = new ( ) ;
828- List < int > proteolysisProductEndPositions = _proteolysisProducts . Where ( p => p . OneBasedEndPosition . HasValue ) . Select ( p => p . OneBasedEndPosition . Value ) . ToList ( ) ;
829-
830+ List < ProteolysisProduct > localProducts = _proteolysisProducts . Where ( p => ! p . Type . Contains ( "biomarker" ) && ! p . Type . Contains ( "full-length proteoform" ) ) . ToList ( ) ;
831+ List < int > proteolysisProductEndPositions = localProducts . Where ( p => p . OneBasedEndPosition . HasValue ) . Select ( p => p . OneBasedEndPosition . Value ) . ToList ( ) ;
830832 if ( proteolysisProductEndPositions . Count > 0 )
831833 {
832834 foreach ( int proteolysisProductEndPosition in proteolysisProductEndPositions )
833835 {
834- if ( _proteolysisProducts . Any ( p => p . OneBasedBeginPosition == ( proteolysisProductEndPosition + 1 ) ) )
836+ if ( localProducts . Any ( p => p . OneBasedBeginPosition == ( proteolysisProductEndPosition + 1 ) ) )
835837 {
836838 cleavagePostions . Add ( proteolysisProductEndPosition ) ;
837839 }
@@ -844,6 +846,7 @@ public void CleaveOnceBetweenProteolysisProducts(int minimumProductLength = 7)
844846 {
845847 string leftType = $ "N-terminal Portion of Singly Cleaved Protein(1-{ position } )";
846848 ProteolysisProduct leftProduct = new ( 1 , position , leftType ) ;
849+
847850 //here we're making sure a product with these begin/end positions isn't already present
848851 if ( ! _proteolysisProducts . Any ( p => p . OneBasedBeginPosition == leftProduct . OneBasedBeginPosition && p . OneBasedEndPosition == leftProduct . OneBasedEndPosition ) )
849852 {
@@ -855,6 +858,7 @@ public void CleaveOnceBetweenProteolysisProducts(int minimumProductLength = 7)
855858 {
856859 string rightType = $ "C-terminal Portion of Singly Cleaved Protein({ position + 1 } -{ BaseSequence . Length } )";
857860 ProteolysisProduct rightProduct = new ( position + 1 , BaseSequence . Length , rightType ) ;
861+
858862 //here we're making sure a product with these begin/end positions isn't already present
859863 if ( ! _proteolysisProducts . Any ( p => p . OneBasedBeginPosition == rightProduct . OneBasedBeginPosition && p . OneBasedEndPosition == rightProduct . OneBasedEndPosition ) )
860864 {
0 commit comments