Mercurial > repos > yating-l > hubarchivecreator
annotate util/Reader.py @ 72:2440ce10848b draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit a60f8496cccf4c5a07ba7d75876198eda997f07d
| author | yating-l | 
|---|---|
| date | Wed, 27 Sep 2017 15:34:20 -0400 | 
| parents | 39a32cb31623 | 
| children | 
| rev | line source | 
|---|---|
| 66 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 1 import json | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 2 import logging | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 3 import codecs | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 4 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 5 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 6 # Internal dependencies | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 7 from datatypes.binary.Bam import Bam | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 8 from datatypes.binary.BigWig import BigWig | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 9 from datatypes.binary.BigBed import BigBed | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 10 from datatypes.interval.Bed import Bed | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 11 from datatypes.interval.BedSimpleRepeats import BedSimpleRepeats | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 12 from datatypes.interval.BedSpliceJunctions import BedSpliceJunctions | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 13 from datatypes.interval.CytoBand import CytoBand | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 14 from datatypes.interval.BedBlatAlignments import BedBlatAlignments | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 15 from datatypes.interval.BedBlastAlignments import BedBlastAlignments | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 16 from datatypes.interval.Gff3 import Gff3 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 17 from datatypes.interval.Gtf import Gtf | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 18 from datatypes.interval.Psl import Psl | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 19 from datatypes.sequence.Fasta import Fasta | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 20 from util import santitizer | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 21 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 22 class Reader(object): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 23 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 24 DATATYPE_CLASS = [Bam, BigWig, BigBed, Bed, BedSimpleRepeats, BedSpliceJunctions, CytoBand, BedBlatAlignments, BedBlastAlignments, Gff3, Gtf, Psl, Fasta] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 25 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 26 def __init__(self, input_json_file): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 27 self.inputFile = input_json_file | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 28 self.args = self.loadJson() | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 29 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 30 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 31 def loadJson(self): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 32 try: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 33 data_file = codecs.open(self.inputFile, 'r', 'utf-8') | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 34 return json.load(data_file) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 35 except IOError: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 36 print "Cannot find JSON file\n" | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 37 exit(1) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 38 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 39 def getToolDir(self): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 40 try: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 41 return self.args["tool_directory"] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 42 except KeyError: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 43 print ("tool_directory is not defined in the input file!") | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 44 exit(1) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 45 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 46 def getExtFilesPath(self): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 47 try: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 48 return self.args["extra_files_path"] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 49 except KeyError: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 50 print ("extra_files_path is not defined in the input file!") | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 51 exit(1) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 52 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 53 def getUserEmail(self): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 54 try: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 55 return self.args["user_email"] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 56 except KeyError: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 57 print ("user_email is not defined in the input file!") | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 58 exit(1) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 59 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 60 def getDebugMode(self): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 61 try: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 62 return self.args["debug_mode"] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 63 except KeyError: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 64 print ("debug_mode is not defined in the input file!") | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 65 exit(1) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 66 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 67 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 68 def getRefGenome(self): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 69 array_inputs_reference_genome = self.args["fasta"] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 70 # TODO: Replace these with the object Fasta | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 71 input_fasta_file = array_inputs_reference_genome["false_path"] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 72 input_fasta_file_name = santitizer.sanitize_name_input(array_inputs_reference_genome["name"]) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 73 genome_name = santitizer.sanitize_name_input(self.args["genome_name"]) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 74 reference_genome = Fasta(input_fasta_file, | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 75 input_fasta_file_name, genome_name) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 76 return reference_genome | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 77 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 78 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 79 def getTracksData(self): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 80 self.logger = logging.getLogger(__name__) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 81 all_datatype_dictionary = dict() | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 82 for datatype in self.DATATYPE_CLASS: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 83 class_name = datatype.__name__ | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 84 array_inputs = self.args.get(str(class_name)) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 85 if array_inputs: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 86 self.logger.debug("Create %s objects\n", class_name) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 87 self.logger.debug("array_inputs: %s", array_inputs) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 88 all_datatype_dictionary.update(self.create_ordered_datatype_objects(datatype, array_inputs)) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 89 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 90 return all_datatype_dictionary | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 91 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 92 def create_ordered_datatype_objects(self, ExtensionClass, array_inputs): | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 93 """ | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 94 Function which executes the creation all the necessary files / folders for a special Datatype, for TrackHub | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 95 and update the dictionary of datatype | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 96 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 97 :param ExtensionClass: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 98 :param array_inputs: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 99 :type ExtensionClass: Datatype | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 100 :type array_inputs: list[string] | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 101 """ | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 102 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 103 datatype_dictionary = {} | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 104 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 105 # TODO: Optimize this double loop | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 106 for input_data in array_inputs: | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 107 input_false_path = input_data["false_path"] | 
| 70 
39a32cb31623
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: 
66diff
changeset | 108 input_data["name"] = santitizer.sanitize_name_input(input_data["name"]) | 
| 66 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 109 extensionObject = ExtensionClass(input_false_path, input_data) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 110 extensionObject.generateCustomTrack() | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 111 datatype_dictionary.update({input_data["order_index"]: extensionObject}) | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 112 return datatype_dictionary | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 113 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 114 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 115 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 116 | 
| 
4ca7cbf2d9b8
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
 yating-l parents: diff
changeset | 117 | 
