Al-Murphy / MungeSumstats

Rapid standardisation and quality control of GWAS or QTL summary statistics
https://doi.org/doi:10.18129/B9.bioc.MungeSumstats
75 stars 15 forks source link

format_sumstats p value column selection problem #149

Closed dupontct closed 1 year ago

dupontct commented 1 year ago

I have a GWAS sumstat with headers:

rsID, CHROM, POS_b37, REF, ALT, N, N_studies, POOLED_ALT_AF, EFFECT_SIZE, SE, pvalue_neg_log10, pvalue, pvalue_neg_log10_GC, pvalue_GC

format_sumstats identifies that there are are multiple traits of NEG_LOG10, NEG_LOG10_GC, and GC. I know that the analysis_trait argument can be used to select either pvalue_neg_log10, pvalue_neg_log10_GC or pvalue_GC, but I need to use the column pvalue for the P-value.

Al-Murphy commented 1 year ago

Code and data to replicate issue, note next time please provide both code and data that will replicate the issue so we can assist:

a <- MungeSumstats::formatted_example()
a[,N:=100]
a[,N_studies:=100]
data.table::setcolorder(a,c('SNP','CHR','BP','A1','A2','N','N_studies',
                            'FRQ','BETA','SE','P'))
a[,P2:=P]
a[,P3:=P]
a[,P4:=P]
data.table::setnames(a,c('rsID',  'CHROM',  'POS_b37',  'REF',  'ALT',  'N',  
                         'N_studies',  'POOLED_ALT_AF',  'EFFECT_SIZE',  'SE',
                         'pvalue_neg_log10',  'pvalue',  'pvalue_neg_log10_GC',
                         'pvalue_GC'))

MungeSumstats::format_sumstats(a,ref_genome='grch37')

So I have updated MSS (v1.9.7), available in the dev bioc in a few days or from the master branch on this github now, adding a parameter ignore_multi_trait to format_sumstats() which will ignore any multi-trait p-values if set to TRUE. I believe this will cover your issue? The above example will now run with:

MungeSumstats::format_sumstats(a,ref_genome='grch37',dbSNP=144,ignore_multi_trait=TRUE)

Let me know if this doesn't work as expected.

Thanks, Alan.

Al-Murphy commented 1 year ago

Closing because of inactivity, feel free to reopen if this doesn't clear things up