mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add the bx browser as a display app for builds hg18,hg19.mm8.mm9, and add the bx browser to the tool config for main.
This commit is contained in:
@@ -81,6 +81,7 @@ class Configuration( object ):
|
||||
self.log_memory_usage = string_as_bool( kwargs.get( 'log_memory_usage', 'False' ) )
|
||||
self.log_actions = string_as_bool( kwargs.get( 'log_actions', 'False' ) )
|
||||
self.log_events = string_as_bool( kwargs.get( 'log_events', 'False' ) )
|
||||
self.bx_display_sites = kwargs.get( 'bx_display_sites', "main" ).lower().split(",")
|
||||
self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites', "main,test,archaea,ucla" ).lower().split(",")
|
||||
self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "main,test,tair" ).lower().split(",")
|
||||
self.genetrack_display_sites = kwargs.get( 'genetrack_display_sites', "main,test" ).lower().split(",")
|
||||
|
||||
@@ -54,6 +54,7 @@ class Interval( Tabular ):
|
||||
"""Initialize interval datatype, by adding UCSC display apps"""
|
||||
Tabular.__init__(self, **kwd)
|
||||
self.add_display_app ( 'ucsc', 'display at UCSC', 'as_ucsc_display_file', 'ucsc_links' )
|
||||
self.add_display_app ( 'main', 'BX', 'as_bx_display_file', 'bx_links' )
|
||||
|
||||
def init_meta( self, dataset, copy_from=None ):
|
||||
Tabular.init_meta( self, dataset, copy_from=copy_from )
|
||||
@@ -246,6 +247,29 @@ class Interval( Tabular ):
|
||||
link = '%s?redirect_url=%s&display_url=%s' % ( internal_url, redirect_url, display_url )
|
||||
ret_val.append( (site_name, link) )
|
||||
return ret_val
|
||||
def bx_links( self, dataset, type, app, base_url ):
|
||||
# TODO: abstract these methods to eliminate duplicate code.
|
||||
ret_val = []
|
||||
if dataset.has_data:
|
||||
viewport_tuple = self.get_estimated_display_viewport(dataset)
|
||||
if viewport_tuple:
|
||||
chrom = viewport_tuple[0]
|
||||
start = viewport_tuple[1]
|
||||
stop = viewport_tuple[2]
|
||||
for site_name, site_url in util.get_bx_by_build(dataset.dbkey):
|
||||
if site_name in app.config.bx_display_sites:
|
||||
# HACK: UCSC doesn't support https, so force http even
|
||||
# if our URL scheme is https. Making this work
|
||||
# requires additional hackery in your upstream proxy.
|
||||
# If UCSC ever supports https, remove this hack.
|
||||
internal_url = "%s" % url_for( controller='dataset', dataset_id=dataset.id, action='display_at', filename='bx_' + site_name )
|
||||
if base_url.startswith( 'https://' ):
|
||||
base_url = base_url.replace( 'https', 'http', 1 )
|
||||
display_url = urllib.quote_plus( "%s%s/display_as?id=%i&display_app=%s&authz_method=display_at" % (base_url, url_for( controller='root' ), dataset.id, type) )
|
||||
redirect_url = urllib.quote_plus( "%sdb=%s&position=%s:%s-%s&hgt.customText=%%s" % (site_url, dataset.dbkey, chrom, start, stop ) )
|
||||
link = '%s?redirect_url=%s&display_url=%s' % ( internal_url, redirect_url, display_url )
|
||||
ret_val.append( (site_name, link) )
|
||||
return ret_val
|
||||
|
||||
def validate( self, dataset ):
|
||||
"""Validate an interval file using the bx GenomicIntervalReader"""
|
||||
|
||||
@@ -214,6 +214,8 @@ class Tabular( data.Text ):
|
||||
return open( dataset.file_name )
|
||||
def as_ucsc_display_file( self, dataset, **kwd ):
|
||||
return open( dataset.file_name )
|
||||
def as_bx_display_file( self, dataset, **kwd ):
|
||||
return open( dataset.file_name )
|
||||
|
||||
class Taxonomy( Tabular ):
|
||||
def __init__(self, **kwd):
|
||||
|
||||
@@ -278,7 +278,12 @@ def object_to_string( obj ):
|
||||
def string_to_object( s ):
|
||||
return pickle.loads( binascii.unhexlify( s ) )
|
||||
|
||||
|
||||
def get_bx_by_build(build):
|
||||
sites = []
|
||||
for site in bx_build_sites:
|
||||
if build in site['builds']:
|
||||
sites.append((site['name'],site['url']))
|
||||
return sites
|
||||
def get_ucsc_by_build(build):
|
||||
sites = []
|
||||
for site in ucsc_build_sites:
|
||||
@@ -471,6 +476,7 @@ def umask_fix_perms( path, umask, unmasked_perms, gid=None ):
|
||||
galaxy_root_path = os.path.join(__path__[0], "..","..","..")
|
||||
# The dbnames list is used in edit attributes and the upload tool
|
||||
dbnames = read_dbnames( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "builds.txt" ) )
|
||||
bx_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "bx", "bx_build_sites.txt" ) )
|
||||
ucsc_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "ucsc_build_sites.txt" ) )
|
||||
gbrowse_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "gbrowse", "gbrowse_build_sites.txt" ) )
|
||||
genetrack_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "genetrack", "genetrack_sites.txt" ), check_builds=False )
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
main http://main.genome-browser.bx.psu.edu/cgi-bin/hgTracks? hg18,hg19,mm8,mm9
|
||||
@@ -4,6 +4,7 @@
|
||||
<tool file="data_source/upload.xml"/>
|
||||
<tool file="data_source/ucsc_tablebrowser.xml" />
|
||||
<tool file="data_source/ucsc_tablebrowser_archaea.xml" />
|
||||
<tool file="data_source/bx_browser.xml" />
|
||||
<tool file="data_source/microbial_import.xml" />
|
||||
<tool file="data_source/biomart.xml" />
|
||||
<tool file="data_source/gramene_mart.xml" />
|
||||
|
||||
@@ -105,7 +105,8 @@ mailing_join_addr = galaxy-user-join@bx.psu.edu
|
||||
# Use the new iframe / javascript based layout
|
||||
use_new_layout = true
|
||||
|
||||
# Comma separated list of UCSC / gbrowse / GeneTrack browsers to use for viewing
|
||||
# Comma separated list of bx / UCSC / gbrowse / GeneTrack browsers to use for viewing
|
||||
bx_display_sites = main
|
||||
ucsc_display_sites = main,test,archaea,ucla
|
||||
gbrowse_display_sites = main,test,tair
|
||||
# Define your GeneTrack servers in tool-data/shared/genetrack/genetrack_sites.txt
|
||||
|
||||
Reference in New Issue
Block a user