簡體   English   中英

XCMS包 - 保留時間

[英]XCMS Package - Retention time

有沒有一種簡單的方法從xcmsRaw對象獲取保留時間列表/數組?

示例代碼:

xraw <- xcmsRaw(cdfFile) 

例如,從中獲取信息:

xraw@env$intensity 

要么

xraw@env$mz 

您可以在xcmsRaw實例中查看可用的插槽

> slotNames(xraw)
 [1] "env"                   "tic"                   "scantime"             
 [4] "scanindex"             "polarity"              "acquisitionNum"       
 [7] "profmethod"            "profparam"             "mzrange"              
[10] "gradient"              "msnScanindex"          "msnAcquisitionNum"    
[13] "msnPrecursorScan"      "msnLevel"              "msnRt"                
[16] "msnPrecursorMz"        "msnPrecursorIntensity" "msnPrecursorCharge"   
[19] "msnCollisionEnergy"    "filepath"

你想要的是xraw@msnRt - 它是一個numeric vector

env插槽是一個存儲3個變量的環境:

> ls(xraw@env)
[1] "intensity" "mz"        "profile"

關於班級本身的更多細節class?xcmsRaw

編輯:僅當您指定includeMSn = TRUE並且您的輸入文件必須是mzXMLmzML而不是cdf ,才會填充msnRt插槽。 如果您使用來自?xcmasRawfaahKO示例,您將看到它

xr <- xcmsRaw(cdffiles[1], includeMSn = TRUE)
Warning message:
In xcmsRaw(cdffiles[1], includeMSn = TRUE) :
  Reading of MSn spectra for NetCDF not supported

此外, xr@msnRt將僅存儲MSn掃描的保留時間, n > 1 看到xset@rt其中xsetxcmsSet對於在原始/校正MS1保留時間實例如通過提供xcms

編輯2:或者,使用mzR

> library(mzR)
> cdffiles[1]
[2] "/home/lgatto/R/x86_64-unknown-linux-gnu-library/2.16/faahKO/cdf/KO/ko15.CDF"
> xx <- openMSfile(cdffiles[1])
> xx
Mass Spectrometry file handle.
Filename:  /home/lgatto/R/x86_64-unknown-linux-gnu-library/2.16/faahKO/cdf/KO/ko15.CDF 
Number of scans:  1278 
> hd <- header(xx)
> names(hd)
 [1] "seqNum"                   "acquisitionNum"          
 [3] "msLevel"                  "peaksCount"              
 [5] "totIonCurrent"            "retentionTime"           
 [7] "basePeakMZ"               "basePeakIntensity"       
 [9] "collisionEnergy"          "ionisationEnergy"        
[11] "highMZ"                   "precursorScanNum"        
[13] "precursorMZ"              "precursorCharge"         
[15] "precursorIntensity"       "mergedScan"              
[17] "mergedResultScanNum"      "mergedResultStartScanNum"
[19] "mergedResultEndScanNum"  
> class(hd)
[1] "data.frame"
> dim(hd)
[1] 1278   19

但你會默認之外xcms管道,如果你走這條路(雖然斯特芬紐曼,從xcms ,不知道mzR非常好,oubviously)。

最后,如果您希望最大限度地從xcms開發人員那里獲得反饋的機會,您最好使用xcms在線論壇的Bioconductor 郵件列表

希望這可以幫助。

很好的答案,但我正在尋找這個:

xraw <- xcmsRaw(cdfFile)
dp_index <- which(duplicated(rawMat(xraw)[,1]))
xraw_rt_dp <- rawMat(xraw)[,1]
xrawData.rt <- xraw_rt_dp[-dp_index]

現在:

xrawData.rt #contains the retention time.

觀察 - >使用mzr包:

nc     <- mzR:::netCDFOpen(cdfFile)
ncData <- mzR:::netCDFRawData(nc)
mzR:::netCDFClose(nc)

ncData$rt #contains the same retention time for the same input !!!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM