# HG changeset patch # User fubar # Date 1719012871 0 # Node ID 990291e918c793282a16caafa6131cccb54b61fc # Parent b1260bca5fdc06d62a00724be21f867b866ace80 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty diff -r b1260bca5fdc -r 990291e918c7 __pycache__/jbrowse2.cpython-312.pyc Binary file __pycache__/jbrowse2.cpython-312.pyc has changed diff -r b1260bca5fdc -r 990291e918c7 jbrowse2.py --- a/jbrowse2.py Wed Jun 05 10:00:07 2024 +0000 +++ b/jbrowse2.py Fri Jun 21 23:34:31 2024 +0000 @@ -20,8 +20,8 @@ logging.basicConfig(level=logging.DEBUG) log = logging.getLogger("jbrowse") -JB2VER = "v2.11.0" -# version pinned if cloning - but not used until now +JB2VER = "v2.11.1" +# version pinned if cloning - but not cloning now logCommands = True # useful for seeing what's being written but not for production setups TODAY = datetime.datetime.now().strftime("%Y-%m-%d") @@ -455,7 +455,7 @@ log.error(command) log.error(output) log.error(err) - raise RuntimeError(f"Command ( {command} ) failed with exit code {retcode}") + raise RuntimeError("Command failed with exit code %s" % (retcode)) def subprocess_check_output(self, command): if logCommands: @@ -698,8 +698,8 @@ ] } categ = trackData["category"] - fname = f"{tId}" - dest = os.path.join(self.outdir, fname) + fname = tId + dest = "%s/%s" % (self.outdir, fname) gname = trackData["assemblyNames"] cmd = [ @@ -1198,6 +1198,9 @@ def process_annotations(self, track): category = track["category"].replace("__pd__date__pd__", TODAY) + tt1 = ",/ :;\\" + tt2 = "______" + labttab = str.maketrans(tt1,tt2) for trackIndex, ( dataset_path, dataset_ext, @@ -1209,20 +1212,12 @@ # Unsanitize labels (element_identifiers are always sanitized by Galaxy) for key, value in mapped_chars.items(): track_human_label = track_human_label.replace(value, key) - track_human_label = track_human_label.replace(" ", "_") + track_human_label = track_human_label.translate(labttab) outputTrackConfig = { "category": category, "style": {}, } - # hashData = [ - # str(dataset_path), - # track_human_label, - # track["category"], - # ] - # hashData = "|".join(hashData).encode("utf-8") - # hash_string = hashlib.md5(hashData).hexdigest() - outputTrackConfig["assemblyNames"] = track["assemblyNames"] outputTrackConfig["key"] = track_human_label outputTrackConfig["useuri"] = useuri @@ -1230,13 +1225,6 @@ outputTrackConfig["ext"] = dataset_ext outputTrackConfig["trackset"] = track.get("trackset", {}) outputTrackConfig["label"] = track["label"] - # outputTrackConfig["label"] = "%s_%i_%s_%s" % ( - # dataset_ext, - # trackIndex, - # track_human_label, - # hash_string, - # ) - outputTrackConfig["metadata"] = extra_metadata outputTrackConfig["name"] = track_human_label if track["label"] in self.trackIdlist: @@ -1331,6 +1319,7 @@ https://github.com/abretaud/tools-iuc/blob/jbrowse2/tools/jbrowse2/jbrowse2.py """ # TODO using the default session for now, but check out session specs in the future https://github.com/GMOD/jbrowse-components/issues/2708 + bpPerPx = 50 # this is tricky since browser window width is unknown - this seems a compromise that sort of works.... track_types = {} with open(self.config_json_file, "r") as config_file: config_json = json.load(config_file) @@ -1369,24 +1358,17 @@ "displays": [style_data], } ) - view_json = { - "type": "LinearGenomeView", - "offsetPx": 0, - "minimized": False, - "tracks": tracks_data, - } first = [x for x in self.ass_first_contigs if x[0] == gnome] - if len(first) > 0: - [gnome, refName, end] = first[0] - start = 0 - end = int(end) - drdict = { - "refName": refName, - "start": start, - "end": end, + drdict = { "reversed": False, "assemblyName": gnome, } + if len(first) > 0: + [gnome, refName, end] = first[0] + drdict["refName"] = refName + drdict["start"] = 0 + end = int(end) + drdict["end"] = end else: ddl = default_data.get("defaultLocation", None) if ddl: @@ -1404,6 +1386,13 @@ "@@@ regexp could not match contig:start..end in the supplied location %s - please fix" % ddl ) + view_json = { + "type": "LinearGenomeView", + "offsetPx": 0, + "bpPerPx" : bpPerPx, + "minimized": False, + "tracks": tracks_data + } if drdict.get("refName", None): # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome view_json["displayedRegions"] = [ @@ -1628,7 +1617,7 @@ if trackfiles: for x in trackfiles: track_conf["label"] = "%s_%d" % ( - x.attrib["label"].replace(" ", "_").replace(",", ""), + x.attrib["label"].replace(" ", "_").replace(",", "_").replace("/","_"), trackI, ) trackI += 1 diff -r b1260bca5fdc -r 990291e918c7 jbrowse2.xml --- a/jbrowse2.xml Wed Jun 05 10:00:07 2024 +0000 +++ b/jbrowse2.xml Fri Jun 21 23:34:31 2024 +0000 @@ -8,6 +8,7 @@ jbrowse2 + @@ -28,9 +29,9 @@ #if $autoCollection[$key].is_collection: #set subCol=$autoCollection[$key] #set pafs=[($subCol[x],$subcol[x].ext,x) for x in $subCol.keys() if $subCol[x].ext == 'paf'] + #set refs=[($subCol[x],$subcol[x].ext,x) for x in $subCol.keys() if $subCol[x].ext in ['fasta.gz','fasta']] #if len($pafs) > 0: --pafmeta '$pafs[0]' - #set refs = [($pafs[0][2],$subCol[x],x) for x in $subCol.keys() if $subCol[x].ext == 'fasta'] #for $ref in $refs: --pafreferencemeta '$ref' #end for @@ -314,7 +315,7 @@ ]]> - + @@ -334,8 +335,11 @@ - - + + + + @@ -343,16 +347,16 @@ - + - + - + @@ -404,6 +408,7 @@ + @@ -1129,29 +1134,31 @@ JBrowse2-in-Galaxy offers a highly configurable, workflow-compatible Genome viewer. -Compared to JBrowse1-in-Galaxy, there is no support for alternative codons for unusual genomes, -and detailed track styling is not yet implemented. Please contact us if you are missing features. Use and local viewing ===================== +All tracks have a coordinate system, based on the reference genome, so that must be chosen before adding groups of tracks. +There are 10 Galaxy datatypes that can be turned into a track for display - in all cases, the selected reference genome must have been +used to generate the data: + + bam + bed + bigwig + blastxml + cram + gff3 + hic + maf + paf + vcf + +cram and bam will be large, so very slow amd are only recommended if you need the cigar annotation. +Otherwise conversion to bed is recommended to slim them down. +Unfortunately if you have millions of rows in a bed, it will also be very slow - in which case a bigwig is recommended. A JBrowse2 history item can be opened by viewing it (the "eye" icon). -The same browser data and setup can also be downloaded as a compressed zip archive by clicking the download ("floppy disk") icon in the history. -This can be shared and viewed without Galaxy. - -A replacement application to serve the browser is required without Galaxy. A local python web server can be started using a script included in each archive, -assuming that Python3 is already working on your desktop - if not you will have to install it first. Unzip the archive (*unzip [filename].zip*) and change -directory to the first level in that zip archive. It contains a file named *jb2_webserver.py* - -With python3 installed, - -*python3 jb2_webserver.py* - -will serve the unarchived JBrowse2 configuration from the same directory as the python script automatically. If a new browser window does not open, -but the script appears to be running, try pointing your web browser to the default of *localhost:8080* - Overview -------- @@ -1175,6 +1182,7 @@ **Track Groups** represent a set of tracks in a single category. + Annotation Tracks ----------------- @@ -1232,6 +1240,22 @@ **Protein blast search** option merely informs underlying tools that they should adjust feature locations by 3x. +Local viewing +============= + +The same browser data and setup can also be downloaded as a compressed zip archive by clicking the download ("floppy disk") icon in the history. +This can be shared and viewed without Galaxy. + +A replacement application to serve the browser is required without Galaxy. A local python web server can be started using a script included in each archive, +assuming that Python3 is already working on your desktop - if not you will have to install it first. Unzip the archive (*unzip [filename].zip*) and change +directory to the first level in that zip archive. It contains a file named *jb2_webserver.py* + +With python3 installed, + +*python3 jb2_webserver.py* + +will serve the unarchived JBrowse2 configuration from the same directory as the python script automatically. If a new browser window does not open, +but the script appears to be running, try pointing your web browser to the default of *localhost:8080* ]]> diff -r b1260bca5fdc -r 990291e918c7 macros.xml --- a/macros.xml Wed Jun 05 10:00:07 2024 +0000 +++ b/macros.xml Fri Jun 21 23:34:31 2024 +0000 @@ -333,6 +333,13 @@ + + + + + + + @@ -432,13 +439,13 @@ - + - +