mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Requires change to Galaxy config - fixed the way the File Format select list in the upload tool is dynamically generated, now retrieved from the upload_file_formats in app.registry.
Fixed all references to 'qualityscore' file extensions to be 'qual', since that is the extension in the QualityScore class. Added functional test to the fastq2fasta converter.
This commit is contained in:
@@ -14,27 +14,50 @@ class Registry( object ):
|
||||
self.datatypes_by_extension = {}
|
||||
self.mimetypes_by_extension = {}
|
||||
self.datatype_converters = odict()
|
||||
self.upload_file_formats = []
|
||||
self.sniff_order = []
|
||||
for ext, kind in datatypes:
|
||||
# Data types are defined in the config like this:
|
||||
# #<file extension> = <data type class>,<mime type (optional)>,<display in upload select list (optional)>
|
||||
try:
|
||||
mime_type = None
|
||||
fields = kind.split(",")
|
||||
if len(fields)>1:
|
||||
kind = fields[0].strip()
|
||||
mime_type = fields[1].strip()
|
||||
kind = fields[0].strip()
|
||||
mime_type = None
|
||||
display_in_upload = False
|
||||
# See if we have a mime type or a display_in_upload
|
||||
try:
|
||||
ele = fields[1].strip()
|
||||
if ele:
|
||||
if ele == 'display_in_upload':
|
||||
display_in_upload = True
|
||||
else:
|
||||
mime_type = ele
|
||||
except:
|
||||
pass
|
||||
# See if we have a display_in_upload
|
||||
if not display_in_upload:
|
||||
try:
|
||||
ele = fields[2].strip()
|
||||
if ele == 'display_in_upload':
|
||||
display_in_upload = True
|
||||
except:
|
||||
pass
|
||||
if display_in_upload:
|
||||
self.upload_file_formats.append( ext )
|
||||
fields = kind.split(":")
|
||||
datatype_module = fields[0]
|
||||
datatype_class = fields[1]
|
||||
fields = datatype_module.split(".")
|
||||
module = __import__(fields.pop(0))
|
||||
for mod in fields: module = getattr(module,mod)
|
||||
module = __import__( fields.pop(0) )
|
||||
for mod in fields:
|
||||
module = getattr(module,mod)
|
||||
self.datatypes_by_extension[ext] = getattr(module, datatype_class)()
|
||||
if mime_type is None:
|
||||
# Use default mime type as per datatype spec
|
||||
mime_type = self.datatypes_by_extension[ext].get_mime()
|
||||
self.mimetypes_by_extension[ext] = mime_type
|
||||
except:
|
||||
self.log.warning('error loading datatype: %s' % ext)
|
||||
except Exception, e:
|
||||
self.log.warning('error loading datatype "%s", problem: %s' % ( ext, str( e ) ) )
|
||||
#default values
|
||||
if len(self.datatypes_by_extension) < 1:
|
||||
self.datatypes_by_extension = {
|
||||
@@ -51,7 +74,7 @@ class Registry( object ):
|
||||
'laj' : images.Laj(),
|
||||
'lav' : sequence.Lav(),
|
||||
'maf' : sequence.Maf(),
|
||||
'qualityscore': qualityscore.QualityScore(),
|
||||
'qual' : qualityscore.QualityScore(),
|
||||
'scf' : images.Scf(),
|
||||
'tabular' : tabular.Tabular(),
|
||||
'taxonomy' : tabular.Taxonomy(),
|
||||
@@ -73,7 +96,7 @@ class Registry( object ):
|
||||
'laj' : 'text/plain',
|
||||
'lav' : 'text/plain',
|
||||
'maf' : 'text/plain',
|
||||
'qualityscore': 'text/plain',
|
||||
'qual' : 'text/plain',
|
||||
'scf' : 'application/octet-stream',
|
||||
'tabular' : 'text/plain',
|
||||
'taxonomy' : 'text/plain',
|
||||
|
||||
@@ -172,8 +172,8 @@ class DynamicOptions( object ):
|
||||
filters[ 'data_meta' ][ 'meta_value' ] = dataset.metadata.species
|
||||
except:
|
||||
pass
|
||||
return self.generate_options( filters=filters, sep=self.separator )
|
||||
def generate_options( self, filters={}, sep='\t' ):
|
||||
return self.generate_options( trans, filters=filters, sep=self.separator )
|
||||
def generate_options( self, trans, filters={}, sep='\t' ):
|
||||
try:
|
||||
meta_key = filters[ 'data_meta' ][ 'meta_key' ]
|
||||
except:
|
||||
@@ -194,7 +194,8 @@ class DynamicOptions( object ):
|
||||
return self.generate_for_dbkey( dbkey, meta_key_col, self.name_col, self.value_col, sep=sep )
|
||||
else: # meta_key is None
|
||||
if self.data_file == 'datatypes_registry':
|
||||
return self.generate_from_datatypes_registry()
|
||||
upload_file_formats = trans.app.datatypes_registry.upload_file_formats
|
||||
return self.generate_from_datatypes_registry( upload_file_formats )
|
||||
elif self.data_file == 'encode_datasets.loc':
|
||||
encode_group = filters[ 'params' ][ 'encode_group' ]
|
||||
dbkey = filters[ 'params' ][ 'dbkey' ]
|
||||
@@ -217,11 +218,9 @@ class DynamicOptions( object ):
|
||||
return self.generate_for_microbial( kingdom, org, feature )
|
||||
else:
|
||||
return self.generate( self.name_col, self.value_col, sep=sep )
|
||||
def generate_from_datatypes_registry( self ):
|
||||
from galaxy.datatypes import registry
|
||||
datatypes_registry = registry.Registry()
|
||||
def generate_from_datatypes_registry( self, upload_file_formats ):
|
||||
options = []
|
||||
formats = datatypes_registry.datatypes_by_extension.keys()
|
||||
formats = upload_file_formats
|
||||
formats.sort()
|
||||
options.append( ( 'Auto-detect', 'auto', True ) )
|
||||
for format in formats:
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
@seq1
|
||||
GACAGCTTGGTTTTTAGTGAGTTGTTCCTTTCTTT
|
||||
+seq1
|
||||
hhhhhhhhhhhhhhhhhhhhhhhhhhPW@hhhhhh
|
||||
@seq2
|
||||
GCAATGACGGCAGCAATAAACTCAACAGGTGCTGG
|
||||
+seq2
|
||||
hhhhhhhhhhhhhhYhhahhhhWhAhFhSIJGChO
|
||||
@@ -1,15 +1,21 @@
|
||||
<tool id="convert_fastq2fasta" name="FASTQ-to-FASTA" version="1.0.0">
|
||||
<description>converts FASTQ file to FASTA format</description>
|
||||
<command interpreter="python">convert_fastq2fasta.py $input1 $output1 $output2</command>
|
||||
<inputs>
|
||||
<param name="input1" type="data" format="fastq" label="Fastq file"/>
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data name="output1" format="fasta"/>
|
||||
<data name="output2" format="qualityscore"/>
|
||||
</outputs>
|
||||
|
||||
<help>
|
||||
<description>converts FASTQ file to FASTA format</description>
|
||||
<command interpreter="python">convert_fastq2fasta.py $input1 $output1 $output2</command>
|
||||
<inputs>
|
||||
<param name="input1" type="data" format="fastq" label="Fastq file"/>
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data name="output1" format="qual"/>
|
||||
<data name="output2" format="fasta"/>
|
||||
</outputs>
|
||||
<tests>
|
||||
<!-- NOTE: this tool generates 2 output files, but our functional tests currently only handle the last one generated -->
|
||||
<test>
|
||||
<param name="input1" value="1.fastq" ftype="fastq" />
|
||||
<output name="output2" file="convert_fastq2fasta_out2.fasta" />
|
||||
</test>
|
||||
</tests>
|
||||
<help>
|
||||
|
||||
**What it does**
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<options from_file="faseq.loc" name_col="0" value_col="1"/>
|
||||
</param>
|
||||
<param name="input_seq" type="data" format="fasta" label="Sequence file"/>
|
||||
<param name="input_score" type="data" format="qualityscore" label="Quality score file"/>
|
||||
<param name="input_score" type="data" format="qual" label="Quality score file"/>
|
||||
<param name="high_score" type="float" size="15" value="40" label="Minimum score for high-quality base (-q)"/>
|
||||
<param name="high_len" type="integer" size="15" value="36" label="Minimal high-quality bases (-M)"/>
|
||||
<param name="align_len" type="integer" size="15" value="11" label="Minimal length of a hit (-h)" help="seed"/>
|
||||
@@ -43,7 +43,7 @@
|
||||
<test>
|
||||
<param name="database" value="/depot/data2/galaxy/faseq/test" />
|
||||
<param name="input_seq" value="rmapq_wrapper_test1.fasta" ftype="fasta"/>
|
||||
<param name="input_score" value="rmapq_wrapper_test1.qualityscore" ftype="qualityscore" />
|
||||
<param name="input_score" value="rmapq_wrapper_test1.qual" ftype="qual" />
|
||||
<param name="high_score" value="40" />
|
||||
<param name="high_len" value="36" />
|
||||
<param name="read_len" value="36" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<inputs>
|
||||
<page>
|
||||
<param name="input1" type="data" format="qualityscore,txtseq.zip" label="Quality score file" help="No dataset? Read tip below"/>
|
||||
<param name="input1" type="data" format="qual,txtseq.zip" label="Quality score file" help="No dataset? Read tip below"/>
|
||||
<param name="input2" type="integer" size="5" value="20" label="Quality score threshold" />
|
||||
</page>
|
||||
</inputs>
|
||||
@@ -17,12 +17,12 @@
|
||||
</requirements>
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input1" value="solexa.qualityscore" ftype="qualityscore" />
|
||||
<param name="input1" value="solexa.qual" ftype="qual" />
|
||||
<param name="input2" value="5" />
|
||||
<output name="output1" file="solexa_high_quality_hist.pdf" ftype="pdf"/>
|
||||
</test>
|
||||
<test>
|
||||
<param name="input1" value="454.qualityscore" ftype="qualityscore" />
|
||||
<param name="input1" value="454.qual" ftype="qual" />
|
||||
<param name="input2" value="5" />
|
||||
<output name="output1" file="454_high_quality_hist.pdf" ftype="pdf"/>
|
||||
</test>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<inputs>
|
||||
<page>
|
||||
<param name="input1" type="data" format="qualityscore, txtseq.zip" label="Quality score file" help="No dataset? Read tip below"/>
|
||||
<param name="input1" type="data" format="qual, txtseq.zip" label="Quality score file" help="No dataset? Read tip below"/>
|
||||
</page>
|
||||
</inputs>
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
</requirements>
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input1" value="solexa.qualityscore" ftype="qualityscore" />
|
||||
<param name="input1" value="solexa.qual" ftype="qual" />
|
||||
<output name="output1" file="solexaScore.png" ftype="png" />
|
||||
</test>
|
||||
<test>
|
||||
<param name="input1" value="454.qualityscore" ftype="qualityscore" />
|
||||
<param name="input1" value="454.qual" ftype="qual" />
|
||||
<output name="output1" file="454Score.png" ftype="png" />
|
||||
</test>
|
||||
</tests>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<inputs>
|
||||
<page>
|
||||
<param name="input1" type="data" format="fasta,txtseq.zip" label="Reads" />
|
||||
<param name="input2" type="data" format="qualityscore,txtseq.zip" label="Quality scores" />
|
||||
<param name="input2" type="data" format="qual,txtseq.zip" label="Quality scores" />
|
||||
<param name="trim" type="integer" size="5" value="20" label="Minimal quality score" help="bases scoring below this value will trigger splitting"/>
|
||||
<param name="length" type="integer" size="5" value="100" label="Minimal length of contiguous segment" help="report all high quality segments above this length. Setting this option to '0' will cause the program to return a single longest run of high quality bases per read" />
|
||||
<conditional name="sequencing_method_choice">
|
||||
@@ -36,7 +36,7 @@
|
||||
<test>
|
||||
<param name="sequencer" value="454" />
|
||||
<param name="input1" value="454.fasta" ftype="fasta" />
|
||||
<param name="input2" value="454.qualityscore" ftype="qualityscore" />
|
||||
<param name="input2" value="454.qual" ftype="qual" />
|
||||
<param name="input3" value="no" />
|
||||
<param name="trim" value="20" />
|
||||
<param name="length" value="0" />
|
||||
@@ -45,7 +45,7 @@
|
||||
<test>
|
||||
<param name="sequencer" value="Solexa" />
|
||||
<param name="input1" value="solexa.fasta" ftype="fasta" />
|
||||
<param name="input2" value="solexa.qualityscore" ftype="qualityscore" />
|
||||
<param name="input2" value="solexa.qual" ftype="qual" />
|
||||
<param name="input3" value="0" />
|
||||
<param name="trim" value="20" />
|
||||
<param name="length" value="0" />
|
||||
|
||||
+19
-18
@@ -85,7 +85,7 @@ mailing_join_addr = galaxy-user-join@bx.psu.edu
|
||||
|
||||
# Mail
|
||||
smtp_server = coltrane.bx.psu.edu
|
||||
error_email_to = galaxy_bugs@bx.psu.edu
|
||||
error_email_to = galaxy-bugs@bx.psu.edu
|
||||
|
||||
# Use the new iframe / javascript based layout
|
||||
use_new_layout = true
|
||||
@@ -167,33 +167,34 @@ upload1 = local:///
|
||||
|
||||
[galaxy:datatypes]
|
||||
|
||||
ab1 = galaxy.datatypes.images:Ab1,application/octet-stream
|
||||
axt = galaxy.datatypes.sequence:Axt
|
||||
bed = galaxy.datatypes.interval:Bed
|
||||
binseq.zip = galaxy.datatypes.images:Binseq,application/zip
|
||||
#<file extension> = <data type class>,<mime type (optional)>,<display in upload select list (optional)>
|
||||
ab1 = galaxy.datatypes.images:Ab1,application/octet-stream,display_in_upload
|
||||
axt = galaxy.datatypes.sequence:Axt,display_in_upload
|
||||
bed = galaxy.datatypes.interval:Bed,display_in_upload
|
||||
binseq.zip = galaxy.datatypes.images:Binseq,application/zip,display_in_upload
|
||||
customtrack = galaxy.datatypes.interval:CustomTrack
|
||||
data = galaxy.datatypes.data:Data,application/octet-stream
|
||||
fasta = galaxy.datatypes.sequence:Fasta
|
||||
fastq = galaxy.datatypes.sequence:Fastq
|
||||
gff = galaxy.datatypes.interval:Gff
|
||||
gff3 = galaxy.datatypes.interval:Gff3
|
||||
fasta = galaxy.datatypes.sequence:Fasta,display_in_upload
|
||||
fastq = galaxy.datatypes.sequence:Fastq,display_in_upload
|
||||
gff = galaxy.datatypes.interval:Gff,display_in_upload
|
||||
gff3 = galaxy.datatypes.interval:Gff3,display_in_upload
|
||||
gif = galaxy.datatypes.images:Image,image/gif
|
||||
gmaj.zip = galaxy.datatypes.images:Gmaj,application/zip
|
||||
html = galaxy.datatypes.images:Html,text/html
|
||||
interval = galaxy.datatypes.interval:Interval
|
||||
interval = galaxy.datatypes.interval:Interval,display_in_upload
|
||||
jpg = galaxy.datatypes.images:Image,image/jpeg
|
||||
laj = galaxy.datatypes.images:Laj
|
||||
lav = galaxy.datatypes.sequence:Lav
|
||||
maf = galaxy.datatypes.sequence:Maf
|
||||
maf = galaxy.datatypes.sequence:Maf,display_in_upload
|
||||
pdf = galaxy.datatypes.images:Image,application/pdf
|
||||
png = galaxy.datatypes.images:Image,image/png
|
||||
qualityscore = galaxy.datatypes.qualityscore:QualityScore
|
||||
scf = galaxy.datatypes.images:Scf,application/octet-stream
|
||||
taxonomy = galaxy.datatypes.tabular:Taxonomy
|
||||
tabular = galaxy.datatypes.tabular:Tabular
|
||||
txt = galaxy.datatypes.data:Text
|
||||
txtseq.zip = galaxy.datatypes.images:Txtseq,application/zip
|
||||
wig = galaxy.datatypes.interval:Wiggle
|
||||
qual = galaxy.datatypes.qualityscore:QualityScore,display_in_upload
|
||||
scf = galaxy.datatypes.images:Scf,application/octet-stream,display_in_upload
|
||||
taxonomy = galaxy.datatypes.tabular:Taxonomy,display_in_upload
|
||||
tabular = galaxy.datatypes.tabular:Tabular,display_in_upload
|
||||
txt = galaxy.datatypes.data:Text,display_in_upload
|
||||
txtseq.zip = galaxy.datatypes.images:Txtseq,application/zip,display_in_upload
|
||||
wig = galaxy.datatypes.interval:Wiggle,display_in_upload
|
||||
#EMBOSS TOOLS
|
||||
acedb = galaxy.datatypes.data:Text
|
||||
asn1 = galaxy.datatypes.data:Text
|
||||
|
||||
Reference in New Issue
Block a user