galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
May 2012
- 1 participants
- 61 discussions
commit/galaxy-central: jgoecks: Add Bowtie2 preset options to Tophat2 wrapper.
by Bitbucket 31 May '12
by Bitbucket 31 May '12
31 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/9ae91fb49fdd/
changeset: 9ae91fb49fdd
user: jgoecks
date: 2012-05-31 17:08:24
summary: Add Bowtie2 preset options to Tophat2 wrapper.
affected #: 2 files
diff -r 2f971a75d8575082685e97325967fedc67b462a4 -r 9ae91fb49fdd5762dc9a0374dfc471733da47143 tools/ngs_rna/tophat2_wrapper.py
--- a/tools/ngs_rna/tophat2_wrapper.py
+++ b/tools/ngs_rna/tophat2_wrapper.py
@@ -64,6 +64,12 @@
parser.add_option( '', '--min-coverage-intron', dest='min_coverage_intron', help='Minimum intron length that may be found during coverage search' )
parser.add_option( '', '--max-coverage-intron', dest='max_coverage_intron', help='Maximum intron length that may be found during coverage search' )
+ # Bowtie2 options.
+ parser.add_option( '', '--b2-very-fast', action='store_true', dest='b2_very_fast')
+ parser.add_option( '', '--b2-fast', action='store_true', dest='b2_fast')
+ parser.add_option( '', '--b2-very-sensitive', action='store_true', dest='b2_very_sensitive')
+ parser.add_option( '', '--b2-sensitive', action='store_true', dest='b2_sensitive')
+
# Fusion search options.
parser.add_option( '', '--fusion-search', action='store_true', dest='fusion_search' )
parser.add_option( '', '--fusion-anchor-length', dest='fusion_anchor_length' )
@@ -198,6 +204,16 @@
( int( options.fusion_anchor_length ), int( options.fusion_min_dist ),
int( options.fusion_read_mismatches ), int( options.fusion_multireads ),
int( options.fusion_multipairs ), options.fusion_ignore_chromosomes )
+
+ # Bowtie2 options.
+ if options.b2_very_fast:
+ opts += ' --b2-very-fast'
+ if options.b2_fast:
+ opts += ' --b2-fast'
+ if options.b2_sensitive:
+ opts += ' --b2-sensitive'
+ if options.b2_very_sensitive:
+ opts += ' --b2-very-sensitive'
cmd = cmd % ( opts, index_path, reads )
diff -r 2f971a75d8575082685e97325967fedc67b462a4 -r 9ae91fb49fdd5762dc9a0374dfc471733da47143 tools/ngs_rna/tophat2_wrapper.xml
--- a/tools/ngs_rna/tophat2_wrapper.xml
+++ b/tools/ngs_rna/tophat2_wrapper.xml
@@ -105,6 +105,13 @@
--fusion-multipairs $params.fusion_search.multipairs
--fusion-ignore-chromosomes $params.fusion_search.ignore_chromosomes
#end if
+
+ #if $params.bowtie2_settings.b2_settings == "Yes":
+ #if $params.bowtie2_settings.preset.b2_preset == "Yes":
+ --b2-$params.bowtie2_settings.preset.b2_preset_select
+ #end if
+ #end if
+
#end if
</command><inputs>
@@ -257,6 +264,33 @@
<param name="ignore_chromosomes" type="text" value='' label="Ignore some chromosomes such as chrM when detecting fusion break points"/></when></conditional>
+
+ <!-- Bowtie2 settings. -->
+ <conditional name="bowtie2_settings">
+ <param name="b2_settings" type="select" label="Set Bowtie2 settings">
+ <option selected="true" value="No">No</option>
+ <option value="Yes">Yes</option>
+ </param>
+ <when value="No" />
+ <when value="Yes">
+ <conditional name="preset">
+ <param name="b2_preset" type="select" label="Use Preset options">
+ <option selected="true" value="Yes">Yes</option>
+ <option value="No">No</option>
+ </param>
+ <when value="Yes">
+ <param name="b2_preset_select" type="select" label="Preset option">
+ <option value="very-fast">Very fast</option>
+ <option selected="true" value="fast">Fast</option>
+ <option value="sensitive">Sensitive</option>
+ <option value="very-sensitive">Very sensitive</option>
+ </param>
+ </when>
+ <!-- TODO: -->
+ <when value="No" />
+ </conditional>
+ </when>
+ </conditional></when><!-- full --></conditional><!-- params --></inputs>
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.
1
0
commit/galaxy-central: jgoecks: Clearer explanation and help for default vs. full parameter settings.
by Bitbucket 30 May '12
by Bitbucket 30 May '12
30 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/b6ddc6196429/
changeset: b6ddc6196429
user: jgoecks
date: 2012-05-31 01:47:40
summary: Clearer explanation and help for default vs. full parameter settings.
affected #: 2 files
diff -r 377e1d1691fc285cbccc94b393ce7ed069956794 -r b6ddc6196429859c887f20c359e0afc463afa229 tools/ngs_rna/tophat_color_wrapper.xml
--- a/tools/ngs_rna/tophat_color_wrapper.xml
+++ b/tools/ngs_rna/tophat_color_wrapper.xml
@@ -179,7 +179,7 @@
<when value="single"><conditional name="sParams"><param name="sSettingsType" type="select" label="TopHat settings to use" help="You can use the default settings or set custom values for any of Tophat's parameters.">
- <option value="preSet">Use Defaults</option>
+ <option value="preSet">Default settings</option><option value="full">Full parameter list</option></param><when value="preSet" />
@@ -284,8 +284,8 @@
<param format="fastqcssanger" name="input2" type="data" label="RNA-Seq FASTQ file" help="Color-space: Must have Sanger-scaled quality values with ASCII offset 33" /><param name="mate_inner_distance" type="integer" value="20" label="Mean Inner Distance between Mate Pairs" /><conditional name="pParams">
- <param name="pSettingsType" type="select" label="TopHat settings to use" help="For most mapping needs use Commonly used settings. If you want full control use Full parameter list">
- <option value="preSet">Commonly used</option>
+ <param name="pSettingsType" type="select" label="TopHat settings to use" help="Use the Full parameter list to change default settings.">
+ <option value="preSet">Default settings</option><option value="full">Full parameter list</option></param><when value="preSet" />
diff -r 377e1d1691fc285cbccc94b393ce7ed069956794 -r b6ddc6196429859c887f20c359e0afc463afa229 tools/ngs_rna/tophat_wrapper.xml
--- a/tools/ngs_rna/tophat_wrapper.xml
+++ b/tools/ngs_rna/tophat_wrapper.xml
@@ -175,8 +175,8 @@
</param><when value="single"><conditional name="sParams">
- <param name="sSettingsType" type="select" label="TopHat settings to use" help="You can use the default settings or set custom values for any of Tophat's parameters.">
- <option value="preSet">Use Defaults</option>
+ <param name="sSettingsType" type="select" label="TopHat settings to use" help="Use the Full parameter list to change default settings.">
+ <option value="preSet">Default settings</option><option value="full">Full parameter list</option></param><when value="preSet" />
@@ -281,8 +281,8 @@
<param format="fastqsanger" name="input2" type="data" label="RNA-Seq FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" /><param name="mate_inner_distance" type="integer" value="20" label="Mean Inner Distance between Mate Pairs" /><conditional name="pParams">
- <param name="pSettingsType" type="select" label="TopHat settings to use" help="For most mapping needs use Commonly used settings. If you want full control use Full parameter list">
- <option value="preSet">Commonly used</option>
+ <param name="pSettingsType" type="select" label="TopHat settings to use" help="Use the Full parameter list to change default settings.">
+ <option value="preSet">Default settings</option><option value="full">Full parameter list</option></param><when value="preSet" />
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.
1
0
30 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/377e1d1691fc/
changeset: 377e1d1691fc
user: jgoecks
date: 2012-05-31 00:09:26
summary: Fix compatibility issue with 9765176c63f7
affected #: 1 file
diff -r 1270fd83fab77ddda4385a6a3eb2011518ebfd3a -r 377e1d1691fc285cbccc94b393ce7ed069956794 static/scripts/trackster.js
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -1368,7 +1368,11 @@
// Introduction div shown when there are no tracks.
this.intro_div = $("<div/>").addClass("intro").appendTo(this.viewport_container).hide();
var add_tracks_button = $("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function () {
- add_datasets();
+ add_datasets(add_datasets_url, add_track_async_url, function(tracks) {
+ _.each(tracks, function(track) {
+ view.add_drawable( object_from_template(track, view) );
+ });
+ });
});
// Another label track at bottom
this.nav_labeltrack = $("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);
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.
1
0
commit/galaxy-central: jgoecks: Use backbone to save trackster visualizations.
by Bitbucket 30 May '12
by Bitbucket 30 May '12
30 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/1270fd83fab7/
changeset: 1270fd83fab7
user: jgoecks
date: 2012-05-30 22:37:51
summary: Use backbone to save trackster visualizations.
affected #: 5 files
diff -r ec4584a0e500e755aa5436691318d442831d8787 -r 1270fd83fab77ddda4385a6a3eb2011518ebfd3a lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -2445,8 +2445,8 @@
self.user = None
class Visualization( object ):
- def __init__( self, user=None, type=None, title=None, dbkey=None, slug=None, latest_revision=None ):
- self.id = None
+ def __init__( self, id=None, user=None, type=None, title=None, dbkey=None, slug=None, latest_revision=None ):
+ self.id = id
self.user = user
self.type = type
self.title = title
diff -r ec4584a0e500e755aa5436691318d442831d8787 -r 1270fd83fab77ddda4385a6a3eb2011518ebfd3a lib/galaxy/web/controllers/tracks.py
--- a/lib/galaxy/web/controllers/tracks.py
+++ b/lib/galaxy/web/controllers/tracks.py
@@ -234,15 +234,26 @@
rows.append( [location, name] )
return { 'data': rows }
- # TODO: this is duplicated from visualization controller; remove it once
- # routing incompatibilities have been resolved.
@web.json
- def save( self, trans, config, type, id=None, title=None, dbkey=None, annotation=None ):
+ def save( self, trans, vis_json ):
"""
Save a visualization; if visualization does not have an ID, a new
visualization is created. Returns JSON of visualization.
"""
- return self.save_visualization( trans, from_json_string( config ), type, id, title, dbkey, annotation )
+
+ # TODO: Need from_dict to convert json to Visualization object.
+ vis_config = from_json_string( vis_json )
+ config = {
+ 'view': vis_config[ 'datasets' ],
+ 'bookmarks': vis_config[ 'bookmarks' ],
+ 'viewport': vis_config[ 'viewport' ]
+ }
+ type = vis_config[ 'type' ]
+ id = vis_config[ 'id' ]
+ title = vis_config[ 'title' ]
+ dbkey = vis_config[ 'dbkey' ]
+ annotation = vis_config.get( 'annotation', None )
+ return self.save_visualization( trans, config, type, id, title, dbkey, annotation )
@web.expose
@web.require_login()
diff -r ec4584a0e500e755aa5436691318d442831d8787 -r 1270fd83fab77ddda4385a6a3eb2011518ebfd3a static/scripts/mvc/visualization.js
--- a/static/scripts/mvc/visualization.js
+++ b/static/scripts/mvc/visualization.js
@@ -54,6 +54,24 @@
type: "",
dbkey: "",
datasets: []
+ },
+
+ url: function() { return galaxy_paths.get("visualization_url"); },
+
+ /**
+ * POSTs visualization's JSON to its URL using the parameter 'vis_json'
+ * Note: This is necessary because (a) Galaxy requires keyword args and
+ * (b) Galaxy does not handle PUT now.
+ */
+ save: function() {
+ return $.ajax({
+ url: this.url(),
+ type: "POST",
+ dataType: "json",
+ data: {
+ vis_json: JSON.stringify(this)
+ }
+ });
}
});
diff -r ec4584a0e500e755aa5436691318d442831d8787 -r 1270fd83fab77ddda4385a6a3eb2011518ebfd3a static/scripts/trackster.js
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -1368,7 +1368,7 @@
// Introduction div shown when there are no tracks.
this.intro_div = $("<div/>").addClass("intro").appendTo(this.viewport_container).hide();
var add_tracks_button = $("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function () {
- add_tracks();
+ add_datasets();
});
// Another label track at bottom
this.nav_labeltrack = $("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);
diff -r ec4584a0e500e755aa5436691318d442831d8787 -r 1270fd83fab77ddda4385a6a3eb2011518ebfd3a templates/tracks/browser.mako
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -47,7 +47,10 @@
<script type="text/javascript">
//
// Place URLs here so that url_for can be used to generate them.
- //
+ //
+ galaxy_paths.set({
+ visualization_url: "${h.url_for( action='save' )}"
+ });
var
add_track_async_url = "${h.url_for( action='add_track_async' )}",
add_datasets_url = "${h.url_for( action='list_current_history_datasets' )}",
@@ -148,36 +151,29 @@
// FIXME: give unique IDs to Drawables and save overview as ID.
var overview_track_name = (view.overview_drawable ? view.overview_drawable.name : null);
- var payload = {
- 'view': view.to_dict(),
+ var visualization = new TracksterVisualization({
+ 'id': view.vis_id,
+ 'title': view.name,
+ 'dbkey': view.dbkey,
+ 'type': 'trackster',
+ 'datasets': view.to_dict(),
'viewport': { 'chrom': view.chrom, 'start': view.low , 'end': view.high, 'overview': overview_track_name },
'bookmarks': bookmarks
- };
-
- $.ajax({
- url: "${h.url_for( action='save' )}",
- type: "POST",
- data: {
- 'id': view.vis_id,
- 'title': view.name,
- 'dbkey': view.dbkey,
- 'type': 'trackster',
- 'config': JSON.stringify(payload)
- },
- dataType: "json",
- success: function(vis_info) {
+ });
+
+ visualization.save()
+ .success(function(vis_info) {
hide_modal();
view.vis_id = vis_info.vis_id;
view.has_changes = false;
-
+
// Needed to set URL when first saving a visualization.
window.history.pushState({}, "", vis_info.url + window.location.hash);
- },
- error: function() {
+ })
+ .error(function() {
show_modal( "Could Not Save", "Could not save visualization. Please try again later.",
{ "Close" : hide_modal } );
- }
- });
+ });
} },
{ icon_class: 'cross-circle', title: 'Close', on_click: function() {
window.location = "${h.url_for( controller='visualization', action='list' )}";
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.
1
0
30 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/ec4584a0e500/
changeset: ec4584a0e500
user: greg
date: 2012-05-30 22:00:18
summary: Fixes for handling tool shed repositories that include tool_data_table_conf.xml.sample files. The fixes apply to determining if the tool is valid in the tool shed and also to the Galaxy environment when the tool shed repository is installed.
affected #: 6 files
diff -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f -r ec4584a0e500e755aa5436691318d442831d8787 lib/galaxy/tool_shed/install_manager.py
--- a/lib/galaxy/tool_shed/install_manager.py
+++ b/lib/galaxy/tool_shed/install_manager.py
@@ -152,7 +152,12 @@
if repository_tools_tups:
sample_files = metadata_dict.get( 'sample_files', [] )
# Handle missing data table entries for tool parameters that are dynamically generated select lists.
- repository_tools_tups = handle_missing_data_table_entry( self.app, self.tool_path, sample_files, repository_tools_tups )
+ repository_tools_tups = handle_missing_data_table_entry( self.app,
+ tool_shed_repository,
+ changeset_revision,
+ self.tool_path,
+ repository_tools_tups,
+ work_dir )
# Handle missing index files for tool parameters that are dynamically generated select lists.
repository_tools_tups, sample_files_copied = handle_missing_index_file( self.app, self.tool_path, sample_files, repository_tools_tups )
# Copy remaining sample files included in the repository to the ~/tool-data directory of the local Galaxy instance.
diff -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f -r ec4584a0e500e755aa5436691318d442831d8787 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -6,7 +6,7 @@
to modify the tool configurations.
"""
-import logging, sys, os.path
+import logging, sys, os, os.path, tempfile, shutil
from galaxy import util
log = logging.getLogger( __name__ )
@@ -15,6 +15,9 @@
"""Manages a collection of tool data tables"""
def __init__( self, config_filename=None ):
self.data_tables = {}
+ # Store config elements for on-the-fly persistence.
+ self.data_table_elems = []
+ self.data_table_elem_names = []
if config_filename:
self.load_from_config_file( config_filename )
def __getitem__( self, key ):
@@ -29,14 +32,19 @@
type = table_elem.get( 'type', 'tabular' )
assert type in tool_data_table_types, "Unknown data table type '%s'" % type
table_elems.append( table_elem )
+ table_elem_name = table_elem.get( 'name', None )
+ if table_elem_name and table_elem_name not in self.data_table_elem_names:
+ self.data_table_elem_names.append( table_elem_name )
+ self.data_table_elems.append( table_elem )
table = tool_data_table_types[ type ]( table_elem )
if table.name not in self.data_tables:
self.data_tables[ table.name ] = table
log.debug( "Loaded tool data table '%s'", table.name )
return table_elems
- def add_new_entries_from_config_file( self, config_filename ):
+ def add_new_entries_from_config_file( self, config_filename, tool_data_table_config_path ):
"""
- We have 2 cases to handle, files whose root tag is <tables>, for example:
+ This method is called when a tool shed repository that includes a tool_data_table_conf.xml.sample file is being
+ installed into a local galaxy instance. We have 2 cases to handle, files whose root tag is <tables>, for example:
<tables><!-- Location of Tmap files --><table name="tmap_indexes" comment_char="#">
@@ -53,6 +61,8 @@
"""
tree = util.parse_xml( config_filename )
root = tree.getroot()
+ # Make a copy of the current list of data_table_elem_names so we can persist later if changes to the config file are necessary.
+ original_data_table_elem_names = [ name for name in self.data_table_elem_names ]
if root.tag == 'tables':
table_elems = self.load_from_config_file( config_filename )
else:
@@ -60,11 +70,31 @@
type = root.get( 'type', 'tabular' )
assert type in tool_data_table_types, "Unknown data table type '%s'" % type
table_elems.append( root )
+ table_elem_name = root.get( 'name', None )
+ if table_elem_name and table_elem_name not in self.data_table_elem_names:
+ self.data_table_elem_names.append( table_elem_name )
+ self.data_table_elems.append( root )
table = tool_data_table_types[ type ]( root )
if table.name not in self.data_tables:
self.data_tables[ table.name ] = table
- log.debug( "Loaded tool data table '%s", table.name )
+ log.debug( "Added new tool data table '%s'", table.name )
+ if self.data_table_elem_names != original_data_table_elem_names:
+ # Persist Galaxy's version of the changed tool_data_table_conf.xml file.
+ self.to_xml_file( tool_data_table_config_path )
return table_elems
+ def to_xml_file( self, tool_data_table_config_path ):
+ """Write the current in-memory version of the tool_data-table_conf.xml file to disk."""
+ full_path = os.path.abspath( tool_data_table_config_path )
+ fd, filename = tempfile.mkstemp()
+ os.write( fd, '<?xml version="1.0"?>\n' )
+ os.write( fd, "<!-- Use the file tool_data_table_conf.xml.oldlocstyle if you don't want to update your loc files as changed in revision 4550:535d276c92bc-->\n" )
+ os.write( fd, '<tables>\n' )
+ for elem in self.data_table_elems:
+ os.write( fd, '%s' % util.xml_to_string( elem ) )
+ os.write( fd, '</tables>\n' )
+ os.close( fd )
+ shutil.move( filename, full_path )
+ os.chmod( full_path, 0644 )
class ToolDataTable( object ):
def __init__( self, config_element ):
diff -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f -r ec4584a0e500e755aa5436691318d442831d8787 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1003,10 +1003,10 @@
return shed_url
# The tool shed from which the repository was originally installed must no longer be configured in tool_sheds_conf.xml.
return None
-def handle_missing_data_table_entry( app, tool_path, sample_files, repository_tools_tups ):
+def handle_missing_data_table_entry( app, repository, changeset_revision, tool_path, repository_tools_tups, dir ):
"""
Inspect each tool to see if any have input parameters that are dynamically generated select lists that require entries in the
- tool_data_table_conf.xml file. This method is not called only from Galaxy (not the tool shed) when a repository is being installed.
+ tool_data_table_conf.xml file. This method is called only from Galaxy (not the tool shed) when a repository is being installed.
"""
missing_data_table_entry = False
for index, repository_tools_tup in enumerate( repository_tools_tups ):
@@ -1015,13 +1015,11 @@
missing_data_table_entry = True
break
if missing_data_table_entry:
- sample_file = None
# The repository must contain a tool_data_table_conf.xml.sample file that includes all required entries for all tools in the repository.
- for sample_file in sample_files:
- sample_file_name = strip_path( sample_file )
- if sample_file_name == 'tool_data_table_conf.xml.sample':
- break
- error, correction_msg = handle_sample_tool_data_table_conf_file( app, sample_file )
+ sample_tool_data_table_conf = get_config_from_repository( app, 'tool_data_table_conf.xml.sample', repository, changeset_revision, dir )
+ # Add entries to the ToolDataTableManager's in-memory data_tables dictionary as well as the list of data_table_elems and the list of
+ # data_table_elem_names.
+ error, correction_msg = handle_sample_tool_data_table_conf_file( app, sample_tool_data_table_conf )
if error:
# TODO: Do more here than logging an exception.
log.debug( correction_msg )
@@ -1059,47 +1057,16 @@
return repository_tools_tups, sample_files_copied
def handle_sample_tool_data_table_conf_file( app, filename ):
"""
- Parse the incoming filename and add new entries to the in-memory app.tool_data_tables dictionary as well as appending them to the
- shed's tool_data_table_conf.xml file on disk.
+ Parse the incoming filename and add new entries to the in-memory app.tool_data_tables dictionary as well as appending them to
+ Galaxy's tool_data_table_conf.xml file on disk.
"""
- # TODO: Load an in-memory version of the tool_data_table_conf.xml file, and write it to disk
- # from the in-memory version only when changes are made.
error = False
message = ''
try:
- new_table_elems = app.tool_data_tables.add_new_entries_from_config_file( filename )
+ new_table_elems = app.tool_data_tables.add_new_entries_from_config_file( filename, app.config.tool_data_table_config_path )
except Exception, e:
message = str( e )
error = True
- """
- # TODO: eliminate this - the shed should not need to write this to disk...
- if not error:
- # Add an entry to the end of the tool_data_table_conf.xml file.
- tdt_config = "%s/tool_data_table_conf.xml" % app.config.root
- if os.path.exists( tdt_config ):
- # Make a backup of the file since we're going to be changing it.
- today = date.today()
- backup_date = today.strftime( "%Y_%m_%d" )
- tdt_config_copy = '%s/tool_data_table_conf.xml_%s_backup' % ( app.config.root, backup_date )
- shutil.copy( os.path.abspath( tdt_config ), os.path.abspath( tdt_config_copy ) )
- # Write each line of the tool_data_table_conf.xml file, except the last line to a temp file.
- fh = tempfile.NamedTemporaryFile( 'wb' )
- tmp_filename = fh.name
- fh.close()
- new_tdt_config = open( tmp_filename, 'wb' )
- for i, line in enumerate( open( tdt_config, 'rb' ) ):
- if line.find( '</tables>' ) >= 0:
- for new_table_elem in new_table_elems:
- new_tdt_config.write( ' %s\n' % util.xml_to_string( new_table_elem ).rstrip( '\n' ) )
- new_tdt_config.write( '</tables>\n' )
- else:
- new_tdt_config.write( line )
- new_tdt_config.close()
- shutil.move( tmp_filename, os.path.abspath( tdt_config ) )
- else:
- message = "The required file named tool_data_table_conf.xml does not exist in the Galaxy install directory."
- error = True
- """
return error, message
def handle_tool_dependencies( app, tool_shed_repository, installed_changeset_revision, tool_dependencies_config ):
"""
@@ -1208,11 +1175,20 @@
tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata_dict[ 'tools' ], tool_section )
repository_tools_tups = get_repository_tools_tups( trans.app, metadata_dict )
if repository_tools_tups:
+ # Handle missing data table entries for tool parameters that are dynamically generated select lists.
work_dir = make_tmp_directory()
+ repository_tools_tups = handle_missing_data_table_entry( trans.app,
+ tool_shed_repository,
+ changeset_revision,
+ tool_path,
+ repository_tools_tups,
+ work_dir )
+ try:
+ shutil.rmtree( work_dir )
+ except:
+ pass
+ # Handle missing index files for tool parameters that are dynamically generated select lists.
sample_files = metadata_dict.get( 'sample_files', [] )
- # Handle missing data table entries for tool parameters that are dynamically generated select lists.
- repository_tools_tups = handle_missing_data_table_entry( trans.app, tool_path, sample_files, repository_tools_tups )
- # Handle missing index files for tool parameters that are dynamically generated select lists.
repository_tools_tups, sample_files_copied = handle_missing_index_file( trans.app, tool_path, sample_files, repository_tools_tups )
# Copy remaining sample files included in the repository to the ~/tool-data directory of the local Galaxy instance.
copy_sample_files( trans.app, sample_files, sample_files_copied=sample_files_copied )
@@ -1406,7 +1382,7 @@
trans.app.toolbox.write_integrated_tool_panel_config_file()
def reset_tool_data_tables( app ):
# Reset the tool_data_tables to an empty dictionary.
- app.tool_data_tables = galaxy.tools.data.ToolDataTableManager()
+ app.tool_data_tables.data_tables = {}
def strip_path( fpath ):
file_path, file_name = os.path.split( fpath )
return file_name
diff -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f -r ec4584a0e500e755aa5436691318d442831d8787 lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -613,6 +613,7 @@
else:
ctx_rev = repository.ctx_rev
clone_repository( repository_clone_url, os.path.abspath( relative_install_dir ), ctx_rev )
+ tool_section = None
if repository.includes_tools:
# Get the location in the tool panel in which each tool was originally loaded.
metadata = repository.metadata
@@ -668,19 +669,19 @@
tool_section = trans.app.toolbox.tool_panel[ section_key ]
else:
tool_section = None
- tool_shed_repository, metadata_dict, error_message = load_repository_contents( trans,
- repository_name=repository.name,
- description=repository.description,
- owner=repository.owner,
- changeset_revision=repository.installed_changeset_revision,
- ctx_rev=ctx_rev,
- tool_path=tool_path,
- repository_clone_url=repository_clone_url,
- relative_install_dir=relative_install_dir,
- tool_shed=repository.tool_shed,
- tool_section=tool_section,
- shed_tool_conf=shed_tool_conf,
- install_tool_dependencies=install_tool_dependencies )
+ tool_shed_repository, metadata_dict, error_message = load_repository_contents( trans,
+ repository_name=repository.name,
+ description=repository.description,
+ owner=repository.owner,
+ changeset_revision=repository.installed_changeset_revision,
+ ctx_rev=ctx_rev,
+ tool_path=tool_path,
+ repository_clone_url=repository_clone_url,
+ relative_install_dir=relative_install_dir,
+ tool_shed=repository.tool_shed,
+ tool_section=tool_section,
+ shed_tool_conf=shed_tool_conf,
+ install_tool_dependencies=install_tool_dependencies )
if error_message:
message += error_message
status = 'error'
diff -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f -r ec4584a0e500e755aa5436691318d442831d8787 lib/galaxy/webapps/community/app.py
--- a/lib/galaxy/webapps/community/app.py
+++ b/lib/galaxy/webapps/community/app.py
@@ -36,8 +36,8 @@
self.security = security.SecurityHelper( id_secret=self.config.id_secret )
# Tag handler
self.tag_handler = CommunityTagHandler()
- # Tool data tables
- self.tool_data_tables = galaxy.tools.data.ToolDataTableManager( self.config.tool_data_table_config_path )
+ # Tool data tables - never pass a config file here because the tool shed should always have an empty dictionary!
+ self.tool_data_tables = galaxy.tools.data.ToolDataTableManager()
# The tool shed has no toolbox, but this attribute is still required.
self.toolbox = None
# Load security policy
diff -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f -r ec4584a0e500e755aa5436691318d442831d8787 lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -201,23 +201,18 @@
if options:
if options.tool_data_table or options.missing_tool_data_table_name:
# Make sure the repository contains a tool_data_table_conf.xml.sample file.
- sample_found = False
- for sample_file in sample_files:
- sample_file_name = strip_path( sample_file )
- if sample_file_name == 'tool_data_table_conf.xml.sample':
- sample_found = True
- error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, sample_file )
- if error:
- can_set_metadata = False
- invalid_files.append( ( sample_file_name, correction_msg ) )
- else:
- options.missing_tool_data_table_name = None
- break
- if not sample_found:
+ sample_tool_data_table_conf = get_config( 'tool_data_table_conf.xml.sample', repo, repo_dir, ctx, dir )
+ if sample_tool_data_table_conf:
+ error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, sample_tool_data_table_conf )
+ if error:
+ can_set_metadata = False
+ invalid_files.append( ( 'tool_data_table_conf.xml.sample', correction_msg ) )
+ else:
+ options.missing_tool_data_table_name = None
+ else:
can_set_metadata = False
- correction_msg = "This file requires an entry in the tool_data_table_conf.xml file. "
- correction_msg += "Upload a file named tool_data_table_conf.xml.sample to the repository "
- correction_msg += "that includes the required entry to correct this error.<br/>"
+ correction_msg = "This file requires an entry in the tool_data_table_conf.xml file. Upload a file named tool_data_table_conf.xml.sample "
+ correction_msg += "to the repository that includes the required entry to correct this error.<br/>"
invalid_files.append( ( xml_file_in_ctx, correction_msg ) )
if options.index_file or options.missing_index_file:
# Make sure the repository contains the required xxx.loc.sample file.
@@ -245,8 +240,8 @@
correction_msg = "This file refers to a file named <b>%s</b>. " % str( index_file )
correction_msg += "Upload a file named <b>%s.sample</b> to the repository to correct this error." % str( index_file_name )
invalid_files.append( ( xml_file_in_ctx, correction_msg ) )
- # Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file.
- reset_tool_data_tables( trans.app )
+ # Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file.
+ reset_tool_data_tables( trans.app )
return sample_files_copied, can_set_metadata, invalid_files
def clean_repository_metadata( trans, id, changeset_revisions ):
# Delete all repository_metadata reecords associated with the repository that have a changeset_revision that is not in changeset_revisions.
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.
1
0
commit/galaxy-central: greg: Load datatype converters and display appliations included in installed tool shed repositories after the app's toolbox has been inititlaized.
by Bitbucket 30 May '12
by Bitbucket 30 May '12
30 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/16a93eb6eaf6/
changeset: 16a93eb6eaf6
user: greg
date: 2012-05-30 15:46:25
summary: Load datatype converters and display appliations included in installed tool shed repositories after the app's toolbox has been inititlaized.
affected #: 4 files
diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -62,7 +62,6 @@
# However, if there is a conflict (2 datatypes with the same extension) between a proprietary datatype and a datatype
# in the Galaxy distribution, the datatype in the Galaxy distribution will take precedence. If there is a conflict
# between 2 proprietary datatypes, the datatype from the repository that was installed earliest will take precedence.
- # This will also load proprietary datatype converters and display applications.
self.installed_repository_manager.load_proprietary_datatypes()
# Load the data types in the Galaxy distribution, which are defined in self.config.datatypes_config.
self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
@@ -84,6 +83,8 @@
if self.config.get_bool( 'enable_tool_shed_check', False ):
from tool_shed import update_manager
self.update_manager = update_manager.UpdateManager( self )
+ # Load proprietary datatype converters and display applications.
+ self.installed_repository_manager.load_proprietary_converters_and_display_applications()
# Load datatype display applications defined in local datatypes_conf.xml
self.datatypes_registry.load_display_applications()
# Load datatype converters defined in local datatypes_conf.xml
diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/tool_shed/__init__.py
--- a/lib/galaxy/tool_shed/__init__.py
+++ b/lib/galaxy/tool_shed/__init__.py
@@ -19,6 +19,7 @@
self.tool_configs = self.app.config.tool_configs
if self.app.config.migrated_tools_config not in self.tool_configs:
self.tool_configs.append( self.app.config.migrated_tools_config )
+ self.installed_repository_dicts = []
def get_repository_install_dir( self, tool_shed_repository ):
for tool_config in self.tool_configs:
tree = ElementTree.parse( tool_config )
@@ -43,5 +44,13 @@
.order_by( self.model.ToolShedRepository.table.c.id ):
relative_install_dir = self.get_repository_install_dir( tool_shed_repository )
if relative_install_dir:
- galaxy.util.shed_util.load_datatype_items( self.app, tool_shed_repository, relative_install_dir )
+ installed_repository_dict = galaxy.util.shed_util.load_installed_datatypes( self.app, tool_shed_repository, relative_install_dir )
+ if installed_repository_dict:
+ self.installed_repository_dicts.append( installed_repository_dict )
+ def load_proprietary_converters_and_display_applications( self, deactivate=False ):
+ for installed_repository_dict in self.installed_repository_dicts:
+ if installed_repository_dict[ 'converter_path' ]:
+ galaxy.util.shed_util.load_installed_datatype_converters( self.app, installed_repository_dict, deactivate=deactivate )
+ if installed_repository_dict[ 'display_path' ]:
+ galaxy.util.shed_util.load_installed_display_applications( installed_repository_dict, deactivate=deactivate )
\ No newline at end of file
diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1152,10 +1152,14 @@
parent_id=tool_version_using_parent_id.id )
sa_session.add( tool_version_association )
sa_session.flush()
-def load_datatype_items( app, repository, relative_install_dir, deactivate=False ):
- # Load proprietary datatypes.
+def load_installed_datatype_converters( app, installed_repository_dict, deactivate=False ):
+ # Load or deactivate proprietary datatype converters
+ app.datatypes_registry.load_datatype_converters( app.toolbox, installed_repository_dict=installed_repository_dict, deactivate=deactivate )
+def load_installed_datatypes( app, repository, relative_install_dir, deactivate=False ):
+ # Load proprietary datatypes and return information needed for loading proprietary datatypes converters and display applications later.
metadata = repository.metadata
work_dir = make_tmp_directory()
+ repository_dict = None
datatypes_config = get_config_from_repository( app,
'datatypes_conf.xml',
repository,
@@ -1173,16 +1177,14 @@
tool_dicts=metadata.get( 'tools', [] ),
converter_path=converter_path,
display_path=display_path )
- if converter_path:
- # Load or deactivate proprietary datatype converters
- app.datatypes_registry.load_datatype_converters( app.toolbox, installed_repository_dict=repository_dict, deactivate=deactivate )
- if display_path:
- # Load or deactivate proprietary datatype display applications
- app.datatypes_registry.load_display_applications( installed_repository_dict=repository_dict, deactivate=deactivate )
try:
shutil.rmtree( work_dir )
except:
pass
+ return repository_dict
+def load_installed_display_applications( installed_repository_dict, deactivate=False ):
+ # Load or deactivate proprietary datatype display applications
+ app.datatypes_registry.load_display_applications( installed_repository_dict=installed_repository_dict, deactivate=deactivate )
def load_repository_contents( trans, repository_name, description, owner, changeset_revision, ctx_rev, tool_path, repository_clone_url,
relative_install_dir, tool_shed=None, tool_section=None, shed_tool_conf=None, install_tool_dependencies=False ):
"""
@@ -1403,8 +1405,8 @@
# Write the current in-memory version of the integrated_tool_panel.xml file to disk.
trans.app.toolbox.write_integrated_tool_panel_config_file()
def reset_tool_data_tables( app ):
- # Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file.
- app.tool_data_tables = galaxy.tools.data.ToolDataTableManager( app.config.tool_data_table_config_path )
+ # Reset the tool_data_tables to an empty dictionary.
+ app.tool_data_tables = galaxy.tools.data.ToolDataTableManager()
def strip_path( fpath ):
file_path, file_name = os.path.split( fpath )
return file_name
diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -189,7 +189,11 @@
remove_from_tool_panel( trans, repository, shed_tool_conf, uninstall=remove_from_disk_checked )
if repository.includes_datatypes:
# Deactivate proprietary datatypes.
- load_datatype_items( trans.app, repository, repository_install_dir, deactivate=True )
+ installed_repository_dict = load_installed_datatypes( trans.app, repository, repository_install_dir, deactivate=True )
+ if installed_repository_dict[ 'converter_path' ]:
+ load_installed_datatype_converters( trans.app, installed_repository_dict, deactivate=True )
+ if installed_repository_dict[ 'display_path' ]:
+ load_installed_display_applications( installed_repository_dict, deactivate=True )
if remove_from_disk_checked:
try:
# Remove the repository from disk.
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.
1
0
commit/galaxy-central: jgoecks: Fix bug in showing/hiding filters in Trackster.
by Bitbucket 30 May '12
by Bitbucket 30 May '12
30 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/356aa8a00cfd/
changeset: 356aa8a00cfd
user: jgoecks
date: 2012-05-30 15:39:59
summary: Fix bug in showing/hiding filters in Trackster.
affected #: 1 file
diff -r 3dd591f01f6aae374142a62c25db98bacae5c4e3 -r 356aa8a00cfdd8c1d29f7065601f55120d241005 static/scripts/trackster.js
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -2598,8 +2598,10 @@
* Update filter's slider.
*/
update_ui_elt: function () {
- // Only show filter if min != max because filter is not useful otherwise.
- if (this.min !== this.max) {
+ // Only show filter if min < max because filter is not useful otherwise. This
+ // covers all corner cases, such as when min, max have not been defined and
+ // when min == max.
+ if (this.min < this.max) {
this.parent_div.show();
}
else {
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.
1
0
30 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/3dd591f01f6a/
changeset: 3dd591f01f6a
user: natefoo
date: 2012-05-30 10:31:56
summary: Handle spaces between commas in admin_users
affected #: 1 file
diff -r 37a28d5134b37b8450d9c266e1a5a6bb261461bf -r 3dd591f01f6aae374142a62c25db98bacae5c4e3 lib/galaxy/web/framework/__init__.py
--- a/lib/galaxy/web/framework/__init__.py
+++ b/lib/galaxy/web/framework/__init__.py
@@ -657,7 +657,7 @@
def user_is_admin( self ):
if self.api_inherit_admin:
return True
- admin_users = self.app.config.get( "admin_users", "" ).split( "," )
+ admin_users = [ x.strip() for x in self.app.config.get( "admin_users", "" ).split( "," ) ]
return self.user and admin_users and self.user.email in admin_users
def user_can_do_run_as( self ):
run_as_users = self.app.config.get( "api_allow_run_as", "" ).split( "," )
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.
1
0
commit/galaxy-central: greg: Fixes for loading a tool in a tool shed repository.
by Bitbucket 29 May '12
by Bitbucket 29 May '12
29 May '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/37a28d5134b3/
changeset: 37a28d5134b3
user: greg
date: 2012-05-29 20:46:02
summary: Fixes for loading a tool in a tool shed repository.
affected #: 4 files
diff -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b -r 37a28d5134b37b8450d9c266e1a5a6bb261461bf lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -785,14 +785,14 @@
for filename in ctx:
ctx_file_name = strip_path( filename )
if ctx_file_name == config_file:
- return get_named_tmpfile_from_ctx( ctx, filename, dir=dir )
+ return get_named_tmpfile_from_ctx( ctx, filename, dir )
# Finally look in the repository manifest.
for changeset in repo.changelog:
prev_ctx = repo.changectx( changeset )
for ctx_file in prev_ctx.files():
ctx_file_name = strip_path( ctx_file )
if ctx_file_name == config_file:
- return get_named_tmpfile_from_ctx( prev_ctx, filename, dir=dir )
+ return get_named_tmpfile_from_ctx( prev_ctx, filename, dir )
return None
def get_config_from_disk( config_file, relative_install_dir ):
for root, dirs, files in os.walk( relative_install_dir ):
diff -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b -r 37a28d5134b37b8450d9c266e1a5a6bb261461bf lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -547,7 +547,7 @@
.filter( trans.model.RepositoryMetadata.table.c.repository_id == trans.security.decode_id( id ) ) \
.order_by( trans.model.RepositoryMetadata.table.c.id.desc() ) \
.first()
-def get_named_tmpfile_from_ctx( ctx, filename, dir=None ):
+def get_named_tmpfile_from_ctx( ctx, filename, dir ):
fctx = ctx[ filename ]
fh = tempfile.NamedTemporaryFile( 'wb', dir=dir )
tmp_filename = fh.name
@@ -574,6 +574,28 @@
if parent_id is None:
# The tool did not change through all of the changeset revisions.
return old_id
+def get_previous_valid_changset_revision( repository, repo, before_changeset_revision ):
+ changeset_tups = []
+ for repository_metadata in repository.downloadable_revisions:
+ changeset_revision = repository_metadata.changeset_revision
+ ctx = get_changectx_for_changeset( repo, changeset_revision )
+ if ctx:
+ rev = '%04d' % ctx.rev()
+ else:
+ rev = '-1'
+ changeset_tups.append( ( rev, changeset_revision ) )
+ previous_changeset_revision = None
+ current_changeset_revision = None
+ for changeset_tup in sorted( changeset_tups ):
+ current_changeset_revision = changeset_tup[ 1 ]
+ if current_changeset_revision == before_changeset_revision:
+ if previous_changeset_revision:
+ return previous_changeset_revision
+ else:
+ # Return the hash value of an empty repository changlog - note that this will not be a valid changset revision.
+ return '000000000000'
+ else:
+ previous_changeset_revision = current_changeset_revision
def get_repository( trans, id ):
"""Get a repository from the database via id"""
return trans.sa_session.query( trans.model.Repository ).get( trans.security.decode_id( id ) )
@@ -743,8 +765,42 @@
ToolClass = Tool
return ToolClass( config_file, root, trans.app )
return None
-def load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config ):
- tool_config = strip_path( tool_config )
+def load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config_filename ):
+ """
+ Return a loaded tool whose tool config file name (e.g., filtering.xml) is the value of tool_config_filename. The value of changeset_revision
+ is a valid (downloadable) changset revision. If changeset_revision is the repository tip, then the tool will be loaded from it's file on disk.
+ Otherwise, the tool config will be located in the repository manifest between the received valid changeset revision and the previous valid
+ changeset revision (if one exists) or the first changeset revision in the repository (if one doesn't).
+ """
+ def load_from_tmp_config( ctx, ctx_file, work_dir ):
+ tool = None
+ message = ''
+ tmp_tool_config = get_named_tmpfile_from_ctx( ctx, ctx_file, work_dir )
+ element_tree = util.parse_xml( tmp_tool_config )
+ element_tree_root = element_tree.getroot()
+ # Look for code files required by the tool config.
+ tmp_code_files = []
+ for code_elem in element_tree_root.findall( 'code' ):
+ code_file_name = code_elem.get( 'file' )
+ tmp_code_file_name = copy_file_from_manifest( repo, ctx, code_file_name, work_dir )
+ if tmp_code_file_name:
+ tmp_code_files.append( tmp_code_file_name )
+ try:
+ tool = load_tool( trans, tmp_tool_config )
+ except Exception, e:
+ tool = None
+ message = "Error loading tool: %s. Clicking <b>Reset metadata</b> may correct this error." % str( e )
+ for tmp_code_file in tmp_code_files:
+ try:
+ os.unlink( tmp_code_file )
+ except:
+ pass
+ try:
+ os.unlink( tmp_tool_config )
+ except:
+ pass
+ return tool, message
+ tool_config_filename = strip_path( tool_config_filename )
repository = get_repository( trans, repository_id )
repo_files_dir = repository.repo_path
repo = hg.repository( get_configured_ui(), repo_files_dir )
@@ -757,48 +813,39 @@
if tool_data_table_config:
error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
if changeset_revision == repository.tip:
+ # Load the tool fron it's config file on disk.
try:
- copied_tool_config = copy_file_from_disk( tool_config, repo_files_dir, work_dir )
+ copied_tool_config = copy_file_from_disk( tool_config_filename, repo_files_dir, work_dir )
tool = load_tool( trans, copied_tool_config )
except Exception, e:
tool = None
- message = "Error loading tool: %s." % str( e )
+ message = "Error loading tool from config '%s': %s." % ( tool_config_filename, str( e ) )
else:
- # Get the tool config file name from the hgweb url, something like: /repos/test/convert_chars1/file/e58dcf0026c7/convert_characters.xml
- old_tool_config_file_name = tool_config.split( '/' )[ -1 ]
- in_ctx = False
+ found = False
+ tool = None
+ # Get the tool config from ctx if present.
for ctx_file in ctx.files():
ctx_file_name = strip_path( ctx_file )
- if ctx_file_name == old_tool_config_file_name:
- in_ctx = True
+ if ctx_file_name == tool_config_filename:
+ found = True
break
- if in_ctx:
- tmp_tool_config = get_named_tmpfile_from_ctx( ctx, ctx_file, dir=work_dir )
- element_tree = util.parse_xml( tmp_tool_config )
- element_tree_root = element_tree.getroot()
- # Look for code files required by the tool config.
- tmp_code_files = []
- for code_elem in element_tree_root.findall( 'code' ):
- code_file_name = code_elem.get( 'file' )
- tmp_code_file_name = copy_file_from_manifest( repo, ctx, code_file_name, work_dir )
- if tmp_code_file_name:
- tmp_code_files.append( tmp_code_file_name )
- try:
- tool = load_tool( trans, tmp_tool_config )
- except Exception, e:
- tool = None
- message = "Error loading tool: %s. Clicking <b>Reset metadata</b> may correct this error." % str( e )
- for tmp_code_file in tmp_code_files:
- try:
- os.unlink( tmp_code_file )
- except:
- pass
- try:
- os.unlink( tmp_tool_config )
- except:
- pass
+ if found:
+ if found:
+ tool, message = load_from_tmp_config( ctx, ctx_file, work_dir )
else:
- tool = None
+ # Get the tool config from the repository manifest between valid changeset revisions.
+ previous_valid_changset_revision = get_previous_valid_changset_revision( repository, repo, changeset_revision )
+ for changeset in reversed_filtered_changelog( repo, previous_valid_changset_revision, changeset_revision ):
+ manifest_changeset_revision = str( repo.changectx( changeset ) )
+ manifest_ctx = repo.changectx( changeset )
+ for ctx_file in manifest_ctx.files():
+ ctx_file_name = strip_path( ctx_file )
+ if ctx_file_name == tool_config_filename:
+ found = True
+ break
+ if found:
+ tool, message = load_from_tmp_config( manifest_ctx, ctx_file, work_dir )
+ break
# Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file.
reset_tool_data_tables( trans.app )
try:
@@ -811,7 +858,7 @@
tool = None
valid = False
error_message = ''
- tmp_config = get_named_tmpfile_from_ctx( ctx, filename, dir=dir )
+ tmp_config = get_named_tmpfile_from_ctx( ctx, filename, dir )
if not ( check_binary( tmp_config ) or check_image( tmp_config ) or check_gzip( tmp_config )[ 0 ]
or check_bz2( tmp_config )[ 0 ] or check_zip( tmp_config ) ):
try:
@@ -979,6 +1026,26 @@
clean_repository_metadata( trans, id, changeset_revisions )
add_repository_metadata_tool_versions( trans, id, changeset_revisions )
return '', 'ok'
+def reversed_filtered_changelog( repo, excluded_lower_bounds_changeset_revision, included_upper_bounds_changeset_revision ):
+ """
+ Return a reversed list of changesets in the repository changelog after the excluded_lower_bounds_changeset_revision, but up to and
+ including the included_upper_bounds_changeset_revision. The value of excluded_lower_bounds_changeset_revision will be '000000000000'
+ if no valid changesets exist before included_upper_bounds_changeset_revision.
+ """
+ if excluded_lower_bounds_changeset_revision == '000000000000':
+ appending_started = True
+ else:
+ appending_started = False
+ reversed_changelog = []
+ for changeset in repo.changelog:
+ changeset_hash = str( repo.changectx( changeset ) )
+ if appending_started:
+ reversed_changelog.insert( 0, changeset )
+ if changeset_hash == excluded_lower_bounds_changeset_revision and not appending_started:
+ appending_started = True
+ if changeset_hash == included_upper_bounds_changeset_revision:
+ break
+ return reversed_changelog
def set_repository_metadata( trans, id, changeset_revision, content_alert_str='', **kwd ):
"""
Set repository metadata on the repository tip, returning specific error messages (if any) to alert the repository owner that the changeset
diff -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b -r 37a28d5134b37b8450d9c266e1a5a6bb261461bf lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -402,7 +402,6 @@
url_args=url_args,
allow_multiple=False,
async_compatible=False ) ]
- # Render the list view
return self.valid_repository_list_grid( trans, **kwd )
@web.expose
def browse_invalid_tools( self, trans, **kwd ):
@@ -1891,7 +1890,7 @@
for filename in ctx:
ctx_file_name = strip_path( filename )
if ctx_file_name == tool_config:
- tool_config_path = get_named_tmpfile_from_ctx( ctx, filename, dir=work_dir )
+ tool_config_path = get_named_tmpfile_from_ctx( ctx, filename, work_dir )
break
metadata_dict, invalid_files = generate_metadata_for_changeset_revision( trans,
repo,
diff -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b -r 37a28d5134b37b8450d9c266e1a5a6bb261461bf lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py
+++ b/lib/galaxy/webapps/community/controllers/upload.py
@@ -43,7 +43,6 @@
# See the handle_email_alerts() method for the definition of the scenarios.
new_repo_alert = repository.is_new
if params.get( 'upload_button', False ):
- current_working_dir = os.getcwd()
if file_data == '' and url == '':
message = 'No files were entered on the upload form.'
status = 'error'
@@ -270,9 +269,6 @@
error, message = handle_sample_tool_data_table_conf_file( trans.app, filename_in_archive )
if error:
return False, message, files_to_remove, content_alert_str, undesirable_dirs_removed, undesirable_files_removed
- #if filename_in_archive.endswith( '.loc.sample' ):
- # # Handle the special case where a xxx.loc.sample file is being uploaded by copying it to ~/tool-data/xxx.loc.
- # copy_sample_file( trans.app, filename_in_archive )
commands.commit( repo.ui, repo, full_path, user=trans.user.username, message=commit_message )
# See if the content of the change set was valid.
admin_only = len( repository.downloadable_revisions ) != 1
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/b129ae3fc035/
changeset: b129ae3fc035
user: jgoecks
date: 2012-05-28 18:05:20
summary: Move icons from trackster.css to base.css for general usage.
affected #: 5 files
diff -r 03cb8ee86726813073913be149516ab10e601e55 -r b129ae3fc0359f08b9f47ae33230249a4ce0975e static/june_2007_style/base_sprites.less.tmpl
--- a/static/june_2007_style/base_sprites.less.tmpl
+++ b/static/june_2007_style/base_sprites.less.tmpl
@@ -102,14 +102,28 @@
-sprite-group: fugue;
-sprite-image: silk/chart_curve.png;
}
-
+.icon-button.disk--arrow {
+ -sprite-group: fugue;
+ -sprite-image: fugue/disk--arrow-bw.png;
+}
+.icon-button.disk--arrow:hover {
+ -sprite-group: fugue;
+ -sprite-image: fugue/disk--arrow.png;
+}
+.icon-button.cross-circle {
+ -sprite-group: fugue;
+ -sprite-image: fugue/cross-circle-bw.png;
+}
+.icon-button.cross-circle:hover {
+ -sprite-group: fugue;
+ -sprite-image: fugue/cross-circle.png;
+}
.text-and-autocomplete-select {
-sprite-group: fugue;
-sprite-image: fugue/control-270.png;
-sprite-horiz-position: right;
}
-
div.historyItem-error .state-icon {
-sprite-group: history-states;
-sprite-image: data_error.png;
diff -r 03cb8ee86726813073913be149516ab10e601e55 -r b129ae3fc0359f08b9f47ae33230249a4ce0975e static/june_2007_style/blue/base.css
--- a/static/june_2007_style/blue/base.css
+++ b/static/june_2007_style/blue/base.css
@@ -754,7 +754,11 @@
.icon-button.plus-button:hover{background:url(fugue.png) no-repeat 0px -364px;}
.icon-button.gear{background:url(fugue.png) no-repeat 0px -390px;}
.icon-button.chart_curve{background:url(fugue.png) no-repeat 0px -416px;}
-.text-and-autocomplete-select{background:url(fugue.png) no-repeat right -442px;}
+.icon-button.disk--arrow{background:url(fugue.png) no-repeat 0px -442px;}
+.icon-button.disk--arrow:hover{background:url(fugue.png) no-repeat 0px -468px;}
+.icon-button.cross-circle{background:url(fugue.png) no-repeat 0px -494px;}
+.icon-button.cross-circle:hover{background:url(fugue.png) no-repeat 0px -520px;}
+.text-and-autocomplete-select{background:url(fugue.png) no-repeat right -546px;}
div.historyItem-error .state-icon{background:url(history-states.png) no-repeat 0px 0px;}
div.historyItem-empty .state-icon{background:url(history-states.png) no-repeat 0px -25px;}
div.historyItem-queued .state-icon{background:url(history-states.png) no-repeat 0px -50px;}
diff -r 03cb8ee86726813073913be149516ab10e601e55 -r b129ae3fc0359f08b9f47ae33230249a4ce0975e static/june_2007_style/blue/fugue.png
Binary file static/june_2007_style/blue/fugue.png has changed
diff -r 03cb8ee86726813073913be149516ab10e601e55 -r b129ae3fc0359f08b9f47ae33230249a4ce0975e static/june_2007_style/blue/trackster.css
--- a/static/june_2007_style/blue/trackster.css
+++ b/static/june_2007_style/blue/trackster.css
@@ -84,16 +84,12 @@
.icon-button.toggle:hover{background:transparent url(../images/fugue/toggle.png) no-repeat;}
.icon-button.toggle-expand{background:transparent url(../images/fugue/toggle-expand-bw.png) no-repeat;margin-right:0px;}
.icon-button.toggle-expand:hover{background:transparent url(../images/fugue/toggle-expand.png) no-repeat;}
-.icon-button.cross-circle{background:transparent url(../images/fugue/cross-circle-bw.png) no-repeat;margin-right:0px;}
-.icon-button.cross-circle:hover{background:transparent url(../images/fugue/cross-circle.png) no-repeat;}
.icon-button.block--plus{background:transparent url(../images/fugue/block--plus-bw.png) no-repeat;}
.icon-button.block--plus:hover{background:transparent url(../images/fugue/block--plus.png) no-repeat;}
.icon-button.bookmarks{background:transparent url(../images/fugue/bookmarks-bw.png) no-repeat;}
.icon-button.bookmarks:hover{background:transparent url(../images/fugue/bookmarks.png) no-repeat;}
.icon-button.toolbox{background:transparent url(../images/fugue/toolbox-bw.png) no-repeat;}
.icon-button.toolbox:hover{background:transparent url(../images/fugue/toolbox.png) no-repeat;}
-.icon-button.disk--arrow{background:transparent url(../images/fugue/disk--arrow-bw.png) no-repeat;}
-.icon-button.disk--arrow:hover{background:transparent url(../images/fugue/disk--arrow.png) no-repeat;}
.child-track-icon{background:url('../images/fugue/arrow-000-small-bw.png') no-repeat;width:30px;cursor:move;}
.track-resize{background:white url('../images/visualization/draggable_vertical.png') no-repeat top center;position:absolute;right:3px;bottom:-4px;width:14px;height:7px;border:solid #999 1px;z-index:100;}
.bookmark{background:white;border:solid #999 1px;border-right:none;margin:0.5em;margin-right:0;padding:0.5em;}
diff -r 03cb8ee86726813073913be149516ab10e601e55 -r b129ae3fc0359f08b9f47ae33230249a4ce0975e static/june_2007_style/trackster.css.tmpl
--- a/static/june_2007_style/trackster.css.tmpl
+++ b/static/june_2007_style/trackster.css.tmpl
@@ -405,12 +405,6 @@
.icon-button.toggle-expand:hover {
background: transparent url(../images/fugue/toggle-expand.png) no-repeat;
}
-.icon-button.cross-circle {
- background: transparent url(../images/fugue/cross-circle-bw.png) no-repeat;margin-right:0px;
-}
-.icon-button.cross-circle:hover {
- background: transparent url(../images/fugue/cross-circle.png) no-repeat;
-}
.icon-button.block--plus {
background: transparent url(../images/fugue/block--plus-bw.png) no-repeat;
}
@@ -429,12 +423,6 @@
.icon-button.toolbox:hover {
background: transparent url(../images/fugue/toolbox.png) no-repeat;
}
-.icon-button.disk--arrow {
- background: transparent url(../images/fugue/disk--arrow-bw.png) no-repeat;
-}
-.icon-button.disk--arrow:hover {
- background: transparent url(../images/fugue/disk--arrow.png) no-repeat;
-}
.child-track-icon {
background:url('../images/fugue/arrow-000-small-bw.png') no-repeat;
width: 30px;
https://bitbucket.org/galaxy/galaxy-central/changeset/9765176c63f7/
changeset: 9765176c63f7
user: jgoecks
date: 2012-05-28 18:10:04
summary: Visualization: (a) rename circos viz 'circster' and (b) foundational work for circster and backbone-visualization integration. Also pack scripts.
affected #: 11 files
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -277,7 +277,7 @@
class UsesVisualizationMixin( SharableItemSecurityMixin ):
""" Mixin for controllers that use Visualization objects. """
- viz_types = [ "trackster", "circos" ]
+ viz_types = [ "trackster", "circster" ]
len_files = None
@@ -360,7 +360,7 @@
end = config['viewport']['end']
overview = config['viewport']['overview']
vis_rev.config[ "viewport" ] = { 'chrom': chrom, 'start': start, 'end': end, 'overview': overview }
- elif type == 'circos':
+ elif type == 'circster':
# TODO.
pass
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b lib/galaxy/web/controllers/tracks.py
--- a/lib/galaxy/web/controllers/tracks.py
+++ b/lib/galaxy/web/controllers/tracks.py
@@ -758,7 +758,7 @@
@web.expose
@web.require_login( "use Galaxy visualizations", use_panels=True )
- def circos( self, trans, hda_ldda, dataset_id ):
+ def circster( self, trans, hda_ldda, dataset_id ):
# Get dataset.
dataset = self._get_dataset( trans, hda_ldda, dataset_id )
@@ -777,7 +777,7 @@
summary = indexer.get_summary( chrom_info[ 'chrom' ], 0, chrom_info[ 'len' ], level=4 )
dataset_summary.append( summary )
- return trans.fill_template_mako( "visualization/circos.mako", dataset=dataset, dataset_summary=dataset_summary, genome=genome )
+ return trans.fill_template_mako( "visualization/circster.mako", dataset=dataset, dataset_summary=dataset_summary, genome=genome )
# -----------------
# Helper methods.
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b static/scripts/mvc/tools.js
--- a/static/scripts/mvc/tools.js
+++ b/static/scripts/mvc/tools.js
@@ -181,6 +181,7 @@
* applies search results as they become available.
*/
var ToolPanel = Backbone.Collection.extend({
+ // TODO: need to generate this using url_for
url: "/tools",
tools: new ToolCollection(),
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b static/scripts/mvc/ui.js
--- a/static/scripts/mvc/ui.js
+++ b/static/scripts/mvc/ui.js
@@ -1,5 +1,24 @@
/**
- * Utility models and views for Galaxy objects.
+ * -- Functions for creating large UI elements. --
+ */
+
+/**
+ * Returns an IconButtonMenuView for the provided configuration.
+ * Configuration is a list of dictionaries where each dictionary
+ * defines an icon button. Each dictionary must have the following
+ * elements: icon_class, title, and on_click.
+ */
+var create_icon_buttons_menu = function(config) {
+ // Create and initialize menu.
+ var buttons = new IconButtonCollection(
+ _.map(config, function(button_config) { return new IconButton(button_config); })
+ );
+
+ return new IconButtonMenuView( {collection: buttons} );
+};
+
+/**
+ * -- Utility models and views for Galaxy objects. --
*/
/**
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b static/scripts/mvc/visualization.js
--- a/static/scripts/mvc/visualization.js
+++ b/static/scripts/mvc/visualization.js
@@ -26,9 +26,77 @@
});
/**
+ * A genome browser bookmark.
+ */
+var BrowserBookmark = Backbone.Model.extend({
+ defaults: {
+ chrom: null,
+ start: 0,
+ end: 0,
+ note: ""
+ }
+});
+
+/**
+ * Bookmarks collection.
+ */
+var BrowserBookmarks = Backbone.Collection.extend({
+ model: BrowserBookmark
+});
+
+/**
+ * A visualization.
+ */
+var Visualization = Backbone.RelationalModel.extend({
+ defaults: {
+ id: "",
+ title: "",
+ type: "",
+ dbkey: "",
+ datasets: []
+ }
+});
+
+/**
+ * A Trackster visualization.
+ */
+var TracksterVisualization = Visualization.extend({
+ defaults: {
+ bookmarks: [],
+ viewport: {}
+ }
+});
+
+/**
+ * A Circster visualization.
+ */
+var CircsterVisualization = Visualization.extend({
+});
+
+/**
+ * A dataset. In Galaxy, datasets are associated with a history, so
+ * this object is also known as a HistoryDatasetAssociation.
+ */
+var Dataset = Backbone.Model.extend({
+ defaults: {
+ id: "",
+ type: "",
+ name: "",
+ hda_ldda: ""
+ }
+});
+
+/**
* A histogram dataset.
*/
var HistogramDataset = Backbone.Model.extend({
+ /*
+ defaults: {
+ data: [],
+ dataset: null,
+ max: 0
+ },
+ */
initialize: function(data) {
// Set max across dataset.
@@ -42,9 +110,16 @@
});
/**
- * Layout for a histogram dataset in a circos visualization.
+ * Configuration data for a Trackster track.
*/
-var CircosHistogramDatasetLayout = Backbone.Model.extend({
+var TrackConfig = Backbone.Model.extend({
+
+});
+
+/**
+ * Layout for a histogram dataset in a circster visualization.
+ */
+var CircsterHistogramDatasetLayout = Backbone.Model.extend({
// TODO: should accept genome and dataset and use these to generate layout data.
/**
@@ -104,8 +179,8 @@
* -- Views --
*/
-var CircosView = Backbone.View.extend({
- className: 'circos',
+var CircsterView = Backbone.View.extend({
+ className: 'circster',
initialize: function(options) {
this.width = options.width;
@@ -124,7 +199,7 @@
dataset_arc_height = this.dataset_arc_height,
// Layout chromosome arcs.
- arcs_layout = new CircosHistogramDatasetLayout({
+ arcs_layout = new CircsterHistogramDatasetLayout({
genome: this.genome,
total_gap: this.total_gap
}),
@@ -205,3 +280,58 @@
this.view.go_to(new_loc);
}
});
+
+/**
+ * -- Helper functions.
+ */
+
+/**
+ * Use a popup grid to add more datasets.
+ */
+var add_datasets = function(dataset_url, add_track_async_url, success_fn) {
+ $.ajax({
+ url: dataset_url,
+ data: { "f-dbkey": view.dbkey },
+ error: function() { alert( "Grid failed" ); },
+ success: function(table_html) {
+ show_modal(
+ "Select datasets for new tracks",
+ table_html, {
+ "Cancel": function() {
+ hide_modal();
+ },
+ "Add": function() {
+ var requests = [];
+ $('input[name=id]:checked,input[name=ldda_ids]:checked').each(function() {
+ var data,
+ id = $(this).val();
+ if ($(this).attr("name") === "id") {
+ data = { hda_id: id };
+ } else {
+ data = { ldda_id: id};
+ }
+ requests[requests.length] = $.ajax({
+ url: add_track_async_url,
+ data: data,
+ dataType: "json",
+ });
+ });
+ // To preserve order, wait until there are definitions for all tracks and then add
+ // them sequentially.
+ $.when.apply($, requests).then(function() {
+ // jQuery always returns an Array for arguments, so need to look at first element
+ // to determine whether multiple requests were made and consequently how to
+ // map arguments to track definitions.
+ var track_defs = (arguments[0] instanceof Array ?
+ $.map(arguments, function(arg) { return arg[0]; }) :
+ [ arguments[0] ]
+ );
+ success_fn(track_defs);
+ });
+ hide_modal();
+ }
+ }
+ );
+ }
+ });
+};
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b static/scripts/packed/mvc/ui.js
--- a/static/scripts/packed/mvc/ui.js
+++ b/static/scripts/packed/mvc/ui.js
@@ -1,1 +1,1 @@
-var GalaxyPaths=Backbone.Model.extend({defaults:{root_path:"",image_path:""}});var IconButton=Backbone.Model.extend({defaults:{title:"",icon_class:"",on_click:null}});var IconButtonCollection=Backbone.Collection.extend({model:IconButton});var IconButtonMenuView=Backbone.View.extend({tagName:"div",render:function(){var a=this;this.collection.each(function(b){$("<a/>").attr("href","javascript:void(0)").attr("title",b.attributes.title).addClass("icon-button menu-button").addClass(b.attributes.icon_class).appendTo(a.$el).click(b.attributes.on_click)});return this}});var Grid=Backbone.Collection.extend({});var GridView=Backbone.View.extend({});
\ No newline at end of file
+var create_icon_buttons_menu=function(a){var b=new IconButtonCollection(_.map(a,function(c){return new IconButton(c)}));return new IconButtonMenuView({collection:b})};var GalaxyPaths=Backbone.Model.extend({defaults:{root_path:"",image_path:""}});var IconButton=Backbone.Model.extend({defaults:{title:"",icon_class:"",on_click:null}});var IconButtonCollection=Backbone.Collection.extend({model:IconButton});var IconButtonMenuView=Backbone.View.extend({tagName:"div",render:function(){var a=this;this.collection.each(function(b){$("<a/>").attr("href","javascript:void(0)").attr("title",b.attributes.title).addClass("icon-button menu-button").addClass(b.attributes.icon_class).appendTo(a.$el).click(b.attributes.on_click)});return this}});var Grid=Backbone.Collection.extend({});var GridView=Backbone.View.extend({});
\ No newline at end of file
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b static/scripts/packed/mvc/visualization.js
--- a/static/scripts/packed/mvc/visualization.js
+++ b/static/scripts/packed/mvc/visualization.js
@@ -1,1 +1,1 @@
-var Genome=Backbone.Model.extend({defaults:{name:null,key:null,chroms_info:null},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info}});var HistogramDataset=Backbone.Model.extend({initialize:function(a){this.attributes.data=a;this.attributes.max=_.max(a,function(b){if(!b||typeof b==="string"){return 0}return b[1]})[1]}});var CircosHistogramDatasetLayout=Backbone.Model.extend({chroms_layout:function(){var b=this.attributes.genome.get_chroms_info(),d=d3.layout.pie().value(function(f){return f.len}).sort(null),e=d(b),a=this.attributes.total_gap/b.length,c=_.map(e,function(h,g){var f=h.endAngle-a;h.endAngle=(f>h.startAngle?f:h.startAngle);return h});return c},chrom_data_layout:function(j,b,g,f,h){if(!b||typeof b==="string"){return null}var d=b[0],i=b[3],c=d3.scale.linear().domain([0,h]).range([g,f]),e=d3.layout.pie().value(function(k){return i}).startAngle(j.startAngle).endAngle(j.endAngle),a=e(d);_.each(d,function(k,l){a[l].outerRadius=c(k[1])});return a}});var CircosView=Backbone.View.extend({className:"circos",initialize:function(a){this.width=a.width;this.height=a.height;this.total_gap=a.total_gap;this.genome=a.genome;this.dataset=a.dataset;this.radius_start=a.radius_start;this.dataset_arc_height=a.dataset_arc_height},render:function(){var d=this.radius_start,e=this.dataset_arc_height,j=new CircosHistogramDatasetLayout({genome:this.genome,total_gap:this.total_gap}),i=j.chroms_layout(),g=_.zip(i,this.dataset.attributes.data),h=this.dataset.attributes.max,b=_.map(g,function(m){var n=m[0],l=m[1];return j.chrom_data_layout(n,l,d,d+e,h)});var c=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height).append("g").attr("transform","translate("+this.width/2+","+this.height/2+")");var k=c.append("g").attr("id","inner-arc"),f=d3.svg.arc().innerRadius(d).outerRadius(d+e),a=k.selectAll("#inner-arc>path").data(i).enter().append("path").attr("d",f).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(l){return l.data.chrom});_.each(b,function(l){if(!l){return}var o=c.append("g"),n=d3.svg.arc().innerRadius(d),m=o.selectAll("path").data(l).enter().append("path").attr("d",n).style("stroke","red").style("fill","red")})}});var TrackBrowserRouter=Backbone.Router.extend({initialize:function(b){this.view=b.view;this.route(/([\w]+)$/,"change_location");this.route(/([\w]+\:[\d,]+-[\d,]+)$/,"change_location");var a=this;a.view.on("navigate",function(c){a.navigate(c)})},change_location:function(a){this.view.go_to(a)}});
\ No newline at end of file
+var Genome=Backbone.Model.extend({defaults:{name:null,key:null,chroms_info:null},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info}});var BrowserBookmark=Backbone.Model.extend({defaults:{chrom:null,start:0,end:0,note:""}});var BrowserBookmarks=Backbone.Collection.extend({model:BrowserBookmark});var Visualization=Backbone.RelationalModel.extend({defaults:{id:"",title:"",type:"",dbkey:"",datasets:[]}});var TracksterVisualization=Visualization.extend({defaults:{bookmarks:[],viewport:{}}});var CircsterVisualization=Visualization.extend({});var Dataset=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:""}});var HistogramDataset=Backbone.Model.extend({initialize:function(a){this.attributes.data=a;this.attributes.max=_.max(a,function(b){if(!b||typeof b==="string"){return 0}return b[1]})[1]}});var TrackConfig=Backbone.Model.extend({});var CircsterHistogramDatasetLayout=Backbone.Model.extend({chroms_layout:function(){var b=this.attributes.genome.get_chroms_info(),d=d3.layout.pie().value(function(f){return f.len}).sort(null),e=d(b),a=this.attributes.total_gap/b.length,c=_.map(e,function(h,g){var f=h.endAngle-a;h.endAngle=(f>h.startAngle?f:h.startAngle);return h});return c},chrom_data_layout:function(j,b,g,f,h){if(!b||typeof b==="string"){return null}var d=b[0],i=b[3],c=d3.scale.linear().domain([0,h]).range([g,f]),e=d3.layout.pie().value(function(k){return i}).startAngle(j.startAngle).endAngle(j.endAngle),a=e(d);_.each(d,function(k,l){a[l].outerRadius=c(k[1])});return a}});var CircsterView=Backbone.View.extend({className:"circster",initialize:function(a){this.width=a.width;this.height=a.height;this.total_gap=a.total_gap;this.genome=a.genome;this.dataset=a.dataset;this.radius_start=a.radius_start;this.dataset_arc_height=a.dataset_arc_height},render:function(){var d=this.radius_start,e=this.dataset_arc_height,j=new CircsterHistogramDatasetLayout({genome:this.genome,total_gap:this.total_gap}),i=j.chroms_layout(),g=_.zip(i,this.dataset.attributes.data),h=this.dataset.attributes.max,b=_.map(g,function(m){var n=m[0],l=m[1];return j.chrom_data_layout(n,l,d,d+e,h)});var c=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height).append("g").attr("transform","translate("+this.width/2+","+this.height/2+")");var k=c.append("g").attr("id","inner-arc"),f=d3.svg.arc().innerRadius(d).outerRadius(d+e),a=k.selectAll("#inner-arc>path").data(i).enter().append("path").attr("d",f).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(l){return l.data.chrom});_.each(b,function(l){if(!l){return}var o=c.append("g"),n=d3.svg.arc().innerRadius(d),m=o.selectAll("path").data(l).enter().append("path").attr("d",n).style("stroke","red").style("fill","red")})}});var TrackBrowserRouter=Backbone.Router.extend({initialize:function(b){this.view=b.view;this.route(/([\w]+)$/,"change_location");this.route(/([\w]+\:[\d,]+-[\d,]+)$/,"change_location");var a=this;a.view.on("navigate",function(c){a.navigate(c)})},change_location:function(a){this.view.go_to(a)}});var add_datasets=function(a,c,b){$.ajax({url:a,data:{"f-dbkey":view.dbkey},error:function(){alert("Grid failed")},success:function(d){show_modal("Select datasets for new tracks",d,{Cancel:function(){hide_modal()},Add:function(){var e=[];$("input[name=id]:checked,input[name=ldda_ids]:checked").each(function(){var f,g=$(this).val();if($(this).attr("name")==="id"){f={hda_id:g}}else{f={ldda_id:g}}e[e.length]=$.ajax({url:c,data:f,dataType:"json",})});$.when.apply($,e).then(function(){var f=(arguments[0] instanceof Array?$.map(arguments,function(g){return g[0]}):[arguments[0]]);b(f)});hide_modal()}})}})};
\ No newline at end of file
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b templates/base_panels.mako
--- a/templates/base_panels.mako
+++ b/templates/base_panels.mako
@@ -61,7 +61,7 @@
<%def name="late_javascripts()">
## Scripts can be loaded later since they progressively add features to
## the panels, but do not change layout
- ${h.js( 'jquery.event.drag', 'jquery.event.hover', 'jquery.form', 'jquery.rating', 'galaxy.base', 'galaxy.panels' )}
+ ${h.js( 'jquery.event.drag', 'jquery.event.hover', 'jquery.form', 'jquery.rating', 'galaxy.base', 'galaxy.panels', 'jquery.tipsy' )}
<script type="text/javascript">
ensure_dd_helper();
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b templates/tracks/browser.mako
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -42,13 +42,16 @@
<script type='text/javascript' src="${h.url_for('/static/scripts/excanvas.js')}"></script><![endif]-->
-${h.js( "galaxy.base", "galaxy.panels", "json2", "jquery", "jstorage", "jquery.event.drag", "jquery.event.hover","jquery.mousewheel", "jquery.autocomplete", "trackster", "trackster_ui", "jquery.ui.sortable.slider", "farbtastic", "jquery.tipsy", "mvc/visualization" )}
+${h.js( "galaxy.base", "galaxy.panels", "json2", "jquery", "jstorage", "jquery.event.drag", "jquery.event.hover","jquery.mousewheel", "jquery.autocomplete", "trackster", "trackster_ui", "jquery.ui.sortable.slider", "farbtastic", "mvc/visualization" )}
<script type="text/javascript">
//
// Place URLs here so that url_for can be used to generate them.
//
- var default_data_url = "${h.url_for( action='data' )}",
+ var
+ add_track_async_url = "${h.url_for( action='add_track_async' )}",
+ add_datasets_url = "${h.url_for( action='list_current_history_datasets' )}",
+ default_data_url = "${h.url_for( action='data' )}",
raw_data_url = "${h.url_for( action='raw_data' )}",
run_tool_url = "${h.url_for( action='run_tool' )}",
rerun_tool_url = "${h.url_for( action='rerun_tool' )}",
@@ -66,60 +69,7 @@
browser_router = new TrackBrowserRouter(options);
Backbone.history.start();
};
-
- /**
- * Use a popup grid to add more tracks.
- */
- var add_tracks = function() {
- $.ajax({
- url: "${h.url_for( action='list_current_history_datasets' )}",
- data: { "f-dbkey": view.dbkey },
- error: function() { alert( "Grid failed" ); },
- success: function(table_html) {
- show_modal(
- "Select datasets for new tracks",
- table_html, {
- "Cancel": function() {
- hide_modal();
- },
- "Insert": function() {
- var requests = [];
- $('input[name=id]:checked,input[name=ldda_ids]:checked').each(function() {
- var data,
- id = $(this).val();
- if ($(this).attr("name") === "id") {
- data = { hda_id: id };
- } else {
- data = { ldda_id: id};
- }
- requests[requests.length] = $.ajax({
- url: "${h.url_for( action='add_track_async' )}",
- data: data,
- dataType: "json",
- });
- });
- // To preserve order, wait until there are definitions for all tracks and then add
- // them sequentially.
- $.when.apply($, requests).then(function() {
- // jQuery always returns an Array for arguments, so need to look at first element
- // to determine whether multiple requests were made and consequently how to
- // map arguments to track definitions.
- var track_defs = (arguments[0] instanceof Array ?
- $.map(arguments, function(arg) { return arg[0]; }) :
- [ arguments[0] ]
- );
- for (var i= 0; i < track_defs.length; i++) {
- view.add_drawable( object_from_template(track_defs[i], view) );
- }
- });
- hide_modal();
- }
- }
- );
- }
- });
- };
-
+
/**
* Use a popup grid to bookmarks from a dataset.
*/
@@ -168,23 +118,22 @@
var browser_router;
$(function() {
// Create and initialize menu.
- var
-
- buttons = new IconButtonCollection([
- new IconButton({icon_class: 'plus-button', title: 'Add tracks', on_click: function() { add_tracks(); } }),
- new IconButton({icon_class: 'block--plus', title: 'Add group', on_click: function() {
+ var menu = create_icon_buttons_menu([
+ { icon_class: 'plus-button', title: 'Add tracks', on_click: function() {
+ add_datasets(add_datasets_url, add_track_async_url, function(tracks) {
+ _.each(tracks, function(track) {
+ view.add_drawable( object_from_template(track, view) );
+ });
+ });
+ } },
+ { icon_class: 'block--plus', title: 'Add group', on_click: function() {
view.add_drawable( new DrawableGroup(view, view, { name: "New Group" }) );
- } }),
- /*
- new IconButton({icon_class: 'toolbox', title: 'Use tools', on_click: function() {
- console.log("toolbox!")
- } }),
- */
- new IconButton({icon_class: 'bookmarks', title: 'Bookmarks', on_click: function() {
+ } },
+ { icon_class: 'bookmarks', title: 'Bookmarks', on_click: function() {
// HACK -- use style to determine if panel is hidden and hide/show accordingly.
parent.force_right_panel(($("div#right").css("right") == "0px" ? "hide" : "show"));
- } }),
- new IconButton({icon_class: 'disk--arrow', title: 'Save', on_click: function() {
+ } },
+ { icon_class: 'disk--arrow', title: 'Save', on_click: function() {
// Show saving dialog box
show_modal("Saving...", "progress");
@@ -229,15 +178,11 @@
{ "Close" : hide_modal } );
}
});
- } }),
- new IconButton({icon_class: 'cross-circle', title: 'Close', on_click: function() {
+ } },
+ { icon_class: 'cross-circle', title: 'Close', on_click: function() {
window.location = "${h.url_for( controller='visualization', action='list' )}";
- } })
- ]),
-
- menu = new IconButtonMenuView({
- collection: buttons
- });
+ } }
+ ]);
menu.render();
menu.$el.attr("style", "float: right");
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b templates/visualization/circos.mako
--- a/templates/visualization/circos.mako
+++ /dev/null
@@ -1,39 +0,0 @@
-<%inherit file="/base.mako"/>
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
-
- ${h.js( "libs/d3", "mvc/visualization" )}
-
- <script type="text/javascript">
- $(function() {
- // -- Viz set up. --
-
- var genome = new Genome(JSON.parse('${ h.to_json_string( genome ) }')),
- dataset = new HistogramDataset(JSON.parse('${ h.to_json_string( dataset_summary ) }')),
- circos = new CircosView({
- width: 600,
- height: 600,
- // Gap is difficult to set because it very dependent on chromosome size and organization.
- total_gap: 2 * Math.PI * 0.5,
- genome: genome,
- dataset: dataset,
- radius_start: 100,
- dataset_arc_height: 50
- });
-
- // -- Render viz. --
-
- circos.render();
- $('body').append(circos.$el);
- });
- </script>
-</%def>
-
-<%def name="body()">
- <h1>Circos plot for '${dataset.name}'</h1>
-</%def>
diff -r b129ae3fc0359f08b9f47ae33230249a4ce0975e -r 9765176c63f7ada3ee30a649ab3ef13396d9c84b templates/visualization/circster.mako
--- /dev/null
+++ b/templates/visualization/circster.mako
@@ -0,0 +1,97 @@
+<%inherit file="/webapps/galaxy/base_panels.mako"/>
+
+<%def name="init()">
+<%
+ self.has_left_panel=False
+ self.has_right_panel=False
+ self.active_view="visualization"
+ self.message_box_visible=False
+%>
+</%def>
+
+<%def name="stylesheets()">
+ ${parent.stylesheets()}
+</%def>
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+
+ ${h.js( "libs/d3", "mvc/visualization" )}
+
+ <script type="text/javascript">
+ $(function() {
+ // -- Visualization menu and set up.
+ var menu = create_icon_buttons_menu([
+ { icon_class: 'plus-button', title: 'Add tracks', on_click: function() { add_tracks(); } },
+ { icon_class: 'disk--arrow', title: 'Save', on_click: function() {
+ // Show saving dialog box
+ show_modal("Saving...", "progress");
+
+ $.ajax({
+ url: "${h.url_for( action='save' )}",
+ type: "POST",
+ data: {
+ 'id': view.vis_id,
+ 'title': view.name,
+ 'dbkey': view.dbkey,
+ 'type': 'trackster',
+ 'config': JSON.stringify(payload)
+ },
+ dataType: "json",
+ success: function(vis_info) {
+ hide_modal();
+ view.vis_id = vis_info.vis_id;
+ view.has_changes = false;
+
+ // Needed to set URL when first saving a visualization.
+ window.history.pushState({}, "", vis_info.url + window.location.hash);
+ },
+ error: function() {
+ show_modal( "Could Not Save", "Could not save visualization. Please try again later.",
+ { "Close" : hide_modal } );
+ }
+ });
+ } },
+ { icon_class: 'cross-circle', title: 'Close', on_click: function() {
+ window.location = "${h.url_for( controller='visualization', action='list' )}";
+ } }
+ ]);
+
+ menu.render();
+ menu.$el.attr("style", "float: right");
+ $("#center .unified-panel-header-inner").append(menu.$el);
+ // Manual tipsy config because default gravity is S and cannot be changed.
+ $(".menu-button").tipsy( {gravity: 'n'} );
+
+ // -- Viz set up. --
+
+ var genome = new Genome(JSON.parse('${ h.to_json_string( genome ) }')),
+ dataset = new HistogramDataset(JSON.parse('${ h.to_json_string( dataset_summary ) }')),
+ circster = new CircsterView({
+ width: 600,
+ height: 600,
+ // Gap is difficult to set because it very dependent on chromosome size and organization.
+ total_gap: 2 * Math.PI * 0.5,
+ genome: genome,
+ dataset: dataset,
+ radius_start: 100,
+ dataset_arc_height: 50
+ });
+
+ // -- Render viz. --
+
+ circster.render();
+ $('#vis').append(circster.$el);
+ });
+ </script>
+</%def>
+
+<%def name="center_panel()">
+ <div class="unified-panel-header" unselectable="on">
+ <div class="unified-panel-header-inner">
+ <div style="float:left;" id="title"></div>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div id="vis" class="unified-panel-body"></div>
+</%def>
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.
1
0