本文整理汇总了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;
}