diff jbrowse.py @ 12:db5fe5a3176a draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 2bfbb5ae6b801e43355fdc3f964a5111fe3fe3a1
author iuc
date Mon, 06 Feb 2017 12:52:09 -0500
parents 4cbceec1d6b4
children 69c5e9c0add0
line wrap: on
line diff
--- a/jbrowse.py	Wed Dec 14 09:19:48 2016 -0500
+++ b/jbrowse.py	Mon Feb 06 12:52:09 2017 -0500
@@ -158,7 +158,7 @@
         return r, g, b
 
     def parse_menus(self, track):
-        trackConfig = {'menuTemplate': [{}, {}, {}]}
+        trackConfig = {'menuTemplate': [{}, {}, {}, {}]}
 
         if 'menu' in track['menus']:
             menu_list = [track['menus']['menu']]
@@ -435,8 +435,9 @@
         cmd = ['ln', data, dest]
         self.subprocess_check_call(cmd)
 
+        url = os.path.join('raw', trackData['label'] + '.bw')
         trackData.update({
-            "urlTemplate": os.path.join('..', dest),
+            "urlTemplate": url,
             "storeClass": "JBrowse/Store/SeqFeature/BigWig",
             "type": "JBrowse/View/Track/Wiggle/Density",
         })
@@ -460,8 +461,9 @@
         cmd = ['ln', '-s', os.path.realpath(bam_index), dest + '.bai']
         self.subprocess_check_call(cmd)
 
+        url = os.path.join('raw', trackData['label'] + '.bam')
         trackData.update({
-            "urlTemplate": os.path.join('..', dest),
+            "urlTemplate": url,
             "type": "JBrowse/View/Track/Alignments2",
             "storeClass": "JBrowse/Store/SeqFeature/BAM",
         })
@@ -487,8 +489,9 @@
         cmd = ['tabix', '-p', 'vcf', dest + '.gz']
         self.subprocess_check_call(cmd)
 
+        url = os.path.join('raw', trackData['label'] + '.vcf')
         trackData.update({
-            "urlTemplate": os.path.join('..', dest + '.gz'),
+            "urlTemplate": url,
             "type": "JBrowse/View/Track/HTMLVariants",
             "storeClass": "JBrowse/Store/SeqFeature/VCFTabix",
         })
@@ -564,8 +567,9 @@
                 else:
                     outputTrackConfig[key] = colourOptions[key]
 
-            menus = self.cs.parse_menus(track['conf']['options'])
-            outputTrackConfig.update(menus)
+            if 'menus' in track['conf']['options']:
+                menus = self.cs.parse_menus(track['conf']['options'])
+                outputTrackConfig.update(menus)
 
             # import pprint; pprint.pprint(track)
             # import sys; sys.exit()