@@ -24,7 +24,7 @@ sample_names.remove('T825_macaque3') # due to 25% of spot don't have spatial coo
24
24
25
25
annotation = "SubClass"
26
26
data_type = "SCT"
27
- # sample_names = ['T584_macaque2']
27
+ sample_names = ['T584_macaque2' ]
28
28
num_processes = 20
29
29
30
30
rule all :
@@ -123,8 +123,6 @@ rule latent_to_gene:
123
123
latent_representation = "latent_GVAE" ,
124
124
num_neighbour = 51 ,
125
125
num_neighbour_spatial = 201 ,
126
- fold = 1.0 ,
127
- pst = 0.2 ,
128
126
species = 'MACAQUE_GENE_SYM' ,
129
127
gs_species = '/storage/yangjianLab/songliyang/SpatialData/homologs/macaque_human_homologs.txt' ,
130
128
gM_slices = None ,
@@ -148,8 +146,6 @@ GPS run_latent_to_gene \
148
146
--latent_representation { params .latent_representation } \
149
147
--num_neighbour { params .num_neighbour } \
150
148
--num_neighbour_spatial { params .num_neighbour_spatial } \
151
- --fold { params .fold } \
152
- --pst { params .pst } \
153
149
{ '--species ' + params .species if params .species is not None else '' } \
154
150
{ '--gs_species ' + params .gs_species if params .gs_species is not None else '' } \
155
151
{ '--gM_slices ' + params .gM_slices if params .gM_slices is not None else '' }
@@ -166,11 +162,14 @@ rule generate_ldscore:
166
162
done = '{sample_name}/generate_ldscore/{sample_name}_generate_ldscore_chr{chrom}.done'
167
163
params :
168
164
ld_score_save_dir = '{sample_name}/generate_ldscore' ,
169
- gtf_file = "/storage/yangjianLab/songliyang/ReferenceGenome/GRCh37/gencode.v39lift37.annotation.gtf" ,
165
+ gtf_annotation_file = "/storage/yangjianLab/songliyang/ReferenceGenome/GRCh37/gencode.v39lift37.annotation.gtf" ,
170
166
bfile_root = "/storage/yangjianLab/sharedata/LDSC_resource/1000G_EUR_Phase3_plink/1000G.EUR.QC" ,
171
167
keep_snp_root = "/storage/yangjianLab/sharedata/LDSC_resource/hapmap3_snps/hm" ,
172
- window_size = 50000 ,
173
- spots_per_chunk = 1000 ,
168
+ gene_window_size = 50000 ,
169
+ enhancer_annotation_file = None ,
170
+ snp_multiple_enhancer_strategy = 'max_mkscore' ,
171
+ gene_window_enhancer_priority = None ,
172
+ spots_per_chunk = 5000 ,
174
173
ld_wind = 1 ,
175
174
ld_unit = "CM"
176
175
benchmark : '{sample_name}/generate_ldscore/{sample_name}_generate_ldscore_chr{chrom}.done.benchmark'
@@ -179,11 +178,25 @@ rule generate_ldscore:
179
178
resources :
180
179
mem_mb_per_cpu = lambda wildcards , threads , attempt : 45_000 / threads * np .log2 (attempt + 1 ),
181
180
qos = 'huge'
182
- shell :
183
- """
184
- GPS run_generate_ldscore --sample_name {wildcards.sample_name} --chrom {wildcards.chrom} --ldscore_save_dir {params.ld_score_save_dir} --gtf_annotation_file {params.gtf_annotation_file} --mkscore_feather_file {input.mkscore_feather_file} --bfile_root {params.bfile_root} --keep_snp_root {params.keep_snp_root} --window_size {params.window_size} --spots_per_chunk {params.spots_per_chunk} --ld_wind {params.ld_wind} --ld_unit {params.ld_unit}
185
- touch {output.done}
181
+ run :
182
+ command = f"""
183
+ GPS run_generate_ldscore \
184
+ --sample_name { wildcards .sample_name } \
185
+ --chrom { wildcards .chrom } \
186
+ --ldscore_save_dir { params .ld_score_save_dir } \
187
+ --mkscore_feather_file { input .mkscore_feather_file } \
188
+ --bfile_root { params .bfile_root } \
189
+ --keep_snp_root { params .keep_snp_root } \
190
+ --gtf_annotation_file { params .gtf_annotation_file } \
191
+ --gene_window_size { params .gene_window_size } \
192
+ { '--enhancer_annotation_file ' + params .enhancer_annotation_file if params .enhancer_annotation_file is not None else '' } \
193
+ --snp_multiple_enhancer_strategy { params .snp_multiple_enhancer_strategy } \
194
+ { '--gene_window_enhancer_priority ' + params .gene_window_enhancer_priority if params .gene_window_enhancer_priority is not None else '' } \
195
+ --spots_per_chunk { params .spots_per_chunk } \
196
+ --ld_wind { params .ld_wind } \
197
+ --ld_unit { params .ld_unit }
186
198
"""
199
+ shell (command )
187
200
188
201
189
202
def get_h2_file (wildcards ):
@@ -210,7 +223,7 @@ rule spatial_ldsc:
210
223
ldscore_input_dir = rules .generate_ldscore .params .ld_score_save_dir ,
211
224
ldsc_save_dir = '{sample_name}/spatial_ldsc' ,
212
225
w_file = "/storage/yangjianLab/sharedata/LDSC_resource/LDSC_SEG_ldscores/weights_hm3_no_hla/weights." ,
213
- sumstats_config_file = '/storage/yangjianLab/chenwenhao/projects/202312_GPS/src/GPS/example/sumstats_config .yaml' ,
226
+ sumstats_config_file = '/storage/yangjianLab/chenwenhao/projects/202312_GPS/src/GPS/example/sumstats_config_sub .yaml' ,
214
227
all_chunk = None
215
228
threads :
216
229
2
0 commit comments