commit/galaxy-central: guerler: Datatypes: Add datatype description to xml, Upload: Load description from xml
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/72eec07ef718/ Changeset: 72eec07ef718 User: guerler Date: 2014-02-15 06:06:32 Summary: Datatypes: Add datatype description to xml, Upload: Load description from xml Affected #: 12 files diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c datatypes_conf.xml.sample --- a/datatypes_conf.xml.sample +++ b/datatypes_conf.xml.sample @@ -1,13 +1,13 @@ <?xml version="1.0"?><datatypes><registration converters_path="lib/galaxy/datatypes/converters" display_path="display_applications"> - <datatype extension="ab1" type="galaxy.datatypes.binary:Ab1" mimetype="application/octet-stream" display_in_upload="true"/> - <datatype extension="afg" type="galaxy.datatypes.assembly:Amos" display_in_upload="false"/> + <datatype extension="ab1" type="galaxy.datatypes.binary:Ab1" mimetype="application/octet-stream" display_in_upload="true" description="A binary sequence file in 'ab1' format with a '.ab1' file extension. You must manually select this 'File Format' when uploading the file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Ab1"/> + <datatype extension="afg" type="galaxy.datatypes.assembly:Amos" display_in_upload="false" /><datatype extension="asn1" type="galaxy.datatypes.data:GenericAsn1" mimetype="text/plain" display_in_upload="true" /><datatype extension="asn1-binary" type="galaxy.datatypes.binary:GenericAsn1Binary" mimetype="application/octet-stream" display_in_upload="true" /> - <datatype extension="axt" type="galaxy.datatypes.sequence:Axt" display_in_upload="true"/> + <datatype extension="axt" type="galaxy.datatypes.sequence:Axt" display_in_upload="true" description="blastz pairwise alignment format. Each alignment block in an axt file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines. The summary line contains chromosomal position and size information about the alignment. It consists of 9 required fields." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Axt"/><datatype extension="fli" type="galaxy.datatypes.tabular:FeatureLocationIndex" display_in_upload="false"/> - <datatype extension="bam" type="galaxy.datatypes.binary:Bam" mimetype="application/octet-stream" display_in_upload="true"> + <datatype extension="bam" type="galaxy.datatypes.binary:Bam" mimetype="application/octet-stream" display_in_upload="true" description="A binary file compressed in the BGZF format with a '.bam' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#BAM"><converter file="bam_to_bai.xml" target_datatype="bai"/><converter file="bam_to_bigwig_converter.xml" target_datatype="bigwig"/><display file="ucsc/bam.xml" /> @@ -15,7 +15,7 @@ <display file="igv/bam.xml" /><display file="igb/bam.xml" /></datatype> - <datatype extension="bed" type="galaxy.datatypes.interval:Bed" display_in_upload="true"> + <datatype extension="bed" type="galaxy.datatypes.interval:Bed" display_in_upload="true" description="BED format provides a flexible way to define the data lines that are displayed in an annotation track. BED lines have three required columns and nine additional optional columns. The three required columns are chrom, chromStart and chromEnd." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Bed"><converter file="bed_to_gff_converter.xml" target_datatype="gff"/><converter file="bed_to_bgzip_converter.xml" target_datatype="bgzip"/><converter file="bed_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/> @@ -56,20 +56,20 @@ <datatype extension="csfasta" type="galaxy.datatypes.sequence:csFasta" display_in_upload="true"/><datatype extension="data" type="galaxy.datatypes.data:Data" mimetype="application/octet-stream" max_optional_metadata_filesize="1048576" /><datatype extension="data_manager_json" type="galaxy.datatypes.data:Text" mimetype="application/json" subclass="True" display_in_upload="False"/> - <datatype extension="fasta" type="galaxy.datatypes.sequence:Fasta" display_in_upload="true"> + <datatype extension="fasta" type="galaxy.datatypes.sequence:Fasta" display_in_upload="true" description="A sequence in FASTA format consists of a single-line description, followed by lines of sequence data. The first character of the description line is a greater-than ('>') symbol in the first column. All lines should be shorter than 80 characters." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Fasta"><converter file="fasta_to_tabular_converter.xml" target_datatype="tabular"/><converter file="fasta_to_bowtie_base_index_converter.xml" target_datatype="bowtie_base_index"/><converter file="fasta_to_bowtie_color_index_converter.xml" target_datatype="bowtie_color_index"/><converter file="fasta_to_2bit.xml" target_datatype="twobit"/><converter file="fasta_to_len.xml" target_datatype="len"/></datatype> - <datatype extension="fastq" type="galaxy.datatypes.sequence:Fastq" display_in_upload="true"> + <datatype extension="fastq" type="galaxy.datatypes.sequence:Fastq" display_in_upload="true" description="FASTQ format is a text-based format for storing both a biological sequence (usually nucleotide sequence) and its corresponding quality scores." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Fastq"><converter file="fastq_to_fqtoc.xml" target_datatype="fqtoc"/></datatype><datatype extension="fastqsanger" type="galaxy.datatypes.sequence:FastqSanger" display_in_upload="true"><converter file="fastq_to_fqtoc.xml" target_datatype="fqtoc"/></datatype> - <datatype extension="fastqsolexa" type="galaxy.datatypes.sequence:FastqSolexa" display_in_upload="true"> + <datatype extension="fastqsolexa" type="galaxy.datatypes.sequence:FastqSolexa" display_in_upload="true" description="FastqSolexa is the Illumina (Solexa) variant of the Fastq format, which stores sequences and quality scores in a single file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#FastqSolexa"><converter file="fastq_to_fqtoc.xml" target_datatype="fqtoc"/></datatype><datatype extension="fastqcssanger" type="galaxy.datatypes.sequence:FastqCSSanger" display_in_upload="true"> @@ -84,7 +84,7 @@ <datatype extension="genetrack" type="galaxy.datatypes.tracks:GeneTrack"><!-- <display file="genetrack.xml" /> --></datatype> - <datatype extension="gff" type="galaxy.datatypes.interval:Gff" display_in_upload="true"> + <datatype extension="gff" type="galaxy.datatypes.interval:Gff" display_in_upload="true" description="GFF lines have nine required fields that must be tab-separated." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#GFF"><converter file="gff_to_bed_converter.xml" target_datatype="bed"/><converter file="gff_to_interval_index_converter.xml" target_datatype="interval_index"/><converter file="bed_gff_or_vcf_to_bigwig_converter.xml" target_datatype="bigwig"/> @@ -92,7 +92,7 @@ <display file="ensembl/ensembl_gff.xml" inherit="True"/><!-- <display file="gbrowse/gbrowse_gff.xml" inherit="True" /> --></datatype> - <datatype extension="gff3" type="galaxy.datatypes.interval:Gff3" display_in_upload="true"/> + <datatype extension="gff3" type="galaxy.datatypes.interval:Gff3" display_in_upload="true" description="The GFF3 format addresses the most common extensions to GFF, while preserving backward compatibility with previous formats." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#GFF3"/><datatype extension="gif" type="galaxy.datatypes.images:Gif" mimetype="image/gif"/><datatype extension="gmaj.zip" type="galaxy.datatypes.images:Gmaj" mimetype="application/zip"/><datatype extension="gtf" type="galaxy.datatypes.interval:Gtf" display_in_upload="true"> @@ -102,7 +102,7 @@ <datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary" mimetype="multipart/x-gzip" subclass="True" /><datatype extension="h5" type="galaxy.datatypes.binary:Binary" mimetype="application/octet-stream" subclass="True" /><datatype extension="html" type="galaxy.datatypes.images:Html" mimetype="text/html"/> - <datatype extension="interval" type="galaxy.datatypes.interval:Interval" display_in_upload="true"> + <datatype extension="interval" type="galaxy.datatypes.interval:Interval" display_in_upload="true" description="File must start with definition line in the following format (columns may be in any order)." ><converter file="interval_to_bed_converter.xml" target_datatype="bed"/><converter file="interval_to_bedstrict_converter.xml" target_datatype="bedstrict"/><converter file="interval_to_bed6_converter.xml" target_datatype="bed6"/> @@ -139,8 +139,8 @@ <datatype extension="eps" type="galaxy.datatypes.images:Eps" mimetype="image/eps"/><datatype extension="rast" type="galaxy.datatypes.images:Rast" mimetype="image/rast"/><datatype extension="laj" type="galaxy.datatypes.images:Laj"/> - <datatype extension="lav" type="galaxy.datatypes.sequence:Lav" display_in_upload="true"/> - <datatype extension="maf" type="galaxy.datatypes.sequence:Maf" display_in_upload="true"> + <datatype extension="lav" type="galaxy.datatypes.sequence:Lav" display_in_upload="true" description="Lav is the primary output format for BLASTZ. The first line of a .lav file begins with #:lav.." /> + <datatype extension="maf" type="galaxy.datatypes.sequence:Maf" display_in_upload="true" description="TBA and multiz multiple alignment format. The first line of a .maf file begins with ##maf. This word is followed by white-space-separated 'variable=value' pairs. There should be no white space surrounding the '='." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#MAF"><converter file="maf_to_fasta_converter.xml" target_datatype="fasta"/><converter file="maf_to_interval_converter.xml" target_datatype="interval"/></datatype> @@ -168,14 +168,14 @@ <converter file="sam_to_bam.xml" target_datatype="bam"/><converter file="sam_to_bigwig_converter.xml" target_datatype="bigwig"/></datatype> - <datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true"/> + <datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true" description="A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Scf"/><datatype extension="Sequences" type="galaxy.datatypes.assembly:Sequences" display_in_upload="false"/> - <datatype extension="sff" type="galaxy.datatypes.binary:Sff" mimetype="application/octet-stream" display_in_upload="true"/> + <datatype extension="sff" type="galaxy.datatypes.binary:Sff" mimetype="application/octet-stream" display_in_upload="true" description="A binary file in 'Standard Flowgram Format' with a '.sff' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Sff"/><datatype extension="svg" type="galaxy.datatypes.images:Image" mimetype="image/svg+xml"/><datatype extension="taxonomy" type="galaxy.datatypes.tabular:Taxonomy" display_in_upload="true"/> - <datatype extension="tabular" type="galaxy.datatypes.tabular:Tabular" display_in_upload="true"/> + <datatype extension="tabular" type="galaxy.datatypes.tabular:Tabular" display_in_upload="true" description="Any data in tab delimited format (tabular)." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Tabular_.28tab_delimited.29"/><datatype extension="twobit" type="galaxy.datatypes.binary:TwoBit" mimetype="application/octet-stream" display_in_upload="true"/> - <datatype extension="txt" type="galaxy.datatypes.data:Text" display_in_upload="true"/> + <datatype extension="txt" type="galaxy.datatypes.data:Text" display_in_upload="true" description="Any text file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Plain_text"/><datatype extension="linecount" type="galaxy.datatypes.data:LineCount" display_in_upload="false"/><datatype extension="memexml" type="galaxy.datatypes.xml:MEMEXml" mimetype="application/xml" display_in_upload="true"/><datatype extension="cisml" type="galaxy.datatypes.xml:CisML" mimetype="application/xml" display_in_upload="true"/> @@ -191,7 +191,7 @@ </datatype><datatype extension="bcf" type="galaxy.datatypes.binary:Binary" subclass="True" display_in_upload="True"/><datatype extension="velvet" type="galaxy.datatypes.assembly:Velvet" display_in_upload="false"/> - <datatype extension="wig" type="galaxy.datatypes.interval:Wiggle" display_in_upload="true"> + <datatype extension="wig" type="galaxy.datatypes.interval:Wiggle" display_in_upload="true" description="The wiggle format is line-oriented. Wiggle data is preceded by a track definition line, which adds a number of options for controlling the default display of this track." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Wig"><converter file="wig_to_bigwig_converter.xml" target_datatype="bigwig"/><converter file="wiggle_to_simple_converter.xml" target_datatype="interval"/><!-- <display file="gbrowse/gbrowse_wig.xml" /> --> diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c lib/galaxy/webapps/galaxy/api/datatypes.py --- a/lib/galaxy/webapps/galaxy/api/datatypes.py +++ b/lib/galaxy/webapps/galaxy/api/datatypes.py @@ -18,12 +18,25 @@ GET /api/datatypes Return an object containing upload datatypes. """ + extension_only = asbool( kwd.get( 'extension_only', True ) ) upload_only = asbool( kwd.get( 'upload_only', True ) ) try: - if upload_only: - return trans.app.datatypes_registry.upload_file_formats + if extension_only: + if upload_only: + return trans.app.datatypes_registry.upload_file_formats + else: + return [ ext for ext in trans.app.datatypes_registry.datatypes_by_extension ] else: - return [ ext for ext in trans.app.datatypes_registry.datatypes_by_extension ] + rval = [] + for elem in trans.app.datatypes_registry.datatype_elems: + if not asbool(elem.get('display_in_upload')) and upload_only: + continue + keys = ['extension', 'description', 'description_url'] + dictionary = {} + for key in keys: + dictionary[key] = elem.get(key) + rval.append(dictionary) + return rval except Exception, exception: log.error( 'could not get datatypes: %s', str( exception ), exc_info=True ) trans.response.status = 500 diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/mvc/upload/upload-extensions.js --- a/static/scripts/mvc/upload/upload-extensions.js +++ /dev/null @@ -1,110 +0,0 @@ -// dependencies -define([], function() { - -var dictionary = { - - auto : { - text: 'The system will attempt to detect Axt, Fasta, Fastqsolexa, Gff, Gff3, Html, Lav, Maf, Tabular, Wiggle, Bed and Interval (Bed with headers) formats. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed' - }, - - ab1 : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Ab1', - text: 'A binary sequence file in \'ab1\' format with a \'.ab1\' file extension. You must manually select this \'File Format\' when uploading the file.' - }, - - axt : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Axt', - text: 'blastz pairwise alignment format. Each alignment block in an axt file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines. The summary line contains chromosomal position and size information about the alignment. It consists of 9 required fields.' - }, - - bam : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#BAM', - text: 'A binary file compressed in the BGZF format with a \'.bam\' file extension.' - }, - - bed : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Bed', - text: 'BED format provides a flexible way to define the data lines that are displayed in an annotation track. BED lines have three required columns and nine additional optional columns. The three required columns are chrom, chromStart and chromEnd.' - }, - - fasta : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Fasta', - text: 'A sequence in FASTA format consists of a single-line description, followed by lines of sequence data. The first character of the description line is a greater-than (">") symbol in the first column. All lines should be shorter than 80 characters.' - }, - - fastq : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Fastq', - text: 'FASTQ format is a text-based format for storing both a biological sequence (usually nucleotide sequence) and its corresponding quality scores. ' - }, - - fastqsolexa : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#FastqSolexa', - text: 'FastqSolexa is the Illumina (Solexa) variant of the Fastq format, which stores sequences and quality scores in a single file.' - }, - - gff : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF', - text: 'GFF lines have nine required fields that must be tab-separated.' - }, - - gff3 : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF3', - text: 'The GFF3 format addresses the most common extensions to GFF, while preserving backward compatibility with previous formats.' - }, - - interval : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF3', - text: 'File must start with definition line in the following format (columns may be in any order).' - }, - - lav : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF3', - text: 'Lav is the primary output format for BLASTZ. The first line of a .lav file begins with #:lav..' - }, - - maf : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#MAF', - text: 'TBA and multiz multiple alignment format. The first line of a .maf file begins with ##maf. This word is followed by white-space-separated "variable=value" pairs. There should be no white space surrounding the "=".' - }, - - scf : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Scf', - text: 'A binary sequence file in \'scf\' format with a \'.scf\' file extension. You must manually select this \'File Format\' when uploading the file.' - }, - - sff : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Sff', - text: 'A binary file in \'Standard Flowgram Format\' with a \'.sff\' file extension.' - }, - - tabular : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Tabular_.28tab_delimited.29', - text: 'Any data in tab delimited format (tabular).' - }, - - wig : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Wig', - text: 'The wiggle format is line-oriented. Wiggle data is preceded by a track definition line, which adds a number of options for controlling the default display of this track.' - }, - - txt : { - url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Plain_text', - text: 'Any text file.' - }, - -}; - -// create description content -return function(key) { - var description = dictionary[key]; - if (description) { - var tmpl = description.text; - if (description.url) { - tmpl += ' (<a href="' + description.url + '" target="_blank">read more</a>)'; - } - return tmpl; - } else { - return 'There is no description available for this file extension.'; - } -} -}); diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/mvc/upload/upload-row.js --- a/static/scripts/mvc/upload/upload-row.js +++ b/static/scripts/mvc/upload/upload-row.js @@ -1,14 +1,12 @@ // dependencies define(['utils/utils', 'mvc/upload/upload-model', - 'mvc/upload/upload-extensions', 'mvc/upload/upload-settings', 'mvc/ui/ui-popover', 'mvc/ui/ui-select'], function( Utils, UploadModel, - UploadExtensions, UploadSettings, Popover, Select @@ -317,11 +315,11 @@ var $el = $(this.el).find('#extension-info'); var extension = this.model.get('extension'); var title = this.select_extension.text(); + var description = Utils.findPair(this.app.list_extensions, 'id', extension); // create popup if (!this.extension_popup) { this.extension_popup = new Popover.View({ - content: UploadExtensions(extension), placement: 'bottom', container: $el }); @@ -331,7 +329,7 @@ if (!this.extension_popup.visible) { this.extension_popup.title(title); this.extension_popup.empty(); - this.extension_popup.append(UploadExtensions(extension)); + this.extension_popup.append(this._templateDescription(description)); this.extension_popup.show(); } else { this.extension_popup.hide(); @@ -352,7 +350,20 @@ this.settings.hide(); } }, - + + // template + _templateDescription: function(options) { + if (options.description) { + var tmpl = options.description; + if (options.description_url) { + tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)'; + } + return tmpl; + } else { + return 'There is no description available for this file extension.'; + } + }, + // template _template: function(options) { diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/mvc/upload/upload-view.js --- a/static/scripts/mvc/upload/upload-view.js +++ b/static/scripts/mvc/upload/upload-view.js @@ -42,7 +42,11 @@ upload_size: 0, // extension types - list_extensions :[{id: 'auto', text: 'Auto-detect'}], + list_extensions :[{ + id : 'auto', + text : 'Auto-detect', + description : 'The system will attempt to detect Axt, Fasta, Fastqsolexa, Gff, Gff3, Html, Lav, Maf, Tabular, Wiggle, Bed and Interval (Bed with headers) formats. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed.' + }], // genomes list_genomes : [], @@ -105,14 +109,25 @@ // load extension var self = this; - Utils.jsonFromUrl(galaxy_config.root + "api/datatypes?upload_only=True", + Utils.jsonFromUrl(galaxy_config.root + "api/datatypes?extension_only=False", function(datatypes) { for (key in datatypes) { self.list_extensions.push({ - id : datatypes[key], - text : datatypes[key] + id : datatypes[key].extension, + text : datatypes[key].extension, + description : datatypes[key].description, + description_url : datatypes[key].description_url }); } + + // sort + self.list_extensions.sort(function(a, b) { + if (a.id == 'auto') + return -1; + if (b.id == 'auto') + return 1; + return a.id > b.id ? 1 : a.id < b.id ? -1 : 0; + }); }); // load genomes diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/packed/mvc/upload/upload-extensions.js --- a/static/scripts/packed/mvc/upload/upload-extensions.js +++ /dev/null @@ -1,1 +0,0 @@ -define([],function(){var a={auto:{text:"The system will attempt to detect Axt, Fasta, Fastqsolexa, Gff, Gff3, Html, Lav, Maf, Tabular, Wiggle, Bed and Interval (Bed with headers) formats. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed"},ab1:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Ab1",text:"A binary sequence file in 'ab1' format with a '.ab1' file extension. You must manually select this 'File Format' when uploading the file."},axt:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Axt",text:"blastz pairwise alignment format. Each alignment block in an axt file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines. The summary line contains chromosomal position and size information about the alignment. It consists of 9 required fields."},bam:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#BAM",text:"A binary file compressed in the BGZF format with a '.bam' file extension."},bed:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Bed",text:"BED format provides a flexible way to define the data lines that are displayed in an annotation track. BED lines have three required columns and nine additional optional columns. The three required columns are chrom, chromStart and chromEnd."},fasta:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Fasta",text:'A sequence in FASTA format consists of a single-line description, followed by lines of sequence data. The first character of the description line is a greater-than (">") symbol in the first column. All lines should be shorter than 80 characters.'},fastq:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Fastq",text:"FASTQ format is a text-based format for storing both a biological sequence (usually nucleotide sequence) and its corresponding quality scores. "},fastqsolexa:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#FastqSolexa",text:"FastqSolexa is the Illumina (Solexa) variant of the Fastq format, which stores sequences and quality scores in a single file."},gff:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF",text:"GFF lines have nine required fields that must be tab-separated."},gff3:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF3",text:"The GFF3 format addresses the most common extensions to GFF, while preserving backward compatibility with previous formats."},interval:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF3",text:"File must start with definition line in the following format (columns may be in any order)."},lav:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF3",text:"Lav is the primary output format for BLASTZ. The first line of a .lav file begins with #:lav.."},maf:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#MAF",text:'TBA and multiz multiple alignment format. The first line of a .maf file begins with ##maf. This word is followed by white-space-separated "variable=value" pairs. There should be no white space surrounding the "=".'},scf:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Scf",text:"A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file."},sff:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Sff",text:"A binary file in 'Standard Flowgram Format' with a '.sff' file extension."},tabular:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Tabular_.28tab_delimited.29",text:"Any data in tab delimited format (tabular)."},wig:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Wig",text:"The wiggle format is line-oriented. Wiggle data is preceded by a track definition line, which adds a number of options for controlling the default display of this track."},txt:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Plain_text",text:"Any text file."},};return function(c){var d=a[c];if(d){var b=d.text;if(d.url){b+=' (<a href="'+d.url+'" target="_blank">read more</a>)'}return b}else{return"There is no description available for this file extension."}}}); \ No newline at end of file diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/packed/mvc/upload/upload-row.js --- a/static/scripts/packed/mvc/upload/upload-row.js +++ b/static/scripts/packed/mvc/upload/upload-row.js @@ -1,1 +1,1 @@ -define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-extensions","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select"],function(d,b,f,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(j,h){this.app=j;var g=this;this.model=new b.Model(h);this.setElement(this._template(h));var i=this.$el;this.settings=new c.View({title:"Upload configuration",container:i.find("#settings"),placement:"bottom"});this.select_genome=new e.View({css:"genome",onchange:function(){g.model.set("genome",g.select_genome.value())},data:g.app.list_genomes,container:i.find("#genome"),value:g.model.get("genome")});this.select_extension=new e.View({css:"extension",onchange:function(){g.model.set("extension",g.select_extension.value())},data:g.app.list_extensions,container:i.find("#extension"),value:g.model.get("extension")});i.find("#symbol").on("click",function(){g._removeRow()});i.find("#extension-info").on("click",function(k){g._showExtensionInfo()}).on("mousedown",function(k){k.preventDefault()});i.find("#settings").on("click",function(k){g._showSettings()}).on("mousedown",function(k){k.preventDefault()});i.find("#text-content").on("keyup",function(k){g.model.set("url_paste",$(k.target).val());g.model.set("file_size",$(k.target).val().length)});i.find("#space_to_tabs").on("change",function(k){g.model.set("space_to_tabs",$(k.target).prop("checked"))});this.model.on("change:percentage",function(){g._refreshPercentage()});this.model.on("change:status",function(){g._refreshStatus()});this.model.on("change:info",function(){g._refreshInfo()});this.model.on("change:genome",function(){g._refreshGenome()});this.model.on("change:file_size",function(){g._refreshFileSize()});this.model.on("remove",function(){g.remove()});this.app.collection.on("reset",function(){g.remove()})},render:function(){var n=this.model.get("file_name");var h=this.model.get("file_size");var k=this.model.get("file_mode");var j=this.$el;j.find("#title").html(n);j.find("#size").html(d.bytesToString(h));j.find("#mode").removeClass().addClass("mode");if(k=="new"){var m=j.find("#text");var l=this.options.padding;var i=j.width()-2*l;var g=j.height()-l;m.css("width",i+"px");m.css("top",g+"px");j.height(g+m.height()+2*l);m.show();j.find("#mode").addClass("fa fa-pencil")}if(k=="local"){j.find("#mode").addClass("fa fa-laptop")}if(k=="ftp"){j.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshGenome:function(){var g=this.model.get("genome");this.select_genome.value(g)},_refreshInfo:function(){var g=this.model.get("info");if(g){this.$el.find("#info").html("<strong>Failed: </strong>"+g).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var g=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:g+"%"});if(g!=100){this.$el.find("#percentage").html(g+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var h=this.$el;var g=this.model.get("status");var j=this.status_classes[g];var i=this.$el.find("#symbol");i.removeClass();i.addClass(j);if(g=="init"){this.select_genome.enable();this.select_extension.enable();h.find("#text-content").attr("disabled",false);h.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();h.find("#text-content").attr("disabled",true);h.find("#space_to_tabs").attr("disabled",true)}if(g=="success"){h.addClass("success");h.find("#percentage").html("100%")}if(g=="error"){h.addClass("danger");h.find(".progress").remove()}},_refreshFileSize:function(){var g=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(g))},_removeRow:function(){var g=this.model.get("status");if(g=="init"||g=="success"||g=="error"){this.app.collection.remove(this.model)}},_showExtensionInfo:function(){var g=$(this.el).find("#extension-info");var i=this.model.get("extension");var h=this.select_extension.text();if(!this.extension_popup){this.extension_popup=new c.View({content:f(i),placement:"bottom",container:g})}if(!this.extension_popup.visible){this.extension_popup.title(h);this.extension_popup.empty();this.extension_popup.append(f(i));this.extension_popup.show()}else{this.extension_popup.hide()}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(g){return'<tr id="upload-item-'+g.id+'" class="upload-item"><td><div style="position: relative;"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>'}})}); \ No newline at end of file +define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select"],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(i,g){this.app=i;var f=this;this.model=new b.Model(g);this.setElement(this._template(g));var h=this.$el;this.settings=new c.View({title:"Upload configuration",container:h.find("#settings"),placement:"bottom"});this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:h.find("#genome"),value:f.model.get("genome")});this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:h.find("#extension"),value:f.model.get("extension")});h.find("#symbol").on("click",function(){f._removeRow()});h.find("#extension-info").on("click",function(j){f._showExtensionInfo()}).on("mousedown",function(j){j.preventDefault()});h.find("#settings").on("click",function(j){f._showSettings()}).on("mousedown",function(j){j.preventDefault()});h.find("#text-content").on("keyup",function(j){f.model.set("url_paste",$(j.target).val());f.model.set("file_size",$(j.target).val().length)});h.find("#space_to_tabs").on("change",function(j){f.model.set("space_to_tabs",$(j.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshGenome:function(){var f=this.model.get("genome");this.select_genome.value(f)},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showExtensionInfo:function(){var f=$(this.el).find("#extension-info");var i=this.model.get("extension");var h=this.select_extension.text();var g=d.findPair(this.app.list_extensions,"id",i);if(!this.extension_popup){this.extension_popup=new c.View({placement:"bottom",container:f})}if(!this.extension_popup.visible){this.extension_popup.title(h);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(g));this.extension_popup.show()}else{this.extension_popup.hide()}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_templateDescription:function(g){if(g.description){var f=g.description;if(g.description_url){f+=' (<a href="'+g.description_url+'" target="_blank">read more</a>)'}return f}else{return"There is no description available for this file extension."}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div style="position: relative;"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>'}})}); \ No newline at end of file diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/packed/mvc/upload/upload-view.js --- a/static/scripts/packed/mvc/upload/upload-view.js +++ b/static/scripts/packed/mvc/upload/upload-view.js @@ -1,1 +1,1 @@ -define(["galaxy.modal","utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui","utils/uploadbox"],function(a,f,e,c,b,g,d){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,upload_size:0,list_extensions:[{id:"auto",text:"Auto-detect"}],list_genomes:[],collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(i){var h=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){h.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(j){if(j){h._eventShow(j)}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new e.View(this.ui_button)).$el);var h=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes?upload_only=True",function(j){for(key in j){h.list_extensions.push({id:j[key],text:j[key]})}});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(j){for(key in j){h.list_genomes.push({id:j[key][1],text:j[key][0]})}h.list_genomes.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0})});if(i){this.options=_.defaults(i,this.options)}this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},_eventShow:function(j){j.preventDefault();if(!this.modal){var h=this;this.modal=new a.GalaxyModal({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){h.uploadbox.select()},"Choose FTP file":function(){h._eventFtp()},"Create new file":function(){h._eventCreate()},Start:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(k,l,m){h._eventAnnounce(k,l,m)},initialize:function(k,l,m){return h._eventInitialize(k,l,m)},progress:function(k,l,m){h._eventProgress(k,l,m)},success:function(k,l,m){h._eventSuccess(k,l,m)},error:function(k,l,m){h._eventError(k,l,m)},complete:function(){h._eventComplete()}});this._updateScreen();if(this.options.ftp_upload_dir&&this.options.ftp_upload_site){var i=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:i})}else{this.modal.hideButton("Choose FTP file")}}this.modal.show()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new b(this,{id:h,file_name:i.name,file_size:i.size,file_mode:i.mode,file_path:i.path});this.collection.add(j.model);$(this.el).find("tbody:first").append(j.$el);j.render()},_eventInitialize:function(m,j,s){var k=this.collection.get(m);k.set("status","running");var o=k.get("file_name");var n=k.get("file_path");var h=k.get("file_mode");var p=k.get("extension");var r=k.get("genome");var q=k.get("url_paste");var l=k.get("space_to_tabs");var i=k.get("to_posix_lines");if(!q&&!(j.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(h=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(h=="new"){tool_input["files_0|url_paste"]=q}if(h=="ftp"){tool_input["files_0|ftp_files"]=n}tool_input.dbkey=r;tool_input.file_type=p;tool_input["files_0|type"]="upload_dataset";tool_input.space_to_tabs=l;tool_input.to_posix_lines=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.ui_button.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","success");var h=k.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("percentage",100);j.set("status","error");j.set("info",k);this.ui_button.set("percentage",this._upload_percentage(100,i.size));this.ui_button.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.ui_button.set("percentage",0)}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Create new file")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Create new file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+h+'" class="upload-info"></h6>'}})}); \ No newline at end of file +define(["galaxy.modal","utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui","utils/uploadbox"],function(a,f,e,c,b,g,d){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,upload_size:0,list_extensions:[{id:"auto",text:"Auto-detect",description:"The system will attempt to detect Axt, Fasta, Fastqsolexa, Gff, Gff3, Html, Lav, Maf, Tabular, Wiggle, Bed and Interval (Bed with headers) formats. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."}],list_genomes:[],collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(i){var h=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){h.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(j){if(j){h._eventShow(j)}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new e.View(this.ui_button)).$el);var h=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes?extension_only=False",function(j){for(key in j){h.list_extensions.push({id:j[key].extension,text:j[key].extension,description:j[key].description,description_url:j[key].description_url})}h.list_extensions.sort(function(l,k){if(l.id=="auto"){return -1}if(k.id=="auto"){return 1}return l.id>k.id?1:l.id<k.id?-1:0})});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(j){for(key in j){h.list_genomes.push({id:j[key][1],text:j[key][0]})}h.list_genomes.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0})});if(i){this.options=_.defaults(i,this.options)}this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},_eventShow:function(j){j.preventDefault();if(!this.modal){var h=this;this.modal=new a.GalaxyModal({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){h.uploadbox.select()},"Choose FTP file":function(){h._eventFtp()},"Create new file":function(){h._eventCreate()},Start:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(k,l,m){h._eventAnnounce(k,l,m)},initialize:function(k,l,m){return h._eventInitialize(k,l,m)},progress:function(k,l,m){h._eventProgress(k,l,m)},success:function(k,l,m){h._eventSuccess(k,l,m)},error:function(k,l,m){h._eventError(k,l,m)},complete:function(){h._eventComplete()}});this._updateScreen();if(this.options.ftp_upload_dir&&this.options.ftp_upload_site){var i=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:i})}else{this.modal.hideButton("Choose FTP file")}}this.modal.show()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new b(this,{id:h,file_name:i.name,file_size:i.size,file_mode:i.mode,file_path:i.path});this.collection.add(j.model);$(this.el).find("tbody:first").append(j.$el);j.render()},_eventInitialize:function(m,j,s){var k=this.collection.get(m);k.set("status","running");var o=k.get("file_name");var n=k.get("file_path");var h=k.get("file_mode");var p=k.get("extension");var r=k.get("genome");var q=k.get("url_paste");var l=k.get("space_to_tabs");var i=k.get("to_posix_lines");if(!q&&!(j.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(h=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(h=="new"){tool_input["files_0|url_paste"]=q}if(h=="ftp"){tool_input["files_0|ftp_files"]=n}tool_input.dbkey=r;tool_input.file_type=p;tool_input["files_0|type"]="upload_dataset";tool_input.space_to_tabs=l;tool_input.to_posix_lines=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.ui_button.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","success");var h=k.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("percentage",100);j.set("status","error");j.set("info",k);this.ui_button.set("percentage",this._upload_percentage(100,i.size));this.ui_button.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.ui_button.set("percentage",0)}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Create new file")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Create new file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+h+'" class="upload-info"></h6>'}})}); \ No newline at end of file diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/packed/utils/utils.js --- a/static/scripts/packed/utils/utils.js +++ b/static/scripts/packed/utils/utils.js @@ -1,1 +1,1 @@ -define(["libs/underscore"],function(c){function f(j,i,h){var k=new XMLHttpRequest();k.open("GET",j,true);k.setRequestHeader("Accept","application/json");k.setRequestHeader("Cache-Control","no-cache");k.setRequestHeader("X-Requested-With","XMLHttpRequest");k.onloadend=function(){var l=k.status;if(l==200){try{response=jQuery.parseJSON(k.responseText)}catch(m){response=k.responseText}i&&i(response)}else{h&&h(l)}};k.send()}function b(k,h){var i=$('<div class="'+k+'"></div>');i.appendTo(":eq(0)");var j=i.css(h);i.remove();return j}function a(h){if(!$('link[href^="'+h+'"]').length){$('<link href="'+galaxy_config.root+h+'" rel="stylesheet">').appendTo("head")}}function g(h,i){if(h){return c.defaults(h,i)}else{return i}}function d(i,k){var j="";if(i>=100000000000){i=i/100000000000;j="TB"}else{if(i>=100000000){i=i/100000000;j="GB"}else{if(i>=100000){i=i/100000;j="MB"}else{if(i>=100){i=i/100;j="KB"}else{if(i>0){i=i*10;j="b"}else{return"<strong>-</strong>"}}}}}var h=(Math.round(i)/10);if(k){return h+" "+j}else{return"<strong>"+h+"</strong> "+j}}function e(){return(new Date().getTime()).toString(36)}return{cssLoadFile:a,cssGetAttribute:b,jsonFromUrl:f,merge:g,bytesToString:d,uuid:e}}); \ No newline at end of file +define(["libs/underscore"],function(c){function f(k,j,i){var l=new XMLHttpRequest();l.open("GET",k,true);l.setRequestHeader("Accept","application/json");l.setRequestHeader("Cache-Control","no-cache");l.setRequestHeader("X-Requested-With","XMLHttpRequest");l.onloadend=function(){var m=l.status;if(m==200){try{response=jQuery.parseJSON(l.responseText)}catch(n){response=l.responseText}j&&j(response)}else{i&&i(m)}};l.send()}function b(l,i){var j=$('<div class="'+l+'"></div>');j.appendTo(":eq(0)");var k=j.css(i);j.remove();return k}function a(i){if(!$('link[href^="'+i+'"]').length){$('<link href="'+galaxy_config.root+i+'" rel="stylesheet">').appendTo("head")}}function h(i,j){if(i){return c.defaults(i,j)}else{return j}}function d(j,l){var k="";if(j>=100000000000){j=j/100000000000;k="TB"}else{if(j>=100000000){j=j/100000000;k="GB"}else{if(j>=100000){j=j/100000;k="MB"}else{if(j>=100){j=j/100;k="KB"}else{if(j>0){j=j*10;k="b"}else{return"<strong>-</strong>"}}}}}var i=(Math.round(j)/10);if(l){return i+" "+k}else{return"<strong>"+i+"</strong> "+k}}function e(){return(new Date().getTime()).toString(36)}function g(j,l,n){for(var k in j){var m=j[k];if(m[l]==n){return m}}return{}}return{cssLoadFile:a,cssGetAttribute:b,jsonFromUrl:f,merge:h,bytesToString:d,uuid:e,findPair:g}}); \ No newline at end of file diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/scripts/utils/utils.js --- a/static/scripts/utils/utils.js +++ b/static/scripts/utils/utils.js @@ -96,6 +96,17 @@ return (new Date().getTime()).toString(36); }; +// find in dict +function findPair(arr, key, val) { + for (var i in arr) { + var item = arr[i]; + if (item[key] == val) { + return item; + } + } + return {}; +} + // return return { cssLoadFile : cssLoadFile, @@ -103,7 +114,8 @@ jsonFromUrl : jsonFromUrl, merge : merge, bytesToString: bytesToString, - uuid: uuid + uuid: uuid, + findPair: findPair }; }); diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1261,7 +1261,7 @@ .upload-info{font-weight:normal;text-align:center} .upload-box{width:100%;height:95%;text-align:center;overflow:scroll;font-size:12px;line-height:1.33;-moz-border-radius:5px;border-radius:5px;border:1px dashed #bfbfbf;padding:10px;overflow-x:hidden;-ms-overflow-style:none}.upload-box .table{width:100%} .upload-box .table th{text-align:center;white-space:nowrap} -.upload-box .table td{margin:0px;paddign:0px} +.upload-box .table td{margin:0px} .upload-box .upload-item .select2-arrow b{background-position:0 -3px} .upload-box .upload-item .select2-choice{max-height:20px;line-height:18px;background:transparent} .upload-box .upload-item .select2-container-disabled .select2-arrow{background:transparent} diff -r 5079dae08441dcf125cc9fee87b28aaba7a38f9d -r 72eec07ef71833f797c7e279a6c27c4e8a24535c static/style/src/less/upload.less --- a/static/style/src/less/upload.less +++ b/static/style/src/less/upload.less @@ -82,7 +82,6 @@ .table td { margin: 0px; - paddign: 0px; } .upload-item { Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org