diff jbrowse2.py @ 29:f728cf0df71d draft

planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit fe89199bded3f50aefb6958f0c4e85eede77ad81-dirty
author fubar
date Fri, 16 Feb 2024 00:04:37 +0000
parents 9a5c409f33f4
children 8f02a84ee278
line wrap: on
line diff
--- a/jbrowse2.py	Wed Feb 07 22:51:54 2024 +0000
+++ b/jbrowse2.py	Fri Feb 16 00:04:37 2024 +0000
@@ -564,11 +564,7 @@
         # can be served - if public.
         # dsId = trackData["metadata"]["dataset_id"]
         # url = "%s/api/datasets/%s/display?to_ext=hic " % (self.giURL, dsId)
-        hname = trackData["name"]
-        dest = os.path.join(self.outdir, hname)
-        cmd = ["cp", data, dest]
-        # these can be very big.
-        self.subprocess_check_call(cmd)
+        hname = trackData["hic_url"]
         floc = {
             "uri": hname,
         }
@@ -774,7 +770,6 @@
         trackDict["style"] = style_json
         self.tracksToAdd.append(trackDict)
         self.trackIdlist.append(tId)
-        logging.info("#### wig trackData=%s" % str(trackData))
 
     def add_bam(self, data, trackData, bamOpts, bam_index=None, **kwargs):
         tId = trackData["label"]
@@ -1152,9 +1147,8 @@
                     outputTrackConfig,
                 )
             elif dataset_ext in ("cool", "mcool", "scool"):
-                hic_path = os.path.join(
-                    self.outdir, "%s_%d_%s.hic" % (track_human_label, i, dataset_ext)
-                )
+                hic_url = "%s_%d.hic" % (track_human_label, i)
+                hic_path = os.path.join(self.outdir, hic_url)
                 self.subprocess_check_call(
                     [
                         "hictk",
@@ -1166,6 +1160,7 @@
                         hic_path,
                     ]
                 )
+                outputTrackConfig["hic_url"] = hic_url
                 self.add_hic(
                     hic_path,
                     outputTrackConfig,
@@ -1227,7 +1222,7 @@
                     track["conf"]["options"]["paf"],
                 )
             else:
-                log.warn("Do not know how to handle %s", dataset_ext)
+                logging.warn("Do not know how to handle %s", dataset_ext)
             # Return non-human label for use in other fields
             yield outputTrackConfig["label"]
 
@@ -1292,7 +1287,8 @@
                     "@@@ regexp could not match contig:start..end in the supplied location %s - please fix"
                     % ddl
                 )
-
+        else:
+            drdict["refName"] = self.genome_firstcontig
         if drdict.get("refName", None):
             # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome
             view_json["displayedRegions"] = [