mtag
mtag copied to clipboard
Key error if running FDR step separately but have custom name for 'n' column
Hi,
I downloaded and ran MTAG today.
First I calculated test statistics python mtag-master/mtag.py --sumstats eur_dec28_2017_maf01_info6.results_nefff_pos2.mtag,data2_sumstats --snp_name SNP --z_name z --beta_name BETA --se_name SE --n_name N --eaf_name MAF --a1_name A1 --a2_name A2 --chr_name CHR --bpos_name BP --drop_ambig_snps --fdr --skip_mtag --out ./pt_md
This step ran fine. However when I tried doing FDR
python mtag-master/mtag.py --fdr --skip_mtag --n_approx --out ./pt_md
I got an error:
"Traceback (most recent call last):
File "mtag-master/mtag.py", line 1503, in
Notice that in the first command my input was --n_name N. This error occurred because mtag was looking through the trait_1/trait_2 files for a column called 'n', but obviously none would be there because I was using a column called 'N'.
I worked around the problem by just going to line 1503 in mtag.py and changing "N_mat[:,t] = df_d[t]['n']" to "N_mat[:,t] = df_d[t]['N']" , after which the program ran successfully.
Therefore I guess I could have avoided this if I just ran the FDR step with the initial mtag command, or if I just modified the input files. Anyway I just thought I would document this.
Thanks! Adam
Hi @nievergeltlab ,
Thanks for your feedback. I think a better way to solve the issue you mentioned is to put in a header conformer that allows for customized column names as input, but forces output to have uniform column names. I've updated the program with this feature. Now running MTAG and then FDR right after should work. Please feel free to re-pull the master branch and try this. Let me know if you have any other questions!
Best, Hui