本文整理匯總了Java中com.compomics.util.experiment.identification.matches.ModificationMatch.getTheoreticPtm方法的典型用法代碼示例。如果您正苦於以下問題:Java ModificationMatch.getTheoreticPtm方法的具體用法?Java ModificationMatch.getTheoreticPtm怎麽用?Java ModificationMatch.getTheoreticPtm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.compomics.util.experiment.identification.matches.ModificationMatch
的用法示例。
在下文中一共展示了ModificationMatch.getTheoreticPtm方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: 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);
}
示例3: 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;
}
示例4: sanityCheck
import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入方法依賴的package包/類
/**
* Removes characters from the sequence and checks the modifications names
* for forbidden characters.
*/
private void sanityCheck() {
sequence = sequence.replaceAll("[#*$%&]", "");
if (modifications != null) {
for (ModificationMatch mod : modifications) {
if (mod.getTheoreticPtm().contains(MODIFICATION_SEPARATOR)) {
throw new IllegalArgumentException("PTM names containing '" + MODIFICATION_SEPARATOR + "' are not supported. Conflicting name: " + mod.getTheoreticPtm());
}
if (mod.getTheoreticPtm().contains(MODIFICATION_LOCALIZATION_SEPARATOR)) {
throw new IllegalArgumentException("PTM names containing '" + MODIFICATION_LOCALIZATION_SEPARATOR + "' are not supported. Conflicting name: " + mod.getTheoreticPtm());
}
}
}
}
示例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: 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. Note: this
* does not include HTML start end tags or terminal annotation.
*
* @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 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 useShortName, boolean excludeAllFixedPtms) {
HashMap<Integer, ArrayList<String>> mainModificationSites = 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 (targetModifications != null) {
for (int modSite : targetModifications.keySet()) {
for (ModificationMatch modificationMatch : targetModifications.get(modSite)) {
String modName = modificationMatch.getTheoreticPtm();
if (modificationMatch.isVariable()) {
if (modificationMatch.isConfident()) {
if (!mainModificationSites.containsKey(modSite)) {
mainModificationSites.put(modSite, new ArrayList<String>());
}
mainModificationSites.get(modSite).add(modName);
} else {
if (!secondaryModificationSites.containsKey(modSite)) {
secondaryModificationSites.put(modSite, new ArrayList<String>());
}
secondaryModificationSites.get(modSite).add(modName);
}
} else if (!excludeAllFixedPtms) {
if (!fixedModificationSites.containsKey(modSite)) {
fixedModificationSites.put(modSite, new ArrayList<String>());
}
fixedModificationSites.get(modSite).add(modName);
}
}
}
}
return getTaggedModifiedSequence(modificationProfile, this, mainModificationSites, secondaryModificationSites,
fixedModificationSites, useHtmlColorCoding, useShortName);
}
示例7: 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. Note: this
* does not include HTML start end tags or terminal annotation.
*
* @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 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 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 (int modSite : modifications.keySet()) {
for (ModificationMatch modificationMatch : modifications.get(modSite)) {
String modName = modificationMatch.getTheoreticPtm();
if (modificationMatch.isVariable()) {
if (modificationMatch.isConfident()) {
if (!confidentModificationSites.containsKey(modSite)) {
confidentModificationSites.put(modSite, new ArrayList<String>());
}
confidentModificationSites.get(modSite).add(modName);
} else {
if (!representativeModificationSites.containsKey(modSite)) {
representativeModificationSites.put(modSite, new ArrayList<String>());
}
representativeModificationSites.get(modSite).add(modName);
}
} else if (!excludeAllFixedPtms) {
if (!fixedModificationSites.containsKey(modSite)) {
fixedModificationSites.put(modSite, new ArrayList<String>());
}
fixedModificationSites.get(modSite).add(modName);
}
}
}
}
setSequenceStringBuilder(false);
return getTaggedModifiedSequence(modificationProfile, sequence, confidentModificationSites, representativeModificationSites, secondaryModificationSites,
fixedModificationSites, useHtmlColorCoding, useShortName);
}
示例8: 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;
}
}
}