本文整理匯總了Java中com.compomics.util.experiment.identification.matches.ModificationMatch類的典型用法代碼示例。如果您正苦於以下問題:Java ModificationMatch類的具體用法?Java ModificationMatch怎麽用?Java ModificationMatch使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ModificationMatch類屬於com.compomics.util.experiment.identification.matches包,在下文中一共展示了ModificationMatch類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getNTerminal
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Returns the N-terminal of the peptide as a String. Returns "NH2" if the
* terminal is not modified, otherwise returns the name of the modification.
* /!\ this method will work only if the PTM found in the peptide are in the
* PTMFactory.
*
* @return the N-terminal of the peptide as a String, e.g., "NH2"
*/
public String getNTerminal() {
String nTerm = "NH2";
PTMFactory ptmFactory = PTMFactory.getInstance();
if (modifications != null) {
for (ModificationMatch modificationMatch : modifications) {
if (modificationMatch.getModificationSite() == 1) {
PTM ptm = ptmFactory.getPTM(modificationMatch.getTheoreticPtm());
if (ptm.getType() != PTM.MODAA && ptm.getType() != PTM.MODMAX) {
nTerm = ptm.getShortName();
}
}
}
}
nTerm = nTerm.replaceAll("-", " ");
return nTerm;
}
示例2: getIndexedFixedModifications
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Returns an indexed map of all fixed modifications amino acid, (1 is the
* first) > list of modification names.
*
* @return an indexed map of all fixed modifications amino acid
*/
public HashMap<Integer, ArrayList<String>> getIndexedFixedModifications() {
if (modifications == null) {
return new HashMap<Integer, ArrayList<String>>(0);
}
HashMap<Integer, ArrayList<String>> result = new HashMap<Integer, ArrayList<String>>(modifications.size());
for (ModificationMatch modificationMatch : modifications) {
if (!modificationMatch.isVariable()) {
int aa = modificationMatch.getModificationSite();
if (!result.containsKey(aa)) {
result.put(aa, new ArrayList<String>());
}
result.get(aa).add(modificationMatch.getTheoreticPtm());
}
}
return result;
}
示例3: getNoModPeptide
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Returns a version of the peptide which does not contain the inspected
* PTMs.
*
* @param peptide the original peptide
* @param ptms list of inspected PTMs
*
* @return a not modified version of the peptide
*
* @throws IOException exception thrown whenever an error occurred while
* reading a protein sequence
* @throws InterruptedException exception thrown whenever an error occurred
* while reading a protein sequence
* @throws ClassNotFoundException if a ClassNotFoundException occurs
* @throws SQLException if an SQLException occurs
*/
public static Peptide getNoModPeptide(Peptide peptide, ArrayList<PTM> ptms) throws IOException, SQLException, ClassNotFoundException, InterruptedException {
Peptide noModPeptide = new Peptide(peptide.getSequence(), new ArrayList<ModificationMatch>());
noModPeptide.setParentProteins(peptide.getParentProteinsNoRemapping());
if (peptide.isModified()) {
for (ModificationMatch modificationMatch : peptide.getModificationMatches()) {
boolean found = false;
for (PTM ptm : ptms) {
if (modificationMatch.getTheoreticPtm().equals(ptm.getName())) {
found = true;
break;
}
}
if (!found) {
noModPeptide.addModificationMatch(modificationMatch);
}
}
}
return noModPeptide;
}
示例4: addModificationMatch
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Adds a modification to one of the amino acid pattern.
*
* @param localization the index of the amino acid retained as target of the
* modification. 1 is the first amino acid.
* @param modificationMatch the modification match
*/
public void addModificationMatch(int localization, ModificationMatch modificationMatch) {
int index = localization - 1;
if (index < 0) {
throw new IllegalArgumentException("Wrong modification target index " + localization + ", 1 is the first amino acid for PTM localization.");
}
if (targetModifications == null) {
targetModifications = new HashMap<Integer, ArrayList<ModificationMatch>>();
}
ArrayList<ModificationMatch> modificationMatches = targetModifications.get(localization);
if (modificationMatches == null) {
modificationMatches = new ArrayList<ModificationMatch>();
targetModifications.put(localization, modificationMatches);
}
modificationMatches.add(modificationMatch);
}
示例5: addModificationMatches
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Adds a list of modifications to one of the amino acid pattern.
*
* @param localization the index of the amino acid retained as target of the
* modification. 1 is the first amino acid.
* @param modificationMatches the modification matches
*/
public void addModificationMatches(int localization, ArrayList<ModificationMatch> modificationMatches) {
int index = localization - 1;
if (index < 0) {
throw new IllegalArgumentException("Wrong modification target index " + localization + ", 1 is the first amino acid for PTM localization.");
}
if (targetModifications == null) {
targetModifications = new HashMap<Integer, ArrayList<ModificationMatch>>();
}
ArrayList<ModificationMatch> modificationMatchesAtIndex = targetModifications.get(localization);
if (modificationMatchesAtIndex == null) {
modificationMatchesAtIndex = new ArrayList<ModificationMatch>();
targetModifications.put(localization, modificationMatchesAtIndex);
}
modificationMatches.addAll(modificationMatches);
}
示例6: AminoAcidSequence
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Creates a sequence from another sequence.
*
* @param sequence the other sequence
*/
public AminoAcidSequence(AminoAcidSequence sequence) {
this.sequence = sequence.getSequence();
HashMap<Integer, ArrayList<ModificationMatch>> modificationMatches = sequence.getModificationMatches();
if (modificationMatches != null) {
modifications = new HashMap<Integer, ArrayList<ModificationMatch>>(modificationMatches.size());
for (int site : modificationMatches.keySet()) {
ArrayList<ModificationMatch> oldModifications = modificationMatches.get(site);
ArrayList<ModificationMatch> newModifications = new ArrayList<ModificationMatch>(oldModifications.size());
for (ModificationMatch modificationMatch : oldModifications) {
newModifications.add(modificationMatch.clone());
}
modifications.put(site, newModifications);
}
}
}
示例7: appendCTerm
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Appends another sequence at the end of this sequence.
*
* @param otherSequence the other sequence to append.
*/
public void appendCTerm(AminoAcidSequence otherSequence) {
setSequenceStringBuilder(true);
int previousLength = length();
sequenceStringBuilder.append(otherSequence.getSequence());
HashMap<Integer, ArrayList<ModificationMatch>> modificationMatches = otherSequence.getModificationMatches();
if (modificationMatches != null) {
for (int otherSite : modificationMatches.keySet()) {
int newSite = otherSite + previousLength;
for (ModificationMatch oldModificationMatch : modificationMatches.get(otherSite)) {
ModificationMatch newModificationMatch = oldModificationMatch.clone();
oldModificationMatch.setModificationSite(newSite);
addModificationMatch(newSite, newModificationMatch);
}
}
}
}
示例8: addModificationMatch
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Adds a modification to one of the amino acid sequence.
*
* @param localization the index of the amino acid retained as target of the
* modification. 1 is the first amino acid.
* @param modificationMatch the modification match
*/
public void addModificationMatch(int localization, ModificationMatch modificationMatch) {
int index = localization - 1;
if (index < 0) {
throw new IllegalArgumentException("Wrong modification target index " + localization + ", 1 is the first amino acid for PTM localization.");
}
if (modifications == null) {
modifications = new HashMap<Integer, ArrayList<ModificationMatch>>();
}
ArrayList<ModificationMatch> modificationMatches = modifications.get(localization);
if (modificationMatches == null) {
modificationMatches = new ArrayList<ModificationMatch>();
modifications.put(localization, modificationMatches);
}
modificationMatches.add(modificationMatch);
}
示例9: addModificationMatches
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Adds a list of modifications to one of the amino acid sequence.
*
* @param localization the index of the amino acid retained as target of the
* modification. 1 is the first amino acid.
* @param modificationMatches the modification matches
*/
public void addModificationMatches(int localization, ArrayList<ModificationMatch> modificationMatches) {
int index = localization - 1;
if (index < 0) {
throw new IllegalArgumentException("Wrong modification target index " + localization + ", 1 is the first amino acid for PTM localization.");
}
if (modifications == null) {
modifications = new HashMap<Integer, ArrayList<ModificationMatch>>();
}
ArrayList<ModificationMatch> modificationMatchesAtIndex = modifications.get(localization);
if (modificationMatchesAtIndex == null) {
modificationMatchesAtIndex = new ArrayList<ModificationMatch>();
modifications.put(localization, modificationMatchesAtIndex);
}
modificationMatches.addAll(modificationMatches);
}
示例10: reverse
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Returns an amino acid sequence which is a reversed version of the current
* pattern.
*
* @return an amino acid sequence which is a reversed version of the current
* pattern
*/
public AminoAcidSequence reverse() {
setSequenceStringBuilder(false);
AminoAcidSequence newSequence = new AminoAcidSequence((new StringBuilder(sequence)).reverse().toString());
if (modifications != null) {
for (int i : modifications.keySet()) {
int reversed = length() - i + 1;
for (ModificationMatch modificationMatch : modifications.get(i)) {
ModificationMatch newMatch = new ModificationMatch(modificationMatch.getTheoreticPtm(), modificationMatch.isVariable(), reversed);
if (modificationMatch.isConfident()) {
newMatch.setConfident(true);
}
if (modificationMatch.isInferred()) {
newMatch.setInferred(true);
}
newSequence.addModificationMatch(reversed, newMatch);
}
}
}
return newSequence;
}
示例11: getMass
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
@Override
public Double getMass() {
setSequenceStringBuilder(false);
double mass = 0;
for (int i = 0; i < length(); i++) {
AminoAcid aminoAcid = AminoAcid.getAminoAcid(sequence.charAt(i));
mass += aminoAcid.getMonoisotopicMass();
if (modifications != null) {
ArrayList<ModificationMatch> modificationAtIndex = modifications.get(i + 1);
if (modificationAtIndex != null) {
for (ModificationMatch modificationMatch : modificationAtIndex) {
PTM ptm = PTMFactory.getInstance().getPTM(modificationMatch.getTheoreticPtm());
mass += ptm.getMass();
}
}
}
}
return mass;
}
示例12: getPossiblePeptidesMap
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Returns a map of the different possible peptides for the different
* profiles.
*
* @param peptide the peptide of interest
* @param ptms the PTMs to score
* @param possibleProfiles the different profiles
*
* @return a map of the different peptides for the different profiles
*
* @throws IOException exception thrown whenever an error occurred while
* reading a protein sequence
* @throws InterruptedException exception thrown whenever an error occurred
* while reading a protein sequence
* @throws ClassNotFoundException if a ClassNotFoundException occurs
* @throws SQLException if an SQLException occurs
*/
private static HashMap<String, Peptide> getPossiblePeptidesMap(Peptide peptide, ArrayList<PTM> ptms, ArrayList<ArrayList<Integer>> possibleProfiles) throws IOException, SQLException, ClassNotFoundException, InterruptedException {
String representativePTM = ptms.get(0).getName();
HashMap<String, Peptide> result = new HashMap<String, Peptide>(possibleProfiles.size());
int peptideLength = peptide.getSequence().length();
for (ArrayList<Integer> profile : possibleProfiles) {
Peptide tempPeptide = Peptide.getNoModPeptide(peptide, ptms);
for (int pos : profile) {
int index = pos;
if (index == 0) {
index = 1;
} else if (index == peptideLength + 1) {
index = peptideLength;
}
tempPeptide.addModificationMatch(new ModificationMatch(representativePTM, true, index));
}
String profileKey = KeyUtils.getKey(profile);
result.put(profileKey, tempPeptide);
}
return result;
}
示例13: MatrixContent
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Constructor.
*
* @param left left index boundary
* @param right right index boundary
* @param character current character stored
* @param previousContent previous matrix content
* @param mass current mass
* @param peptideSequence intermediate peptide sequence
* @param peptideSequenceSearch intermediate peptide sequence for search
* @param length current peptide length
* @param numX number of current X amino acids
* @param modification index to modification list
* @param modifications intermediate list of modifications
* @param modifictationPos index to modification list for ptm
* @param ambiguousChar ambiguous character
*/
public MatrixContent(int left, int right, int character, MatrixContent previousContent, double mass, String peptideSequence, String peptideSequenceSearch,
int length, int numX, ModificationMatch modification, ArrayList<ModificationMatch> modifications, int modifictationPos, int ambiguousChar) {
this.left = left;
this.right = right;
this.character = character;
this.previousContent = previousContent;
this.mass = mass;
this.peptideSequence = peptideSequence;
this.peptideSequenceSearch = peptideSequenceSearch;
this.length = length;
this.numX = numX;
this.modification = modification;
this.modifications = modifications;
this.modificationPos = modifictationPos;
this.numVariants = 0;
this.numSpecificVariants = new int[]{0, 0, 0};
this.variant = '\0';
this.allVariants = null;
this.ambiguousChar = ambiguousChar;
this.tagComponent = -1;
this.allXcomponents = null;
this.XMassDiff = -1;
this.allXMassDiffs = null;
}
示例14: appendTerminus
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Appends an amino acid sequence to the terminus of sequencing.
*
* @param aminoAcidSequence an amino acid sequence
*/
public void appendTerminus(AminoAcidSequence aminoAcidSequence) {
HashMap<Integer, ArrayList<ModificationMatch>> otherModifications = aminoAcidSequence.getModificationMatches();
if (otherModifications != null) {
if (modificationMatches == null) {
modificationMatches = new HashMap<Integer, String>(otherModifications.size());
}
for (int index : otherModifications.keySet()) {
ArrayList<ModificationMatch> modificationMatchesList = otherModifications.get(index);
if (modificationMatches.size() > 1) {
throw new IllegalArgumentException("Two PTMs found on the same amino acid when mapping tags. Only one supported.");
}
modificationMatches.put(index + length, modificationMatchesList.get(0).getTheoreticPtm());
}
}
length += aminoAcidSequence.length();
if (nTerminus) {
terminalIndex -= aminoAcidSequence.length();
} else {
terminalIndex += aminoAcidSequence.length();
}
mass += aminoAcidSequence.getMass();
}
示例15: getComplementaryIonsFeatures
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入依賴的package包/類
/**
* Returns the ms2pip features for the complementary ions of the given
* peptide at the given charge.
*
* @param peptide the peptide
* @param charge the charge
* @param ionIndex the ion index
*
* @return the ms2pip features for the b ions
*/
public int[] getComplementaryIonsFeatures(Peptide peptide, int charge, int ionIndex) {
char[] peptideSequence = peptide.getSequence().toCharArray();
int sequenceLength = peptideSequence.length;
char[] reversedSequence = new char[sequenceLength];
for (int i = 0; i < sequenceLength; i++) {
reversedSequence[i] = peptideSequence[sequenceLength - i - 1];
}
ArrayList<ModificationMatch> modificationMatches = peptide.getModificationMatches();
ArrayList<ModificationMatch> reversedModificationMatches;
if (modificationMatches != null) {
reversedModificationMatches = new ArrayList<ModificationMatch>(modificationMatches.size());
for (ModificationMatch modificationMatch : modificationMatches) {
ModificationMatch reversedModificationMatch = new ModificationMatch(modificationMatch.getTheoreticPtm(), modificationMatch.isVariable(), sequenceLength - modificationMatch.getModificationSite() + 1);
reversedModificationMatches.add(reversedModificationMatch);
}
} else {
reversedModificationMatches = null;
}
return getIonsFeatures(reversedSequence, reversedModificationMatches, charge, ionIndex);
}