当前位置: 首页>>代码示例>>Java>>正文


Java ModificationMatch.getTheoreticPtm方法代码示例

本文整理汇总了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;
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:28,代码来源:AminoAcidSequence.java

示例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);
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:33,代码来源:FeaturesGenerator.java

示例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;
}
 
开发者ID:YcheCourseProject,项目名称:DIA-Umpire-Maven,代码行数:8,代码来源:PepIonID.java

示例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());
            }
        }
    }
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:18,代码来源:Peptide.java

示例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, &lt;mox&gt;. /!\
 * 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, &lt;mox&gt;, 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);
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:49,代码来源:Peptide.java

示例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, &lt;mox&gt;. /!\
 * 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, &lt;mox&gt;, 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);
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:51,代码来源:AminoAcidPattern.java

示例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, &lt;mox&gt;. /!\
 * 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, &lt;mox&gt;, 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);
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:52,代码来源:AminoAcidSequence.java

示例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;
        }
    }
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:73,代码来源:FragmentAnnotator.java


注:本文中的com.compomics.util.experiment.identification.matches.ModificationMatch.getTheoreticPtm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。