本文整理汇总了Java中com.compomics.util.experiment.biology.Ion.getSubType方法的典型用法代码示例。如果您正苦于以下问题:Java Ion.getSubType方法的具体用法?Java Ion.getSubType怎么用?Java Ion.getSubType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.compomics.util.experiment.biology.Ion
的用法示例。
在下文中一共展示了Ion.getSubType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMatchKey
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
/**
* Returns the key for the ion match uniquely representing a peak
* annotation. If a cache is given it will be used to store keys, ignored if
* null.
*
* @param ion the ion matched
* @param charge the charge
* @param ionMatchKeysCache a cache for the ion match keys
*
* @return the key for the ion match
*/
public static String getMatchKey(Ion ion, int charge, IonMatchKeysCache ionMatchKeysCache) {
if (ionMatchKeysCache != null) {
return ionMatchKeysCache.getMatchKey(ion, charge);
}
Ion.IonType ionType = ion.getType();
int ionTypeIndex = ionType.index;
int ionSubType = ion.getSubType();
int fragmentIonNumber;
if (ionType == Ion.IonType.PEPTIDE_FRAGMENT_ION) {
PeptideFragmentIon fragmentIon = ((PeptideFragmentIon) ion);
fragmentIonNumber = fragmentIon.getNumber();
} else if (ionType == Ion.IonType.TAG_FRAGMENT_ION) {
TagFragmentIon tagFragmentIon = ((TagFragmentIon) ion);
fragmentIonNumber = tagFragmentIon.getNumber();
} else {
fragmentIonNumber = 0;
}
String neutralLossesAsString = ion.getNeutralLossesAsString();
String key = getMatchKey(ionTypeIndex, ionSubType, fragmentIonNumber, neutralLossesAsString, charge);
return key;
}
示例2: isSameAs
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
@Override
public boolean isSameAs(Ion anotherIon) {
return anotherIon.getType() == Ion.IonType.TAG_FRAGMENT_ION
&& anotherIon.getSubType() == subType
&& ((PeptideFragmentIon) anotherIon).getNumber() == number
&& anotherIon.getNeutralLossesAsString().equals(getNeutralLossesAsString());
}
示例3: isSameAs
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
@Override
public boolean isSameAs(Ion anotherIon) {
return anotherIon.getType() == IonType.ELEMENTARY_ION
&& anotherIon.getSubType() == subType
&& anotherIon.getTheoreticMass() == theoreticMass1
&& anotherIon.getNeutralLossesAsString().equals(getNeutralLossesAsString());
}
示例4: isSameAs
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
@Override
public boolean isSameAs(Ion anotherIon) {
return anotherIon.getType() == IonType.PEPTIDE_FRAGMENT_ION
&& anotherIon.getSubType() == subType
&& ((PeptideFragmentIon) anotherIon).getNumber() == number
&& anotherIon.getNeutralLossesAsString().equals(getNeutralLossesAsString());
}
示例5: getIntensity
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
/**
* Returns the intensity expected for the given ion. 50.0 for b and y ions
* with no neutral losses. 25.0 for a ions and b and y ions with neutral
* losses. 0.0 for other peaks.
*
* @param ion the ion of interest
*
* @return the expected intensity
*/
public static Double getIntensity(Ion ion) {
if (ion instanceof PeptideFragmentIon) {
if (ion.getSubType() == PeptideFragmentIon.B_ION || ion.getSubType() == PeptideFragmentIon.Y_ION) {
if (!ion.hasNeutralLosses() || ion.getNeutralLosses().length == 0) {
return 50.0;
} else {
return 25.0;
}
} else if (ion.getSubType() == PeptideFragmentIon.A_ION) {
return 25.0;
}
}
return 0.0;
}
示例6: getCoveredAminoAcids
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
/**
* Returns the ion matches corresponding to fragment ions indexed by amino
* acid number in the sequence. 1 is first amino acid.
*
* @param annotationSettings the annotation settings
* @param specificAnnotationSettings the specific annotation settings
* @param spectrum The spectrum to match
* @param peptide The peptide of interest
* @param useIntensityFilter boolean indicating whether intensity filters
* should be used
*
* @return the ion matches corresponding to fragment ions indexed by amino
* acid number in the sequence
*
* @throws java.lang.InterruptedException exception thrown if a threading
* error occurred when estimating the noise level
* @throws org.apache.commons.math.MathException exception thrown if a math
* exception occurred when estimating the noise level
*/
public HashMap<Integer, ArrayList<IonMatch>> getCoveredAminoAcids(AnnotationSettings annotationSettings,
SpecificAnnotationSettings specificAnnotationSettings, MSnSpectrum spectrum, Peptide peptide, boolean useIntensityFilter) throws InterruptedException, MathException {
HashMap<Integer, ArrayList<IonMatch>> matchesMap = new HashMap<Integer, ArrayList<IonMatch>>();
ArrayList<IonMatch> matches = getSpectrumAnnotation(annotationSettings, specificAnnotationSettings, spectrum, peptide, useIntensityFilter);
for (IonMatch ionMatch : matches) {
Ion ion = ionMatch.ion;
int number;
if (ion.getType() == Ion.IonType.PEPTIDE_FRAGMENT_ION) {
if (ion.getSubType() == PeptideFragmentIon.A_ION
|| ion.getSubType() == PeptideFragmentIon.B_ION
|| ion.getSubType() == PeptideFragmentIon.C_ION) {
number = ((PeptideFragmentIon) ion).getNumber();
} else {
number = peptide.getSequence().length() + 1 - ((PeptideFragmentIon) ion).getNumber();
}
if (!matchesMap.containsKey(number)) {
matchesMap.put(number, new ArrayList<IonMatch>());
}
matchesMap.get(number).add(ionMatch);
}
}
return matchesMap;
}
示例7: isSameAs
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
@Override
public boolean isSameAs(Ion anotherIon) {
return anotherIon.getType() == IonType.IMMONIUM_ION
&& anotherIon.getSubType() == subType;
}
示例8: isAccounted
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
/**
* Returns a boolean indicating whether the neutral loss should be accounted
* for.
*
* @param neutralLosses map of expected neutral losses
* @param neutralLoss the neutral loss of interest
* @param ion the fragment ion of interest
*
* @return boolean indicating whether the neutral loss should be considered
*/
public boolean isAccounted(NeutralLossesMap neutralLosses, NeutralLoss neutralLoss, Ion ion) {
if (neutralLosses == null || neutralLosses.isEmpty()) {
return false;
}
for (String neutralLossName : neutralLosses.getAccountedNeutralLosses()) {
NeutralLoss neutralLossRef = NeutralLoss.getNeutralLoss(neutralLossName);
if (neutralLoss.isSameAs(neutralLossRef)) {
switch (ion.getType()) {
case PEPTIDE_FRAGMENT_ION:
PeptideFragmentIon peptideFragmentIon = ((PeptideFragmentIon) ion);
switch (ion.getSubType()) {
case PeptideFragmentIon.A_ION:
case PeptideFragmentIon.B_ION:
case PeptideFragmentIon.C_ION:
return neutralLosses.getForwardStart(neutralLossName) <= peptideFragmentIon.getNumber();
case PeptideFragmentIon.X_ION:
case PeptideFragmentIon.Y_ION:
case PeptideFragmentIon.Z_ION:
return neutralLosses.getRewindStart(neutralLossName) <= peptideFragmentIon.getNumber();
default:
throw new UnsupportedOperationException("Fragment ion type " + ion.getSubTypeAsString() + " not implemented in the spectrum annotator.");
}
case TAG_FRAGMENT_ION:
TagFragmentIon tagFragmentIon = ((TagFragmentIon) ion);
switch (ion.getSubType()) {
case TagFragmentIon.A_ION:
case TagFragmentIon.B_ION:
case TagFragmentIon.C_ION:
return neutralLosses.getForwardStart(neutralLossName) <= tagFragmentIon.getNumber();
case TagFragmentIon.X_ION:
case TagFragmentIon.Y_ION:
case TagFragmentIon.Z_ION:
return neutralLosses.getRewindStart(neutralLossName) <= tagFragmentIon.getNumber();
default:
throw new UnsupportedOperationException("Fragment ion type " + ion.getSubTypeAsString() + " not implemented in the spectrum annotator.");
}
default:
return true;
}
}
}
return false;
}
示例9: getMatchKey
import com.compomics.util.experiment.biology.Ion; //导入方法依赖的package包/类
/**
* Returns the key for the ion match uniquely representing a peak
* annotation.
*
* @param ion the ion matched
* @param charge the charge
*
* @return the key for the ion match
*/
public String getMatchKey(Ion ion, int charge) {
Ion.IonType ionType = ion.getType();
int ionTypeIndex = ionType.index;
int ionSubType = ion.getSubType();
int fragmentIonNumber;
if (ionType == Ion.IonType.PEPTIDE_FRAGMENT_ION) {
PeptideFragmentIon fragmentIon = ((PeptideFragmentIon) ion);
fragmentIonNumber = fragmentIon.getNumber();
} else if (ionType == Ion.IonType.TAG_FRAGMENT_ION) {
TagFragmentIon tagFragmentIon = ((TagFragmentIon) ion);
fragmentIonNumber = tagFragmentIon.getNumber();
} else {
fragmentIonNumber = 0;
}
String neutralLossesAsString = ion.getNeutralLossesAsString();
HashMap<Integer, HashMap<Integer, HashMap<String, HashMap<Integer, String>>>> ionTypeMap = ionKeysCache.get(ionTypeIndex);
if (ionTypeMap == null) {
ionTypeMap = new HashMap<Integer, HashMap<Integer, HashMap<String, HashMap<Integer, String>>>>(8);
ionKeysCache.put(ionTypeIndex, ionTypeMap);
}
HashMap<Integer, HashMap<String, HashMap<Integer, String>>> ionSubTypeMap = ionTypeMap.get(ionSubType);
if (ionSubTypeMap == null) {
ionSubTypeMap = new HashMap<Integer, HashMap<String, HashMap<Integer, String>>>(2);
ionTypeMap.put(ionSubType, ionSubTypeMap);
}
HashMap<String, HashMap<Integer, String>> ionNumberMap = ionSubTypeMap.get(fragmentIonNumber);
if (ionNumberMap == null) {
ionNumberMap = new HashMap<String, HashMap<Integer, String>>(8);
ionSubTypeMap.put(fragmentIonNumber, ionNumberMap);
}
HashMap<Integer, String> ionNeutralLossesMap = ionNumberMap.get(neutralLossesAsString);
if (ionNeutralLossesMap == null) {
ionNeutralLossesMap = new HashMap<Integer, String>(4);
ionNumberMap.put(neutralLossesAsString, ionNeutralLossesMap);
}
String key = ionNeutralLossesMap.get(charge);
if (key == null) {
key = IonMatch.getMatchKey(ionTypeIndex, ionSubType, fragmentIonNumber, neutralLossesAsString, charge);
ionNeutralLossesMap.put(charge, key);
}
return key;
}