您好,欢迎访问三七文档
2Dataimport3Initialdatainspection4Chromatographicpeakdetection5Alignment6Correspondence7Furtherdataprocessingandanalysis8AdditionaldetailsandnotesReferences12LCMSdatapreprocessingandanalysiswithxcms30October2017Packagexcms3.0.0Package:xcms()Authors:JohannesRainerModified:2017-10-3017:18:20Compiled:MonOct3018:41:112017IntroductionThisdocumentsdescribesdataimport,exploration,preprocessingandanalysisofLCMSexperimentswithxcmsversion=3.TheexamplesandbasicworkflowwasadaptedfromtheoriginalLC/MSPreprocessingandAnalysiswithxcmsvignettefromColinA.Smith.DataimportxcmssupportsanalysisofLC/MSdatafromfilesin(AIA/ANDI)NetCDF,mzML/mzXMLandmzDataformat.FortheactualdataimportBioconductor’sSRC_R[:exportsboth]{Biocpkg(“mzR”)}isused.Fordemonstrationpurposewewillanalyzeasubsetofthedatafrom[1]inwhichthemetabolicconsequencesofknockingoutthefattyacidamidehydrolase(FAAH)geneinmicewasinvestigated.Therawdatafiles(inNetCDFformat)areprovidedwiththefaahKOdatapackage.Thedatasetconsistsofsamplesfromthespinalcordsof6knock-outand6wild-typemice.Eachfilecontainsdataincentroidmodeacquiredinpositiveionmodeform200-600m/zand2500-4500seconds.Belowweloadallrequiredpackages,locatetherawCDFfileswithinthefaahKOpackageandbuildaphenodatadataframedescribingtheexperimentalsetup.1Introduction3library(xcms)library(faahKO)library(RColorBrewer)library(pander)##GetthefullpathtotheCDFfilescdfs-dir(system.file(cdf,package=faahKO),full.names=TRUE,recursive=TRUE)##Createaphenodatadata.framepd-data.frame(sample_name=sub(basename(cdfs),pattern=.CDF,replacement=,fixed=TRUE),sample_group=c(rep(KO,6),rep(WT,6)),stringsAsFactors=FALSE)SubsequentlyweloadtherawdataasanOnDiskMSnExpobjectusingthereadMSDatamethodfromtheMSnbasepackage.WhiletheMSnbasepackagewasoriginallydevelopedforproteomicsdataprocessing,manyofitsfunctionality,includingrawdataimportanddatarepresentation,canbesharedandreusedinmetabolomicsdataanalysis.raw_data-readMSData(files=cdfs,pdata=new(NAnnotatedDataFrame,pd),mode=onDisk)TheOnDiskMSnExpobjectcontainsgeneralinformationaboutthenumberofspectra,retentiontimes,themeasuredtotalioncurrentetc,butdoesnotcontainthefullrawdata(i.e.them/zandintensityvaluesfromeachmeasuredspectrum).Itsmemoryfootprintisthusrathersmallmakingitanidealobjecttorepresentlargemetabolomicsexperimentswhilestillallowingtoperformsimplequalitycontrols,datainspectionandexplorationaswellasdatasub-settingoperations.Them/zandintensityvaluesareimportedfromtherawdatafilesondemand,hencethelocationoftherawdatafilesshouldnotbechangedafterinitialdataimport.InitialdatainspectionTheOnDiskMSnExporganizestheMSdatabyspectrumandprovidesthemethodsintensity,mzandrtimetoaccesstherawdatafromthefiles(themeasuredintensityvalues,thecorrespondingm/zandretentiontimevalues).Inaddition,thespectramethodcouldbeusedtoreturnalldataencapsulatedinSpectrumclasses.Belowweextracttheretentiontimevaluesfromtheobject.head(rtime(raw_data))##F01.S0001F01.S0002F01.S0003F01.S0004F01.S0005F01.S0006##2501.3782502.9432504.5082506.0732507.6382509.203Alldataisreturnedasone-dimensionalvectors(anumericvectorforrtimeandalistofnumericvectorsformzandintensity,eachcontainingthevaluesfromonespectrum),eveniftheexperimentconsistsofmultiplefiles/samples.ThefromFilefunctionreturnsanumericvectorthatprovidesthemappingofthevaluestotheoriginatingfile.BelowweusethefromFileindicestoorganizethemzvaluesbyfile.mzs-mz(raw_data)##Splitthelistbyfilemzs_by_file-split(mzs,f=fromFile(raw_data))length(mzs_by_file)##[1]12Asafirstevaluationofthedataweplotbelowthebasepeakchromatogram(BPC)foreachfileinourexperiment.WeusethechromatogrammethodandsettheaggregationFuntomaxtoreturnforeachspectrumthemaximalintensityandhencecreatetheBPCfromtherawdata.TocreateatotalionchromatogramwecouldsetaggregationFuntosum.##Getthebasepeakchromatograms.Thisreadsdatafromthefiles.bpis-chromatogram(raw_data,aggregationFun=max)##Definecolorsforthetwogroupsgroup_colors-brewer.pal(3,Set1)[1:2]names(group_colors)-c(KO,WT)##Plotallchromatograms.plot(bpis,col=group_colors[raw_data$sample_group])ThechromatogrammethodreturnedaChromatogramsobjectthatorganizesindividualChromatogramobjects(whichinfactcontainthechromatographicdata)inatwo-dimensionalarray:columnsrepresentsamplesandrows(optionally)m/zand/orretentiontimeranges.Belowweextractthechromatogramofthefirstsampleandaccessitsretentiontimeandintensityvalues.bpi_1-bpis[1,1]head(rtime(bpi_1))##F01.S0001F01.S0002F01.S0003F01.S0004F01.S0005F01.S0006##2501.3782502.9432504.5082506.0732507.6382509.203head(intensity(bpi_1))##F01.S0001F01.S0002F01.S0003F01.S0004F01.S0005F01.S0006##438884396043392426324220042288Thechromatogrammethodsupportsalsoextractionofchromatographicdatafromam/z-rtsliceoftheMSdata.Inthenextsectionwewillusethismethodtocreateanextractedionchromatogram(EIC)foraselectedpeak.Notethatchromatogramreadstherawdatafromeachfiletocalculatethechromatogram.Thebpiandticmethodsontheotherhanddonotreadanydatafromtherawfilesbutusetherespectiveinformationthatwasprovidedintheheaderdefinitionoftheinputfiles.Belowwecreate
本文标题:LCMS-data-preprocessing-and-analysis-with-xcms
链接地址:https://www.777doc.com/doc-6139834 .html