sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
180 stars 80 forks source link

I am a novice, could you please explain why this code is wrong?Why is the error reported?17852824720@163.com #538

Closed xtr1222 closed 3 years ago

xtr1222 commented 3 years ago

`> library(xcms)

library(faahKO) library(RColorBrewer) library(pander) library(magrittr) library(pheatmap) library(SummarizedExperiment) cdfs <- dir(system.file("cdf", package = "faahKO"), full.names = TRUE,

  • recursive = TRUE)[c(1, 2, 5, 6, 7, 8, 11, 12)] pd <- data.frame(sample_name = sub(basename(cdfs), pattern = ".CDF",
  • replacement = "", fixed = TRUE),
  • sample_group = c(rep("KO",4), rep("WT", 4)),
  • stringsAsFactors = FALSE) raw_data <- readMSData(files = cdfs, pdata = new("NAnnotatedDataFrame", pd),
  • mode = "onDisk") Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method. raw_data <- filterRt(raw_data, c(2500, 3500)) head(rtime(raw_data)) F1.S0001 F1.S0002 F1.S0003 F1.S0004 F1.S0005 F1.S0006 2501.378 2502.943 2504.508 2506.073 2507.638 2509.203 mzs <- mz(raw_data) Warning messages: 1: In serialize(data, node$con) : 载入时'package:stats'可能无用 2: In serialize(data, node$con) : 载入时'package:stats'可能无用 mzs_by_file <- split(mzs, f = fromFile(raw_data)) length(mzs_by_file) [1] 8 bpis <- chromatogram(raw_data, aggregationFun = "max")

group_colors error:not found 'group_colors' names(group_colors) <- c("KO", "WT") Error in names(group_colors) <- c("KO", "WT") : 找不到对象'group_colors' plot(bpis, col = group_colors[raw_data$sample_group]) Error in .plotChromatogramList(x[i, , drop = TRUE], col = col, lty = lty, : error:not found 'group_colors'`

jorainer commented 3 years ago

Please have a look at issue #537 - the answer is given there.

I'm closing this issue now, feel free to reopen if needed.