本文整理匯總了Java中com.compomics.util.experiment.identification.matches.ModificationMatch.getModificationSite方法的典型用法代碼示例。如果您正苦於以下問題:Java ModificationMatch.getModificationSite方法的具體用法?Java ModificationMatch.getModificationSite怎麽用?Java ModificationMatch.getModificationSite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.compomics.util.experiment.identification.matches.ModificationMatch
的用法示例。
在下文中一共展示了ModificationMatch.getModificationSite方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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);
}
示例4: GetModificationString
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入方法依賴的package包/類
public String GetModificationString() {
String ModificationString = "";
for (ModificationMatch mod : Modifications) {
ModificationString += mod.getTheoreticPtm() + "(" + mod.getModificationSite() + ");";
}
return ModificationString;
}
示例5: getTaggedModifiedSequence
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入方法依賴的package包/類
/**
* Returns the modified sequence as an tagged string with potential
* modification sites color coded or with PTM tags, e.g, <mox>. /!\
* this method will work only if the PTM found in the peptide are in the
* PTMFactory. /!\ This method uses the modifications as set in the
* modification matches of this peptide and displays all of them.
*
* @param modificationProfile the modification profile of the search
* @param useHtmlColorCoding if true, color coded HTML is used, otherwise
* PTM tags, e.g, <mox>, are used
* @param includeHtmlStartEndTags if true, start and end HTML tags are added
* @param useShortName if true the short names are used in the tags
* @param excludeAllFixedPtms if true, all fixed PTMs are excluded
* @return the modified sequence as a tagged string
*/
public String getTaggedModifiedSequence(PtmSettings modificationProfile, boolean useHtmlColorCoding, boolean includeHtmlStartEndTags, boolean useShortName, boolean excludeAllFixedPtms) {
HashMap<Integer, ArrayList<String>> confidentModificationSites = new HashMap<Integer, ArrayList<String>>();
HashMap<Integer, ArrayList<String>> representativeModificationSites = new HashMap<Integer, ArrayList<String>>();
HashMap<Integer, ArrayList<String>> secondaryModificationSites = new HashMap<Integer, ArrayList<String>>();
HashMap<Integer, ArrayList<String>> fixedModificationSites = new HashMap<Integer, ArrayList<String>>();
if (modifications != null) {
for (ModificationMatch modMatch : modifications) {
String modName = modMatch.getTheoreticPtm();
int modSite = modMatch.getModificationSite();
if (modMatch.isVariable()) {
if (modMatch.isConfident()) {
if (!confidentModificationSites.containsKey(modSite)) {
confidentModificationSites.put(modSite, new ArrayList<String>(1));
}
confidentModificationSites.get(modSite).add(modName);
} else {
if (!representativeModificationSites.containsKey(modSite)) {
representativeModificationSites.put(modSite, new ArrayList<String>(1));
}
representativeModificationSites.get(modSite).add(modName);
}
} else if (!excludeAllFixedPtms) {
if (!fixedModificationSites.containsKey(modSite)) {
fixedModificationSites.put(modSite, new ArrayList<String>(1));
}
fixedModificationSites.get(modSite).add(modName);
}
}
}
return getTaggedModifiedSequence(modificationProfile, this, confidentModificationSites, representativeModificationSites, secondaryModificationSites,
fixedModificationSites, useHtmlColorCoding, includeHtmlStartEndTags, useShortName);
}
示例6: checkPTMPattern
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入方法依賴的package包/類
/**
* Checking if peptide-protein should be discarded due to pattern PTM conflict.
*
* @param peptideProteinMapping the peptide protein mapping
* @return either yes or no
*/
public boolean checkPTMPattern(PeptideProteinMapping peptideProteinMapping){
if (PTMPatterns.isEmpty()) return true;
// prepare text for pattern search
String searchText = peptideProteinMapping.getPeptideSequence();
// TODO: extend searchText for length of longest PTM pattern in both directions
for (ModificationMatch modificationMatch : peptideProteinMapping.getModificationMatches()){
if(PTMPatternNames.containsKey(modificationMatch.getTheoreticPtm())){
Integer[] PTMPatternData = PTMPatternNames.get(modificationMatch.getTheoreticPtm()); //(PTMPattern index, starting position, pattern length)
Long[] masks = PTMPatterns.get(PTMPatternData[0]);
int textPos = modificationMatch.getModificationSite() - 1;
if (textPos + PTMPatternData[1] < 0) return false; // TODO: handle this
if (textPos + PTMPatternData[1] + PTMPatternData[2] > searchText.length()) return false; // TODO: handle this
// use shift-and algorithm for pattern search
long pattern = 1L;
for (int i = textPos + PTMPatternData[1], j = 0; j < PTMPatternData[2] && pattern != 0; ++i, ++j){
pattern = (pattern & masks[searchText.charAt(i)]) << 1;
}
return ((1L << PTMPatternData[2]) & pattern) > 0L;
}
}
return true;
}
示例7: FragmentAnnotator
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入方法依賴的package包/類
/**
* Constructor.
*
* @param peptide the peptide
* @param ionSeries the ion series to annotate
* @param forward boolean indicating whether forward ions should be
* annotated
* @param complementary boolean indicating whether complementary ions should
* be annotated
*
* @throws java.lang.InterruptedException exception thrown if a thread is
* interrupted
*/
public FragmentAnnotator(Peptide peptide, IonSeries ionSeries, boolean forward, boolean complementary) throws InterruptedException {
char[] aas = peptide.getSequence().toCharArray();
peptideLength = aas.length;
forwardIonMz1 = new double[peptideLength];
complementaryIonMz1 = new double[peptideLength];
double[] modificationsMasses = new double[peptideLength];
ArrayList<ModificationMatch> modificationMatches = peptide.getModificationMatches();
if (modificationMatches != null) {
for (ModificationMatch modificationMatch : modificationMatches) {
String modificationName = modificationMatch.getTheoreticPtm();
PTM modification = ptmFactory.getPTM(modificationName);
double modificationMass = modification.getMass();
int site = modificationMatch.getModificationSite();
modificationsMasses[site - 1] += modificationMass;
}
}
double forwardMass;
double complementaryMass;
if (ionSeries == IonSeries.by) {
forwardMass = ElementaryIon.proton.getTheoreticMass();
complementaryMass = peptide.getMass() + ElementaryIon.protonMassMultiples[2];
forwardIonType = PeptideFragmentIon.B_ION;
complementaryIonType = PeptideFragmentIon.Y_ION;
} else if (ionSeries == IonSeries.cz) {
forwardMass = ElementaryIon.proton.getTheoreticMass() + StandardMasses.nh3.mass;
complementaryMass = peptide.getMass() + ElementaryIon.protonMassMultiples[2] - StandardMasses.nh3.mass;
forwardIonType = PeptideFragmentIon.C_ION;
complementaryIonType = PeptideFragmentIon.Z_ION;
} else if (ionSeries == IonSeries.ax) {
forwardMass = ElementaryIon.proton.getTheoreticMass() - StandardMasses.co.mass;
complementaryMass = peptide.getMass() + ElementaryIon.protonMassMultiples[2] + StandardMasses.co.mass;
forwardIonType = PeptideFragmentIon.A_ION;
complementaryIonType = PeptideFragmentIon.X_ION;
} else {
throw new UnsupportedOperationException("Ion series " + ionSeries + " not supported.");
}
for (int i = 0; i < peptideLength; i++) {
char aa = aas[i];
AminoAcid aminoAcid = AminoAcid.getAminoAcid(aa);
forwardMass += aminoAcid.getMonoisotopicMass();
forwardMass += modificationsMasses[i];
if (forward) {
forwardIonMz1[i] = forwardMass;
}
if (complementary) {
complementaryIonMz1[i] = complementaryMass - forwardMass;
}
}
}