使用 MetaboDiff 的微分表达式

问题描述 投票:0回答:0

我的数据包含在 mydata.csv 文件中。

Sample   Metabolite1   Metabolite2   Metabolite3   Group
control1  1.2           0.8           1.5           A
control2  0.9           1.1           1.2           A
control3  1.5           1.2           1.8           B
s_treat1  0.7           0.9           1.3           B
s_treat2  1.1           1.3           0.9           A
s_treat3  1.0           0.7           1.4           B

library(MetaboDiff)

data <- read.csv("mydata.csv", header = TRUE)
# Extract the sample names (first column)
sample_names <- data[1, 2:ncol(data)]

metadata_cols <- grep("^N_", colnames(data), value = TRUE)
for (col in metadata_cols) {
   attributes(data[[col]]) <- NULL
}
cols <- c(2:(ncol(data) - 1), ncol(data))

met <- diff_test(data[, cols], group_factors = "Group")

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘metadata<-’ for signature ‘"data.frame"

我想找FC,log2FC, 我得到了错误。我该如何处理这个问题?

附注我的数据是通过LC-MS/MS技术获得的,数值是强度。

r bioinformatics
© www.soinside.com 2019 - 2024. All rights reserved.