diff Bam.py @ 16:3233451a3bd6 draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit fc73ec22a0db3ab09c4ac13dc58f0b54ae37845c
author rmarenco
date Sun, 25 Sep 2016 11:25:38 -0400
parents d05236b15f81
children c02720d1afee
line wrap: on
line diff
--- a/Bam.py	Fri Sep 02 15:41:51 2016 -0400
+++ b/Bam.py	Sun Sep 25 11:25:38 2016 -0400
@@ -5,6 +5,7 @@
 Class to handle Bam files to UCSC TrackHub
 """
 
+import logging
 import os
 import shutil
 
@@ -31,6 +32,10 @@
 
         self.priority = self.data_bam["order_index"]
         self.index_bam = self.data_bam["index"]
+        # TODO: Think about how to avoir repetition of the color treatment
+        self.track_color = self.data_bam["track_color"]
+
+        logging.debug("Color of bam: {0}".format(self.track_color))
 
         #print "Creating TrackHub BAM from (falsePath: %s; name: %s)" % ( self.input_bam_false_path, self.name_bam)
 
@@ -49,7 +54,8 @@
         self.createTrack(file_path=self.name_bam,
                          track_name=self.name_bam,
                          long_label=self.name_bam, track_type='bam', visibility='pack', priority=self.priority,
-                         track_file=bam_index_file_path)
+                         track_file=bam_index_file_path,
+                         track_color=self.track_color)
         #
         # dataURL = "tracks/%s" % self.name_bam
         #