# HG changeset patch # User yating-l # Date 1529427752 14400 # Node ID e7c4be523cb786c6ea53e89e87ae87902ac4fab9 # Parent 7e8a8b732db3afa3e33d6dcff9a3b23d7beb6b22 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 2f1b3cc8c9cb463e460f7f79efe99ed472700ecf diff -r 7e8a8b732db3 -r e7c4be523cb7 TrackDb.py --- a/TrackDb.py Wed May 16 18:04:20 2018 -0400 +++ b/TrackDb.py Tue Jun 19 13:02:32 2018 -0400 @@ -1,4 +1,5 @@ #!/usr/bin/python +import os import collections from util import santitizer @@ -21,7 +22,7 @@ def createTrackDb(self, track_name, long_label, short_label, file_path, track_type, extraSettings = None): # TODO: Remove the hardcoded "tracks" by the value used as variable from myTrackFolderPath - data_url = "tracks/%s" % track_name + data_url = "tracks/%s" % os.path.basename(file_path) if not short_label: short_label = TrackDb.getShortName(long_label) # Replace '_' by ' ', to invert the sanitization mecanism diff -r 7e8a8b732db3 -r e7c4be523cb7 hub-archive-creator.iml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hub-archive-creator.iml Tue Jun 19 13:02:32 2018 -0400 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 7e8a8b732db3 -r e7c4be523cb7 hubArchiveCreator.xml --- a/hubArchiveCreator.xml Wed May 16 18:04:20 2018 -0400 +++ b/hubArchiveCreator.xml Tue Jun 19 13:02:32 2018 -0400 @@ -1,4 +1,4 @@ - + This Galaxy tool permits to prepare your files to be ready for Assembly Hub visualization. diff -r 7e8a8b732db3 -r e7c4be523cb7 util/Reader.py --- a/util/Reader.py Wed May 16 18:04:20 2018 -0400 +++ b/util/Reader.py Tue Jun 19 13:02:32 2018 -0400 @@ -1,3 +1,4 @@ +import os import json import logging import codecs @@ -105,10 +106,14 @@ # TODO: Optimize this double loop for input_data in array_inputs: input_false_path = input_data["false_path"] - input_data["name"] = santitizer.sanitize_name_input(input_data["name"]) - extensionObject = ExtensionClass(input_false_path, input_data) - extensionObject.generateCustomTrack() - datatype_dictionary.update({input_data["order_index"]: extensionObject}) + # if the file is empty, skip the rest + if os.path.isfile(input_false_path) and os.path.getsize(input_false_path) > 0: + input_data["name"] = santitizer.sanitize_name_input(input_data["name"]) + extensionObject = ExtensionClass(input_false_path, input_data) + extensionObject.generateCustomTrack() + datatype_dictionary.update({input_data["order_index"]: extensionObject}) + else: + self.logger.info("The input file: %s is empty, skip creating the track for this data", input_data["name"]) return datatype_dictionary