美文网首页
R package:xcms(一):导入数据

R package:xcms(一):导入数据

作者: 佳名 | 来源:发表于2021-10-25 11:29 被阅读0次

    导入所需要的包

    library(xcms)
    library(pheatmap)
    library(RColorBrewer)
    

    多组数据的导入

    myfiles <- list.files(pattern = "^neg")
    myfiles
    pd <- data.frame(sample_name = sub(basename(myfiles), pattern = ".mzML",replacement = "", 
                                       fixed = TRUE),sample_group = c(rep("FA", 4), rep("HFD", 4)),stringsAsFactors = FALSE)
    pd
    raw_data <- readMSData(files = myfiles, pdata = new("NAnnotatedDataFrame", pd),mode = "onDisk")
    

    单个数据的导入

    dda_data <- readMSData("neg_20211-fa-68.mzML", mode = "onDisk",centroided = FALSE)
    

    提取基峰色谱图

    bpis <- chromatogram(raw_data, aggregationFun = "max")
    #定义两组颜色
    group_colors <- c("blue","red")
    names(group_colors) <- c("FA","HFD")
    ## 绘制所有色谱图
    plot(bpis, col = group_colors[raw_data$sample_group])
    
    BPC.png
    参考资料:
    LCMS data preprocessing and analysis with xcms (bioconductor.org)

    相关文章

      网友评论

          本文标题:R package:xcms(一):导入数据

          本文链接:https://www.haomeiwen.com/subject/gqmjaltx.html