galaxy-commits
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- 15302 discussions
galaxy-dist commit 03b74e3675f0: sample tracking functional tests are fixed
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1287161361 14400
# Node ID 03b74e3675f0344005ad491f74d2fb0aa56cb010
# Parent d4b85e30e56d605edc2236ccba5cde41bda1510a
sample tracking functional tests are fixed
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1540,7 +1540,7 @@ class TwillTestCase( unittest.TestCase )
def add_bar_codes( self, request_id, request_name, bar_codes, samples, strings_displayed_after_submit=[] ):
# We have to simulate the form submission here since twill barfs on the page
# gvk - 9/22/10 - TODO: make sure the mako template produces valid html
- url = "%s/requests_common/manage_request?cntrller=requests_admin&id=%s&edit_samples_button=Edit+samples" % ( self.url, request_id )
+ url = "%s/requests_common/manage_request?cntrller=requests_admin&id=%s&managing_samples=True" % ( self.url, request_id )
for index, field_value in enumerate( bar_codes ):
sample_field_name = "sample_%i_name" % index
sample_field_value = samples[ index ].name.replace( ' ', '+' )
@@ -1551,20 +1551,23 @@ class TwillTestCase( unittest.TestCase )
self.visit_url( url )
for check_str in strings_displayed_after_submit:
self.check_page_for_string( check_str )
- def change_sample_state( self, request_id, request_name, sample_name, sample_id, new_sample_state_id, new_state_name, comment='',
+ def change_sample_state( self, request_id, request_name, sample_names, sample_ids, new_sample_state_id, new_state_name, comment='',
strings_displayed=[], strings_displayed_after_submit=[] ):
# We have to simulate the form submission here since twill barfs on the page
# gvk - 9/22/10 - TODO: make sure the mako template produces valid html
url = "%s/requests_common/manage_request?cntrller=requests_admin&id=%s" % ( self.url, request_id )
- # select_sample_%i=true must be included twice to simulate a CheckboxField checked setting.
- url += "&comment=%s&select_sample_%i=true&select_sample_%i=true&sample_state_id=%i" % ( comment, sample_id, sample_id, new_sample_state_id )
+ url += "&comment=%s&sample_state_id=%s" % ( comment, self.security.encode_id( new_sample_state_id ) )
+ # select_sample_%i=true must be included twice for each sample to simulate a CheckboxField checked setting.
+ for sample_id in sample_ids:
+ url += "&select_sample_%i=true&select_sample_%i=true" % ( sample_id, sample_id )
url += "&sample_operation=Change%20state&refresh=true"
url += "&change_state_button=Save"
self.visit_url( url )
self.check_page_for_string( 'Sequencing Request "%s"' % request_name )
- self.visit_url( "%s/requests_common/sample_events?cntrller=requests_admin&sample_id=%i" % ( self.url, sample_id ) )
- self.check_page_for_string( 'Events for Sample "%s"' % sample_name )
- self.check_page_for_string( new_state_name )
+ for sample_id, sample_name in zip( sample_ids, sample_names ):
+ self.visit_url( "%s/requests_common/sample_events?cntrller=requests_admin&sample_id=%s" % ( self.url, self.security.encode_id( sample_id ) ) )
+ self.check_page_for_string( 'Events for Sample "%s"' % sample_name )
+ self.check_page_for_string( new_state_name )
def add_user_address( self, user_id, address_dict ):
self.home()
self.visit_url( "%s/user/new_address?admin_view=False&user_id=%i" % ( self.url, user_id ) )
--- a/test/functional/test_forms_and_requests.py
+++ b/test/functional/test_forms_and_requests.py
@@ -209,7 +209,7 @@ class TestFormsAndRequests( TwillTestCas
name=name,
desc=desc,
field_value_tuples=field_value_tuples,
- strings_displayed=[ 'Create a new request',
+ strings_displayed=[ 'Create a new sequencing request',
test_field_name1,
test_field_name2,
test_field_name3 ],
@@ -272,8 +272,6 @@ class TestFormsAndRequests( TwillTestCas
def test_040_request_lifecycle( self ):
"""Testing request life-cycle as it goes through all the states"""
# logged in as regular_user1
- """
- TODO: debug this test case...
self.logout()
self.login( email=admin_user.email )
self.check_request_grid( cntrller='requests_admin',
@@ -292,19 +290,18 @@ class TestFormsAndRequests( TwillTestCas
samples=request_one.samples,
strings_displayed_after_submit=strings_displayed_after_submit )
# Change the states of all the samples of this request to ultimately be COMPLETE
- for sample in request_one.samples:
- self.change_sample_state( request_id=self.security.encode_id( request_one.id ),
- request_name=request_one.name,
- sample_name=sample.name,
- sample_id=self.security.encode_id( sample.id ),
- new_sample_state_id=request_type1.states[1].id,
- new_state_name=request_type1.states[1].name )
- self.change_sample_state( request_id=self.security.encode_id( request_one.id ),
- request_name=request_one.name,
- sample_name=sample.name,
- sample_id=self.security.encode_id( sample.id ),
- new_sample_state_id=request_type1.states[2].id,
- new_state_name=request_type1.states[2].name )
+ self.change_sample_state( request_id=self.security.encode_id( request_one.id ),
+ request_name=request_one.name,
+ sample_names=[ sample.name for sample in request_one.samples ],
+ sample_ids=[ sample.id for sample in request_one.samples ],
+ new_sample_state_id=request_type1.states[1].id,
+ new_state_name=request_type1.states[1].name )
+ self.change_sample_state( request_id=self.security.encode_id( request_one.id ),
+ request_name=request_one.name,
+ sample_names=[ sample.name for sample in request_one.samples ],
+ sample_ids=[ sample.id for sample in request_one.samples ],
+ new_sample_state_id=request_type1.states[2].id,
+ new_state_name=request_type1.states[2].name )
refresh( request_one )
self.logout()
self.login( email=regular_user1.email )
@@ -314,7 +311,7 @@ class TestFormsAndRequests( TwillTestCas
strings_displayed=[ request_one.name ] )
assert request_one.state is not request_one.states.COMPLETE, "The state of the request '%s' should be set to '%s'" \
% ( request_one.name, request_one.states.COMPLETE )
- """
+
def test_045_admin_create_request_on_behalf_of_regular_user( self ):
"""Testing creating and submitting a request as an admin on behalf of a regular user"""
# Logged in as regular_user1
@@ -332,7 +329,7 @@ class TestFormsAndRequests( TwillTestCas
name=name,
desc=desc,
field_value_tuples=field_value_tuples,
- strings_displayed=[ 'Create a new request',
+ strings_displayed=[ 'Create a new sequencing request',
test_field_name1,
test_field_name2,
test_field_name3 ],
1
0
galaxy-dist commit 98739e24554c: Fix for setting columns in workflow builder for ColumnListParameter. e.g. allows splitting lists of columns by newlines and commas and strips leading 'c's.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dan Blankenberg <dan(a)bx.psu.edu>
# Date 1287173342 14400
# Node ID 98739e24554c777400732e8a2d8f6c18b2b8768a
# Parent 1f4d6b25a84e785c3feee1733a19ac10877a985b
Fix for setting columns in workflow builder for ColumnListParameter. e.g. allows splitting lists of columns by newlines and commas and strips leading 'c's.
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -562,7 +562,8 @@ class SelectToolParameter( ToolParameter
if value == '':
value = None
else:
- value = value.split( "\n" )
+ if not isinstance( value, list ):
+ value = value.split( "\n" )
return UnvalidatedValue( value )
legal_values = self.get_legal_values( trans, context )
if isinstance( value, list ):
@@ -773,16 +774,30 @@ class ColumnListParameter( SelectToolPar
Label convention prepends column number with a 'c', but tool uses the integer. This
removes the 'c' when entered into a workflow.
"""
- if type( value ) == list:
- # We have a multi-select list
- new_value = []
- for item in value:
- if item.startswith( "c" ):
- item = item[1:]
- new_value.append( item )
- value = new_value
- elif value and value.startswith( "c" ):
- value = value[1:]
+ def _strip_c( column ):
+ column = column.strip().lower()
+ if column.startswith( 'c' ):
+ column = column[1:]
+ return column
+ if self.multiple:
+ #split on newline and ,
+ if value:
+ column_list = []
+ if not isinstance( value, list ):
+ value = value.split( '\n' )
+ for column in value:
+ for column2 in column.split( ',' ):
+ column2 = column2.strip()
+ if column2:
+ column_list.append( column2 )
+ value = map( _strip_c, column_list )
+ else:
+ value = []
+ else:
+ if value:
+ value = _strip_c( value )
+ else:
+ value = None
return super( ColumnListParameter, self ).from_html( value, trans, context )
def get_column_list( self, trans, other_values ):
"""
1
0
galaxy-dist commit e029c860e717: Added tests and more help to mutation visualization tool
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1287517130 14400
# Node ID e029c860e71710d69f725e5c136b7e55fa529a42
# Parent 7c80b7c2aa6aef5fba1b3a08e6426f5c84a125b4
Added tests and more help to mutation visualization tool
--- a/tools/mutation/visualize.xml
+++ b/tools/mutation/visualize.xml
@@ -37,16 +37,42 @@
<outputs><data format="svg" name="out_file1" /></outputs>
+ <tests>
+ <test>
+ <param name="input1" value="mutation_data1.txt" ftype="tabular" />
+ <param name="position_col" value="2" />
+ <param name="ref_col" value="4" />
+ <param name="zoom_value" value="interactive" />
+ <param name="name" value="s1" />
+ <param name="a_col" value="5" />
+ <param name="totals_col" value="9" />
+ <output name="output" file="mutation_data1_interactive.svg" ftype="svg" />
+ </test>
+ <test>
+ <param name="input1" value="mutation_data1.txt" ftype="tabular" />
+ <param name="position_col" value="2" />
+ <param name="ref_col" value="4" />
+ <param name="zoom_value" value="3" />
+ <param name="name" value="s1" />
+ <param name="a_col" value="5" />
+ <param name="totals_col" value="9" />
+ <output name="output" file="mutation_data1_zoom3x.svg" ftype="svg" />
+ </test>
+ </tests><help>
**Example**
-
+This tool allows you to visualize mutations described in a tabular input file. It generates an SVG image which can be viewed in any web browser.
+
Given the input file::
gm blood gm cheek
chrM 72 73 G 26394 4 49 0 26447 26398 1 23389 3 45 0 23437 23392 1
chrM 149 150 T 11 50422 2 96 50531 50435 1 4 45417 1 65 45487 45422 1
+
+You will need to specify the position and reference columns in the input file. Then click on the 'Add new Sample' to add samples in the input file that you would like to visualize. For each sample you select, specify the column for base 'A' and the totals column.
+This tool assumes the columns specifying bases A, C, G, T are placed consecutively and in that order in an input file.
Visualization:
@@ -54,7 +80,7 @@ Visualization:
:width: 150
Interactivity::
- If interactive zoom/pan option is checked then the resultant image can be zoomed in or out: scroll mouse wheel; pan: drag using left mouse button.
+ If interactive zoom option is selected, then the resultant image can be zoomed in or out using the scroll mouse wheel and can be panned by dragging the image using left mouse button.
</help></tool>
--- a/tool_conf.xml.main
+++ b/tool_conf.xml.main
@@ -134,6 +134,7 @@
<tool file="visualization/GMAJ.xml" /><tool file="visualization/build_ucsc_custom_track.xml" /><tool file="maf/vcf_to_maf_customtrack.xml" />
+ <tool file="mutation/visualize.xml" /></section><section name="Regional Variation" id="regVar"><tool file="regVariation/windowSplitter.xml" />
--- a/tools/mutation/visualize.py
+++ b/tools/mutation/visualize.py
@@ -367,7 +367,6 @@ if __name__ == '__main__':
parser.add_option('-z', '--zoom', dest='zoom', action='store', default='1')
parser.add_option('-p', '--position_col', dest='position_col', action='store', default='c0')
parser.add_option('-r', '--ref_col', dest='ref_col', action='store', default='c1')
- #parser.add_option('-n', '--interactive', dest='interactive', action='store_false', default='True')
(opts, args) = parser.parse_args()
mainsvg(opts, args)
sys.exit(1)
1
0
galaxy-dist commit c0feb970e48d: sample tracking bug fixes
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1287000426 14400
# Node ID c0feb970e48de8b713a9a516cad61950ed0641b5
# Parent 77e13329ab8b9e69089400259eb70cda9525ec80
sample tracking bug fixes
--- a/templates/admin/requests/rename_datasets.mako
+++ b/templates/admin/requests/rename_datasets.mako
@@ -3,15 +3,14 @@
<% from galaxy.web.controllers.requests_admin import build_rename_datasets_for_sample_select_field %>
-<br/><br/>
-<font color="red"><b><i>A dataset can be renamed only if its status is "Not Started"</i></b></font>
+<h3>Rename datasets for Sample "${sample.name}"</h3><ul class="manage-table-actions"><li><a class="action-button" href="${h.url_for( controller='requests_admin', action='manage_datasets', sample_id=trans.security.encode_id( sample.id ) )}">Browse datasets</a></li><li>
- <a class="action-button" href="${h.url_for( controller='requests_common', action='manage_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Browse this request</a>
+ <a class="action-button" href="${h.url_for( controller='requests_common', action='manage_request', cntrller='requests_admin', id=trans.security.encode_id( sample.request.id ) )}">Browse this request</a></li></ul>
@@ -19,40 +18,39 @@
${render_msg( message, status )}
%endif
+${render_msg( 'A dataset can be renamed only if it is in <b>Not Started</b> state.', 'warning' )}
<div class="toolForm">
- <div class="toolFormTitle">Rename datasets for Sample "${sample.name}"</div>
- <div class="toolFormBody">
- <form name="rename_datasets" id="rename_datasets" action="${h.url_for( controller='requests_admin', action='rename_datasets', id_list=id_list, sample_id=trans.security.encode_id( sample.id ) )}" method="post" >
- <table class="grid">
- <thead>
- <tr>
- <th>Prepend directory name</th>
- <th>Name</th>
- <th>Path on sequencer</th>
- </tr>
- <thead>
- <tbody>
- %for sample_dataset in sample_datasets:
- %if sample_dataset.status == trans.app.model.Sample.transfer_status.NOT_STARTED:
- <tr>
- <td>
- <% rename_datasets_for_sample_select_field = build_rename_datasets_for_sample_select_field( trans, sample_dataset ) %>
- ${rename_datasets_for_sample_select_field}
- </td>
- <td>
- <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id} )" value="${sample_dataset.name}" size="100"/>
- </td>
- <td>${sample_dataset.file_path}</td>
- </tr>
- %endif
- %endfor
- </tbody>
- </table>
- <br/>
- <div class="form-row">
- <input type="submit" name="rename_datasets_button" value="Save"/>
- <input type="submit" name="cancel_rename_datasets_button" value="Close"/>
- </div>
- </form>
- </div>
+ <form name="rename_datasets" id="rename_datasets" action="${h.url_for( controller='requests_admin', action='rename_datasets', id_list=id_list, sample_id=trans.security.encode_id( sample.id ) )}" method="post" >
+ <table class="grid">
+ <thead>
+ <tr>
+ <th>Prepend directory name</th>
+ <th>Name</th>
+ <th>Path on sequencer</th>
+ </tr>
+ <thead>
+ <tbody>
+ %for id in id_list:
+ <% sample_dataset = trans.sa_session.query( trans.model.SampleDataset ).get( trans.security.decode_id( id ) ) %>
+ %if sample_dataset.status == trans.app.model.Sample.transfer_status.NOT_STARTED:
+ <tr>
+ <td>
+ <% rename_datasets_for_sample_select_field = build_rename_datasets_for_sample_select_field( trans, sample_dataset ) %>
+ ${rename_datasets_for_sample_select_field.get_html()}
+ </td>
+ <td>
+ <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id ) }" value="${sample_dataset.name}" size="100"/>
+ </td>
+ <td>${sample_dataset.file_path}</td>
+ </tr>
+ %endif
+ %endfor
+ </tbody>
+ </table>
+ <br/>
+ <div class="form-row">
+ <input type="submit" name="rename_datasets_button" value="Save"/>
+ <input type="submit" name="cancel_rename_datasets_button" value="Close"/>
+ </div>
+ </form></div>
--- a/lib/galaxy/web/controllers/requests_common.py
+++ b/lib/galaxy/web/controllers/requests_common.py
@@ -105,8 +105,7 @@ class RequestsGrid( grids.Grid ):
class RequestsCommon( BaseController, UsesFormDefinitionWidgets ):
@web.json
- def sample_state_updates( self, trans, ids=None, states=None, cntrller=None ):
- # TODO fix this mthod - cntrller is required in the signature.
+ def sample_state_updates( self, trans, cntrller, ids=None, states=None ):
# Avoid caching
trans.response.headers['Pragma'] = 'no-cache'
trans.response.headers['Expires'] = '0'
@@ -424,13 +423,19 @@ class RequestsCommon( BaseController, Us
except:
invalid_id_redirect( trans, cntrller, folder_id )
for sample_id in selected_samples:
- sample = trans.sa_session.query( trans.model.Sample ).get( sample_id )
+ sample = trans.sa_session.query( trans.model.Sample ).get( trans.security.decode_id( sample_id ) )
sample.library = library
sample.folder = folder
trans.sa_session.add( sample )
trans.sa_session.flush()
trans.sa_session.refresh( request )
message = 'Changes made to the selected samples have been saved. '
+ return trans.response.send_redirect( web.url_for( controller='requests_common',
+ action='manage_request',
+ cntrller=cntrller,
+ id=request_id,
+ status=status,
+ message=message ) )
elif params.get( 'cancel_change_lib_button', False ):
return trans.response.send_redirect( web.url_for( controller='requests_common',
action='manage_request',
@@ -859,7 +864,7 @@ class RequestsCommon( BaseController, Us
# The user has selected a sample to copy.
library_id = current_samples[ copy_sample_index][ 'library_select_field' ].get_selected( return_value=True )
folder_id = current_samples[ copy_sample_index ][ 'folder_select_field' ].get_selected( return_value=True )
- name = current_samples[ copy_sample_index ][ 'name' ] + '_%i' % ( index+1 )
+ name = current_samples[ copy_sample_index ][ 'name' ] + '_%i' % ( len( current_samples ) + 1 )
library_id = 'none'
folder_id = 'none'
field_values = [ val for val in current_samples[ copy_sample_index ][ 'field_values' ] ]
@@ -867,7 +872,7 @@ class RequestsCommon( BaseController, Us
# The user has not selected a sample to copy (may just be adding a sample).
library_id = None
folder_id = None
- name = 'Sample_%i' % ( sample_index+1 )
+ name = 'Sample_%i' % ( len( current_samples ) + 1 )
field_values = [ '' for field in request.type.sample_form.fields ]
# Build the library_select_field and folder_select_field for the new sample being added.
library_select_field, folder_select_field = self.__build_library_and_folder_select_fields( trans,
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -9,11 +9,13 @@ import logging, os, pexpect, ConfigParse
log = logging.getLogger( __name__ )
-class UserColumn( grids.TextColumn ):
- def get_value( self, trans, grid, request ):
- return request.user.email
+
class AdminRequestsGrid( RequestsGrid ):
+ class UserColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, request ):
+ return request.user.email
+ # Grid definition
columns = [ col for col in RequestsGrid.columns ]
columns.append( UserColumn( "User",
model_class=model.User,
@@ -180,7 +182,7 @@ class RequestsAdmin( BaseController, Use
@web.json
def get_file_details( self, trans, id, folder_path ):
def print_ticks( d ):
- # TODO: why is this method here? Add comments!
+ # pexpect timeout method
pass
# Avoid caching
trans.response.headers['Pragma'] = 'no-cache'
@@ -243,16 +245,20 @@ class RequestsAdmin( BaseController, Use
if not sample_dataset_id:
return invalid_id_redirect( trans, 'requests_admin', sample_dataset_id )
id_list = util.listify( sample_dataset_id )
+ selected_sample_datasets = []
+ for sample_dataset_id in id_list:
+ try:
+ selected_sample_datasets.append( trans.sa_session.query( trans.model.SampleDataset ).get( trans.security.decode_id( sample_dataset_id ) ) )
+ except:
+ return invalid_id_redirect( trans, 'requests_admin', sample_dataset_id )
if operation == "view":
- sample_dataset = trans.sa_session.query( trans.model.SampleDataset ).get( trans.security.decode_id( sample_dataset_id ) )
return trans.fill_template( '/admin/requests/dataset.mako',
- sample_dataset=sample_dataset )
+ sample_dataset=selected_sample_datasets[0] )
elif operation == "delete":
not_deleted = []
- for sample_dataset_id in id_list:
- sample_dataset = trans.sa_session.query( trans.model.SampleDataset ).get( trans.security.decode_id( sample_dataset_id ) )
- sample_id = sample_dataset.sample_id
- if sample_dataset.status == sample_dataset.sample.transfer_status.NOT_STARTED:
+ for sample_dataset in selected_sample_datasets:
+ sample_id = sample_dataset.sample.id
+ if sample_dataset.status == trans.app.model.Sample.transfer_status.NOT_STARTED:
trans.sa_session.delete( sample_dataset )
trans.sa_session.flush()
else:
@@ -267,13 +273,26 @@ class RequestsAdmin( BaseController, Use
status=status,
message=message ) )
elif operation == "rename":
- sample_dataset = trans.sa_session.query( trans.model.SampleDataset ).get( trans.security.decode_id( sample_dataset_id ) )
+ # if none of the selected sample datasets are in the NOT_STARTED state,
+ # then display error message
+ flag = True
+ for sd in selected_sample_datasets:
+ if sd.status == trans.app.model.Sample.transfer_status.NOT_STARTED:
+ flag = False
+ break
+ if flag:
+ status = 'error'
+ message = 'A dataset can be renamed only if it is in the <b>Not Started</b> state.'
+ return trans.response.send_redirect( web.url_for( controller='requests_admin',
+ action='manage_datasets',
+ sample_id=trans.security.encode_id( selected_sample_datasets[0].sample.id ),
+ status=status,
+ message=message ) )
return trans.fill_template( '/admin/requests/rename_datasets.mako',
- sample=sample_dataset.sample,
+ sample=selected_sample_datasets[0].sample,
id_list=id_list )
elif operation == "start transfer":
- sample_dataset = trans.sa_session.query( trans.model.SampleDataset ).get( trans.security.decode_id( sample_dataset_id ) )
- self.__start_datatx( trans, sample_dataset.sample, id_list )
+ self.__start_datatx( trans, selected_sample_datasets[0].sample, selected_sample_datasets )
# Render the grid view
sample_id = params.get( 'sample_id', None )
try:
@@ -340,7 +359,7 @@ class RequestsAdmin( BaseController, Use
message = 'Changes saved successfully.'
return trans.fill_template( '/admin/requests/rename_datasets.mako',
sample=sample,
- sample_datasets=sample_datasets,
+ id_list=id_list,
message=message,
status=status )
return trans.response.send_redirect( web.url_for( controller='requests_admin',
@@ -353,38 +372,48 @@ class RequestsAdmin( BaseController, Use
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
request_id = kwd.get( 'request_id', None )
+ files = []
try:
request = trans.sa_session.query( trans.model.Request ).get( trans.security.decode_id( request_id ) )
except:
return invalid_id_redirect( trans, 'requests_admin', request_id )
- files_list = util.listify( params.get( 'files_list', [] ) )
+ selected_files = util.listify( params.get( 'files_list', [] ) )
folder_path = util.restore_text( params.get( 'folder_path', request.type.datatx_info[ 'data_dir' ] ) )
- selected_value = kwd.get( 'sample_id', 'none' )
- sample_id_select_field = self.__build_sample_id_select_field( request, selected_value )
+ selected_sample_id = kwd.get( 'sample_id', 'none' )
+ sample_id_select_field = self.__build_sample_id_select_field( trans, request, selected_sample_id )
# The __get_files() method redirects here with a status of 'error' and a message if there
# was a problem retrieving the files.
if folder_path and status != 'error':
folder_path = self.__check_path( folder_path )
- sample_id = params.get( 'sample_id', None )
- try:
- sample = trans.sa_session.query( trans.model.Sample ).get( trans.security.decode_id( sample_id ) )
- except:
- return invalid_id_redirect( trans, 'requests_admin', sample_id )
- # Get the filenames from the remote host
- files = self.__get_files( trans, request, folder_path )
- if params.get( 'open_folder', False ):
- if len( files_list ) == 1:
- folder_path = os.path.join( folder_path, files_list[0] )
- folder_path = self.__check_path( folder_path )
+ if params.get( 'folder_up', False ):
+ if folder_path[-1] == os.sep:
+ folder_path = os.path.dirname(folder_path[:-1])
+ folder_path = self.__check_path( folder_path )
elif params.get( 'select_show_datasets_button', False ) or params.get( 'select_more_button', False ):
- sample_dataset_file_names = self.__save_sample_datasets( trans, sample, files_list, folder_path )
+ # get the sample these datasets are associated with
+ try:
+ sample = trans.sa_session.query( trans.model.Sample ).get( trans.security.decode_id( selected_sample_id ) )
+ sample.library.id and sample.folder.id
+ except:
+ # if no sample (with associated library & folder) has been selected
+ status = 'error'
+ message = 'Select a sample with associated data library and folder before selecting the dataset(s).'
+ return trans.response.send_redirect( web.url_for( controller='requests_admin',
+ action='get_data',
+ request_id=trans.security.encode_id( request.id ),
+ folder_path=folder_path,
+ status=status,
+ message=message ) )
+ # save the sample datasets
+ sample_dataset_file_names = self.__save_sample_datasets( trans, sample, selected_files, folder_path )
if sample_dataset_file_names:
message = 'Datasets (%s) have been selected for sample (%s)' % \
( str( sample_dataset_file_names )[1:-1].replace( "'", "" ), sample.name )
if params.get( 'select_show_datasets_button', False ):
return trans.response.send_redirect( web.url_for( controller='requests_admin',
action='manage_datasets',
- sample_id=sample_id,
+ request_id=request_id,
+ sample_id=trans.security.encode_id( sample.id ),
message=message,
status=status ) )
else: # 'select_more_button' was clicked
@@ -392,11 +421,13 @@ class RequestsAdmin( BaseController, Use
action='get_data',
request_id=request_id,
folder_path=folder_path,
- sample_id=sample_id,
+ sample_id=sample.id,
open_folder=True,
message=message,
status=status ) )
- return trans.fill_template( '/admin/requests/dataset_transfer.mako',
+ # Get the filenames from the remote host
+ files = self.__get_files( trans, request, folder_path )
+ return trans.fill_template( '/admin/requests/get_data.mako',
cntrller='requests_admin',
request=request,
sample_id_select_field=sample_id_select_field,
@@ -434,20 +465,20 @@ class RequestsAdmin( BaseController, Use
if ok:
return output.splitlines()
return trans.response.send_redirect( web.url_for( controller='requests_admin',
- action='get_data',
- request_id=trans.security.encode_id( request.id ),
- folder_path=folder_path,
- status=status,
- message=message ) )
+ action='get_data',
+ request_id=trans.security.encode_id( request.id ),
+ folder_path=folder_path,
+ status=status,
+ message=message ) )
def __check_path( self, a_path ):
# Return a valid folder_path
if a_path and not a_path.endswith( os.sep ):
a_path += os.sep
return a_path
- def __save_sample_datasets( self, trans, sample, files_list, folder_path ):
+ def __save_sample_datasets( self, trans, sample, selected_files, folder_path ):
sample_dataset_file_names = []
- if files_list:
- for f in files_list:
+ if selected_files:
+ for f in selected_files:
filepath = os.path.join( folder_path, f )
if f[-1] == os.sep:
# FIXME: The selected item is a folder so transfer all the folder contents
@@ -522,7 +553,7 @@ class RequestsAdmin( BaseController, Use
trans.sa_session.add( lfp )
trans.sa_session.flush()
return datatx_user
- def __send_message( self, trans, datatx_info, sample, id_list ):
+ def __send_message( self, trans, datatx_info, sample, selected_sample_datasets ):
"""Ceates an xml message and sends it to the rabbitmq server"""
# Create the xml message based on the following template
xml = \
@@ -542,8 +573,7 @@ class RequestsAdmin( BaseController, Use
<file>%(FILE)s</file></dataset>'''
datasets = ''
- for id in id_list:
- sample_dataset = trans.sa_session.query( trans.model.SampleDataset ).get( trans.security.decode_id( id ) )
+ for sample_dataset in selected_sample_datasets:
if sample_dataset.status == sample.transfer_status.NOT_STARTED:
datasets = datasets + dataset_xml % dict( ID=str( sample_dataset.id ),
NAME=sample_dataset.name,
@@ -574,7 +604,7 @@ class RequestsAdmin( BaseController, Use
routing_key=trans.app.config.amqp['routing_key'] )
chan.close()
conn.close()
- def __start_datatx( self, trans, sample, id_list ):
+ def __start_datatx( self, trans, sample, selected_sample_datasets ):
datatx_user = self.__setup_datatx_user( trans, sample.library, sample.folder )
# Validate sequencer information
datatx_info = sample.request.type.datatx_info
@@ -582,8 +612,8 @@ class RequestsAdmin( BaseController, Use
message = "Error in sequencer login information."
status = "error"
else:
- self.__send_message( trans, datatx_info, sample, id_list )
- message = "%i datasets have been queued for transfer from the sequencer. Click the Refresh button above to see the latest transfer status." % len( id_list )
+ self.__send_message( trans, datatx_info, sample, selected_sample_datasets )
+ message = "%i datasets have been queued for transfer from the sequencer. Click the Refresh button above to see the latest transfer status." % len( selected_sample_datasets )
status = "done"
return trans.response.send_redirect( web.url_for( controller='requests_admin',
action='manage_datasets',
@@ -599,6 +629,14 @@ class RequestsAdmin( BaseController, Use
obj_id = kwd.get( 'id', None )
if operation == "view_form_definition":
return self.view_form_definition( trans, **kwd )
+ elif operation == "view":
+ return self.view_request_type( trans, **kwd )
+ elif operation == "delete":
+ return self.delete_request_type( trans, **kwd )
+ elif operation == "undelete":
+ return self.undelete_request_type( trans, **kwd )
+ elif operation == "permissions":
+ return self.request_type_permissions( trans, **kwd )
# Render the grid view
return self.requesttype_grid( trans, **kwd )
@web.expose
@@ -655,26 +693,26 @@ class RequestsAdmin( BaseController, Use
message=message,
status=status )
def __create_request_type_form( self, trans, **kwd ):
- request_form_definitionss = self.get_all_forms( trans,
+ request_form_definitions = self.get_all_forms( trans,
filter=dict( deleted=False ),
form_type=trans.model.FormDefinition.types.REQUEST )
sample_form_definitions = self.get_all_forms( trans,
filter=dict( deleted=False ),
form_type=trans.model.FormDefinition.types.SAMPLE )
- if not request_form_definitionss or not sample_form_definitions:
+ if not request_form_definitions or not sample_form_definitions:
return [],[]
params = util.Params( kwd )
request_form_id = params.get( 'request_form_id', 'none' )
sample_form_id = params.get( 'sample_form_id', 'none' )
request_form_id_select_field = build_select_field( trans,
- objs=request_form_definitionss,
- label_attr='id',
+ objs=request_form_definitions,
+ label_attr='name',
select_field_name='request_form_id',
selected_value=request_form_id,
refresh_on_change=False )
sample_form_id_select_field = build_select_field( trans,
objs=sample_form_definitions,
- label_attr='id',
+ label_attr='name',
select_field_name='sample_form_id',
selected_value=sample_form_id,
refresh_on_change=False )
@@ -826,7 +864,7 @@ class RequestsAdmin( BaseController, Use
status=status,
message=message )
# ===== Methods for building SelectFields used on various admin_requests forms
- def __build_sample_id_select_field( self, request, selected_value ):
+ def __build_sample_id_select_field( self, trans, request, selected_value ):
return build_select_field( trans, request.samples, 'name', 'sample_id', selected_value=selected_value, refresh_on_change=False )
def __build_rename_dataset_select_field( self, trans, request_type=None ):
if request_type:
--- a/templates/admin/requests/get_data.mako
+++ b/templates/admin/requests/get_data.mako
@@ -68,13 +68,6 @@
}
</script>
-<style type="text/css">
-.msg_head {
- padding: 0px 0px;
- cursor: pointer;
-}
-</style>
-
<br/><br/><ul class="manage-table-actions">
@@ -92,7 +85,7 @@
<div class="toolForm"><div class="toolFormTitle">Select files for transfer</div>
- <form name="get_data" id="get_data" action="${h.url_for( controller='requests_admin', action='get_data', cntrller=cntrller, request_id=trans.security.encode_id( request.id )}" method="post" >
+ <form name="get_data" id="get_data" action="${h.url_for( controller='requests_admin', action='get_data', cntrller=cntrller, request_id=trans.security.encode_id( request.id ))}" method="post" ><div class="form-row"><label>Sample:</label>
${sample_id_select_field.get_html()}
--- a/templates/requests/common/manage_request.mako
+++ b/templates/requests/common/manage_request.mako
@@ -62,7 +62,7 @@
// Build request data
var ids = []
var states = []
- $.each( sample_states, function ( id, state ) {
+ $.each( sample_states, function ( id, state, cntrller ) {
ids.push( id );
states.push( state );
});
@@ -73,7 +73,7 @@
dataType: "json",
data: { ids: ids.join( "," ), states: states.join( "," ) },
success : function ( data ) {
- $.each( data, function(id, val, cntrller ) {
+ $.each( data, function( cntrller, id, val ) {
// Replace HTML
var cell1 = $("#sampleState-" + id);
cell1.html( val.html_state );
@@ -146,8 +146,6 @@
</div><br/><br/>
-<font color="red"><b><i>A dataset can be renamed only if its status is "Not Started"</i></b></font>
-
<ul class="manage-table-actions"><li><a class="action-button" id="seqreq-${request.id}-popup" class="menubutton">Sequencing Request Actions</a></li><div popupmenu="seqreq-${request.id}-popup">
1
0
galaxy-dist commit 76f09e5ccb85: sample tracking UI fixes
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1287002139 14400
# Node ID 76f09e5ccb85569b56e66676e4c761f4348336fc
# Parent c0feb970e48de8b713a9a516cad61950ed0641b5
sample tracking UI fixes
--- a/templates/requests/common/manage_request.mako
+++ b/templates/requests/common/manage_request.mako
@@ -132,38 +132,38 @@
<div class="grid-header"><h2>Sequencing Request "${request.name}"</h2>
+
+ <ul class="manage-table-actions">
+ <li><a class="action-button" id="seqreq-${request.id}-popup" class="menubutton">Sequencing Request Actions</a></li>
+ <div popupmenu="seqreq-${request.id}-popup">
+ %if request.is_unsubmitted and request.samples:
+ <a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests_common', action='submit_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Submit</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='requests_common', action='request_events', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">History</a>
+ <a class="action-button" href="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Edit</a>
+ %if is_admin:
+ %if request.is_submitted:
+ <a class="action-button" href="${h.url_for( controller='requests_admin', action='reject', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Reject</a>
+ <a class="action-button" href="${h.url_for( controller='requests_admin', action='get_data', request_id=trans.security.encode_id( request.id ) )}">Select datasets to transfer</a>
+ %endif
+ %endif
+ </div>
+ <li><a class="action-button" href="${h.url_for( controller=cntrller, action='browse_requests' )}">Browse requests</a></li>
+ </ul>
+
<div class="toolParamHelp" style="clear: both;">
- <b>Sequencer</b>: ${request.type.name}
- %if is_admin:
- | <b>User</b>: ${request.user.email}
- %endif
- %if request.is_submitted:
- | <b>State</b>: <i>${request.state}</i>
- %else:
- | <b>State</b>: ${request.state}
- %endif
+ <b>Sequencer</b>: ${request.type.name}
+ %if is_admin:
+ | <b>User</b>: ${request.user.email}
+ %endif
+ %if request.is_submitted:
+ | <b>State</b>: <i>${request.state}</i>
+ %else:
+ | <b>State</b>: ${request.state}
+ %endif
</div></div>
-<br/><br/>
-<ul class="manage-table-actions">
- <li><a class="action-button" id="seqreq-${request.id}-popup" class="menubutton">Sequencing Request Actions</a></li>
- <div popupmenu="seqreq-${request.id}-popup">
- %if request.is_unsubmitted and request.samples:
- <a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests_common', action='submit_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Submit</a>
- %endif
- <a class="action-button" href="${h.url_for( controller='requests_common', action='request_events', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">History</a>
- <a class="action-button" href="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Edit</a>
- %if is_admin:
- %if request.is_submitted:
- <a class="action-button" href="${h.url_for( controller='requests_admin', action='reject', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Reject</a>
- <a class="action-button" href="${h.url_for( controller='requests_admin', action='get_data', request_id=trans.security.encode_id( request.id ) )}">Select datasets to transfer</a>
- %endif
- %endif
- </div>
- <li><a class="action-button" href="${h.url_for( controller=cntrller, action='browse_requests' )}">Browse requests</a></li>
-</ul>
-
%if request.has_samples_without_library_destinations:
${render_msg( "Select a target data library and folder for all the samples before starting the sequence run", "warning" )}
%endif
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -393,7 +393,8 @@ class RequestsAdmin( BaseController, Use
# get the sample these datasets are associated with
try:
sample = trans.sa_session.query( trans.model.Sample ).get( trans.security.decode_id( selected_sample_id ) )
- sample.library.id and sample.folder.id
+ if sample.name in sample.request.has_samples_without_library_destinations:
+ raise Exception()
except:
# if no sample (with associated library & folder) has been selected
status = 'error'
1
0
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1287030296 14400
# Node ID c8173a50bc9bdb0c8e07807c1b73be746557647f
# Parent 4d5b00b6fe741a35320a572302d1fb8bb7eb6971
sample_tracking fixes
--- a/templates/requests/common/sample_datasets.mako
+++ b/templates/requests/common/sample_datasets.mako
@@ -1,5 +1,5 @@
-<%def name="render_sample_datasets( cntrller, sample )">
- <a href="${h.url_for( controller='requests_common', action='view_dataset_transfer', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${sample.transferred_dataset_files} / ${len( sample.datasets )}</a>
+<%def name="render_sample_datasets( sample )">
+ ${sample.transferred_dataset_files} / ${len( sample.datasets )}
</%def>
-${render_sample_datasets( cntrller, sample )}
+${render_sample_datasets( sample )}
--- a/test/functional/test_forms_and_requests.py
+++ b/test/functional/test_forms_and_requests.py
@@ -160,8 +160,8 @@ class TestFormsAndRequests( TwillTestCas
name = 'Test Requestype'
self.create_request_type( name,
"test sequencer configuration",
- str( request_form.id ),
- str( sample_form.id ),
+ self.security.encode_id( request_form.id ),
+ self.security.encode_id( sample_form.id ),
sample_states,
strings_displayed=[ 'Create a new sequencer configuration' ],
strings_displayed_after_submit=[ "Sequencer configuration (%s) has been created" % name ] )
--- a/lib/galaxy/web/controllers/requests_common.py
+++ b/lib/galaxy/web/controllers/requests_common.py
@@ -88,7 +88,7 @@ class RequestsGrid( grids.Grid ):
StateColumn( "State",
key='state',
filterable="advanced",
- link=( lambda item: iff( item.deleted, None, dict( operation="events", id=item.id ) ) )
+ link=( lambda item: iff( item.deleted, None, dict( operation="request_events", id=item.id ) ) )
)
]
columns.append( grids.MulticolFilterColumn( "Search",
@@ -105,7 +105,7 @@ class RequestsGrid( grids.Grid ):
class RequestsCommon( BaseController, UsesFormDefinitionWidgets ):
@web.json
- def sample_state_updates( self, trans, cntrller, ids=None, states=None ):
+ def sample_state_updates( self, trans, ids=None, states=None ):
# Avoid caching
trans.response.headers['Pragma'] = 'no-cache'
trans.response.headers['Expires'] = '0'
@@ -120,12 +120,10 @@ class RequestsCommon( BaseController, Us
rval[ id ] = { "state": sample.state.name,
"datasets": len( sample.datasets ),
"html_state": unicode( trans.fill_template( "requests/common/sample_state.mako",
- sample=sample,
- cntrller=cntrller ),
+ sample=sample),
'utf-8' ),
"html_datasets": unicode( trans.fill_template( "requests/common/sample_datasets.mako",
- sample=sample,
- cntrller=cntrller ),
+ sample=sample ),
'utf-8' ) }
return rval
@web.expose
@@ -865,8 +863,6 @@ class RequestsCommon( BaseController, Us
library_id = current_samples[ copy_sample_index][ 'library_select_field' ].get_selected( return_value=True )
folder_id = current_samples[ copy_sample_index ][ 'folder_select_field' ].get_selected( return_value=True )
name = current_samples[ copy_sample_index ][ 'name' ] + '_%i' % ( len( current_samples ) + 1 )
- library_id = 'none'
- folder_id = 'none'
field_values = [ val for val in current_samples[ copy_sample_index ][ 'field_values' ] ]
else:
# The user has not selected a sample to copy (may just be adding a sample).
--- a/lib/galaxy/web/controllers/requests.py
+++ b/lib/galaxy/web/controllers/requests.py
@@ -52,6 +52,12 @@ class Requests( BaseController ):
action='undelete_request',
cntrller='requests',
**kwd ) )
+ if operation == "request_events":
+ return trans.response.send_redirect( web.url_for( controller='requests_common',
+ action='request_events',
+ cntrller='requests',
+ **kwd ) )
+
# If there are requests that have been rejected, show a message as a reminder to the user
rejected = 0
for request in trans.sa_session.query( trans.app.model.Request ) \
--- a/templates/admin/requests/view_request_type.mako
+++ b/templates/admin/requests/view_request_type.mako
@@ -11,7 +11,7 @@
<div class="toolForm"><div class="toolFormTitle">Sequencer configuration information</div>
- <form name="view_request_type" action="${h.url_for( controller='requests_admin', action='create_request_type', rt_id=request_type.id)}" method="post" >
+ <form name="view_request_type" action="${h.url_for( controller='requests_admin', action='create_request_type', rt_id=trans.security.encode_id( request_type.id ))}" method="post" ><div class="form-row"><label>Name</label>
${request_type.name}
--- a/templates/requests/common/manage_request.mako
+++ b/templates/requests/common/manage_request.mako
@@ -62,7 +62,7 @@
// Build request data
var ids = []
var states = []
- $.each( sample_states, function ( id, state, cntrller ) {
+ $.each( sample_states, function ( id, state ) {
ids.push( id );
states.push( state );
});
@@ -73,7 +73,7 @@
dataType: "json",
data: { ids: ids.join( "," ), states: states.join( "," ) },
success : function ( data ) {
- $.each( data, function( cntrller, id, val ) {
+ $.each( data, function( id, val ) {
// Replace HTML
var cell1 = $("#sampleState-" + id);
cell1.html( val.html_state );
@@ -140,7 +140,6 @@
<a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests_common', action='submit_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Submit</a>
%endif
<a class="action-button" href="${h.url_for( controller='requests_common', action='request_events', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">History</a>
- <a class="action-button" href="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Edit</a>
%if is_admin:
%if request.is_submitted:
<a class="action-button" href="${h.url_for( controller='requests_admin', action='reject', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Reject</a>
@@ -178,6 +177,13 @@
<h4><img src="/static/images/fugue/toggle-expand.png" alt="Show" onclick="showContent(this);" style="cursor:pointer;"/> Request Information</h4><div style="display:none;">
+ <div class="form-row">
+ <ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Edit request informaton</a>
+ </li>
+ </ul>
+ </div><table class="grid" border="0"><tbody><tr>
@@ -452,7 +458,7 @@
%if sample.request.is_unsubmitted:
<td>Unsubmitted</td>
%else:
- <td id="sampleState-${sample.id}">${render_sample_state( cntrller, sample )}</td>
+ <td><a id="sampleState-${sample.id}" href="${h.url_for( controller='requests_common', action='sample_events', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${render_sample_state( sample )}</a></td>
%endif
%if info['library']:
%if cntrller == 'requests':
@@ -469,9 +475,9 @@
<td></td>
%endif
%if request.is_submitted or request.is_complete:
- <td id="sampleDatasets-${sample.id}">
- ${render_sample_datasets( cntrller, sample )}
- </td>
+ <td><a id="sampleDatasets-${sample.id}" href="${h.url_for( controller='requests_common', action='view_dataset_transfer', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">
+ ${render_sample_datasets( sample )}
+ </a></td>
%endif
%else:
${show_basic_info_form( sample_index, sample, info )}
--- a/templates/requests/common/sample_state.mako
+++ b/templates/requests/common/sample_state.mako
@@ -1,5 +1,5 @@
-<%def name="render_sample_state( cntrller, sample )">
- <a href="${h.url_for( controller='requests_common', action='sample_events', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${sample.state.name}</a>
+<%def name="render_sample_state( sample )">
+ ${sample.state.name}
</%def>
-${render_sample_state( cntrller, sample )}
+${render_sample_state( sample )}
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -163,6 +163,11 @@ class RequestsAdmin( BaseController, Use
action='manage_request',
cntrller='requests_admin',
**kwd ) )
+ if operation == "request_events":
+ return trans.response.send_redirect( web.url_for( controller='requests_common',
+ action='request_events',
+ cntrller='requests_admin',
+ **kwd ) )
if operation == "reject":
return self.reject_request( trans, **kwd )
if operation == "view_type":
@@ -423,7 +428,6 @@ class RequestsAdmin( BaseController, Use
request_id=request_id,
folder_path=folder_path,
sample_id=sample.id,
- open_folder=True,
message=message,
status=status ) )
# Get the filenames from the remote host
@@ -590,21 +594,31 @@ class RequestsAdmin( BaseController, Use
FOLDER_ID=str(sample.folder.id),
DATASETS=datasets )
# Send the message
- conn = amqp.Connection( host=trans.app.config.amqp['host'] + ":" + trans.app.config.amqp['port'],
- userid=trans.app.config.amqp['userid'],
- password=trans.app.config.amqp['password'],
- virtual_host=trans.app.config.amqp['virtual_host'],
- insist=False )
- chan = conn.channel()
- msg = amqp.Message( data.replace( '\n', '' ).replace( '\r', '' ),
- content_type='text/plain',
- application_headers={'msg_type': 'data_transfer'} )
- msg.properties["delivery_mode"] = 2
- chan.basic_publish( msg,
- exchange=trans.app.config.amqp['exchange'],
- routing_key=trans.app.config.amqp['routing_key'] )
- chan.close()
- conn.close()
+ try:
+ conn = amqp.Connection( host=trans.app.config.amqp['host'] + ":" + trans.app.config.amqp['port'],
+ userid=trans.app.config.amqp['userid'],
+ password=trans.app.config.amqp['password'],
+ virtual_host=trans.app.config.amqp['virtual_host'],
+ insist=False )
+ chan = conn.channel()
+ msg = amqp.Message( data.replace( '\n', '' ).replace( '\r', '' ),
+ content_type='text/plain',
+ application_headers={'msg_type': 'data_transfer'} )
+ msg.properties["delivery_mode"] = 2
+ chan.basic_publish( msg,
+ exchange=trans.app.config.amqp['exchange'],
+ routing_key=trans.app.config.amqp['routing_key'] )
+ chan.close()
+ conn.close()
+ except Exception, e:
+ message = "Error in sending the data transfer message to the Galaxy AMQP message queue:<br/>%s" % str(e)
+ status = "error"
+ return trans.response.send_redirect( web.url_for( controller='requests_admin',
+ action='manage_datasets',
+ sample_id=trans.security.encode_id( sample.id ),
+ status=status,
+ message=message) )
+
def __start_datatx( self, trans, sample, selected_sample_datasets ):
datatx_user = self.__setup_datatx_user( trans, sample.library, sample.folder )
# Validate sequencer information
1
0
galaxy-dist commit 9f172e4713ed: Support query anchored and HTML output
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User peterjc <p.j.a.cock(a)googlemail.com>
# Date 1286796719 -3600
# Node ID 9f172e4713edbf4d6a22f10ad01867710cce6b00
# Parent d8da4f7bb0f5e1d43b371e4e52fb688ad816e5bf
Support query anchored and HTML output
--- a/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml
@@ -15,7 +15,7 @@ blastn
$adv_opts.filter_query
$adv_opts.strand
-out $output1
--outfmt $out_format
+$out_format
-num_threads 8
## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string
## Note -max_target_seqs overrides -num_descriptions and -num_alignments
@@ -60,11 +60,16 @@ blastn
</param><param name="evalue_cutoff" type="float" size="15" value="0.001" label="set expectation value cutoff" /><param name="out_format" type="select" label="Output format">
- <option value="6">Tabular</option>
- <option value="5">BLAST XML</option>
- <option value="0">Pairwise text</option>
+ <option value="-outfmt 6" selected="True">Tabular</option>
+ <option value="-outfmt 5">BLAST XML</option>
+ <option value="-outfmt 0">Pairwise text</option>
+ <option value="-outfmt 0 -html">Pairwise HTML</option>
+ <option value="-outfmt 2">Query-anchored text</option>
+ <option value="-outfmt 2 -html">Query-anchored HTML</option>
+ <option value="-outfmt 4">Flat query-anchored text</option>
+ <option value="-outfmt 4 -html">Flat query-anchored HTML</option><!--
- <option value="11">BLAST archive format (ASN.1)</option>
+ <option value="-outfmt 11">BLAST archive format (ASN.1)</option>
--></param><conditional name="adv_opts">
@@ -102,10 +107,13 @@ blastn
<outputs><data name="output1" format="tabular" label="${blast_type.value_label} on ${db_opts.db_opts_selector}"><change_format>
- <when input="out_format" value="0" format="txt"/>
- </change_format>
- <change_format>
- <when input="out_format" value="5" format="blastxml"/>
+ <when input="out_format" value="-outfmt 0" format="txt"/>
+ <when input="out_format" value="-outfmt 0 -html" format="html"/>
+ <when input="out_format" value="-outfmt 2" format="txt"/>
+ <when input="out_format" value="-outfmt 2 -html" format="html"/>
+ <when input="out_format" value="-outfmt 4" format="txt"/>
+ <when input="out_format" value="-outfmt 4 -html" format="html"/>
+ <when input="out_format" value="-outfmt 5" format="blastxml"/></change_format></data></outputs>
@@ -147,7 +155,7 @@ Algorithms include blastn, megablast, an
**Output format**
-The default output of this tool is tabular, containing 12 columns:
+Because Galaxy focuses on processing tabular data, the default output of this tool is tabular. This contains 12 columns:
1. Id of your sequence
2. GI of the database hit
@@ -162,6 +170,14 @@ 10. End position in database hit
11. E-value
12. Bit score
+The second option is BLAST XML output, which is designed to be parsed by another program, and is understood by other Galaxy tools.
+
+You can also choose several plain text or HTML output formats which are designed to be read by a person (not by another program).
+The HTML versions use basic webpage formatting and can include links to the hits on the NCBI website.
+The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
+The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
+and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).
+
-------
**References**
--- a/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml
@@ -15,7 +15,7 @@ blastp
$adv_opts.filter_query
$adv_opts.matrix
-out $output1
--outfmt $out_format
+$out_format
-num_threads 8
## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string
## Note -max_target_seqs overrides -num_descriptions and -num_alignments
@@ -55,11 +55,16 @@ blastp
</param><param name="evalue_cutoff" type="float" size="15" value="0.001" label="set expectation value cutoff" /><param name="out_format" type="select" label="Output format">
- <option value="6">Tabular</option>
- <option value="5">BLAST XML</option>
- <option value="0">Pairwise text</option>
+ <option value="-outfmt 6" selected="True">Tabular</option>
+ <option value="-outfmt 5">BLAST XML</option>
+ <option value="-outfmt 0">Pairwise text</option>
+ <option value="-outfmt 0 -html">Pairwise HTML</option>
+ <option value="-outfmt 2">Query-anchored text</option>
+ <option value="-outfmt 2 -html">Query-anchored HTML</option>
+ <option value="-outfmt 4">Flat query-anchored text</option>
+ <option value="-outfmt 4 -html">Flat query-anchored HTML</option><!--
- <option value="11">BLAST archive format (ASN.1)</option>
+ <option value="-outfmt 11">BLAST archive format (ASN.1)</option>
--></param><conditional name="adv_opts">
@@ -110,10 +115,13 @@ blastp
<outputs><data name="output1" format="tabular" label="${blast_type.value_label} on ${db_opts.db_opts_selector}"><change_format>
- <when input="out_format" value="0" format="txt"/>
- </change_format>
- <change_format>
- <when input="out_format" value="5" format="blastxml"/>
+ <when input="out_format" value="-outfmt 0" format="txt"/>
+ <when input="out_format" value="-outfmt 0 -html" format="html"/>
+ <when input="out_format" value="-outfmt 2" format="txt"/>
+ <when input="out_format" value="-outfmt 2 -html" format="html"/>
+ <when input="out_format" value="-outfmt 4" format="txt"/>
+ <when input="out_format" value="-outfmt 4 -html" format="html"/>
+ <when input="out_format" value="-outfmt 5" format="blastxml"/></change_format></data></outputs>
@@ -140,7 +148,7 @@ using the NCBI BLAST+ blastp command lin
**Output format**
-The default output of this tool is tabular, containing 12 columns:
+Because Galaxy focuses on processing tabular data, the default output of this tool is tabular. This contains 12 columns:
1. Id of your sequence
2. GI of the database hit
@@ -155,6 +163,14 @@ 10. End position in database hit
11. E-value
12. Bit score
+The second option is BLAST XML output, which is designed to be parsed by another program, and is understood by other Galaxy tools.
+
+You can also choose several plain text or HTML output formats which are designed to be read by a person (not by another program).
+The HTML versions use basic webpage formatting and can include links to the hits on the NCBI website.
+The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
+The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
+and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).
+
-------
**References**
--- a/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml
@@ -15,7 +15,7 @@ tblastx
$adv_opts.strand
$adv_opts.matrix
-out $output1
--outfmt $out_format
+$out_format
-num_threads 8
## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string
## Note -max_target_seqs overrides -num_descriptions and -num_alignments
@@ -49,11 +49,16 @@ tblastx
</conditional><param name="evalue_cutoff" type="float" size="15" value="0.001" label="set expectation value cutoff" /><param name="out_format" type="select" label="Output format">
- <option value="6">Tabular</option>
- <option value="5">BLAST XML</option>
- <option value="0">Pairwise text</option>
+ <option value="-outfmt 6" selected="True">Tabular</option>
+ <option value="-outfmt 5">BLAST XML</option>
+ <option value="-outfmt 0">Pairwise text</option>
+ <option value="-outfmt 0 -html">Pairwise HTML</option>
+ <option value="-outfmt 2">Query-anchored text</option>
+ <option value="-outfmt 2 -html">Query-anchored HTML</option>
+ <option value="-outfmt 4">Flat query-anchored text</option>
+ <option value="-outfmt 4 -html">Flat query-anchored HTML</option><!--
- <option value="11">BLAST archive format (ASN.1)</option>
+ <option value="-outfmt 11">BLAST archive format (ASN.1)</option>
--></param><conditional name="adv_opts">
@@ -100,10 +105,13 @@ tblastx
<outputs><data name="output1" format="tabular" label="tblastx on ${db_opts.db_opts_selector}"><change_format>
- <when input="out_format" value="0" format="txt"/>
- </change_format>
- <change_format>
- <when input="out_format" value="5" format="blastxml"/>
+ <when input="out_format" value="-outfmt 0" format="txt"/>
+ <when input="out_format" value="-outfmt 0 -html" format="html"/>
+ <when input="out_format" value="-outfmt 2" format="txt"/>
+ <when input="out_format" value="-outfmt 2 -html" format="html"/>
+ <when input="out_format" value="-outfmt 4" format="txt"/>
+ <when input="out_format" value="-outfmt 4 -html" format="html"/>
+ <when input="out_format" value="-outfmt 5" format="blastxml"/></change_format></data></outputs>
@@ -122,7 +130,7 @@ tblastx
--><param name="evalue_cutoff" value="10.0" /><param name="filter_query" value="yes" />
- <param name="out_format" value="6" />
+ <param name="out_format" value="-outfmt 6" /><output name="output1" file="megablast_wrapper_test1.out"/></test></tests>
@@ -143,7 +151,7 @@ using the NCBI BLAST+ tblastx command li
**Output format**
-The default output of this tool is tabular, containing 12 columns:
+Because Galaxy focuses on processing tabular data, the default output of this tool is tabular. This contains 12 columns:
1. Id of your sequence
2. GI of the database hit
@@ -158,6 +166,14 @@ 10. End position in database hit
11. E-value
12. Bit score
+The second option is BLAST XML output, which is designed to be parsed by another program, and is understood by other Galaxy tools.
+
+You can also choose several plain text or HTML output formats which are designed to be read by a person (not by another program).
+The HTML versions use basic webpage formatting and can include links to the hits on the NCBI website.
+The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
+The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
+and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).
+
-------
**References**
--- a/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml
@@ -15,7 +15,7 @@ blastx
$adv_opts.strand
$adv_opts.matrix
-out $output1
--outfmt $out_format
+$out_format
-num_threads 8
## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string
## Note -max_target_seqs overrides -num_descriptions and -num_alignments
@@ -50,11 +50,16 @@ blastx
</conditional><param name="evalue_cutoff" type="float" size="15" value="0.001" label="set expectation value cutoff" /><param name="out_format" type="select" label="Output format">
- <option value="6">Tabular</option>
- <option value="5">BLAST XML</option>
- <option value="0">Pairwise text</option>
+ <option value="-outfmt 6" selected="True">Tabular</option>
+ <option value="-outfmt 5">BLAST XML</option>
+ <option value="-outfmt 0">Pairwise text</option>
+ <option value="-outfmt 0 -html">Pairwise HTML</option>
+ <option value="-outfmt 2">Query-anchored text</option>
+ <option value="-outfmt 2 -html">Query-anchored HTML</option>
+ <option value="-outfmt 4">Flat query-anchored text</option>
+ <option value="-outfmt 4 -html">Flat query-anchored HTML</option><!--
- <option value="11">BLAST archive format (ASN.1)</option>
+ <option value="-outfmt 11">BLAST archive format (ASN.1)</option>
--></param><conditional name="adv_opts">
@@ -103,10 +108,13 @@ blastx
<outputs><data name="output1" format="tabular" label="blastx on ${db_opts.db_opts_selector}"><change_format>
- <when input="out_format" value="0" format="txt"/>
- </change_format>
- <change_format>
- <when input="out_format" value="5" format="blastxml"/>
+ <when input="out_format" value="-outfmt 0" format="txt"/>
+ <when input="out_format" value="-outfmt 0 -html" format="html"/>
+ <when input="out_format" value="-outfmt 2" format="txt"/>
+ <when input="out_format" value="-outfmt 2 -html" format="html"/>
+ <when input="out_format" value="-outfmt 4" format="txt"/>
+ <when input="out_format" value="-outfmt 4 -html" format="html"/>
+ <when input="out_format" value="-outfmt 5" format="blastxml"/></change_format></data></outputs>
@@ -133,7 +141,7 @@ using the NCBI BLAST+ blastx command lin
**Output format**
-The default output of this tool is tabular, containing 12 columns:
+Because Galaxy focuses on processing tabular data, the default output of this tool is tabular. This contains 12 columns:
1. Id of your sequence
2. GI of the database hit
@@ -148,6 +156,14 @@ 10. End position in database hit
11. E-value
12. Bit score
+The second option is BLAST XML output, which is designed to be parsed by another program, and is understood by other Galaxy tools.
+
+You can also choose several plain text or HTML output formats which are designed to be read by a person (not by another program).
+The HTML versions use basic webpage formatting and can include links to the hits on the NCBI website.
+The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
+The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
+and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).
+
-------
**References**
--- a/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml
@@ -14,7 +14,7 @@ tblastn
$adv_opts.filter_query
$adv_opts.matrix
-out $output1
--outfmt $out_format
+$out_format
-num_threads 8
## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string
## Note -max_target_seqs overrides -num_descriptions and -num_alignments
@@ -50,11 +50,16 @@ tblastn
</conditional><param name="evalue_cutoff" type="float" size="15" value="0.001" label="set expectation value cutoff" /><param name="out_format" type="select" label="Output format">
- <option value="6">Tabular</option>
- <option value="5">BLAST XML</option>
- <option value="0">Pairwise text</option>
+ <option value="-outfmt 6" selected="True">Tabular</option>
+ <option value="-outfmt 5">BLAST XML</option>
+ <option value="-outfmt 0">Pairwise text</option>
+ <option value="-outfmt 0 -html">Pairwise HTML</option>
+ <option value="-outfmt 2">Query-anchored text</option>
+ <option value="-outfmt 2 -html">Query-anchored HTML</option>
+ <option value="-outfmt 4">Flat query-anchored text</option>
+ <option value="-outfmt 4 -html">Flat query-anchored HTML</option><!--
- <option value="11">BLAST archive format (ASN.1)</option>
+ <option value="-outfmt 11">BLAST archive format (ASN.1)</option>
--></param><conditional name="adv_opts">
@@ -105,10 +110,13 @@ tblastn
<outputs><data name="output1" format="tabular" label="tblastn on ${db_opts.db_opts_selector}"><change_format>
- <when input="out_format" value="0" format="txt"/>
- </change_format>
- <change_format>
- <when input="out_format" value="5" format="blastxml"/>
+ <when input="out_format" value="-outfmt 0" format="txt"/>
+ <when input="out_format" value="-outfmt 0 -html" format="html"/>
+ <when input="out_format" value="-outfmt 2" format="txt"/>
+ <when input="out_format" value="-outfmt 2 -html" format="html"/>
+ <when input="out_format" value="-outfmt 4" format="txt"/>
+ <when input="out_format" value="-outfmt 4 -html" format="html"/>
+ <when input="out_format" value="-outfmt 5" format="blastxml"/></change_format></data></outputs>
@@ -135,7 +143,7 @@ using the NCBI BLAST+ tblastn command li
**Output format**
-The default output of this tool is tabular, containing 12 columns:
+Because Galaxy focuses on processing tabular data, the default output of this tool is tabular. This contains 12 columns:
1. Id of your sequence
2. GI of the database hit
@@ -150,6 +158,14 @@ 10. End position in database hit
11. E-value
12. Bit score
+The second option is BLAST XML output, which is designed to be parsed by another program, and is understood by other Galaxy tools.
+
+You can also choose several plain text or HTML output formats which are designed to be read by a person (not by another program).
+The HTML versions use basic webpage formatting and can include links to the hits on the NCBI website.
+The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
+The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
+and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).
+
-------
**References**
1
0
galaxy-dist commit 77e13329ab8b: No longer try to display Image type (including PDF) datasets within browser. Clicking on eye icon for binary and image types will now invoke save action.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1286945049 14400
# Node ID 77e13329ab8b9e69089400259eb70cda9525ec80
# Parent 9f172e4713edbf4d6a22f10ad01867710cce6b00
No longer try to display Image type (including PDF) datasets within browser. Clicking on eye icon for binary and image types will now invoke save action.
--- a/lib/galaxy/web/controllers/dataset.py
+++ b/lib/galaxy/web/controllers/dataset.py
@@ -324,56 +324,56 @@ class DatasetInterface( BaseController,
if not data:
raise paste.httpexceptions.HTTPRequestRangeNotSatisfiable( "Invalid reference dataset id: %s." % str( dataset_id ) )
current_user_roles = trans.get_current_user_roles()
- if trans.app.security_agent.can_access_dataset( current_user_roles, data.dataset ):
- if data.state == trans.model.Dataset.states.UPLOAD:
- return trans.show_error_message( "Please wait until this dataset finishes uploading before attempting to view it." )
+ if not trans.app.security_agent.can_access_dataset( current_user_roles, data.dataset ):
+ return trans.show_error_message( "You are not allowed to access this dataset" )
+
+ if data.state == trans.model.Dataset.states.UPLOAD:
+ return trans.show_error_message( "Please wait until this dataset finishes uploading before attempting to view it." )
+
+ if filename and filename != "index":
+ # For files in extra_files_path
+ file_path = os.path.join( data.extra_files_path, filename )
+ if os.path.exists( file_path ):
+ mime, encoding = mimetypes.guess_type( file_path )
+ if not mime:
+ try:
+ mime = trans.app.datatypes_registry.get_mimetype_by_extension( ".".split( file_path )[-1] )
+ except:
+ mime = "text/plain"
- if filename and filename != "index":
- # For files in extra_files_path
- file_path = os.path.join( data.extra_files_path, filename )
- if os.path.exists( file_path ):
- mime, encoding = mimetypes.guess_type( file_path )
- if not mime:
- try:
- mime = trans.app.datatypes_registry.get_mimetype_by_extension( ".".split( file_path )[-1] )
- except:
- mime = "text/plain"
-
- trans.response.set_content_type( mime )
- return open( file_path )
- else:
- return "Could not find '%s' on the extra files path %s." % (filename,file_path)
-
- mime = trans.app.datatypes_registry.get_mimetype_by_extension( data.extension.lower() )
- trans.response.set_content_type(mime)
- trans.log_event( "Display dataset id: %s" % str( dataset_id ) )
-
- if to_ext: # Saving the file
- if data.ext in composite_extensions:
- return self.archive_composite_dataset( trans, data, **kwd )
- else:
- trans.response.headers['Content-Length'] = int( os.stat( data.file_name ).st_size )
- if to_ext[0] != ".":
- to_ext = "." + to_ext
- valid_chars = '.,^_-()[]0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
- fname = data.name
- fname = ''.join(c in valid_chars and c or '_' for c in fname)[0:150]
- trans.response.headers["Content-Disposition"] = "attachment; filename=Galaxy%s-[%s]%s" % (data.hid, fname, to_ext)
- return open( data.file_name )
- if os.path.exists( data.file_name ):
- max_peek_size = 1000000 # 1 MB
- if preview and (not isinstance(data.datatype, datatypes.binary.Binary)) and os.stat( data.file_name ).st_size > max_peek_size:
- trans.response.set_content_type( "text/html" )
- return trans.stream_template_mako( "/dataset/large_file.mako",
- truncated_data = open( data.file_name ).read(max_peek_size),
- data = data )
- else:
- return open( data.file_name )
+ trans.response.set_content_type( mime )
+ return open( file_path )
else:
- raise paste.httpexceptions.HTTPNotFound( "File Not Found (%s)." % data.file_name )
+ return "Could not find '%s' on the extra files path %s." % (filename,file_path)
+
+ mime = trans.app.datatypes_registry.get_mimetype_by_extension( data.extension.lower() )
+ trans.response.set_content_type(mime)
+ trans.log_event( "Display dataset id: %s" % str( dataset_id ) )
+
+ if to_ext or isinstance(data.datatype, datatypes.binary.Binary) or isinstance(data.datatype, datatypes.images.Image): # Saving the file, or binary/image file
+ if data.extension in composite_extensions:
+ return self.archive_composite_dataset( trans, data, **kwd )
+ else:
+ trans.response.headers['Content-Length'] = int( os.stat( data.file_name ).st_size )
+ if not to_ext:
+ to_ext = data.extension
+ valid_chars = '.,^_-()[]0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ fname = data.name
+ fname = ''.join(c in valid_chars and c or '_' for c in fname)[0:150]
+ trans.response.headers["Content-Disposition"] = "attachment; filename=Galaxy%s-[%s].%s" % (data.hid, fname, to_ext)
+ return open( data.file_name )
+ if not os.path.exists( data.file_name ):
+ raise paste.httpexceptions.HTTPNotFound( "File Not Found (%s)." % data.file_name )
+
+ max_peek_size = 1000000 # 1 MB
+ if preview and os.stat( data.file_name ).st_size > max_peek_size:
+ trans.response.set_content_type( "text/html" )
+ return trans.stream_template_mako( "/dataset/large_file.mako",
+ truncated_data = open( data.file_name ).read(max_peek_size),
+ data = data )
else:
- return trans.show_error_message( "You are not allowed to access this dataset" )
-
+ return open( data.file_name )
+
@web.expose
@web.require_login( "see all available datasets" )
def list( self, trans, **kwargs ):
1
0
galaxy-dist commit d8da4f7bb0f5: Add -ungapped for blastn and blastx (having trouble with blastp and tblastn, not in tblastx)
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User peterjc <p.j.a.cock(a)googlemail.com>
# Date 1286554738 -3600
# Node ID d8da4f7bb0f5e1d43b371e4e52fb688ad816e5bf
# Parent 8979b429d7691f4121afb368a05e6b9d0ea40706
Add -ungapped for blastn and blastx (having trouble with blastp and tblastn, not in tblastx)
--- a/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml
@@ -25,6 +25,7 @@ blastn
#if (str($adv_opts.word_size) and int(str($adv_opts.word_size)) > 0):
-word_size $adv_opts.word_size
#end if
+$adv_opts.ungapped
</command><inputs><param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/>
@@ -76,6 +77,7 @@ blastn
<param name="strand" type="hidden" value="" /><param name="max_hits" type="hidden" value="" /><param name="word_size" type="hidden" value="" />
+ <param name="ungapped" type="hidden" value="" /></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'level window linker' -->
@@ -93,6 +95,7 @@ blastn
<param name="word_size" type="integer" value="0" label="Word size for wordfinder algorithm" help="Use zero for default, otherwise minimum 4."><validator type="in_range" min="0" /></param>
+ <param name="ungapped" type="boolean" label="Perform ungapped alignment only?" truevalue="-ungapped" falsevalue="" checked="false" /></when></conditional></inputs>
--- a/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml
@@ -25,6 +25,8 @@ blastp
#if (str($adv_opts.word_size) and int(str($adv_opts.word_size)) > 0):
-word_size $adv_opts.word_size
#end if
+##Ungapped disabled for now - see comments below
+##$adv_opts.ungapped
</command><inputs><param name="query" type="data" format="fasta" label="Protein query sequence(s)"/>
@@ -70,6 +72,10 @@ blastp
<param name="matrix" type="hidden" value="" /><param name="max_hits" type="hidden" value="" /><param name="word_size" type="hidden" value="" />
+ <!--
+ Ungapped disabled for now, see comments below
+ <param name="ungapped" type="hidden" value="" />
+ --></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' -->
@@ -92,6 +98,12 @@ blastp
<param name="word_size" type="integer" value="0" label="Word size for wordfinder algorithm" help="Use zero for default, otherwise minimum 2."><validator type="in_range" min="0" /></param>
+ <!--
+ Can't use '-ungapped' on its own, error back is:
+ Composition-adjusted searched are not supported with an ungapped search, please add -comp_based_stats F or do a gapped search
+ Tried using '-ungapped -comp_based_stats F' and blastp crashed with 'Attempt to access NULL pointer.'
+ <param name="ungapped" type="boolean" label="Perform ungapped alignment only?" truevalue="-ungapped -comp_based_stats F" falsevalue="" checked="false" />
+ --></when></conditional></inputs>
--- a/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml
@@ -25,6 +25,7 @@ blastx
#if (str($adv_opts.word_size) and int(str($adv_opts.word_size)) > 0):
-word_size $adv_opts.word_size
#end if
+$adv_opts.ungapped
</command><inputs><param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/>
@@ -67,6 +68,7 @@ blastx
<param name="matrix" type="hidden" value="" /><param name="max_hits" type="hidden" value="" /><param name="word_size" type="hidden" value="" />
+ <param name="ungapped" type="hidden" value="" /></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' -->
@@ -94,6 +96,7 @@ blastx
<param name="word_size" type="integer" value="0" label="Word size for wordfinder algorithm" help="Use zero for default, otherwise minimum 2."><validator type="in_range" min="0" /></param>
+ <param name="ungapped" type="boolean" label="Perform ungapped alignment only?" truevalue="-ungapped" falsevalue="" checked="false" /></when></conditional></inputs>
--- a/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml
+++ b/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml
@@ -24,6 +24,8 @@ tblastn
#if (str($adv_opts.word_size) and int(str($adv_opts.word_size)) > 0):
-word_size $adv_opts.word_size
#end if
+##Ungapped disabled for now - see comments below
+##$adv_opts.ungapped
</command><inputs><param name="query" type="data" format="fasta" label="Protein query sequence(s)"/>
@@ -65,6 +67,10 @@ tblastn
<param name="matrix" type="hidden" value="" /><param name="max_hits" type="hidden" value="" /><param name="word_size" type="hidden" value="" />
+ <!--
+ Ungapped disabled for now, see comments below
+ <param name="ungapped" type="hidden" value="" />
+ --></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' -->
@@ -87,6 +93,12 @@ tblastn
<param name="word_size" type="integer" value="0" label="Word size for wordfinder algorithm" help="Use zero for default, otherwise minimum 2."><validator type="in_range" min="0" /></param>
+ <!--
+ Can't use '-ungapped' on its own, error back is:
+ Composition-adjusted searched are not supported with an ungapped search, please add -comp_based_stats F or do a gapped search
+ Tried using '-ungapped -comp_based_stats F' and tblastn crashed with 'Attempt to access NULL pointer.'
+ <param name="ungapped" type="boolean" label="Perform ungapped alignment only?" truevalue="-ungapped -comp_based_stats F" falsevalue="" checked="false" />
+ --></when></conditional></inputs>
1
0
galaxy-dist commit 4d5b00b6fe74: Show Image type datasets inline in browser
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1287007951 14400
# Node ID 4d5b00b6fe741a35320a572302d1fb8bb7eb6971
# Parent 5f4ad373807158f8b2ac0bcaafab9f57b972e562
Show Image type datasets inline in browser
--- a/lib/galaxy/web/controllers/dataset.py
+++ b/lib/galaxy/web/controllers/dataset.py
@@ -350,7 +350,7 @@ class DatasetInterface( BaseController,
trans.response.set_content_type(mime)
trans.log_event( "Display dataset id: %s" % str( dataset_id ) )
- if to_ext or isinstance(data.datatype, datatypes.binary.Binary) or isinstance(data.datatype, datatypes.images.Image): # Saving the file, or binary/image file
+ if to_ext or isinstance(data.datatype, datatypes.binary.Binary): # Saving the file, or binary file
if data.extension in composite_extensions:
return self.archive_composite_dataset( trans, data, **kwd )
else:
@@ -366,13 +366,13 @@ class DatasetInterface( BaseController,
raise paste.httpexceptions.HTTPNotFound( "File Not Found (%s)." % data.file_name )
max_peek_size = 1000000 # 1 MB
- if preview and os.stat( data.file_name ).st_size > max_peek_size:
+ if not preview or isinstance(data.datatype, datatypes.images.Image) or os.stat( data.file_name ).st_size < max_peek_size:
+ return open( data.file_name )
+ else:
trans.response.set_content_type( "text/html" )
return trans.stream_template_mako( "/dataset/large_file.mako",
truncated_data = open( data.file_name ).read(max_peek_size),
data = data )
- else:
- return open( data.file_name )
@web.expose
@web.require_login( "see all available datasets" )
1
0