Skip to content
Snippets Groups Projects
Commit 63746344 authored by mariabernard's avatar mariabernard
Browse files

IMAGE_vqsr : add script dir in PATH to execute filter_multi_samples_vcf.py

parent 8e5deb30
No related branches found
No related tags found
No related merge requests found
##########################################################
### Import section
import yaml
import os
import os,sys
import collections
##########################################################
### system options
......@@ -35,7 +35,8 @@ for rule in rule_resources:
# add tabix and filter_multi_sample_vcf.py in PATH
tabix_dir=os.path.dirname(config['bin']['tabix'])
script_dir=os.path.abspath('script')
snakefile_path=sys.argv[sys.argv.index("-s") +1] if "-s" in sys.argv else "./Snakefile"
script_dir=os.path.join(os.path.abspath(os.path.dirname(snakefile_path)),'script')
os.environ['PATH'] = tabix_dir + os.pathsep + script_dir + os.pathsep + os.environ['PATH']
##########################################################
......@@ -81,10 +82,12 @@ final_outputs.append("results/split_SNP_INDEL/VQSR_trainingSet_untrusted_uniquel
# common hard filtered SNP and INDEL
final_outputs.append("results/hard_filtering/VQSR_trainingSet_trusted_3callers_hardFiltered_variants_SNP.vcf.gz")
final_outputs.append("results/hard_filtering/VQSR_trainingSet_trusted_3callers_hardFiltered_variants_INDEL.vcf.gz")
# Final recalibrated GATK SNP and INDEL
gatk_prefix = os.path.splitext(os.path.basename(config['GATK_variants']))[0]
if gatk_prefix.endswith('vcf') :
gatk_prefix = os.path.splitext(gatk_prefix)[0]
final_outputs.append("results/VQSR/" + gatk_prefix +"_vqsr_SNP.vcf.gz")
final_outputs.append("results/VQSR/" + gatk_prefix +"_vqsr_INDEL.vcf.gz")
final_outputs.append("results/genoFilter/" + gatk_prefix +"_vqsr_SNP_genFiltered.vcf.gz")
......@@ -126,6 +129,6 @@ onsuccess:
temp_list.append('results/split_SNP_INDEL/common_SNP.vcf.gz.tbi')
temp_list.append('results/split_SNP_INDEL/common_INDEL.vcf.gz.tbi')
for f in temp_list:
print(f)
os.remove(f)
#~ for f in temp_list:
#~ print(f)
#~ os.remove(f)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment