changeset 42:bf05cda04e1f draft

planemo upload
author scottx611x
date Fri, 08 Jul 2016 14:33:30 -0400
parents 2dbaaa6e8344
children e42284a13168
files data_manager_gene_annotation/data_manager/data_manager.py
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)
             }
         }