public class TagMatcher extends Object
Constructor and Description |
---|
TagMatcher(ArrayList<String> fixedModifications,
ArrayList<String> variableModifications,
SequenceMatchingPreferences sequenceMatchingPreferences)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ArrayList<SequenceSegment> |
addSequenceSegmentsToCache(HashMap<Integer,ArrayList<SequenceSegment>> indexCache,
String sequence,
AminoAcid aminoAcid,
Integer currentIndex,
Integer aaIndex,
boolean nTerminus)
Adds the possible new sequence segments generated when appending the
given amino acid to the given cache and returns the list of possible
segments.
|
ArrayList<SequenceSegment> |
addSequenceSegmentsToCacheSynchronized(HashMap<Integer,ArrayList<SequenceSegment>> indexCache,
String sequence,
AminoAcid aminoAcid,
Integer currentIndex,
Integer aaIndex,
boolean nTerminus)
Adds the possible new sequence segments generated when appending the
given amino acid to the given cache and returns the list of possible
segments.
|
void |
addVariableModifications(HashMap<String,Double> variableModifications,
SequenceSegment noModSegment,
ArrayList<SequenceSegment> possibleSegments)
Adds the potential sequence segments obtained after adding the given
variable modifications on a segment terminus to the given list of
possible segments.
|
HashMap<Integer,ArrayList<Peptide>> |
buildPeptides(String sequence,
ArrayList<SequenceSegment> nTermPossibleSequences,
String seedSequence,
ArrayList<SequenceSegment> cTermPossibleSequences,
HashMap<Integer,ArrayList<ModificationMatch>> modificationsAtIndex,
int mutationsAtIndex)
Builds the possible peptides based on the given terminal segments and the
seed sequence.
|
void |
clearCache()
Clears the cache.
|
ArrayList<SequenceSegment> |
getCombinationsForAminoAcid(String sequence,
ArrayList<SequenceSegment> possibleSequences,
AminoAcid aminoAcid,
Integer currentIndex,
Integer aaIndex,
boolean nTerminus)
Adds the possible new sequence segments generated when appending the
given amino acid.
|
HashMap<Integer,ArrayList<SequenceSegment>> |
getIndexCache(String accession,
Integer currentIndex,
boolean nTerminus)
Returns the index cache for the given segment seed, accession and index.
|
HashMap<Integer,ArrayList<Peptide>> |
getPeptideMatches(Tag tag,
String accession,
String sequence,
Integer tagIndex,
Integer componentIndex,
double massTolerance)
Returns the possible peptides which can be created on this sequence
indexed by their start index.
|
void |
setSynchronizedIndexing(boolean synchronizedIndexing)
Sets whether the indexing of the sequence should be executed in a
synchronized method.
|
void |
setUseCache(boolean useCache)
Sets whether a cache should be used.
|
boolean |
validateSegments(ArrayList<SequenceSegment> possibleSequences,
ArrayList<SequenceSegment> validSequences,
double massGap,
double massTolerance,
String sequence,
char sequenceAa,
boolean nTerminus)
Removes the segments which cannot match the mass gap from the possible
sequences and transfers the valid segments to the valid sequences.
|
public TagMatcher(ArrayList<String> fixedModifications, ArrayList<String> variableModifications, SequenceMatchingPreferences sequenceMatchingPreferences)
fixedModifications
- list of fixed modificationsvariableModifications
- list of variable modificationssequenceMatchingPreferences
- the sequence matching preferencespublic HashMap<Integer,ArrayList<Peptide>> getPeptideMatches(Tag tag, String accession, String sequence, Integer tagIndex, Integer componentIndex, double massTolerance)
tag
- the tag to look foraccession
- the accession of the proteinsequence
- the sequence where to look for the tagtagIndex
- the index where the tag is locatedcomponentIndex
- the index of the component of the tag indexed by
tagIndex in the content listmassTolerance
- the ms2 tolerancepublic HashMap<Integer,ArrayList<Peptide>> buildPeptides(String sequence, ArrayList<SequenceSegment> nTermPossibleSequences, String seedSequence, ArrayList<SequenceSegment> cTermPossibleSequences, HashMap<Integer,ArrayList<ModificationMatch>> modificationsAtIndex, int mutationsAtIndex)
sequence
- the protein sequencenTermPossibleSequences
- the N-terminal possible segmentsseedSequence
- the seed sequencecTermPossibleSequences
- the C-terminal possible segmentsmodificationsAtIndex
- the seed modificationsmutationsAtIndex
- the seeds mutationspublic HashMap<Integer,ArrayList<SequenceSegment>> getIndexCache(String accession, Integer currentIndex, boolean nTerminus)
accession
- the accession of the proteincurrentIndex
- the index on the proteinnTerminus
- boolean indicating whether the N or C terminus cache
should be usedpublic ArrayList<SequenceSegment> addSequenceSegmentsToCacheSynchronized(HashMap<Integer,ArrayList<SequenceSegment>> indexCache, String sequence, AminoAcid aminoAcid, Integer currentIndex, Integer aaIndex, boolean nTerminus)
indexCache
- the cache for this index on the sequencesequence
- the protein sequenceaminoAcid
- the amino acid objectcurrentIndex
- the current indexing level on the protein sequenceaaIndex
- the amino acid indexnTerminus
- indicates whether the sequencing goes toward the N
(true) or the C (false) terminuspublic ArrayList<SequenceSegment> addSequenceSegmentsToCache(HashMap<Integer,ArrayList<SequenceSegment>> indexCache, String sequence, AminoAcid aminoAcid, Integer currentIndex, Integer aaIndex, boolean nTerminus)
indexCache
- the cache for this index on the sequencesequence
- the protein sequenceaminoAcid
- the amino acid objectcurrentIndex
- the current indexing level on the protein sequenceaaIndex
- the amino acid indexnTerminus
- indicates whether the sequencing goes toward the N
(true) or the C (false) terminuspublic ArrayList<SequenceSegment> getCombinationsForAminoAcid(String sequence, ArrayList<SequenceSegment> possibleSequences, AminoAcid aminoAcid, Integer currentIndex, Integer aaIndex, boolean nTerminus)
sequence
- the protein sequencepossibleSequences
- the possible previous sequencesaminoAcid
- the amino acid objectcurrentIndex
- the current indexing level on the protein sequenceaaIndex
- the amino acid indexnTerminus
- indicates whether the sequencing goes toward the N
(true) or the C (false) terminuspublic boolean validateSegments(ArrayList<SequenceSegment> possibleSequences, ArrayList<SequenceSegment> validSequences, double massGap, double massTolerance, String sequence, char sequenceAa, boolean nTerminus)
possibleSequences
- the possible sequencesvalidSequences
- the valid sequencesmassGap
- the mass gapmassTolerance
- the mass tolerance to usesequence
- the protein sequencesequenceAa
- the amino acid at terminus on the protein sequencenTerminus
- indicates whether the sequencing goes toward the N
(true) or the C (false) terminuspublic void addVariableModifications(HashMap<String,Double> variableModifications, SequenceSegment noModSegment, ArrayList<SequenceSegment> possibleSegments)
variableModifications
- the variable modifications to addnoModSegment
- the sequence segment without modificationpossibleSegments
- the possible segment where to add the modified
segmentspublic void clearCache()
public void setUseCache(boolean useCache)
useCache
- if true a cache will be usedpublic void setSynchronizedIndexing(boolean synchronizedIndexing)
synchronizedIndexing
- true if the indexing of the sequence should
be executed in a synchronized methodCopyright © 2016. All rights reserved.