Repository 'data_manager_fetch_gene_annotation'
hg clone https://toolshed.g2.bx.psu.edu/repos/scottx611x/data_manager_fetch_gene_annotation

Changeset 42:bf05cda04e1f (2016-07-08)
Previous changeset 41:2dbaaa6e8344 (2016-07-08) Next changeset 43:e42284a13168 (2016-07-08)
Commit message:
planemo upload
modified:
data_manager_gene_annotation/data_manager/data_manager.py
b
diff -r 2dbaaa6e8344 -r bf05cda04e1f data_manager_gene_annotation/data_manager/data_manager.py
--- a/data_manager_gene_annotation/data_manager/data_manager.py Fri Jul 08 11:47:55 2016 -0400
+++ b/data_manager_gene_annotation/data_manager/data_manager.py Fri Jul 08 14:33:30 2016 -0400
[
@@ -1,6 +1,5 @@
 import os
 import sys
-import uuid
 import json
 import argparse
 import requests
@@ -42,7 +41,7 @@
     parser.add_argument('--out', dest='output', action='store',
                         help='JSON filename')
     parser.add_argument('--name', dest='name', action='store',
-                        default=uuid.uuid4(), help='Data table entry unique ID'
+                        default=None, help='Data table entry unique ID'
                         )
     parser.add_argument('--url', dest='url', action='store',
                         help='Url to download gtf file from')
@@ -54,13 +53,18 @@
     # Attempt to download gene annotation file from given url
     gene_annotation_file_name = url_download(args.url)
 
+    name = str(args.name)
+
+    if not name:
+        name = gene_annotation_file_name.split(".")[0]
+
     # Update Data Manager JSON and write to file
     data_manager_entry = {
         'data_tables': {
             'gene_annotation': {
-                'value': gene_annotation_file_name,
+                'value': gene_annotation_file_name.split(".")[0],
                 'dbkey': gene_annotation_file_name.split(".")[0],
-                'name': str(args.name),
+                'name': name,
                 'path': os.path.join(work_dir, gene_annotation_file_name)
             }
         }