當前位置: 首頁>>代碼示例>>Java>>正文


Java ModificationMatch.isVariable方法代碼示例

本文整理匯總了Java中com.compomics.util.experiment.identification.matches.ModificationMatch.isVariable方法的典型用法代碼示例。如果您正苦於以下問題:Java ModificationMatch.isVariable方法的具體用法?Java ModificationMatch.isVariable怎麽用?Java ModificationMatch.isVariable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.compomics.util.experiment.identification.matches.ModificationMatch的用法示例。


在下文中一共展示了ModificationMatch.isVariable方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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;
}
 
開發者ID:compomics,項目名稱:compomics-utilities,代碼行數:25,代碼來源:Peptide.java

示例2: 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

示例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);
}
 
開發者ID:compomics,項目名稱:compomics-utilities,代碼行數:33,代碼來源:FeaturesGenerator.java

示例4: getNVariableModifications

import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入方法依賴的package包/類
/**
 * Returns the number of variable modifications found with the given mass.
 *
 * @param modificationMass the mass of the modification
 * @return the number of occurrences of this modification
 */
public int getNVariableModifications(double modificationMass) {
    int n = 0;
    if (modifications != null) {
        for (ModificationMatch modificationMatch : modifications) {
            if (modificationMatch.isVariable()) {
                PTM ptm = PTMFactory.getInstance().getPTM(modificationMatch.getTheoreticPtm());
                if (ptm.getMass() == modificationMass) {
                    n++;
                }
            }
        }
    }
    return n;
}
 
開發者ID:compomics,項目名稱:compomics-utilities,代碼行數:21,代碼來源: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: getPeptideModificationsAsString

import com.compomics.util.experiment.identification.matches.ModificationMatch; //導入方法依賴的package包/類
/**
 * Returns the peptide modifications as a string.
 *
 * @param peptide the peptide
 * @param variablePtms if true, only variable PTMs are shown, false return
 * only the fixed PTMs
 *
 * @return the peptide modifications as a string
 */
public static String getPeptideModificationsAsString(Peptide peptide, boolean variablePtms) {

    StringBuilder result = new StringBuilder();

    HashMap<String, ArrayList<Integer>> modMap = new HashMap<String, ArrayList<Integer>>();
    if (peptide.isModified()) {
        for (ModificationMatch modificationMatch : peptide.getModificationMatches()) {
            if ((variablePtms && modificationMatch.isVariable()) || (!variablePtms && !modificationMatch.isVariable())) {
                if (!modMap.containsKey(modificationMatch.getTheoreticPtm())) {
                    modMap.put(modificationMatch.getTheoreticPtm(), new ArrayList<Integer>());
                }
                modMap.get(modificationMatch.getTheoreticPtm()).add(modificationMatch.getModificationSite());
            }
        }
    }

    boolean first = true, first2;
    ArrayList<String> mods = new ArrayList<String>(modMap.keySet());

    Collections.sort(mods);
    for (String mod : mods) {
        if (first) {
            first = false;
        } else {
            result.append(", ");
        }
        first2 = true;
        result.append(mod);
        result.append(" (");
        for (int aa : modMap.get(mod)) {
            if (first2) {
                first2 = false;
            } else {
                result.append(", ");
            }
            result.append(aa);
        }
        result.append(")");
    }

    return result.toString();
}
 
開發者ID:compomics,項目名稱:compomics-utilities,代碼行數:52,代碼來源:Peptide.java


注:本文中的com.compomics.util.experiment.identification.matches.ModificationMatch.isVariable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。