galaxy-dev
Threads by month
- ----- 2025 -----
- 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
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- 10008 discussions

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/c81a9407c7a8
changeset: 2941:c81a9407c7a8
user: rc
date: Mon Nov 02 16:12:31 2009 -0500
description:
Fixed the functional test to create new user as admin
diffstat:
test/base/twilltestcase.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r cd0596754ff1 -r c81a9407c7a8 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Mon Nov 02 13:30:17 2009 -0500
+++ b/test/base/twilltestcase.py Mon Nov 02 16:12:31 2009 -0500
@@ -922,7 +922,7 @@
def create_new_account_as_admin( self, email='test4(a)bx.psu.edu', password='testuser' ):
"""Create a new account for another user"""
self.home()
- self.visit_url( "%s/admin/create_new_user?email=%s&password=%s&confirm=%s&user_create_button=Create&subscribe=False" \
+ self.visit_url( "%s/user/create?admin_view=True&email=%s&password=%s&confirm=%s&create_user_button=Submit&subscribe=False" \
% ( self.url, email, password, password ) )
try:
self.check_page_for_string( "Created new user account" )
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/cd0596754ff1
changeset: 2940:cd0596754ff1
user: rc
date: Mon Nov 02 13:30:17 2009 -0500
description:
User information forms first pass.
- added a foreign key in the galaxy_user table to the form_values table
- separate user info page for viewing/editing user info
- user addresses added to user info page
diffstat:
lib/galaxy/model/__init__.py | 18 +-
lib/galaxy/model/mapping.py | 3 +
lib/galaxy/model/migrate/versions/0025_user_info.py | 62 ++
lib/galaxy/web/controllers/admin.py | 42 +-
lib/galaxy/web/controllers/library_common.py | 3 +-
lib/galaxy/web/controllers/user.py | 604 ++++++++++++++++++++-----
lib/galaxy/web/form_builder.py | 19 +
lib/galaxy/web/framework/helpers/grids.py | 3 +-
templates/admin/user/grid.mako | 2 +-
templates/user/edit_address.mako | 33 +
templates/user/index.mako | 5 +-
templates/user/info.mako | 161 ++++++
templates/user/permissions.mako | 8 +-
templates/user/register.mako | 87 +++
test/base/twilltestcase.py | 105 +++-
test/functional/test_forms_and_requests.py | 39 +-
test/functional/test_user_info.py | 149 ++++++
17 files changed, 1134 insertions(+), 209 deletions(-)
diffs (1702 lines):
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py Mon Nov 02 09:54:18 2009 -0500
+++ b/lib/galaxy/model/__init__.py Mon Nov 02 13:30:17 2009 -0500
@@ -1098,7 +1098,8 @@
class FormDefinition( object ):
types = Bunch( REQUEST = 'Sequencing Request Form',
SAMPLE = 'Sequencing Sample Form',
- LIBRARY_INFO_TEMPLATE = 'Library information template' )
+ LIBRARY_INFO_TEMPLATE = 'Library information template',
+ USER_INFO = 'User Information' )
def __init__(self, name=None, desc=None, fields=[],
form_definition_current=None, form_type=None, layout=None):
self.name = name
@@ -1203,21 +1204,6 @@
self.folder = folder
self.state = state
self.samples_list = []
- def add_sample(self, sample_name=None, sample_desc=None, sample_values=None):
- # create a form_values row
- values = trans.app.model.FormValues(self.type.sample_form, sample_values)
- values.flush()
- sample = Sample(sample_name, sample_desc, self, values)
- sample.flush()
- # set the initial state
- state = self.type.states[0]
- event = SampleEvent(sample, state)
- event.flush()
- # add this sample to the member array
- self.samples_list.append(sample)
- return sample
- def delete_sample(self, sample_name):
- pass
def has_sample(self, sample_name):
for s in self.samples:
if s.name == sample_name:
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/model/mapping.py
--- a/lib/galaxy/model/mapping.py Mon Nov 02 09:54:18 2009 -0500
+++ b/lib/galaxy/model/mapping.py Mon Nov 02 13:30:17 2009 -0500
@@ -47,6 +47,7 @@
Column( "username", TrimmedString( 255 ), index=True, unique=True ),
Column( "password", TrimmedString( 40 ), nullable=False ),
Column( "external", Boolean, default=False ),
+ Column( "form_values_id", Integer, ForeignKey( "form_values.id" ), index=True ),
Column( "deleted", Boolean, index=True, default=False ),
Column( "purged", Boolean, index=True, default=False ) )
@@ -781,6 +782,8 @@
_preferences=relation( UserPreference, backref="user", collection_class=attribute_mapped_collection('name')),
# addresses=relation( UserAddress,
# primaryjoin=( User.table.c.id == UserAddress.table.c.user_id ) )
+ values=relation( FormValues,
+ primaryjoin=( User.table.c.form_values_id == FormValues.table.c.id ) ),
) )
# Set up proxy so that this syntax is possible:
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/model/migrate/versions/0025_user_info.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/galaxy/model/migrate/versions/0025_user_info.py Mon Nov 02 13:30:17 2009 -0500
@@ -0,0 +1,62 @@
+"""
+This script adds a foreign key to the form_values table in the galaxy_user table
+"""
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from sqlalchemy.exceptions import *
+from migrate import *
+from migrate.changeset import *
+import datetime
+now = datetime.datetime.utcnow
+import sys, logging
+# Need our custom types, but don't import anything else from model
+from galaxy.model.custom_types import *
+
+log = logging.getLogger( __name__ )
+log.setLevel(logging.DEBUG)
+handler = logging.StreamHandler( sys.stdout )
+format = "%(name)s %(levelname)s %(asctime)s %(message)s"
+formatter = logging.Formatter( format )
+handler.setFormatter( formatter )
+log.addHandler( handler )
+
+metadata = MetaData( migrate_engine )
+db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) )
+
+def display_migration_details():
+ print "========================================"
+ print "This script adds a foreign key to the form_values table in the galaxy_user table"
+ print "========================================"
+def upgrade():
+ display_migration_details()
+ # Load existing tables
+ metadata.reflect()
+ try:
+ User_table = Table( "galaxy_user", metadata, autoload=True )
+ except NoSuchTableError:
+ User_table = None
+ log.debug( "Failed loading table galaxy_user" )
+ if User_table:
+ try:
+ col = Column( "form_values_id", Integer, index=True )
+ col.create( User_table )
+ assert col is User_table.c.form_values_id
+ except Exception, e:
+ log.debug( "Adding column 'form_values_id' to galaxy_user table failed: %s" % ( str( e ) ) )
+ try:
+ FormValues_table = Table( "form_values", metadata, autoload=True )
+ except NoSuchTableError:
+ FormValues_table = None
+ log.debug( "Failed loading table form_values" )
+ # Add 1 foreign key constraint to the form_values table
+ if User_table and FormValues_table:
+ try:
+ cons = ForeignKeyConstraint( [User_table.c.form_values_id],
+ [FormValues_table.c.id],
+ name='user_form_values_id_fk' )
+ # Create the constraint
+ cons.create()
+ except Exception, e:
+ log.debug( "Adding foreign key constraint 'user_form_values_id_fk' to table 'galaxy_user' failed: %s" % ( str( e ) ) )
+def downgrade():
+ pass
\ No newline at end of file
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Mon Nov 02 09:54:18 2009 -0500
+++ b/lib/galaxy/web/controllers/admin.py Mon Nov 02 13:30:17 2009 -0500
@@ -41,7 +41,7 @@
model_class = model.User
template='/admin/user/grid.mako'
columns = [
- EmailColumn( "Email", link=( lambda item: dict( operation="user", id=item.id ) ), attach_popup=True ),
+ EmailColumn( "Email", link=( lambda item: dict( operation="information", id=item.id ) ), attach_popup=True ),
UserNameColumn( "User Name", attach_popup=False ),
GroupsColumn( "Groups", attach_popup=False ),
RolesColumn( "Roles", attach_popup=False ),
@@ -51,13 +51,15 @@
grids.GridColumn( "Deleted", key="deleted", visible=False )
]
operations = [
- grids.GridOperation( "reset_password", condition=( lambda item: not item.deleted ), allow_multiple=True )
+ grids.GridOperation( "Manage Roles & Groups", condition=( lambda item: not item.deleted ), allow_multiple=False )
+
]
#TODO: enhance to account for trans.app.config.allow_user_deletion here so that we can eliminate these operations if
# the setting is False
- operations.append( grids.GridOperation( "delete", condition=( lambda item: not item.deleted ), allow_multiple=True ) )
- operations.append( grids.GridOperation( "undelete", condition=( lambda item: item.deleted ), allow_multiple=True ) )
- operations.append( grids.GridOperation( "purge", condition=( lambda item: item.deleted ), allow_multiple=True ) )
+ operations.append( grids.GridOperation( "Reset Password", condition=( lambda item: not item.deleted ), allow_multiple=True, allow_popup=False ) )
+ operations.append( grids.GridOperation( "Delete", condition=( lambda item: not item.deleted ), allow_multiple=True ) )
+ operations.append( grids.GridOperation( "Undelete", condition=( lambda item: item.deleted ), allow_multiple=True ) )
+ operations.append( grids.GridOperation( "Purge", condition=( lambda item: item.deleted ), allow_multiple=True ) )
standard_filters = [
grids.GridColumnFilter( "Active", args=dict( deleted=False ) ),
grids.GridColumnFilter( "Deleted", args=dict( deleted=True ) ),
@@ -530,6 +532,9 @@
@web.expose
@web.require_admin
def create_new_user( self, trans, **kwargs ):
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='create',
+ admin_view='True' ) )
email = ''
password = ''
confirm = ''
@@ -731,9 +736,9 @@
def users( self, trans, **kwargs ):
if 'operation' in kwargs:
operation = kwargs['operation'].lower()
- if operation == "user":
+ if operation == "roles":
return self.user( trans, **kwargs )
- if operation == "reset_password":
+ if operation == "reset password":
return self.reset_user_password( trans, **kwargs )
if operation == "delete":
return self.mark_user_deleted( trans, **kwargs )
@@ -743,10 +748,33 @@
return self.purge_user( trans, **kwargs )
if operation == "create":
return self.create_new_user( trans, **kwargs )
+ if operation == "information":
+ return self.user_info( trans, **kwargs )
# Render the list view
return self.user_list_grid( trans, **kwargs )
@web.expose
@web.require_admin
+ def user_info( self, trans, **kwd ):
+ '''
+ This method displays the user information page which consists of login
+ information, public username, reset password & other user information
+ obtained during registration
+ '''
+ print 'KWD', kwd
+ user_id = kwd.get( 'id', None )
+ if not user_id:
+ message += "Invalid user id (%s) received" % str( user_id )
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='users',
+ message=util.sanitize_text( message ),
+ status='error' ) )
+ user = get_user( trans, user_id )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=True ) )
+ @web.expose
+ @web.require_admin
def user( self, trans, **kwd ):
user_id = kwd.get( 'id', None )
message = ''
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/web/controllers/library_common.py
--- a/lib/galaxy/web/controllers/library_common.py Mon Nov 02 09:54:18 2009 -0500
+++ b/lib/galaxy/web/controllers/library_common.py Mon Nov 02 13:30:17 2009 -0500
@@ -242,7 +242,8 @@
trans.response.send_redirect( web.url_for( controller='forms',
action='new',
msg=msg,
- messagetype='done' ) )
+ messagetype='done',
+ form_type=trans.app.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE ) )
if params.get( 'add_info_template_button', False ):
form = trans.sa_session.query( trans.app.model.FormDefinition ).get( int( kwd[ 'form_id' ] ) )
#fields = list( copy.deepcopy( form.fields ) )
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/web/controllers/user.py
--- a/lib/galaxy/web/controllers/user.py Mon Nov 02 09:54:18 2009 -0500
+++ b/lib/galaxy/web/controllers/user.py Mon Nov 02 13:30:17 2009 -0500
@@ -6,6 +6,9 @@
from galaxy import util
import logging, os, string, re
from random import choice
+from galaxy.web.controllers.forms import get_all_forms
+from galaxy.web.form_builder import *
+from galaxy.web.controllers import admin
log = logging.getLogger( __name__ )
@@ -23,10 +26,11 @@
VALID_USERNAME_RE = re.compile( "^[a-z0-9\-]+$" )
class User( BaseController ):
- edit_address_id = None
+
@web.expose
def index( self, trans, **kwd ):
return trans.fill_template( '/user/index.mako', user=trans.get_user() )
+
@web.expose
def change_password(self, trans, old_pass='', new_pass='', conf_pass='', **kwd):
old_pass_err = new_pass_err = conf_pass_err = ''
@@ -158,50 +162,392 @@
msg += ' <a href="%s">Click here</a> to return to the login page.' % web.url_for( controller='user', action='login' )
return trans.show_ok_message( msg, refresh_frames=refresh_frames )
@web.expose
- def create( self, trans, email='', password='', confirm='', subscribe=False ):
+ def create( self, trans, **kwd ):
+ params = util.Params( kwd )
+ email = util.restore_text( params.get('email', '') )
+ username = util.restore_text( params.get('username', '') )
+ password = util.restore_text( params.get('password', '') )
+ confirm = util.restore_text( params.get('confirm', '') )
+ subscribe = params.get('subscribe', False)
+ admin_view = params.get('admin_view', 'False')
+ msg = util.restore_text( params.get( 'msg', '' ) )
+ messagetype = params.get( 'messagetype', 'done' )
if trans.app.config.require_login:
refresh_frames = [ 'masthead', 'history', 'tools' ]
else:
refresh_frames = [ 'masthead', 'history' ]
if not trans.app.config.allow_user_creation and not trans.user_is_admin():
return trans.show_error_message( 'User registration is disabled. Please contact your Galaxy administrator for an account.' )
- email_error = password_error = confirm_error = None
- if email:
- if len( email ) == 0 or "@" not in email or "." not in email:
- email_error = "Please enter a real email address"
- elif len( email ) > 255:
- email_error = "Email address exceeds maximum allowable length"
- elif trans.sa_session.query( trans.app.model.User ).filter_by( email=email ).all():
- email_error = "User with that email already exists"
- elif len( password ) < 6:
- password_error = "Please use a password of at least 6 characters"
- elif password != confirm:
- confirm_error = "Passwords do not match"
- else:
- user = trans.app.model.User( email=email )
- user.set_password_cleartext( password )
- user.flush()
- trans.app.security_agent.create_private_user_role( user )
- # We set default user permissions, before we log in and set the default history permissions
- trans.app.security_agent.user_set_default_permissions( user, default_access_private = trans.app.config.new_user_dataset_access_role_default_private )
+ #
+ # Create the user, save all the user info and login to Galaxy
+ #
+ if params.get('create_user_button', None) == "Submit":
+ # check email and password validity
+ error = self.__validate(trans, params, email, password, confirm)
+ if error:
+ kwd[ 'msg' ] = error
+ kwd[ 'messagetype' ] = 'error'
+ kwd[ 'create_user_button' ] = None
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='create',
+ **kwd ) )
+ # all the values are valid
+ user = trans.app.model.User( email=email )
+ user.set_password_cleartext( password )
+ user.username = username
+ user.flush()
+ trans.app.security_agent.create_private_user_role( user )
+ # We set default user permissions, before we log in and set the default history permissions
+ trans.app.security_agent.user_set_default_permissions( user, default_access_private = trans.app.config.new_user_dataset_access_role_default_private )
+ # save user info
+ self.__save_user_info(trans, user, action='create', new_user=True, **kwd)
+ if subscribe:
+ mail = os.popen("%s -t" % trans.app.config.sendmail_path, 'w')
+ mail.write("To: %s\nFrom: %s\nSubject: Join Mailing List\n\nJoin Mailing list." % (trans.app.config.mailing_join_addr,email) )
+ if mail.close():
+ return trans.show_warn_message( "Now logged in as " + user.email+". However, subscribing to the mailing list has failed.", refresh_frames=refresh_frames )
+ if admin_view == 'False':
# The handle_user_login() method has a call to the history_set_default_permissions() method
# (needed when logging in with a history), user needs to have default permissions set before logging in
trans.handle_user_login( user )
trans.log_event( "User created a new account" )
trans.log_event( "User logged in" )
- #subscribe user to email list
- if subscribe:
- mail = os.popen("%s -t" % trans.app.config.sendmail_path, 'w')
- mail.write("To: %s\nFrom: %s\nSubject: Join Mailing List\n\nJoin Mailing list." % (trans.app.config.mailing_join_addr,email) )
- if mail.close():
- return trans.show_warn_message( "Now logged in as " + user.email+". However, subscribing to the mailing list has failed.", refresh_frames=refresh_frames )
+ # subscribe user to email list
return trans.show_ok_message( "Now logged in as " + user.email, refresh_frames=refresh_frames )
- return trans.show_form(
- web.FormBuilder( web.url_for(), "Create account", submit_text="Create" )
- .add_text( "email", "Email address", value=email, error=email_error )
- .add_password( "password", "Password", value='', error=password_error )
- .add_password( "confirm", "Confirm password", value='', error=confirm_error )
- .add_input( "checkbox","Subscribe To Mailing List","subscribe", value='subscribe' ) )
+ else:
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='users',
+ message='Created new user account (%s)' % user.email,
+ status='done' ) )
+ else:
+ #
+ # Show the user registration form
+ #
+ user_info_select, user_info_form, login_info, widgets = self.__user_info_ui(trans, **kwd)
+ return trans.fill_template( '/user/register.mako',
+ user_info_select=user_info_select,
+ user_info_form=user_info_form, widgets=widgets,
+ login_info=login_info, admin_view=admin_view,
+ msg=msg, messagetype=messagetype)
+
+ def __save_user_info(self, trans, user, action, new_user=True, **kwd):
+ '''
+ This method saves the user information for new users as well as editing user
+ info for existing users. For new users, the user info form is retrieved from
+ the one that user has selected. And for existing users, the user info form is
+ retrieved from the db.
+ '''
+ params = util.Params( kwd )
+ # get all the user information forms
+ user_info_forms = get_all_forms( trans, filter=dict(deleted=False),
+ form_type=trans.app.model.FormDefinition.types.USER_INFO )
+ # if there are no user forms available then there is nothing to save
+ if not len( user_info_forms ):
+ return
+ if new_user:
+ user_info_type = params.get( 'user_info_select', 'none' )
+ try:
+ user_info_form = trans.sa_session.query( trans.app.model.FormDefinition ).get(int(user_info_type))
+ except:
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action=action,
+ msg='Invalid user information form id',
+ messagetype='error') )
+ else:
+ user_info_form = user.values.form_definition
+ values = []
+ for index, field in enumerate(user_info_form.fields):
+ if field['type'] == 'AddressField':
+ value = util.restore_text(params.get('field_%i' % index, ''))
+ if value == 'new':
+ # save this new address in the list of this user's addresses
+ user_address = trans.app.model.UserAddress( user=user )
+ user_address.desc = util.restore_text(params.get('field_%i_short_desc' % index, ''))
+ user_address.name = util.restore_text(params.get('field_%i_name' % index, ''))
+ user_address.institution = util.restore_text(params.get('field_%i_institution' % index, ''))
+ user_address.address = util.restore_text(params.get('field_%i_address1' % index, ''))+' '+util.restore_text(params.get('field_%i_address2' % index, ''))
+ user_address.city = util.restore_text(params.get('field_%i_city' % index, ''))
+ user_address.state = util.restore_text(params.get('field_%i_state' % index, ''))
+ user_address.postal_code = util.restore_text(params.get('field_%i_postal_code' % index, ''))
+ user_address.country = util.restore_text(params.get('field_%i_country' % index, ''))
+ user_address.phone = util.restore_text(params.get('field_%i_phone' % index, ''))
+ user_address.flush()
+ trans.user.refresh()
+ values.append(int(user_address.id))
+ elif value == unicode('none'):
+ values.append('')
+ else:
+ values.append(int(value))
+ else:
+ values.append(util.restore_text(params.get('field_%i' % index, '')))
+ if new_user:
+ form_values = trans.app.model.FormValues(user_info_form, values)
+ form_values.flush()
+ user.values = form_values
+ else: # editing the user info of an existing user
+ user.values.content = values
+ user.values.flush()
+ user.flush()
+ def __validate_email(self, trans, params, email, user=None):
+ error = None
+ if user:
+ if user.email == email:
+ return None
+ if len(email) == 0 or "@" not in email or "." not in email:
+ error = "Please enter a real email address"
+ elif len(email) > 255:
+ error = "Email address exceeds maximum allowable length"
+ elif trans.sa_session.query( trans.app.model.User ).filter_by(email=email).all():
+ error = "User with that email already exists"
+ return error
+ def __validate_password(self, trans, params, password, confirm):
+ error = None
+ if len(password) < 6:
+ error = "Please use a password of at least 6 characters"
+ elif password != confirm:
+ error = "Passwords do not match"
+ return error
+
+ def __validate(self, trans, params, email, password, confirm):
+ error = self.__validate_email(trans, params, email)
+ if error:
+ return error
+ error = self.__validate_password(trans, params, password, confirm)
+ if error:
+ return error
+ if len(get_all_forms( trans,
+ filter=dict(deleted=False),
+ form_type=trans.app.model.FormDefinition.types.USER_INFO )):
+ if params.get('user_info_select', 'none') == 'none':
+ return 'Select the user type and the user information'
+ return None
+
+ def __user_info_ui(self, trans, user=None, **kwd):
+ '''
+ This method creates the user type select box & user information form widgets
+ and is called during user registration and editing user information.
+ If there exists only one user information form then show it after main
+ login info. However, if there are more than one user info forms then
+ show a selectbox containing all the forms, then the user can select
+ the one that fits the user's description the most
+ '''
+ params = util.Params( kwd )
+ # get all the user information forms
+ user_info_forms = get_all_forms( trans, filter=dict(deleted=False),
+ form_type=trans.app.model.FormDefinition.types.USER_INFO )
+ user_info_select = None
+ if user:
+ if user.values:
+ selected_user_form_id = user.values.form_definition.id
+ else:
+ selected_user_form_id = 'none'
+ else:
+ selected_user_form_id = params.get( 'user_info_select', 'none' )
+ # when there are more than one user information forms then show a select box
+ # list all these forms
+ if len(user_info_forms) > 1:
+ # create the select box
+ user_info_select = SelectField('user_info_select', refresh_on_change=True,
+ refresh_on_change_values=[str(u.id) for u in user_info_forms])
+ if selected_user_form_id == 'none':
+ user_info_select.add_option('Select one', 'none', selected=True)
+ else:
+ user_info_select.add_option('Select one', 'none')
+ for u in user_info_forms:
+ if selected_user_form_id == str(u.id):
+ user_info_select.add_option(u.name, u.id, selected=True)
+ else:
+ user_info_select.add_option(u.name, u.id)
+ # when there is just one user information form the just render that form
+ elif len(user_info_forms) == 1:
+ selected_user_form_id = user_info_forms[0].id
+ # now, create the selected user form widgets starting with the basic
+ # login information
+ if user:
+ login_info = { 'Email': TextField( 'email', 40, user.email ),
+ 'Public Username': TextField( 'username', 40, user.username ),
+ 'Current Password': PasswordField( 'current', 40, '' ),
+ 'New Password': PasswordField( 'password', 40, '' ),
+ 'Confirm': PasswordField( 'confirm', 40, '' ) }
+ else:
+ login_info = { 'Email': TextField( 'email', 40,
+ util.restore_text( params.get('email', '') ) ),
+ 'Public Username': TextField( 'username', 40,
+ util.restore_text( params.get('username', '') ) ),
+ 'Password': PasswordField( 'password', 40,
+ util.restore_text( params.get('password', '') ) ),
+ 'Confirm': PasswordField( 'confirm', 40,
+ util.restore_text( params.get('confirm', '') ) ),
+ 'Subscribe To Mailing List': CheckboxField( 'subscribe',
+ util.restore_text( params.get('subscribe', '') ) ) }
+ # user information
+ try:
+ user_info_form = trans.sa_session.query( trans.app.model.FormDefinition ).get(int(selected_user_form_id))
+ except:
+ return user_info_select, None, login_info, None
+ if user:
+ if user.values:
+ widgets = user_info_form.get_widgets(user=user,
+ contents=user.values.content,
+ **kwd)
+ else:
+ widgets = user_info_form.get_widgets(None, contents=[], **kwd)
+ else:
+ widgets = user_info_form.get_widgets(None, contents=[], **kwd)
+ return user_info_select, user_info_form, login_info, widgets
+
+ @web.expose
+ def show_info( self, trans, **kwd ):
+ '''
+ This method displays the user information page which consists of login
+ information, public username, reset password & other user information
+ obtained during registration
+ '''
+ params = util.Params( kwd )
+ msg = util.restore_text( params.get( 'msg', '' ) )
+ messagetype = params.get( 'messagetype', 'done' )
+ # check if this method is called from the admin perspective,
+ if params.get('admin_view', 'False') == 'True':
+ try:
+ user = trans.sa_session.query( trans.app.model.User ).get( int( params.get( 'user_id', None ) ) )
+ except:
+ return trans.response.send_redirect( web.url_for( controller='admin',
+ action='users',
+ message='Invalid user',
+ status='error' ) )
+ admin_view = True
+ else:
+ user = trans.user
+ admin_view = False
+ user_info_select, user_info_form, login_info, widgets = self.__user_info_ui(trans, user, **kwd)
+ # user's addresses
+ show_filter = util.restore_text( params.get( 'show_filter', 'Active' ) )
+ if show_filter == 'All':
+ addresses = [address for address in user.addresses]
+ elif show_filter == 'Deleted':
+ addresses = [address for address in user.addresses if address.deleted]
+ else:
+ addresses = [address for address in user.addresses if not address.deleted]
+ return trans.fill_template( '/user/info.mako', user=user, admin_view=admin_view,
+ user_info_select=user_info_select,
+ user_info_form=user_info_form, widgets=widgets,
+ login_info=login_info,
+ addresses=addresses, show_filter=show_filter,
+ msg=msg, messagetype=messagetype)
+ @web.expose
+ def edit_info( self, trans, **kwd ):
+ params = util.Params( kwd )
+ msg = util.restore_text( params.get( 'msg', '' ) )
+ messagetype = params.get( 'messagetype', 'done' )
+ if params.get('admin_view', 'False') == 'True':
+ try:
+ user = trans.sa_session.query( trans.app.model.User ).get( int( params.get( 'user_id', None ) ) )
+ except:
+ return trans.response.send_redirect( web.url_for( controller='admin',
+ action='users',
+ message='Invalid user',
+ status='error' ) )
+ else:
+ user = trans.user
+ #
+ # Editing login info (email & username)
+ #
+ if params.get('login_info_button', None) == 'Save':
+ email = util.restore_text( params.get('email', '') )
+ username = util.restore_text( params.get('username', '') )
+ # validate the new values
+ error = self.__validate_email(trans, params, email, user)
+ if error:
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ msg=error,
+ messagetype='error') )
+ # the new email & username
+ user.email = email
+ user.username = username
+ user.flush()
+ msg = 'The login information has been updated with the changes'
+ if params.get('admin_view', 'False') == 'True':
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=True,
+ msg=msg,
+ messagetype='done' ) )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ msg=msg,
+ messagetype='done') )
+ #
+ # Change password
+ #
+ elif params.get('change_password_button', None) == 'Save':
+ password = util.restore_text( params.get('password', '') )
+ confirm = util.restore_text( params.get('confirm', '') )
+ # when from the user perspective, validate the current password
+ if params.get('admin_view', 'False') == 'False':
+ current = util.restore_text( params.get('current', '') )
+ if not trans.user.check_password( current ):
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ msg='Invalid current password',
+ messagetype='error') )
+ # validate the new values
+ error = self.__validate_password(trans, params, password, confirm)
+ if error:
+ if params.get('admin_view', 'False') == 'True':
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=True,
+ msg=error,
+ messagetype='error' ) )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ msg=error,
+ messagetype='error') )
+ # save new password
+ user.set_password_cleartext( password )
+ user.flush()
+ trans.log_event( "User change password" )
+ msg = 'The password has been changed.'
+ if params.get('admin_view', 'False') == 'True':
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=True,
+ msg=msg,
+ messagetype='done' ) )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ msg=msg,
+ messagetype='done') )
+ #
+ # Edit user information
+ #
+ elif params.get('edit_user_info_button', None) == 'Save':
+ self.__save_user_info(trans, user, "show_info", new_user=False, **kwd)
+ msg = "The user information has been updated with the changes."
+ if params.get('admin_view', 'False') == 'True':
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=True,
+ msg=msg,
+ messagetype='done' ) )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ msg=msg,
+ messagetype='done') )
+ else:
+ if params.get('admin_view', 'False') == 'True':
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=True ) )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info' ) )
+
@web.expose
def reset_password( self, trans, email=None, **kwd ):
error = ''
@@ -305,7 +651,7 @@
country=country, phone=phone)
user_address.flush()
return trans.response.send_redirect( web.url_for( controller='user',
- action='manage_addresses',
+ action='show_info',
msg='Address <b>%s</b> has been added' % user_address.desc,
messagetype='done') )
@@ -322,109 +668,123 @@
.add_text( "country", "Country", value=country, error=country_error )
.add_text( "phone", "Phone", value=phone, error=phone_error ) )
@web.expose
- def edit_address( self, trans, address_id=None, short_desc='', name='', institution='', address1='',
- address2='', city='', state='', postal_code='', country='', phone='' ):
- import sys
-
- if trans.app.config.require_login:
- refresh_frames = [ 'masthead', 'history', 'tools' ]
+ def edit_address( self, trans, **kwd ):
+ params = util.Params( kwd )
+ msg = util.restore_text( params.get( 'msg', '' ) )
+ messagetype = params.get( 'messagetype', 'done' )
+ admin_view = params.get( 'admin_view', 'False' )
+ error = ''
+ user = trans.sa_session.query( trans.app.model.User ).get( int( params.get( 'user_id', None ) ) )
+ try:
+ user_address = trans.sa_session.query( trans.app.model.UserAddress ).get(int(params.get( 'address_id', None )))
+ except:
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=admin_view,
+ msg='Invalid address ID',
+ messagetype='error' ) )
+ if params.get( 'edit_address_button', None ) == 'Save changes':
+ if not len( util.restore_text( params.get( 'short_desc', '' ) ) ):
+ error = 'Enter a short description for this address'
+ elif not len( util.restore_text( params.get( 'name', '' ) ) ):
+ error = 'Enter the full name'
+ elif not len( util.restore_text( params.get( 'institution', '' ) ) ):
+ error = 'Enter the institution associated with the user'
+ elif not len ( util.restore_text( params.get( 'address1', '' ) ) ):
+ error = 'Enter the address'
+ elif not len( util.restore_text( params.get( 'city', '' ) ) ):
+ error = 'Enter the city'
+ elif not len( util.restore_text( params.get( 'state', '' ) ) ):
+ error = 'Enter the state/province/region'
+ elif not len( util.restore_text( params.get( 'postal_code', '' ) ) ):
+ error = 'Enter the postal code'
+ elif not len( util.restore_text( params.get( 'country', '' ) ) ):
+ error = 'Enter the country'
+ else:
+ user_address.desc = util.restore_text( params.get( 'short_desc', '' ) )
+ user_address.name = util.restore_text( params.get( 'name', '' ) )
+ user_address.institution = util.restore_text( params.get( 'institution', '' ) )
+ user_address.address = util.restore_text( params.get( 'address1', '' ) )+' '+util.restore_text( params.get( 'address2', '' ) )
+ user_address.city = util.restore_text( params.get( 'city', '' ) )
+ user_address.state = util.restore_text( params.get( 'state', '' ) )
+ user_address.postal_code = util.restore_text( params.get( 'postal_code', '' ) )
+ user_address.country = util.restore_text( params.get( 'country', '' ) )
+ user_address.phone = util.restore_text( params.get( 'phone', '' ) )
+ user_address.flush()
+ msg = 'Changes made to address <b>%s</b> are saved.' % user_address.desc
+ if admin_view == 'True':
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user.id,
+ admin_view=True,
+ msg=msg,
+ messagetype='done' ) )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ msg=msg,
+ messagetype='done') )
else:
- refresh_frames = [ 'masthead', 'history' ]
- if not trans.app.config.allow_user_creation and not trans.user_is_admin():
- return trans.show_error_message( 'User registration is disabled. Please contact your Galaxy administrator for an account.' )
- short_desc_error = name_error = institution_error = address1_error = city_error = None
- address2_error = state_error = postal_code_error = country_error = phone_error = None
- if short_desc:
- if not len( short_desc ):
- short_desc_error = 'Enter a short description for this address'
- elif not len( name ):
- name_error = 'Enter the full name'
- elif not len( institution ):
- institution_error = 'Enter the institution associated with the user'
- elif not len ( address1 ):
- address1_error = 'Enter the address'
- elif not len( city ):
- city_error = 'Enter the city'
- elif not len( state ):
- state_error = 'Enter the state/province/region'
- elif not len( postal_code ):
- postal_code_error = 'Enter the postal code'
- elif not len( country ):
- country_error = 'Enter the country'
- else:
- if self.edit_address_id:
- try:
- user_address = trans.sa_session.query( trans.app.model.UserAddress ).get( int( self.edit_address_id ) )
- except:
- return trans.response.send_redirect( web.url_for( controller='user',
- action='manage_addresses',
- msg='Invalid address ID',
- messagetype='error') )
- user_address.desc = short_desc
- user_address.name = name
- user_address.institution = institution
- user_address.address = address1+' '+address2
- user_address.city = city
- user_address.state = state
- user_address.postal_code = postal_code
- user_address.country = country
- user_address.phone = phone
- user_address.flush()
- self.edit_address_id = None
- return trans.response.send_redirect( web.url_for( controller='user',
- action='manage_addresses',
- msg='Changes made to address <b>%s</b> are saved.' % user_address.desc,
- messagetype='done') )
- self.edit_address_id = address_id
- return trans.show_form(
- web.FormBuilder( web.url_for(), "Edit address", submit_text="Save changes" )
- .add_text( "short_desc", "Short address description", value=short_desc, error=short_desc_error )
- .add_text( "name", "Name", value=name, error=name_error )
- .add_text( "institution", "Institution", value=institution, error=institution_error )
- .add_text( "address1", "Address Line 1", value=address1, error=address1_error )
- .add_text( "address2", "Address Line 2", value=address2, error=address2_error )
- .add_text( "city", "City", value=city, error=city_error )
- .add_text( "state", "State/Province/Region", value=state, error=state_error )
- .add_text( "postal_code", "Postal Code", value=postal_code, error=postal_code_error )
- .add_text( "country", "Country", value=country, error=country_error )
- .add_text( "phone", "Phone", value=phone, error=phone_error ) )
+ # show the address form with the current values filled in
+ # create the widgets for each address field
+ widgets = []
+ widgets.append(dict(label='Short description',
+ widget=TextField( 'short_desc', 40, user_address.desc ) ) )
+ widgets.append(dict(label='Name',
+ widget=TextField( 'name', 40, user_address.name ) ) )
+ widgets.append(dict(label='Institution',
+ widget=TextField( 'institution', 40, user_address.institution ) ) )
+ widgets.append(dict(label='Address Line 1',
+ widget=TextField( 'address1', 40, user_address.address ) ) )
+ widgets.append(dict(label='City',
+ widget=TextField( 'city', 40, user_address.city ) ) )
+ widgets.append(dict(label='State',
+ widget=TextField( 'state', 40, user_address.state ) ) )
+ widgets.append(dict(label='Postal Code',
+ widget=TextField( 'postal_code', 40, user_address.postal_code ) ) )
+ widgets.append(dict(label='Country',
+ widget=TextField( 'country', 40, user_address.country ) ) )
+ widgets.append(dict(label='Phone',
+ widget=TextField( 'phone', 40, user_address.phone ) ) )
+ return trans.fill_template( 'user/edit_address.mako', user=user,
+ address=user_address, admin_view=admin_view,
+ widgets=widgets, msg=msg, messagetype=messagetype)
@web.expose
- def delete_address( self, trans, address_id=None):
- if trans.app.config.require_login:
- refresh_frames = [ 'masthead', 'history', 'tools' ]
- else:
- refresh_frames = [ 'masthead', 'history' ]
- if not trans.app.config.allow_user_creation and not trans.user_is_admin():
- return trans.show_error_message( 'User registration is disabled. Please contact your Galaxy administrator for an account.' )
+ def delete_address( self, trans, address_id=None, user_id=None, admin_view='False'):
try:
user_address = trans.sa_session.query( trans.app.model.UserAddress ).get( int( address_id ) )
except:
- return trans.fill_template( 'user/address.mako',
- msg='Invalid address ID',
- messagetype='error' )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user_id,
+ admin_view=admin_view,
+ msg='Invalid address ID',
+ messagetype='error' ) )
user_address.deleted = True
user_address.flush()
return trans.response.send_redirect( web.url_for( controller='user',
- action='manage_addresses',
+ action='show_info',
+ admin_view=admin_view,
+ user_id=user_id,
msg='Address <b>%s</b> deleted' % user_address.desc,
messagetype='done') )
@web.expose
- def undelete_address( self, trans, address_id=None):
- if trans.app.config.require_login:
- refresh_frames = [ 'masthead', 'history', 'tools' ]
- else:
- refresh_frames = [ 'masthead', 'history' ]
- if not trans.app.config.allow_user_creation and not trans.user_is_admin():
- return trans.show_error_message( 'User registration is disabled. Please contact your Galaxy administrator for an account.' )
+ def undelete_address( self, trans, address_id=None, user_id=None, admin_view='False'):
try:
user_address = trans.sa_session.query( trans.app.model.UserAddress ).get( int( address_id ) )
except:
- return trans.fill_template( 'user/address.mako',
- msg='Invalid address ID',
- messagetype='error' )
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action='show_info',
+ user_id=user_id,
+ admin_view=admin_view,
+ msg='Invalid address ID',
+ messagetype='error' ) )
user_address.deleted = False
user_address.flush()
return trans.response.send_redirect( web.url_for( controller='user',
- action='manage_addresses',
- msg='Address <b>%s</b> is restored' % user_address.desc,
+ action='show_info',
+ admin_view=admin_view,
+ user_id=user_id,
+ msg='Address <b>%s</b> undeleted' % user_address.desc,
messagetype='done') )
+
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/web/form_builder.py
--- a/lib/galaxy/web/form_builder.py Mon Nov 02 09:54:18 2009 -0500
+++ b/lib/galaxy/web/form_builder.py Mon Nov 02 13:30:17 2009 -0500
@@ -33,6 +33,25 @@
def set_size(self, size):
self.size = int( size )
+class PasswordField(BaseField):
+ """
+ A password input box. text appears as "******"
+
+ >>> print PasswordField( "foo" ).get_html()
+ <input type="password" name="foo" size="10" value="">
+ >>> print PasswordField( "bins", size=4, value="default" ).get_html()
+ <input type="password" name="bins" size="4" value="default">
+ """
+ def __init__( self, name, size=None, value=None ):
+ self.name = name
+ self.size = int( size or 10 )
+ self.value = value or ""
+ def get_html( self, prefix="" ):
+ return '<input type="password" name="%s%s" size="%d" value="%s">' \
+ % ( prefix, self.name, self.size, escape(str(self.value), quote=True) )
+ def set_size(self, size):
+ self.size = int( size )
+
class NumberField(BaseField):
"""
A number input box.
diff -r 6e8263ea83fa -r cd0596754ff1 lib/galaxy/web/framework/helpers/grids.py
--- a/lib/galaxy/web/framework/helpers/grids.py Mon Nov 02 09:54:18 2009 -0500
+++ b/lib/galaxy/web/framework/helpers/grids.py Mon Nov 02 13:30:17 2009 -0500
@@ -266,10 +266,11 @@
return accepted_filters
class GridOperation( object ):
- def __init__( self, label, key=None, condition=None, allow_multiple=True, target=None, url_args=None ):
+ def __init__( self, label, key=None, condition=None, allow_multiple=True, allow_popup=True, target=None, url_args=None ):
self.label = label
self.key = key
self.allow_multiple = allow_multiple
+ self.allow_popup = allow_popup
self.condition = condition
self.target = target
self.url_args = url_args
diff -r 6e8263ea83fa -r cd0596754ff1 templates/admin/user/grid.mako
--- a/templates/admin/user/grid.mako Mon Nov 02 09:54:18 2009 -0500
+++ b/templates/admin/user/grid.mako Mon Nov 02 13:30:17 2009 -0500
@@ -195,7 +195,7 @@
<td>
<div popupmenu="grid-${i}-popup">
%for operation in grid.operations:
- %if operation.allowed( item ):
+ %if operation.allowed( item ) and operation.allow_popup:
<a class="action-button" href="${url( operation=operation.label, id=item.id )}">${operation.label}</a>
%endif
%endfor
diff -r 6e8263ea83fa -r cd0596754ff1 templates/user/edit_address.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/user/edit_address.mako Mon Nov 02 13:30:17 2009 -0500
@@ -0,0 +1,33 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+</br>
+</br>
+<h3>Edit address</h3>
+
+<ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller='user', action='show_info')}">
+ <span>Manage User Information</span></a>
+ </li>
+</ul>
+<div class="toolForm">
+<form name="login_info" id="login_info" action="${h.url_for( controller='user', action='edit_address', admin_view=admin_view, address_id=address.id, user_id=user.id )}" method="post" >
+ <div class="toolFormTitle">Edit address</div>
+ <div class="toolFormBody">
+ %for field in widgets:
+ <div class="form-row">
+ <label>${field[ 'label' ]}</label>
+ ${field[ 'widget' ].get_html()}
+ </div>
+ %endfor
+ <div class="form-row">
+ <input type="submit" name="edit_address_button" value="Save changes">
+ </div>
+ </div>
+</form>
+</div>
\ No newline at end of file
diff -r 6e8263ea83fa -r cd0596754ff1 templates/user/index.mako
--- a/templates/user/index.mako Mon Nov 02 09:54:18 2009 -0500
+++ b/templates/user/index.mako Mon Nov 02 13:30:17 2009 -0500
@@ -7,11 +7,8 @@
%if user:
<p>You are currently logged in as ${user.email}.</p>
<ul>
- <li><a href="${h.url_for( action='change_password' )}">${_('Change your password')}</a></li>
- <li><a href="${h.url_for( action='change_email' )}">${_('Update your email address')}</a></li>
- <li><a href="${h.url_for( action='change_username' )}">${_('Change your public username')}</a></li>
+ <li><a href="${h.url_for( action='show_info' )}">${_('Manage your information')}</a></li>
<li><a href="${h.url_for( action='set_default_permissions' )}">${_('Change default permissions')}</a> for new histories</li>
- <li><a href="${h.url_for( action='manage_addresses' )}">${_('Manage your addresses')}</a></li>
<li><a href="${h.url_for( action='logout' )}">${_('Logout')}</a></li>
</ul>
%else:
diff -r 6e8263ea83fa -r cd0596754ff1 templates/user/info.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/user/info.mako Mon Nov 02 13:30:17 2009 -0500
@@ -0,0 +1,161 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<h2>Manage User Information</h2>
+%if not admin_view:
+ <ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller='user', action='index')}">
+ <span>User preferences</span></a>
+ </li>
+ </ul>
+%endif
+
+<script type="text/javascript">
+$( function() {
+ $( "select[refresh_on_change='true']").change( function() {
+ var refresh = false;
+ var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
+ if ( refresh_on_change_values ) {
+ refresh_on_change_values = refresh_on_change_values.value.split( ',' );
+ var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
+ for( i= 0; i < refresh_on_change_values.length; i++ ) {
+ if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
+ refresh = true;
+ break;
+ }
+ }
+ }
+ else {
+ refresh = true;
+ }
+ if ( refresh ){
+ $( "#user_info" ).submit();
+ }
+ });
+});
+</script>
+
+<div class="toolForm">
+ <form name="login_info" id="login_info" action="${h.url_for( controller='user', action='edit_info', user_id=user.id, admin_view=admin_view )}" method="post" >
+ <div class="toolFormTitle">Login Information</div>
+ <div class="form-row">
+ <label>Email</label>
+ ${login_info[ 'Email' ].get_html()}
+ </div>
+ <div class="form-row">
+ <label>Public Username</label>
+ ${login_info[ 'Public Username' ].get_html()}
+ </div>
+ <div class="form-row">
+ <input type="submit" name="login_info_button" value="Save">
+ </div>
+ </form>
+ <form name="change_password" id="change_password" action="${h.url_for( controller='user', action='edit_info', user_id=user.id, admin_view=admin_view )}" method="post" >
+ <div class="toolFormTitle">Change Password</div>
+ %if not admin_view:
+ <div class="form-row">
+ <label>Current Password</label>
+ ${login_info[ 'Current Password' ].get_html()}
+ </div>
+ %endif
+ <div class="form-row">
+ <label>New Password</label>
+ ${login_info[ 'New Password' ].get_html()}
+ </div>
+ <div class="form-row">
+ <label>Confirm</label>
+ ${login_info[ 'Confirm' ].get_html()}
+ </div>
+ <div class="form-row">
+ <input type="submit" name="change_password_button" value="Save">
+ </div>
+ </form>
+ %if user.values:
+ <form name="user_info" id="user_info" action="${h.url_for( controller='user', action='edit_info', user_id=user.id, admin_view=admin_view )}" method="post" >
+ <div class="toolFormTitle">User information</div>
+ %if user_info_form:
+ %for field in widgets:
+ <div class="form-row">
+ <label>${field['label']}</label>
+ ${field['widget'].get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ ${field['helptext']}
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %endfor
+ %if not user_info_select:
+ <input type="hidden" name="user_info_select" value="${user_info_form.id}"/>
+ %endif
+ %endif
+ <div class="form-row">
+ <input type="submit" name="edit_user_info_button" value="Save">
+ </div>
+ </form>
+ %endif
+ <form name="user_info" id="user_info" action="${h.url_for( controller='user', action='new_address' )}" method="post" >
+ <div class="toolFormTitle">User Addresses</div>
+ <div class="toolFormBody">
+ %if user.addresses:
+ <div class="form-row">
+ <div class="grid-header">
+ ##<span class="title">Filter:</span>
+ %for i, filter in enumerate( ['Active', 'Deleted', 'All'] ):
+ %if i > 0:
+ <span>|</span>
+ %endif
+ %if show_filter == filter:
+ <span class="filter"><a href="${h.url_for( controller='user', action='show_info', show_filter=filter, user_id=user.id, admin_view=admin_view )}"><b>${filter}</b></a></span>
+ %else:
+ <span class="filter"><a href="${h.url_for( controller='user', action='show_info', show_filter=filter, user_id=user.id, admin_view=admin_view )}">${filter}</a></span>
+ %endif
+ %endfor
+ </div>
+ </div>
+ <table class="grid">
+ <tbody>
+ %for index, address in enumerate(addresses):
+ <tr class="libraryRow libraryOrFolderRow" id="libraryRow">
+ <td>
+ <div class="form-row">
+ <label>${address.desc}</label>
+ ${address.get_html()}
+ </div>
+ <div class="form-row">
+ <ul class="manage-table-actions">
+ <li>
+ %if not address.deleted:
+ <a class="action-button" href="${h.url_for( controller='user', action='edit_address', admin_view=admin_view, address_id=address.id, user_id=user.id )}">
+ <span>Edit</span></a>
+ <a class="action-button" href="${h.url_for( controller='user', action='delete_address', admin_view=admin_view, address_id=address.id, user_id=user.id)}">
+ <span>Delete</span></a>
+ %else:
+ <a class="action-button" href="${h.url_for( controller='user', action='undelete_address', admin_view=admin_view, address_id=address.id, user_id=user.id)}">
+ <span>Undelete</span></a>
+ %endif
+
+ </li>
+ </ul>
+ </div>
+ </td>
+ </tr>
+ %endfor
+ </tbody>
+ </table>
+ %endif
+ <div class="form-row">
+ <input type="submit" value="Add a new address">
+ </div>
+ </div>
+ </form>
+
+
+
+
+</div>
\ No newline at end of file
diff -r 6e8263ea83fa -r cd0596754ff1 templates/user/permissions.mako
--- a/templates/user/permissions.mako Mon Nov 02 09:54:18 2009 -0500
+++ b/templates/user/permissions.mako Mon Nov 02 13:30:17 2009 -0500
@@ -1,7 +1,13 @@
<%inherit file="/base.mako"/>
<%def name="title()">Change Default Permissions on New Histories</%def>
<%namespace file="/dataset/security_common.mako" import="render_permission_form" />
-
+<br/><br/>
+<ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller='user', action='index')}">
+ <span>User preferences</span></a>
+ </li>
+</ul>
%if trans.user:
${render_permission_form( trans.user, trans.user.email, h.url_for(), trans.user.all_roles() )}
%endif
diff -r 6e8263ea83fa -r cd0596754ff1 templates/user/register.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/user/register.mako Mon Nov 02 13:30:17 2009 -0500
@@ -0,0 +1,87 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+
+
+<script type="text/javascript">
+$( function() {
+ $( "select[refresh_on_change='true']").change( function() {
+ var refresh = false;
+ var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
+ if ( refresh_on_change_values ) {
+ refresh_on_change_values = refresh_on_change_values.value.split( ',' );
+ var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
+ for( i= 0; i < refresh_on_change_values.length; i++ ) {
+ if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
+ refresh = true;
+ break;
+ }
+ }
+ }
+ else {
+ refresh = true;
+ }
+ if ( refresh ){
+ $( "#registration" ).submit();
+ }
+ });
+});
+</script>
+
+<div class="toolForm">
+ <form name="registration" id="registration" action="${h.url_for( controller='user', action='create', admin_view=admin_view )}" method="post" >
+ <div class="toolFormTitle">Create account</div>
+ <div class="form-row">
+ <label>Email</label>
+ ${login_info[ 'Email' ].get_html()}
+ </div>
+ <div class="form-row">
+ <label>Password</label>
+ ${login_info[ 'Password' ].get_html()}
+ </div>
+ <div class="form-row">
+ <label>Confirm</label>
+ ${login_info[ 'Confirm' ].get_html()}
+ </div>
+ <div class="form-row">
+ <label>Public Username</label>
+ ${login_info[ 'Public Username' ].get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ Optional
+ </div>
+ </div>
+ <div class="form-row">
+ <label>Subscribe To Mailing List</label>
+ ${login_info[ 'Subscribe To Mailing List' ].get_html()}
+ </div>
+ %if user_info_select:
+ <div class="form-row">
+ <label>User type</label>
+ ${user_info_select.get_html()}
+ </div>
+ %endif
+ %if user_info_form:
+ %for field in widgets:
+ <div class="form-row">
+ <label>${field['label']}</label>
+ ${field['widget'].get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ ${field['helptext']}
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %endfor
+ %if not user_info_select:
+ <input type="hidden" name="user_info_select" value="${user_info_form.id}"/>
+ %endif
+ %endif
+ <div class="form-row">
+ <input type="submit" name="create_user_button" value="Submit">
+ </div>
+ </form>
+</div>
\ No newline at end of file
diff -r 6e8263ea83fa -r cd0596754ff1 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Mon Nov 02 09:54:18 2009 -0500
+++ b/test/base/twilltestcase.py Mon Nov 02 13:30:17 2009 -0500
@@ -596,13 +596,82 @@
# Functions associated with user accounts
def create( self, email='test(a)bx.psu.edu', password='testuser' ):
self.home()
- self.visit_page( "user/create?email=%s&password=%s&confirm=%s" % ( email, password, password ) )
+ self.visit_page( "user/create?email=%s&password=%s&confirm=%s&create_user_button=Submit" % ( email, password, password ) )
self.check_page_for_string( "Now logged in as %s" %email )
self.home()
# Make sure a new private role was created for the user
self.visit_page( "user/set_default_permissions" )
self.check_page_for_string( email )
self.home()
+ def create_user_with_info( self, email, password, username, user_info_forms, user_info_form_id, user_info_values ):
+ '''
+ This method registers a new user and also provides use info
+ '''
+ self.home()
+ if user_info_forms == 'multiple':
+ self.visit_page( "user/create?user_info_select=%i&admin_view=False" % user_info_form_id )
+ else:
+ self.visit_page( "user/create?admin_view=False" )
+ self.check_page_for_string( "Create account" )
+ tc.fv( "1", "email", email )
+ tc.fv( "1", "password", password )
+ tc.fv( "1", "confirm", password )
+ tc.fv( "1", "username", username )
+ if user_info_forms == 'multiple':
+ self.check_page_for_string( "User type" )
+ for index, info_value in enumerate(user_info_values):
+ tc.fv( "1", "field_%i" % index, info_value )
+ tc.submit( "create_user_button" )
+ self.check_page_for_string( "Now logged in as %s" % email )
+ def create_user_with_info_as_admin( self, email, password, username, user_info_forms, user_info_form_id, user_info_values ):
+ '''
+ This method registers a new user and also provides use info as an admin
+ '''
+ self.home()
+ if user_info_forms == 'multiple':
+ self.visit_page( "admin/users?operation=create?user_info_select=%i&admin_view=False" % user_info_form_id )
+ else:
+ self.visit_page( "admin/users?operation=create" )
+ self.check_page_for_string( "Create account" )
+ tc.fv( "1", "email", email )
+ tc.fv( "1", "password", password )
+ tc.fv( "1", "confirm", password )
+ tc.fv( "1", "username", username )
+ if user_info_forms == 'multiple':
+ self.check_page_for_string( "User type" )
+ for index, info_value in enumerate(user_info_values):
+ tc.fv( "1", "field_%i" % index, info_value )
+ tc.submit( "create_user_button" )
+ self.check_page_for_string( "Created new user account (%s)" % email )
+ def edit_login_info( self, new_email, new_username ):
+ self.home()
+ self.visit_page( "user/show_info" )
+ self.check_page_for_string( "Manage User Information" )
+ tc.fv( "1", "email", new_email )
+ tc.fv( "1", "username", new_username )
+ tc.submit( "login_info_button" )
+ self.check_page_for_string( 'The login information has been updated with the changes' )
+ self.check_page_for_string( new_email )
+ self.check_page_for_string( new_username )
+ def change_password( self, password, new_password ):
+ self.home()
+ self.visit_page( "user/show_info" )
+ self.check_page_for_string( "Manage User Information" )
+ tc.fv( "2", "current", password )
+ tc.fv( "2", "password", new_password )
+ tc.fv( "2", "confirm", new_password )
+ tc.submit( "change_password_button" )
+ self.check_page_for_string( 'The password has been changed.' )
+ def edit_user_info( self, info_values ):
+ self.home()
+ self.visit_page( "user/show_info" )
+ self.check_page_for_string( "Manage User Information" )
+ for index, info_value in enumerate(info_values):
+ tc.fv( "3", "field_%i" % index, info_value )
+ tc.submit( "edit_user_info_button" )
+ self.check_page_for_string( "The user information has been updated with the changes." )
+ for value in info_values:
+ self.check_page_for_string( value )
def user_set_default_permissions( self, permissions_out=[], permissions_in=[], role_id=2 ): # role.id = 2 is Private Role for test2(a)bx.psu.edu
# NOTE: Twill has a bug that requires the ~/user/permissions page to contain at least 1 option value
# in each select list or twill throws an exception, which is: ParseError: OPTION outside of SELECT
@@ -1161,19 +1230,8 @@
for index, field_value in enumerate(fields):
tc.fv( "1", "field_%i" % index, field_value )
tc.submit( "create_request_button" )
- def create_request_admin( self, request_type_id, user_id, name, desc, library_id, fields ):
- self.home()
- self.visit_url( "%s/requests_admin/new?create=True&select_request_type=%i&library_id=%i" % ( self.url,
- request_type_id,
- library_id ) )
- self.check_page_for_string( 'Add a new request' )
- tc.fv( "1", "select_user", str(user_id) )
- tc.fv( "1", "name", name )
- tc.fv( "1", "desc", desc )
- tc.fv( "1", "library_id", str(library_id) )
- for index, field_value in enumerate(fields):
- tc.fv( "1", "field_%i" % index, field_value )
- tc.submit( "create_request_button" )
+ self.check_page_for_string( name )
+ self.check_page_for_string( desc )
def edit_request( self, request_id, name, new_name, new_desc, new_library_id, new_folder_id, new_fields):
self.home()
self.visit_url( "%s/requests/edit?request_id=%i&show=True" % (self.url, request_id) )
@@ -1185,6 +1243,8 @@
for index, field_value in enumerate(new_fields):
tc.fv( "1", "field_%i" % index, field_value )
tc.submit( "save_changes_request_button" )
+ self.check_page_for_string( new_name )
+ self.check_page_for_string( new_desc )
def add_samples( self, request_id, request_name, samples ):
self.home()
self.visit_url( "%s/requests/list?sort=-create_time&operation=show_request&id=%s" % ( self.url, self.security.encode_id( request_id ) ))
@@ -1196,6 +1256,11 @@
for field_index, field_value in enumerate(fields):
tc.fv( "1", "sample_%i_field_%i" % ( sample_index, field_index ), field_value )
tc.submit( "save_samples_button" )
+ for sample_name, fields in samples:
+ self.check_page_for_string( sample_name )
+ self.check_page_for_string( 'Unsubmitted' )
+ for field_value in fields:
+ self.check_page_for_string( field_value )
def submit_request( self, request_id, request_name ):
self.home()
self.visit_url( "%s/requests/submit_request?id=%i" % ( self.url, request_id ))
@@ -1207,21 +1272,15 @@
for index, bar_code in enumerate(bar_codes):
tc.fv( "1", "sample_%i_bar_code" % index, bar_code )
tc.submit( "save_bar_codes" )
- def change_sample_state( self, sample_name, sample_id, new_state_id, comment='' ):
+ self.check_page_for_string( 'Bar codes has been saved for this request' )
+ def change_sample_state( self, sample_name, sample_id, new_state_id, new_state_name, comment='' ):
self.home()
self.visit_url( "%s/requests_admin/show_events?sample_id=%i" % (self.url, sample_id) )
self.check_page_for_string( 'Events for Sample "%s"' % sample_name )
tc.fv( "1", "select_state", str(new_state_id) )
tc.fv( "1", "comment", comment )
tc.submit( "add_event_button" )
- # Address stuff
- def create_address( self, address ):
- self.home()
- self.visit_url( "%s/user/new_address" % self.url )
- self.check_page_for_string( 'New address' )
- for name, value in address.iteritems():
- tc.fv( "1", name, value )
- tc.submit( "Save_button" )
+ self.check_page_for_string( new_state_name )
# Library stuff
def create_library( self, name='Library One', description='This is Library One' ):
"""Create a new library"""
diff -r 6e8263ea83fa -r cd0596754ff1 test/functional/test_forms_and_requests.py
--- a/test/functional/test_forms_and_requests.py Mon Nov 02 09:54:18 2009 -0500
+++ b/test/functional/test_forms_and_requests.py Mon Nov 02 13:30:17 2009 -0500
@@ -41,16 +41,11 @@
self.login( email='test(a)bx.psu.edu' )
# create a form
global form_one_name
- name = form_one_name
desc = "This is Form One's description"
formtype = galaxy.model.FormDefinition.types.REQUEST
- self.create_form( name=name, desc=desc, formtype=formtype, num_fields=0 )
+ self.create_form( name=form_one_name, desc=desc, formtype=formtype, num_fields=0 )
# Get the form_definition object for later tests
- form_one = sa_session.query( galaxy.model.FormDefinition ) \
- .filter( and_( galaxy.model.FormDefinition.table.c.name==name,
- galaxy.model.FormDefinition.table.c.desc==desc,
- galaxy.model.FormDefinition.table.c.type==formtype ) ) \
- .all()[-1]
+ form_one = get_latest_form(form_one_name)
assert form_one is not None, 'Problem retrieving form named "%s" from the database' % name
# edit form & add few more fields
new_name = "Request Form (Renamed)"
@@ -83,20 +78,18 @@
def test_015_create_sample_form( self ):
"""Testing creating another form (for samples)"""
global form_two_name
- name = form_two_name
desc = "This is Form One's description"
formtype = 'Sequencing Sample Form'
- self.create_form( name=name, desc=desc, formtype=formtype )
+ self.create_form( name=form_two_name, desc=desc, formtype=formtype )
self.home()
self.visit_page( 'forms/manage' )
- self.check_page_for_string( name )
+ self.check_page_for_string( form_two_name )
self.check_page_for_string( desc )
self.check_page_for_string( formtype )
def test_020_create_request_type( self ):
"""Testing creating a new requestype"""
request_form = get_latest_form(form_one_name)
sample_form = get_latest_form(form_two_name)
- print request_form.id, sample_form.id
self.create_request_type(request_type_name, "test request type",
str(request_form.id), str(sample_form.id), sample_states )
global request_type
@@ -179,7 +172,6 @@
% ( self.url, address1[ 'short_desc' ], address1[ 'name' ], address1[ 'institution' ],
address1[ 'address1' ], address1[ 'address2' ], address1[ 'city' ], address1[ 'state' ],
address1[ 'postal_code' ], address1[ 'country' ], address1[ 'phone' ] )
- print url_str
self.visit_url( url_str )
self.check_page_for_string( 'Address <b>%s</b> has been added' % address1[ 'short_desc' ] )
global regular_user
@@ -201,8 +193,6 @@
# create the request
request_name, request_desc = 'Request One', 'Request One Description'
self.create_request(request_type.id, request_name, request_desc, library_one.id, 'none', fields)
- self.check_page_for_string( request_name )
- self.check_page_for_string( request_desc )
global request_one
request_one = sa_session.query( galaxy.model.Request ) \
.filter( and_( galaxy.model.Request.table.c.name==request_name,
@@ -216,18 +206,11 @@
( 'Sample Two', [ 'S2 Field 0 Value' ] ) ]
# add samples to this request
self.add_samples( request_one.id, request_one.name, samples )
- for sample_name, fields in samples:
- self.check_page_for_string( sample_name )
- self.check_page_for_string( 'Unsubmitted' )
- for field_value in fields:
- self.check_page_for_string( field_value )
# edit this request
fields = ['option2', str(user_address.id), 'field three value (edited)']
self.edit_request(request_one.id, request_one.name, request_one.name+' (Renamed)',
request_one.desc+' (Re-described)', library_one.id, folder_one.id, fields)
sa_session.refresh( request_one )
- self.check_page_for_string( request_name+' (Renamed)' )
- self.check_page_for_string( request_desc+' (Re-described)' )
# check if the request is showing in the 'unsubmitted' filter
self.home()
self.visit_url( '%s/requests/list?show_filter=Unsubmitted' % self.url )
@@ -256,15 +239,10 @@
# set bar codes for the samples
bar_codes = [ '1234567890', '0987654321' ]
self.add_bar_codes( request_one.id, request_one.name, bar_codes )
- self.check_page_for_string( 'Bar codes has been saved for this request' )
# change the states of all the samples of this request
for sample in request_one.samples:
- self.change_sample_state( sample.name, sample.id, request_type.states[1].id )
- self.check_page_for_string( request_type.states[1].name )
- self.check_page_for_string( request_type.states[1].desc )
- self.change_sample_state( sample.name, sample.id, request_type.states[2].id )
- self.check_page_for_string( request_type.states[2].name )
- self.check_page_for_string( request_type.states[2].desc )
+ self.change_sample_state( sample.name, sample.id, request_type.states[1].id, request_type.states[1].name )
+ self.change_sample_state( sample.name, sample.id, request_type.states[2].id, request_type.states[2].name )
self.home()
sa_session.refresh( request_one )
# check if the request's state is now set to 'complete'
@@ -300,11 +278,6 @@
( 'Sample Two', [ 'S2 Field 0 Value' ] ) ]
# add samples to this request
self.add_samples( request_two.id, request_two.name, samples )
- for sample_name, fields in samples:
- self.check_page_for_string( sample_name )
- self.check_page_for_string( 'Unsubmitted' )
- for field_value in fields:
- self.check_page_for_string( field_value )
# submit the request
self.submit_request( request_two.id, request_two.name )
sa_session.refresh( request_two )
diff -r 6e8263ea83fa -r cd0596754ff1 test/functional/test_user_info.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/functional/test_user_info.py Mon Nov 02 13:30:17 2009 -0500
@@ -0,0 +1,149 @@
+import galaxy.model
+from galaxy.model.orm import *
+from galaxy.model.mapping import context as sa_session
+from base.twilltestcase import *
+
+not_logged_in_as_admin_security_msg = 'You must be logged in as an administrator to access this feature.'
+logged_in_as_admin_security_msg = 'You must be an administrator to access this feature.'
+not_logged_in_security_msg = 'You must be logged in to create/submit sequencing requests'
+form_one_name = "Student"
+form_two_name = "Researcher"
+
+def get_latest_form(form_name):
+ fdc_list = sa_session.query( galaxy.model.FormDefinitionCurrent ) \
+ .filter( galaxy.model.FormDefinitionCurrent.table.c.deleted==False ) \
+ .order_by( galaxy.model.FormDefinitionCurrent.table.c.create_time.desc() )
+ for fdc in fdc_list:
+ if form_name == fdc.latest_form.name:
+ return fdc.latest_form
+ return None
+
+
+class TestUserInfo( TwillTestCase ):
+ def test_000_create_user_info_forms( self ):
+ """Testing creating a new user info form and editing it"""
+ self.logout()
+ self.login( email='test(a)bx.psu.edu' )
+ # create a the first form
+ global form_one_name
+ name = form_one_name
+ desc = "This is Student user info form's description"
+ formtype = galaxy.model.FormDefinition.types.USER_INFO
+ self.create_form( name=name, desc=desc, formtype=formtype, num_fields=0 )
+ # Get the form_definition object for later tests
+ form_one = get_latest_form(form_one_name)
+ assert form_one is not None, 'Problem retrieving form named "%s" from the database' % name
+ # edit form & add few more fields
+ fields = [dict(name='Affiliation',
+ desc='The type of organization you are affiliated with',
+ type='SelectField',
+ required='optional',
+ selectlist=['Educational', 'Research', 'Commercial']),
+ dict(name='Name of Organization',
+ desc='',
+ type='TextField',
+ required='optional')]
+ form_one = get_latest_form(form_one_name)
+ self.form_add_field(form_one.id, form_one.name, form_one.desc, form_one.type, field_index=len(form_one.fields), fields=fields)
+ form_one_latest = get_latest_form(form_one_name)
+ assert len(form_one_latest.fields) == len(form_one.fields)+len(fields)
+ # create the second form
+ global form_two_name
+ name = form_two_name
+ desc = "This is Researcher user info form's description"
+ self.create_form( name=name, desc=desc, formtype=formtype, num_fields=0 )
+ # Get the form_definition object for later tests
+ form_two = get_latest_form(form_two_name)
+ assert form_two is not None, 'Problem retrieving form named "%s" from the database' % name
+ # edit form & add few more fields
+ fields = [dict(name='Affiliation',
+ desc='The type of organization you are affiliated with',
+ type='SelectField',
+ required='optional',
+ selectlist=['Educational', 'Research', 'Commercial']),
+ dict(name='Name of Organization',
+ desc='',
+ type='TextField',
+ required='optional')]
+ form_two = get_latest_form(form_two_name)
+ self.form_add_field(form_two.id, form_two.name, form_two.desc, form_two.type, field_index=len(form_one.fields), fields=fields)
+ form_two_latest = get_latest_form(form_two_name)
+ assert len(form_two_latest.fields) == len(form_two.fields)+len(fields)
+ def test_005_user_reqistration_multiple_user_info_forms( self ):
+ ''' Testing user registration with multiple user info forms '''
+ self.logout()
+ # user a new user with 'Student' user info form
+ form_one = get_latest_form(form_one_name)
+ user_info_values=['Educational', 'Penn State']
+ self.create_user_with_info( 'test1(a)bx.psu.edu', 'testuser', 'test1',
+ user_info_forms='multiple',
+ user_info_form_id=form_one.id,
+ user_info_values=user_info_values )
+ self.home()
+ self.visit_page( "user/show_info" )
+ self.check_page_for_string( "Manage User Information" )
+ for value in user_info_values:
+ self.check_page_for_string( value )
+ def test_010_user_reqistration_single_user_info_forms( self ):
+ ''' Testing user registration with a single user info form '''
+ # lets delete the 'Researcher' user info form
+ self.login( 'test(a)bx.psu.edu' )
+ form_two_latest = get_latest_form(form_two_name)
+ form_two_latest.current.deleted = True
+ form_two_latest.current.flush()
+ self.home()
+ self.visit_page('forms/manage?show_filter=Deleted')
+ self.check_page_for_string(form_two_latest.name)
+ self.logout()
+ # user a new user with 'Student' user info form
+ form_one = get_latest_form(form_one_name)
+ user_info_values=['Educational', 'Penn State']
+ self.create_user_with_info( 'test2(a)bx.psu.edu', 'testuser', 'test2',
+ user_info_forms='single',
+ user_info_form_id=form_one.id,
+ user_info_values=user_info_values )
+ self.home()
+ self.visit_page( "user/show_info" )
+ self.check_page_for_string( "Manage User Information" )
+ for value in user_info_values:
+ self.check_page_for_string( value )
+ def test_015_edit_user_info( self ):
+ """Testing editing user info as a regular user"""
+ self.logout()
+ self.login( 'test1(a)bx.psu.edu' )
+ user = sa_session.query( galaxy.model.User ) \
+ .filter( and_( galaxy.model.User.table.c.email=='test1(a)bx.psu.edu' ) ).first()
+ self.edit_login_info( new_email='test1_new(a)bx.psu.edu', new_username='test1_new' )
+ self.change_password('testuser', 'new_testuser')
+ self.edit_user_info( ['Research', 'PSU'] )
+ def test_020_create_user_as_admin( self ):
+ ''' Testing creating users as an admin '''
+ self.logout()
+ self.login( 'test2(a)bx.psu.edu' )
+ form_one = get_latest_form(form_one_name)
+ user_info_values=['Educational', 'Penn State']
+ self.create_user_with_info( 'test3(a)bx.psu.edu', 'testuser', 'test3',
+ user_info_forms='single',
+ user_info_form_id=form_one.id,
+ user_info_values=user_info_values )
+ self.logout()
+ self.login( 'test(a)bx.psu.edu' )
+ user = sa_session.query( galaxy.model.User ) \
+ .filter( and_( galaxy.model.User.table.c.email=='test3(a)bx.psu.edu' ) ).first()
+ self.home()
+ page = "admin/users?id=%s&operation=information&f-deleted=False" % self.security.encode_id( user.id )
+ self.visit_page( page )
+ self.check_page_for_string( 'Manage User Information' )
+ self.check_page_for_string( 'test3(a)bx.psu.edu' )
+ for value in user_info_values:
+ self.check_page_for_string( value )
+ # lets delete the 'Student' user info form
+ self.login( 'test(a)bx.psu.edu' )
+ form_one_latest = get_latest_form(form_one_name)
+ form_one_latest.current.deleted = True
+ form_one_latest.current.flush()
+ self.home()
+ self.visit_page('forms/manage?show_filter=Deleted')
+ self.check_page_for_string(form_one_latest.name)
+ self.logout()
+
\ No newline at end of file
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/6e657b4aa837
changeset: 2943:6e657b4aa837
user: Nate Coraor <nate(a)bx.psu.edu>
date: Mon Nov 02 16:52:32 2009 -0500
description:
Update rg test data sample outputs to match the new versions Ross uploaded
diffstat:
test-data/rgenetics.bed | 2 +-
test-data/rgenetics.bim | 35 ++++++++---
test-data/rgenetics.fam | 130 +++++++++++++------------------------------
test-data/rgenetics.map | 35 ++++++++---
test-data/rgenetics.ped | 130 +++++++++++++------------------------------
5 files changed, 131 insertions(+), 201 deletions(-)
diffs (354 lines):
diff -r 67dce52402fd -r 6e657b4aa837 test-data/rgenetics.bed
--- a/test-data/rgenetics.bed Mon Nov 02 16:21:28 2009 -0500
+++ b/test-data/rgenetics.bed Mon Nov 02 16:52:32 2009 -0500
@@ -1,1 +1,1 @@
-lÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿï¾î¸ÿÿüþ¿ÿ¿ûú¿¿ï/ÿÿþÿï¯ê¸ëê°®¾î®ãê¸;ì/âïú¯ï¯Îê¼ïâ°¯þÏªã¯ø+ì?âÿú¯ïëÿî¾ÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïÿÿÿÿÿºÿÿþ¯þï¿ÿ»ÿÿþÿÿÿïëÿî¾ÿºþÿþ¯þï¿ÿ;ï?þÿÿÿÿÿÿÿþïÿÿÿþÿÿÿÿûÿûÿÿÿ»ÿïëÿî¾ÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïëÿê¾ÿºúïþ¯îë¿þ;¯>âïþ»
\ No newline at end of file
+lÿëþ¿¾+êóª¿ü £ïªîþ¨êÿïªûÿÿÿÿÿÿþﮨª"ëú £ïªîþ¨ÿÿ»ÿÿïïþÿèÿþ"ÿ«ïªîþ¨:*ÿïêüº.«ë:*ÿïêüº.«ëÿÿÿÿ¯ÿ¿ïþ¿ÿþªÿ¯û¿ïþ¿:*»ïêìª,«À:*»ïêìª,«Àÿëþ¿¾+êóª¿ÿÿÿÿûÿúÿÿÿÿÿÿÿÿÿ¿þ¿ÿëþ¿¾+ê󪿺ûÿÿ¿»ÿÿþ¿êÿÿªûÿÿÿÿÿºûÿÿ¿»ÿÿþ¿mÿÿÿýÿÿÿÿÿ ú¢ª±«¯ü(:ú¢ÿ¿«¯ü(:ú¢ÿ¿«¯ü(:ú¢ÿ¿«¯ü(
\ No newline at end of file
diff -r 67dce52402fd -r 6e657b4aa837 test-data/rgenetics.bim
--- a/test-data/rgenetics.bim Mon Nov 02 16:21:28 2009 -0500
+++ b/test-data/rgenetics.bim Mon Nov 02 16:52:32 2009 -0500
@@ -1,10 +1,25 @@
-22 rs5992809 16.5965 16596539 0 C
-22 rs12168131 16.6573 16657262 G A
-22 rs390041 16.6629 16662916 T C
-22 rs437633 16.6697 16669684 A G
-22 rs450960 16.6909 16690858 T C
-22 rs450975 16.6909 16690887 T C
-22 rs451740 16.6912 16691174 T C
-22 rs8139723 16.6917 16691696 T C
-22 rs405490 16.6922 16692175 G A
-22 rs415170 16.6935 16693517 G C
+22 rs2283802 0 21784722 4 2
+22 rs2267000 0 21785366 4 2
+22 rs16997606 0 21794754 1 3
+22 rs4820537 0 21794810 1 3
+22 rs3788347 0 21797804 3 1
+22 rs756632 0 21799918 4 2
+22 rs4820539 0 21807970 1 3
+22 rs2283804 0 21820335 1 2
+22 rs2267006 0 21820990 3 1
+22 rs4822363 0 21821000 4 2
+22 rs5751592 0 21827674 4 2
+22 rs5759608 0 21832708 2 4
+22 rs5759612 0 21833170 3 1
+22 rs2267009 0 21860168 3 4
+22 rs2267010 0 21864366 3 1
+22 rs5759636 0 21868698 4 2
+22 rs2071436 0 21871488 4 2
+22 rs2267013 0 21875879 3 1
+22 rs6003566 0 21889806 3 1
+22 rs2256725 0 21892891 2 1
+22 rs12160770 0 21892925 1 3
+22 rs5751611 0 21896019 2 4
+22 rs762601 0 21898858 1 3
+22 rs2156921 0 21899063 3 1
+22 rs4822375 0 21905642 1 3
diff -r 67dce52402fd -r 6e657b4aa837 test-data/rgenetics.fam
--- a/test-data/rgenetics.fam Mon Nov 02 16:21:28 2009 -0500
+++ b/test-data/rgenetics.fam Mon Nov 02 16:52:32 2009 -0500
@@ -1,90 +1,40 @@
-CH18526 NA18526 0 0 2 1
-CH18524 NA18524 0 0 1 1
-CH18529 NA18529 0 0 2 1
-CH18558 NA18558 0 0 1 1
-CH18532 NA18532 0 0 2 1
-CH18561 NA18561 0 0 1 1
-CH18562 NA18562 0 0 1 1
-CH18537 NA18537 0 0 2 2
-CH18603 NA18603 0 0 1 2
-CH18540 NA18540 0 0 2 1
-CH18605 NA18605 0 0 1 1
-CH18542 NA18542 0 0 2 1
-CH18545 NA18545 0 0 2 1
-CH18572 NA18572 0 0 1 2
-CH18547 NA18547 0 0 2 2
-CH18609 NA18609 0 0 1 1
-CH18550 NA18550 0 0 2 1
-CH18608 NA18608 0 0 1 1
-CH18552 NA18552 0 0 2 1
-CH18611 NA18611 0 0 1 1
-CH18555 NA18555 0 0 2 1
-CH18564 NA18564 0 0 2 2
-CH18566 NA18566 0 0 2 1
-CH18563 NA18563 0 0 1 1
-CH18570 NA18570 0 0 2 1
-CH18612 NA18612 0 0 1 2
-CH18571 NA18571 0 0 2 1
-CH18620 NA18620 0 0 1 1
-CH18621 NA18621 0 0 1 1
-CH18594 NA18594 0 0 2 1
-CH18622 NA18622 0 0 1 2
-CH18573 NA18573 0 0 2 2
-CH18623 NA18623 0 0 1 1
-CH18576 NA18576 0 0 2 1
-CH18577 NA18577 0 0 2 1
-CH18624 NA18624 0 0 1 1
-CH18579 NA18579 0 0 2 1
-CH18632 NA18632 0 0 1 2
-CH18582 NA18582 0 0 2 1
-CH18633 NA18633 0 0 1 1
-CH18635 NA18635 0 0 1 2
-CH18592 NA18592 0 0 2 1
-CH18636 NA18636 0 0 1 1
-CH18593 NA18593 0 0 2 2
-CH18637 NA18637 0 0 1 1
-JA18942 NA18942 0 0 2 2
-JA18940 NA18940 0 0 1 2
-JA18951 NA18951 0 0 2 2
-JA18943 NA18943 0 0 1 2
-JA18947 NA18947 0 0 2 2
-JA18944 NA18944 0 0 1 2
-JA18945 NA18945 0 0 1 2
-JA18949 NA18949 0 0 2 2
-JA18948 NA18948 0 0 1 2
-JA18952 NA18952 0 0 1 2
-JA18956 NA18956 0 0 2 2
-JA18964 NA18964 0 0 2 2
-JA18953 NA18953 0 0 1 1
-JA18968 NA18968 0 0 2 2
-JA18959 NA18959 0 0 1 2
-JA18969 NA18969 0 0 2 1
-JA18960 NA18960 0 0 1 2
-JA18961 NA18961 0 0 1 2
-JA18972 NA18972 0 0 2 2
-JA18965 NA18965 0 0 1 2
-JA18973 NA18973 0 0 2 2
-JA18966 NA18966 0 0 1 2
-JA18975 NA18975 0 0 2 2
-JA18967 NA18967 0 0 1 2
-JA18976 NA18976 0 0 2 1
-JA18978 NA18978 0 0 2 2
-JA18970 NA18970 0 0 1 1
-JA18980 NA18980 0 0 2 2
-JA18995 NA18995 0 0 1 1
-JA18981 NA18981 0 0 2 2
-JA18971 NA18971 0 0 1 2
-JA18974 NA18974 0 0 1 1
-JA18987 NA18987 0 0 2 2
-JA18990 NA18990 0 0 1 1
-JA18991 NA18991 0 0 2 2
-JA18994 NA18994 0 0 1 2
-JA18992 NA18992 0 0 2 2
-JA18997 NA18997 0 0 2 2
-JA18998 NA18998 0 0 2 2
-JA19000 NA19000 0 0 1 2
-JA19005 NA19005 0 0 1 2
-JA18999 NA18999 0 0 2 2
-JA19007 NA19007 0 0 1 2
-JA19003 NA19003 0 0 2 2
-JA19012 NA19012 0 0 1 2
+101 1 3 2 2 2
+101 2 0 0 2 1
+101 3 0 0 1 1
+105 1 3 2 2 2
+105 2 0 0 2 1
+105 3 0 0 1 1
+112 1 3 2 1 2
+112 2 0 0 2 1
+112 3 0 0 1 1
+117 1 3 2 2 2
+117 2 0 0 2 1
+117 3 0 0 1 1
+12 1 3 2 1 2
+12 2 0 0 2 1
+12 3 0 0 1 1
+13 1 3 2 1 2
+13 2 0 0 2 1
+13 3 0 0 1 1
+1334 1 10 11 1 2
+1334 10 0 0 1 1
+1334 11 0 0 2 1
+1334 12 0 0 1 1
+1334 13 0 0 2 1
+1334 2 12 13 2 2
+1340 1 9 10 1 2
+1340 10 0 0 2 1
+1340 11 0 0 1 1
+1340 12 0 0 2 1
+1340 2 11 12 2 2
+1340 9 0 0 1 1
+1341 1 11 12 1 1
+1341 11 0 0 1 1
+1341 12 0 0 2 1
+1341 13 0 0 1 1
+1341 14 0 0 2 1
+1341 2 13 14 2 1
+1344 1 12 13 1 1
+1344 12 0 0 1 1
+1344 13 0 0 2 1
+1345 12 0 0 1 1
diff -r 67dce52402fd -r 6e657b4aa837 test-data/rgenetics.map
--- a/test-data/rgenetics.map Mon Nov 02 16:21:28 2009 -0500
+++ b/test-data/rgenetics.map Mon Nov 02 16:52:32 2009 -0500
@@ -1,10 +1,25 @@
-22 rs5992809 16.5965 16596539
-22 rs12168131 16.6573 16657262
-22 rs390041 16.6629 16662916
-22 rs437633 16.6697 16669684
-22 rs450960 16.6909 16690858
-22 rs450975 16.6909 16690887
-22 rs451740 16.6912 16691174
-22 rs8139723 16.6917 16691696
-22 rs405490 16.6922 16692175
-22 rs415170 16.6935 16693517
+22 rs2283802 0 21784722
+22 rs2267000 0 21785366
+22 rs16997606 0 21794754
+22 rs4820537 0 21794810
+22 rs3788347 0 21797804
+22 rs756632 0 21799918
+22 rs4820539 0 21807970
+22 rs2283804 0 21820335
+22 rs2267006 0 21820990
+22 rs4822363 0 21821000
+22 rs5751592 0 21827674
+22 rs5759608 0 21832708
+22 rs5759612 0 21833170
+22 rs2267009 0 21860168
+22 rs2267010 0 21864366
+22 rs5759636 0 21868698
+22 rs2071436 0 21871488
+22 rs2267013 0 21875879
+22 rs6003566 0 21889806
+22 rs2256725 0 21892891
+22 rs12160770 0 21892925
+22 rs5751611 0 21896019
+22 rs762601 0 21898858
+22 rs2156921 0 21899063
+22 rs4822375 0 21905642
diff -r 67dce52402fd -r 6e657b4aa837 test-data/rgenetics.ped
--- a/test-data/rgenetics.ped Mon Nov 02 16:21:28 2009 -0500
+++ b/test-data/rgenetics.ped Mon Nov 02 16:52:32 2009 -0500
@@ -1,90 +1,40 @@
-CH18526 NA18526 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18524 NA18524 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18529 NA18529 0 0 2 1 C C A A T C A G T C T C T C C C G A G C
-CH18558 NA18558 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18532 NA18532 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18561 NA18561 0 0 1 1 C C A A C C G G T C C C T C C C G A G C
-CH18562 NA18562 0 0 1 1 C C G A T C A G T C C C T C C C G A G C
-CH18537 NA18537 0 0 2 2 C C A A T C A G C C C C C C C C A A C C
-CH18603 NA18603 0 0 1 2 C C G A T C A G C C C C C C C C A A C C
-CH18540 NA18540 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18605 NA18605 0 0 1 1 C C A A T T A A C C C C C C C C A A C C
-CH18542 NA18542 0 0 2 1 C C G A T C G G C C C C C C C C A A C C
-CH18545 NA18545 0 0 2 1 C C G A T C A G T C C C T C C C G A G C
-CH18572 NA18572 0 0 1 2 C C A A T C A G C C C C C C C C A A G C
-CH18547 NA18547 0 0 2 2 C C G A T C A G T C C C T C C C G A G C
-CH18609 NA18609 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18550 NA18550 0 0 2 1 C C G G T T A A T C C C T C T C G A G C
-CH18608 NA18608 0 0 1 1 C C G A T C G G C C C C C C C C A A C C
-CH18552 NA18552 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18611 NA18611 0 0 1 1 C C G A T C A G T C C C T C C C G A G C
-CH18555 NA18555 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18564 NA18564 0 0 2 2 C C A A T C G G C C C C C C C C A A C C
-CH18566 NA18566 0 0 2 1 C C A A T C A G C C C C C C T C A A C C
-CH18563 NA18563 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18570 NA18570 0 0 2 1 C C A A T C A G T C T C T C C C G A G C
-CH18612 NA18612 0 0 1 2 C C A A T C A A T C T C T C C C G A G C
-CH18571 NA18571 0 0 2 1 C C A A T C A G C C C C C C C C A A C C
-CH18620 NA18620 0 0 1 1 C C A A C C G G T C T C T C C C G A G C
-CH18621 NA18621 0 0 1 1 C C G G T T A A T C C C T C C C G A G C
-CH18594 NA18594 0 0 2 1 C C A A T T A A C C C C C C C C A A G C
-CH18622 NA18622 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-CH18573 NA18573 0 0 2 2 C C A A T C A G C C C C C C C C A A C C
-CH18623 NA18623 0 0 1 1 C C G A T C G G C C C C C C C C A A C C
-CH18576 NA18576 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18577 NA18577 0 0 2 1 C C A A T C A G C C C C C C C C A A G C
-CH18624 NA18624 0 0 1 1 C C A A T C A G C C C C C C C C A A C C
-CH18579 NA18579 0 0 2 1 C C A A T C A G T C T C T C T C G A G C
-CH18632 NA18632 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-CH18582 NA18582 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18633 NA18633 0 0 1 1 C C G A T C G G C C C C C C C C A A C C
-CH18635 NA18635 0 0 1 2 C C A A T C G G C C C C C C C C A A C C
-CH18592 NA18592 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18636 NA18636 0 0 1 1 C C A A T C A A T C T C T C C C G A G C
-CH18593 NA18593 0 0 2 2 C C A A C C G G T C T C T C C C G A G C
-CH18637 NA18637 0 0 1 1 C C A A T C A G T C T C T C C C G A G C
-JA18942 NA18942 0 0 2 2 C C A A C C A G C C C C C C C C A A C C
-JA18940 NA18940 0 0 1 2 C C A A T C A G C C C C C C C C A A G C
-JA18951 NA18951 0 0 2 2 C C G A T C A G C C C C C C C C A A C C
-JA18943 NA18943 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA18947 NA18947 0 0 2 2 C C G A T T A A C C C C C C C C A A G C
-JA18944 NA18944 0 0 1 2 C C A A T C A G T C T C T C C C G A G C
-JA18945 NA18945 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA18949 NA18949 0 0 2 2 C C G A T C G G C C C C C C C C A A C C
-JA18948 NA18948 0 0 1 2 C C G A T C G G C C C C C C C C A A C C
-JA18952 NA18952 0 0 1 2 C C A A T C A G C C C C C C C C A A C C
-JA18956 NA18956 0 0 2 2 C C A A C C A G T C T C T C C C G A G C
-JA18964 NA18964 0 0 2 2 C C A A T T A A C C C C C C C C A A G C
-JA18953 NA18953 0 0 1 1 C C A A T C A G C C C C C C T C A A C C
-JA18968 NA18968 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18959 NA18959 0 0 1 2 C C G A T C G G C C C C C C C C A A C C
-JA18969 NA18969 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-JA18960 NA18960 0 0 1 2 C C A A T C A G T C T C T C C C G A G C
-JA18961 NA18961 0 0 1 2 C C A A C C A G C C C C C C C C A A C C
-JA18972 NA18972 0 0 2 2 C C G A T T A A T T T C T T C C G G G G
-JA18965 NA18965 0 0 1 2 C C A A T T A A C C C C C C C C A A C C
-JA18973 NA18973 0 0 2 2 C C A A C C G G C C C C C C T C A A C C
-JA18966 NA18966 0 0 1 2 C C G A T C A G T C C C T C C C G A G C
-JA18975 NA18975 0 0 2 2 C C A A C C G G C C C C C C C C A A G C
-JA18967 NA18967 0 0 1 2 C C A A C C G G C C C C C C C C A A G C
-JA18976 NA18976 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-JA18978 NA18978 0 0 2 2 C C G A T C G G C C C C C C C C A A C C
-JA18970 NA18970 0 0 1 1 C C G G T T A A T T C C T T C C G G G G
-JA18980 NA18980 0 0 2 2 C C A A T C A G T C T C T C C C G A G C
-JA18995 NA18995 0 0 1 1 C C A A T T A A C C C C C C C C A A G G
-JA18981 NA18981 0 0 2 2 C C A A T C A G C C C C C C C C A A G C
-JA18971 NA18971 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA18974 NA18974 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-JA18987 NA18987 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18990 NA18990 0 0 1 1 C C A A T C G G C C C C C C C C A A G C
-JA18991 NA18991 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18994 NA18994 0 0 1 2 C C G A T C A G C C C C C C C C A A G C
-JA18992 NA18992 0 0 2 2 C C A A T C A G C C C C C C T C A A C C
-JA18997 NA18997 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18998 NA18998 0 0 2 2 C C A A C C G G C C C C C C T C A A C C
-JA19000 NA19000 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA19005 NA19005 0 0 1 2 C C A A C C G G C C C C C C C C A A G C
-JA18999 NA18999 0 0 2 2 C C A A T C A G C C C C C C C C A A C C
-JA19007 NA19007 0 0 1 2 C C A A T C A G C C C C C C C C A A G C
-JA19003 NA19003 0 0 2 2 C C A A T C G G C C C C C C C C A A C C
-JA19012 NA19012 0 0 1 2 C C A A 0 0 G G C C C C C C 0 0 A A C C
+101 1 3 2 2 2 2 2 4 2 1 3 3 3 3 3 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 1 1 2 2 2 2 3 1 3 1 2 1 0 0 2 2 1 3 3 1 1 3
+101 2 0 0 2 1 2 2 4 2 1 3 3 3 3 3 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 1 1 2 2 2 2 3 1 3 1 2 1 3 3 2 2 1 3 3 1 1 3
+101 3 0 0 1 1 2 2 4 4 1 3 3 3 3 3 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 1 3 2 4 3 3 1 1 3 3
+105 1 3 2 2 2 2 2 4 2 3 3 3 3 3 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 3 1 1 1 2 1 0 0 2 2 1 1 3 3 1 1
+105 2 0 0 2 1 2 2 4 4 3 3 3 3 3 1 2 2 1 3 1 2 3 1 2 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+105 3 0 0 1 1 4 2 2 2 3 3 3 3 3 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+112 1 3 2 1 2 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+112 2 0 0 2 1 2 2 2 2 3 3 1 1 1 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+112 3 0 0 1 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 2 2 1 1 2 2 4 2 4 4 1 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+117 1 3 2 2 2 2 2 4 2 3 3 3 3 3 3 4 2 1 1 2 2 1 1 2 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 2 1 1 3 3 1 1
+117 2 0 0 2 1 2 2 4 4 1 3 3 3 3 3 2 2 1 3 2 2 1 1 2 2 4 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+117 3 0 0 1 1 2 2 4 2 3 3 3 3 3 3 4 2 1 1 2 2 1 1 2 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+12 1 3 2 1 2 2 2 4 4 1 3 3 3 3 3 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+12 2 0 0 2 1 2 2 4 4 1 3 3 3 3 3 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+12 3 0 0 1 1 2 2 4 2 1 3 1 3 3 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+13 1 3 2 1 2 4 2 4 2 1 3 3 3 3 1 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 3 4 1 1 2 2 4 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+13 2 0 0 2 1 4 2 2 2 3 3 1 3 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 0 0 0 0 3 3 1 1 3 3
+13 3 0 0 1 1 2 2 4 4 1 3 3 3 3 3 2 2 1 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 3 1 2 2 2 2 1 1 3 1 1 1 3 3 2 2 3 3 1 1 3 3
+1334 1 10 11 1 2 2 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 4 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1334 10 0 0 1 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 2 2 1 1 4 2 4 2 4 4 1 1 3 4 1 1 2 2 4 2 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+1334 11 0 0 2 1 2 2 2 2 3 3 1 1 1 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1334 12 0 0 1 1 4 2 2 2 3 3 1 3 1 1 2 2 3 3 2 2 1 1 2 2 4 2 4 4 1 1 3 4 1 1 2 2 4 2 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+1334 13 0 0 2 1 4 2 4 2 3 3 1 3 3 1 4 2 1 3 2 2 1 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1334 2 12 13 2 2 4 4 2 2 3 3 1 3 1 1 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 3 3 1 1 2 2 4 4 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+1340 1 9 10 1 2 4 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 3 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1340 10 0 0 2 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 3 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1340 11 0 0 1 1 4 2 4 2 3 3 1 3 3 1 4 2 1 3 2 2 1 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1340 12 0 0 2 1 2 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 4 2 4 2 2 4 3 1 4 4 1 1 4 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1340 2 11 12 2 2 2 2 4 2 3 3 1 3 3 1 4 2 1 3 1 2 3 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1340 9 0 0 1 1 4 4 2 2 3 3 1 1 1 1 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 3 3 1 1 2 2 4 4 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1341 1 11 12 1 1 2 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 4 2 4 2 2 4 3 1 4 4 1 1 0 0 2 2 1 1 1 1 1 1 3 3 2 2 1 1 3 3 1 1
+1341 11 0 0 1 1 2 2 2 2 3 3 1 1 1 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 4 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1341 12 0 0 2 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 2 2 1 1 4 2 4 2 4 4 1 1 3 4 1 1 4 2 4 2 3 1 1 1 2 1 3 3 2 2 1 1 3 3 1 1
+1341 13 0 0 1 1 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1341 14 0 0 2 1 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1341 2 13 14 2 1 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1344 1 12 13 1 1 2 2 4 4 3 3 3 3 3 3 4 4 1 1 2 2 1 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 2 1 1 3 3 1 1
+1344 12 0 0 1 1 2 2 4 2 3 3 1 3 3 1 4 2 1 3 1 2 3 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1344 13 0 0 2 1 2 2 4 2 3 3 1 3 3 1 4 2 1 3 1 2 3 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1345 12 0 0 1 1 4 2 4 2 3 3 3 3 3 1 2 2 1 3 2 2 1 1 4 2 4 2 4 4 1 1 3 4 1 1 4 2 4 2 3 1 1 1 2 1 3 3 2 2 1 1 3 3 1 1
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/67dce52402fd
changeset: 2942:67dce52402fd
user: Nate Coraor <nate(a)bx.psu.edu>
date: Mon Nov 02 16:21:28 2009 -0500
description:
Remove old encode import tools
diffstat:
tools/data_source/encode_import.py | 82 ----------
tools/data_source/encode_import_all_latest_datasets.xml | 65 --------
tools/data_source/encode_import_chromatin_and_chromosomes.xml | 64 --------
tools/data_source/encode_import_code.py | 54 ------
tools/data_source/encode_import_gencode.xml | 67 --------
tools/data_source/encode_import_genes_and_transcripts.xml | 64 --------
tools/data_source/encode_import_multi-species_sequence_analysis.xml | 66 --------
tools/data_source/encode_import_transcription_regulation.xml | 65 --------
8 files changed, 0 insertions(+), 527 deletions(-)
diffs (565 lines):
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import.py
--- a/tools/data_source/encode_import.py Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Script that imports locally stored data as a new dataset for the user
-Usage: import id outputfile
-"""
-import sys, os
-from shutil import copyfile
-
-assert sys.version_info[:2] >= ( 2, 4 )
-
-BUFFER = 1048576
-
-def stop_err( msg ):
- sys.stderr.write( msg )
- sys.exit()
-
-def main():
- uids = sys.argv[1].split(",")
- out_file1 = sys.argv[2]
- file_name = "%s/encode_datasets.loc" % sys.argv[3]
-
- #remove NONE from uids
- have_none = True
- while have_none:
- try:
- uids.remove('None')
- except:
- have_none = False
-
- #create dictionary keyed by uid of tuples of (displayName,filePath,build) for all files
- available_files = {}
- try:
- for i, line in enumerate( file ( file_name ) ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ):
- fields = line.split( '\t' )
- try:
- encode_group = fields[0].strip()
- build = fields[1].strip()
- description = fields[2].strip()
- uid = fields[3].strip()
- path = fields[4].strip()
- try:
- file_type = fields[5].strip()
- except:
- file_type = "bed"
- except:
- continue
- available_files[uid] = ( description, path, build, file_type )
- except:
- stop_err( "It appears that the configuration file for this tool is missing." )
-
- #create list of tuples of ( displayName, FileName, build ) for desired files
- desired_files = []
- for uid in uids:
- try:
- desired_files.append( available_files[uid] )
- except:
- continue
-
- #copy first file to contents of given output file
- file1_copied = False
- while not file1_copied:
- try:
- first_file = desired_files.pop(0)
- except:
- stop_err( "There were no valid files requested." )
- file1_desc, file1_path, file1_build, file1_type = first_file
- try:
- copyfile( file1_path, out_file1 )
- print "#File1\t" + file1_desc + "\t" + file1_build + "\t" + file1_type
- file1_copied = True
- except:
- stop_err( "The file '%s' is missing." %str( file1_path ) )
-
- #Tell post-process filter where remaining files reside
- for extra_output in desired_files:
- file_desc, file_path, file_build, file_type = extra_output
- print "#NewFile\t" + file_desc + "\t" + file_build + "\t" + file_path + "\t" + file_type
-
-if __name__ == "__main__": main()
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import_all_latest_datasets.xml
--- a/tools/data_source/encode_import_all_latest_datasets.xml Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-<tool id="encode_import_all_latest_datasets1" name="Combined Datasets">
- <command interpreter="python">encode_import.py $hg17,$hg16 $output ${GALAXY_DATA_INDEX_DIR}</command>
- <inputs>
- <display>
- <p><div class="toolFormTitle">hg17 (most recent datasets in bold)</div>$hg17</p>
- <p><div class="toolFormTitle">hg16 (most recent datasets in bold)</div>$hg16</p>
- </display>
- <param name="hg17" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="ALD" column="0"/>
- <filter type="static_value" name="dbkey" value="hg17" column="1"/>
- </options>
- </param>
- <param name="hg16" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="ALD" column="0"/>
- <filter type="static_value" name="dbkey" value="hg16" column="1"/>
- </options>
- </param>
- </inputs>
- <outputs>
- <data format="bed" name="output"/>
- </outputs>
- <code file="encode_import_code.py"/>
- <help>
-
-.. class:: warningmark
-
-The data in this section is intended as a supplement for this manuscript_. Use the **Get Data->UCSC Main** tool for current ENCODE data.
-
-.. _manuscript: http://www.genome.org/cgi/content/full/17/6/960
-
-For detailed information about data deposition and partitioning, click here_.
-
-.. _here: http://genome.imim.es/gencode/wiki/index.php/Collecting_Feature_Sets_from_A…
-
-*[gencode_partitioned]* means that the dataset was partitioned according to the protocol below:
-
-A partition scheme has been defined that is similar to what has previously been done with TARs/TRANSFRAGs such that any feature can be classified as falling into one of the following 6 categories:
- 1. **Coding** -- coding exons defined from the GENCODE experimentally verified coding set (coding in any transcript)
- 2. **5UTR** -- 5' UTR exons defined from the GENCODE experimentally verified coding set (5' UTR in some transcript but never coding in any other)
- 3. **3UTR** -- 3' UTR exons defined from the GENCODE experimentally verified coding set (3' UTR in some transcript but never coding in any other)
- 4. **Intronic Proximal** -- intronic and no more than 5kb away from an exon.
- 5. **Intergenic Proximal** -- between genes and no more than 5kb away from an exon.
- 6. **Intronic Distal** -- intronic and greater than 5kb away from an exon.
- 7. **Intergenic Distal** -- between genes and greater than 5kb away from an exon.
-
------
-
-.. class:: infomark
-
-**Note:** Features overlapping more than one partition will take the identity of the lower-numbered partition.
-
-
- </help>
-</tool>
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import_chromatin_and_chromosomes.xml
--- a/tools/data_source/encode_import_chromatin_and_chromosomes.xml Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-<tool id="encode_import_chromatin_and_chromosomes1" name="Chromatin and Chromosomes">
- <command interpreter="python">encode_import.py $hg17,$hg16 $output ${GALAXY_DATA_INDEX_DIR}</command>
- <inputs>
- <display>
- <p><div class="toolFormTitle">hg17 (most recent datasets in bold)</div>$hg17</p>
- <p><div class="toolFormTitle">hg16 (most recent datasets in bold)</div>$hg16</p>
- </display>
- <param name="hg17" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="CC" column="0"/>
- <filter type="static_value" name="dbkey" value="hg17" column="1"/>
- </options>
- </param>
- <param name="hg16" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="CC" column="0"/>
- <filter type="static_value" name="dbkey" value="hg16" column="1"/>
- </options>
- </param>
- </inputs>
- <outputs>
- <data format="bed" name="output"/>
- </outputs>
- <code file="encode_import_code.py"/>
- <help>
-
-.. class:: warningmark
-
-The data in this section is intended as a supplement for this manuscript_. Use the **Get Data->UCSC Main** tool for current ENCODE data.
-
-.. _manuscript: http://www.genome.org/cgi/content/full/17/6/960
-
-For detailed information about data deposition and partitioning, click here_.
-
-.. _here: http://genome.imim.es/gencode/wiki/index.php/Collecting_Feature_Sets_from_A…
-
-*[gencode_partitioned]* means that the dataset was partitioned according to the protocol below:
-
-A partition scheme has been defined that is similar to what has previously been done with TARs/TRANSFRAGs such that any feature can be classified as falling into one of the following 6 categories:
- 1. **Coding** -- coding exons defined from the GENCODE experimentally verified coding set (coding in any transcript)
- 2. **5UTR** -- 5' UTR exons defined from the GENCODE experimentally verified coding set (5' UTR in some transcript but never coding in any other)
- 3. **3UTR** -- 3' UTR exons defined from the GENCODE experimentally verified coding set (3' UTR in some transcript but never coding in any other)
- 4. **Intronic Proximal** -- intronic and no more than 5kb away from an exon.
- 5. **Intergenic Proximal** -- between genes and no more than 5kb away from an exon.
- 6. **Intronic Distal** -- intronic and greater than 5kb away from an exon.
- 7. **Intergenic Distal** -- between genes and greater than 5kb away from an exon.
-
------
-
-.. class:: infomark
-
-**Note:** Features overlapping more than one partition will take the identity of the lower-numbered partition.
-
- </help>
-</tool>
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import_code.py
--- a/tools/data_source/encode_import_code.py Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-import os, sys
-
-from galaxy import datatypes, config, jobs
-from shutil import copyfile
-
-#post processing, set build for data and add additional data to history
-def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
- base_dataset = out_data.items()[0][1]
- history = base_dataset.history
- if history == None:
- print "unknown history!"
- return
- new_stdout = ""
- split_stdout = stdout.split("\n")
- basic_name = ""
- for line in split_stdout:
- fields = line.split("\t")
- if fields[0] == "#File1":
- description = fields[1]
- dbkey = fields[2]
- file_type = fields[3]
- name, data = out_data.items()[0]
- data.set_size()
- basic_name = data.name
- data.name = data.name + " (" + description + ")"
- data.dbkey = dbkey
- data.info = data.name
- data = app.datatypes_registry.change_datatype( data, file_type )
- data.init_meta()
- data.set_peek()
- app.model.flush()
- elif fields[0] == "#NewFile":
- description = fields[1]
- dbkey = fields[2]
- filepath = fields[3]
- file_type = fields[4]
- newdata = app.model.HistoryDatasetAssociation( create_dataset = True ) #This import should become a library
- newdata.set_size()
- newdata.extension = file_type
- newdata.name = basic_name + " (" + description + ")"
- history.add_dataset( newdata )
- app.security_agent.copy_dataset_permissions( base_dataset.dataset, newdata.dataset )
- app.model.flush()
- try:
- copyfile(filepath,newdata.file_name)
- newdata.info = newdata.name
- newdata.state = jobs.JOB_OK
- except:
- newdata.info = "The requested file is missing from the system."
- newdata.state = jobs.JOB_ERROR
- newdata.dbkey = dbkey
- newdata.set_meta()
- newdata.set_peek()
- app.model.flush()
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import_gencode.xml
--- a/tools/data_source/encode_import_gencode.xml Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-<tool id="encode_import_gencode1" name="Gencode Datasets">
- <command interpreter="python">encode_import.py $hg17,$hg16 $output ${GALAXY_DATA_INDEX_DIR}</command>
- <inputs>
- <display>
- <p><div class="toolFormTitle">hg17 (most recent datasets in bold)</div>$hg17</p>
- <p><div class="toolFormTitle">hg16 (most recent datasets in bold)</div>$hg16</p>
- </display>
- <param name="hg17" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="GENCODE" column="0"/>
- <filter type="static_value" name="dbkey" value="hg17" column="1"/>
- </options>
- </param>
- <param name="hg16" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="GENCODE" column="0"/>
- <filter type="static_value" name="dbkey" value="hg16" column="1"/>
- </options>
- </param>
- </inputs>
- <outputs>
- <data format="bed" name="output"/>
- </outputs>
- <code file="encode_import_code.py"/>
- <help>
-
-.. class:: warningmark
-
-The data in this section is intended as a supplement for this manuscript_. Use the **Get Data->UCSC Main** tool for current ENCODE data.
-
-.. _manuscript: http://www.genome.org/cgi/content/full/17/6/960
-
-These are the datasets used for partitioning files.
-
-For detailed information about data deposition and partitioning, click here_.
-
-.. _here: http://genome.imim.es/gencode/wiki/index.php/Collecting_Feature_Sets_from_A…
-
-*[gencode_partitioned]* means that the dataset was partitioned according to the protocol below:
-
-A partition scheme has been defined that is similar to what has previously been done with TARs/TRANSFRAGs such that any feature can be classified as falling into one of the following 6 categories:
- 1. **Coding** -- coding exons defined from the GENCODE experimentally verified coding set (coding in any transcript)
- 2. **5UTR** -- 5' UTR exons defined from the GENCODE experimentally verified coding set (5' UTR in some transcript but never coding in any other)
- 3. **3UTR** -- 3' UTR exons defined from the GENCODE experimentally verified coding set (3' UTR in some transcript but never coding in any other)
- 4. **Intronic Proximal** -- intronic and no more than 5kb away from an exon.
- 5. **Intergenic Proximal** -- between genes and no more than 5kb away from an exon.
- 6. **Intronic Distal** -- intronic and greater than 5kb away from an exon.
- 7. **Intergenic Distal** -- between genes and greater than 5kb away from an exon.
-
------
-
-.. class:: infomark
-
-**Note:** Features overlapping more than one partition will take the identity of the lower-numbered partition.
-
- </help>
-
-</tool>
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import_genes_and_transcripts.xml
--- a/tools/data_source/encode_import_genes_and_transcripts.xml Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-<tool id="encode_import_genes_and_transcripts1" name="Genes and Transcripts">
- <command interpreter="python">encode_import.py $hg17,$hg16 $output ${GALAXY_DATA_INDEX_DIR}</command>
- <inputs>
- <display>
- <p><div class="toolFormTitle">hg17 (most recent datasets in bold)</div>$hg17</p>
- <p><div class="toolFormTitle">hg16 (most recent datasets in bold)</div>$hg16</p>
- </display>
- <param name="hg17" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="GT" column="0"/>
- <filter type="static_value" name="dbkey" value="hg17" column="1"/>
- </options>
- </param>
- <param name="hg16" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="GT" column="0"/>
- <filter type="static_value" name="dbkey" value="hg16" column="1"/>
- </options>
- </param>
- </inputs>
- <outputs>
- <data format="bed" name="output"/>
- </outputs>
- <code file="encode_import_code.py"/>
- <help>
-
-.. class:: warningmark
-
-The data in this section is intended as a supplement for this manuscript_. Use the **Get Data->UCSC Main** tool for current ENCODE data.
-
-.. _manuscript: http://www.genome.org/cgi/content/full/17/6/960
-
-For detailed information about data deposition and partitioning, click here_.
-
-.. _here: http://genome.imim.es/gencode/wiki/index.php/Collecting_Feature_Sets_from_A…
-
-*[gencode_partitioned]* means that the dataset was partitioned according to the protocol below:
-
-A partition scheme has been defined that is similar to what has previously been done with TARs/TRANSFRAGs such that any feature can be classified as falling into one of the following 6 categories:
- 1. **Coding** -- coding exons defined from the GENCODE experimentally verified coding set (coding in any transcript)
- 2. **5UTR** -- 5' UTR exons defined from the GENCODE experimentally verified coding set (5' UTR in some transcript but never coding in any other)
- 3. **3UTR** -- 3' UTR exons defined from the GENCODE experimentally verified coding set (3' UTR in some transcript but never coding in any other)
- 4. **Intronic Proximal** -- intronic and no more than 5kb away from an exon.
- 5. **Intergenic Proximal** -- between genes and no more than 5kb away from an exon.
- 6. **Intronic Distal** -- intronic and greater than 5kb away from an exon.
- 7. **Intergenic Distal** -- between genes and greater than 5kb away from an exon.
-
------
-
-.. class:: infomark
-
-**Note:** Features overlapping more than one partition will take the identity of the lower-numbered partition.
-
- </help>
-</tool>
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import_multi-species_sequence_analysis.xml
--- a/tools/data_source/encode_import_multi-species_sequence_analysis.xml Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-<tool id="encode_import_multi-species_sequence_analysis1" name="Multi-species Sequence Analysis">
- <command interpreter="python">encode_import.py $hg17,$hg16 $output ${GALAXY_DATA_INDEX_DIR}</command>
- <inputs>
- <display>
- <p><div class="toolFormTitle">hg17 (most recent datasets in bold)</div>$hg17</p>
- <p><div class="toolFormTitle">hg16 (most recent datasets in bold)</div>$hg16</p>
- </display>
- <param name="hg17" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="MSA" column="0"/>
- <filter type="static_value" name="dbkey" value="hg17" column="1"/>
- </options>
- </param>
- <param name="hg16" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="MSA" column="0"/>
- <filter type="static_value" name="dbkey" value="hg16" column="1"/>
- </options>
- </param>
- </inputs>
- <outputs>
- <data format="bed" name="output"/>
- </outputs>
- <code file="encode_import_code.py"/>
- <help>
-
-.. class:: warningmark
-
-The data in this section is intended as a supplement for this manuscript_. Use the **Get Data->UCSC Main** tool for current ENCODE data.
-
-.. _manuscript: http://www.genome.org/cgi/content/full/17/6/960
-
-For detailed information about data deposition and partitioning, click here_.
-
-.. _here: http://genome.imim.es/gencode/wiki/index.php/Collecting_Feature_Sets_from_A…
-
-*[gencode_partitioned]* means that the dataset was partitioned according to the protocol below:
-
-A partition scheme has been defined that is similar to what has previously been done with TARs/TRANSFRAGs such that any feature can be classified as falling into one of the following 6 categories:
- 1. **Coding** -- coding exons defined from the GENCODE experimentally verified coding set (coding in any transcript)
- 2. **5UTR** -- 5' UTR exons defined from the GENCODE experimentally verified coding set (5' UTR in some transcript but never coding in any other)
- 3. **3UTR** -- 3' UTR exons defined from the GENCODE experimentally verified coding set (3' UTR in some transcript but never coding in any other)
- 4. **Intronic Proximal** -- intronic and no more than 5kb away from an exon.
- 5. **Intergenic Proximal** -- between genes and no more than 5kb away from an exon.
- 6. **Intronic Distal** -- intronic and greater than 5kb away from an exon.
- 7. **Intergenic Distal** -- between genes and greater than 5kb away from an exon.
-
------
-
-.. class:: infomark
-
-**Note:** Features overlapping more than one partition will take the identity of the lower-numbered partition.
-
-
-
- </help>
-</tool>
diff -r c81a9407c7a8 -r 67dce52402fd tools/data_source/encode_import_transcription_regulation.xml
--- a/tools/data_source/encode_import_transcription_regulation.xml Mon Nov 02 16:12:31 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-<tool id="encode_import_transcription_regulation1" name="Transcription Regulation">
- <command interpreter="python">encode_import.py $hg17,$hg16 $output ${GALAXY_DATA_INDEX_DIR}</command>
- <inputs>
- <display>
- <p><div class="toolFormTitle">hg17 (most recent datasets in bold)</div>$hg17</p>
- <p><div class="toolFormTitle">hg16 (most recent datasets in bold)</div>$hg16</p>
- </display>
- <param name="hg17" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="TR" column="0"/>
- <filter type="static_value" name="dbkey" value="hg17" column="1"/>
- </options>
- </param>
- <param name="hg16" type="select" display="checkboxes" multiple="true">
- <options from_file="encode_datasets.loc">
- <column name="name" index="2"/>
- <column name="value" index="3"/>
- <column name="dbkey" index="1"/>
- <column name="encode_group" index="0"/>
- <column name="uid" index="3"/>
- <filter type="static_value" name="encode_group" value="TR" column="0"/>
- <filter type="static_value" name="dbkey" value="hg16" column="1"/>
- </options>
- </param>
- </inputs>
- <outputs>
- <data format="bed" name="output"/>
- </outputs>
- <code file="encode_import_code.py"/>
- <help>
-
-.. class:: warningmark
-
-The data in this section is intended as a supplement for this manuscript_. Use the **Get Data->UCSC Main** tool for current ENCODE data.
-
-.. _manuscript: http://www.genome.org/cgi/content/full/17/6/960
-
-For detailed information about data deposition and partitioning, click here_.
-
-.. _here: http://genome.imim.es/gencode/wiki/index.php/Collecting_Feature_Sets_from_A…
-
-*[gencode_partitioned]* means that the dataset was partitioned according to the protocol below:
-
-A partition scheme has been defined that is similar to what has previously been done with TARs/TRANSFRAGs such that any feature can be classified as falling into one of the following 6 categories:
- 1. **Coding** -- coding exons defined from the GENCODE experimentally verified coding set (coding in any transcript)
- 2. **5UTR** -- 5' UTR exons defined from the GENCODE experimentally verified coding set (5' UTR in some transcript but never coding in any other)
- 3. **3UTR** -- 3' UTR exons defined from the GENCODE experimentally verified coding set (3' UTR in some transcript but never coding in any other)
- 4. **Intronic Proximal** -- intronic and no more than 5kb away from an exon.
- 5. **Intergenic Proximal** -- between genes and no more than 5kb away from an exon.
- 6. **Intronic Distal** -- intronic and greater than 5kb away from an exon.
- 7. **Intergenic Distal** -- between genes and greater than 5kb away from an exon.
-
------
-
-.. class:: infomark
-
-**Note:** Features overlapping more than one partition will take the identity of the lower-numbered partition.
-
- </help>
-
-</tool>
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/6e8263ea83fa
changeset: 2939:6e8263ea83fa
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Mon Nov 02 09:54:18 2009 -0500
description:
Bug fix for cleanup_datasets.py - use app.sa_session instead of self.sa_session.
diffstat:
scripts/cleanup_datasets/cleanup_datasets.py | 90 +++++++++++++++---------------
1 files changed, 45 insertions(+), 45 deletions(-)
diffs (156 lines):
diff -r 3aa07fc9512a -r 6e8263ea83fa scripts/cleanup_datasets/cleanup_datasets.py
--- a/scripts/cleanup_datasets/cleanup_datasets.py Fri Oct 30 21:55:17 2009 -0400
+++ b/scripts/cleanup_datasets/cleanup_datasets.py Mon Nov 02 09:54:18 2009 -0500
@@ -93,14 +93,14 @@
history_count = 0
start = time.time()
if force_retry:
- histories = self.sa_session.query( app.model.History ) \
- .filter( and_( app.model.History.table.c.user_id==None,
- app.model.History.table.c.update_time < cutoff_time ) )
+ histories = app.sa_session.query( app.model.History ) \
+ .filter( and_( app.model.History.table.c.user_id==None,
+ app.model.History.table.c.update_time < cutoff_time ) )
else:
- histories = self.sa_session.query( app.model.History ) \
- .filter( and_( app.model.History.table.c.user_id==None,
- app.model.History.table.c.deleted==False,
- app.model.History.table.c.update_time < cutoff_time ) )
+ histories = app.sa_session.query( app.model.History ) \
+ .filter( and_( app.model.History.table.c.user_id==None,
+ app.model.History.table.c.deleted==False,
+ app.model.History.table.c.update_time < cutoff_time ) )
for history in histories:
if not info_only:
print "Deleting history id ", history.id
@@ -121,16 +121,16 @@
history_count = 0
start = time.time()
if force_retry:
- histories = self.sa_session.query( app.model.History ) \
- .filter( and_( app.model.History.table.c.deleted==True,
- app.model.History.table.c.update_time < cutoff_time ) ) \
- .options( eagerload( 'datasets' ) )
+ histories = app.sa_session.query( app.model.History ) \
+ .filter( and_( app.model.History.table.c.deleted==True,
+ app.model.History.table.c.update_time < cutoff_time ) ) \
+ .options( eagerload( 'datasets' ) )
else:
- histories = self.sa_session.query( app.model.History ) \
- .filter( and_( app.model.History.table.c.deleted==True,
- app.model.History.table.c.purged==False,
- app.model.History.table.c.update_time < cutoff_time ) ) \
- .options( eagerload( 'datasets' ) )
+ histories = app.sa_session.query( app.model.History ) \
+ .filter( and_( app.model.History.table.c.deleted==True,
+ app.model.History.table.c.purged==False,
+ app.model.History.table.c.update_time < cutoff_time ) ) \
+ .options( eagerload( 'datasets' ) )
for history in histories:
for dataset_assoc in history.datasets:
_purge_dataset_instance( dataset_assoc, app, remove_from_disk, info_only = info_only ) #mark a DatasetInstance as deleted, clear associated files, and mark the Dataset as deleted if it is deletable
@@ -158,14 +158,14 @@
library_count = 0
start = time.time()
if force_retry:
- libraries = self.sa_session.query( app.model.Library ) \
- .filter( and_( app.model.Library.table.c.deleted==True,
- app.model.Library.table.c.update_time < cutoff_time ) )
+ libraries = app.sa_session.query( app.model.Library ) \
+ .filter( and_( app.model.Library.table.c.deleted==True,
+ app.model.Library.table.c.update_time < cutoff_time ) )
else:
- libraries = self.sa_session.query( app.model.Library ) \
- .filter( and_( app.model.Library.table.c.deleted==True,
- app.model.Library.table.c.purged==False,
- app.model.Library.table.c.update_time < cutoff_time ) )
+ libraries = app.sa_session.query( app.model.Library ) \
+ .filter( and_( app.model.Library.table.c.deleted==True,
+ app.model.Library.table.c.purged==False,
+ app.model.Library.table.c.update_time < cutoff_time ) )
for library in libraries:
_purge_folder( library.root_folder, app, remove_from_disk, info_only = info_only )
if not info_only:
@@ -187,14 +187,14 @@
folder_count = 0
start = time.time()
if force_retry:
- folders = self.sa_session.query( app.model.LibraryFolder ) \
- .filter( and_( app.model.LibraryFolder.table.c.deleted==True,
- app.model.LibraryFolder.table.c.update_time < cutoff_time ) )
+ folders = app.sa_session.query( app.model.LibraryFolder ) \
+ .filter( and_( app.model.LibraryFolder.table.c.deleted==True,
+ app.model.LibraryFolder.table.c.update_time < cutoff_time ) )
else:
- folders = self.sa_session.query( app.model.LibraryFolder ) \
- .filter( and_( app.model.LibraryFolder.table.c.deleted==True,
- app.model.LibraryFolder.table.c.purged==False,
- app.model.LibraryFolder.table.c.update_time < cutoff_time ) )
+ folders = app.sa_session.query( app.model.LibraryFolder ) \
+ .filter( and_( app.model.LibraryFolder.table.c.deleted==True,
+ app.model.LibraryFolder.table.c.purged==False,
+ app.model.LibraryFolder.table.c.update_time < cutoff_time ) )
for folder in folders:
_purge_folder( folder, app, remove_from_disk, info_only = info_only )
folder_count += 1
@@ -241,7 +241,7 @@
deleted_instance_count = 0
for dataset_id in dataset_ids:
print "######### Processing dataset id:", dataset_id
- dataset = self.sa_session.query( app.model.Dataset ).get( dataset_id )
+ dataset = app.sa_session.query( app.model.Dataset ).get( dataset_id )
if dataset.id not in skip and _dataset_is_deletable( dataset ):
deleted_dataset_count += 1
for dataset_instance in dataset.history_associations + dataset.library_associations:
@@ -261,16 +261,16 @@
disk_space = 0
start = time.time()
if force_retry:
- datasets = self.sa_session.query( app.model.Dataset ) \
- .filter( and_( app.model.Dataset.table.c.deleted==True,
- app.model.Dataset.table.c.purgable==True,
- app.model.Dataset.table.c.update_time < cutoff_time ) )
+ datasets = app.sa_session.query( app.model.Dataset ) \
+ .filter( and_( app.model.Dataset.table.c.deleted==True,
+ app.model.Dataset.table.c.purgable==True,
+ app.model.Dataset.table.c.update_time < cutoff_time ) )
else:
- datasets = self.sa_session.query( app.model.Dataset ) \
- .filter( and_( app.model.Dataset.table.c.deleted==True,
- app.model.Dataset.table.c.purgable==True,
- app.model.Dataset.table.c.purged==False,
- app.model.Dataset.table.c.update_time < cutoff_time ) )
+ datasets = app.sa_session.query( app.model.Dataset ) \
+ .filter( and_( app.model.Dataset.table.c.deleted==True,
+ app.model.Dataset.table.c.purgable==True,
+ app.model.Dataset.table.c.purged==False,
+ app.model.Dataset.table.c.update_time < cutoff_time ) )
for dataset in datasets:
file_size = dataset.file_size
_purge_dataset( dataset, remove_from_disk, info_only = info_only )
@@ -294,7 +294,7 @@
dataset_instance.mark_deleted( include_children = include_children )
dataset_instance.clear_associated_files()
dataset_instance.flush()
- self.sa_session.refresh( dataset_instance.dataset )
+ app.sa_session.refresh( dataset_instance.dataset )
if is_deletable or _dataset_is_deletable( dataset_instance.dataset ):
# Calling methods may have already checked _dataset_is_deletable, if so, is_deletable should be True
_delete_dataset( dataset_instance.dataset, app, remove_from_disk, info_only=info_only, is_deletable=is_deletable )
@@ -317,12 +317,12 @@
metadata_files = []
#lets create a list of metadata files, then perform actions on them
for hda in dataset.history_associations:
- for metadata_file in self.sa_session.query( app.model.MetadataFile ) \
- .filter( app.model.MetadataFile.table.c.hda_id==hda.id ):
+ for metadata_file in app.sa_session.query( app.model.MetadataFile ) \
+ .filter( app.model.MetadataFile.table.c.hda_id==hda.id ):
metadata_files.append( metadata_file )
for lda in dataset.library_associations:
- for metadata_file in self.sa_session.query( app.model.MetadataFile ) \
- .filter( app.model.MetadataFile.table.c.lda_id==lda.id ):
+ for metadata_file in app.sa_session.query( app.model.MetadataFile ) \
+ .filter( app.model.MetadataFile.table.c.lda_id==lda.id ):
metadata_files.append( metadata_file )
for metadata_file in metadata_files:
print "The following metadata files attached to associations of Dataset '%s' have been purged:" % dataset.id
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/3aa07fc9512a
changeset: 2938:3aa07fc9512a
user: Kanwei Li <kanwei(a)gmail.com>
date: Fri Oct 30 21:55:17 2009 -0400
description:
trackster: fix window resizing, wrong tiles being displayed
diffstat:
static/scripts/trackster.js | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diffs (92 lines):
diff -r dac542cca894 -r 3aa07fc9512a static/scripts/trackster.js
--- a/static/scripts/trackster.js Fri Oct 30 14:27:48 2009 -0400
+++ b/static/scripts/trackster.js Fri Oct 30 21:55:17 2009 -0400
@@ -7,7 +7,7 @@
DATA_NONE = "No data for this chrom/contig.",
DATA_PENDING = "Currently indexing... please wait",
DATA_LOADING = "Loading data...",
- CACHED_TILES = 5,
+ CACHED_TILES = 10,
CACHED_DATA = 20,
CONTEXT = $("<canvas></canvas>").get(0).getContext("2d"),
RIGHT_STRAND, LEFT_STRAND;
@@ -22,7 +22,6 @@
left_img.onload = function() {
LEFT_STRAND = CONTEXT.createPattern(left_img, "repeat");
}
-
var right_img_inv = new Image();
right_img_inv.src = "../images/visualization/strand_right_inv.png";
right_img_inv.onload = function() {
@@ -182,10 +181,10 @@
var tile_index = Math.floor( low / resolution / DENSITY );
while ( ( tile_index * DENSITY * resolution ) < high ) {
// Check in cache
- var key = this.view.zoom_level + "_" + tile_index;
+ var key = this.content_div.width() + '_' + this.view.zoom_level + '_' + tile_index;
var cached = this.tile_cache.get(key);
if ( cached ) {
- // console.log("cached tile");
+ // console.log("cached tile " + tile_index);
var tile_low = tile_index * DENSITY * resolution;
cached.css( {
left: ( tile_low - this.view.low ) * w_scale
@@ -194,9 +193,9 @@
parent_element.append( cached );
} else {
tile_element = this.draw_tile( resolution, tile_index, parent_element, w_scale );
- }
- if ( tile_element ) {
- this.tile_cache.set(key, tile_element);
+ if ( tile_element ) {
+ this.tile_cache.set(key, tile_element);
+ }
}
tile_index += 1;
}
@@ -384,7 +383,7 @@
calc_slots: function( include_labels ) {
// console.log("num vals: " + this.values.length);
var end_ary = [],
- scale = this.container_div.width() / (this.view.high - this.view.low),
+ scale = this.content_div.width() / (this.view.high - this.view.low),
labels_scale = this.show_labels_scale,
max_high = this.view.max_high,
max_low = this.view.max_low;
@@ -396,14 +395,15 @@
for (var i = 0, len = this.values.length; i < len; i++) {
var f_start, f_end, feature = this.values[i];
if (include_labels) {
- f_start = Math.floor( Math.max(max_low, (feature.start - max_low) * labels_scale) );
+ f_start = Math.floor( (feature.start - max_low) * labels_scale );
f_start -= dummy_canvas.measureText(feature.name).width;
- f_end = Math.ceil( Math.min(max_high, (feature.end - max_low) * labels_scale) );
+ f_end = Math.ceil( (feature.end - max_low) * labels_scale );
} else {
- f_start = Math.floor( Math.max(max_low, (feature.start - max_low) * scale) );
- f_end = Math.ceil( Math.min(max_high, (feature.end - max_low) * scale) );
+ f_start = Math.floor( (feature.start - max_low) * scale );
+ f_end = Math.ceil( (feature.end - max_low) * scale );
}
// if (include_labels) { console.log(f_start, f_end); }
+
var j = 0;
while (true) {
if (end_ary[j] === undefined || end_ary[j] < f_start) {
@@ -425,7 +425,7 @@
if (!this.values) { // Still loading
return null;
}
- // console.log("drawing");
+ // console.log("drawing " + tile_index);
// Once we zoom in enough, show name labels
if (w_scale > this.show_labels_scale && !this.showing_labels) {
this.showing_labels = true;
@@ -480,6 +480,7 @@
// Showing labels, blocks, details
if (ctx.fillText) {
ctx.fillText(feature.name, f_start - 1, y_center + 8);
+ // ctx.fillText(commatize(feature.start), f_start - 1, y_center + 8);
}
var blocks = feature.blocks;
if (blocks) {
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/da1a03642283
changeset: 2935:da1a03642283
user: Nate Coraor <nate(a)bx.psu.edu>
date: Fri Oct 30 12:41:17 2009 -0400
description:
Add contributed Debian init script and OS X LaunchDaemon plist from James Casbon, and my Solaris SMF manifest.
diffstat:
contrib/README | 19 ++++++
contrib/edu.psu.galaxy.GalaxyServer.plist | 22 +++++++
contrib/galaxy.debian-init | 55 ++++++++++++++++++
contrib/galaxy.solaris-smf.xml | 75 +++++++++++++++++++++++++
4 files changed, 171 insertions(+), 0 deletions(-)
diffs (187 lines):
diff -r 979534de254d -r da1a03642283 contrib/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/README Fri Oct 30 12:41:17 2009 -0400
@@ -0,0 +1,19 @@
+CONTENTS
+--------
+
+edu.psu.galaxy.GalaxyServer.plist:
+
+ LaunchDaemon definition for OS X (pre-Snow Leopard?). Modify paths and
+ load with `launchctl load edu.psu.galaxy.GalaxyServer.plist`. Written and
+ submitted by James Casbon.
+
+galaxy.debian-init:
+
+ init script for Debian/Ubuntu Linux. Copy to /etc/init.d/galaxy, modify
+ paths, and configure for start at boot with `update-rc.d galaxy defaults`.
+ Also written and submitted by James Casbon.
+
+galaxy.solaris-smf.xml:
+
+ SMF Manifest for Solaris 10 and OpenSolaris. Import with `svccfg import
+ galaxy.solaris-smf.xml`.
diff -r 979534de254d -r da1a03642283 contrib/edu.psu.galaxy.GalaxyServer.plist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/edu.psu.galaxy.GalaxyServer.plist Fri Oct 30 12:41:17 2009 -0400
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>edu.psu.galaxy.GalaxyServer</string>
+ <key>OnDemand</key>
+ <false/>
+ <key>Program</key>
+ <string>galaxy_dist/run.sh<string>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>ServiceDescription</key>
+ <string>Galaxy</string>
+ <key>StandardErrorPath</key>
+ <string>galaxy_dist/log/galaxy.stderr</string>
+ <key>StandardOutPath</key>
+ <string>galaxy_dist/log/galaxy.stdout</string>
+ <key>UserName</key>
+ <string>galaxy</string>
+</dict>
+</plist>
diff -r 979534de254d -r da1a03642283 contrib/galaxy.debian-init
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/galaxy.debian-init Fri Oct 30 12:41:17 2009 -0400
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Author: James Casbon, 2009
+
+### BEGIN INIT INFO
+# Provides: galaxy
+# Required-Start: $network $local_fs $mysql
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Galaxy
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+USER="galaxy"
+GROUP="nogroup"
+DIR="/home/galaxy/galaxy_dist/"
+PYTHON="/usr/bin/python"
+OPTS="-ES ./scripts/paster.py serve --log-file /home/galaxy/galaxy.log universe_wsgi.ini"
+PIDFILE="/var/run/galaxy.pid"
+
+case "${1:-''}" in
+ 'start')
+ log_daemon_msg "Starting Galaxy"
+ if start-stop-daemon --chuid $USER --group $GROUP --start --make-pidfile \
+ --pidfile $PIDFILE --background --chdir $DIR --exec $PYTHON -- $OPTS; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+
+ ;;
+ 'stop')
+ log_daemon_msg "Stopping Galaxy"
+ if start-stop-daemon --stop --pidfile $PIDFILE; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ 'restart')
+ # restart commands here
+ $0 stop
+ $0 start
+
+ ;;
+ *) # no parameter specified
+ echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+ exit 1
+ ;;
+esac
+
+
+
diff -r 979534de254d -r da1a03642283 contrib/galaxy.solaris-smf.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/galaxy.solaris-smf.xml Fri Oct 30 12:41:17 2009 -0400
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<service_bundle type='manifest' name='nginx'>
+
+<service name='application/galaxy' type='service' version='0'>
+
+ <dependency name='net'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri
+ value='svc:/network/loopback'/>
+ </dependency>
+
+ <dependency name='filesystem-local'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri
+ value='svc:/system/filesystem/local:default'/>
+ </dependency>
+
+ <instance name='main' enabled='false'>
+
+ <exec_method name='start'
+ type='method'
+ exec='python -ES ./scripts/paster.py serve universe_wsgi.webapp.ini --log-file=log/main.log --daemon'
+ timeout_seconds='60'>
+ <method_context
+ working_directory='/galaxy'>
+ <method_credential user='galaxy' group='galaxy' />
+ <method_environment>
+ <envvar name="PATH" value="/opt/local/bin:/bin:/usr/bin" />
+ <envvar name="TEMP" value="/galaxy/database/tmp" />
+ </method_environment>
+ </method_context>
+
+ </exec_method>
+
+ <exec_method name='stop'
+ type='method'
+ exec=':kill'
+ timeout_seconds='60'>
+ <method_context>
+ <method_credential user='galaxy' group='galaxy' />
+ </method_context>
+ </exec_method>
+
+ <property_group name='general' type='framework'>
+ <propval name='action_authorization' type='astring'
+ value='solaris.smf.manage.galaxy' />
+ <propval name='value_authorization' type='astring'
+ value='solaris.smf.manage.galaxy' />
+ </property_group>
+
+ </instance>
+
+ <stability value='Evolving' />
+
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>
+ Galaxy
+ </loctext>
+ </common_name>
+ <documentation>
+ <doc_link name='galaxyproject.org'
+ uri='http://galaxyproject.org' />
+ </documentation>
+ </template>
+
+</service>
+
+</service_bundle>
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/dac542cca894
changeset: 2937:dac542cca894
user: Nate Coraor <nate(a)bx.psu.edu>
date: Fri Oct 30 14:27:48 2009 -0400
description:
Fix a bug in file staging
diffstat:
lib/galaxy/jobs/runners/pbs.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 583fab0515a0 -r dac542cca894 lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py Fri Oct 30 12:51:07 2009 -0400
+++ b/lib/galaxy/jobs/runners/pbs.py Fri Oct 30 14:27:48 2009 -0400
@@ -217,7 +217,7 @@
# write the job script
if self.app.config.pbs_stage_path != '':
- script = pbs_symlink_template % (job_wrapper.galaxy_lib_dir, " ".join(job_wrapper.get_input_fnames() + output_fnames), self.app.config.pbs_stage_path, exec_dir, command_line)
+ script = pbs_symlink_template % (job_wrapper.galaxy_lib_dir, " ".join(job_wrapper.get_input_fnames() + output_files), self.app.config.pbs_stage_path, exec_dir, command_line)
else:
if self.app.config.set_metadata_externally:
external_metadata_script = job_wrapper.setup_external_metadata( exec_dir = exec_dir, tmp_dir = self.app.config.new_file_path, dataset_files_path = self.app.model.Dataset.file_path, output_fnames = output_fnames, kwds = { 'overwrite' : False } ) #we don't want to overwrite metadata that was copied over in init_meta(), as per established behavior
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/583fab0515a0
changeset: 2936:583fab0515a0
user: Nate Coraor <nate(a)bx.psu.edu>
date: Fri Oct 30 12:51:07 2009 -0400
description:
Try block around the stat for setting permissions and groups
diffstat:
lib/galaxy/util/__init__.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (16 lines):
diff -r da1a03642283 -r 583fab0515a0 lib/galaxy/util/__init__.py
--- a/lib/galaxy/util/__init__.py Fri Oct 30 12:41:17 2009 -0400
+++ b/lib/galaxy/util/__init__.py Fri Oct 30 12:51:07 2009 -0400
@@ -488,7 +488,11 @@
umask-friendly permissions fixing
"""
perms = unmasked_perms & ~umask
- st = os.stat( path )
+ try:
+ st = os.stat( path )
+ except OSError, e:
+ log.exception( 'Unable to set permissions or group on %s' % path )
+ return
# fix modes
if stat.S_IMODE( st.st_mode ) != perms:
try:
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/5d80e32d989b
changeset: 2932:5d80e32d989b
user: James Taylor <james(a)jamestaylor.org>
date: Thu Oct 29 13:34:44 2009 -0400
description:
Page create fix
diffstat:
lib/galaxy/web/controllers/page.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (14 lines):
diff -r 86cc0b2b9e09 -r 5d80e32d989b lib/galaxy/web/controllers/page.py
--- a/lib/galaxy/web/controllers/page.py Thu Oct 29 10:06:11 2009 -0400
+++ b/lib/galaxy/web/controllers/page.py Thu Oct 29 13:34:44 2009 -0400
@@ -138,8 +138,8 @@
session.save_or_update( page )
session.flush()
# Display the management page
- trans.set_message( "Page '%s' created" % page.title )
- return self.list( trans )
+ ## trans.set_message( "Page '%s' created" % page.title )
+ return trans.response.send_redirect( web.url_for( action='index' ) )
return trans.show_form(
web.FormBuilder( web.url_for(), "Create new page", submit_text="Submit" )
.add_text( "page_title", "Page title", value=page_title, error=page_title_err )
1
0