Skip to content

Commit 8587bb9

Browse files
ckandothlordzappo
authored andcommitted
Support separate VEP cache/data folders (#19)
Thank you Cyriac - this change was necessary to eventually support vcf2maf in the cloud.
1 parent 9d45b33 commit 8587bb9

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

bin/cmo_maf2maf

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ if __name__ =='__main__':
6767
# For machines without writable /scratch, default to creating a temp folder under /tmp
6868
tmp_dir = tempfile.mkdtemp(dir=tmp_root) if os.path.exists(tmp_root) else tempfile.mkdtemp(dir='/tmp')
6969
args_dict['tmp_dir'] = tmp_dir
70-
# Show the user a warning about limited storage in temp directories
71-
sys.stderr.write( "WARNING: Writing temporary files to " + tmp_dir + " which could fill " +
72-
"up and interrupt your colleagues' work. If you're working with giant files, then " +
73-
"please define your own --tmp-dir, or we're gonna get ya!\n" )
70+
# If input is large, show the user a warning about limited storage in temp directories
71+
if os.path.getsize(args_dict['input_maf']) > 100000000:
72+
sys.stderr.write( "WARNING: Writing temporary files to " + tmp_dir + " which could " +
73+
"fill up and interrupt your colleagues' work. If you're working with giant " +
74+
"files, then please define your own --tmp-dir.\n" )
7475

7576
# Locate VEP and it's cache, the reference FASTA, and the VCF used for filtering
76-
vep_dir = cmo.util.programs['vep'][args.vep_release]
77-
args_dict['vep_data'] = vep_dir
78-
args_dict['vep_path'] = vep_dir
77+
args_dict['vep_path'] = cmo.util.programs['vep'][args.vep_release]
78+
args_dict['vep_data'] = cmo.util.genomes[args.ncbi_build]['vep_cache']
7979
args_dict['ref_fasta'] = cmo.util.genomes[args.ncbi_build]['fasta']
8080
try:
8181
args_dict['filter_vcf'] = cmo.util.genomes[args.ncbi_build]['exac']

bin/cmo_vcf2maf

+7-7
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ if __name__ =='__main__':
6969
# For machines without writable /scratch, default to creating a temp folder under /tmp
7070
tmp_dir = tempfile.mkdtemp(dir=tmp_root) if os.path.exists(tmp_root) else tempfile.mkdtemp(dir='/tmp')
7171
args_dict['tmp_dir'] = tmp_dir
72-
# Show the user a warning about limited storage in temp directories
73-
sys.stderr.write( "WARNING: Writing temporary files to " + tmp_dir + " which could fill " +
74-
"up and interrupt your colleagues' work. If you're working with giant files, then " +
75-
"please define your own --tmp-dir, or we're gonna get ya!\n" )
72+
# If input is large, show the user a warning about limited storage in temp directories
73+
if os.path.getsize(args_dict['input_vcf']) > 100000000:
74+
sys.stderr.write( "WARNING: Writing temporary files to " + tmp_dir + " which could " +
75+
"fill up and interrupt your colleagues' work. If you're working with giant " +
76+
"files, then please define your own --tmp-dir.\n" )
7677

7778
# Locate VEP and it's cache, the reference FASTA, and the VCF used for filtering
78-
vep_dir = cmo.util.programs['vep'][args.vep_release]
79-
args_dict['vep_data'] = vep_dir
80-
args_dict['vep_path'] = vep_dir
79+
args_dict['vep_path'] = cmo.util.programs['vep'][args.vep_release]
80+
args_dict['vep_data'] = cmo.util.genomes[args.ncbi_build]['vep_cache']
8181
args_dict['ref_fasta'] = cmo.util.genomes[args.ncbi_build]['fasta']
8282
try:
8383
args_dict['filter_vcf'] = cmo.util.genomes[args.ncbi_build]['exac']

0 commit comments

Comments
 (0)