污染添加17和160图
parent
3f6e7b2dc0
commit
157fa94ef8
|
|
@ -46,9 +46,13 @@ def single_monitor(name, vcf_file, bed_file, freq_range, output_dir):
|
|||
bed_regions = load_bed_regions(bed_file)
|
||||
|
||||
vcf = pysam.VariantFile(vcf_file)
|
||||
|
||||
res_pos = list()
|
||||
count_normal = 0
|
||||
count_exception = 0
|
||||
vcf_out = open(os.path.join(output_dir, f'{name}_cnvkit_tumor.vcf'), 'w')
|
||||
for line in str(vcf.header).strip().split('\n'):
|
||||
vcf_out.write(line + '\n')
|
||||
|
||||
for record in vcf:
|
||||
contig = record.contig
|
||||
|
|
@ -79,7 +83,9 @@ def single_monitor(name, vcf_file, bed_file, freq_range, output_dir):
|
|||
freq=freq,
|
||||
res=res
|
||||
))
|
||||
vcf_out.write(str(record) + '\n')
|
||||
break
|
||||
|
||||
count_all = count_exception + count_normal
|
||||
if count_all == 0:
|
||||
z_score = 0
|
||||
|
|
|
|||
|
|
@ -61,6 +61,19 @@ task run_generate_png {
|
|||
}
|
||||
}
|
||||
|
||||
task run_single_generate_png {
|
||||
String name
|
||||
String probe
|
||||
String cnvkit_tumor_vcf
|
||||
String cnv_cnr
|
||||
String cnv_cns
|
||||
String output_dir
|
||||
|
||||
command {
|
||||
cnvkit.py scatter ${cnv_cnr} -s ${cnv_cns} -v ${cnvkit_tumor_vcf} -o ${output_dir}/pollution/${name}_pollution_cnvkit_tumor.png
|
||||
}
|
||||
}
|
||||
|
||||
workflow call_pollution {
|
||||
|
||||
Boolean run=true
|
||||
|
|
@ -114,6 +127,16 @@ workflow call_pollution {
|
|||
probe=probe,
|
||||
vcf=initial_vcf
|
||||
}
|
||||
call run_single_generate_png {
|
||||
input:
|
||||
name=tumor,
|
||||
probe=probe,
|
||||
cnvkit_tumor_vcf=run_pollution_paired.cnvkit_tumor_vcf,
|
||||
cnv_cnr=cnv_cnr,
|
||||
cnv_cns=cnv_cns,
|
||||
output_dir=output_dir
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue