choishingwan / PRSice

A software package for calculating, applying, evaluating and plotting the results of polygenic risk scores
http://prsice.info
GNU General Public License v3.0
187 stars 90 forks source link

[BUG] Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : #311

Closed Antonio-Nappi closed 1 year ago

Antonio-Nappi commented 1 year ago

Describe the bug I am new in PRSice 2.0 and I want to use it to perform a PRS analysis on BMI. It's a toy example so I am limiting my analysis only on the chrom 22. Currently I am not able to install both ggplot and data.table.

Error Log Begin plotting Current Rscript version = 2.3.3 Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 36 did not have 3 elements Calls: read.table -> scan Execution halted

To Reproduce The command that I run in the terminal is the following: Rscript ~/antonio.nappi/PRSice2/PRSice.R --prsice ~/antonio.nappi/PRSice2/PRSice_linux --base ~/antonio.nappi/bmi-prsv2/BMI_chr_22_no_dup.sumstat --target ~/dataset/genos/imputed/bfile-filtered-hg38/ukb_imp_chr22_v3_filtered_hg38 --binary-target F --base-maf MAF:0.01 --base-info INFO:0.8 --out ~/antonio.nappi/bmi-prsv2/PRSice --cov ~/users/antonio.nappi/prs-bmi-v2/split_10_fold/split_1/covars_train_tab_sep.csv --pheno ~/users/antonio.nappi/eids_pheno.csv --ignore-fid Additional context I have used GCTA to perform the GWAS analysis. Here there is the sumstat file

CHR SNP POS A1  A2  N   AF1 BETA    SE  P
22  22:16498458_G_A 15479504    A   G   213183  0.0685655   0.0011949   0.0059535   0.840929
22  22:16495833_C_A 15482129    A   C   217841  0.0780776   0.00016822  0.00553374  0.975749
22  22:16488702_G_C 15489260    C   G   213695  0.0755539   0.000114636 0.00567338  0.983879
22  22:16488635_C_A 15489327    A   C   213521  0.0763297   0.000305003 0.0056494   0.956944
22  22:16464274_A_C 15513688    C   A   205582  0.0732263   -0.000321583    0.00588967  0.956456
22  22:16057417_T_C 15920590    C   T   217841  0.898582    -0.000494364    0.00495179  0.920475
22  22:16054454_C_T 15923554    T   C   214479  0.0999841   0.000306892 0.00502329  0.951284
22  22:16053862_C_T 15924146    T   C   215354  0.0996197   0.000283129 0.00502081  0.95503
22  22:16051249_T_C 15926767    C   T   216406  0.0990384   -0.00071405 0.0050229   0.886955

here the covars file

eid Axiom   BiLEVE  gsex    age age2    gsex.age    gsex.age2   gpc1    gpc2    gpc3    gpc4    gpc5    gpc6    gpc7    gpc8    gpc9    gpc10   gpc11   gpc12   gpc13   gpc14   gpc15   gpc16   gpc17   gpc18   gpc19   gpc20
2426627 1   0   0.0 49.0    2401.0  0.0 0.0 -11.7764    4.79466 -2.2785 6.7797  19.5925 1.42321 -2.02837    1.57565 1.5328  2.5875  4.12255 -1.39361    -0.290032   -8.3644-0.00611065  -1.06014    0.939646    -4.16765    -1.40232    -1.98292
4763558 0   1   1.0 66.0    4356.0  66.0    4356.0  -11.5404    3.19508 -2.18518    -1.03754    -3.57993    -1.38607    1.90651 0.957257    -2.39903    0.904704    -3.12774    -1.14217    1.35595 0.648571    -1.88745    -2.75565    0.0929041   1.76729 -0.176371   -0.360567

while the pheno file is the following:

FID IID Pheno
1000015 1000015 31.4398
1000027 1000027 22.3678
1000039 1000039 28.7013
1000040 1000040 25.1486
1000053 1000053 28.3445
1000064 1000064 25.4581
1000071 1000071 32.5437
1000088 1000088 23.0198
1000096 1000096 24.1959

Moreover I would like to know if I have to include or not the --ignore-fid option

Antonio-Nappi commented 1 year ago

Edit. I found the error, I had a missing value in the pheno file. Could I suggest to make the error message more clear (i.e. specifing which file misses values)?