Mercurial > repos > rmarenco > hubarchivecreator
comparison 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 |
comparison
equal
deleted
inserted
replaced
15:2a45cd656e8e | 16:3233451a3bd6 |
---|---|
3 | 3 |
4 """ | 4 """ |
5 Class to handle Bam files to UCSC TrackHub | 5 Class to handle Bam files to UCSC TrackHub |
6 """ | 6 """ |
7 | 7 |
8 import logging | |
8 import os | 9 import os |
9 import shutil | 10 import shutil |
10 | 11 |
11 from Datatype import Datatype | 12 from Datatype import Datatype |
12 from Track import Track | 13 from Track import Track |
29 else: | 30 else: |
30 self.name_bam = self.data_bam["name"] | 31 self.name_bam = self.data_bam["name"] |
31 | 32 |
32 self.priority = self.data_bam["order_index"] | 33 self.priority = self.data_bam["order_index"] |
33 self.index_bam = self.data_bam["index"] | 34 self.index_bam = self.data_bam["index"] |
35 # TODO: Think about how to avoir repetition of the color treatment | |
36 self.track_color = self.data_bam["track_color"] | |
37 | |
38 logging.debug("Color of bam: {0}".format(self.track_color)) | |
34 | 39 |
35 #print "Creating TrackHub BAM from (falsePath: %s; name: %s)" % ( self.input_bam_false_path, self.name_bam) | 40 #print "Creating TrackHub BAM from (falsePath: %s; name: %s)" % ( self.input_bam_false_path, self.name_bam) |
36 | 41 |
37 # First: Add the bam file | 42 # First: Add the bam file |
38 # Second: Add the bam index file, in the same folder (https://genome.ucsc.edu/goldenpath/help/bam.html) | 43 # Second: Add the bam index file, in the same folder (https://genome.ucsc.edu/goldenpath/help/bam.html) |
47 | 52 |
48 # Create the Track Object | 53 # Create the Track Object |
49 self.createTrack(file_path=self.name_bam, | 54 self.createTrack(file_path=self.name_bam, |
50 track_name=self.name_bam, | 55 track_name=self.name_bam, |
51 long_label=self.name_bam, track_type='bam', visibility='pack', priority=self.priority, | 56 long_label=self.name_bam, track_type='bam', visibility='pack', priority=self.priority, |
52 track_file=bam_index_file_path) | 57 track_file=bam_index_file_path, |
58 track_color=self.track_color) | |
53 # | 59 # |
54 # dataURL = "tracks/%s" % self.name_bam | 60 # dataURL = "tracks/%s" % self.name_bam |
55 # | 61 # |
56 # trackDb = TrackDb( | 62 # trackDb = TrackDb( |
57 # trackName=self.name_bam, | 63 # trackName=self.name_bam, |