Merge branch '12032-project-trash' refs #12032
[arvados.git] / crunch_scripts / GATK2-VariantFiltration
index 75af6121d3550def02ddd1aa4e5720fae82742c3..0ef4a747389e6c205540827fe2a0e0dbf8c08322 100755 (executable)
@@ -1,4 +1,7 @@
 #!/usr/bin/env python
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
 
 import arvados
 import os
@@ -19,12 +22,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 +51,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 +60,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())