mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Added support for gff3 datatype
This commit is contained in:
@@ -330,6 +330,16 @@ class Gff( Tabular ):
|
||||
ret_val.append( (site_name, link) )
|
||||
return ret_val
|
||||
|
||||
class Gff3( Gff ):
|
||||
"""Tab delimited data in Gff3 format"""
|
||||
|
||||
"""Add metadata elements"""
|
||||
MetadataElement( name="column_types", default=['str','str','str','int','int','float','str','int','list'], desc="Column types", readonly=True )
|
||||
|
||||
def __init__(self, **kwd):
|
||||
"""Initialize datatype, by adding GBrowse display app"""
|
||||
Gff.__init__(self, **kwd)
|
||||
|
||||
class Wiggle( Tabular ):
|
||||
"""Tab delimited data in wiggle format"""
|
||||
MetadataElement( name="columns", default=3, desc="Number of columns", readonly=True )
|
||||
|
||||
@@ -48,6 +48,7 @@ class Registry( object ):
|
||||
'maf' : sequence.Maf(),
|
||||
'axt' : sequence.Axt(),
|
||||
'gff' : interval.Gff(),
|
||||
'gff3' : interval.Gff3(),
|
||||
'wig' : interval.Wiggle(),
|
||||
'gmaj.zip' : images.Gmaj(),
|
||||
'laj' : images.Laj(),
|
||||
@@ -69,6 +70,7 @@ class Registry( object ):
|
||||
'maf' : 'text/plain',
|
||||
'axt' : 'text/plain',
|
||||
'gff' : 'text/plain',
|
||||
'gff3' : 'text/plain',
|
||||
'wig' : 'text/plain',
|
||||
'gmaj.zip' : 'application/zip',
|
||||
'laj' : 'text/plain',
|
||||
|
||||
@@ -599,8 +599,10 @@ def guess_ext(fname):
|
||||
|
||||
if is_column_based(fname, '\t', 1):
|
||||
headers = get_headers(fname, '\t')
|
||||
if is_gff(headers) or is_gff3(headers):
|
||||
if is_gff(headers):
|
||||
return 'gff'
|
||||
if is_gff3(headers):
|
||||
return 'gff3'
|
||||
elif is_interval(headers):
|
||||
return 'interval'
|
||||
else:
|
||||
|
||||
@@ -86,6 +86,26 @@ class Tabular( data.Text ):
|
||||
proceed = True
|
||||
except:
|
||||
pass
|
||||
elif format == 'gff3':
|
||||
valid_gff3_strand = ['+', '-', '.', '?']
|
||||
valid_start = False
|
||||
valid_end = False
|
||||
if elems_len == 9:
|
||||
try:
|
||||
start = int(hdr[3])
|
||||
valid_start = True
|
||||
except:
|
||||
if hdr[3] == '.':
|
||||
valid_start = True
|
||||
try:
|
||||
end = int(hdr[4])
|
||||
valid_end = True
|
||||
except:
|
||||
if hdr[4] == '.':
|
||||
valid_end = True
|
||||
srand = hdr[6]
|
||||
if valid_start and valid_end and start < end and strand in valid_gff3_strand:
|
||||
proceed = True
|
||||
elif format=='wig':
|
||||
try:
|
||||
int( elems[0] )
|
||||
|
||||
@@ -70,7 +70,7 @@ mime_types = {
|
||||
|
||||
text_types = sets.Set([
|
||||
'txt', 'text', 'wig', 'genbank', 'motif', 'acedb', 'nexus', 'fitch', 'meganon', 'codata', 'dbmotif',
|
||||
'table', 'fasta', 'txt', 'gff', 'pir', 'ig', 'seqtable', 'clustal', 'gcg', 'hennig86', 'excel', 'asn1',
|
||||
'table', 'fasta', 'txt', 'gff', 'gff3', 'pir', 'ig', 'seqtable', 'clustal', 'gcg', 'hennig86', 'excel', 'asn1',
|
||||
'regions', 'simple', 'score', 'text', 'msf', 'selex', 'tagseq', 'embl', 'srspair', 'staden',
|
||||
'strider', 'xbed', 'markx10', 'pair', 'markx1', 'markx0', 'markx3', 'markx2', 'jackknifer',
|
||||
'ncbi', 'mega', 'fa', 'feattable', 'phylip', 'diffseq', 'bed', 'srs', 'jackknifernon', 'swiss',
|
||||
|
||||
@@ -22,6 +22,8 @@ def exec_before_job( app, inp_data, out_data, param_dict, tool=None):
|
||||
ext = "maf"
|
||||
elif outputType == 'gff':
|
||||
ext = "gff"
|
||||
elif outputType == 'gff3':
|
||||
ext = "gff3"
|
||||
else:
|
||||
if 'hgta_doPrintSelectedFields' in param_dict:
|
||||
ext = "interval"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<option value="axt">AXT</option>
|
||||
<option value="tabular">Tab delimited</option>
|
||||
<option value="gff">Gff</option>
|
||||
<option value="gff3">Gff3</option>
|
||||
<option value="lav">LAV</option>
|
||||
<option value="html">HTML</option>
|
||||
<option value="wig">Wiggle</option>
|
||||
@@ -112,7 +113,13 @@ A sequence in FASTA format consists of a single-line description, followed by li
|
||||
|
||||
**Gff**
|
||||
|
||||
GFF lines have nine required fields that must be tab-separated. Gff version 3 is also supported.
|
||||
GFF lines have nine required fields that must be tab-separated.
|
||||
|
||||
-----
|
||||
|
||||
**Gff3**
|
||||
|
||||
The proposed GFF3 format addresses the most common extensions to GFF, while preserving backward compatibility with previous formats.
|
||||
|
||||
-----
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ fasta = galaxy.datatypes.sequence:Fasta
|
||||
maf = galaxy.datatypes.sequence:Maf
|
||||
axt = galaxy.datatypes.sequence:Axt
|
||||
gff = galaxy.datatypes.interval:Gff
|
||||
gff3 = galaxy.datatypes.interval:Gff3
|
||||
wig = galaxy.datatypes.interval:Wiggle
|
||||
gmaj.zip = galaxy.datatypes.images:Gmaj,application/zip
|
||||
laj = galaxy.datatypes.images:Laj
|
||||
|
||||
Reference in New Issue
Block a user