weixin_50883715 2024-03-25 00:42 采纳率: 0%
浏览 153

Error in eval(expr, p) : 找不到对象'exposure_dat_clumped,如何解决?(标签-MR|关键词-Sam)

Error in eval(expr, p) : 找不到对象'exposure_dat_clumped'

生信自学网的代码,没有自己改

> #引用包
> library(TwoSampleMR)
TwoSampleMR version 0.5.10 
[>] New: Option to use non-European LD reference panels for clumping etc
[>] Some studies temporarily quarantined to verify effect allele
[>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further details

> 
> exposureFile="exposure.pvalue.csv"     #输入文件
> setwd("E:\\zhuomian\\lianxi2\\175.MendelianDmseo888\\05.LD")      #设置工作目录
> 
> #读取输入文件
> exposure_dat<-read_exposure_data(filename=exposureFile,
+                                  sep = ",",
+                                  snp_col = "SNP",
+                                  beta_col = "beta.exposure",
+                                  se_col = "se.exposure",
+                                  effect_allele_col = "effect_allele.exposure",
+                                  other_allele_col = "other_allele.exposure",
+                                  eaf_col = "eaf.exposure",
+                                  samplesize_col = "samplesize.exposure",
+                                  clump = F)
No phenotype name specified, defaulting to 'exposure'.
Inferring p-values
> 
> #去除连锁不平衡的SNP
> exposure_dat_clumped <- clump_data(exposure_dat, clump_kb=10000, clump_r2=0.001)
API: public: http://gwas-api.mrcieu.ac.uk/
Please look at vignettes for options on running this locally if you need to run many instances of this command.
Clumping Z7TQ9n, 16301 variants, using EUR population reference
No encoding supplied: defaulting to UTF-8.
Error in mtfrm.default(list(url = "https://api.opengwas.io/api/ld/clump",  : 
  cannot mtfrm
> write.csv(exposure_dat_clumped, file="exposure.LD.csv", row.names=F)


  • 写回答

4条回答 默认 最新

  • 码农阿豪@新空间代码工作室 Java领域优质创作者 2024-03-25 00:42
    关注
    让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如果还有疑问可以评论或留言
    问题:为什么会出现 "Error in eval(expr, p) : 找不到对象'exposure_dat_clumped'" 的错误? 回答:这个错误表示在代码中的某个地方使用了对象 'exposure_dat_clumped',但是该对象并不存在或者没有被正确定义。在这段代码中,'exposure_dat_clumped' 是通过 clump_data 函数创建的一个对象,但是在对该对象进行操作时出现了错误。可能的原因有:
    1. 在 clump_data 函数调用时出现了问题,没有正确地创建 exposure_dat_clumped 对象;
    2. exposure_dat_clumped 对象不存在或者被删除;
    3. exposure_dat_clumped 对象被不正确地复制或者移动,导致在后续代码中无法找到它。 为了解决这个问题,可以尝试检查创建 exposure_dat_clumped 对象的代码,确保它正确地创建了该对象。如果对象已经存在,可以检查它的变量名是否正确拼写,并确认它所存在的作用域是否适合后续的操作。如果对象已经被删除或者复制,可以尝试重新创建它或者修改后续的代码,以便正确地引用它。在排查问题时,可以使用 print 函数输出一些调试信息,帮助确定问题出现的位置。例如,在代码中添加如下语句:
    print(exposure_dat_clumped)
    

    这会输出 exposure_dat_clumped 的内容,帮助检查是否存在问题。

    评论

报告相同问题?

问题事件

  • 创建了问题 3月25日

悬赏问题

  • ¥15 AnolisOs7.9如何安装 Qt_5.14.2的运行库
  • ¥20 求:怎么实现qt与pcie通信
  • ¥50 前后端数据顺序不一致问题,如何解决?(相关搜索:数据结构)
  • ¥15 基于蒙特卡罗法的中介效应点估计代码
  • ¥15 罗技G293和UE5.3
  • ¥20 Tesla 特斯拉K80显卡 如果需要使用该设备,你需要禁用系统上的另一个设备。
  • ¥30 QT调用百度智能云千帆模型无法取得返回文本
  • ¥50 CCD工业视觉相机检测出现光边
  • ¥60 二次元手游日常任务自动化代肝(相关搜索:自动化)
  • ¥15 mysql将查询的结果作为动态列名怎么实现