當前位置: 首頁>>代碼示例>>Java>>正文


Java ScanHeader類代碼示例

本文整理匯總了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;
}
 
開發者ID:yeastrc,項目名稱:msdapl,代碼行數:17,代碼來源:MzXmlFileReader.java

示例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;
}
 
開發者ID:yeastrc,項目名稱:proxl-web-app,代碼行數:21,代碼來源:MzMl_MzXml_FileReader.java

示例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;
}
 
開發者ID:yeastrc,項目名稱:msdapl,代碼行數:58,代碼來源:MzXmlFileReader.java

示例4: MSScan

import org.systemsbiology.jrap.stax.ScanHeader; //導入依賴的package包/類
public MSScan(ScanHeader s)
{
    _scan = s;
}
 
開發者ID:dhmay,項目名稱:msInspect,代碼行數:5,代碼來源:MSRun.java


注:本文中的org.systemsbiology.jrap.stax.ScanHeader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。