Merge branch 'master' into 11840-unique-constraint-untrash-coll
[arvados.git] / crunch_scripts / GATK2-VariantFiltration
index 75af6121d3550def02ddd1aa4e5720fae82742c3..392e14be1b0778d1edf22ef9b212bc88ebf4de74 100755 (executable)
@@ -19,12 +19,12 @@ this_task_input = this_task['parameters']['input']
 
 input_file = list(arvados.CollectionReader(this_task_input).all_files())[0]
 
-# pick "before" and "after" vcf filenames
+# choose vcf temporary file names
 vcf_in = os.path.join(arvados.current_task().tmpdir,
                       os.path.basename(input_file.name()))
 vcf_out = re.sub('(.*)\\.vcf', '\\1-filtered.vcf', vcf_in)
 
-# fetch the "before" data
+# fetch the unfiltered data
 vcf_in_file = open(vcf_in, 'w')
 for buf in input_file.readall():
     vcf_in_file.write(buf)
@@ -48,6 +48,7 @@ stdoutdata, stderrdata = arvados.util.run_command(
      '-R', os.path.join(bundle_path, 'human_g1k_v37.fasta')],
     cwd=arvados.current_task().tmpdir)
 
+# store the filtered data
 with open(vcf_out, 'rb') as f:
     out = arvados.CollectionWriter()
     while True:
@@ -56,4 +57,5 @@ with open(vcf_out, 'rb') as f:
             break
         out.write(buf)
 out.set_current_file_name(os.path.basename(vcf_out))
+
 this_task.set_output(out.finish())