Mercurial > repos > rmarenco > hubarchivecreator
comparison Gtf.py @ 11:d05236b15f81 draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 3760d0c8353b924ecf994131a5c2eb381aa81fb2
author | rmarenco |
---|---|
date | Wed, 27 Jul 2016 10:10:49 -0400 |
parents | acc233161f50 |
children | 25809f699cb3 |
comparison
equal
deleted
inserted
replaced
10:acc233161f50 | 11:d05236b15f81 |
---|---|
19 | 19 |
20 self.input_gtf_false_path = input_gtf_false_path | 20 self.input_gtf_false_path = input_gtf_false_path |
21 self.name_gtf = data_gtf["name"] | 21 self.name_gtf = data_gtf["name"] |
22 self.priority = data_gtf["order_index"] | 22 self.priority = data_gtf["order_index"] |
23 | 23 |
24 print "Creating TrackHub GTF from (falsePath: %s; name: %s)" % ( self.input_gtf_false_path, self.name_gtf) | 24 #print "Creating TrackHub GTF from (falsePath: %s; name: %s)" % ( self.input_gtf_false_path, self.name_gtf) |
25 | 25 |
26 # TODO: See if we need these temporary files as part of the generated files | 26 # TODO: See if we need these temporary files as part of the generated files |
27 genePredFile = tempfile.NamedTemporaryFile(bufsize=0, suffix=".genePred") | 27 genePredFile = tempfile.NamedTemporaryFile(bufsize=0, suffix=".genePred") |
28 unsortedBedFile = tempfile.NamedTemporaryFile(bufsize=0, suffix=".unsortedBed") | 28 unsortedBedFile = tempfile.NamedTemporaryFile(bufsize=0, suffix=".unsortedBed") |
29 sortedBedFile = tempfile.NamedTemporaryFile(suffix=".sortedBed") | 29 sortedBedFile = tempfile.NamedTemporaryFile(suffix=".sortedBed") |
44 myBigBedFilePath = os.path.join(self.myTrackFolderPath, trackName) | 44 myBigBedFilePath = os.path.join(self.myTrackFolderPath, trackName) |
45 with open(myBigBedFilePath, 'w') as bigBedFile: | 45 with open(myBigBedFilePath, 'w') as bigBedFile: |
46 subtools.bedToBigBed(sortedBedFile.name, self.chromSizesFile.name, bigBedFile.name) | 46 subtools.bedToBigBed(sortedBedFile.name, self.chromSizesFile.name, bigBedFile.name) |
47 | 47 |
48 # Create the Track Object | 48 # Create the Track Object |
49 dataURL = "tracks/%s" % trackName | 49 self.createTrack(file_path=trackName, |
50 track_name=trackName, | |
51 long_label=self.name_gtf, track_type='bigBed 12 +', visibility='dense', priority=self.priority, | |
52 track_file=myBigBedFilePath) | |
53 # | |
54 # dataURL = "tracks/%s" % trackName | |
55 # | |
56 # trackDb = TrackDb( | |
57 # trackName=trackName, | |
58 # longLabel=self.name_gtf, | |
59 # shortLabel=self.getShortName( self.name_gtf ), | |
60 # trackDataURL=dataURL, | |
61 # trackType='bigBed 12 +', | |
62 # visibility='dense', | |
63 # priority=self.priority, | |
64 # ) | |
65 # self.track = Track( | |
66 # trackFile=myBigBedFilePath, | |
67 # trackDb=trackDb, | |
68 # ) | |
50 | 69 |
51 trackDb = TrackDb( | 70 print("- Gtf %s created" % self.name_gtf) |
52 trackName=trackName, | 71 #print("- %s created in %s" % (trackName, myBigBedFilePath)) |
53 longLabel=self.name_gtf, | |
54 shortLabel=self.getShortName( self.name_gtf ), | |
55 trackDataURL=dataURL, | |
56 trackType='bigBed 12 +', | |
57 visibility='dense', | |
58 priority=self.priority, | |
59 ) | |
60 self.track = Track( | |
61 trackFile=myBigBedFilePath, | |
62 trackDb=trackDb, | |
63 ) | |
64 | |
65 print("- %s created in %s" % (trackName, myBigBedFilePath)) |