@@ -128,6 +128,7 @@ def run_spatial_ldsc(config: SpatialLDSCConfig):
128
128
129
129
filter_by_common_snp = lambda df : df .loc [common_snp ]
130
130
sumstats = filter_by_common_snp (sumstats )
131
+ CHISQ = sumstats .chisq .to_numpy (dtype = np .float32 ).reshape ((- 1 , 1 )).copy ()
131
132
ref_ld_baseline = filter_by_common_snp (ref_ld_baseline )
132
133
w_ld = filter_by_common_snp (w_ld )
133
134
n_annot_baseline = len (ref_ld_baseline .columns )
@@ -178,8 +179,7 @@ def run_spatial_ldsc(config: SpatialLDSCConfig):
178
179
ref_ld_spatial *= initial_w
179
180
ref_ld_spatial = ref_ld_spatial .to_numpy (dtype = np .float32 )
180
181
181
- y = sumstats .chisq .to_numpy (dtype = np .float32 ).reshape ((- 1 , 1 ))
182
- y *= initial_w
182
+ y = CHISQ * initial_w
183
183
184
184
chunk_size = ref_ld_spatial .shape [1 ]
185
185
out_chunk = process_map (jackknife_for_processmap , range (chunk_size ),
@@ -234,5 +234,19 @@ def run_spatial_ldsc(config: SpatialLDSCConfig):
234
234
args = parser .parse_args (args_list )
235
235
else :
236
236
args = parser .parse_args ()
237
- config = SpatialLDSCConfig (** vars (args ))
237
+ import os
238
+
239
+ os .chdir ('/storage/yangjianLab/chenwenhao/projects/202312_GPS/data/macaque/representative_slices2' )
240
+ config = SpatialLDSCConfig (** {'all_chunk' : None ,
241
+ 'chisq_max' : None ,
242
+ 'h2' : '/storage/yangjianLab/songliyang/GWAS_trait/LDSC/ADULT1_ADULT2_ONSET_ASTHMA.sumstats.gz' ,
243
+ 'ldsc_save_dir' : 'T135_macaque1/spatial_ldsc' ,
244
+ 'ldscore_input_dir' : 'T135_macaque1/generate_ldscore' ,
245
+ 'n_blocks' : 200 ,
246
+ 'not_M_5_50' : False ,
247
+ 'num_processes' : 4 ,
248
+ 'sample_name' : 'T135_macaque1' ,
249
+ 'trait_name' : 'ADULT1_ADULT2_ONSET_ASTHMA' ,
250
+ 'w_file' : '/storage/yangjianLab/sharedata/LDSC_resource/LDSC_SEG_ldscores/weights_hm3_no_hla/weights.' })
251
+ # config = SpatialLDSCConfig(**vars(args))
238
252
run_spatial_ldsc (config )
0 commit comments