changeset 5:52bcd04ee0d6

Fix issues with setting up subprocess call. Thanks to David Leader
author Brad Chapman <chapmanb@50mail.com>
date Mon, 24 Feb 2014 10:02:20 -0500
parents 14e5258d1b39
children 9163e1db4c16
files bam_to_bigwig/bam_to_bigwig.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/bam_to_bigwig/bam_to_bigwig.py	Tue Feb 11 15:55:22 2014 -0500
+++ b/bam_to_bigwig/bam_to_bigwig.py	Mon Feb 24 10:02:20 2014 -0500
@@ -1,10 +1,11 @@
 #!/usr/bin/env python
-#Original version copyright Brad Chapman with revisions from Peter Cock
-#and ideas from Lance Parsons
 """Convert BAM files to BigWig file format in a specified region.
 
+Original version copyright Brad Chapman with revisions from Peter Cock
+and ideas from Lance Parsons
+
 Usage:
-    bam_to_wiggle.py <BAM file> [--outfile=<output file name>] [--split]
+    bam_to_bigwig.py <BAM file> [--outfile=<output file name>] [--split]
 
 The --split argument is passed to bedtools genomecov
 
@@ -69,7 +70,7 @@
     return sizes
 
 def convert_to_graph(bam_file, split, config, out_handle):
-    cl = [config["program"]["bedtools_genomeCoverageBed"]] + ["-ibam", bam_file, "-bg"]
+    cl = config["program"]["bedtools_genomeCoverageBed"] + ["-ibam", bam_file, "-bg"]
     if split:
         cl.append("-split")
     subprocess.check_call(cl, stdout=out_handle)
@@ -81,7 +82,7 @@
         for chrom, size in chr_sizes:
             out_handle.write("%s\t%s\n" % (chrom, size))
     try:
-        cl = [config["program"]["ucsc_bedGraphToBigWig"]] + [bedgraph_file, size_file, bw_file]
+        cl = config["program"]["ucsc_bedGraphToBigWig"] + [bedgraph_file, size_file, bw_file]
         subprocess.check_call(cl)
     finally:
         os.remove(size_file)