> library(tidyverse) > library(maSigPro) > setwd("D:/ANorth/muilt/呼吸多组学-陈宵/Analy...

2025年09月06日 21:25 响应: 3.03秒 状态: success

🚨 错误信息

> library(tidyverse) > library(maSigPro) > setwd("D:/ANorth/muilt/呼吸多组学-陈宵/Analysis-lym/1.单组学分析/转录组/4时序分析") > > ## 1. 读入推文格式数据 --------------------------------------------------------- > counts <- read_csv("geneMatrix_Control_normalized_log2cpm.csv") %>% + column_to_rownames("symble") %>% as.matrix() Rows: 13692 Columns: 13 ── Column specification ────────────────────────────────────────────────────────────────────────────── Delimiter: "," chr (1): symble dbl (12): 6hC1, 6hC2, 6hC3, 24hC1, 24hC2, 24hC3, 72hC1, 72hC2, 72hC3, 120hC1, 120hC2, 120hC3 ℹ Use `spec()` to retrieve the full column specification for this data. ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. > > ## 2. 构建推文同款 design(time + replicate_factor) > meta <- read_csv("meta_Control.csv") %>% arrange(sample) Rows: 12 Columns: 4 ── Column specification ────────────────────────────────────────────────────────────────────────────── Delimiter: "," chr (2): sample, group dbl (2): time, replicate ℹ Use `spec()` to retrieve the full column specification for this data. ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. > design <- data.frame( + time = meta$time, + replicate = factor(meta$replicate) + ) > rownames(design) <- meta$sample > > ## 3. 严格对齐列顺序(推文没写,但必须) > counts <- counts[, meta$sample] > > ## 4. 推文两步回归 ------------------------------------------------------------- > fit <- p.vector(counts, design, Q = 0.05, "gaussian") [1] "fitting gene 100 out of 13692" [1] "fitting gene 200 out of 13692" [1] "fitting gene 300 out of 13692" [1] "fitting gene 400 out of 13692" [1] "fitting gene 500 out of 13692" [1] "fitting gene 600 out of 13692" [1] "fitting gene 700 out of 13692" [1] "fitting gene 800 out of 13692" [1] "fitting gene 900 out of 13692" [1] "fitting gene 1000 out of 13692" [1] "fitting gene 1100 out of 13692" [1] "fitting gene 1200 out of 13692" [1] "fitting gene 1300 out of 13692" [1] "fitting gene 1400 out of 13692" [1] "fitting gene 1500 out of 13692" [1] "fitting gene 1600 out of 13692" [1] "fitting gene 1700 out of 13692" [1] "fitting gene 1800 out of 13692" [1] "fitting gene 1900 out of 13692" [1] "fitting gene 2000 out of 13692" [1] "fitting gene 2100 out of 13692" [1] "fitting gene 2200 out of 13692" [1] "fitting gene 2300 out of 13692" [1] "fitting gene 2400 out of 13692" [1] "fitting gene 2500 out of 13692" [1] "fitting gene 2600 out of 13692" [1] "fitting gene 2700 out of 13692" [1] "fitting gene 2800 out of 13692" [1] "fitting gene 2900 out of 13692" [1] "fitting gene 3000 out of 13692" [1] "fitting gene 3100 out of 13692" [1] "fitting gene 3200 out of 13692" [1] "fitting gene 3300 out of 13692" [1] "fitting gene 3400 out of 13692" [1] "fitting gene 3500 out of 13692" [1] "fitting gene 3600 out of 13692" [1] "fitting gene 3700 out of 13692" [1] "fitting gene 3800 out of 13692" [1] "fitting gene 3900 out of 13692" [1] "fitting gene 4000 out of 13692" [1] "fitting gene 4100 out of 13692" [1] "fitting gene 4200 out of 13692" [1] "fitting gene 4300 out of 13692" [1] "fitting gene 4400 out of 13692" [1] "fitting gene 4500 out of 13692" [1] "fitting gene 4600 out of 13692" [1] "fitting gene 4700 out of 13692" [1] "fitting gene 4800 out of 13692" [1] "fitting gene 4900 out of 13692" [1] "fitting gene 5000 out of 13692" [1] "fitting gene 5100 out of 13692" [1] "fitting gene 5200 out of 13692" [1] "fitting gene 5300 out of 13692" [1] "fitting gene 5400 out of 13692" [1] "fitting gene 5500 out of 13692" [1] "fitting gene 5600 out of 13692" [1] "fitting gene 5700 out of 13692" [1] "fitting gene 5800 out of 13692" [1] "fitting gene 5900 out of 13692" [1] "fitting gene 6000 out of 13692" [1] "fitting gene 6100 out of 13692" [1] "fitting gene 6200 out of 13692" [1] "fitting gene 6300 out of 13692" [1] "fitting gene 6400 out of 13692" [1] "fitting gene 6500 out of 13692" [1] "fitting gene 6600 out of 13692" [1] "fitting gene 6700 out of 13692" [1] "fitting gene 6800 out of 13692" [1] "fitting gene 6900 out of 13692" [1] "fitting gene 7000 out of 13692" [1] "fitting gene 7100 out of 13692" [1] "fitting gene 7200 out of 13692" [1] "fitting gene 7300 out of 13692" [1] "fitting gene 7400 out of 13692" [1] "fitting gene 7500 out of 13692" [1] "fitting gene 7600 out of 13692" [1] "fitting gene 7700 out of 13692" [1] "fitting gene 7800 out of 13692" [1] "fitting gene 7900 out of 13692" [1] "fitting gene 8000 out of 13692" [1] "fitting gene 8100 out of 13692" [1] "fitting gene 8200 out of 13692" [1] "fitting gene 8300 out of 13692" [1] "fitting gene 8400 out of 13692" [1] "fitting gene 8500 out of 13692" [1] "fitting gene 8600 out of 13692" [1] "fitting gene 8700 out of 13692" [1] "fitting gene 8800 out of 13692" [1] "fitting gene 8900 out of 13692" [1] "fitting gene 9000 out of 13692" [1] "fitting gene 9100 out of 13692" [1] "fitting gene 9200 out of 13692" [1] "fitting gene 9300 out of 13692" [1] "fitting gene 9400 out of 13692" [1] "fitting gene 9500 out of 13692" [1] "fitting gene 9600 out of 13692" [1] "fitting gene 9700 out of 13692" [1] "fitting gene 9800 out of 13692" [1] "fitting gene 9900 out of 13692" [1] "fitting gene 10000 out of 13692" [1] "fitting gene 10100 out of 13692" [1] "fitting gene 10200 out of 13692" [1] "fitting gene 10300 out of 13692" [1] "fitting gene 10400 out of 13692" [1] "fitting gene 10500 out of 13692" [1] "fitting gene 10600 out of 13692" [1] "fitting gene 10700 out of 13692" [1] "fitting gene 10800 out of 13692" [1] "fitting gene 10900 out of 13692" [1] "fitting gene 11000 out of 13692" [1] "fitting gene 11100 out of 13692" [1] "fitting gene 11200 out of 13692" [1] "fitting gene 11300 out of 13692" [1] "fitting gene 11400 out of 13692" [1] "fitting gene 11500 out of 13692" [1] "fitting gene 11600 out of 13692" [1] "fitting gene 11700 out of 13692" [1] "fitting gene 11800 out of 13692" [1] "fitting gene 11900 out of 13692" [1] "fitting gene 12000 out of 13692" [1] "fitting gene 12100 out of 13692" [1] "fitting gene 12200 out of 13692" [1] "fitting gene 12300 out of 13692" [1] "fitting gene 12400 out of 13692" [1] "fitting gene 12500 out of 13692" [1] "fitting gene 12600 out of 13692" [1] "fitting gene 12700 out of 13692" [1] "fitting gene 12800 out of 13692" [1] "fitting gene 12900 out of 13692" [1] "fitting gene 13000 out of 13692" [1] "fitting gene 13100 out of 13692" [1] "fitting gene 13200 out of 13692" [1] "fitting gene 13300 out of 13692" [1] "fitting gene 13400 out of 13692" [1] "fitting gene 13500 out of 13692" [1] "fitting gene 13600 out of 13692" 错误于match.arg(method): 'arg' should be one of “holm”, “hochberg”, “hommel”, “bonferroni”, “BH”, “BY”, “fdr”, “none”

🤖 AI解决方案

错误于match.arg(method): 
  'arg' should be one of “holm”, “hochberg”, “hommel”, “bonferroni”, “BH”, “BY”, “fdr”, “none”

  • 错误翻译:
  •     Error in match.arg(method): 
          'arg' should be one of “holm”, “hochberg”, “hommel”, “bonferroni”, “BH”, “BY”, “fdr”, “none”
        
    "错误发生在 match.arg(method): 参数 arg 应该为下列值之一:“holm”, “hochberg”, “hommel”, “bonferroni”, “BH”, “BY”, “fdr”, “none”"

  • 原因分析:

  • p.vector 函数的 Q 参数不应直接传递为 "gaussian"Q 参数用于多重检验校正方法,而 "gaussian" 是分布类型,不属于允许的校正方法之一。

  • 解决方案:

  • p.vector 函数的调用修改为:
        # 假设您想使用 BH 校正方法,Q 参数通常是 p 值阈值,这里根据上下文推测为 0.05
        # 如果您没有设定 Q 的具体值,可以将其移除,函数会使用默认值
        # maSigPro 默认使用 BH 校正,因此如果您的目的是 BH 校正,可以省略 Q 参数
        fit <- p.vector(counts, design, Q = 0.05) 
        
        # 或者,如果您确实需要指定校正方法(尽管 p.vector 中 Q 是指 p-value threshold, 
        # maSigPro 的其他函数有 method 参数用于指定校正方法)
        # 但在 p.vector 中,Q 是一个数值(例如 0.05),不是方法名。
        # 如果您想直接指定方法,需要查看 maSigPro 的文档,但 p.vector 的参数是固定的。
        # 鉴于错误信息,最可能的问题是 Q 参数被错误地设置为 "gaussian"。
        

    请注意: p.vector 函数的 Q 参数是用于设置 P-value threshold(通常是 0.05 或 0.1),而不是校正方法。您传入的 "gaussian" 极有可能是误将分布类型传给了 Q 参数。maSigPro 默认会进行多重检验校正(如 BH 法),您无需在 p.vector 中指定方法。

  • 预防措施:

* 在调用函数前,仔细检查函数文档,确保所有参数都传递了正确的数据类型和值。
* 对于需要指定校正方法的函数,确认使用的校正方法名称是否在函数支持的列表中。