mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Improved implementation for displaying Galaxy files at UCSC, GBrowse, and other future applications.
Fixed a bug in the unit test for new gff version 3 format in sniff.py. Tweaked the biomart tool so that it will not display problm Info: text in history. This commit includes some stuff for future GBrowse integration, but nothing included should pose any problems with the current environment.
This commit is contained in:
@@ -46,6 +46,7 @@ class Configuration( object ):
|
||||
self.pbs_dataset_path = kwargs.get('pbs_dataset_path', "" )
|
||||
self.use_heartbeat = kwargs.get( 'use_heartbeat', False )
|
||||
self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites', "main,test,archaea" ).lower().split(",")
|
||||
self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "wormbase,flybase" ).lower().split(",")
|
||||
#Parse global_conf
|
||||
global_conf = kwargs.get( 'global_conf', None )
|
||||
global_conf_parser = ConfigParser.ConfigParser()
|
||||
|
||||
@@ -15,6 +15,9 @@ class DataMeta( type ):
|
||||
|
||||
class Data( object ):
|
||||
__metaclass__ = DataMeta
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
def set_peek( self, dataset ):
|
||||
dataset.peek = ''
|
||||
@@ -23,10 +26,12 @@ class Data( object ):
|
||||
pass
|
||||
def missing_meta( self, dataset):
|
||||
return False
|
||||
def bed_viewport( self, dataset ):
|
||||
raise Exception( "'bed_viewport' not supported for this datatype" )
|
||||
def as_bedfile( self, dataset ):
|
||||
raise Exception( "'as_bedfile' not supported for this datatype" )
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
raise Exception( "'get_estimated_display_viewport' must be overridden in subclass." )
|
||||
def as_ucsc_display_file( self, dataset ):
|
||||
raise Exception( "'as_ucsc_display_file' not supported for this datatype" )
|
||||
def as_gbrowse_display_file( self, dataset ):
|
||||
raise Exception( "'as_gbrowse_display_file' not supported for this datatype" )
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return escape(dataset.peek)
|
||||
@@ -44,6 +49,8 @@ class Data( object ):
|
||||
return "info unavailable"
|
||||
def get_ucsc_sites(self, dataset):
|
||||
return util.get_ucsc_by_build(dataset.dbkey)
|
||||
def get_gbrowse_sites(self, dataset):
|
||||
return util.get_gbrowse_sites_by_build(dataset.dbkey)
|
||||
def validate(self, dataset):
|
||||
"""Unimplemented validate, return no exceptions"""
|
||||
return list()
|
||||
@@ -56,6 +63,10 @@ class Data( object ):
|
||||
return cls._metadataspec
|
||||
|
||||
class Text( Data ):
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
def write_from_stream(self, stream):
|
||||
"Writes data from a stream"
|
||||
# write it twice for now
|
||||
@@ -107,6 +118,10 @@ class Text( Data ):
|
||||
|
||||
class Binary( Data ):
|
||||
"""Binary data"""
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
def set_peek( self, dataset ):
|
||||
dataset.peek = 'binary data'
|
||||
dataset.blurb = 'data'
|
||||
|
||||
@@ -33,6 +33,9 @@ for key, value in alias_spec.items():
|
||||
class Tabular( data.Text ):
|
||||
"""Tab delimited data"""
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
def missing_meta( self, dataset ):
|
||||
"""Checks for empty meta values"""
|
||||
for key, value in dataset.metadata.items():
|
||||
@@ -77,14 +80,21 @@ class Tabular( data.Text ):
|
||||
except Exception, exc:
|
||||
out = "Can't create peek %s" % exc
|
||||
return out
|
||||
|
||||
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
#TODO: fix me...
|
||||
return ('', '', '')
|
||||
|
||||
def display_peek( self, dataset ):
|
||||
m_peek = self.make_html_table( dataset.peek )
|
||||
return m_peek
|
||||
|
||||
class Interval( Tabular ):
|
||||
"""Tab delimited data containing interval information"""
|
||||
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = ['ucsc']
|
||||
|
||||
def missing_meta( self, dataset ):
|
||||
"""Checks for empty meta values"""
|
||||
for key, value in dataset.metadata.items():
|
||||
@@ -125,13 +135,9 @@ class Interval( Tabular ):
|
||||
for lower in values[start:]:
|
||||
del valid[lower] # removes lower priority keys
|
||||
dataset.mark_metadata_changed()
|
||||
|
||||
|
||||
|
||||
def bed_viewport( self, dataset ):
|
||||
"""
|
||||
Return a start position for viewing a bed file.
|
||||
"""
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
"""Return a chrom, start, stop tuple for viewing a file."""
|
||||
if dataset.has_data() and dataset.state == dataset.states.OK:
|
||||
try:
|
||||
c, s, e, t = dataset.metadata.chromCol, dataset.metadata.startCol, dataset.metadata.endCol, dataset.metadata.strandCol
|
||||
@@ -152,13 +158,13 @@ class Interval( Tabular ):
|
||||
stop = max( stop, int( p[e] ) )
|
||||
except Exception, exc:
|
||||
log.error( 'Viewport generation error -> %s ' % str(exc) )
|
||||
chr, start, stop = 'chr1', 1, 1000
|
||||
return "%s:%d-%d" % ( chr, start, stop )
|
||||
(chr, start, stop) = 'chr1', 1, 1000
|
||||
return (chr, str( start ), str( stop ))
|
||||
else:
|
||||
return ""
|
||||
return ('', '', '')
|
||||
|
||||
def as_bedfile( self, dataset ):
|
||||
'''Returns a file that contains only the bed data'''
|
||||
def as_ucsc_display_file( self, dataset ):
|
||||
"""Returns a file that contains only the bed data"""
|
||||
fd, temp_name = tempfile.mkstemp()
|
||||
c, s, e, t = dataset.metadata.chromCol, dataset.metadata.startCol, dataset.metadata.endCol, dataset.metadata.strandCol
|
||||
c, s, e, t = int(c)-1, int(s)-1, int(e)-1, int(t)-1
|
||||
@@ -203,6 +209,10 @@ class Interval( Tabular ):
|
||||
|
||||
class Bed( Interval ):
|
||||
"""Tab delimited data in BED format"""
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = ['ucsc']
|
||||
|
||||
def missing_meta( self, dataset ):
|
||||
"""Checks for empty meta values"""
|
||||
return Tabular.missing_meta(self, dataset)
|
||||
@@ -237,8 +247,8 @@ class Bed( Interval ):
|
||||
dataset.metadata.strandCol = 0
|
||||
dataset.mark_metadata_changed()
|
||||
|
||||
def as_bedfile( self, dataset ):
|
||||
'''Returns a file that contains only the bed data. If bed 6+, treat as interval.'''
|
||||
def as_ucsc_display_file( self, dataset ):
|
||||
"""Returns a file that contains only the bed data. If bed 6+, treat as interval."""
|
||||
for line in open(dataset.file_name):
|
||||
line = line.strip()
|
||||
if line == "" or line.startswith("#"):
|
||||
@@ -247,14 +257,14 @@ class Bed( Interval ):
|
||||
#check to see if this file doesn't conform to strict genome browser accepted bed
|
||||
try:
|
||||
if len(fields) > 12:
|
||||
return Interval.as_bedfile(self, dataset) #too many fields
|
||||
return Interval.as_ucsc_display_file(self, dataset) #too many fields
|
||||
if len(fields) > 6:
|
||||
int(fields[6])
|
||||
if len(fields) > 7:
|
||||
int(fields[7])
|
||||
if len(fields) > 8:
|
||||
if int(fields[8]) != 0:
|
||||
return Interval.as_bedfile(self, dataset)
|
||||
return Interval.as_ucsc_display_file(self, dataset)
|
||||
if len(fields) > 9:
|
||||
int(fields[9])
|
||||
if len(fields) > 10:
|
||||
@@ -265,57 +275,144 @@ class Bed( Interval ):
|
||||
fields2 = fields[11].rstrip(",").split(",") #remove trailing comma and split on comma
|
||||
for field in fields2:
|
||||
int(field)
|
||||
except: return Interval.as_bedfile(self, dataset)
|
||||
except: return Interval.as_ucsc_display_file(self, dataset)
|
||||
#only check first line for proper form
|
||||
break
|
||||
|
||||
try: return dataset.file_name
|
||||
except: return "This item contains no content"
|
||||
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
#TODO: fix me...
|
||||
return Interval.get_estimated_display_viewport( self, dataset )
|
||||
|
||||
class Gff( Tabular ):
|
||||
"""Tab delimited data in Gff format"""
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = ['gbrowse']
|
||||
|
||||
def __init__(self, id=None):
|
||||
data.Text.__init__(self, id=id)
|
||||
|
||||
def make_html_table(self, data):
|
||||
return Tabular.make_html_table(self, data, skipchar='#')
|
||||
|
||||
def as_gbrowse_display_file( self, dataset ):
|
||||
'''Returns a file that can be displayed in GBrowse apps.'''
|
||||
#TODO: fix me...
|
||||
return dataset.file_name
|
||||
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
"""
|
||||
Return a chrom, start, stop tuple for viewing a file. There are slight differences between gff and gff version 3
|
||||
formats. This function should correctly handle both...
|
||||
"""
|
||||
if dataset.has_data() and dataset.state == dataset.states.OK:
|
||||
try:
|
||||
"""
|
||||
TODO: the metadata stuff needs to work for this and other formats (besides bed and interval).
|
||||
When this works, we should be able to have just 1 get_estimated_display_viewport() method at
|
||||
possibly the Tabular level that should handle most tabular formats.
|
||||
|
||||
c, s, e, t = dataset.metadata.chromCol, dataset.metadata.startCol, dataset.metadata.endCol, dataset.metadata.strandCol
|
||||
c, s, e, t = int(c)-1, int(s)-1, int(e)-1, int(t)-1
|
||||
"""
|
||||
seqid_col = 0
|
||||
start_col = 3
|
||||
stop_col = 4
|
||||
|
||||
peek = []
|
||||
for idx, line in enumerate(file(dataset.file_name)):
|
||||
if line[0] != '#':
|
||||
peek.append( line.split() )
|
||||
if idx > 10:
|
||||
break
|
||||
|
||||
seqid, start, stop = peek[0][seqid_col], int( peek[0][start_col] ), int( peek[0][stop_col] )
|
||||
|
||||
for p in peek[1:]:
|
||||
if p[0] == seqid:
|
||||
start = min( start, int( p[start_col] ) )
|
||||
stop = max( stop, int( p[stop_col] ) )
|
||||
except Exception, exc:
|
||||
log.error( 'Viewport generation error -> %s ' % str(exc) )
|
||||
seqid, start, stop = ('', '', '')
|
||||
return (seqid, str( start ), str( stop ))
|
||||
else:
|
||||
return ('', '', '')
|
||||
|
||||
class Wiggle( Tabular ):
|
||||
"""Tab delimited data in wiggle format"""
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
def __init__(self, id=None):
|
||||
data.Text.__init__(self, id=id)
|
||||
|
||||
def make_html_table(self, data):
|
||||
return Tabular.make_html_table(self, data, skipchar='#')
|
||||
|
||||
class Wiggle( Tabular ):
|
||||
"""Tab delimited data in wiggle format"""
|
||||
def __init__(self, id=None):
|
||||
data.Text.__init__(self, id=id)
|
||||
|
||||
def make_html_table(self, data):
|
||||
return Tabular.make_html_table(self, data, skipchar='#')
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
#TODO: fix me...
|
||||
return ('', '', '')
|
||||
|
||||
#Extend Tabular type, since interval tools will fail on track def line (we should fix this)
|
||||
#This is a skeleton class for now, allows viewing at ucsc and formatted peeking.
|
||||
class CustomTrack ( Tabular ):
|
||||
"""UCSC CustomTrack"""
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = ['ucsc']
|
||||
|
||||
def __init__(self, id=None):
|
||||
data.Text.__init__(self, id=id)
|
||||
|
||||
def make_html_table(self, dataset):
|
||||
return Tabular.make_html_table(self, dataset, skipchar='track')
|
||||
|
||||
def bed_viewport( self, dataset ):
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
try:
|
||||
for line in open(dataset.file_name):
|
||||
if (line.startswith("chr") or line.startswith("scaffold")):
|
||||
start = line.split("\t")[1].replace(",","")
|
||||
end = line.split("\t")[2].replace(",","")
|
||||
|
||||
if int(start) < int(end):
|
||||
value = line.split("\t")[0] + ":" + start + "-" + end
|
||||
value = ( line.split("\t")[0], start, end )
|
||||
else:
|
||||
value = line.split("\t")[0] + ":" + end + "-" + start
|
||||
value = ( line.split("\t")[0], end, start )
|
||||
|
||||
break
|
||||
return value #returns the co-ordinates of the 1st track/dataset
|
||||
except:
|
||||
return "."
|
||||
#return "."
|
||||
return ('', '', '')
|
||||
|
||||
def as_bedfile( self, dataset ):
|
||||
def as_ucsc_display_file( self, dataset ):
|
||||
return dataset.file_name
|
||||
|
||||
#Extend Tabular type, since interval tools will fail on track def line (we should fix this)
|
||||
#This is a skeleton class for now, allows viewing at ucsc and formatted peeking.
|
||||
class GBrowseTrack ( Tabular ):
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = ['gbrowse']
|
||||
|
||||
def __init__(self, id=None):
|
||||
data.Text.__init__(self, id=id)
|
||||
|
||||
def make_html_table(self, dataset):
|
||||
return Tabular.make_html_table(self, dataset, skipchar='track')
|
||||
|
||||
def display_formats_supported( self, dataset ):
|
||||
return set(['gbrowse track'])
|
||||
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
#TODO: fix me...
|
||||
return ('', '', '')
|
||||
|
||||
if __name__ == '__main__':
|
||||
import doctest, sys
|
||||
doctest.testmod(sys.modules[__name__])
|
||||
|
||||
@@ -9,10 +9,16 @@ log = logging.getLogger(__name__)
|
||||
|
||||
class Sequence( data.Text ):
|
||||
"""Class describing a sequence"""
|
||||
pass
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
class Fasta( Sequence ):
|
||||
"""Class representing a FASTA sequence"""
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
def set_peek( self, dataset ):
|
||||
Sequence.set_peek( self, dataset )
|
||||
count = size = 0
|
||||
@@ -27,14 +33,24 @@ class Fasta( Sequence ):
|
||||
else:
|
||||
dataset.blurb = '%d sequences' % count
|
||||
|
||||
def get_estimated_display_viewport( self, dataset ):
|
||||
#TODO: fix me...
|
||||
return ('', '', '')
|
||||
|
||||
class Maf( Sequence ):
|
||||
"""Class describing a Maf alignment"""
|
||||
pass
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
class Axt( Sequence ):
|
||||
"""Class describing an axt alignment"""
|
||||
pass
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
|
||||
class Lav( Sequence ):
|
||||
"""Class describing a LAV alignment"""
|
||||
pass
|
||||
|
||||
"""Provide the set of display formats supported by this datatype """
|
||||
supported_display_apps = []
|
||||
@@ -214,9 +214,9 @@ def is_gff3(headers):
|
||||
>>> headers = get_headers(__file__, sep=' ')
|
||||
>>> is_fasta(headers)
|
||||
False
|
||||
>>> fname = get_test_fname('test.gff')
|
||||
>>> fname = get_test_fname('gff_version_3.gff')
|
||||
>>> headers = get_headers(fname,sep='\\t')
|
||||
>>> is_gff(headers)
|
||||
>>> is_gff3(headers)
|
||||
True
|
||||
"""
|
||||
try:
|
||||
|
||||
@@ -111,23 +111,29 @@ class Universe(common.Root):
|
||||
except:
|
||||
return "This item contains no content"
|
||||
else:
|
||||
return "No data with id=%s" % id
|
||||
|
||||
return "No data with id=%d" % id
|
||||
|
||||
@web.expose
|
||||
def display_bed( self, trans, id=None ):
|
||||
"""Returns a bed file"""
|
||||
def display_as( self, trans, id=None, display_app="ucsc" ):
|
||||
"""Returns a file in a format that can successfully be displayed in display_app"""
|
||||
data = self.app.model.Dataset.get( id )
|
||||
if data:
|
||||
if isinstance(data.datatype, datatypes.interval.Interval) or isinstance(data.datatype, datatypes.interval.CustomTrack):
|
||||
if display_app == 'ucsc':
|
||||
mime = trans.app.datatypes_registry.get_mimetype_by_extension( data.extension.lower() )
|
||||
trans.response.set_content_type(mime)
|
||||
file_name = data.as_bedfile()
|
||||
trans.log_event( "Display dataset id %s as BED" % str(id) )
|
||||
file_name = data.as_ucsc_display_file()
|
||||
trans.log_event( "Formatted dataset id %s for display at UCSC" % str(id) )
|
||||
return open(file_name)
|
||||
elif display_app == 'gbrowse':
|
||||
mime = trans.app.datatypes_registry.get_mimetype_by_extension( data.extension.lower() )
|
||||
trans.response.set_content_type(mime)
|
||||
file_name = data.as_gbrowse_display_file()
|
||||
trans.log_event( "Formatted dataset id %s for display at GBrowse" % str(id) )
|
||||
return open(file_name)
|
||||
else:
|
||||
return 'This file cannot be displayed as bed'
|
||||
return "Dataset '%s' cannot be displayed at %s." %(data.name, display_app)
|
||||
else:
|
||||
return "No data with id=%s" % id
|
||||
return "No data with id=%d" % id
|
||||
|
||||
@web.expose
|
||||
def peek(self, trans, id=None):
|
||||
@@ -138,7 +144,7 @@ class Universe(common.Root):
|
||||
yield data.peek
|
||||
yield "</pre></body></html>"
|
||||
else:
|
||||
yield "No data with is=%s" % id
|
||||
yield "No data with id=%d" % id
|
||||
|
||||
@web.expose
|
||||
def edit(self, trans, id=None, hid=None, **kwd):
|
||||
@@ -283,7 +289,7 @@ class Universe(common.Root):
|
||||
tool = toolbox.tools_by_id.get(id, '')
|
||||
yield "<html><body>"
|
||||
if not tool:
|
||||
yield "Unkown tool id '%s'" % id
|
||||
yield "Unknown tool id '%d'" % id
|
||||
elif tool.help:
|
||||
yield tool.help
|
||||
else:
|
||||
@@ -335,10 +341,6 @@ class Universe(common.Root):
|
||||
new_history = self.copy_history(history, trans)
|
||||
new_history.name = history.name+" from "+user.email
|
||||
new_history.user_id = send_to_user.id
|
||||
"""
|
||||
gvk TODO: how should we handle galaxy_session_to_history association here?
|
||||
I'll do the following for now, but not sure if this is what we want...
|
||||
"""
|
||||
new_history.add_galaxy_session(trans.get_galaxy_session( create=True ))
|
||||
trans.log_event( "History share, id: %s, name: '%s': to new id: %s" % (str(history.id), history.name, str(new_history.id)) )
|
||||
self.app.model.flush()
|
||||
|
||||
@@ -238,10 +238,12 @@ class Dataset( object ):
|
||||
return self.datatype.set_meta( self, first_line_is_header )
|
||||
def missing_meta( self ):
|
||||
return self.datatype.missing_meta( self )
|
||||
def bed_viewport( self ):
|
||||
return self.datatype.bed_viewport( self )
|
||||
def as_bedfile( self ):
|
||||
return self.datatype.as_bedfile( self )
|
||||
def get_estimated_display_viewport( self ):
|
||||
return self.datatype.get_estimated_display_viewport( self )
|
||||
def as_ucsc_display_file( self ):
|
||||
return self.datatype.as_ucsc_display_file( self )
|
||||
def as_gbrowse_display_file( self ):
|
||||
return self.datatype.as_gbrowse_display_file( self )
|
||||
def display_peek( self ):
|
||||
return self.datatype.display_peek( self )
|
||||
def display_name( self ):
|
||||
@@ -250,6 +252,8 @@ class Dataset( object ):
|
||||
return self.datatype.display_info( self )
|
||||
def get_ucsc_sites( self ):
|
||||
return self.datatype.get_ucsc_sites( self )
|
||||
def get_gbrowse_sites( self ):
|
||||
return self.datatype.get_gbrowse_sites( self )
|
||||
def get_child_by_designation(self, designation):
|
||||
# if self.history:
|
||||
# for data in self.history.datasets:
|
||||
|
||||
@@ -74,7 +74,8 @@ text_types = sets.Set([
|
||||
'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',
|
||||
'phylipnon', 'nexusnon', 'nametable', 'xml', 'interval', 'tabular', 'maf','axt', 'lav', 'laj', 'customtrack'
|
||||
'phylipnon', 'nexusnon', 'nametable', 'xml', 'interval', 'tabular', 'maf','axt', 'lav', 'laj', 'customtrack',
|
||||
'gbrowsetrack'
|
||||
])
|
||||
|
||||
def parse_xml(fname):
|
||||
@@ -249,6 +250,13 @@ def get_ucsc_by_build(build):
|
||||
sites.append((site['name'],site['url']))
|
||||
return sites
|
||||
|
||||
def get_gbrowse_sites_by_build(build):
|
||||
sites = []
|
||||
for site in gbrowse_build_sites:
|
||||
if build in site['builds']:
|
||||
sites.append((site['name'],site['url']))
|
||||
return sites
|
||||
|
||||
def read_dbnames(filename):
|
||||
""" Read build names from file """
|
||||
db_names = []
|
||||
@@ -296,7 +304,7 @@ def read_dbnames(filename):
|
||||
db_names = [('?', 'unspecified (?)')]
|
||||
return db_names
|
||||
|
||||
def read_ucsc_build_sites(filename):
|
||||
def read_build_sites(filename):
|
||||
""" read db names to ucsc mappings from file, this file should probably be merged with the one above """
|
||||
build_sites = []
|
||||
try:
|
||||
@@ -311,12 +319,12 @@ def read_ucsc_build_sites(filename):
|
||||
build_sites.append( site_dict )
|
||||
except: continue
|
||||
except:
|
||||
print "ERROR: Unable to read builds to ucsc site file"
|
||||
print "ERROR: Unable to read builds for site file %s" %filename
|
||||
return build_sites
|
||||
|
||||
dbnames = read_dbnames("static/ucsc/builds.txt") #this list is used in edit attributes and the upload tool
|
||||
ucsc_build_sites = read_ucsc_build_sites("static/ucsc/ucsc_build_sites.txt") #this list is used in history.tmpl
|
||||
|
||||
ucsc_build_sites = read_build_sites("static/ucsc/ucsc_build_sites.txt") #this list is used in history.tmpl
|
||||
gbrowse_build_sites = read_build_sites("static/gbrowse/gbrowse_build_sites.txt") #this list is used in history.tmpl
|
||||
|
||||
if __name__ == '__main__':
|
||||
import doctest, sys
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#Harvested from http://www.wormbase.org/db/seq/gbrowse/wormbase/
|
||||
# TODO: Uncomment the 1st lines and eliminate the 2nd test lines when the prototype is completed.
|
||||
#wormbase http://gvk.bx.psu.edu/cgi-bin/gbrowse/volvox? briggsae,briggsae_cb25,brugia,elegans,elegans_gmap,elegans_pmap,fly,fly31,nGASP,nGASP_submissions,remanei,wormbase,ws77,yeast_chr1
|
||||
wormbase http://gvk.bx.psu.edu/cgi-bin/gbrowse/volvox? ctgA,tmpfiller1,tmpfiller2
|
||||
#Harvested from http://flybase.bio.indiana.edu/cgi-bin/gbrowse/dmel/
|
||||
#flybase http://flybase.bio.indiana.edu/cgi-bin/gbrowse/dmel/ dana,dere,dgri,dmel,dmoj,dper,dpse,dsec,dsim,dvir,dwil,dyak,dmelstocks
|
||||
flybase http://flybase.bio.indiana.edu/cgi-bin/gbrowse/dmel/ tmpfiller1,tmpfiller2
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
User-agent: *
|
||||
Disallow: /display?
|
||||
Disallow: /display_bed?
|
||||
Disallow: /display_as?
|
||||
+68
-16
@@ -220,15 +220,40 @@ main();">
|
||||
#if $data.ext in [ "bed", "interval", "tabular", "txt", "text", "axt", "maf", "fasta", "gff", "gmaj.zip" ]:
|
||||
<a href="display?id=$data.id&tofile=yes&toext=$data.ext" target="_blank">save</a>
|
||||
#end if
|
||||
#if $data.ext in ["bed", "interval", "customtrack" ]:
|
||||
#set $value = $data.bed_viewport()
|
||||
#if $value
|
||||
| display at UCSC
|
||||
#for $site_name,$site_url in $data.get_ucsc_sites:
|
||||
#if $site_name in $app.config.ucsc_display_sites:
|
||||
<a target="_blank" href="$[site_url]db=$data.dbkey&position=$value&hgt.customText=$request.base/display_bed?id=$data.id">$site_name</a>
|
||||
#end if
|
||||
#end for
|
||||
#if "ucsc" in $data.datatype.supported_display_apps:
|
||||
#set $viewport_tuple = $data.get_estimated_display_viewport()
|
||||
#if $viewport_tuple
|
||||
#set $chrom = $viewport_tuple[0]
|
||||
#set $start = $viewport_tuple[1]
|
||||
#set $stop = $viewport_tuple[2]
|
||||
#set $displayed = "false"
|
||||
#for $site_name,$site_url in $data.get_ucsc_sites:
|
||||
#if $site_name in $app.config.ucsc_display_sites:
|
||||
#if $displayed == "false":
|
||||
| display at UCSC
|
||||
#set $displayed = "true"
|
||||
#end if
|
||||
<a target="_blank" href="$[site_url]db=$data.dbkey&position=$chrom:$start-$stop&hgt.customText=$request.base/display_as?id=$data.id&display_app=ucsc">$site_name</a>
|
||||
#end if
|
||||
#end for
|
||||
#end if
|
||||
#end if
|
||||
#if "gbrowse" in $data.datatype.supported_display_apps:
|
||||
#set $viewport_tuple = $data.get_estimated_display_viewport()
|
||||
#if $viewport_tuple
|
||||
#set $chrom = $viewport_tuple[0]
|
||||
#set $start = $viewport_tuple[1]
|
||||
#set $stop = $viewport_tuple[2]
|
||||
#set $displayed = "false"
|
||||
#for $site_name, $site_url in $data.get_gbrowse_sites:
|
||||
#if $site_name in $app.config.gbrowse_display_sites:
|
||||
#if $displayed == "false":
|
||||
| display in GBrowse
|
||||
#set $displayed = "true"
|
||||
#end if
|
||||
<a target="_blank" href="$[site_url]&name=$data.dbkey&ref=$chrom:$start..$stop&eurl=$request.base/display_as?id=$data.id&display_app=gbrowse">$site_name</a>
|
||||
#end if
|
||||
#end for
|
||||
#end if
|
||||
#end if
|
||||
</div>
|
||||
@@ -303,13 +328,40 @@ main();">
|
||||
#if $child.ext in [ "bed", "interval", "tabular", "txt", "text", "axt", "maf", "fasta", "gff", "gmaj.zip" ]:
|
||||
<a href="display?id=$child.id&tofile=yes&toext=$child.ext" target="_blank">save</a>
|
||||
#end if
|
||||
#if $child.ext in ["bed", "interval" ]:
|
||||
#set $value = $child.bed_viewport()
|
||||
#if $value
|
||||
| display at UCSC
|
||||
#for $site_name,$site_url in $child.get_ucsc_sites:
|
||||
<a target="_blank" href="$[site_url]db=$child.dbkey&position=$value&hgt.customText=$request.base/display_bed?id=$child.id">$site_name</a>
|
||||
#end for
|
||||
#if "ucsc" in $child.datatype.supported_display_apps:
|
||||
#set $viewport_tuple = $child.get_estimated_display_viewport()
|
||||
#if $viewport_tuple
|
||||
#set $chrom = $viewport_tuple[0]
|
||||
#set $start = $viewport_tuple[1]
|
||||
#set $stop = $viewport_tuple[2]
|
||||
#set $displayed = "false"
|
||||
#for $site_name,$site_url in $child.get_ucsc_sites:
|
||||
#if $site_name in $app.config.ucsc_display_sites:
|
||||
#if $displayed == "false":
|
||||
| display at UCSC
|
||||
#set $displayed = "true"
|
||||
#end if
|
||||
<a target="_blank" href="$[site_url]db=$child.dbkey&position=$chrom:$start-$stop&hgt.customText=$request.base/display_as?id=$child.id&display_app=ucsc">$site_name</a>
|
||||
#end if
|
||||
#end for
|
||||
#end if
|
||||
#end if
|
||||
#if "gbrowse" in $child.datatype.supported_display_apps:
|
||||
#set $viewport_tuple = $child.get_estimated_display_viewport()
|
||||
#if $viewport_tuple
|
||||
#set $chrom = $viewport_tuple[0]
|
||||
#set $start = $viewport_tuple[1]
|
||||
#set $stop = $viewport_tuple[2]
|
||||
#set $displayed = "false"
|
||||
#for $site_name,$site_url in $child.get_gbrowse_sites:
|
||||
#if $site_name in $app.config.ucsc_display_sites:
|
||||
#if $displayed == "false":
|
||||
| display in GBrowse
|
||||
#set $displayed = "true"
|
||||
#end if
|
||||
<a target="_blank" href="$[site_url]&name=$child.dbkey&ref=$chrom:$start..$stop&eurl=$request.base/display_as?id=$data.id&display_app=gbrowse">$site_name</a>
|
||||
#end if
|
||||
#end for
|
||||
#end if
|
||||
#end if
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<description>Central server</description>
|
||||
|
||||
<command/>
|
||||
<command>noop</command>
|
||||
|
||||
<inputs action="http://www.biomart.org/biomart/martview" check_values="false" method="get" target="_top">
|
||||
<display>go to BioMart Central $GALAXY_URL</display>
|
||||
|
||||
@@ -87,6 +87,7 @@ mailing_join_addr = galaxy-user-join@bx.psu.edu
|
||||
use_heartbeat = True
|
||||
# Comma separated list of UCSC browsers to use for viewing
|
||||
ucsc_display_sites = main,test,archaea
|
||||
gbrowse_display_sites = wormbase,flybase
|
||||
|
||||
# Static files
|
||||
|
||||
@@ -126,4 +127,5 @@ gmaj.zip = galaxy.datatypes.images:Gmaj,application/zip
|
||||
laj = galaxy.datatypes.images:Laj
|
||||
lav = galaxy.datatypes.sequence:Lav
|
||||
html = galaxy.datatypes.images:Html,text/html
|
||||
customtrack = galaxy.datatypes.interval:CustomTrack
|
||||
customtrack = galaxy.datatypes.interval:CustomTrack
|
||||
gbrowsetrack = galaxy.datatypes.interval:GBrowseTrack
|
||||
Reference in New Issue
Block a user