exposure_dat <- ld_clump_local( + dat = df1, + clump_kb = 500, + clump_r2 = 0.2, + clump_p = 1e-5, + bfile = "D:/R-language/MR代码/课题组数据/g1000_eas", + plink_bin = "D:/R-language/R-4.2.2/library/plinkbinr/bin/plink_Windows.exe" + ) PLINK v1.90b6.10 64-bit (17 Jun 2019) www.cog-genomics.org/plink/1.9/ (C) 2005-2019 Shaun Purcell, Christopher Chang GNU General Public License v3 Logging to C:\Users\86131\AppData\Local\Temp\Rtmp8kX5Lf\file3e5474b5111.log. Options in effect: --bfile D:/R-language/MR����/����������/g1000_eas --clump C:\Users\86131\AppData\Local\Temp\Rtmp8kX5Lf\file3e5474b5111 --clump-kb 500 --clump-p1 1e-05 --clump-r2 0.2 --out C:\Users\86131\AppData\Local\Temp\Rtmp8kX5Lf\file3e5474b5111 14188 MB RAM detected; reserving 7094 MB for main workspace. Allocated 5320 MB successfully, after larger attempt(s) failed. Error: Failed to open D:/R-language/MR����/����������/g1000_eas.bed. Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'C:\Users\86131\AppData\Local\Temp\Rtmp8kX5Lf\file3e5474b5111.clumped': No such file or directory
时间: 2023-10-15 20:07:09 浏览: 556
It seems like there is an error in the code related to file paths. Specifically, the error message says that the program failed to open the file "D:/R-language/MR����/����������/g1000_eas.bed". This could be due to incorrect file path or missing file. Additionally, there is a warning message that says "cannot open file 'C:\Users\86131\AppData\Local\Temp\Rtmp8kX5Lf\file3e5474b5111.clumped': No such file or directory". This could be due to the program not finding the output file at the specified location.
相关问题
asm_exp_dat <- extract_instruments(outcomes = 'ebi-a-GCST90014325') asm <- extract_instruments(outcomes = 'ebi-a-GCST90014325', clump = TRUE, r2 = 0.001, kb = 10000, access_token = NULL) #如果想要调整P值 asm_1 <- extract_instruments(outcomes = 'ebi-a-GCST90014325', p1 = 5e-08, clump = TRUE, r2 = 0.001, kb = 10000, access_token = NULL)bca_out <- extract_outcome_data( snps=data$SNP, outcomes='ieu-a-1127', proxies = FALSE, maf_threshold = 0.01, access_token = NULL ) mydata <- harmonise_data( exposure_dat=asm_1, outcome_dat=bca_out, action= 3 )Error in data$SNP : object of type 'closure' is not subsettable >我该如何修改?正确的代码是?
根据代码,你是想从 `data` 中提取 `SNP` 列,但是出现了错误。这个错误的原因可能是 `data` 不是一个数据框或数据表,而是一个函数。因此,你需要先执行 `data()` 函数,将数据加载到内存中,然后再提取 `SNP` 列。
修改后的代码如下:
```
data() # 加载数据
bca_out <- extract_outcome_data(
snps = mydata$SNP, # 提取 mydata 数据框的 SNP 列
outcomes = 'ieu-a-1127',
proxies = FALSE,
maf_threshold = 0.01,
access_token = NULL
)
```
另外,你在上面的代码中使用了 `asm_1` 数据框,但是它没有在代码中定义。如果需要使用 `asm_1` 数据框,请先定义并赋值。
bmi_exp_dat_clumped<-read_exposure_data(filename = bmi,sep = ",",snp_col = "ID",p_col = "p",se_col = "SE",effect_allele_col = "alt",other_allele_col = "ref",clump = TRUE)
这行代码的作用是读取一个名为 "bmi" 的数据文件,其中包含SNP ID、p值、SE、效应等位基因和其它等位基因等信息,并进行数据聚类(clump),生成一个新的数据集 "bmi_exp_dat_clumped"。其中,参数 "sep" 表示数据文件中列之间的分隔符为逗号(","),"snp_col" 表示SNP ID所在的列,"p_col" 表示p值所在的列,"se_col" 表示SE所在的列,"effect_allele_col" 表示效应等位基因所在的列,"other_allele_col" 表示另一等位基因所在的列。
阅读全文