# HG changeset patch # User fubar # Date 1706600963 0 # Node ID 9c7aa58857212119beeb6548677c622ec56a4f30 # Parent bde6b1d09f7d0b0f03026df29bf4f8263149eded planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit b831bbba43ba42d44be2a91800f387fa868c7d9d diff -r bde6b1d09f7d -r 9c7aa5885721 autogenJB2.py --- a/autogenJB2.py Tue Jan 30 06:05:03 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -import argparse -import os - -from jbrowse2 import jbrowseConnector as jbC - - - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="", epilog="") - parser.add_argument("--yaml", help="Track Configuration") - parser.add_argument("--outdir", help="Output directory", default="out") - parser.add_argument("--version", "-V", action="version", version="%(prog)s 0.0.1") - args = parser.parse_args() - if os.path.exists(args.outdir): - root = args.outdir - dirList = os.scandir(root) - subdirs = [f.path for f in dirList if f.is_dir()] - genome_paths = [f.path for f in dirList if f.name.startswith('genome') and f.is_file()] - if len(genome_paths) > 0: - genome_fnames = [os.path.basename(x).split('_')[2:] for x in genome_paths] # expect genome_1_genomename.fasta etc - jc = jbC( - outdir=args.outdir, - genomes=[ - { - "path": x, - "meta": {"name" : genome_fnames[i], }, - } - for i,x in enumerate(genome_paths) - ], - ) - jc.process_genomes() - # .add_default_view() replace from https://github.com/abretaud/tools-iuc/blob/jbrowse2/tools/jbrowse2/jbrowse2.py - default_session_data = { - "visibility": { - "default_on": [], - "default_off": [], - }, - "style": {}, - "style_labels": {}, - } - - track_paths = [x for x in genome_paths if not x.startswith('genome') and x.is_file()] - for i, track in enumerate(track_paths): - track_conf = {} - track_conf['format']= os.path.basename(track).split('_')[0] - track_conf["name"] = os.path.basename(track).split('_')[2:] # expect genome_1_genomename.fasta etc - fext = os.path.splitext(os.path.basename(track)).replace('.','') - track_conf["label"] = "%s_%i" % (os.path.basename(track), i) - track_conf["trackfiles"] = [] - keys = jc.process_annotations(track_conf) - - if keys: - for key in keys: - default_session_data["visibility"][ - track.attrib.get("visibility", "default_off") - ].append(key) - if track_conf.get("style", None): - default_session_data["style"][key] = track_conf[ - "style" - ] # TODO do we need this anymore? - if track_conf.get("style_lables", None): - default_session_data["style_labels"][key] = track_conf.get( - "style_labels", None - ) - # default_session_data["defaultLocation"] = root.find( - # "metadata/general/defaultLocation" - # ).text - # default_session_data["session_name"] = root.find( - # "metadata/general/session_name" - # ).text - # general_data = { - # "analytics": root.find("metadata/general/analytics").text, - # "primary_color": root.find("metadata/general/primary_color").text, - # "secondary_color": root.find("metadata/general/secondary_color").text, - # "tertiary_color": root.find("metadata/general/tertiary_color").text, - # "quaternary_color": root.find("metadata/general/quaternary_color").text, - # "font_size": root.find("metadata/general/font_size").text, - # } - # jc.add_general_configuration(general_data) - trackconf = jc.config_json.get("tracks", None) - if trackconf: - jc.config_json["tracks"].update(jc.tracksToAdd) - else: - jc.config_json["tracks"] = jc.tracksToAdd - jc.write_config() - jc.add_default_session(default_session_data) - # jc.text_index() not sure what broke here. diff -r bde6b1d09f7d -r 9c7aa5885721 autogenJB2.xml --- a/autogenJB2.xml Tue Jan 30 06:05:03 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ - - Files to JBrowse2 - - macros.xml - - - - jbrowse2 - - - python '${__tool_directory__}/autogenJB2.py' --version - to test the files I want to test. Hmph. -#if str($uglyTestingHack) == "enabled": - && cp '$trackxml' '$output' -#end if - ]]> - - - - - - - - - - `__, reviewer. -It is maintained by https://github.com/fubar2 who you can help you -with missing features or bugs in the tool. For the record, he remains unconvinced by the reviewer's logic, -and disturbed by the distinctly coercive approach to introducing new code, -compared to the more usual method of providing a working PR. - -Options -------- - -**Reference or Assembly** - -Choose either a built-in or select one from your history. - -Track coordinates and contig names *must* match this reference precisely -or they will not display. - -**Track Groups** represent a set of tracks in a single category. - -Annotation Tracks ------------------ - -GFF3/BED -~~~~~~~~ - -Standard feature tracks. They usually highlight genes, mRNAs and other features of interest along a genomic region. - -When these contain tens of millions of features, such as repeat regions from a VGP assembly, displaying one at a time leads -to extremely slow loading times when a large region is in view, unless the "LinearPileupDisplay" display option is -selected for that track in the styling options section. The default is LinearBasicDisplay, which shows all details and works -well for relatively sparse bed files. A better option is to make a bigwig track using a set of windows based on the -lengths of each assembly or reference contig. - -BAM Pileups -~~~~~~~~~~~ - -We support BAM files and can automatically generate SNP tracks based on -that bam data. - - -BlastXML -~~~~~~~~ - -JiG now supports both blastn and blastp datasets. JiG internally uses a -blastXML to gapped GFF3 tool to convert your blastxml datasets into a -format amenable to visualization in JBrowse. This tool is also -available separately from the IUC on the toolshed. - -**Minimum Gap Size** reflects how long a gap must be before it becomes a -real gap in the processed gff3 file. In the picture above, various sizes -of gaps can be seen. If the minimum gap size was set much higher, say -100nt, many of the smaller gaps would disappear, and the features on -both sides would be merged into one, longer feature. This setting is -inversely proportional to runtime and output file size. *Do not set this -to a low value for large datasets*. By setting this number lower, you -will have extremely large outputs and extremely long runtimes. The -default was configured based off of the author's experience, but the -author only works on small viruses. It is *strongly* recommended that -you filter your blast results before display, e.g. picking out the top -10 hits or so. - -**Protein blast search** option merely informs underlying tools that -they should adjust feature locations by 3x. - - -@ATTRIBUTION@ -]]> - -