Repository 'hubarchivecreator'
hg clone https://toolshed.g2.bx.psu.edu/repos/rmarenco/hubarchivecreator

Changeset 30:e7c4be523cb7 (2018-06-19)
Previous changeset 29:7e8a8b732db3 (2018-05-16) Next changeset 31:9c5d82d3c87e (2018-06-19)
Commit message:
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 2f1b3cc8c9cb463e460f7f79efe99ed472700ecf
modified:
TrackDb.py
hubArchiveCreator.xml
util/Reader.py
added:
hub-archive-creator.iml
b
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
b
@@ -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
b
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
b
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
\ No newline at end of file
b
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
b
@@ -1,4 +1,4 @@
-<tool id="hubArchiveCreator" name="Hub Archive Creator" version="2.5.0">
+<tool id="hubArchiveCreator" name="Hub Archive Creator" version="2.5.2">
     <description>
         This Galaxy tool permits to prepare your files to be ready for
         Assembly Hub visualization.
b
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