comparison Datatype.py @ 6:816956489fe9 draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 20817d2bd61639d88226c9cd0392cea420ded222
author rmarenco
date Tue, 19 Jul 2016 01:19:57 -0400
parents fb5e60d4d18a
children acc233161f50
comparison
equal deleted inserted replaced
5:fcff8e9146e7 6:816956489fe9
9 9
10 from util import subtools 10 from util import subtools
11 11
12 12
13 class Datatype(object): 13 class Datatype(object):
14
15 twoBitFile = None
16
14 def __init__( self, input_fasta_file, extra_files_path, tool_directory ): 17 def __init__( self, input_fasta_file, extra_files_path, tool_directory ):
15 18
16 self.input_fasta_file = input_fasta_file 19 self.input_fasta_file = input_fasta_file
17 self.extra_files_path = extra_files_path 20 self.extra_files_path = extra_files_path
18 self.tool_directory = tool_directory 21 self.tool_directory = tool_directory
19 22
23 self.twoBitFile = None
20 24
21 # Construction of the arborescence 25 # Construction of the arborescence
22 # TODO: Change the hard-coded path with a input based one 26 # TODO: Change the hard-coded path with a input based one
23 self.mySpecieFolderPath = os.path.join(extra_files_path, "myHub", "dbia3") 27 self.mySpecieFolderPath = os.path.join(extra_files_path, "myHub", "dbia3")
24 28
25 # TODO: Refactor the name of the folder "tracks" into one variable, and should be inside TrackHub object 29 # TODO: Refactor the name of the folder "tracks" into one variable, and should be inside TrackHub object
26 self.myTrackFolderPath = os.path.join(self.mySpecieFolderPath, "tracks") 30 self.myTrackFolderPath = os.path.join(self.mySpecieFolderPath, "tracks")
27 31
28 # TODO: Redundant, should be refactored because they are all doing it...into hubArchiveCreator? 32 # TODO: Redundant, should be refactored because they are all doing it...into hubArchiveCreator?
29 # 2bit file creation from input fasta 33 # 2bit file creation from input fasta
30 self.twoBitFile = subtools.faToTwoBit(self.input_fasta_file, self.mySpecieFolderPath) 34 if not Datatype.twoBitFile:
35 print "We create the self.twoBit in " + self.__class__.__name__
36 Datatype.twoBitFile = subtools.faToTwoBit(self.input_fasta_file, self.mySpecieFolderPath)
37
38 # TODO: Remove this by saying to all children classes to use "Datatype.twoBitFile" instead
39 self.twoBitFile = Datatype.twoBitFile
31 40
32 def getShortName( self, name_to_shortify ): 41 def getShortName( self, name_to_shortify ):
33 # Slice to get from Long label the short label 42 # Slice to get from Long label the short label
34 short_label_slice = slice(0, 15) 43 short_label_slice = slice(0, 15)
35 44