如何解决MetaboAnalystR 中的 2D PCA 得分图问题
我无法从我的 mSet 对象获取 2D PCA 得分图。到目前为止,这是我的代码(我正在处理示例数据集并遵循小插图中给出的代码。
mSet <- InitDataObjects("mspeak","stat",FALSE)
# Unzips the uploaded zip file/s,removes it and saves it as "upload"
UnzipUploadedFile("lcms_3col_peaks.zip","upload",F)
# Read peak lists/intensity files
(mSet <- Read.PeakList(mSet,"upload"))
##################################################################################
########################### Data Preprocessing ###################################
##################################################################################
### Peaks in NMR or MS peak lists that represent the same metabolite need to be combined
mSet <- GroupPeakList(mSet,0.025,30.0)
# clean peak groups
(mSet <- SetPeakList.GroupValues(mSet))
# View message resulting from peak grouping
mSet$dataSet$proc.msg
### Integrity Check: Is data suitable for subsequent analsysis
mSet <- SanityCheckData(mSet)
# to view any messages from sanity check:
mSet$dataSet$check.msg
#######################################################################################
########################## Data Processing ############################################
########################################################################################
########## Remove missing values
### Replace missing/zero values with a minimum positive value (can be perfomed before or after normalization)
mSet <- ReplaceMin(mSet)
# View messages collected during ReplaceMin()
mSet$msgSet$replace.msg
# Check if the sample size is too small (returns a 0 if the data passes the check)
mSet<-IsSmallSmplSize(mSet)
######### Nomalise
###Perform log transformation
mSet<-PreparePrenormData(mSet)
mSet <- Normalization(mSet,rowNorm = "NULL",transNorm = "LogNorm",scaleNorm = "AutoNorm",ref="NULL",ratio=FALSE,ratioNum=20)
# View feature normalization (sends these to working directory)
mSet<-PlotNormSummary(mSet,"feature_norm",format="png",dpi=300,width=0)
# View sample normalization
mSet<-PlotSampleNormSummary(mSet,"sample_norm",format="pdf",width=NA)
######### Filter
# 3 components of the FilterVariable function
(mSet <- FilterVariable(mSetObj = mSet,filter = "mad",# user specified method for filtering (median absolute deviaton)
qcFilter = F,# Filter variables based on QC samples (if true then filter = "none")
rsd = 30)) # Define relative standard deviation cut off (variables greater then this removed)
### Remove samples
# Check for outliers
PlotPCA2DScore(mSetObj = mSet,imgName = "2D PCA score plot",format = "png",dpi = 300,width = 0,pcx = 1,pcy = 2,reg = 0.95,show = 1,grey.scale = 0)
我出现了以下错误,但我不确定它是什么意思:
Error in var(cbind(pc1[inx],pc2[inx]),na.rm = T) : 'x' is NULL
有人可以帮我解决这个问题吗?谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。