Repository 'bam_to_bigwig'
hg clone https://toolshed.g2.bx.psu.edu/repos/brad-chapman/bam_to_bigwig

Changeset 5:52bcd04ee0d6 (2014-02-24)
Previous changeset 4:14e5258d1b39 (2014-02-11) Next changeset 6:9163e1db4c16 (2016-05-12)
Commit message:
Fix issues with setting up subprocess call. Thanks to David Leader
modified:
bam_to_bigwig/bam_to_bigwig.py
b
diff -r 14e5258d1b39 -r 52bcd04ee0d6 bam_to_bigwig/bam_to_bigwig.py
--- 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)