# HG changeset patch # User fubar # Date 1709803386 0 # Node ID bdfa6a7c45436484a96275642e29029195dfe0ba # Parent ae12977c0e5e50d54a4633bcf8e8f41ae820a77a planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4-dirty diff -r ae12977c0e5e -r bdfa6a7c4543 autogenJB2.py --- a/autogenJB2.py Thu Mar 07 06:41:01 2024 +0000 +++ b/autogenJB2.py Thu Mar 07 09:23:06 2024 +0000 @@ -129,10 +129,8 @@ elif trext == "cram": ipath = track[3] if not os.path.exists(ipath): - jc.logging.info('calling %s' % ' '.join(cmd)) ipath = os.path.realpath(os.path.join('./', trackname + '.crai')) cmd = ["samtools", "index", "-c", "-o", ipath, os.path.realpath(track[0])] - sys.stdout.write('#### calling %s' % ' '.join(cmd)) jc.subprocess_check_call(cmd) track_conf.update({"conf": {"options": {"cram": {"cram_index": ipath}}}}) track_conf["path"] = tpath diff -r ae12977c0e5e -r bdfa6a7c4543 jbrowse2.py --- a/jbrowse2.py Thu Mar 07 06:41:01 2024 +0000 +++ b/jbrowse2.py Thu Mar 07 09:23:06 2024 +0000 @@ -10,6 +10,7 @@ import shutil import struct import subprocess +import sys import tempfile import urllib.request import xml.etree.ElementTree as ET @@ -467,6 +468,7 @@ self.genome_name = ( genome_name # first one for all tracks - other than paf ) + self.genome_sequence_adapter = assem["sequence"]["adapter"] self.genome_firstcontig = None if not useuri: # https://lazarus.name/jbrowse/fish/bigwig_0_coverage_bedgraph_cov_count_count_bw.bigwig @@ -529,7 +531,7 @@ "uri": faname + ".gzi", }, } - self.genome_sequence_adapter = adapter + trackDict = { "name": gname, "sequence": { @@ -874,27 +876,20 @@ else: fname = "%s.cram" % trackData["label"] dest = "%s/%s" % (self.outdir, fname) - bindex = fname + '.bai' + bindex = fname + '.crai' url = fname self.subprocess_check_call(["cp", data, dest]) - if bindex is not None and os.path.exists(bindex): if not os.path.exists(dest+'.crai'): # most probably made by galaxy and stored in galaxy dirs, need to copy it to dest self.subprocess_check_call( ["cp", os.path.realpath(cram_index), dest + ".crai"] ) - else: - # Can happen in exotic condition - # e.g. if bam imported as symlink with datatype=unsorted.bam, then datatype changed to bam - # => no index generated by galaxy, but there might be one next to the symlink target - # this trick allows to skip the bam sorting made by galaxy if already done outside - if os.path.exists(os.path.realpath(data) + ".crai"): - self.symlink_or_copy( - os.path.realpath(data) + ".crai", dest + ".crai" - ) - else: - log.warn("Could not find a cram index (.crai file) for %s", data) + else: + cpath = os.path.realpath(dest) + '.crai' + cmd = ["samtools", "index", "-c", "-o", cpath, os.path.realpath(dest)] + logging.debug('executing cmd %s' % ' '.join(cmd)) + self.subprocess_check_call(cmd) trackDict = { "type": "AlignmentsTrack", "trackId": tId, @@ -1280,8 +1275,8 @@ drdict = { "reversed": False, "assemblyName": self.genome_name, - "start": 0, - "end": 100000, + "start": 2000, + "end": 0, "refName": "x", } diff -r ae12977c0e5e -r bdfa6a7c4543 jbrowse2.xml --- a/jbrowse2.xml Thu Mar 07 06:41:01 2024 +0000 +++ b/jbrowse2.xml Thu Mar 07 09:23:06 2024 +0000 @@ -275,7 +275,8 @@ help="If your genome of interest is not listed, contact the Galaxy team" label="Select a reference genome" name="genome" - type="select"> + type="select" + optional="true"> @@ -288,7 +289,8 @@ format="fasta" label="Select the reference genome" name="genome" - type="data"> + type="data" + optional="true"> @@ -318,9 +320,9 @@ + - - +