本文整理汇总了Java中com.compomics.util.experiment.biology.Peptide.isModified方法的典型用法代码示例。如果您正苦于以下问题:Java Peptide.isModified方法的具体用法?Java Peptide.isModified怎么用?Java Peptide.isModified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.compomics.util.experiment.biology.Peptide
的用法示例。
在下文中一共展示了Peptide.isModified方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPTMPlotData
import com.compomics.util.experiment.biology.Peptide; //导入方法依赖的package包/类
/**
* Returns the PTM plot series in the JFreechart format for one PSM.
*
* @param peptide the peptide of interest
* @param ptm the PTM to score
* @param nPTM the amount of times the PTM is expected
* @param spectrum the corresponding spectrum
* @param annotationPreferences the annotation preferences
* @param specificAnnotationPreferences the specific annotation preferences
*
* @return the PTM plot series in the JFreechart format for one PSM.
*
* @throws java.lang.InterruptedException exception thrown if the thread is
* interrupted
* @throws org.apache.commons.math.MathException exception thrown if a math exception occurred when estimating the noise level
*/
public static HashMap<PeptideFragmentIon, ArrayList<IonMatch>> getPTMPlotData(Peptide peptide, PTM ptm, int nPTM, MSnSpectrum spectrum,
AnnotationSettings annotationPreferences, SpecificAnnotationSettings specificAnnotationPreferences) throws InterruptedException, MathException {
//@TODO: use Peptide.getNoModPeptide instead
Peptide noModPeptide = new Peptide(peptide.getSequence(), new ArrayList<ModificationMatch>());
if (peptide.isModified()) {
for (ModificationMatch modificationMatch : peptide.getModificationMatches()) {
if (!modificationMatch.getTheoreticPtm().equals(ptm.getName())) {
noModPeptide.addModificationMatch(modificationMatch);
}
}
}
PeptideSpectrumAnnotator spectrumAnnotator = new PeptideSpectrumAnnotator();
HashMap<Integer, ArrayList<Ion>> fragmentIons
= spectrumAnnotator.getExpectedIons(specificAnnotationPreferences, noModPeptide);
HashMap<PeptideFragmentIon, ArrayList<IonMatch>> map = new HashMap<PeptideFragmentIon, ArrayList<IonMatch>>();
for (int i = 0; i <= nPTM; i++) {
spectrumAnnotator.setMassShift(i * ptm.getMass());
ArrayList<IonMatch> matches = spectrumAnnotator.getSpectrumAnnotation(annotationPreferences, specificAnnotationPreferences, spectrum, noModPeptide);
for (IonMatch ionMatch : matches) {
if (ionMatch.ion.getType() == Ion.IonType.PEPTIDE_FRAGMENT_ION) {
PeptideFragmentIon peptideFragmentIon = (PeptideFragmentIon) ionMatch.ion;
for (Ion noModIon : fragmentIons.get(ionMatch.charge)) {
if (noModIon.getType() == Ion.IonType.PEPTIDE_FRAGMENT_ION
&& peptideFragmentIon.isSameAs(noModIon)) {
PeptideFragmentIon noModFragmentIon = (PeptideFragmentIon) noModIon;
if (!map.containsKey(noModFragmentIon)) {
map.put(noModFragmentIon, new ArrayList<IonMatch>());
}
map.get(noModFragmentIon).add(ionMatch);
break;
}
}
}
}
}
return map;
}