diff 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
line wrap: on
line diff
--- a/Datatype.py	Mon Jul 18 12:40:30 2016 -0400
+++ b/Datatype.py	Tue Jul 19 01:19:57 2016 -0400
@@ -11,12 +11,16 @@
 
 
 class Datatype(object):
+
+    twoBitFile = None
+
     def __init__( self, input_fasta_file, extra_files_path, tool_directory ):
 
         self.input_fasta_file = input_fasta_file
         self.extra_files_path = extra_files_path
         self.tool_directory = tool_directory
 
+        self.twoBitFile = None
 
         # Construction of the arborescence
         # TODO: Change the hard-coded path with a input based one
@@ -27,7 +31,12 @@
 
         # TODO: Redundant, should be refactored because they are all doing it...into hubArchiveCreator?
         # 2bit file creation from input fasta
-        self.twoBitFile = subtools.faToTwoBit(self.input_fasta_file, self.mySpecieFolderPath)
+        if not Datatype.twoBitFile:
+            print "We create the self.twoBit in " + self.__class__.__name__
+            Datatype.twoBitFile = subtools.faToTwoBit(self.input_fasta_file, self.mySpecieFolderPath)
+
+        # TODO: Remove this by saying to all children classes to use "Datatype.twoBitFile" instead
+        self.twoBitFile = Datatype.twoBitFile
 
     def getShortName( self, name_to_shortify ):
         # Slice to get from Long label the short label