Mercurial > repos > iuc > jbrowse
changeset 17:ff11d442feed draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 908f16ea4eb082227437dc93e06e8cb742f5a257
author | iuc |
---|---|
date | Wed, 15 Nov 2017 15:15:27 -0500 |
parents | b5c5470d7c09 |
children | 836d1aa3e89a |
files | all_fasta.loc.sample blastxml_to_gapped_gff3.py gff3_rebase.py jbrowse.py jbrowse.xml macros.xml test-data/bam/test.xml test-data/blastxml/test.xml test-data/bw/data.bw test-data/bw/test.xml test-data/gencode/test-1.xml test-data/gencode/test.xml test-data/gff3/test.xml test-data/menus/test.xml test-data/track_config/test.xml test-data/vcf/test.xml |
diffstat | 16 files changed, 1077 insertions(+), 139 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all_fasta.loc.sample Wed Nov 15 15:15:27 2017 -0500 @@ -0,0 +1,18 @@ +#This file lists the locations and dbkeys of all the fasta files +#under the "genome" directory (a directory that contains a directory +#for each build). The script extract_fasta.py will generate the file +#all_fasta.loc. This file has the format (white space characters are +#TAB characters): +# +#<unique_build_id> <dbkey> <display_name> <file_path> +# +#So, all_fasta.loc could look something like this: +# +#apiMel3 apiMel3 Honeybee (Apis mellifera): apiMel3 /path/to/genome/apiMel3/apiMel3.fa +#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /path/to/genome/hg19/hg19canon.fa +#hg19full hg19 Human (Homo sapiens): hg19 Full /path/to/genome/hg19/hg19full.fa +# +#Your all_fasta.loc file should contain an entry for each individual +#fasta file. So there will be multiple fasta files for each build, +#such as with hg19 above. +#
--- a/blastxml_to_gapped_gff3.py Wed Sep 13 13:07:20 2017 -0400 +++ b/blastxml_to_gapped_gff3.py Wed Nov 15 15:15:27 2017 -0500 @@ -6,47 +6,58 @@ import sys from BCBio import GFF - logging.basicConfig(level=logging.INFO) log = logging.getLogger(name='blastxml2gff3') -__author__ = "Eric Rasche" -__version__ = "0.4.0" -__maintainer__ = "Eric Rasche" -__email__ = "esr@tamu.edu" - __doc__ = """ BlastXML files, when transformed to GFF3, do not normally show gaps in the blast hits. This tool aims to fill that "gap". """ -def blastxml2gff3(blastxml, min_gap=3, trim=False, trim_end=False): +def blastxml2gff3(blastxml, min_gap=3, trim=False, trim_end=False, include_seq=False): from Bio.Blast import NCBIXML from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.SeqFeature import SeqFeature, FeatureLocation blast_records = NCBIXML.parse(blastxml) - records = [] - for record in blast_records: + for idx_record, record in enumerate(blast_records): # http://www.sequenceontology.org/browser/release_2.4/term/SO:0000343 match_type = { # Currently we can only handle BLASTN, BLASTP 'BLASTN': 'nucleotide_match', 'BLASTP': 'protein_match', }.get(record.application, 'match') - rec = SeqRecord(Seq("ACTG"), id=record.query) - for hit in record.alignments: - for hsp in hit.hsps: + recid = record.query + if ' ' in recid: + recid = recid[0:recid.index(' ')] + + rec = SeqRecord(Seq("ACTG"), id=recid) + for idx_hit, hit in enumerate(record.alignments): + for idx_hsp, hsp in enumerate(hit.hsps): qualifiers = { + "ID": 'b2g.%s.%s.%s' % (idx_record, idx_hit, idx_hsp), "source": "blast", "score": hsp.expect, "accession": hit.accession, "hit_id": hit.hit_id, "length": hit.length, - "hit_titles": hit.title.split(' >') + "hit_titles": hit.title.split(' >'), } + if include_seq: + qualifiers.update({ + 'blast_qseq': hsp.query, + 'blast_sseq': hsp.sbjct, + 'blast_mseq': hsp.match, + }) + + for prop in ('score', 'bits', 'identities', 'positives', + 'gaps', 'align_length', 'strand', 'frame', + 'query_start', 'query_end', 'sbjct_start', + 'sbjct_end'): + qualifiers['blast_' + prop] = getattr(hsp, prop, None) + desc = hit.title.split(' >')[0] qualifiers['description'] = desc[desc.index(' '):] @@ -62,14 +73,11 @@ # protein. parent_match_end = hsp.query_start + hit.length + hsp.query.count('-') - # However, if the user requests that we trim the feature, then - # we need to cut the ``match`` start to 0 to match the parent feature. - # We'll also need to cut the end to match the query's end. It (maybe) - # should be the feature end? But we don't have access to that data, so - # We settle for this. + # If we trim the left end, we need to trim without losing information. + used_parent_match_start = parent_match_start if trim: if parent_match_start < 1: - parent_match_start = 0 + used_parent_match_start = 0 if trim or trim_end: if parent_match_end > hsp.query_end: @@ -77,7 +85,7 @@ # The ``match`` feature will hold one or more ``match_part``s top_feature = SeqFeature( - FeatureLocation(parent_match_start, parent_match_end), + FeatureLocation(used_parent_match_start, parent_match_end), type=match_type, strand=0, qualifiers=qualifiers ) @@ -87,19 +95,15 @@ "source": "blast", } top_feature.sub_features = [] - for start, end, cigar in generate_parts(hsp.query, hsp.match, - hsp.sbjct, - ignore_under=min_gap): + for idx_part, (start, end, cigar) in \ + enumerate(generate_parts(hsp.query, hsp.match, + hsp.sbjct, + ignore_under=min_gap)): part_qualifiers['Gap'] = cigar - part_qualifiers['ID'] = hit.hit_id + part_qualifiers['ID'] = qualifiers['ID'] + ('.%s' % idx_part) - if trim: - # If trimming, then we start relative to the - # match's start - match_part_start = parent_match_start + start - else: - # Otherwise, we have to account for the subject start's location - match_part_start = parent_match_start + hsp.sbjct_start + start - 1 + # Otherwise, we have to account for the subject start's location + match_part_start = parent_match_start + hsp.sbjct_start + start - 1 # We used to use hsp.align_length here, but that includes # gaps in the parent sequence @@ -117,8 +121,7 @@ rec.features.append(top_feature) rec.annotations = {} - records.append(rec) - return records + yield rec def __remove_query_gaps(query, match, subject): @@ -253,11 +256,13 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='Convert Blast XML to gapped GFF3', epilog='') - parser.add_argument('blastxml', type=open, help='Blast XML Output') + parser.add_argument('blastxml', type=argparse.FileType("r"), help='Blast XML Output') parser.add_argument('--min_gap', type=int, help='Maximum gap size before generating a new match_part', default=3) parser.add_argument('--trim', action='store_true', help='Trim blast hits to be only as long as the parent feature') parser.add_argument('--trim_end', action='store_true', help='Cut blast results off at end of gene') + parser.add_argument('--include_seq', action='store_true', help='Include sequence') args = parser.parse_args() - result = blastxml2gff3(**vars(args)) - GFF.write(result, sys.stdout) + for rec in blastxml2gff3(**vars(args)): + if len(rec.features): + GFF.write([rec], sys.stdout)
--- a/gff3_rebase.py Wed Sep 13 13:07:20 2017 -0400 +++ b/gff3_rebase.py Wed Nov 15 15:15:27 2017 -0500 @@ -83,18 +83,25 @@ def __get_features(child, interpro=False): child_features = {} for rec in GFF.parse(child): + # Only top level for feature in rec.features: + # Get the record id as parent_feature_id (since this is how it will be during remapping) parent_feature_id = rec.id + # If it's an interpro specific gff3 file if interpro: + # Then we ignore polypeptide features as they're useless if feature.type == 'polypeptide': continue - if '_' in parent_feature_id: - parent_feature_id = parent_feature_id[parent_feature_id.index('_') + 1:] + # If there's an underscore, we strip up to that underscore? + # I do not know the rationale for this, removing. + # if '_' in parent_feature_id: + # parent_feature_id = parent_feature_id[parent_feature_id.index('_') + 1:] try: child_features[parent_feature_id].append(feature) except KeyError: child_features[parent_feature_id] = [feature] + # Keep a list of feature objects keyed by parent record id return child_features @@ -132,23 +139,29 @@ __update_feature_location(subfeature, parent, protein2dna) -def rebase(parent, child, interpro=False, protein2dna=False): +def rebase(parent, child, interpro=False, protein2dna=False, map_by='ID'): + # get all of the features we will be re-mapping in a dictionary, keyed by parent feature ID child_features = __get_features(child, interpro=interpro) for rec in GFF.parse(parent): replacement_features = [] for feature in feature_lambda( rec.features, + # Filter features in the parent genome by those that are + # "interesting", i.e. have results in child_features array. + # Probably an unnecessary optimisation. feature_test_qual_value, { - 'qualifier': 'ID', + 'qualifier': map_by, 'attribute_list': child_features.keys(), }, subfeatures=False): - new_subfeatures = child_features[feature.id] - fixed_subfeatures = [] - for x in new_subfeatures: + # Features which will be re-mapped + to_remap = child_features[feature.id] + # TODO: update starts + fixed_features = [] + for x in to_remap: # Then update the location of the actual feature __update_feature_location(x, feature, protein2dna) @@ -156,11 +169,11 @@ for y in ('status', 'Target'): try: del x.qualifiers[y] - except: + except Exception: pass - fixed_subfeatures.append(x) - replacement_features.extend(fixed_subfeatures) + fixed_features.append(x) + replacement_features.extend(fixed_features) # We do this so we don't include the original set of features that we # were rebasing against in our result. rec.features = replacement_features @@ -176,5 +189,6 @@ help='Interpro specific modifications') parser.add_argument('--protein2dna', action='store_true', help='Map protein translated results to original DNA data') + parser.add_argument('--map_by', help='Map by key', default='ID') args = parser.parse_args() rebase(**vars(args))
--- a/jbrowse.py Wed Sep 13 13:07:20 2017 -0400 +++ b/jbrowse.py Wed Nov 15 15:15:27 2017 -0500 @@ -1,7 +1,8 @@ #!/usr/bin/env python import argparse -import codecs +import binascii import copy +import datetime import hashlib import json import logging @@ -14,9 +15,10 @@ from collections import defaultdict from Bio.Data import CodonTable - logging.basicConfig(level=logging.INFO) log = logging.getLogger('jbrowse') +TODAY = datetime.datetime.now().strftime("%Y-%m-%d") +GALAXY_INFRASTRUCTURE_URL = None class ColorScaling(object): @@ -63,6 +65,7 @@ var color = ({user_spec_color} || search_up(feature, 'color') || search_down(feature, 'color') || {auto_gen_color}); var score = (search_up(feature, 'score') || search_down(feature, 'score')); {opacity} + if(score === undefined){{ opacity = 1; }} var result = /^#?([a-f\d]{{2}})([a-f\d]{{2}})([a-f\d]{{2}})$/i.exec(color); var red = parseInt(result[1], 16); var green = parseInt(result[2], 16); @@ -82,11 +85,11 @@ """, 'blast': """ var opacity = 0; - if(score == 0.0) { + if(score == 0.0) {{ opacity = 1; - } else{ + }} else {{ opacity = (20 - Math.log10(score)) / 180; - } + }} """ } @@ -128,7 +131,7 @@ def rgb_from_hex(self, hexstr): # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back - return struct.unpack('BBB', codecs.decode(hexstr, 'hex')) + return struct.unpack('BBB', binascii.unhexlify(hexstr)) def min_max_gff(self, gff_file): min_val = None @@ -285,6 +288,44 @@ INSTALLED_TO = os.path.dirname(os.path.realpath(__file__)) +def metadata_from_node(node): + metadata = {} + try: + if len(node.findall('dataset')) != 1: + # exit early + return metadata + except Exception: + return {} + + for (key, value) in node.findall('dataset')[0].attrib.items(): + metadata['dataset_%s' % key] = value + + for (key, value) in node.findall('history')[0].attrib.items(): + metadata['history_%s' % key] = value + + for (key, value) in node.findall('metadata')[0].attrib.items(): + metadata['metadata_%s' % key] = value + + for (key, value) in node.findall('tool')[0].attrib.items(): + metadata['tool_%s' % key] = value + + # Additional Mappings applied: + metadata['dataset_edam_format'] = '<a target="_blank" href="http://edamontology.org/{0}">{1}</a>'.format(metadata['dataset_edam_format'], metadata['dataset_file_ext']) + metadata['history_user_email'] = '<a href="mailto:{0}">{0}</a>'.format(metadata['history_user_email']) + metadata['history_display_name'] = '<a target="_blank" href="{galaxy}/history/view/{encoded_hist_id}">{hist_name}</a>'.format( + galaxy=GALAXY_INFRASTRUCTURE_URL, + encoded_hist_id=metadata['history_id'], + hist_name=metadata['history_display_name'] + ) + metadata['tool_tool'] = '<a target="_blank" href="{galaxy}/datasets/{encoded_id}/show_params">{tool_id}</a>'.format( + galaxy=GALAXY_INFRASTRUCTURE_URL, + encoded_id=metadata['dataset_id'], + tool_id=metadata['tool_tool_id'], + tool_version=metadata['tool_tool_version'], + ) + return metadata + + class JbrowseConnector(object): def __init__(self, jbrowse, outdir, genomes, standalone=False, gencode=1): @@ -312,6 +353,12 @@ # Ignore if the folder exists pass + try: + os.makedirs(os.path.join(self.outdir, 'data', 'raw')) + except OSError: + # Ignore if the folder exists + pass + self.process_genomes() self.update_gencode() @@ -338,21 +385,20 @@ return os.path.realpath(os.path.join(self.jbrowse, 'bin', command)) def process_genomes(self): - for genome_path in self.genome_paths: + for genome_node in self.genome_paths: + # TODO: Waiting on https://github.com/GMOD/jbrowse/pull/884 self.subprocess_check_call([ 'perl', self._jbrowse_bin('prepare-refseqs.pl'), - '--fasta', genome_path]) + '--fasta', genome_node['path']]) def generate_names(self): # Generate names - args = [ 'perl', self._jbrowse_bin('generate-names.pl'), '--hashBits', '16' ] tracks = ','.join(self.tracksToIndex) - if tracks: args += ['--tracks', tracks] else: @@ -362,7 +408,6 @@ self.subprocess_check_call(args) def _add_json(self, json_data): - cmd = [ 'perl', self._jbrowse_bin('add-json.pl'), json.dumps(json_data), @@ -421,7 +466,7 @@ '--key', trackData['key'], '--clientConfig', json.dumps(clientConfig), '--config', json.dumps(config), - '--trackType', 'JBrowse/View/Track/CanvasFeatures' + '--trackType', 'BlastView/View/Track/CanvasFeatures' ] # className in --clientConfig is ignored, it needs to be set with --className @@ -455,6 +500,8 @@ else: trackData['autoscale'] = wiggleOpts.get('autoscale', 'local') + trackData['scale'] = wiggleOpts['scale'] + self._add_track_json(trackData) def add_bam(self, data, trackData, bamOpts, bam_index=None, **kwargs): @@ -506,7 +553,7 @@ }) self._add_track_json(trackData) - def add_features(self, data, format, trackData, gffOpts, **kwargs): + def add_features(self, data, format, trackData, gffOpts, metadata=None, **kwargs): cmd = [ 'perl', self._jbrowse_bin('flatfile-to-json.pl'), self.TN_TABLE.get(format, 'gff'), @@ -549,6 +596,8 @@ '--trackType', gffOpts['trackType'] ] + if metadata: + config.update({'metadata': metadata}) cmd.extend(['--config', json.dumps(config)]) self.subprocess_check_call(cmd) @@ -556,14 +605,32 @@ if gffOpts.get('index', 'false') == 'true': self.tracksToIndex.append("%s" % trackData['label']) + def add_rest(self, url, trackData): + data = { + "label": trackData['label'], + "key": trackData['key'], + "category": trackData['category'], + "type": "JBrowse/View/Track/HTMLFeatures", + "storeClass": "JBrowse/Store/SeqFeature/REST", + "baseUrl": url, + "query": { + "organism": "tyrannosaurus" + } + } + self._add_track_json(data) + def process_annotations(self, track): + category = track['category'].replace('__pd__date__pd__', TODAY) outputTrackConfig = { 'style': { 'label': track['style'].get('label', 'description'), 'className': track['style'].get('className', 'feature'), 'description': track['style'].get('description', ''), }, - 'category': track['category'], + 'overridePlugins': track['style'].get('overridePlugins', False) == 'True', + 'overrideDraggable': track['style'].get('overrideDraggable', False) == 'True', + 'maxHeight': track['style'].get('maxHeight', '600'), + 'category': category, } mapped_chars = { @@ -579,15 +646,26 @@ '#': '__pd__' } - for i, (dataset_path, dataset_ext, track_human_label) in enumerate(track['trackfiles']): + for i, (dataset_path, dataset_ext, track_human_label, extra_metadata) in enumerate(track['trackfiles']): # 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) - log.info('Processing %s / %s', track['category'], track_human_label) + log.info('Processing %s / %s', category, track_human_label) outputTrackConfig['key'] = track_human_label - hashData = [dataset_path, track_human_label, track['category']] - outputTrackConfig['label'] = hashlib.md5('|'.join(hashData).encode('utf-8')).hexdigest() + '_%s' % i + # We add extra data to hash for the case of REST + SPARQL. + try: + rest_url = track['conf']['options']['url'] + except KeyError: + rest_url = '' + + # I chose to use track['category'] instead of 'category' here. This + # is intentional. This way re-running the tool on a different date + # will not generate different hashes and make comparison of outputs + # much simpler. + hashData = [dataset_path, track_human_label, track['category'], rest_url] + hashData = '|'.join(hashData).encode('utf-8') + outputTrackConfig['label'] = hashlib.md5(hashData).hexdigest() + '_%s' % i # Colour parsing is complex due to different track types having # different colour options. @@ -608,10 +686,10 @@ # import sys; sys.exit() if dataset_ext in ('gff', 'gff3', 'bed'): self.add_features(dataset_path, dataset_ext, outputTrackConfig, - track['conf']['options']['gff']) + track['conf']['options']['gff'], metadata=extra_metadata) elif dataset_ext == 'bigwig': self.add_bigwig(dataset_path, outputTrackConfig, - track['conf']['options']['wiggle']) + track['conf']['options']['wiggle'], metadata=extra_metadata) elif dataset_ext == 'bam': real_indexes = track['conf']['options']['pileup']['bam_indices']['bam_index'] if not isinstance(real_indexes, list): @@ -626,11 +704,15 @@ self.add_bam(dataset_path, outputTrackConfig, track['conf']['options']['pileup'], - bam_index=real_indexes[i]) + bam_index=real_indexes[i], metadata=extra_metadata) elif dataset_ext == 'blastxml': - self.add_blastxml(dataset_path, outputTrackConfig, track['conf']['options']['blast']) + self.add_blastxml(dataset_path, outputTrackConfig, track['conf']['options']['blast'], metadata=extra_metadata) elif dataset_ext == 'vcf': - self.add_vcf(dataset_path, outputTrackConfig) + self.add_vcf(dataset_path, outputTrackConfig, metadata=extra_metadata) + elif dataset_ext == 'rest': + self.add_rest(track['conf']['options']['url'], outputTrackConfig, metadata=extra_metadata) + else: + log.warn('Do not know how to handle %s', dataset_ext) # Return non-human label for use in other fields yield outputTrackConfig['label'] @@ -659,10 +741,65 @@ generalData['show_overview'] = (data['general']['show_overview'] == 'true') generalData['show_menu'] = (data['general']['show_menu'] == 'true') generalData['hideGenomeOptions'] = (data['general']['hideGenomeOptions'] == 'true') + generalData['plugins'] = data['plugins'] viz_data.update(generalData) self._add_json(viz_data) + if 'GCContent' in data['plugins_python']: + self._add_track_json({ + "storeClass": "JBrowse/Store/SeqFeature/SequenceChunks", + "type": "GCContent/View/Track/GCContentXY", + "label": "GCContentXY", + "urlTemplate": "seq/{refseq_dirpath}/{refseq}-", + "bicolor_pivot": 0.5 + # TODO: Expose params for everyone. + }) + + if 'ComboTrackSelector' in data['plugins_python']: + with open(os.path.join(self.outdir, 'data', 'trackList.json'), 'r') as handle: + trackListJson = json.load(handle) + trackListJson.update({ + "trackSelector": { + "renameFacets": { + "tool_tool": "Tool ID", + "tool_tool_id": "Tool ID", + "tool_tool_version": "Tool Version", + "dataset_edam_format": "EDAM", + "dataset_size": "Size", + "history_display_name": "History Name", + "history_user_email": "Owner", + "metadata_dbkey": "Dbkey", + }, + "displayColumns": [ + "key", + "tool_tool", + "tool_tool_version", + "dataset_edam_format", + "dataset_size", + "history_display_name", + "history_user_email", + "metadata_dbkey", + ], + "type": "Faceted", + "title": ["Galaxy Metadata"], + "escapeHTMLInData": False + }, + "trackMetadata": { + "indexFacets": [ + "category", + "key", + "tool_tool_id", + "tool_tool_version", + "dataset_edam_format", + "history_user_email", + "history_display_name" + ] + } + }) + with open(os.path.join(self.outdir, 'data', 'trackList2.json'), 'w') as handle: + json.dump(trackListJson, handle) + def clone_jbrowse(self, jbrowse_dir, destination): """Clone a JBrowse directory into a destination directory. """ @@ -677,9 +814,14 @@ # http://unix.stackexchange.com/a/38691/22785 # JBrowse releases come with some broken symlinks - cmd = ['find', destination, '-type', 'l', '-xtype', 'l', '-exec', 'rm', "'{}'", '+'] + cmd = ['find', destination, '-type', 'l', '-xtype', 'l'] log.debug(' '.join(cmd)) - subprocess.check_call(cmd) + symlinks = subprocess.check_output(cmd) + for i in symlinks: + try: + os.unlink(i) + except OSError: + pass if __name__ == '__main__': @@ -689,6 +831,7 @@ parser.add_argument('--jbrowse', help='Folder containing a jbrowse release') parser.add_argument('--outdir', help='Output directory', default='out') parser.add_argument('--standalone', help='Standalone mode includes a copy of JBrowse', action='store_true') + parser.add_argument('--version', '-V', action='version', version="%(prog)s 0.7.0") args = parser.parse_args() tree = ET.parse(args.xml.name) @@ -697,7 +840,13 @@ jc = JbrowseConnector( jbrowse=args.jbrowse, outdir=args.outdir, - genomes=[os.path.realpath(x.text) for x in root.findall('metadata/genomes/genome')], + genomes=[ + { + 'path': os.path.realpath(x.attrib['path']), + 'meta': metadata_from_node(x.find('metadata')) + } + for x in root.findall('metadata/genomes/genome') + ], standalone=args.standalone, gencode=root.find('metadata/gencode').text ) @@ -719,21 +868,74 @@ 'show_overview': root.find('metadata/general/show_overview').text, 'show_menu': root.find('metadata/general/show_menu').text, 'hideGenomeOptions': root.find('metadata/general/hideGenomeOptions').text, - } + }, + 'plugins': [{ + 'location': 'https://cdn.rawgit.com/TAMU-CPT/blastview/97572a21b7f011c2b4d9a0b5af40e292d694cbef/', + 'name': 'BlastView' + }], + 'plugins_python': ['BlastView'], } + + plugins = root.find('plugins').attrib + if plugins['GCContent'] == 'True': + extra_data['plugins_python'].append('GCContent') + extra_data['plugins'].append({ + 'location': 'https://cdn.rawgit.com/elsiklab/gccontent/5c8b0582ecebf9edf684c76af8075fb3d30ec3fa/', + 'name': 'GCContent' + }) + + if plugins['Bookmarks'] == 'True': + extra_data['plugins'].append({ + 'location': 'https://cdn.rawgit.com/TAMU-CPT/bookmarks-jbrowse/5242694120274c86e1ccd5cb0e5e943e78f82393/', + 'name': 'Bookmarks' + }) + + if plugins['ComboTrackSelector'] == 'True': + extra_data['plugins_python'].append('ComboTrackSelector') + extra_data['plugins'].append({ + 'location': 'https://cdn.rawgit.com/Arabidopsis-Information-Portal/ComboTrackSelector/52403928d5ccbe2e3a86b0fa5eb8e61c0f2e2f57', + 'icon': 'https://galaxyproject.org/images/logos/galaxy-icon-square.png', + 'name': 'ComboTrackSelector' + }) + + if plugins['theme'] == 'Minimalist': + extra_data['plugins'].append({ + 'location': 'https://cdn.rawgit.com/erasche/jbrowse-minimalist-theme/d698718442da306cf87f033c72ddb745f3077775/', + 'name': 'MinimalistTheme' + }) + elif plugins['theme'] == 'Dark': + extra_data['plugins'].append({ + 'location': 'https://cdn.rawgit.com/erasche/jbrowse-dark-theme/689eceb7e33bbc1b9b15518d45a5a79b2e5d0a26/', + 'name': 'DarkTheme' + }) + + GALAXY_INFRASTRUCTURE_URL = root.find('metadata/galaxyUrl').text + # Sometimes this comes as `localhost` without a protocol + if not GALAXY_INFRASTRUCTURE_URL.startswith('http'): + # so we'll prepend `http://` and hope for the best. Requests *should* + # be GET and not POST so it should redirect OK + GALAXY_INFRASTRUCTURE_URL = 'http://' + GALAXY_INFRASTRUCTURE_URL + for track in root.findall('tracks/track'): track_conf = {} - track_conf['trackfiles'] = [ - (os.path.realpath(x.attrib['path']), x.attrib['ext'], x.attrib['label']) - for x in track.findall('files/trackFile') - ] + track_conf['trackfiles'] = [] + + for x in track.findall('files/trackFile'): + metadata = metadata_from_node(x.find('metadata')) + + track_conf['trackfiles'].append(( + os.path.realpath(x.attrib['path']), + x.attrib['ext'], + x.attrib['label'], + metadata + )) track_conf['category'] = track.attrib['cat'] track_conf['format'] = track.attrib['format'] try: # Only pertains to gff3 + blastxml. TODO? track_conf['style'] = {t.tag: t.text for t in track.find('options/style')} - except TypeError: + except TypeError as te: track_conf['style'] = {} pass track_conf['conf'] = etree_to_dict(track.find('options')) @@ -743,4 +945,3 @@ extra_data['visibility'][track.attrib.get('visibility', 'default_off')].append(key) jc.add_final_data(extra_data) - jc.generate_names()
--- a/jbrowse.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/jbrowse.xml Wed Nov 15 15:15:27 2017 -0500 @@ -5,6 +5,7 @@ </macros> <expand macro="requirements"/> <expand macro="stdio"/> + <version_command>python jbrowse.py --version</version_command> <command><![CDATA[ #if $action.action_select == "create": @@ -75,7 +76,29 @@ <genome>${reference_genome.genomes.fields.path}</genome> #else #for $genome in $reference_genome.genomes: - <genome>$genome</genome> + <genome path="$genome"> + <metadata> + <dataset id="${__app__.security.encode_id($genome.id)}" hid="${genome.hid}" + size="${genome.get_size(nice_size=True)}" + edam_format="${genome.datatype.edam_format}" + file_ext="${genome.ext}" /> + <history id="${__app__.security.encode_id($genome.history_id)}" + user_email="${genome.history.user.email}" + user_id="${genome.history.user_id}" + display_name="${genome.history.get_display_name()}"/> + <metadata + #for (key, value) in $genome.get_metadata().items(): + #if "_types" not in $key: + ${key}="${value}" + #end if + #end for + /> + <tool + tool_id="${genome.creating_job.tool_id}" + tool_version="${genome.creating_job.tool_version}" + /> + </metadata> + </genome> #end for #end if </genomes> @@ -91,24 +114,55 @@ <show_menu>${jbgen.show_menu}</show_menu> <hideGenomeOptions>${jbgen.hideGenomeOptions}</hideGenomeOptions> </general> + <galaxyUrl>${__app__.config.galaxy_infrastructure_url}</galaxyUrl> </metadata> <tracks> #for $tg in $track_groups: #for $track in $tg.data_tracks: + #if $track.data_format.data_format_select == "rest": + <track cat="${tg.category}" format="${track.data_format.data_format_select}" visibility="${track.data_format.track_visibility}"> + <url>${track.data_format.url}</url> + </track> + #else: <track cat="${tg.category}" format="${track.data_format.data_format_select}" visibility="${track.data_format.track_visibility}"> <files> #for $dataset in $track.data_format.annotation: - <trackFile path="${dataset}" ext="${dataset.ext}" label="${dataset.element_identifier}" /> + <trackFile path="${dataset}" ext="${dataset.ext}" label="${dataset.element_identifier}"> + <metadata> + <dataset id="${__app__.security.encode_id($dataset.id)}" hid="${dataset.hid}" + size="${dataset.get_size(nice_size=True)}" + edam_format="${dataset.datatype.edam_format}" + file_ext="${dataset.ext}" /> + <history id="${__app__.security.encode_id($dataset.history_id)}" + user_email="${dataset.history.user.email}" + user_id="${dataset.history.user_id}" + display_name="${dataset.history.get_display_name()}"/> + <metadata + #for (key, value) in $dataset.get_metadata().items(): + #if "_types" not in $key: + ${key}="${value}" + #end if + #end for + /> + <tool + tool_id="${dataset.creating_job.tool_id}" + tool_version="${dataset.creating_job.tool_version}" + /> + </metadata> + </trackFile> #end for </files> <options> #if str($track.data_format.data_format_select) == "gene_calls" or str($track.data_format.data_format_select) == "blast": <style> + <overridePlugins>${track.data_format.override_apollo_plugins}</overridePlugins> + <overrideDraggable>${track.data_format.override_apollo_drag}</overrideDraggable> <className>${track.data_format.jbstyle.style_classname}</className> <description>${track.data_format.jbstyle.style_description}</description> <label>${track.data_format.jbstyle.style_label}</label> <height>${track.data_format.jbstyle.style_height}</height> + <maxHeight>${track.data_format.jbstyle.max_height}</maxHeight> </style> <scaling> #if str($track.data_format.jbcolor_scale.color_score.color_score_select) == "none": @@ -177,6 +231,7 @@ <min>${track.data_format.scaling.minimum}</min> <max>${track.data_format.scaling.maximum}</max> #end if + <scale>${track.data_format.scale_select2}</scale> ## Wiggle tracks need special color config #if str($track.data_format.jbcolor.color.color_select) != "automatic": @@ -247,11 +302,17 @@ #end if </options> </track> + #end if #end for #end for </tracks> -</root> -]]></configfile> + <plugins + ComboTrackSelector="${plugins.ComboTrackSelector}" + Bookmarks="${plugins.Bookmarks}" + GCContent="${plugins.GCContent}" + theme="${plugins.theme}" + /> +</root>]]></configfile> </configfiles> <inputs> <conditional name="reference_genome"> @@ -284,7 +345,6 @@ <param name="standalone" label="Produce Standalone Instance" type="boolean" truevalue="Complete" falsevalue="Data Directory" help="Produce a full, working JBrowse instance or just the data directory. Data dir mode is experimental and intended to be used with Apollo" checked="True"/> - <param label="Genetic Code" name="gencode" type="select"> <option value="1">1. The Standard Code</option> <option value="2">2. The Vertebrate Mitochondrial Code</option> @@ -325,15 +385,16 @@ name="category" type="text" value="Default" - help="Organise your tracks into Categories for a nicer end-user experience" optional="False"/> + help="Organise your tracks into Categories for a nicer end-user experience. You can use #date# and it will be replaced with the current date in 'yyyy-mm-dd' format, which is very useful for repeatedly updating a JBrowse instance when member databases / underlying tool versions are updated." optional="False"/> <repeat name="data_tracks" title="Annotation Track"> - <conditional name="data_format"> + <conditional name="data_format" label="Track Options"> <param type="select" label="Track Type" name="data_format_select"> <option value="gene_calls">GFF/GFF3/BED/GBK Features</option> <option value="pileup">BAM Pileups</option> <option value="blast">Blast XML</option> <option value="wiggle">BigWig XY</option> <option value="vcf">VCF SNPs</option> + <option value="rest">REST Endpoint</option> <!--<option value="sparql">SPARQL</option>--> </param> <when value="blast"> @@ -377,7 +438,7 @@ </when> <when value="gene_calls"> <expand macro="input_conditional" label="GFF/GFF3/BED Track Data" format="gff,gff3,bed" /> - <conditional name="match_part"> + <conditional name="match_part" label="match/match_part data"> <param label="This is match/match_part data" type="boolean" name="match_part_select" @@ -400,6 +461,7 @@ <param type="select" label="JBrowse Track Type [Advanced]" name="track_class"> <option value="JBrowse/View/Track/HTMLFeatures">HTML Features</option> <option value="JBrowse/View/Track/CanvasFeatures" selected="true">Canvas Features</option> + <option value="BlastView/View/Track/CanvasFeatures">Blast Features</option> </param> <when value="JBrowse/View/Track/CanvasFeatures"> <section name="canvas_options" title="CanvasFeatures Options [Advanced]" expanded="false"> @@ -466,7 +528,7 @@ truevalue="true" falsevalue="false" /> - <conditional name="scaling"> + <conditional name="scaling" label="Scaling"> <param type="select" label="Track Scaling" name="scale_select"> <option value="auto_local">Autoscale (local)</option> <option value="auto_global" selected="true">Autoscale (global)</option> @@ -481,9 +543,16 @@ type="integer" value="100" /> </when> </conditional> + <param type="select" label="Visual Scaling" name="scale_select2"> + <option value="linear" selected="true">Linear</option> + <option value="log">Logarithmic (Dynamically Calculated)</option> + </param> <expand macro="color_selection_minmax" /> <expand macro="track_display" /> </when> + <when value="rest"> + <param type="text" label="REST Endpoint" name="url" /> + </when> <!-- <when value="sparql"> <param type="text" label="SPARQL Server URL" name="url" /> @@ -497,6 +566,25 @@ </repeat> <expand macro="general_options" /> + <section name="plugins" title="Plugins" expanded="false"> + <param + label="Combo Track Selector" name="ComboTrackSelector" truevalue="True" falsevalue="" type="boolean" + help="ComboTrackSelector is a plugin to allow the co-existence of the Hierarchical and Faceted Track selectors in JBrowse, built for/by the Arabidopsis Information Portal (Araport) project" /> + <param + label="Bookmarks" name="Bookmarks" truevalue="True" falsevalue="" type="boolean" + help="JBrowse plugin allowing users to manage a persistent list of bookmarks kept in localstorage" /> + + <param + label="GC Content" name="GCContent" truevalue="True" falsevalue="" type="boolean" + help="A JBrowse plugin for plotting GC Content and GC Skew. The plugin consists of a storeClass that automatically calculates the percentage of G/C bases in a region, a track type that derives from the Wiggle XY or density types, and a dialog box to adjust the sliding window size, window step size, and the calculation mode (content or skew)." /> + + <param type="select" label="JBrowse Theme" name="theme"> + <option value="" selected="True">Default</option> + <option value="Minimalist">Minimalist</option> + <option value="Dark">Dark</option> + </param> + </section> + <param type="hidden" name="uglyTestingHack" value="" /> </inputs> <outputs> @@ -518,7 +606,7 @@ <param name="gencode" value="11" /> <param name="standalone" value="Data Directory" /> <param name="uglyTestingHack" value="enabled" /> - <output name="output" file="gencode/test.xml" lines_diff="4"/> + <output name="output" file="gencode/test.xml" lines_diff="14"/> </test> <test> <param name="reference_genome|genome_type_select" value="history"/> @@ -714,7 +802,7 @@ </repeat> <param name="uglyTestingHack" value="enabled" /> - <output name="output" file="gff3/test.xml" lines_diff="24" /> + <output name="output" file="gff3/test.xml" lines_diff="64" /> </test> <test> <param name="reference_genome|genome_type_select" value="history"/> @@ -777,7 +865,7 @@ </repeat> <param name="uglyTestingHack" value="enabled" /> - <output name="output" file="menus/test.xml" lines_diff="6"/> + <output name="output" file="menus/test.xml" lines_diff="24"/> </test> <test> <param name="reference_genome|genome_type_select" value="history"/> @@ -814,7 +902,7 @@ </repeat> <param name="uglyTestingHack" value="enabled" /> - <output name="output" file="track_config/test.xml" lines_diff="6"/> + <output name="output" file="track_config/test.xml" lines_diff="26"/> </test> </tests> <help><![CDATA[ @@ -824,6 +912,12 @@ JBrowse-in-Galaxy offers a highly configurable, workflow-compatible alternative to Trackster. +Overview +-------- + +JBrowse is a fast, embeddable genome browser built completely with +JavaScript and HTML5. + The JBrowse-in-Galaxy (JiG) tool was written to help build complex JBrowse installations straight from Galaxy, taking advantage of the latest Galaxy features such as dataset collections, sections, and colour
--- a/macros.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/macros.xml Wed Nov 15 15:15:27 2017 -0500 @@ -12,7 +12,7 @@ </requirements> </xml> <token name="@DATA_DIR@">\$GALAXY_JBROWSE_SHARED_DIR</token> - <token name="@WRAPPER_VERSION@">0.5.3</token> + <token name="@WRAPPER_VERSION@">0.7.0</token> <xml name="stdio"> <stdio> <exit_code range="1:"/> @@ -27,6 +27,43 @@ This Galaxy tool relies on the JBrowse, maintained by the GMOD Community. The Galaxy wrapper is developed by Eric Rasche ]]> </token> + + <xml name="genome_selector" + token_help="" + token_label="Fasta sequences" + token_optional="False" > + <conditional name="reference_genome"> + <param help="Built-in references" label="Reference genome to display" name="genome_type_select" type="select"> + <option selected="True" value="indexed">Use a built-in genome</option> + <option value="history">Use a genome from history</option> + </param> + <when value="indexed"> + <param + help="@HELP@" + label="@LABEL@" + name="genomes" + type="select" + optional="@OPTIONAL@" + > + <options from_data_table="all_fasta"> + <filter column="2" type="sort_by" /> + <validator message="No genomes are available for the selected input dataset" type="no_options" /> + </options> + </param> + </when> + <when value="history"> + <param + format="fasta" + label="@LABEL@" + help="@HELP@" + name="genomes" + type="data" + optional="@OPTIONAL@" + multiple="True" /> + </when> + </conditional> + </xml> + <xml name="auto_manual_tk" token_cond_label="Color" token_cond_name="color" @@ -54,6 +91,14 @@ <option value="force">Force On</option> <option value="always">Always On (ignores URL parameters)</option> </param> + <param type="select" label="Override Apollo Plugins" name="override_apollo_plugins" help="Disable the apollo plugin for this track, this disables the ability to make an annotation from this feature."> + <option value="True">Yes - Override</option> + <option value="False" selected="True">No - Do not Override</option> + </param> + <param type="select" label="Override Apollo Draggability" name="override_apollo_drag" help="Disable apollo's drag-to-create feature functionality."> + <option value="True">Yes - Override</option> + <option value="False" selected="True">No - Do not Override</option> + </param> </xml> <xml name="jb_color" @@ -179,9 +224,9 @@ <!-- Scaling --> <param type="select" label="JBrowse style.color function's score scaling" name="score_scaling" help="How should the colors be distributed across the values? For blast results which distributes scores on the scale of approximately [1e-500, 10], it makes sense to request a logarithmic scaling of the color values. Logarithmic is indeed the default for blast. However other analysis methods may produce scores on ranges such as [0, 100] where a linear scale would be more appropriate for color distribution."> - <option value="linear" selected="@SCALING_LIN_SELECT@" >Linear scaling</option> - <option value="logarithmic">Logarithmic scaling</option> - <option value="blast" selected="@SCALING_LOG_SELECT@" >Blast scaling</option> + <option value="linear" selected="@SCALING_LIN_SELECT@">Linear scaling</option> + <option value="logarithmic" selected="false">Logarithmic scaling</option> + <option value="blast" selected="@SCALING_LOG_SELECT@">Blast scaling</option> </param> <!-- Scaling Bounds --> @@ -219,9 +264,10 @@ </xml> <xml name="track_styling" token_classname="feature" - token_label="name,id" + token_label="product,name,id" token_description="note,description" - token_height="100px"> + token_height="10px" + token_maxheight="600"> <section name="jbstyle" title="JBrowse Styling Options [Advanced]" expanded="false"> <param label="JBrowse style.className" type="text" name="style_classname" @@ -242,6 +288,11 @@ name="style_height" value="@HEIGHT@" help="Height in pixels of glyphs. Default value varies from glyph to glyph. Note that the 'compact' displayMode uses style->height * 0.35 so changing style height can adjust the compact visualization."/> + <param label="JBrowse maxHeight" + type="text" + name="max_height" + value="@MAXHEIGHT@" + help="Maximum height that the track is permitted to reach in pixels."/> </section> </xml>
--- a/test-data/bam/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/bam/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -5,6 +5,17 @@ <genomes> <genome>test-data/merlin.fa</genome> </genomes> + <general> + <defaultLocation></defaultLocation> + <trackPadding>40</trackPadding> + <shareLink>true</shareLink> + <aboutDescription></aboutDescription> + <show_tracklist>true</show_tracklist> + <show_nav>true</show_nav> + <show_overview>false</show_overview> + <show_menu>true</show_menu> + <hideGenomeOptions>false</hideGenomeOptions> + </general> </metadata> <tracks> <track cat="Default" format="pileup">
--- a/test-data/blastxml/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/blastxml/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -5,6 +5,17 @@ <genomes> <genome>test-data/merlin.fa</genome> </genomes> + <general> + <defaultLocation></defaultLocation> + <trackPadding>40</trackPadding> + <shareLink>true</shareLink> + <aboutDescription></aboutDescription> + <show_tracklist>true</show_tracklist> + <show_nav>true</show_nav> + <show_overview>false</show_overview> + <show_menu>true</show_menu> + <hideGenomeOptions>false</hideGenomeOptions> + </general> </metadata> <tracks> <track cat="Blah" format="blast">
--- a/test-data/bw/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/bw/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -5,6 +5,17 @@ <genomes> <genome>test-data/merlin.fa</genome> </genomes> + <general> + <defaultLocation></defaultLocation> + <trackPadding>40</trackPadding> + <shareLink>true</shareLink> + <aboutDescription></aboutDescription> + <show_tracklist>true</show_tracklist> + <show_nav>true</show_nav> + <show_overview>false</show_overview> + <show_menu>true</show_menu> + <hideGenomeOptions>false</hideGenomeOptions> + </general> </metadata> <tracks> <track cat="Scaling" format="wiggle"> @@ -20,6 +31,7 @@ <color_pos>__auto__</color_pos> <color_neg>__auto__</color_neg> <bicolor_pivot>zero</bicolor_pivot> + <scale>linear</scale> </wiggle> </options> </track> @@ -36,6 +48,7 @@ <color_pos>__auto__</color_pos> <color_neg>__auto__</color_neg> <bicolor_pivot>zero</bicolor_pivot> + <scale>linear</scale> </wiggle> </options> </track> @@ -54,6 +67,7 @@ <color_pos>__auto__</color_pos> <color_neg>__auto__</color_neg> <bicolor_pivot>zero</bicolor_pivot> + <scale>linear</scale> </wiggle> </options> </track> @@ -74,6 +88,7 @@ <color_pos>__auto__</color_pos> <color_neg>__auto__</color_neg> <bicolor_pivot>mean</bicolor_pivot> + <scale>linear</scale> </wiggle> </options> </track> @@ -91,6 +106,7 @@ <color_pos>#0000ff</color_pos> <color_neg>#ff0000</color_neg> <bicolor_pivot>mean</bicolor_pivot> + <scale>linear</scale> </wiggle> </options> </track> @@ -108,6 +124,7 @@ <color_pos>#ff0000</color_pos> <color_neg>#0000ff</color_neg> <bicolor_pivot>mean</bicolor_pivot> + <scale>log</scale> </wiggle> </options> </track> @@ -125,6 +142,7 @@ <color_pos>#0000ff</color_pos> <color_neg>#ff0000</color_neg> <bicolor_pivot>100</bicolor_pivot> + <scale>linear</scale> </wiggle> </options> </track>
--- a/test-data/gencode/test-1.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/gencode/test-1.xml Wed Nov 15 15:15:27 2017 -0500 @@ -3,7 +3,27 @@ <metadata> <gencode>1</gencode> <genomes> - <genome>/tmp/tmpPJZIQf/files/000/dataset_1.dat</genome> + <genome path="/tmp/tmpnh6QWY/files/000/dataset_1.dat"> + <metadata> + <dataset id="2891970512fa2d5a" hid="1" + size="171.6 KB" + edam_format="format_1929" + file_ext="fasta" /> + <history id="2891970512fa2d5a" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="2881" + sequences="1" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </genome> </genomes> <general> <defaultLocation></defaultLocation> @@ -17,7 +37,14 @@ <show_menu>true</show_menu> <hideGenomeOptions>false</hideGenomeOptions> </general> + <galaxyUrl>http://localhost:8080</galaxyUrl> </metadata> <tracks> </tracks> + <plugins + ComboTrackSelector="" + Bookmarks="" + GCContent="" + theme="" + /> </root>
--- a/test-data/gencode/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/gencode/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -3,7 +3,27 @@ <metadata> <gencode>11</gencode> <genomes> - <genome>/tmp/tmps5cL_a/files/000/dataset_3.dat</genome> + <genome path="/tmp/tmpnh6QWY/files/000/dataset_3.dat"> + <metadata> + <dataset id="54f2a3a23292eb07" hid="1" + size="171.6 KB" + edam_format="format_1929" + file_ext="fasta" /> + <history id="5729865256bc2525" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="2881" + sequences="1" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </genome> </genomes> <general> <defaultLocation></defaultLocation> @@ -17,7 +37,14 @@ <show_menu>true</show_menu> <hideGenomeOptions>false</hideGenomeOptions> </general> + <galaxyUrl>http://localhost:8080</galaxyUrl> </metadata> <tracks> </tracks> + <plugins + ComboTrackSelector="" + Bookmarks="" + GCContent="" + theme="" + /> </root>
--- a/test-data/gff3/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/gff3/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -3,7 +3,27 @@ <metadata> <gencode>11</gencode> <genomes> - <genome>test-data/merlin.fa</genome> + <genome path="/tmp/tmpnh6QWY/files/000/dataset_5.dat"> + <metadata> + <dataset id="7b55dbb89df8f4e5" hid="1" + size="171.6 KB" + edam_format="format_1929" + file_ext="fasta" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="2881" + sequences="1" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </genome> </genomes> <general> <defaultLocation></defaultLocation> @@ -17,22 +37,122 @@ <show_menu>true</show_menu> <hideGenomeOptions>false</hideGenomeOptions> </general> + <galaxyUrl>http://localhost:8080</galaxyUrl> </metadata> <tracks> <track cat="Auto Coloured" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="A"/> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="B"/> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="C"/> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="D"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_6.dat" ext="gff3" label="A.gff"> + <metadata> + <dataset id="fa6d20d0fb68383f" hid="2" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_7.dat" ext="gff3" label="B.gff"> + <metadata> + <dataset id="683bc220e21425bb" hid="3" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_8.dat" ext="gff3" label="C.gff"> + <metadata> + <dataset id="a90a30fafe298e1e" hid="4" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_9.dat" ext="gff3" label="D.gff"> + <metadata> + <dataset id="b842d972534ccb3e" hid="5" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>ignore</method> @@ -51,15 +171,42 @@ </track> <track cat="Ignore Scale" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Fixed Colour"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_10.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="5449172d6ff5669b" hid="6" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>ignore</method> @@ -78,15 +225,42 @@ </track> <track cat="Scaled Colour" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Auto-bounds"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_10.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="5449172d6ff5669b" hid="6" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>score</method> @@ -111,15 +285,42 @@ </track> <track cat="Scaled Colour" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Auto-bounds, Fixed Color"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_10.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="5449172d6ff5669b" hid="6" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>score</method> @@ -144,15 +345,42 @@ </track> <track cat="Scaled Colour" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Manual Bounds"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_10.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="5449172d6ff5669b" hid="6" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>score</method> @@ -179,15 +407,42 @@ </track> <track cat="Scaled Colour" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Manual Bounds, Fixed Color"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_10.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="5449172d6ff5669b" hid="6" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>score</method> @@ -214,15 +469,42 @@ </track> <track cat="Realistic" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/interpro.gff" ext="gff3" label="Interpro data"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_11.dat" ext="gff3" label="interpro.gff"> + <metadata> + <dataset id="9ce08b2254e4d5ed" hid="7" + size="103.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="556" + comment_lines="2" + columns="9" + column_names="" + delimiter="__tc__" + attributes="11" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>ignore</method> @@ -241,15 +523,42 @@ </track> <track cat="Realistic" format="gene_calls" visibility="default_off"> <files> - <trackFile path="test-data/gff3/2.gff" ext="gff3" label="Match/Match Part"/> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_12.dat" ext="gff3" label="2.gff"> + <metadata> + <dataset id="80b8022ff3f677b7" hid="8" + size="326 bytes" + edam_format="format_1975" + file_ext="gff3" /> + <history id="54f2a3a23292eb07" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="3" + comment_lines="3" + columns="9" + column_names="" + delimiter="__tc__" + attributes="4" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>ignore</method> @@ -268,4 +577,10 @@ </options> </track> </tracks> + <plugins + ComboTrackSelector="" + Bookmarks="" + GCContent="" + theme="" + /> </root>
--- a/test-data/menus/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/menus/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -3,7 +3,27 @@ <metadata> <gencode>11</gencode> <genomes> - <genome>/tmp/tmplFZ5li/files/000/dataset_14.dat</genome> + <genome path="/tmp/tmpnh6QWY/files/000/dataset_14.dat"> + <metadata> + <dataset id="1ae74d26531588b0" hid="1" + size="171.6 KB" + edam_format="format_1929" + file_ext="fasta" /> + <history id="8155e4b4bf1581ff" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="2881" + sequences="1" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </genome> </genomes> <general> <defaultLocation></defaultLocation> @@ -17,19 +37,47 @@ <show_menu>true</show_menu> <hideGenomeOptions>false</hideGenomeOptions> </general> + <galaxyUrl>http://localhost:8080</galaxyUrl> </metadata> <tracks> <track cat="With menu or index" format="gene_calls" visibility="default_off"> <files> - <trackFile path="/tmp/tmplFZ5li/files/000/dataset_15.dat" ext="gff3" label="1.gff" /> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_15.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="440a6c2b5d9efe20" hid="2" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="8155e4b4bf1581ff" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>ignore</method> @@ -62,15 +110,42 @@ </track> <track cat="With menu or index" format="gene_calls" visibility="default_off"> <files> - <trackFile path="/tmp/tmplFZ5li/files/000/dataset_15.dat" ext="gff3" label="1.gff" /> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_15.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="440a6c2b5d9efe20" hid="2" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="8155e4b4bf1581ff" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>ignore</method> @@ -88,4 +163,10 @@ </options> </track> </tracks> + <plugins + ComboTrackSelector="" + Bookmarks="" + GCContent="" + theme="" + /> </root>
--- a/test-data/track_config/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/track_config/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -3,7 +3,27 @@ <metadata> <gencode>11</gencode> <genomes> - <genome>/tmp/tmplFZ5li/files/000/dataset_14.dat</genome> + <genome path="/tmp/tmpnh6QWY/files/000/dataset_17.dat"> + <metadata> + <dataset id="27ee89e2e3d631e0" hid="1" + size="171.6 KB" + edam_format="format_1929" + file_ext="fasta" /> + <history id="7b55dbb89df8f4e5" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="2881" + sequences="1" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </genome> </genomes> <general> <defaultLocation></defaultLocation> @@ -17,19 +37,47 @@ <show_menu>true</show_menu> <hideGenomeOptions>false</hideGenomeOptions> </general> + <galaxyUrl>http://localhost:8080</galaxyUrl> </metadata> <tracks> <track cat="With canvas config" format="gene_calls" visibility="default_off"> <files> - <trackFile path="/tmp/tmplFZ5li/files/000/dataset_15.dat" ext="gff3" label="1.gff" /> + <trackFile path="/tmp/tmpnh6QWY/files/000/dataset_18.dat" ext="gff3" label="1.gff"> + <metadata> + <dataset id="61f03d5eef6f1538" hid="2" + size="2.3 KB" + edam_format="format_1975" + file_ext="gff3" /> + <history id="7b55dbb89df8f4e5" + user_email="test@bx.psu.edu" + user_id="2" + display_name="test_history"/> + <metadata + dbkey="hg17" + data_lines="27" + comment_lines="19" + columns="9" + column_names="" + delimiter="__tc__" + attributes="6" + /> + <tool + tool_id="upload1" + tool_version="1.1.4" + /> + </metadata> + </trackFile> </files> <options> <style> + <overridePlugins>False</overridePlugins> + <overrideDraggable>False</overrideDraggable> <className>feature</className> <description>note,description</description> - <label>name,id</label> - <height>100px</height> + <label>product,name,id</label> + <height>10px</height> + <maxHeight>600</maxHeight> </style> <scaling> <method>ignore</method> @@ -47,4 +95,10 @@ </options> </track> </tracks> + <plugins + ComboTrackSelector="" + Bookmarks="" + GCContent="" + theme="" + /> </root>
--- a/test-data/vcf/test.xml Wed Sep 13 13:07:20 2017 -0400 +++ b/test-data/vcf/test.xml Wed Nov 15 15:15:27 2017 -0500 @@ -5,6 +5,17 @@ <genomes> <genome>test-data/merlin.fa</genome> </genomes> + <general> + <defaultLocation></defaultLocation> + <trackPadding>40</trackPadding> + <shareLink>true</shareLink> + <aboutDescription></aboutDescription> + <show_tracklist>true</show_tracklist> + <show_nav>true</show_nav> + <show_overview>false</show_overview> + <show_menu>true</show_menu> + <hideGenomeOptions>false</hideGenomeOptions> + </general> </metadata> <tracks> <track cat="Default" format="vcf">