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

Changeset 25:99dad5f9444c (2017-06-02)
Previous changeset 24:fcc1021bd496 (2017-05-31) Next changeset 26:df42241d3731 (2017-07-03)
Commit message:
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 93e2e2fb59f99677425104a80c17f665fa7b2b4a-dirty
modified:
tool_dependencies.xml
util/subtools.py
b
diff -r fcc1021bd496 -r 99dad5f9444c tool_dependencies.xml
--- a/tool_dependencies.xml Wed May 31 11:35:16 2017 -0400
+++ b/tool_dependencies.xml Fri Jun 02 17:36:24 2017 -0400
b
@@ -19,11 +19,11 @@
         <repository changeset_revision="a819439b6d76" name="package_ucsc_hac_340" owner="yating-l" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
     <package name="ucsc_bigbed" version="340">
-        <repository changeset_revision="b23d341df89d" name="package_ucsc_bigbed_340" owner="yating-l" toolshed="https://toolshed.g2.bx.psu.edu" />
+        <repository changeset_revision="e3faf2af4e59" name="package_ucsc_bigbed_340" owner="yating-l" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 
     <package name="ucsc_bigwig" version="340">      
-        <repository changeset_revision="b1fb46f92da0" name="package_ucsc_bigwig_340" owner="yating-l" toolshed="https://toolshed.g2.bx.psu.edu" />
+        <repository changeset_revision="5ba6d8812c60" name="package_ucsc_bigwig_340" owner="yating-l" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 
 </tool_dependency>
b
diff -r fcc1021bd496 -r 99dad5f9444c util/subtools.py
--- a/util/subtools.py Wed May 31 11:35:16 2017 -0400
+++ b/util/subtools.py Fri Jun 02 17:36:24 2017 -0400
[
@@ -11,6 +11,7 @@
 import subprocess
 import sys
 import string
+import tempfile
 
 class PopenError(Exception):
     def __init__(self, cmd, error, return_code):
@@ -128,7 +129,9 @@
     :param gene_pred_file_name:
     :return:
     """
-    array_call = ['gff3ToGenePred', input_gff3_file_name, gene_pred_file_name]
+    valid_gff3_file = tempfile.NamedTemporaryFile(bufsize=0, suffix=".gff3")
+    validateGff(input_gff3_file_name, valid_gff3_file.name)
+    array_call = ['gff3ToGenePred', valid_gff3_file.name, gene_pred_file_name]
     p = _handleExceptionAndCheckCall(array_call)
     return p
 
@@ -256,3 +259,19 @@
     sanitize_name = ''.join([c if c in valid_chars else '_' for c in filename])
     sanitize_name = "gonramp_" + sanitize_name
     return sanitize_name
+
+def validateGff(orig_gff3, valid_gff3):
+    """
+    Remove extra meta line: ##gff-version 3
+    """
+    valid = open(valid_gff3, 'w')
+    num = 0
+    with open(orig_gff3, 'r') as f:
+        for line in f:
+            if '##gff-version 3' in line:
+                if num == 0:
+                    num += 1
+                else:
+                    continue
+            valid.write(line)
+