1. Davide Cittaro
  2. dsptools

Commits

Davide Cittaro  committed d52392e

fixed some typos and bugs in latest bigwig code

  • Participants
  • Parent commits 0c34001
  • Branches default

Comments (0)

Files changed (1)

File lib/dspomics/ptpileup.py

View file
         if position % 131072 == 0:
           self._flush()
     elif fmt == "bw" or fmt == "bigwig":
+      fh = open(os.path.expanduser(fname), "rb")
+      bwh = bx.bbi.bigwig_file.BigWigFile(fh)
       for (chrom, size) in getChromosomeSizesFromBigWig(fname):
         self.addChromosome(chrom, size)
-      fh = open(os.path.expanduser(fname), "rb")
-      bwh = bx.bbi.bigwig_file.BigWigFile(fh)
-      self.chromosome(chrom) = bwh.get_as_array(chrom, 0, csize[chrom])
-      giterator = subprocess.Popen(["bigWigToBedGraph", fname, "stdout"], shell = False, stdout = subprocess.PIPE).stdout 
+        self.chromosome(chrom) = bwh.get_as_array(chrom, 0, csize[chrom])
+      fh.close()
     else:  
       raise TypeError("Format %s not supported, yet" % fmt)