bulik / ldsc

LD Score Regression (LDSC)
GNU General Public License v3.0
653 stars 344 forks source link

One-sided test with --h2 flag and custom annotations #288

Open galagoz opened 3 years ago

galagoz commented 3 years ago

Hi everyone,

I have a question about the difference between --h2 and --h2-cts flags. I know that h2-cts is used to partition heritability to cell-type-specific annotations and LDSC performs a one-sided test when this flag is used, so all heritability estimates are positive. However, I run part. heritability with custom annotations, so I'm using the h2 flag, which runs a two-sided test. As a result, sometimes I get negative heritability estimates. So, I was wondering if there is a way to run a one-sided test using the h2 flag and custom annotations.

I also use a custom baseline model in addition to the generic baseline model. Here is the command:

./ldsc.py \
--h2 /data/munged/ancreg_munged.txt.sumstats.gz \
--ref-ld-chr /data/active_merged/active_merged.,/data/active_marks/active_marks.,/data/baselineLD/baselineLD. \
--out /data/results/active_merged/ancreg_munged.txt.sumstats.gz \
--overlap-annot  \
--frqfile-chr /data/LDscores/Phase3/1000G_Phase3_frq/1000G.EUR.QC. \
--w-ld-chr /data/LDscores/Phase3/1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC. \
--print-coefficients

Sample log file:

Beginning analysis at Thu Dec 3 12:06:19 2020 Reading summary statistics from /data/ancreg_munged.txt.sumstats.gz ... Read summary statistics for 1098387 SNPs. Reading reference panel LD Score from /data/active_merged/active_merged.,/data/active_marks/active_marks.,/data/baselineLD/baselineLD.[1-22] ... (ldscore_fromlist) Read reference panel LD Scores for 1190321 SNPs. Removing partitioned LD Scores with zero variance. Reading regression weight LD Score from /data/LDscores/Phase3/1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.[1-22] ... (ldscore_fromlist) Read regression weight LD Scores for 1187349 SNPs. After merging with reference panel LD, 1094449 SNPs remain. After merging with regression SNP LD, 1094449 SNPs remain. Removed 29 SNPs with chi^2 > 80 (1094420 SNPs remain) Total Observed scale h2: 0.3553 (0.0509) Categories: L2_0 L2_1 baseL2_2 Coding_UCSCL2_2 Coding_UCSC.flanking.500L2_2 Conserved_LindbladTohL2_2 Conserved_LindbladToh.flanking.500L2_2 CTCF_HoffmanL2_2 CTCF_Hoffman.flanking.500L2_2 DGF_ENCODEL2_2 DGF_ENCODE.flanking.500L2_2 DHS_peaks_TrynkaL2_2 DHS_TrynkaL2_2 DHS_Trynka.flanking.500L2_2 Enhancer_AnderssonL2_2 Enhancer_Andersson.flanking.500L2_2 Enhancer_HoffmanL2_2 Enhancer_Hoffman.flanking.500L2_2 FetalDHS_TrynkaL2_2 FetalDHS_Trynka.flanking.500L2_2 H3K27ac_HniszL2_2 H3K27ac_Hnisz.flanking.500L2_2 H3K27ac_PGC2L2_2 H3K27ac_PGC2.flanking.500L2_2 H3K4me1_peaks_TrynkaL2_2 H3K4me1_TrynkaL2_2 H3K4me1_Trynka.flanking.500L2_2 H3K4me3_peaks_TrynkaL2_2 H3K4me3_TrynkaL2_2 H3K4me3_Trynka.flanking.500L2_2 H3K9ac_peaks_TrynkaL2_2 H3K9ac_TrynkaL2_2 H3K9ac_Trynka.flanking.500L2_2 Intron_UCSCL2_2 Intron_UCSC.flanking.500L2_2 PromoterFlanking_HoffmanL2_2 PromoterFlanking_Hoffman.flanking.500L2_2 Promoter_UCSCL2_2 Promoter_UCSC.flanking.500L2_2 Repressed_HoffmanL2_2 Repressed_Hoffman.flanking.500L2_2 SuperEnhancer_HniszL2_2 SuperEnhancer_Hnisz.flanking.500L2_2 TFBS_ENCODEL2_2 TFBS_ENCODE.flanking.500L2_2 Transcr_HoffmanL2_2 Transcr_Hoffman.flanking.500L2_2 TSS_HoffmanL2_2 TSS_Hoffman.flanking.500L2_2 UTR_3_UCSCL2_2 UTR_3_UCSC.flanking.500L2_2 UTR_5_UCSCL2_2 UTR_5_UCSC.flanking.500L2_2 WeakEnhancer_HoffmanL2_2 WeakEnhancer_Hoffman.flanking.500L2_2 GERP.NSL2_2 GERP.RSsup4L2_2 MAFbin1L2_2 MAFbin2L2_2 MAFbin3L2_2 MAFbin4L2_2 MAFbin5L2_2 MAFbin6L2_2 MAFbin7L2_2 MAFbin8L2_2 MAFbin9L2_2 MAFbin10L2_2 MAF_Adj_Predicted_Allele_AgeL2_2 MAF_Adj_LLD_AFRL2_2 Recomb_Rate_10kbL2_2 Nucleotide_Diversity_10kbL2_2 Backgrd_Selection_StatL2_2 CpG_Content_50kbL2_2 MAF_Adj_ASMCL2_2 GTEx_eQTL_MaxCPPL2_2 BLUEPRINT_H3K27acQTL_MaxCPPL2_2 BLUEPRINT_H3K4me1QTL_MaxCPPL2_2 BLUEPRINT_DNA_methylation_MaxCPPL2_2 synonymousL2_2 non_synonymousL2_2 Conserved_Vertebrate_phastCons46wayL2_2 Conserved_Vertebrate_phastCons46way.flanking.500L2_2 Conserved_Mammal_phastCons46wayL2_2 Conserved_Mammal_phastCons46way.flanking.500L2_2 Conserved_Primate_phastCons46wayL2_2 Conserved_Primate_phastCons46way.flanking.500L2_2 BivFlnkL2_2 BivFlnk.flanking.500L2_2 Human_Promoter_VillarL2_2 Human_Promoter_Villar.flanking.500L2_2 Human_Enhancer_VillarL2_2 Human_Enhancer_Villar.flanking.500L2_2 Ancient_Sequence_Age_Human_PromoterL2_2 Ancient_Sequence_Age_Human_Promoter.flanking.500L2_2 Ancient_Sequence_Age_Human_EnhancerL2_2 Ancient_Sequence_Age_Human_Enhancer.flanking.500L2_2 Human_Enhancer_Villar_Species_Enhancer_CountL2_2 Human_Promoter_Villar_ExACL2_2 Human_Promoter_Villar_ExAC.flanking.500L2_2 Lambda GC: 1.1207 Mean Chi^2: 1.1573 Intercept: 1.0206 (0.0104) Ratio: 0.1308 (0.0662) Reading annot matrix from /data/active_merged/active_merged.,/data/active_marks/active_marks.,/data/baselineLD/baselineLD.[1-22] ... (annot) Results printed to /data/active_merged/ancreg_munged.txt.sumstats.gz.results Analysis finished at Thu Dec 3 12:15:19 2020 Total time elapsed: 8.0m:59.99s

First 10 lines of the sample results file:

Category Prop._SNPs Prop._h2 Prop._h2_std_error Enrichment Enrichment_std_error Enrichment_p Coefficient Coefficient_std_error Coefficient_z-score L2_0 0.008461274057611951 -0.03957687769706906 0.02683900343002685 -4.677413522785592 3.171981340786602 0.06162636142714611 -2.767274689904383e-07 1.9156438798964022e-07 -1.4445663512646396 L2_1 0.03929504312835809 0.1486892000019253 0.0640972748106775 3.783917465524312 1.631179652896738 0.07370933144741858 1.6847294236770942e-07 9.547323635302777e-08 1.7646091072554972 baseL2_2 1.0 1.0000000000003748 0.0 1.0000000000003748 0.0 NA -6.155996032125788e-09 5.465278327116507e-08 -0.11263828964724848 Coding_UCSCL2_2 0.014259139875316193 0.1189306764813281 0.06756732832535735 8.34066272729447 4.738527633235596 0.11588572368094888 -2.825628492528821e-07 5.798363745080583e-07 -0.4873148040990229 Coding_UCSC.flanking.500L2_2 0.04936288396266565 -0.0010580422938625143 0.07988790132511452 -0.021433964325559614 1.6183799428237555 0.5259000527741089 -1.1487212204779004e-07 1.188252452099697e-07 -0.966731622096009 Conserved_LindbladTohL2_2 0.024670538061474286 0.11250841942073073 0.10034405255096268 4.5604363853103305 4.06736376405429 0.3820559546965644 -5.478106112867414e-07 4.228987152060838e-07 -1.2953707154673821 Conserved_LindbladToh.flanking.500L2_2 0.30553135724110025 0.3015888071348226 0.15980078326807132 0.98709608682435 0.5230258023629623 0.98031107598331 7.627815212954293e-08 5.606414045627694e-08 1.3605515309564125 CTCF_HoffmanL2_2 0.02381466422888569 -0.06596237094520596 0.08848614747209324 -2.769821581830146 3.7156160012016928 0.30013968433261556 -1.525321580370174e-07 2.2250388658078543e-07 -0.6855258143171217 CTCF_Hoffman.flanking.500L2_2 0.04697979033942896 -0.09299514702503765 0.11834853836764614 -1.9794713078357262 2.519137218633332 0.23791381924052799 -1.7010205247027635e-07 1.6127523798545688e-07 -1.0547313685292186

AbbyD99 commented 2 years ago

Hi, have you figured out why there is negative heritability? I also got negative large enrichment values and I don't know how to fix it.