diff jbrowse2.py @ 128:fce4ed3b1702 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a46026a5ea4f075b9053448616f22e8a83fa699a
author bgruening
date Mon, 07 Oct 2024 06:30:43 +0000
parents fbabf7498471
children e188a9d25ed2
line wrap: on
line diff
--- a/jbrowse2.py	Mon Oct 07 02:11:55 2024 +0000
+++ b/jbrowse2.py	Mon Oct 07 06:30:43 2024 +0000
@@ -1136,13 +1136,15 @@
         usePIF = False  # much faster if indexed remotely or locally
         useuri = data.startswith("http://") or data.startswith("https://")
         if not useuri:
-            dest = os.path.join(self.outdir, url)
-            self.symlink_or_copy(os.path.realpath(data), dest)
-            cmd = ["jbrowse", "make-pif", dest]
+            # self.symlink_or_copy(os.path.realpath(data), url)
+            # cmd = ["jbrowse", "make-pif", url]
+            url = '%s.pif.gz' % tId
+            cmd = "sort -b -n -k1,1 -k2,3 -k3,4 '%s' | bgzip -c > '%s'" % (data, url)
+            self.subprocess_popen(cmd)
+            cmd = ["tabix", "-b", "3", "-e", "4", "-f", url]
             self.subprocess_check_call(cmd)
             usePIF = True
-            url = '%s.pif.gz' % tId
-            nrow = self.getNrow(dest)
+            nrow = 1
         else:
             url = data
             if data.endswith(".pif.gz") or data.endswith(".paf.gz"):  # is tabix
@@ -1731,7 +1733,7 @@
                     for trak in trakdat:
                         if trak["trackId"] == key:
                             stile = trak.get("style", {})
-                    if track.find("options/style"):
+                    if len(track.find("options/style")) > 0:
                         for item in track.find("options/style"):
                             if item.text:
                                 stile[item.tag] = parse_style_conf(item)