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


Java ModificationMatch.getModificationSite方法代码示例

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

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

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

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


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