Mercurial > repos > yating-l > hubarchivecreator
comparison BigWig.py @ 0:f493979f1408 draft default tip
planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test commit 48b59e91e2dcc2e97735ee35d587960cbfbce932-dirty
author | yating-l |
---|---|
date | Wed, 21 Dec 2016 12:13:04 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f493979f1408 |
---|---|
1 #!/usr/bin/python | |
2 | |
3 import os | |
4 import shutil | |
5 | |
6 # Internal dependencies | |
7 from Datatype import Datatype | |
8 from Track import Track | |
9 from TrackDb import TrackDb | |
10 | |
11 | |
12 class BigWig( Datatype ): | |
13 def __init__(self, input_bigwig_path, data_bigwig): | |
14 super(BigWig, self).__init__() | |
15 | |
16 self.track = None | |
17 | |
18 self.input_bigwig_path = input_bigwig_path | |
19 self.name_bigwig = data_bigwig["name"] | |
20 self.priority = data_bigwig["order_index"] | |
21 self.track_color = data_bigwig["track_color"] | |
22 # TODO: Think about how to avoid repetition of the group_name everywhere | |
23 self.group_name = data_bigwig["group_name"] | |
24 | |
25 #print "Creating TrackHub BigWig from (falsePath: %s; name: %s)" % ( self.input_bigwig_path, self.name_bigwig ) | |
26 | |
27 trackName = "".join( ( self.name_bigwig, ".bigwig" ) ) | |
28 | |
29 myBigWigFilePath = os.path.join(self.myTrackFolderPath, trackName) | |
30 shutil.copy(self.input_bigwig_path, myBigWigFilePath) | |
31 | |
32 # Create the Track Object | |
33 self.createTrack(file_path=trackName, | |
34 track_name=trackName, | |
35 long_label=self.name_bigwig, | |
36 track_type='bigWig', visibility='full', | |
37 priority=self.priority, | |
38 track_file=myBigWigFilePath, | |
39 track_color=self.track_color, | |
40 group_name=self.group_name) | |
41 | |
42 # dataURL = "tracks/%s" % trackName | |
43 # | |
44 # # Return the BigBed track | |
45 # | |
46 # trackDb = TrackDb( | |
47 # trackName=trackName, | |
48 # longLabel=self.name_bigwig, | |
49 # shortLabel=self.getShortName( self.name_bigwig ), | |
50 # trackDataURL=dataURL, | |
51 # trackType='bigWig', | |
52 # visibility='full', | |
53 # priority=self.priority, | |
54 # ) | |
55 # | |
56 # self.track = Track( | |
57 # trackFile=myBigWigFilePath, | |
58 # trackDb=trackDb, | |
59 # ) | |
60 | |
61 print("- BigWig %s created" % self.name_bigwig) | |
62 #print("- %s created in %s" % (trackName, myBigWigFilePath)) |