本文整理匯總了Java中uk.ac.ebi.jmzml.model.mzml.SelectedIonList類的典型用法代碼示例。如果您正苦於以下問題:Java SelectedIonList類的具體用法?Java SelectedIonList怎麽用?Java SelectedIonList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SelectedIonList類屬於uk.ac.ebi.jmzml.model.mzml包,在下文中一共展示了SelectedIonList類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: extractPrecursorMz
import uk.ac.ebi.jmzml.model.mzml.SelectedIonList; //導入依賴的package包/類
private double extractPrecursorMz(Spectrum spectrum) {
PrecursorList precursorListElement = spectrum.getPrecursorList();
if ((precursorListElement == null)
|| (precursorListElement.getCount().equals(0)))
return 0;
List<Precursor> precursorList = precursorListElement.getPrecursor();
for (Precursor parent : precursorList) {
SelectedIonList selectedIonListElement = parent
.getSelectedIonList();
if ((selectedIonListElement == null)
|| (selectedIonListElement.getCount().equals(0)))
return 0;
List<ParamGroup> selectedIonParams = selectedIonListElement
.getSelectedIon();
if (selectedIonParams == null)
continue;
for (ParamGroup pg : selectedIonParams) {
List<CVParam> pgCvParams = pg.getCvParam();
for (CVParam param : pgCvParams) {
String accession = param.getAccession();
String value = param.getValue();
if ((accession == null) || (value == null))
continue;
// MS:1000040 is used in mzML 1.0,
// MS:1000744 is used in mzML 1.1.0
if (accession.equals("MS:1000040")
|| accession.equals("MS:1000744")) {
double precursorMz = Double.parseDouble(value);
return precursorMz;
}
}
}
}
return 0;
}
示例2: extractPrecursorCharge
import uk.ac.ebi.jmzml.model.mzml.SelectedIonList; //導入依賴的package包/類
private int extractPrecursorCharge(Spectrum spectrum) {
PrecursorList precursorListElement = spectrum.getPrecursorList();
if ((precursorListElement == null)
|| (precursorListElement.getCount().equals(0)))
return 0;
List<Precursor> precursorList = precursorListElement.getPrecursor();
for (Precursor parent : precursorList) {
SelectedIonList selectedIonListElement = parent
.getSelectedIonList();
if ((selectedIonListElement == null)
|| (selectedIonListElement.getCount().equals(0)))
return 0;
List<ParamGroup> selectedIonParams = selectedIonListElement
.getSelectedIon();
if (selectedIonParams == null)
continue;
for (ParamGroup pg : selectedIonParams) {
List<CVParam> pgCvParams = pg.getCvParam();
for (CVParam param : pgCvParams) {
String accession = param.getAccession();
String value = param.getValue();
if ((accession == null) || (value == null))
continue;
if (accession.equals("MS:1000041")) {
int precursorCharge = Integer.parseInt(value);
return precursorCharge;
}
}
}
}
return 0;
}