R package:MAIT峰注释
2020-10-10 本文已影响0人
佳名
BiocManager::install("MAIT")
library(MAIT)
library(faahKO)
help(MAIT)
browseVignettes("xcms")
cdfFiles<-system.file("cdf", package="faahKO", mustWork=TRUE)
MAIT <- sampleProcessing(dataDir = cdfFiles, project = "MAIT_Demo",
snThres=2,rtStep=0.03)
snThres表示的是信噪比参数的设置,rtStep生成峰文件的步长
由于这里用的是示例数据,如果是自己的数据那么dataDir后接的就是自己设置的文件夹,project是自己要存放的结果文件的目录
MAIT
summary(MAIT)
# A MAIT object built of 12 samples
# The object contains 6 samples of class KO
# The object contains 6 samples of class WT
##注释峰
MAIT <- peakAnnotation(MAIT.object = MAIT,corrWithSamp = 0.7,
corrBetSamp = 0.75,perfwhm = 0.6)
MAIT <- peakAnnotation(MAIT.object = MAIT,corrWithSamp = 0.7,
adductTable = "negAdducts",
corrBetSamp = 0.75,perfwhm = 0.6)
?peakAnnotation
# corrWithSamp参数是样品内峰值的相关系数,corrBetSamp则是样品间的一个相关系数
# perfwhm参数是根据保留时间来区分两个峰值
rawData(MAIT) # 结果包括相关的峰、质谱图以及注释结果
MAIT<- spectralSigFeatures(MAIT.object = MAIT,pvalue=0.05,
p.adj="none",scale=FALSE)
# pvalue设置组间比较的阈值
# p.adjust选择p值校正方法
# scale是一个逻辑值,分析前是否要进行标度化
summary(MAIT) # 查看结果
# A MAIT object built of 12 samples and 1261 peaks. No peak aggregation technique has been applied
# 56 of these peaks are statistically significant
# The object contains 6 samples of class KO
# The object contains 6 samples of class WT
Biotransformations(MAIT.object = MAIT, peakPrecision = 0.005)
# peakPrecision参数用于设置实际的峰质量值和生物转换表差异的允许范围
data(MAITtables)
myBiotransformation<-c("custom_biotrans",105.0)
myBiotable<-biotransformationsTable
myBiotable[,1]<-as.character(myBiotable[,1])
myBiotable<-rbind(myBiotable,myBiotransformation)
myBiotable[,1]<-as.factor(myBiotable[,1])
tail(myBiotable) # 查看添加了新的加和物的生物转换表,只看最后几行
# NAME MASSDIFF
# 45 glucuronide conjugation 176.0321
# 46 hydroxylation + glucuronide 192.027
# 47 GSH conjugation 305.0682
# 48 2x glucuronide conjugation 352.0642
# 49 [C13] 1.0034
# 50 custom_biotrans 105
MAIT <- identifyMetabolites(MAIT.object = MAIT, peakTolerance = 0.005)
metTable<-metaboliteTable(MAIT)
head(metTable)
MAIT <- Validation(Iterations = 20, trainSamples= 3, MAIT.object = MAIT)
# Iterations设定迭代次数,trainSamples设置选择多样样品来做验证
summary(MAIT) # 查看结果
# A MAIT object built of 12 samples and 1261 peaks. No peak aggregation technique has been applied
# 56 of these peaks are statistically significant
# The object contains 6 samples of class KO
# The object contains 6 samples of class WT
# The Classification using 3 training samples and 20 Iterations gave the results:
# KNN PLSDA SVM
# mean 1 1 1
# standard error 0 0 0