comparison BigWig.py @ 1:fb5e60d4d18a draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 64cfc08088d11f6818c1b4e5514ef9e67969eaff-dirty
author rmarenco
date Wed, 13 Jul 2016 13:36:37 -0400
parents
children acc233161f50
comparison
equal deleted inserted replaced
0:0f3bc17e5ede 1:fb5e60d4d18a
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 input_fasta_path, extra_files_path, tool_directory):
15 super(BigWig, self).__init__(
16 input_fasta_path, extra_files_path, tool_directory
17 )
18
19 self.track = None
20
21 self.input_bigwig_path = input_bigwig_path
22 self.name_bigwig = data_bigwig["name"]
23 self.priority = data_bigwig["order_index"]
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 dataURL = "tracks/%s" % trackName
34
35 # Return the BigBed track
36 trackDb = TrackDb(
37 trackName=trackName,
38 longLabel=self.name_bigwig,
39 shortLabel=self.getShortName( self.name_bigwig ),
40 trackDataURL=dataURL,
41 trackType='bigWig',
42 visibility='full',
43 priority=self.priority,
44 )
45
46 self.track = Track(
47 trackFile=myBigWigFilePath,
48 trackDb=trackDb,
49 )
50
51 print("- %s created in %s" % (trackName, myBigWigFilePath))