Mercurial > repos > fubar > jbrowse2
changeset 72:2bdb748df098 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
author | fubar |
---|---|
date | Sat, 30 Mar 2024 22:33:29 +0000 |
parents | e26a8a6d2d2e |
children | 3b2815efa5d9 |
files | autogenJB2.py jbrowse2.py |
diffstat | 2 files changed, 22 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/autogenJB2.py Sat Mar 30 07:15:04 2024 +0000 +++ b/autogenJB2.py Sat Mar 30 22:33:29 2024 +0000 @@ -175,6 +175,8 @@ "gff3", "vcf", "maf", + "bed", + "hic" ]: default_session_data["visibility"]["default_on"].append(key) else:
--- a/jbrowse2.py Sat Mar 30 07:15:04 2024 +0000 +++ b/jbrowse2.py Sat Mar 30 22:33:29 2024 +0000 @@ -1106,6 +1106,13 @@ def add_paf(self, data, trackData, pafOpts, **kwargs): tname = trackData["name"] tId = trackData["label"] + url = "%s.paf" % tId + useuri = data.startswith("http://") or data.startswith("https://") + if not useuri: + dest = "%s/%s" % (self.outdir, url) + self.symlink_or_copy(os.path.realpath(data), dest) + else: + url = data categ = trackData["category"] pgnames = [ x.strip() for x in pafOpts["genome_label"].split(",") if len(x.strip()) > 0 @@ -1119,7 +1126,6 @@ % (pafOpts, pgnames, pgpaths, tId) ) for i, gname in enumerate(pgnames): - lab = trackData["label"] if len(gname.split()) > 1: gname = gname.split()[0] passnames.append(gname) @@ -1127,19 +1133,13 @@ useuri = pgpaths[i].startswith("http://") or pgpaths[i].startswith( "https://" ) - if not useuri: - url = "%s.paf" % (lab) - else: - url = data + if gname not in self.genome_names: # ignore if already there - eg for duplicates among pafs. asstrack = self.make_assembly(pgpaths[i], gname, useuri) self.genome_names.append(gname) self.tracksToAdd[gname] = [] self.assemblies.append(asstrack) - if not useuri: - dest = "%s/%s" % (self.outdir, url) - self.symlink_or_copy(os.path.realpath(data), dest) trackDict = { "type": "SyntenyTrack", "trackId": tId, @@ -1156,16 +1156,19 @@ "displays": [ { "type": "LGVSyntenyDisplay", - "displayId": "%s-LGVSyntenyDisplay" % lab, + "displayId": "%s-LGVSyntenyDisplay" % tId, }, - {"type": "DotplotDisplay", "displayId": "%s-DotplotDisplay" % lab}, + { + "type": "DotplotDisplay", + "displayId": "%s-DotplotDisplay" % tId, + }, { "type": "LinearComparativeDisplay", - "displayId": "%s-LinearComparativeDisplay" % lab, + "displayId": "%s-LinearComparativeDisplay" % tId, }, { "type": "LinearSyntenyDisplay", - "displayId": "%s-LinearSyntenyDisplay" % lab, + "displayId": "%s-LinearSyntenyDisplay" % tId, }, ], } @@ -1173,7 +1176,7 @@ "displays": [ { "type": "LGVSyntenyDisplay", - "displayId": "%s-LGVSyntenyDisplay" % lab, + "displayId": "%s-LGVSyntenyDisplay" % tId, } ] } @@ -1343,9 +1346,9 @@ drdict = { "reversed": False, "assemblyName": gnome, - "start": 1, + "start": 0, "end": 100000, - "refName": refName + "refName": refName, } ddl = default_data.get("defaultLocation", None) if ddl: @@ -1383,10 +1386,10 @@ session_json["views"] = session_views else: session_json["views"] += session_views - + pp = json.dumps(session_views, indent=2) config_json["defaultSession"] = session_json self.config_json.update(config_json) - + logging.debug("defaultSession=%s" % (pp)) with open(self.config_json_file, "w") as config_file: json.dump(self.config_json, config_file, indent=2)