本文整理匯總了Java中org.systemsbiology.jrap.stax.ScanHeader類的典型用法代碼示例。如果您正苦於以下問題:Java ScanHeader類的具體用法?Java ScanHeader怎麽用?Java ScanHeader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ScanHeader類屬於org.systemsbiology.jrap.stax包,在下文中一共展示了ScanHeader類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRetentionTime
import org.systemsbiology.jrap.stax.ScanHeader; //導入依賴的package包/類
private BigDecimal getRetentionTime(ScanHeader header) {
// In the schema, retentionTime is "xs:duration"
// http://www.w3schools.com/Schema/schema_dtypes_date.asp
String rt = header.getRetentionTime();
if(rt == null) return null;
rt = rt.trim();
Matcher m = rtPattern.matcher(rt);
if(m.matches()) {
String time = m.group(1);
if(time != null) {
return new BigDecimal(time);
}
}
return null;
}
示例2: getRetentionTime
import org.systemsbiology.jrap.stax.ScanHeader; //導入依賴的package包/類
/**
* @param header
* @return
*/
private BigDecimal getRetentionTime(ScanHeader header) {
// In the schema, retentionTime is "xs:duration"
// http://www.w3schools.com/Schema/schema_dtypes_date.asp
String rt = header.getRetentionTime();
if(rt == null) return null;
rt = rt.trim();
Matcher m = rtPattern.matcher(rt);
if(m.matches()) {
String time = m.group(1);
if(time != null) {
return new BigDecimal(time);
}
}
return null;
}
示例3: getNextScan
import org.systemsbiology.jrap.stax.ScanHeader; //導入依賴的package包/類
@Override
public MsScanIn getNextScan() throws DataProviderException {
if(numScansRead >= numScans)
return null;
Scan scan = null;
if(parser.hasNextScan()) {
try {
scan = parser.getNextScan();
}
catch (XMLStreamException e) {
throw new DataProviderException("Error reading scan.", e);
}
}
if(scan == null)
return null;
ScanHeader header = scan.getHeader();
MzXmlScan mScan = new MzXmlScan();
mScan.setMsLevel(header.getMsLevel());
mScan.setStartScanNum(header.getNum());
mScan.setEndScanNum(header.getNum());
if(header.getMsLevel() == 1) {
this.lastMs1ScanNumber = mScan.getStartScanNum();
}
else if(header.getMsLevel() > 1) {
if(header.getPrecursorScanNum() > 0) {
if(header.getPrecursorScanNum() != this.lastMs1ScanNumber) {
throw new DataProviderException("last MS1 scan: "+this.lastMs1ScanNumber+
" is not the same as precursor scan number: "+header.getPrecursorScanNum()+
" for scan: "+header.getNum());
}
mScan.setPrecursorScanNum(header.getPrecursorScanNum());
}
else {
mScan.setPrecursorScanNum(this.lastMs1ScanNumber);
}
mScan.setPrecursorMz(new BigDecimal(header.getPrecursorMz()));
}
mScan.setRetentionTime(getRetentionTime(header));
if(header.getCentroided() != -1)
mScan.setDataConversionType(getDataConversionType(header.getCentroided()));
else
mScan.setDataConversionType(this.dataConvType);
mScan.setPeakCount(header.getPeaksCount());
double[][] mzInt = scan.getMassIntensityList();
// Peak 0 mass = list[0][0], peak 0 intensity = list[1][0]
// Peak 1 mass = list[0][1], peak 1 intensity = list[1][1]
for(int i = 0; i < header.getPeaksCount(); i++) {
double mz = mzInt[0][i];
double intensity = mzInt[1][i];
mScan.addPeak(mz, (float)intensity);
}
return mScan;
}
示例4: MSScan
import org.systemsbiology.jrap.stax.ScanHeader; //導入依賴的package包/類
public MSScan(ScanHeader s)
{
_scan = s;
}