galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
September 2012
- 1 participants
- 161 discussions
commit/galaxy-central: smcmanus: First cut of query optimizations for browsing. At least 3 out of 5 queries were eliminated. Code is not active by default.
by Bitbucket 27 Sep '12
by Bitbucket 27 Sep '12
27 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/a995f7aca75c/
changeset: a995f7aca75c
user: smcmanus
date: 2012-09-27 21:42:11
summary: First cut of query optimizations for browsing. At least 3 out of 5 queries were eliminated. Code is not active by default.
affected #: 4 files
diff -r 4f788268c76dcb77e99076dbfbc8cf65c05b00cc -r a995f7aca75c03bd180689aead6a8870928d8fdf lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1785,6 +1785,7 @@
# we'll return the next available info_association in the inheritable hierarchy.
# True is also returned if the info_association was inherited, and False if not.
# This enables us to eliminate displaying any contents of the inherited template.
+ # SM: Accessing self.info_association can cause a query to be emitted
if self.info_association:
return self.info_association[0], inherited
if restrict:
diff -r 4f788268c76dcb77e99076dbfbc8cf65c05b00cc -r a995f7aca75c03bd180689aead6a8870928d8fdf lib/galaxy/security/__init__.py
--- a/lib/galaxy/security/__init__.py
+++ b/lib/galaxy/security/__init__.py
@@ -225,13 +225,16 @@
# If role.type is neither private nor sharing, it's ok to display
return True
return role.type != self.model.Role.types.PRIVATE and role.type != self.model.Role.types.SHARING
+
def allow_action( self, roles, action, item ):
"""
Method for checking a permission for the current user ( based on roles ) to perform a
specific action on an item, which must be one of:
Dataset, Library, LibraryFolder, LibraryDataset, LibraryDatasetDatasetAssociation
"""
+ # SM: Note that calling get_item_actions will emit a query.
item_actions = self.get_item_actions( action, item )
+
if not item_actions:
return action.model == 'restrict'
ret_val = False
@@ -249,8 +252,152 @@
ret_val = True
break
return ret_val
- def can_access_dataset( self, roles, dataset ):
- return self.dataset_is_public( dataset ) or self.allow_action( roles, self.permitted_actions.DATASET_ACCESS, dataset )
+
+
+ def get_actions_for_items( self, trans, action, permission_items ):
+ # TODO: Rename this; it's a replacement for get_item_actions, but it
+ # doesn't represent what it's really confusing.
+ # TODO: Make this work for other classes besides lib_datasets.
+ # That should be as easy as checking the type and writing a query for each;
+ # we're avoiding using the SQLAlchemy backrefs because they can cause lots
+ # of queries to be generated.
+ #
+ # Originally, get_item_actions did:
+ # return [ permission for permission in item.actions if permission.action == action.action ]
+ # The "item" can be just about anything with permissions, and referencing
+ # item.actions causes the item's permissions to be retrieved.
+ # This method will retrieve all permissions for all "items" and only
+ # return the permissions associated with that given action.
+ # We initialize the permissions list to be empty; we will return an
+ # empty list by default.
+ #
+ # If the dataset id has no corresponding action in its permissions,
+ # then the returned permissions will not carry an entry for the dataset.
+ ret_permissions = {}
+ if ( len( permission_items ) > 0 ):
+ if ( isinstance( permission_items[0], trans.model.LibraryDataset ) ):
+ ids = [ item.library_dataset_id for item in permission_items ]
+ permissions = trans.sa_session.query( trans.model.LibraryDatasetPermissions ) \
+ .filter( and_( trans.model.LibraryDatasetPermissions.library_dataset_id.in_( ids ),
+ trans.model.LibraryDatasetPermissions.action == action ) ) \
+ .all()
+
+ # Massage the return data. We will return a list of permissions
+ # for each library dataset. So we initialize the return list to
+ # have an empty list for each dataset. Then each permission is
+ # appended to the right lib dataset.
+ # TODO: Consider eliminating the initialization and just return
+ # empty values for each library dataset id.
+ for item in permission_items:
+ ret_permissions[ item.library_dataset_id ] = []
+ for permission in permissions:
+ ret_permissions[ permission.library_dataset_id ].append( permission )
+
+ # Test that we get the same response from get_item_actions each item:
+ test_code = False
+ if test_code:
+ try:
+ log.debug( "get_actions_for_items: Test start" )
+ for item in permission_items:
+ base_result = self.get_item_actions( action, item )
+ new_result = ret_permissions[ item.library_dataset_id ]
+ # For now, just test against LibraryDatasetIds; other classes
+ # are not tested yet.
+ if len( base_result ) == len( new_result ):
+ common_result = set(base_result).intersection( new_result )
+ if len( common_result ) == len( base_result ):
+ log.debug( "Match on permissions for id %d" %
+ item.library_dataset_id )
+ # TODO: Fix this failure message:
+ else:
+ log.debug( "Error: dataset %d; originally: %s; now: %s"
+ % ( item.library_dataset_id,
+ base_result, new_result ) )
+ else:
+ log.debug( "Error: dataset %d: had %d entries, now %d entries"
+ % ( item.library_dataset_id, len( base_result ),
+ len( new_result ) ) )
+ log.debug( "get_actions_for_items: Test end" )
+ except Exception as e:
+ log.debug( "Exception in test code: %s" % e )
+
+ return ret_permissions
+
+
+ def allow_action_on_items( self, trans, user_roles, action, items ):
+ """
+ This should be the equivalent of allow_action defined on multiple items.
+ It is meant to specifically replace allow_action for multiple
+ LibraryDatasets, but it could be reproduced or modified for
+ allow_action's permitted classes - Dataset, Library, LibraryFolder, and
+ LDDAs.
+ """
+ all_items_actions = self.get_actions_for_items( trans, action, items )
+
+ ret_allow_action = {}
+ # Change item to lib_dataset or vice-versa.
+ for item in items:
+ if all_items_actions.has_key( item.id ):
+ item_actions = all_items_actions[ item.id ]
+
+ # For access, all of the dataset's
+ if self.permitted_actions.DATASET_ACCESS == action:
+ ret_allow_action[ item.id ] = True
+ for item_action in item_actions:
+ if item_action.role not in user_roles:
+ ret_allow_action[ item.id ] = False
+ break
+
+ # Else look for just one dataset role to be in the list of
+ # acceptable user roles:
+ else:
+ ret_allow_action[ item.id ] = False
+ for item_action in item_actions:
+ if item_action.role in user_roles:
+ ret_allow_action[ item.id ] = True
+ break
+
+ else:
+ if 'restrict' == action.model:
+ ret_allow_action[ item.id ] = True
+ else:
+ ret_allow_action[ item.id ] = False
+
+ # Test it: the result for each dataset should match the result for
+ # allow_action:
+ test_code = False
+ if test_code:
+ log.debug( "allow_action_for_items: test start" )
+ for item in items:
+ orig_value = self.allow_action( user_roles, action, item )
+ if orig_value == ret_allow_action[ item.id ]:
+ log.debug( "Item %d: success" % item.id )
+ else:
+ log.debug( "Item %d: fail: original: %s; new: %s"
+ % ( item.id, orig_value, ret_allow_action[ item.id ] ) )
+ log.debug( "allow_action_for_items: test end" )
+ return ret_allow_action
+
+
+ def get_dataset_access_mapping( self, trans, user_roles, datasets ):
+ '''
+ For the given list of datasets, return a mapping of the datasets' ids
+ to whether they can be accessed by the user or not. The datasets input
+ is expected to be a simple list of Dataset objects.
+ '''
+ datasets_public_map = self.datasets_are_public( trans, datasets )
+ datasets_allow_action_map = self.allow_action_on_items( trans, user_roles, self.permitted_actions.DATASET_ACCESS, datasets )
+ can_access = {}
+ for dataset in datasets:
+ can_access[ dataset.id ] = datasets_public_map[ dataset.id ] or datasets_allow_action_map[ dataset.id ]
+ return can_access
+
+ def can_access_dataset( self, user_roles, dataset ):
+ # SM: dataset_is_public will access dataset.actions, which is a
+ # backref that causes a query to be made to DatasetPermissions
+ retval = self.dataset_is_public( dataset ) or self.allow_action( user_roles, self.permitted_actions.DATASET_ACCESS, dataset )
+ return retval
+
def can_manage_dataset( self, roles, dataset ):
return self.allow_action( roles, self.permitted_actions.DATASET_MANAGE_PERMISSIONS, dataset )
def can_access_library( self, roles, library ):
@@ -317,9 +464,14 @@
return self.allow_action( roles, self.permitted_actions.LIBRARY_MODIFY, item )
def can_manage_library_item( self, roles, item ):
return self.allow_action( roles, self.permitted_actions.LIBRARY_MANAGE, item )
+
def get_item_actions( self, action, item ):
# item must be one of: Dataset, Library, LibraryFolder, LibraryDataset, LibraryDatasetDatasetAssociation
+ # SM: Accessing item.actions emits a query to Library_Dataset_Permissions
+ # if the item is a LibraryDataset:
+ # TODO: Pass in the item's actions - the item isn't needed
return [ permission for permission in item.actions if permission.action == action.action ]
+
def guess_derived_permissions_for_datasets( self, datasets=[] ):
"""Returns a dict of { action : [ role, role, ... ] } for the output dataset based upon provided datasets"""
perms = {}
@@ -667,10 +819,55 @@
dataset = library_dataset.library_dataset_dataset_association.dataset
if not dataset.purged and not self.dataset_is_public( dataset ):
self.make_dataset_public( dataset )
+
def dataset_is_public( self, dataset ):
# A dataset is considered public if there are no "access" actions associated with it. Any
# other actions ( 'manage permissions', 'edit metadata' ) are irrelevant.
+ # SM: Accessing dataset.actions will cause a query to be emitted.
return self.permitted_actions.DATASET_ACCESS.action not in [ a.action for a in dataset.actions ]
+
+ def datasets_are_public( self, trans, datasets ):
+ '''
+ Given a transaction object and a list of Datasets, return
+ a mapping from Dataset ids to whether the Dataset is public
+ or not. All Dataset ids should be returned in the mapping's keys.
+ '''
+ # We go the other way around from dataset_is_public: we start with
+ # all datasets being marked as public. If there is an access action
+ # associated with the dataset, then we mark it as nonpublic:
+ datasets_public = {}
+ dataset_ids = [ dataset.id for dataset in datasets ]
+ for dataset_id in dataset_ids:
+ datasets_public[ dataset_id ] = True
+
+ # Now get all datasets which have DATASET_ACCESS actions:
+ access_data_perms = trans.sa_session.query( trans.app.model.DatasetPermissions ) \
+ .filter( and_( trans.app.model.DatasetPermissions.dataset_id in dataset_ids,
+ trans.app.model.DatasetPermissions.action == self.permitted_actions.DATASET_ACCESS.action ) ) \
+ .all()
+
+ # Every dataset returned has "access" privileges associated with it,
+ # so it's not public.
+ for permission in access_data_perms:
+ datasets_public[ permission.dataset_id ] = False
+
+ # Test code: Check if the results match up with the original:
+ test_code = False
+ if test_code:
+ log.debug( "datasets_are_public test: check datasets_are_public matches dataset_is_public:" )
+ test_success = True
+ for dataset in datasets:
+ orig_is_public = self.dataset_is_public( dataset )
+ if orig_is_public == datasets_public[ dataset.id ]:
+ log.debug( "\tMatch for dataset %d" % dataset.id )
+ else:
+ success = False
+ log.error( "\tERROR: Did not match: single is_public: %s; multiple is_public: %s"
+ % ( single_is_public, datasets_public[ dataset.id ] ) )
+ log.debug( "datasets_are_public: test succeeded? %s" % test_success )
+ return datasets_public
+
+
def make_dataset_public( self, dataset ):
# A dataset is considered public if there are no "access" actions associated with it. Any
# other actions ( 'manage permissions', 'edit metadata' ) are irrelevant.
@@ -707,7 +904,7 @@
# Ensure that roles being associated with DATASET_ACCESS are a subset of the legitimate roles
# derived from the roles associated with the access permission on item if it's not public. This
# will keep ill-legitimate roles from being associated with the DATASET_ACCESS permission on the
- # dataset (i.e., in the case where item is a library, if Role1 is associated with LIBRARY_ACCESS,
+ # dataset (i.e., in the case where item is .a library, if Role1 is associated with LIBRARY_ACCESS,
# then only those users that have Role1 should be associated with DATASET_ACCESS.
legitimate_roles = self.get_legitimate_roles( trans, item, cntrller )
ill_legitimate_roles = []
@@ -944,12 +1141,21 @@
if self.can_add_library_item( roles, folder ):
return True, ''
action = self.permitted_actions.DATASET_ACCESS
+
+ # SM: TODO: This is for timing debug. Delete it later.
+ from datetime import datetime, timedelta
+ query_start = datetime.now()
lddas = self.sa_session.query( self.model.LibraryDatasetDatasetAssociation ) \
.join( "library_dataset" ) \
.filter( self.model.LibraryDataset.folder == folder ) \
.join( "dataset" ) \
.options( eagerload_all( "dataset.actions" ) ) \
.all()
+ query_end = datetime.now()
+ query_delta = query_end - query_start
+ #log.debug( "Check folder contents: join query time: %d.%.6d sec" %
+ # ( query_delta.seconds, query_delta.microseconds ) )
+
for ldda in lddas:
ldda_access_permissions = self.get_item_actions( action, ldda.dataset )
if not ldda_access_permissions:
diff -r 4f788268c76dcb77e99076dbfbc8cf65c05b00cc -r a995f7aca75c03bd180689aead6a8870928d8fdf lib/galaxy/web/controllers/library_common.py
--- a/lib/galaxy/web/controllers/library_common.py
+++ b/lib/galaxy/web/controllers/library_common.py
@@ -92,6 +92,65 @@
#"force_history_refresh": force_history_refresh
}
return rval
+
+ def display_folder_hierarchy( self, trans_in, cntrller_in, use_panels_in, library_in, created_ldda_ids_in, hidden_folder_ids_in, show_deleted_in, comptypes_in, current_user_roles_in, message_in, status ):
+ log.debug( "display_folder_hierarchy: enter" )
+ # SM: Determine if this is an admin user (trans.user_is_admin and cntrller
+ # is library_admin). If so, then the user gets add, modify, manage permissions.
+ # Otherwise, if this is the library/requests controller then lookup those
+ # three permissions. Otherwise, it's all not true.
+ #
+ # Now get the library's info_assocation (?). TODO: Look into this.
+ # Determine if there are accessible folders:
+ # 1. Is the root folder accessible to this user?
+ # 2. IS the root folder accessible to this user (without looking downward)?
+ # 3. Is this guy an admin OR is the root folder accessible to this user?
+ # Evidently roles are used each time.
+ #
+ # Then show management buttons and links, and then call render_folders
+
+ # render_folder:
+ # Repeat determining if this is an admin user:
+ # is_admin = trans.user_is_admin() and cntrller == 'library_admin'
+ # Turn the list of created lddas into a list - split by comma, turn one
+ # element into its own list, and leave lists alone.
+ # (Christ) If this is an admin user, then all permissions are granted.
+ # O.w., if this is the library controller,
+ # determine the folder ids along with whether the folders can be
+ # shown, and determine the other three admin permissions.
+ # O.w., no modifications are allowed - it's view-only.
+ # Get the form type and (sigh) again get the folder's info_association (?)
+ # Display information about the folder.
+ # Get the list of deleted (if shown) and non-deleted datasets and subfolders.
+ # Call render_folder for every subfolder
+ # For every library dataset, determine the ldda. If there is an ldda, then
+ # determine if the ldda's dataset can be displayed.
+
+ # TODO: Move this to a security function/method later.
+ is_admin = trans.user_is_admin() and cntrller == 'library_admin'
+
+ if is_admin:
+ can_add = can_modify = can_manage = True
+ elif cntrller in [ 'library', 'requests' ]:
+ can_add = trans.app.security_agent.can_add_library_item( current_user_roles_in, library )
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles_in, library )
+ can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles_in, library )
+ else:
+ can_add = can_modify = can_manage = False
+
+ info_association, inherited = library_in.get_info_association()
+ log.debug( "type(info_association): %s" % type(info_association) )
+ log.debug( "type(inherited): %s" % type(inherited) )
+
+ # SM: determine if folders are accessible underneath here:
+ has_accessible_folders = is_admin or trans.app.security_agent.has_accessible_folders( trans, library.root_folder, trans.user, current_user_roles_in )
+ if has_accessible_folders and cntrller in ['library', 'requests']:
+ self.display_folder( 'library', library.root_folder, 0, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted = show_deleted, parent=None, root_folder=True, simple=simple )
+ elif ( trans_in.user_is_admin() and cntrller in [ 'library_admin', 'requests_admin' ] ):
+ # SM: TODO: Start here.
+ pass
+ pass
+
@web.expose
def browse_library( self, trans, cntrller, **kwd ):
params = util.Params( kwd )
@@ -128,22 +187,36 @@
message += "message \"This job is running\" is cleared from the \"Information\" column below for each selected dataset."
status = "info"
comptypes = get_comptypes( trans )
- try:
- return trans.fill_template( '/library/common/browse_library.mako',
- cntrller=cntrller,
- use_panels=use_panels,
- library=library,
- created_ldda_ids=created_ldda_ids,
- hidden_folder_ids=hidden_folder_ids,
- show_deleted=show_deleted,
- comptypes=comptypes,
- current_user_roles=current_user_roles,
- message=message,
- status=status )
- except Exception, e:
- message = 'Error attempting to display contents of library (%s): %s.' % ( str( library.name ), str( e ) )
- status = 'error'
+ # SM: Retrieve the entire hierarchy and pass it to the template to fill in.
+ # We'll eliminate the mako from retrieving stuff for now.
+ # SM: TODO: Add configuration item
+ # if trans.app.config.optimize_folders:
+ if False:
+ hierarchy = self.display_folder_hierarchy( trans, cntrller, use_panels, library,
+ created_ldda_ids, hidden_folder_ids,
+ show_deleted, comptypes,
+ current_user_roles, message,
+ status )
+
+ else:
+ try:
+ # SM: TODO: Add configuration variable asap.
+ return trans.fill_template( '/library/common/browse_library.mako',
+ cntrller=cntrller,
+ use_panels=use_panels,
+ library=library,
+ created_ldda_ids=created_ldda_ids,
+ hidden_folder_ids=hidden_folder_ids,
+ show_deleted=show_deleted,
+ comptypes=comptypes,
+ current_user_roles=current_user_roles,
+ message=message,
+ status=status )
+ except Exception, e:
+ message = 'Error attempting to display contents of library (%s): %s.' % ( str( library.name ), str( e ) )
+ status = 'error'
default_action = params.get( 'default_action', None )
+
return trans.response.send_redirect( web.url_for( use_panels=use_panels,
controller=cntrller,
action='browse_libraries',
@@ -2534,16 +2607,57 @@
.options( eagerload_all( "actions" ) ) \
.order_by( trans.app.model.LibraryFolder.table.c.name ) \
.all()
+
+def map_library_datasets_to_lddas( trans, lib_datasets ):
+ '''
+ Given a list of LibraryDatasets, return a map from the LibraryDatasets
+ to their LDDAs. If an LDDA does not exist for a LibraryDataset, then
+ there will be no entry in the return hash.
+ '''
+ # Get a list of the LibraryDatasets' ids so that we can pass it along to
+ # a query to retrieve the LDDAs. This eliminates querying for each
+ # LibraryDataset.
+ lib_dataset_ids = [ x.library_dataset_dataset_association_id for x in lib_datasets ]
+ lddas = trans.sa_session.query( trans.app.model.LibraryDatasetDatasetAssociation ) \
+ .filter( trans.app.model.LibraryDatasetDatasetAssociation.id.in_( lib_dataset_ids ) ) \
+ .all()
+
+ # Map the LibraryDataset to the returned LDDAs:
+ ret_lddas = {}
+ for ldda in lddas:
+ ret_lddas[ldda.library_dataset_id] = ldda
+ return ret_lddas
+
+def datasets_for_lddas( trans, lddas ):
+ '''
+ Given a list of LDDAs, return a list of Datasets for them.
+ '''
+ dataset_ids = [ x.dataset_id for x in lddas ]
+ datasets = trans.sa_session.query( trans.app.model.Dataset ) \
+ .filter( trans.app.model.Dataset.id.in_( dataset_ids ) ) \
+ .all()
+ return datasets
+
def active_folders_and_library_datasets( trans, folder ):
+ # SM: TODO: Eliminate timing code
+ from datetime import datetime, timedelta
+ query_start = datetime.now()
folders = active_folders( trans, folder )
library_datasets = trans.sa_session.query( trans.model.LibraryDataset ) \
.filter( and_( trans.model.LibraryDataset.table.c.deleted == False,
trans.model.LibraryDataset.table.c.folder_id == folder.id ) ) \
.order_by( trans.model.LibraryDataset.table.c._name ) \
.all()
+ query_end = datetime.now()
+ query_delta = query_end - query_start
+ #log.debug( "active_folders_and_library_datasets: %d.%.6d" %
+ # ( query_delta.seconds, query_delta.microseconds ) )
return folders, library_datasets
+
def activatable_folders_and_library_datasets( trans, folder ):
folders = activatable_folders( trans, folder )
+ from datetime import datetime, timedelta
+ query_start = datetime.now()
library_datasets = trans.sa_session.query( trans.model.LibraryDataset ) \
.filter( trans.model.LibraryDataset.table.c.folder_id == folder.id ) \
.join( ( trans.model.LibraryDatasetDatasetAssociation.table,
@@ -2553,6 +2667,10 @@
.filter( trans.model.Dataset.table.c.deleted == False ) \
.order_by( trans.model.LibraryDataset.table.c._name ) \
.all()
+ query_end = datetime.now()
+ query_delta = query_end - query_start
+ log.debug( "activatable_folders_and_library_datasets: %d.%.6d" %
+ ( query_delta.seconds, query_delta.microseconds ) )
return folders, library_datasets
def branch_deleted( folder ):
# Return True if a folder belongs to a branch that has been deleted
diff -r 4f788268c76dcb77e99076dbfbc8cf65c05b00cc -r a995f7aca75c03bd180689aead6a8870928d8fdf templates/library/common/browse_library_opt.mako
--- /dev/null
+++ b/templates/library/common/browse_library_opt.mako
@@ -0,0 +1,630 @@
+<%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/library/common/library_item_info.mako" import="render_library_item_info" />
+<%namespace file="/library/common/common.mako" import="render_actions_on_multiple_items" />
+<%namespace file="/library/common/common.mako" import="render_compression_types_help" />
+<%namespace file="/library/common/common.mako" import="common_javascripts" />
+
+<%!
+ def inherit(context):
+ if context.get('use_panels'):
+ return '/webapps/galaxy/base_panels.mako'
+ else:
+ return '/base.mako'
+%>
+<%inherit file="${inherit(context)}"/>
+
+<%def name="init()">
+<%
+ self.has_left_panel=False
+ self.has_right_panel=False
+ self.message_box_visible=False
+ self.active_view="user"
+ self.overlay_visible=False
+ self.has_accessible_datasets = False
+%>
+</%def>
+
+##
+## Override methods from base.mako and base_panels.mako
+##
+<%def name="center_panel()">
+ <div style="overflow: auto; height: 100%;">
+ <div class="page-container" style="padding: 10px;">
+ ${render_content()}
+ </div>
+ </div>
+</%def>
+
+## Render the grid's basic elements. Each of these elements can be subclassed.
+<%def name="body()">
+ ${render_content()}
+</%def>
+
+<%def name="title()">Browse data library</%def>
+<%def name="stylesheets()">
+ ${parent.stylesheets()}
+ ${h.css( "library" )}
+</%def>
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ ${h.js("libs/json2")}
+ ${h.js("libs/jquery/jstorage")}
+ ${common_javascripts()}
+ ${self.grid_javascripts()}
+</%def>
+
+<%def name="grid_javascripts()">
+ <script type="text/javascript">
+ var init_libraries = function() {
+ var storage_id = "library-expand-state-${trans.security.encode_id(library.id)}";
+
+ var restore_folder_state = function() {
+ var state = $.jStorage.get(storage_id);
+ if (state) {
+ for (var id in state) {
+ if (state[id] === true) {
+ var row = $("#" + id),
+ index = row.parent().children().index(row);
+ row.addClass("expanded").show();
+ row.siblings().filter("tr[parent='" + index + "']").show();
+ }
+ }
+ }
+ };
+
+ var save_folder_state = function() {
+ var state = {};
+ $("tr.folderRow").each( function() {
+ var folder = $(this);
+ state[folder.attr("id")] = folder.hasClass("expanded");
+ });
+ $.jStorage.set(storage_id, state);
+ };
+
+ $("#library-grid").each(function() {
+ var child_of_parent_cache = {};
+ // Recursively fill in children and descendents of each row
+ var process_row = function(q, parents) {
+ // Find my index
+ var parent = q.parent(),
+ this_level = child_of_parent_cache[parent] || (child_of_parent_cache[parent] = parent.children());
+
+ var index = this_level.index(q);
+ // Find my immediate children
+ var children = $(par_child_dict[index]);
+ // Recursively handle them
+ var descendents = children;
+ children.each( function() {
+ child_descendents = process_row( $(this), parents.add(q) );
+ descendents = descendents.add(child_descendents);
+ });
+ // Set up expand / hide link
+ var expand_fn = function() {
+ if ( q.hasClass("expanded") ) {
+ descendents.hide();
+ descendents.removeClass("expanded");
+ q.removeClass("expanded");
+ } else {
+ children.show();
+ q.addClass("expanded");
+ }
+ save_folder_state();
+ };
+ $("." + q.attr("id") + "-click").click(expand_fn);
+ // Check/uncheck boxes in subfolders.
+ q.children("td").children("input[type=checkbox]").click( function() {
+ if ( $(this).is(":checked") ) {
+ descendents.find("input[type=checkbox]").attr("checked", true);
+ } else {
+ descendents.find("input[type=checkbox]").attr("checked", false);
+ // If you uncheck a lower level checkbox, uncheck the boxes above it
+ // (since deselecting a child means the parent is not fully selected any more).
+ parents.children("td").children("input[type=checkbox]").attr("checked", false);
+ }
+ });
+ // return descendents for use by parent
+ return descendents;
+ }
+
+ // Initialize dict[parent_id] = rows_which_have_that_parent_id_as_parent_attr
+ var par_child_dict = {},
+ no_parent = [];
+
+ $(this).find("tbody tr").each( function() {
+ if ( $(this).attr("parent")) {
+ var parent = $(this).attr("parent");
+ if (par_child_dict[parent] !== undefined) {
+ par_child_dict[parent].push(this);
+ } else {
+ par_child_dict[parent] = [this];
+ }
+ } else {
+ no_parent.push(this);
+ }
+ });
+
+ $(no_parent).each( function() {
+ descendents = process_row( $(this), $([]) );
+ descendents.hide();
+ });
+ });
+
+ restore_folder_state();
+ };
+ $(function() {
+ init_libraries();
+ });
+
+ // Looks for changes in dataset state using an async request. Keeps
+ // calling itself (via setTimeout) until all datasets are in a terminal
+ // state.
+ var updater = function ( tracked_datasets ) {
+ // Check if there are any items left to track
+ var empty = true;
+ for ( i in tracked_datasets ) {
+ empty = false;
+ break;
+ }
+ if ( ! empty ) {
+ setTimeout( function() { updater_callback( tracked_datasets ) }, 3000 );
+ }
+ };
+ var updater_callback = function ( tracked_datasets ) {
+ // Build request data
+ var ids = []
+ var states = []
+ $.each( tracked_datasets, function ( id, state ) {
+ ids.push( id );
+ states.push( state );
+ });
+ // Make ajax call
+ $.ajax( {
+ type: "POST",
+ url: "${h.url_for( controller='library_common', action='library_item_updates' )}",
+ dataType: "json",
+ data: { ids: ids.join( "," ), states: states.join( "," ) },
+ success : function ( data ) {
+ $.each( data, function( id, val ) {
+ // Replace HTML
+ var cell = $("#libraryItem-" + id).find("#libraryItemInfo");
+ cell.html( val.html );
+ // If new state was terminal, stop tracking
+ if (( val.state == "ok") || ( val.state == "error") || ( val.state == "empty") || ( val.state == "deleted" ) || ( val.state == "discarded" )) {
+ delete tracked_datasets[ parseInt(id) ];
+ } else {
+ tracked_datasets[ parseInt(id) ] = val.state;
+ }
+ });
+ updater( tracked_datasets );
+ },
+ error: function() {
+ // Just retry, like the old method, should try to be smarter
+ updater( tracked_datasets );
+ }
+ });
+ };
+ </script>
+</%def>
+
+<%def name="render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, parent, row_counter, tracked_datasets, show_deleted=False, simple=False )">
+ <%
+ ## The received ldda must always be a LibraryDatasetDatasetAssociation object. The object id passed to methods
+ ## from the drop down menu should be the ldda id to prevent id collision ( which could happen when displaying
+ ## children, which are always lddas ). We also need to make sure we're displaying the latest version of this
+ ## library_dataset, so we display the attributes from the ldda.
+
+ from galaxy.web.controllers.library_common import branch_deleted
+ # SM: DELETEME
+ import logging
+ log = logging.getLogger( __name__ )
+
+ is_admin = trans.user_is_admin() and cntrller == 'library_admin'
+
+ if ldda == library_dataset.library_dataset_dataset_association:
+ current_version = True
+ if is_admin:
+ can_modify = can_manage = True
+ elif cntrller in [ 'library', 'requests' ]:
+ #log.debug( "SM: Query 4: backref to Library_Dataset_Permissions" )
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, library_dataset )
+ can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, library_dataset )
+ else:
+ can_modify = can_manage = False
+ else:
+ current_version = False
+ if current_version and ldda.state not in ( 'ok', 'error', 'empty', 'deleted', 'discarded' ):
+ tracked_datasets[ldda.id] = ldda.state
+ #log.debug( "SM: Query 5 call: LibraryDatasetDatasetInfoAssocation" )
+ info_association, inherited = ldda.get_info_association( restrict=True )
+ # SM: The form type is for displaying URLs only; ignore for now.
+ form_type = trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE
+ %>
+ %if current_version and ( not ldda.library_dataset.deleted or show_deleted ):
+ <tr class="datasetRow"
+ %if parent is not None:
+ parent="${parent}"
+ %endif
+ id="libraryItem-${ldda.id}">
+ <td style="padding-left: ${pad+20}px;">
+ <input style="float: left;" type="checkbox" name="ldda_ids" id="${trans.security.encode_id( ldda.id )}" value="${trans.security.encode_id( ldda.id )}"
+ %if selected:
+ checked="checked"
+ %endif
+ />
+ %if simple:
+ <label for="${trans.security.encode_id( ldda.id )}">${ util.unicodify( ldda.name )}</label>
+ %else:
+ <div style="float: left; margin-left: 1px;" class="menubutton split popup" id="dataset-${ldda.id}-popup">
+ <a class="view-info" href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">
+ %if ldda.library_dataset.deleted:
+ <div class="libraryItem-error">${util.unicodify( ldda.name )}</div>
+ %else:
+ ${util.unicodify( ldda.name )}
+ %endif
+ </a>
+ </div>
+ %if not library.deleted:
+ <div popupmenu="dataset-${ldda.id}-popup">
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type='ldda', item_id=trans.security.encode_id( ldda.id ), source_library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Move this dataset</a>
+ %else:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">View information</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and not info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='ldda', form_type=form_type, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Use template</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='edit_template', cntrller=cntrller, item_type='ldda', form_type=form_type, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit template</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='delete_template', cntrller=cntrller, item_type='ldda', form_type=form_type, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Unuse template</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_manage:
+ %if not trans.app.security_agent.dataset_is_public( ldda.dataset ):
+ <a class="action-button" href="${h.url_for( controller='library_common', action='make_library_item_public', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_type='ldda', id=trans.security.encode_id( ldda.dataset.id ), use_panels=use_panels, show_deleted=show_deleted )}">Make public</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_permissions', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), replace_id=trans.security.encode_id( library_dataset.id ), show_deleted=show_deleted )}">Upload a new version of this dataset</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and ldda.has_data:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), ldda_ids=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Import this dataset into selected histories</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='download_dataset_from_folder', cntrller=cntrller, id=trans.security.encode_id( ldda.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels )}">Download this dataset</a>
+ %endif
+ %if can_modify:
+ %if not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.deleted:
+ <a class="action-button" confirm="Click OK to delete dataset '${util.unicodify( ldda.name )}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Delete this dataset</a>
+ %elif not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.purged and ldda.library_dataset.deleted:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Undelete this dataset</a>
+ %endif
+ %endif
+ </div>
+ %endif
+ %endif
+ </td>
+ % if not simple:
+ <td id="libraryItemInfo">${render_library_item_info( ldda )}</td>
+ <td>${ldda.extension}</td>
+ % endif
+ <td>${ldda.create_time.strftime( "%Y-%m-%d" )}</td>
+ <td>${ldda.get_size( nice_size=True )}</td>
+ </tr>
+ <%
+ my_row = row_counter.count
+ row_counter.increment()
+ %>
+ %endif
+</%def>
+
+<%def name="format_delta( tdelta )">
+ <%
+ from datetime import datetime
+ return "%d.%.6d" % ( tdelta.seconds, tdelta.microseconds )
+ %>
+</%def>
+
+<%def name="render_folder( cntrller, folder, folder_pad, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=False, parent=None, row_counter=None, root_folder=False, simple=False )">
+ <%
+ from galaxy.web.controllers.library_common import active_folders, active_folders_and_library_datasets, activatable_folders_and_library_datasets, map_library_datasets_to_lddas, branch_deleted, datasets_for_lddas
+
+ # SM: DELETEME
+ from datetime import datetime, timedelta
+ import logging
+ log = logging.getLogger( __name__ )
+
+ is_admin = trans.user_is_admin() and cntrller == 'library_admin'
+ has_accessible_library_datasets = trans.app.security_agent.has_accessible_library_datasets( trans, folder, trans.user, current_user_roles, search_downward=False )
+
+ if root_folder:
+ pad = folder_pad
+ expander = h.url_for("/static/images/silk/resultset_bottom.png")
+ folder_img = h.url_for("/static/images/silk/folder_page.png")
+ else:
+ pad = folder_pad + 20
+ expander = h.url_for("/static/images/silk/resultset_next.png")
+ folder_img = h.url_for("/static/images/silk/folder.png")
+ # SM: If this is a comma-delimited list of LDDAs, then split them up
+ # into a list. For anything else, turn created_ldda_ids into a single
+ # item list.
+ if created_ldda_ids:
+ created_ldda_ids = util.listify( created_ldda_ids )
+ if str( folder.id ) in hidden_folder_ids:
+ return ""
+ my_row = None
+ if is_admin:
+ can_add = can_modify = can_manage = True
+ elif cntrller in [ 'library' ]:
+ can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, folder )
+ if not can_access:
+ can_show, folder_ids = \
+ trans.app.security_agent.show_library_item( trans.user,
+ current_user_roles,
+ folder,
+ [ trans.app.security_agent.permitted_actions.LIBRARY_ADD,
+ trans.app.security_agent.permitted_actions.LIBRARY_MODIFY,
+ trans.app.security_agent.permitted_actions.LIBRARY_MANAGE ] )
+ if not can_show:
+ return ""
+ can_add = trans.app.security_agent.can_add_library_item( current_user_roles, folder )
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, folder )
+ can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, folder )
+ else:
+ can_add = can_modify = can_manage = False
+
+ form_type = trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE
+ info_association, inherited = folder.get_info_association( restrict=True )
+ %>
+ %if not root_folder and ( not folder.deleted or show_deleted ):
+ <% encoded_id = trans.security.encode_id( folder.id ) %>
+ <tr id="folder-${encoded_id}" class="folderRow libraryOrFolderRow"
+ %if parent is not None:
+ parent="${parent}"
+ style="display: none;"
+ %endif
+ >
+ <td style="padding-left: ${folder_pad}px;">
+ <input type="checkbox" class="folderCheckbox"/>
+ <span class="expandLink folder-${encoded_id}-click">
+ <div style="float: left; margin-left: 2px;" class="menubutton split popup" id="folder_img-${folder.id}-popup">
+ <a class="folder-${encoded_id}-click" href="javascript:void(0);">
+ <span class="rowIcon"></span>
+ %if folder.deleted:
+ <div class="libraryItem-error">${folder.name}</div>
+ %else:
+ ${folder.name}
+ %endif
+ </a>
+ </div>
+ </span>
+ %if not library.deleted:
+ <div popupmenu="folder_img-${folder.id}-popup">
+ %if not branch_deleted( folder ) and can_add:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add datasets</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add sub-folder</a>
+ %endif
+ %if not branch_deleted( folder ):
+ %if has_accessible_library_datasets:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Select datasets for import into selected histories</a>
+ %endif
+ %if can_modify:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='folder_info', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type='folder', item_id=trans.security.encode_id( folder.id ), source_library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Move this folder</a>
+ %else:
+ <a class="action-button" class="view-info" href="${h.url_for( controller='library_common', action='folder_info', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">View information</a>
+ %endif
+ %endif
+ %if not branch_deleted( folder ) and can_modify and not info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='folder', form_type=form_type, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Use template</a>
+ %endif
+ %if not branch_deleted( folder ) and can_modify and info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='edit_template', cntrller=cntrller, item_type='folder', form_type=form_type, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit template</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='delete_template', cntrller=cntrller, item_type='folder', form_type=form_type, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Unuse template</a>
+ %endif
+ %if not branch_deleted( folder ) and can_manage:
+ %if not trans.app.security_agent.folder_is_public( folder ):
+ <a class="action-button" href="${h.url_for( controller='library_common', action='make_library_item_public', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_type='folder', id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Make public</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='library_common', action='folder_permissions', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a>
+ %endif
+ %if can_modify:
+ %if not library.deleted and not folder.deleted:
+ <a class="action-button" confirm="Click OK to delete the folder '${folder.name}.'" href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Delete this folder</a>
+ %elif not library.deleted and folder.deleted and not folder.purged:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Undelete this folder</a>
+ %endif
+ %endif
+ </div>
+ %endif
+ <td>
+ %if folder.description:
+ ${folder.description}
+ %endif
+ <td colspan="3"></td>
+ </tr>
+ <%
+ my_row = row_counter.count
+ row_counter.increment()
+ %>
+ %endif
+ <%
+ # TODO: If show_deleted is set to True, then nothing is displayed. Why? This wasn't the case
+ # in the past.
+ if show_deleted:
+ sub_folders, library_datasets = activatable_folders_and_library_datasets( trans, folder )
+ else:
+ sub_folders, library_datasets = active_folders_and_library_datasets( trans, folder )
+ # Render all the subfolders:
+ # TODO: Check permissions first.
+ for sub_folder in sub_folders:
+ render_folder( cntrller, sub_folder, pad, created_ldda_ids, library, [], tracked_datasets, show_deleted=show_deleted, parent=my_row, row_counter=row_counter, root_folder=False )
+
+ # Map LibraryDatasets to LDDAs, then map LDDAs to Datasets.
+ # Then determine which Datasets are accessible and which are not.
+ # For every LibraryDataset, if there's an LDDA for it and it's
+ # accessible then display it.
+ if ( len( library_datasets ) > 0 ):
+ lib_dataset_ldda_map = map_library_datasets_to_lddas( trans, library_datasets )
+ dataset_list = datasets_for_lddas( trans, lib_dataset_ldda_map.values() )
+ can_access_datasets = trans.app.security_agent.get_dataset_access_mapping( trans, current_user_roles, dataset_list )
+ for library_dataset in library_datasets:
+ ldda = lib_dataset_ldda_map[ library_dataset.id ]
+ if ldda:
+ can_access = is_admin or can_access_datasets[ ldda.dataset_id ]
+ selected = created_ldda_ids and str( ldda.id ) in created_ldda_ids
+ if can_access:
+ render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, my_row, row_counter, tracked_datasets, show_deleted=show_deleted )
+ %>
+</%def>
+
+<%def name="render_content(simple=False)">
+ <%
+ from galaxy import util
+ from galaxy.web.controllers.library_common import branch_deleted
+ from time import strftime
+ import logging
+ log = logging.getLogger( __name__ )
+
+ is_admin = trans.user_is_admin() and cntrller == 'library_admin'
+
+ if is_admin:
+ can_add = can_modify = can_manage = True
+ elif cntrller in [ 'library', 'requests' ]:
+ can_add = trans.app.security_agent.can_add_library_item( current_user_roles, library )
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, library )
+ can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, library )
+ else:
+ can_add = can_modify = can_manage = False
+
+ info_association, inherited = library.get_info_association()
+ form_type = trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE
+
+ # SM: These are mostly display-specific; ignore them for now.
+ # The has_accessible_folders determines if anything can be shown - use it.
+ self.has_accessible_datasets = trans.app.security_agent.has_accessible_library_datasets( trans, library.root_folder, trans.user, current_user_roles )
+ root_folder_has_accessible_library_datasets = trans.app.security_agent.has_accessible_library_datasets( trans, library.root_folder, trans.user, current_user_roles, search_downward=False )
+ has_accessible_folders = is_admin or trans.app.security_agent.has_accessible_folders( trans, library.root_folder, trans.user, current_user_roles )
+
+ tracked_datasets = {}
+
+ class RowCounter( object ):
+ def __init__( self ):
+ self.count = 0
+ def increment( self ):
+ self.count += 1
+ def __str__( self ):
+ return str( self.count )
+ %>
+
+ <h2>Data Library “${library.name}”</h2>
+
+ <ul class="manage-table-actions">
+ %if not library.deleted and ( is_admin or can_add ):
+ <li><a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( library.root_folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add datasets</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( library.root_folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add folder</a></li>
+ %endif
+ %if ( ( not library.deleted ) and ( can_modify or can_manage ) ) or ( can_modify and not library.purged ) or ( library.purged ):
+ <li><a class="action-button" id="library-${library.id}-popup" class="menubutton">Library Actions</a></li>
+ <div popupmenu="library-${library.id}-popup">
+ %if not library.deleted:
+ %if can_modify:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='library_info', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
+ <a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a>
+ %if show_deleted:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=False )}">Hide deleted items</a>
+ %else:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=True )}">Show deleted items</a>
+ %endif
+ %endif
+ %if can_modify and not library.info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='library', form_type=form_type, library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Use template</a>
+ %endif
+ %if can_modify and info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='edit_template', cntrller=cntrller, item_type='library', form_type=form_type, library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit template</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='delete_template', cntrller=cntrller, item_type='library', form_type=form_type, library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Unuse template</a>
+ %endif
+ %if can_manage:
+ %if not trans.app.security_agent.library_is_public( library, contents=True ):
+ <a class="action-button" href="${h.url_for( controller='library_common', action='make_library_item_public', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_type='library', id=trans.security.encode_id( library.id ), contents=True, use_panels=use_panels, show_deleted=show_deleted )}">Make public</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='library_common', action='library_permissions', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a>
+ %endif
+ %if root_folder_has_accessible_library_datasets:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( library.root_folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Select datasets for import into selected histories</a>
+ %endif
+ %elif can_modify and not library.purged:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library', use_panels=use_panels )}">Undelete this data library</a>
+ %elif library.purged:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">This data library has been purged</a>
+ %endif
+ </div>
+ %endif
+ </ul>
+
+ %if message:
+ ${render_msg( message, status )}
+ %endif
+
+ %if library.synopsis not in [ '', 'None', None ]:
+ <div class="libraryItemBody">
+ ${library.synopsis}
+ </div>
+ %endif
+
+ %if self.has_accessible_datasets:
+ <form name="act_on_multiple_datasets" action="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}" onSubmit="javascript:return checkForm();" method="post">
+ %endif
+ %if has_accessible_folders:
+ <table cellspacing="0" cellpadding="0" border="0" width="100%" class="grid" id="library-grid">
+ <thead>
+ <tr class="libraryTitle">
+ <th>
+ %if self.has_accessible_datasets:
+ <input type="checkbox" id="checkAll" name=select_all_datasets_checkbox value="true" onclick='checkAllFields(1);'/><input type="hidden" name=select_all_datasets_checkbox value="true"/>
+ %endif
+ Name
+ </th>
+ % if not simple:
+ <th>Message</th>
+ <th>Data type</th>
+ % endif
+ <th>Date uploaded</th>
+ <th>File size</th>
+ </tr>
+ </thead>
+ <% row_counter = RowCounter() %>
+ ## SM: Here is where we render the libraries based on admin/non-admin privileges:
+ %if cntrller in [ 'library', 'requests' ]:
+ ${self.render_folder( 'library', library.root_folder, 0, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=show_deleted, parent=None, row_counter=row_counter, root_folder=True, simple=simple )}
+ ## SM: TODO: WTF?
+ %if not library.deleted and self.has_accessible_datasets and not simple:
+ ${render_actions_on_multiple_items()}
+ %endif
+ %elif ( trans.user_is_admin() and cntrller in [ 'library_admin', 'requests_admin' ] ):
+ ${self.render_folder( 'library_admin', library.root_folder, 0, created_ldda_ids, library, [], tracked_datasets, show_deleted=show_deleted, parent=None, row_counter=row_counter, root_folder=True )}
+ ## SM: TODO: WTF?
+ %if not library.deleted and not show_deleted and self.has_accessible_datasets:
+ ${render_actions_on_multiple_items()}
+ %endif
+ %endif
+ </table>
+ %endif
+ %if self.has_accessible_datasets:
+ </form>
+ %endif
+
+ %if tracked_datasets:
+ <script type="text/javascript">
+ // Updater
+ updater({${ ",".join( [ '"%s" : "%s"' % ( k, v ) for k, v in tracked_datasets.iteritems() ] ) }});
+ </script>
+ <!-- running: do not change this comment, used by TwillTestCase.library_wait -->
+ %endif
+
+ %if self.has_accessible_datasets and not simple:
+ ${render_compression_types_help( comptypes )}
+ %endif
+ %if not has_accessible_folders:
+ The data library '${library.name}' does not contain any datasets that you can access.
+ %endif
+</%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Fix from write_integrated_tool_panel_config_file when a section has been removed from tool_conf.xml
by Bitbucket 27 Sep '12
by Bitbucket 27 Sep '12
27 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/4f788268c76d/
changeset: 4f788268c76d
user: dan
date: 2012-09-27 20:25:45
summary: Fix from write_integrated_tool_panel_config_file when a section has been removed from tool_conf.xml
affected #: 1 file
diff -r 206bd8b822caab015f8447c92aeb63264afc3667 -r 4f788268c76dcb77e99076dbfbc8cf65c05b00cc lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -263,36 +263,35 @@
os.write( fd, '<?xml version="1.0"?>\n' )
os.write( fd, '<toolbox>\n' )
for key, item in self.integrated_tool_panel.items():
- if key.startswith( 'tool_' ):
- if item:
+ if item:
+ if key.startswith( 'tool_' ):
os.write( fd, ' <tool id="%s" />\n' % item.id )
- elif key.startswith( 'workflow_' ):
- if item:
+ elif key.startswith( 'workflow_' ):
os.write( fd, ' <workflow id="%s" />\n' % item.id )
- elif key.startswith( 'label_' ):
- label_id = item.id or ''
- label_text = item.text or ''
- label_version = item.version or ''
- os.write( fd, ' <label id="%s" text="%s" version="%s" />\n' % ( label_id, label_text, label_version ) )
- elif key.startswith( 'section_' ):
- section_id = item.id or ''
- section_name = item.name or ''
- section_version = item.version or ''
- os.write( fd, ' <section id="%s" name="%s" version="%s">\n' % ( section_id, section_name, section_version ) )
- for section_key, section_item in item.elems.items():
- if section_key.startswith( 'tool_' ):
- if section_item:
- os.write( fd, ' <tool id="%s" />\n' % section_item.id )
- elif section_key.startswith( 'workflow_' ):
- if section_item:
- os.write( fd, ' <workflow id="%s" />\n' % section_item.id )
- elif section_key.startswith( 'label_' ):
- if section_item:
- label_id = section_item.id or ''
- label_text = section_item.text or ''
- label_version = section_item.version or ''
- os.write( fd, ' <label id="%s" text="%s" version="%s" />\n' % ( label_id, label_text, label_version ) )
- os.write( fd, ' </section>\n' )
+ elif key.startswith( 'label_' ):
+ label_id = item.id or ''
+ label_text = item.text or ''
+ label_version = item.version or ''
+ os.write( fd, ' <label id="%s" text="%s" version="%s" />\n' % ( label_id, label_text, label_version ) )
+ elif key.startswith( 'section_' ):
+ section_id = item.id or ''
+ section_name = item.name or ''
+ section_version = item.version or ''
+ os.write( fd, ' <section id="%s" name="%s" version="%s">\n' % ( section_id, section_name, section_version ) )
+ for section_key, section_item in item.elems.items():
+ if section_key.startswith( 'tool_' ):
+ if section_item:
+ os.write( fd, ' <tool id="%s" />\n' % section_item.id )
+ elif section_key.startswith( 'workflow_' ):
+ if section_item:
+ os.write( fd, ' <workflow id="%s" />\n' % section_item.id )
+ elif section_key.startswith( 'label_' ):
+ if section_item:
+ label_id = section_item.id or ''
+ label_text = section_item.text or ''
+ label_version = section_item.version or ''
+ os.write( fd, ' <label id="%s" text="%s" version="%s" />\n' % ( label_id, label_text, label_version ) )
+ os.write( fd, ' </section>\n' )
os.write( fd, '</toolbox>\n' )
os.close( fd )
shutil.move( filename, os.path.abspath( self.integrated_tool_panel_config ) )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Cuffcompare wrapper: only include refmap datasets if reference annotation is used.
by Bitbucket 27 Sep '12
by Bitbucket 27 Sep '12
27 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/206bd8b822ca/
changeset: 206bd8b822ca
user: jgoecks
date: 2012-09-27 20:12:15
summary: Cuffcompare wrapper: only include refmap datasets if reference annotation is used.
affected #: 1 file
diff -r 9972ac6ee91d7cab4b762ab6c68ff0cacc8b108e -r 206bd8b822caab015f8447c92aeb63264afc3667 tools/ngs_rna/cuffcompare_wrapper.xml
--- a/tools/ngs_rna/cuffcompare_wrapper.xml
+++ b/tools/ngs_rna/cuffcompare_wrapper.xml
@@ -80,13 +80,18 @@
from_work_dir="cc_output.stats" /><data format="tabular" name="input1_tmap" label="${tool.name} on ${on_string}: ${first_input.hid} data tmap file"
from_work_dir="cc_output.input1.tmap" />
- <data format="tabular" name="input1_refmap" label="${tool.name} on ${on_string}: data ${first_input.hid} refmap file"
- from_work_dir="cc_output.input1.refmap"/>
+ <data format="tabular" name="input1_refmap"
+ label="${tool.name} on ${on_string}: data ${first_input.hid} refmap file"
+ from_work_dir="cc_output.input1.refmap">
+ <filter>annotation['use_ref_annotation'] == 'Yes'</filter>
+ </data><data format="tabular" name="input2_tmap" label="${tool.name} on ${on_string}: data ${input_files[0]['additional_input'].hid} tmap file" from_work_dir="cc_output.input2.tmap">
- <filter>len( input_files ) > 0</filter>
+ <filter>len( input_files ) > 1</filter></data>
- <data format="tabular" name="input2_refmap" label="${tool.name} on ${on_string}: data ${input_files[0]['additional_input'].hid} refmap file" from_work_dir="cc_output.input2.refmap">
- <filter>len( input_files ) > 0</filter>
+ <data format="tabular" name="input2_refmap"
+ label="${tool.name} on ${on_string}: data ${input_files[0]['additional_input'].hid} refmap file"
+ from_work_dir="cc_output.input2.refmap">
+ <filter>annotation['use_ref_annotation'] == 'Yes' and len( input_files ) > 1</filter></data><data format="tabular" name="transcripts_tracking" label="${tool.name} on ${on_string}: transcript tracking" from_work_dir="cc_output.tracking"><filter>len( input_files ) > 0</filter>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Apply styles when displaying the long description when viewing a tool shed repository.
by Bitbucket 27 Sep '12
by Bitbucket 27 Sep '12
27 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/9972ac6ee91d/
changeset: 9972ac6ee91d
user: greg
date: 2012-09-27 20:04:38
summary: Apply styles when displaying the long description when viewing a tool shed repository.
affected #: 2 files
diff -r 9c53432ad51c3936e001b3cfe1e82f949ce98fd8 -r 9972ac6ee91d7cab4b762ab6c68ff0cacc8b108e templates/webapps/community/common/common.mako
--- a/templates/webapps/community/common/common.mako
+++ b/templates/webapps/community/common/common.mako
@@ -36,3 +36,23 @@
</div></div></%def>
+
+<%def name="render_long_description( description_text )">
+ <style type="text/css">
+ #description_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style>
+ <div class="form-row">
+ <label>Detailed description:</label>
+ <table id="description_table">
+ <tr><td><pre>${description_text}</pre></td></tr>
+ </table>
+ <div style="clear: both"></div>
+ </div>
+</%def>
diff -r 9c53432ad51c3936e001b3cfe1e82f949ce98fd8 -r 9972ac6ee91d7cab4b762ab6c68ff0cacc8b108e templates/webapps/community/repository/view_repository.mako
--- a/templates/webapps/community/repository/view_repository.mako
+++ b/templates/webapps/community/repository/view_repository.mako
@@ -127,11 +127,7 @@
${repository.description}
</div>
%if repository.long_description:
- <div class="form-row">
- <label>Detailed description:</label>
- <pre>${repository.long_description}</pre>
- <div style="clear: both"></div>
- </div>
+ ${render_long_description( repository.long_description )}
%endif
<div class="form-row"><label>Revision:</label>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Circster: add chromosome labels and some refactoring.
by Bitbucket 27 Sep '12
by Bitbucket 27 Sep '12
27 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/9c53432ad51c/
changeset: 9c53432ad51c
user: jgoecks
date: 2012-09-27 19:36:34
summary: Circster: add chromosome labels and some refactoring.
affected #: 2 files
diff -r 14c1b3e05fb884ba7b6f46a0ba3adb91bcae6485 -r 9c53432ad51c3936e001b3cfe1e82f949ce98fd8 static/scripts/viz/circster.js
--- a/static/scripts/viz/circster.js
+++ b/static/scripts/viz/circster.js
@@ -1,4 +1,4 @@
-define( ["libs/underscore", "libs/d3", "viz/visualization"], function(_, d3, visualization) {
+define(["libs/underscore", "libs/d3", "viz/visualization"], function(_, d3, visualization) {
// General backbone style inheritence
var Base = function() { this.initialize && this.initialize.apply(this, arguments); }; Base.extend = Backbone.Model.extend;
@@ -28,6 +28,18 @@
});
/**
+ * A label track.
+ */
+// FIXME: merge with tracks.js LabelTrack
+var LabelTrack = Backbone.Model.extend({
+ defaults: {
+ prefs: {
+ color: '#ccc'
+ }
+ }
+});
+
+/**
* Renders a full circster visualization.
*/
var CircsterView = Backbone.View.extend({
@@ -38,6 +50,7 @@
this.genome = options.genome;
this.dataset_arc_height = options.dataset_arc_height;
this.track_gap = 5;
+ this.label_arc_height = 20;
},
render: function() {
@@ -47,8 +60,9 @@
height = self.$el.height(),
// Compute radius start based on model, will be centered
// and fit entirely inside element by default.
- init_radius_start = ( Math.min(width, height)/2 -
- this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap) ),
+ init_radius_start = Math.min(width, height) / 2 -
+ this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap) -
+ (this.label_arc_height + this.track_gap),
tracks = this.model.get('tracks');
// Set up SVG element.
@@ -76,7 +90,7 @@
d3.selectAll('path.chrom-data').filter(function(d, i) {
return utils.is_visible(this, svg);
}).each(function(d, i) {
- var elt_data = $.data(this, "chrom_data");
+ var elt_data = $.data(this, 'chrom_data');
tracks_and_chroms_to_update[elt_data.track.id].push(elt_data.chrom);
});
@@ -96,6 +110,7 @@
var track_renderer = new track_renderer_class({
track: track,
+ track_index: index,
radius_start: radius_start,
radius_end: radius_start + dataset_arc_height,
genome: self.genome,
@@ -105,47 +120,67 @@
track_renderer.render(svg);
});
+
+ // -- Render chromosome labels. --
+ var radius_start = init_radius_start + tracks.length * (dataset_arc_height + self.track_gap) + self.track_gap;
+ var chrom_labels_track = new CircsterLabelTrackRenderer({
+ track: new LabelTrack(),
+ track_index: tracks.length,
+ radius_start: radius_start,
+ radius_end: radius_start,
+ genome: self.genome,
+ total_gap: self.total_gap
+ });
+
+ chrom_labels_track.render(svg);
}
});
var CircsterTrackRenderer = Base.extend( {
- initialize: function( options ) {
+ initialize: function(options) {
this.options = options;
+ this.options.bg_stroke = 'ccc';
+ this.options.bg_fill = 'ccc';
},
- render: function( svg ) {
- // Draw background arcs for each chromosome.
- var genome_arcs = this.chroms_layout(),
+ render: function(svg) {
+ // Create track group element.
+ var track_group_elt = svg.append("g").attr("id", "parent-" + this.options.track_index);
+
+ // Render background arcs.
+ var genome_arcs = this._chroms_layout(),
radius_start = this.options.radius_start,
radius_end = this.options.radius_end,
- track_parent_elt = svg.append("g").attr("id", "inner-arc"),
arc_gen = d3.svg.arc()
- .innerRadius(radius_start)
- .outerRadius(radius_end),
- // Draw arcs.
- chroms_elts = track_parent_elt.selectAll("#inner-arc>path")
- .data(genome_arcs).enter().append("path")
- .attr("d", arc_gen)
- .style("stroke", "#ccc")
- .style("fill", "#ccc")
- .append("title").text(function(d) { return d.data.chrom; });
+ .innerRadius(radius_start)
+ .outerRadius(radius_end),
- // Render data.
- this.render_data(track_parent_elt);
+ chroms_elts = track_group_elt.selectAll('g')
+ .data(genome_arcs).enter().append('svg:g');
+
+ // Draw arcs.
+ chroms_elts.append("path")
+ .attr("d", arc_gen)
+ .style("stroke", this.options.bg_stroke)
+ .style("fill", this.options.bg_fill)
+ .append("title").text(function(d) { return d.data.chrom; });
+
+ // Render track data.
+ this.render_data(track_group_elt);
// Apply prefs.
var prefs = this.options.track.get('prefs'),
block_color = prefs.block_color;
if (!block_color) { block_color = prefs.color; }
- track_parent_elt.selectAll('path.chrom-data').style('stroke', block_color).style('fill', block_color);
+ track_group_elt.selectAll('path.chrom-data').style('stroke', block_color).style('fill', block_color);
},
/**
* Returns arc layouts for genome's chromosomes/contigs. Arcs are arranged in a circle
* separated by gaps.
*/
- chroms_layout: function() {
+ _chroms_layout: function() {
// Setup chroms layout using pie.
var chroms_info = this.options.genome.get_chroms_info(),
pie_layout = d3.layout.pie().value(function(d) { return d.len; }).sort(null),
@@ -171,7 +206,7 @@
*/
render_data: function(svg) {
var self = this,
- chrom_arcs = this.chroms_layout(),
+ chrom_arcs = this._chroms_layout(),
track = this.options.track,
r_start = this.options.radius_start,
r_end = this.options.radius_end,
@@ -198,6 +233,42 @@
});
/**
+ * Render chromosome labels.
+ */
+var CircsterLabelTrackRenderer = CircsterTrackRenderer.extend({
+
+ initialize: function(options) {
+ this.options = options;
+ this.options.bg_stroke = 'fff';
+ this.options.bg_fill = 'fff';
+ },
+
+ /**
+ * Render labels.
+ */
+ render_data: function(svg) {
+ // Add chromosome label where it will fit; an alternative labeling mechanism
+ // would be nice for small chromosomes.
+ var chrom_arcs = svg.selectAll('g');
+
+ chrom_arcs.selectAll('path')
+ .attr('id', function(d) { return 'label-' + d.data.chrom; })
+
+ chrom_arcs.append("svg:text")
+ .filter(function(d) {
+ return d.endAngle - d.startAngle > 0.08;
+ })
+ .attr('text-anchor', 'middle')
+ .append("svg:textPath")
+ .attr("xlink:href", function(d) { return "#label-" + d.data.chrom; })
+ .attr('startOffset', '25%')
+ .text(function(d) {
+ return d.data.chrom;
+ });
+ }
+});
+
+/**
* Rendered for quantitative data.
*/
var CircsterQuantitativeTrackRenderer = CircsterTrackRenderer.extend({
diff -r 14c1b3e05fb884ba7b6f46a0ba3adb91bcae6485 -r 9c53432ad51c3936e001b3cfe1e82f949ce98fd8 templates/visualization/circster.mako
--- a/templates/visualization/circster.mako
+++ b/templates/visualization/circster.mako
@@ -11,6 +11,11 @@
<%def name="stylesheets()">
${parent.stylesheets()}
+ <style>
+ text {
+ font-size: 10px;
+ }
+ </style></%def><%def name="javascripts()">
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Always load the tool version with the highest lineage into the tool panel.
by Bitbucket 27 Sep '12
by Bitbucket 27 Sep '12
27 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/14c1b3e05fb8/
changeset: 14c1b3e05fb8
user: dan
date: 2012-09-27 18:40:05
summary: Always load the tool version with the highest lineage into the tool panel.
affected #: 1 file
diff -r 0527905739fe10789de3d331a44dec3507bdfdb2 -r 14c1b3e05fb884ba7b6f46a0ba3adb91bcae6485 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -159,6 +159,8 @@
else:
panel_dict = panel_component
already_loaded = False
+ loaded_version_key = None
+ lineage_id = None
for lineage_id in tool.lineage_ids:
if lineage_id in self.tools_by_id:
loaded_version_key = 'tool_%s' % lineage_id
@@ -176,7 +178,13 @@
if not inserted:
# If the tool is not defined in integrated_tool_panel.xml, append it to the tool panel.
panel_dict[ key ] = tool
- log.debug( "Loaded tool id: %s, version: %s." % ( tool.id, tool.version ) )
+ log.debug( "Loaded tool id: %s, version: %s into tool panel." % ( tool.id, tool.version ) )
+ elif tool.lineage_ids.index( tool_id ) > tool.lineage_ids.index( lineage_id ):
+ key = 'tool_%s' % tool.id
+ index = panel_dict.keys().index( loaded_version_key )
+ del panel_dict[ loaded_version_key ]
+ panel_dict.insert( index, key, tool )
+ log.debug( "Loaded tool id: %s, version: %s into tool panel." % ( tool.id, tool.version ) )
def load_tool_panel( self ):
for key, val in self.integrated_tool_panel.items():
if key.startswith( 'tool_' ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
5 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/371f6770d25c/
changeset: 371f6770d25c
user: dan
date: 2012-09-27 17:46:12
summary: Refactor toolbox.get_tool. Store 'original tool.id' as tool.old_id.
affected #: 1 file
diff -r c28c5f906c6bdbbe799cfcc559760f26029090ce -r 371f6770d25cc5942fad87e8f43e8ce736c75838 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -291,34 +291,33 @@
os.chmod( self.integrated_tool_panel_config, 0644 )
def get_tool( self, tool_id, tool_version=None, get_all_versions=False ):
"""Attempt to locate a tool in the tool box."""
- if tool_id in self.tools_by_id:
- tool = self.tools_by_id[ tool_id ]
- if tool_version and tool.version == tool_version:
- if get_all_versions:
- return [ tool ]
- else:
- return tool
- else:
- if get_all_versions:
- return [ tool ]
- else:
- return tool
+ if tool_id in self.tools_by_id and not get_all_versions:
+ #tool_id exactly matches an available tool by id (which is 'old' tool_id or guid)
+ return self.tools_by_id[ tool_id ]
+ #exact tool id match not found, or all versions requested, search for other options, e.g. migrated tools or different versions
+ rval = []
tv = self.__get_tool_version( tool_id )
if tv:
tool_version_ids = tv.get_version_ids( self.app )
- if get_all_versions:
- available_tool_versions = []
- for tool_version_id in tool_version_ids:
- if tool_version_id in self.tools_by_id:
- available_tool_versions.append( self.tools_by_id[ tool_version_id ] )
- return available_tool_versions
for tool_version_id in tool_version_ids:
if tool_version_id in self.tools_by_id:
- tool = self.tools_by_id[ tool_version_id ]
- if tool_version and tool.version == tool_version:
- return tool
- else:
- return tool
+ rval.append( self.tools_by_id[ tool_version_id ] )
+ if not rval:
+ #still no tool, do a deeper search and try to match by old ids
+ for tool in self.tools_by_id.itervalues():
+ if tool.old_id == tool_id:
+ rval.append( tool )
+ if rval:
+ if get_all_versions:
+ return rval
+ else:
+ if tool_version:
+ #return first tool with matching version
+ for tool in rval:
+ if tool.version == tool_version:
+ return tool
+ #No tool matches by version, simply return the first available tool found
+ return rval[0]
return None
def get_loaded_tools_by_lineage( self, tool_id ):
"""Get all loaded tools associated by lineage to the tool whose id is tool_id."""
@@ -381,7 +380,6 @@
tool.repository_owner = repository_owner
tool.installed_changeset_revision = installed_changeset_revision
tool.guid = guid
- tool.old_id = elem.find( "id" ).text
tool.version = elem.find( "version" ).text
# Make sure the tool has a tool_version.
if not self.__get_tool_version( tool.id ):
@@ -906,8 +904,9 @@
if not self.name:
raise Exception, "Missing tool 'name'"
# Get the UNIQUE id for the tool
+ self.old_id = root.get( "id" )
if guid is None:
- self.id = root.get( "id" )
+ self.id = self.old_id
else:
self.id = guid
if not self.id:
https://bitbucket.org/galaxy/galaxy-central/changeset/5adfb582cca4/
changeset: 5adfb582cca4
user: dan
date: 2012-09-27 17:46:12
summary: Refactor tool selection during rerun. Always allow selecting different versions of a tool when first accessed in tool_runner.
affected #: 1 file
diff -r 371f6770d25cc5942fad87e8f43e8ce736c75838 -r 5adfb582cca4305295f88d6128ccaa54c72a8977 lib/galaxy/web/controllers/tool_runner.py
--- a/lib/galaxy/web/controllers/tool_runner.py
+++ b/lib/galaxy/web/controllers/tool_runner.py
@@ -50,27 +50,21 @@
tools = toolbox.get_loaded_tools_by_lineage( tool_id )
else:
tools = toolbox.get_tool( tool_id, tool_version=tool_version, get_all_versions=True )
- if len( tools ) > 1:
- tool_version_select_field = self.build_tool_version_select_field( tools, tool_id, set_selected )
- for tool in tools:
- if tool.id == tool_id:
- break
- else:
- tool = tools[ 0 ]
- else:
- tool = tools[ 0 ]
- break
+ if tools:
+ tool = toolbox.get_tool( tool_id, tool_version=tool_version, get_all_versions=False )
+ if len( tools ) > 1:
+ tool_version_select_field = self.build_tool_version_select_field( tools, tool.id, set_selected )
+ break
return tool_version_select_field, tools, tool
@web.expose
def index(self, trans, tool_id=None, from_noframe=None, **kwd):
# No tool id passed, redirect to main page
if tool_id is None:
return trans.response.send_redirect( url_for( "/static/welcome.html" ) )
- set_selected = 'refresh' in kwd
tool_version_select_field, tools, tool = self.__get_tool_components( tool_id,
tool_version=None,
- get_loaded_tools_by_lineage=True,
- set_selected=set_selected )
+ get_loaded_tools_by_lineage=False,
+ set_selected=True )
# No tool matching the tool id, display an error (shouldn't happen)
if not tool:
log.error( "index called with tool id '%s' but no such tool exists", tool_id )
https://bitbucket.org/galaxy/galaxy-central/changeset/c76e2882d2d2/
changeset: c76e2882d2d2
user: dan
date: 2012-09-27 17:46:13
summary: Better handling of determining tool/version in workflow tool module.
affected #: 1 file
diff -r 5adfb582cca4305295f88d6128ccaa54c72a8977 -r c76e2882d2d23be86cb914df619af4b3e33911cf lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -199,13 +199,9 @@
# TODO: If workflows are ever enhanced to use tool version
# in addition to tool id, enhance the selection process here
# to retrieve the correct version of the tool.
- tool_version = Class.__get_tool_version( trans, tool_id )
- if tool_version:
- tool_version_ids = tool_version.get_version_ids( trans.app )
- for tool_version_id in tool_version_ids:
- if tool_version_id in trans.app.toolbox.tools_by_id:
- tool_id = tool_version_id
- break
+ tool = trans.app.toolbox.get_tool( tool_id )
+ if tool:
+ tool_id = tool.id
if ( trans.app.toolbox and tool_id in trans.app.toolbox.tools_by_id ):
module = Class( trans, tool_id )
module.state = DefaultToolState()
https://bitbucket.org/galaxy/galaxy-central/changeset/e6289956e267/
changeset: e6289956e267
user: dan
date: 2012-09-27 17:46:13
summary: Display tool version in workflow tool form editor.
affected #: 1 file
diff -r c76e2882d2d23be86cb914df619af4b3e33911cf -r e6289956e267c5e98b343b8ae1149b8af89a26e6 templates/workflow/editor_tool_form.mako
--- a/templates/workflow/editor_tool_form.mako
+++ b/templates/workflow/editor_tool_form.mako
@@ -98,6 +98,9 @@
<div class="toolForm"><div class="toolFormTitle">Tool: ${tool.name}</div>
+ %if tool.version:
+ <div class="form-row"><div class='titleRow'>Version: ${tool.version}</div></div>
+ %endif
<div class="toolFormBody"><input type="hidden" name="tool_id" value="${tool.id}" />
%for i, inputs in enumerate( tool.inputs_by_page ):
https://bitbucket.org/galaxy/galaxy-central/changeset/0527905739fe/
changeset: 0527905739fe
user: dan
date: 2012-09-27 17:46:13
summary: Display tool version when running a workflow.
affected #: 1 file
diff -r e6289956e267c5e98b343b8ae1149b8af89a26e6 -r 0527905739fe10789de3d331a44dec3507bdfdb2 templates/workflow/run.mako
--- a/templates/workflow/run.mako
+++ b/templates/workflow/run.mako
@@ -379,6 +379,9 @@
<div class="toolForm"><div class="toolFormTitle"><span class='title_ul_text'>Step ${int(step.order_index)+1}: ${tool.name}</span>
+ %if tool.version:
+ (version ${tool.version})
+ %endif
% if step.annotations:
<div class="step-annotation">${h.to_unicode( step.annotations[0].annotation )}</div>
% endif
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Add the ability to view a tool shed repository's README file from the pop-up menu on pages in the tool shed repository as well as in Galaxy for the installed repository.
by Bitbucket 27 Sep '12
by Bitbucket 27 Sep '12
27 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/c28c5f906c6b/
changeset: c28c5f906c6b
user: greg
date: 2012-09-27 16:33:55
summary: Add the ability to view a tool shed repository's README file from the pop-up menu on pages in the tool shed repository as well as in Galaxy for the installed repository.
affected #: 28 files
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce lib/galaxy/tool_shed/install_manager.py
--- a/lib/galaxy/tool_shed/install_manager.py
+++ b/lib/galaxy/tool_shed/install_manager.py
@@ -133,6 +133,7 @@
for k, v in tool_panel_dict_for_tool_config.items():
tool_panel_dict_for_display[ k ] = v
metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=self.app,
+ repository=tool_shed_repository,
repository_clone_url=repository_clone_url,
relative_install_dir=relative_install_dir,
repository_files_dir=None,
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -31,8 +31,8 @@
'&' : '&',
'\'' : ''' }
MAX_CONTENT_SIZE = 32768
+NOT_TOOL_CONFIGS = [ 'datatypes_conf.xml', 'tool_dependencies.xml' ]
VALID_CHARS = set( string.letters + string.digits + "'\"-=_.()/+*^,:?!#[]%\\$@;{}" )
-NOT_TOOL_CONFIGS = [ 'datatypes_conf.xml', 'tool_dependencies.xml' ]
class ShedCounter( object ):
def __init__( self, model ):
@@ -602,7 +602,7 @@
else:
tool_dependencies_dict[ 'set_environment' ] = [ requirements_dict ]
return tool_dependencies_dict
-def generate_metadata_for_changeset_revision( app, repository_clone_url, relative_install_dir=None, repository_files_dir=None,
+def generate_metadata_for_changeset_revision( app, repository, repository_clone_url, relative_install_dir=None, repository_files_dir=None,
resetting_all_metadata_on_repository=False, webapp='galaxy' ):
"""
Generate metadata for a repository using it's files on disk. To generate metadata for changeset revisions older than the repository tip,
@@ -610,6 +610,7 @@
disk files, so the value of repository_files_dir will not always be repository.repo_path (it could be an absolute path to a temporary directory
containing a clone). If it is an absolute path, the value of relative_install_dir must contain repository.repo_path.
"""
+ readme_file_names = get_readme_file_names( repository.name )
metadata_dict = {}
invalid_file_tups = []
invalid_tool_configs = []
@@ -653,14 +654,24 @@
tool_data_path=app.config.tool_data_path,
tool_data_table_config_path=app.config.tool_data_table_config_path,
persist=False )
- # Find all tool configs and exported workflows and add them to the repository's metadata.
for root, dirs, files in os.walk( files_dir ):
if root.find( '.hg' ) < 0 and root.find( 'hgrc' ) < 0:
if '.hg' in dirs:
dirs.remove( '.hg' )
for name in files:
- # Find all tool configs.
- if name not in NOT_TOOL_CONFIGS and name.endswith( '.xml' ):
+ # See if we have a READ_ME file.
+ if name.lower() in readme_file_names:
+ if resetting_all_metadata_on_repository:
+ full_path_to_readme = os.path.join( root, name )
+ stripped_path_to_readme = full_path_to_readme.replace( work_dir, '' )
+ if stripped_path_to_readme.startswith( '/' ):
+ stripped_path_to_readme = stripped_path_to_readme[ 1: ]
+ relative_path_to_readme = os.path.join( relative_install_dir, stripped_path_to_readme )
+ else:
+ relative_path_to_readme = os.path.join( root, name )
+ metadata_dict[ 'readme' ] = relative_path_to_readme
+ # See if we have a tool config.
+ elif name not in NOT_TOOL_CONFIGS and name.endswith( '.xml' ):
full_path = os.path.abspath( os.path.join( root, name ) )
if os.path.getsize( full_path ) > 0:
if not ( check_binary( full_path ) or check_image( full_path ) or check_gzip( full_path )[ 0 ]
@@ -699,7 +710,7 @@
else:
for tup in invalid_files_and_errors_tups:
invalid_file_tups.append( tup )
- # Find all exported workflows
+ # Find all exported workflows.
elif name.endswith( '.ga' ):
relative_path = os.path.join( root, name )
if os.path.getsize( os.path.abspath( relative_path ) ) > 0:
@@ -1195,6 +1206,25 @@
if contents:
contents.sort()
return contents
+def get_repository_metadata_by_changeset_revision( trans, id, changeset_revision ):
+ """Get metadata for a specified repository change set from the database"""
+ # Make sure there are no duplicate records, and return the single unique record for the changeset_revision. Duplicate records were somehow
+ # created in the past. The cause of this issue has been resolved, but we'll leave this method as is for a while longer to ensure all duplicate
+ # records are removed.
+ all_metadata_records = trans.sa_session.query( trans.model.RepositoryMetadata ) \
+ .filter( and_( trans.model.RepositoryMetadata.table.c.repository_id == trans.security.decode_id( id ),
+ trans.model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) ) \
+ .order_by( trans.model.RepositoryMetadata.table.c.update_time.desc() ) \
+ .all()
+ if len( all_metadata_records ) > 1:
+ # Delete all recrds older than the last one updated.
+ for repository_metadata in all_metadata_records[ 1: ]:
+ trans.sa_session.delete( repository_metadata )
+ trans.sa_session.flush()
+ return all_metadata_records[ 0 ]
+ elif all_metadata_records:
+ return all_metadata_records[ 0 ]
+ return None
def get_repository_owner( cleaned_repository_url ):
items = cleaned_repository_url.split( 'repos' )
repo_path = items[ 1 ]
@@ -1405,6 +1435,13 @@
return shed_url
# The tool shed from which the repository was originally installed must no longer be configured in tool_sheds_conf.xml.
return None
+def get_readme_file_names( repository_name ):
+ readme_files = [ 'readme', 'read_me', 'install' ]
+ valid_filenames = [ r for r in readme_files ]
+ for r in readme_files:
+ valid_filenames.append( '%s.txt' % r )
+ valid_filenames.append( '%s.txt' % repository_name )
+ return valid_filenames
def handle_missing_data_table_entry( app, relative_install_dir, tool_path, repository_tools_tups ):
"""
Inspect each tool to see if any have input parameters that are dynamically generated select lists that require entries in the
@@ -1907,6 +1944,19 @@
elif c not in [ '\r' ]:
translated.append( '' )
return ''.join( translated )
+def translate_string( raw_text, to_html=True ):
+ if raw_text:
+ if to_html:
+ if len( raw_text ) <= MAX_CONTENT_SIZE:
+ translated_string = to_html_str( raw_text )
+ else:
+ large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % util.nice_size( MAX_CONTENT_SIZE )
+ translated_string = to_html_str( '%s%s' % ( raw_text[ 0:MAX_CONTENT_SIZE ], large_str ) )
+ else:
+ raise Exception( "String translation currently only supports text to HTML." )
+ else:
+ translated_string = ''
+ return translated_string
def update_repository( repo, ctx_rev=None ):
"""
Update the cloned repository to changeset_revision. It is critical that the installed repository is updated to the desired
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -342,8 +342,10 @@
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
repository = get_repository( trans, kwd[ 'id' ] )
+ has_readme = repository.metadata and 'readme' in repository.metadata
return trans.fill_template( '/admin/tool_shed_repository/browse_repository.mako',
repository=repository,
+ has_readme=has_readme,
message=message,
status=status )
@web.expose
@@ -388,8 +390,11 @@
message += "Choose <b>Uninstall this tool dependency</b> from the <b>Repository Actions</b> menu, correct problems "
message += "if necessary, and try installing the dependency again."
status = "error"
+ tool_shed_repository = tool_dependency.tool_shed_repository
+ has_readme = tool_shed_repository.metadata and 'readme' in tool_shed_repository.metadata
return trans.fill_template( '/admin/tool_shed_repository/browse_tool_dependency.mako',
- repository=tool_dependency.tool_shed_repository,
+ repository=tool_shed_repository,
+ has_readme=has_readme,
tool_dependency=tool_dependency,
in_error_state=in_error_state,
can_uninstall=can_uninstall,
@@ -487,9 +492,11 @@
message=message,
status=status ) )
remove_from_disk_check_box = CheckboxField( 'remove_from_disk', checked=remove_from_disk_checked )
+ has_readme = tool_shed_repository.metadata and 'readme' in tool_shed_repository.metadata
return trans.fill_template( '/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako',
repository=tool_shed_repository,
remove_from_disk_check_box=remove_from_disk_check_box,
+ has_readme=has_readme,
message=message,
status=status )
@web.expose
@@ -716,6 +723,7 @@
when an admin is installing a new repository or reinstalling an uninstalled repository.
"""
metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app,
+ repository=tool_shed_repository,
repository_clone_url=repository_clone_url,
relative_install_dir=relative_install_dir,
repository_files_dir=None,
@@ -837,8 +845,10 @@
trans.sa_session.add( repository )
trans.sa_session.flush()
message = "Repository metadata has been reset."
+ has_readme = repository.metadata and 'readme' in repository.metadata
return trans.fill_template( '/admin/tool_shed_repository/manage_repository.mako',
repository=repository,
+ has_readme=has_readme,
in_error_state=in_error_state,
can_install=can_install,
description=description,
@@ -914,14 +924,14 @@
tool_shed_repository = tool_dependency.tool_shed_repository
self.tool_dependency_grid.title = "Tool shed repository '%s' tool dependencies" % tool_shed_repository.name
self.tool_dependency_grid.global_actions = \
- [ grids.GridAction( label='Browse repository',
+ [ grids.GridAction( label='Manage repository',
+ url_args=dict( controller='admin_toolshed',
+ action='manage_repository',
+ id=trans.security.encode_id( tool_shed_repository.id ) ) ),
+ grids.GridAction( label='Browse repository',
url_args=dict( controller='admin_toolshed',
action='browse_repository',
id=trans.security.encode_id( tool_shed_repository.id ) ) ),
- grids.GridAction( label='Manage repository',
- url_args=dict( controller='admin_toolshed',
- action='manage_repository',
- id=trans.security.encode_id( tool_shed_repository.id ) ) ),
grids.GridAction( label='Get repository updates',
url_args=dict( controller='admin_toolshed',
action='check_for_updates',
@@ -934,6 +944,12 @@
url_args=dict( controller='admin_toolshed',
action='deactivate_or_uninstall_repository',
id=trans.security.encode_id( tool_shed_repository.id ) ) ) ]
+ if tool_shed_repository.metadata and 'readme' in tool_shed_repository.metadata:
+ view_readme_action = grids.GridAction( label='View README',
+ url_args=dict( controller='admin_toolshed',
+ action='view_readme',
+ id=trans.security.encode_id( tool_shed_repository.id ) ) )
+ self.tool_dependency_grid.global_actions.insert( 1, view_readme_action )
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
if not tool_dependency_ids:
@@ -1181,13 +1197,7 @@
response = urllib2.urlopen( url )
raw_text = response.read()
response.close()
- readme_text = ''
- for i, line in enumerate( raw_text ):
- readme_text = '%s%s' % ( readme_text, to_html_str( line ) )
- if len( readme_text ) > MAX_CONTENT_SIZE:
- large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % util.nice_size( MAX_CONTENT_SIZE )
- readme_text = '%s%s' % ( readme_text, to_html_str( large_str ) )
- break
+ readme_text = translate_string( raw_text, to_html=True )
else:
readme_text = ''
if trans.app.config.tool_dependency_dir is None:
@@ -1418,8 +1428,19 @@
status = 'warning'
includes_tool_dependencies = 'tool_dependencies' in metadata
install_tool_dependencies_check_box = CheckboxField( 'install_tool_dependencies', checked=True )
+ if metadata and 'readme' in metadata:
+ url = url_join( tool_shed_url,
+ 'repository/get_readme?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
+ ( repository.name, repository.owner, repository.installed_changeset_revision ) )
+ response = urllib2.urlopen( url )
+ raw_text = response.read()
+ response.close()
+ readme_text = translate_string( raw_text, to_html=True )
+ else:
+ readme_text = ''
return trans.fill_template( '/admin/tool_shed_repository/reselect_tool_panel_section.mako',
repository=repository,
+ readme_text=readme_text,
no_changes_check_box=no_changes_check_box,
original_section_name=original_section_name,
install_tool_dependencies_check_box=install_tool_dependencies_check_box,
@@ -1527,6 +1548,8 @@
for tool_dependency_id in tool_dependency_ids:
tool_dependency = get_tool_dependency( trans, tool_dependency_id )
tool_dependencies.append( tool_dependency )
+ tool_shed_repository = tool_dependencies[ 0 ].tool_shed_repository
+ has_readme = tool_shed_repository.metadata and 'readme' in tool_shed_repository.metadata
if kwd.get( 'uninstall_tool_dependencies_button', False ):
errors = False
# Filter tool dependencies to only those that are installed.
@@ -1545,7 +1568,6 @@
status = 'error'
else:
message = "These tool dependencies have been uninstalled: %s" % ','.join( td.name for td in tool_dependencies_for_uninstallation )
- tool_shed_repository = tool_dependencies[ 0 ].tool_shed_repository
td_ids = [ trans.security.encode_id( td.id ) for td in tool_shed_repository.tool_dependencies ]
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='manage_tool_dependencies',
@@ -1553,6 +1575,9 @@
status=status,
message=message ) )
return trans.fill_template( '/admin/tool_shed_repository/uninstall_tool_dependencies.mako',
+ repository=tool_shed_repository,
+ has_readme=has_readme,
+ tool_dependency_ids=tool_dependency_ids,
tool_dependencies=tool_dependencies,
message=message,
status=status )
@@ -1616,27 +1641,55 @@
status=status ) )
@web.expose
@web.require_admin
+ def view_readme( self, trans, id, **kwd ):
+ params = util.Params( kwd )
+ message = util.restore_text( params.get( 'message', '' ) )
+ cntrller = params.get( 'cntrller', 'admin_toolshed' )
+ status = params.get( 'status', 'done' )
+ repository = get_repository( trans, id )
+ metadata = repository.metadata
+ if metadata and 'readme' in metadata:
+ f = open( metadata[ 'readme' ], 'r' )
+ raw_text = f.read()
+ f.close()
+ readme_text = translate_string( raw_text, to_html=True )
+ else:
+ readme_text = ''
+ is_malicious = False
+ return trans.fill_template( '/webapps/community/common/view_readme.mako',
+ cntrller=cntrller,
+ repository=repository,
+ changeset_revision=repository.changeset_revision,
+ readme_text=readme_text,
+ is_malicious=is_malicious,
+ webapp='galaxy',
+ message=message,
+ status=status )
+ @web.expose
+ @web.require_admin
def view_tool_metadata( self, trans, repository_id, tool_id, **kwd ):
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
webapp = get_webapp( trans, **kwd )
repository = get_repository( trans, repository_id )
- metadata = {}
+ repository_metadata = repository.metadata
+ tool_metadata = {}
tool_lineage = []
tool = None
- if 'tools' in repository.metadata:
- for tool_metadata_dict in repository.metadata[ 'tools' ]:
+ if 'tools' in repository_metadata:
+ for tool_metadata_dict in repository_metadata[ 'tools' ]:
if tool_metadata_dict[ 'id' ] == tool_id:
- metadata = tool_metadata_dict
- tool = trans.app.toolbox.load_tool( os.path.abspath( metadata[ 'tool_config' ] ), guid=metadata[ 'guid' ] )
+ tool_metadata = tool_metadata_dict
+ tool = trans.app.toolbox.load_tool( os.path.abspath( tool_metadata[ 'tool_config' ] ), guid=metadata[ 'guid' ] )
if tool:
tool_lineage = self.get_versions_of_tool( trans.app, tool.id )
break
return trans.fill_template( "/admin/tool_shed_repository/view_tool_metadata.mako",
repository=repository,
+ repository_metadata=repository_metadata,
tool=tool,
- metadata=metadata,
+ tool_metadata=tool_metadata,
tool_lineage=tool_lineage,
message=message,
status=status )
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -7,9 +7,9 @@
from galaxy.util.hash_util import *
from galaxy.util.shed_util import check_tool_input_params, clone_repository, concat_messages, copy_sample_file, generate_metadata_for_changeset_revision
from galaxy.util.shed_util import get_changectx_for_changeset, get_config_from_disk, get_configured_ui, get_file_context_from_ctx, get_named_tmpfile_from_ctx
-from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_disk, handle_sample_files_and_load_tool_from_tmp_config
-from galaxy.util.shed_util import handle_sample_tool_data_table_conf_file, INITIAL_CHANGELOG_HASH, load_tool_from_config, reset_tool_data_tables
-from galaxy.util.shed_util import reversed_upper_bounded_changelog, strip_path
+from galaxy.util.shed_util import get_repository_metadata_by_changeset_revision, handle_sample_files_and_load_tool_from_disk
+from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_tmp_config, handle_sample_tool_data_table_conf_file, INITIAL_CHANGELOG_HASH
+from galaxy.util.shed_util import load_tool_from_config, reset_tool_data_tables, reversed_upper_bounded_changelog, strip_path
from galaxy.web.base.controller import *
from galaxy.webapps.community import model
from galaxy.model.orm import *
@@ -473,25 +473,6 @@
.filter( and_( trans.model.Repository.table.c.name == name,
trans.model.Repository.table.c.user_id == user.id ) ) \
.first()
-def get_repository_metadata_by_changeset_revision( trans, id, changeset_revision ):
- """Get metadata for a specified repository change set from the database"""
- # Make sure there are no duplicate records, and return the single unique record for the changeset_revision. Duplicate records were somehow
- # created in the past. The cause of this issue has been resolved, but we'll leave this method as is for a while longer to ensure all duplicate
- # records are removed.
- all_metadata_records = trans.sa_session.query( trans.model.RepositoryMetadata ) \
- .filter( and_( trans.model.RepositoryMetadata.table.c.repository_id == trans.security.decode_id( id ),
- trans.model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) ) \
- .order_by( trans.model.RepositoryMetadata.table.c.update_time.desc() ) \
- .all()
- if len( all_metadata_records ) > 1:
- # Delete all recrds older than the last one updated.
- for repository_metadata in all_metadata_records[ 1: ]:
- trans.sa_session.delete( repository_metadata )
- trans.sa_session.flush()
- return all_metadata_records[ 0 ]
- elif all_metadata_records:
- return all_metadata_records[ 0 ]
- return None
def get_repository_metadata_by_id( trans, id ):
"""Get repository metadata from the database"""
return trans.sa_session.query( trans.model.RepositoryMetadata ).get( trans.security.decode_id( id ) )
@@ -762,6 +743,7 @@
if cloned_ok:
log.debug( "Generating metadata for changset revision: %s", str( ctx.rev() ) )
current_metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app,
+ repository=repository,
repository_clone_url=repository_clone_url,
relative_install_dir=repo_dir,
repository_files_dir=work_dir,
@@ -836,6 +818,7 @@
repo_dir = repository.repo_path
repo = hg.repository( get_configured_ui(), repo_dir )
metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app,
+ repository=repository,
repository_clone_url=repository_clone_url,
relative_install_dir=repo_dir,
repository_files_dir=None,
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -10,9 +10,10 @@
from galaxy.util.json import from_json_string, to_json_string
from galaxy.model.orm import *
from galaxy.util.shed_util import create_repo_info_dict, get_changectx_for_changeset, get_configured_ui, get_repository_file_contents
-from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_disk, handle_sample_files_and_load_tool_from_tmp_config, INITIAL_CHANGELOG_HASH
-from galaxy.util.shed_util import load_tool_from_config, NOT_TOOL_CONFIGS, open_repository_files_folder, reversed_lower_upper_bounded_changelog
-from galaxy.util.shed_util import reversed_upper_bounded_changelog, strip_path, to_html_escaped, update_repository, url_join
+from galaxy.util.shed_util import get_repository_metadata_by_changeset_revision, handle_sample_files_and_load_tool_from_disk
+from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_tmp_config, INITIAL_CHANGELOG_HASH, load_tool_from_config, NOT_TOOL_CONFIGS
+from galaxy.util.shed_util import open_repository_files_folder, reversed_lower_upper_bounded_changelog, reversed_upper_bounded_changelog, strip_path
+from galaxy.util.shed_util import to_html_escaped, translate_string, update_repository, url_join
from galaxy.tool_shed.encoding_util import *
from common import *
@@ -23,7 +24,6 @@
log = logging.getLogger( __name__ )
VALID_REPOSITORYNAME_RE = re.compile( "^[a-z0-9\_]+$" )
-README_FILES = [ 'readme', 'read_me', 'install' ]
class CategoryListGrid( grids.Grid ):
class NameColumn( grids.TextColumn ):
@@ -613,8 +613,10 @@
# Update repository files for browsing.
update_repository( repo )
is_malicious = changeset_is_malicious( trans, id, repository.tip )
+ metadata = self.get_metadata( trans, id, repository.tip )
return trans.fill_template( '/webapps/community/repository/browse_repository.mako',
repository=repository,
+ metadata=metadata,
commit_message=commit_message,
is_malicious=is_malicious,
webapp=webapp,
@@ -828,9 +830,11 @@
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
repository = get_repository( trans, id )
+ metadata = self.get_metadata( trans, id, repository.tip )
if trans.user and trans.user.email:
return trans.fill_template( "/webapps/community/repository/contact_owner.mako",
repository=repository,
+ metadata=metadata,
message=message,
status=status )
else:
@@ -939,9 +943,11 @@
repository, tool, message = load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config )
tool_state = self.__new_state( trans )
is_malicious = changeset_is_malicious( trans, repository_id, repository.tip )
+ metadata = self.get_metadata( trans, repository_id, changeset_revision )
try:
return trans.fill_template( "/webapps/community/repository/tool_form.mako",
repository=repository,
+ metadata=metadata,
changeset_revision=changeset_revision,
tool=tool,
tool_state=tool_state,
@@ -1181,6 +1187,11 @@
trans.response.headers['Pragma'] = 'no-cache'
trans.response.headers['Expires'] = '0'
return get_repository_file_contents( file_path )
+ def get_metadata( self, trans, repository_id, changeset_revision ):
+ repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
+ if repository_metadata and repository_metadata.metadata:
+ return repository_metadata.metadata
+ return None
@web.json
def get_repository_information( self, trans, repository_ids, changeset_revisions, **kwd ):
"""
@@ -1208,23 +1219,18 @@
return dict( includes_tools=includes_tools, includes_tool_dependencies=includes_tool_dependencies, repo_info_dicts=repo_info_dicts )
@web.expose
def get_readme( self, trans, **kwd ):
- """If the received changeset_revision includes a file named readme (case ignored), return it's contents."""
+ """If the received changeset_revision includes a readme file, return it's contents."""
repository_name = kwd[ 'name' ]
repository_owner = kwd[ 'owner' ]
changeset_revision = kwd[ 'changeset_revision' ]
- valid_filenames = [ r for r in README_FILES ]
- for r in README_FILES:
- valid_filenames.append( '%s.txt' % r )
- valid_filenames.append( '%s.txt' % repository_name )
repository = get_repository_by_name_and_owner( trans, repository_name, repository_owner )
- repo_dir = repository.repo_path
- for root, dirs, files in os.walk( repo_dir ):
- for name in files:
- if name.lower() in valid_filenames:
- f = open( os.path.join( root, name ), 'r' )
- text = f.read()
- f.close()
- return str( text )
+ repository_metadata = get_repository_metadata_by_changeset_revision( trans, trans.security.encode_id( repository.id ), changeset_revision )
+ metadata = repository_metadata.metadata
+ if metadata and 'readme' in metadata:
+ f = open( metadata[ 'readme' ], 'r' )
+ text = f.read()
+ f.close()
+ return str( text )
return ''
@web.expose
def get_tool_dependencies( self, trans, **kwd ):
@@ -1829,8 +1835,10 @@
display_reviews = util.string_as_bool( params.get( 'display_reviews', False ) )
rra = self.get_user_item_rating( trans.sa_session, trans.user, repository, webapp_model=trans.model )
is_malicious = changeset_is_malicious( trans, id, repository.tip )
+ metadata = self.get_metadata( trans, id, repository.tip )
return trans.fill_template( '/webapps/community/repository/rate_repository.mako',
repository=repository,
+ metadata=metadata,
avg_rating=avg_rating,
display_reviews=display_reviews,
num_ratings=num_ratings,
@@ -2156,8 +2164,10 @@
# Make sure we'll view latest changeset first.
changesets.insert( 0, change_dict )
is_malicious = changeset_is_malicious( trans, id, repository.tip )
+ metadata = self.get_metadata( trans, id, repository.tip )
return trans.fill_template( '/webapps/community/repository/view_changelog.mako',
repository=repository,
+ metadata=metadata,
changesets=changesets,
is_malicious=is_malicious,
message=message,
@@ -2185,8 +2195,10 @@
for diff in patch.diff( repo, node1=ctx_parent.node(), node2=ctx.node() ):
diffs.append( to_html_escaped( diff ) )
is_malicious = changeset_is_malicious( trans, id, repository.tip )
+ metadata = self.get_metadata( trans, id, ctx_str )
return trans.fill_template( '/webapps/community/repository/view_changeset.mako',
repository=repository,
+ metadata=metadata,
ctx=ctx,
anchors=anchors,
modified=modified,
@@ -2201,6 +2213,33 @@
message=message,
status=status )
@web.expose
+ def view_readme( self, trans, id, changeset_revision, **kwd ):
+ params = util.Params( kwd )
+ message = util.restore_text( params.get( 'message', '' ) )
+ status = params.get( 'status', 'done' )
+ cntrller = params.get( 'cntrller', 'repository' )
+ webapp = params.get( 'webapp', 'community' )
+ repository = get_repository( trans, id )
+ repository_metadata = get_repository_metadata_by_changeset_revision( trans, trans.security.encode_id( repository.id ), changeset_revision )
+ metadata = repository_metadata.metadata
+ if metadata and 'readme' in metadata:
+ f = open( metadata[ 'readme' ], 'r' )
+ raw_text = f.read()
+ f.close()
+ readme_text = translate_string( raw_text, to_html=True )
+ else:
+ readme_text = ''
+ is_malicious = changeset_is_malicious( trans, id, changeset_revision )
+ return trans.fill_template( '/webapps/community/common/view_readme.mako',
+ cntrller=cntrller,
+ repository=repository,
+ changeset_revision=changeset_revision,
+ readme_text=readme_text,
+ is_malicious=is_malicious,
+ webapp=webapp,
+ message=message,
+ status=status )
+ @web.expose
def view_repository( self, trans, id, **kwd ):
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
@@ -2318,6 +2357,8 @@
break
if guid:
tool_lineage = self.get_versions_of_tool( trans, repository, repository_metadata, guid )
+ else:
+ metadata = None
is_malicious = changeset_is_malicious( trans, repository_id, repository.tip )
changeset_revision_select_field = build_changeset_revision_select_field( trans,
repository,
@@ -2327,6 +2368,7 @@
trans.app.config.tool_data_path = original_tool_data_path
return trans.fill_template( "/webapps/community/repository/view_tool_metadata.mako",
repository=repository,
+ metadata=metadata,
tool=tool,
tool_metadata_dict=tool_metadata_dict,
tool_lineage=tool_lineage,
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce lib/galaxy/webapps/community/controllers/workflow.py
--- a/lib/galaxy/webapps/community/controllers/workflow.py
+++ b/lib/galaxy/webapps/community/controllers/workflow.py
@@ -151,6 +151,7 @@
changeset_revision=repository_metadata.changeset_revision,
repository_metadata_id=repository_metadata_id,
workflow_name=workflow_name,
+ metadata=repository_metadata,
webapp=webapp,
message=message,
status=status )
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/browse_repository.mako
--- a/templates/admin/tool_shed_repository/browse_repository.mako
+++ b/templates/admin/tool_shed_repository/browse_repository.mako
@@ -18,6 +18,9 @@
<li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a>
+ %endif
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
%if repository.tool_dependencies:
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/browse_tool_dependency.mako
--- a/templates/admin/tool_shed_repository/browse_tool_dependency.mako
+++ b/templates/admin/tool_shed_repository/browse_tool_dependency.mako
@@ -19,8 +19,11 @@
<ul class="manage-table-actions"><li><a class="action-button" id="tool_dependency-${tool_dependency.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="tool_dependency-${tool_dependency.id}-popup">
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a>
+ %endif
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
--- a/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
+++ b/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
@@ -6,8 +6,11 @@
<ul class="manage-table-actions"><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup">
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a>
+ %endif
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
%if repository.tool_dependencies:
<% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %>
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/manage_repository.mako
--- a/templates/admin/tool_shed_repository/manage_repository.mako
+++ b/templates/admin/tool_shed_repository/manage_repository.mako
@@ -11,6 +11,9 @@
%elif can_install:
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ), operation='install' )}">Install</a>
%else:
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a>
+ %endif
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
%if repository.includes_tools:
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/manage_tool_dependencies.mako
--- a/templates/admin/tool_shed_repository/manage_tool_dependencies.mako
+++ /dev/null
@@ -1,79 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<% import os %>
-
-<br/><br/>
-<ul class="manage-table-actions">
- <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
- <div popupmenu="repository-${repository.id}-popup">
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
- %if repository.includes_tools:
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a>
- %endif
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
- </div>
-</ul>
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Repository '${repository.name}' tool dependencies</div>
- <div class="toolFormBody">
- <div class="form-row">
- <table class="grid">
- %for tool_dependency in repository.tool_dependencies:
- <%
- name = tool_dependency.name
- version = tool_dependency.version
- type = tool_dependency.type
- installed = tool_dependency.status == 'trans.model.ToolDependency.installation_status.INSTALLED
- install_dir = tool_dependency.installation_directory( trans.app )
- %>
- <tr>
- <td bgcolor="#D8D8D8">
- <div style="float: left; margin-left: 1px;" class="menubutton split popup" id="dependency-${tool_dependency.id}-popup">
- %if not installed:
- <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', operation='browse', tool_dependency_id=trans.security.encode_id( tool_dependency.id ) )}">
- <b>Name</b>
- </a>
- <div popupmenu="dependency-${tool_dependency.id}-popup">
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', operation='install', tool_dependency_id=trans.security.encode_id( tool_dependency.id ) )}">Install this tool dependency</a>
- </div>
- %else:
- <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', operation='browse', tool_dependency_id=trans.security.encode_id( tool_dependency.id ) )}">
- <b>Name</b>
- </a>
- <div popupmenu="dependency-${tool_dependency.id}-popup">
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', operation='uninstall', tool_dependency_id=trans.security.encode_id( tool_dependency.id ) )}">Uninstall this tool dependency</a>
- </div>
- %endif
- </div>
- </td>
- <td bgcolor="#D8D8D8">${name}</td>
- </tr>
- <tr><th>Version</th><td>${version}</td></tr>
- <tr><th>Type</th><td>${type}</td></tr>
- <tr>
- <th>Install directory</th>
- <td>
- %if not installed:
- This dependency is not currently installed
- %else:
- <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( tool_dependency.id ), repository_id=trans.security.encode_id( repository.id ) )}">
- ${install_dir}
- </a>
- %endif
- </td>
- </tr>
- <tr><th>Installed</th><td>${not installed}</td></tr>
- %endfor
- </table>
- <div style="clear: both"></div>
- </div>
- </div>
-</div>
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
@@ -1,6 +1,7 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_tool_dependency_section" />
+<%namespace file="/webapps/community/common/common.mako" import="render_readme" />
%if message:
${render_msg( message, status )}
@@ -42,3 +43,6 @@
</form></div></div>
+%if readme_text:
+ ${render_readme( readme_text )}
+%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/select_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/select_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/select_tool_panel_section.mako
@@ -1,6 +1,7 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_tool_dependency_section" />
+<%namespace file="/webapps/community/common/common.mako" import="render_readme" />
%if message:
${render_msg( message, status )}
@@ -77,13 +78,5 @@
</div></div>
%if readme_text:
- <div class="toolForm">
- <div class="toolFormTitle">Repository README file (may contain important installation or license information)</div>
- <div class="toolFormBody">
- <input type="hidden" name="readme_text" value="${readme_text}"/>
- <div class="form-row">
- <pre>${readme_text}</pre>
- </div>
- </div>
- </div>
+ ${render_readme( readme_text )}
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako
--- a/templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako
+++ b/templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako
@@ -3,6 +3,24 @@
<% import os %>
+<br/><br/>
+<ul class="manage-table-actions">
+ <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
+ <div popupmenu="repository-${repository.id}-popup">
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
+ %if repository.tool_dependencies:
+ <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
+ </div>
+</ul>
+
%if message:
${render_msg( message, status )}
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/admin/tool_shed_repository/view_tool_metadata.mako
--- a/templates/admin/tool_shed_repository/view_tool_metadata.mako
+++ b/templates/admin/tool_shed_repository/view_tool_metadata.mako
@@ -5,6 +5,9 @@
<ul class="manage-table-actions"><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup">
+ %if repository_metadata and 'readme' in repository_metadata:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a>
+ %endif
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
@@ -20,10 +23,10 @@
${render_msg( message, status )}
%endif
-%if metadata:
+%if tool_metadata:
<p/><div class="toolForm">
- <div class="toolFormTitle">${metadata[ 'name' ]} tool metadata</div>
+ <div class="toolFormTitle">${tool_metadata[ 'name' ]} tool metadata</div><div class="toolFormBody"><div class="form-row"><table width="100%">
@@ -32,41 +35,41 @@
</div><div class="form-row"><label>Name:</label>
- ${metadata[ 'name' ]}
+ ${tool_metadata[ 'name' ]}
<div style="clear: both"></div></div>
- %if 'description' in metadata:
+ %if 'description' in tool_metadata:
<div class="form-row"><label>Description:</label>
- ${metadata[ 'description' ]}
+ ${tool_metadata[ 'description' ]}
<div style="clear: both"></div></div>
%endif
- %if 'id' in metadata:
+ %if 'id' in tool_metadata:
<div class="form-row"><label>Id:</label>
- ${metadata[ 'id' ]}
+ ${tool_metadata[ 'id' ]}
<div style="clear: both"></div></div>
%endif
- %if 'guid' in metadata:
+ %if 'guid' in tool_metadata:
<div class="form-row"><label>Guid:</label>
- ${metadata[ 'guid' ]}
+ ${tool_metadata[ 'guid' ]}
<div style="clear: both"></div></div>
%endif
- %if 'version' in metadata:
+ %if 'version' in tool_metadata:
<div class="form-row"><label>Version:</label>
- ${metadata[ 'version' ]}
+ ${tool_metadata[ 'version' ]}
<div style="clear: both"></div></div>
%endif
- %if 'version_string_cmd' in metadata:
+ %if 'version_string_cmd' in tool_metadata:
<div class="form-row"><label>Version command string:</label>
- ${metadata[ 'version_string_cmd' ]}
+ ${tool_metadata[ 'version_string_cmd' ]}
<div style="clear: both"></div></div>
%endif
@@ -81,7 +84,7 @@
%for guid in tool_lineage:
<tr><td>
- %if guid == metadata[ 'guid' ]:
+ %if guid == tool_metadata[ 'guid' ]:
${guid} <b>(this tool)</b>
%else:
${guid}
@@ -100,8 +103,8 @@
</table></div><%
- if 'requirements' in metadata:
- requirements = metadata[ 'requirements' ]
+ if 'requirements' in tool_metadata:
+ requirements = tool_metadata[ 'requirements' ]
else:
requirements = None
%>
@@ -172,8 +175,8 @@
</table></div><%
- if 'tests' in metadata:
- tests = metadata[ 'tests' ]
+ if 'tests' in tool_metadata:
+ tests = tool_metadata[ 'tests' ]
else:
tests = None
%>
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/common/common.mako
--- a/templates/webapps/community/common/common.mako
+++ b/templates/webapps/community/common/common.mako
@@ -13,3 +13,26 @@
%>
${html}
</%def>
+
+<%def name="render_readme( readme_text )">
+ <style type="text/css">
+ #readme_table{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style>
+ <div class="toolForm">
+ <div class="toolFormTitle">Repository README file (may contain important installation or license information)</div>
+ <div class="toolFormBody">
+ <div class="form-row">
+ <table id="readme_table">
+ <tr><td>${readme_text}</td></tr>
+ </table>
+ </div>
+ </div>
+ </div>
+</%def>
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/common/view_readme.mako
--- /dev/null
+++ b/templates/webapps/community/common/view_readme.mako
@@ -0,0 +1,88 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/webapps/community/common/common.mako" import="render_readme" />
+
+<%
+ if webapp == 'community':
+ is_admin = trans.user_is_admin()
+ is_new = repository.is_new
+ can_contact_owner = trans.user and trans.user != repository.user
+ can_push = trans.app.security_agent.can_push( trans.user, repository )
+ can_rate = not is_new and trans.user and repository.user != trans.user
+ can_upload = can_push
+ can_download = not is_new and ( not is_malicious or can_push )
+ can_browse_contents = not is_new
+ can_view_change_log = not is_new
+ can_manage = is_admin or repository.user == trans.user
+ if can_push:
+ browse_label = 'Browse or delete repository tip files'
+ else:
+ browse_label = 'Browse repository tip files'
+%>
+
+<br/><br/>
+<ul class="manage-table-actions">
+ %if webapp == 'community':
+ <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
+ <div popupmenu="repository-${repository.id}-popup">
+ %if can_manage:
+ <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip )}">Manage repository</a>
+ %else:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a>
+ %endif
+ %if can_upload:
+ <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a>
+ %endif
+ %if can_view_change_log:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">View change log</a>
+ %endif
+ %if can_rate:
+ <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">Rate repository</a>
+ %endif
+ %if can_browse_contents:
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">${browse_label}</a>
+ %endif
+ %if can_contact_owner:
+ <a class="action-button" href="${h.url_for( controller='repository', action='contact_owner', id=trans.security.encode_id( repository.id ), webapp=webapp )}">Contact repository owner</a>
+ %endif
+ %if can_download:
+ <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='gz', webapp=webapp )}">Download as a .tar.gz file</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='bz2', webapp=webapp )}">Download as a .tar.bz2 file</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='zip', webapp=webapp )}">Download as a zip file</a>
+ %endif
+ </div>
+ %else:
+ %if cntrller=='repository':
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_repositories', operation='preview_tools_in_changeset', id=trans.security.encode_id( repository.id ), webapp=webapp )}">Preview tools for install</a></li>
+ <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
+ <div popupmenu="repository-${repository.id}-popup">
+ <a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories', webapp=webapp )}">Browse valid repositories</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='find_tools', webapp=webapp )}">Search for valid tools</a>
+ <a class="action-button" href="${h.url_for( controller='repository', action='find_workflows', webapp=webapp )}">Search for workflows</a>
+ </div>
+ %else:
+ <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
+ <div popupmenu="repository-${repository.id}-popup">
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
+ %if repository.includes_tools:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a>
+ %endif
+ %if repository.tool_dependencies:
+ <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
+ </div>
+ %endif
+ %endif
+</ul>
+
+%if message:
+ ${render_msg( message, status )}
+%endif
+
+%if readme_text:
+ ${render_readme( readme_text )}
+%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/browse_repository.mako
--- a/templates/webapps/community/repository/browse_repository.mako
+++ b/templates/webapps/community/repository/browse_repository.mako
@@ -15,6 +15,7 @@
can_rate = trans.user and repository.user != trans.user
can_manage = is_admin or repository.user == trans.user
can_view_change_log = not is_new
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -76,6 +77,9 @@
%if can_upload:
<a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/contact_owner.mako
--- a/templates/webapps/community/repository/contact_owner.mako
+++ b/templates/webapps/community/repository/contact_owner.mako
@@ -16,6 +16,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -42,6 +43,9 @@
%if can_upload:
<a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/manage_repository.mako
--- a/templates/webapps/community/repository/manage_repository.mako
+++ b/templates/webapps/community/repository/manage_repository.mako
@@ -21,6 +21,7 @@
browse_label = 'Browse repository tip files'
can_set_malicious = metadata and can_set_metadata and is_admin and changeset_revision == repository.tip
can_reset_all_metadata = is_admin and len( repo ) > 0
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -32,35 +33,6 @@
%><%inherit file="${inherit(context)}"/>
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "jquery.rating" )}
- <style type="text/css">
- ul.fileBrowser,
- ul.toolFile {
- margin-left: 0;
- padding-left: 0;
- list-style: none;
- }
- ul.fileBrowser {
- margin-left: 20px;
- }
- .fileBrowser li,
- .toolFile li {
- padding-left: 20px;
- background-repeat: no-repeat;
- background-position: 0;
- min-height: 20px;
- }
- .toolFile li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white_compressed.png' )} );
- }
- .fileBrowser li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white.png' )} );
- }
- </style>
-</%def>
-
<%def name="javascripts()">
${parent.javascripts()}
${h.js( "libs/jquery/jquery.rating" )}
@@ -77,6 +49,9 @@
%if can_upload:
<a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp='community' )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/preview_tools_in_changeset.mako
--- a/templates/webapps/community/repository/preview_tools_in_changeset.mako
+++ b/templates/webapps/community/repository/preview_tools_in_changeset.mako
@@ -16,6 +16,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -27,35 +28,6 @@
%><%inherit file="${inherit(context)}"/>
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "jquery.rating" )}
- <style type="text/css">
- ul.fileBrowser,
- ul.toolFile {
- margin-left: 0;
- padding-left: 0;
- list-style: none;
- }
- ul.fileBrowser {
- margin-left: 20px;
- }
- .fileBrowser li,
- .toolFile li {
- padding-left: 20px;
- background-repeat: no-repeat;
- background-position: 0;
- min-height: 20px;
- }
- .toolFile li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white_compressed.png' )} );
- }
- .fileBrowser li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white.png' )} );
- }
- </style>
-</%def>
-
<%def name="javascripts()">
${parent.javascripts()}
${h.js( "libs/jquery/jquery.rating" )}
@@ -67,6 +39,9 @@
<li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li><div popupmenu="repository-${repository.id}-popup">
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp=webapp )}">View README</a>
+ %endif
<a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_categories', webapp=webapp )}">Browse valid repositories</a><a class="action-button" href="${h.url_for( controller='repository', action='find_tools', webapp=webapp )}">Search for valid tools</a><a class="action-button" href="${h.url_for( controller='repository', action='find_workflows', webapp=webapp )}">Search for workflows</a>
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/rate_repository.mako
--- a/templates/webapps/community/repository/rate_repository.mako
+++ b/templates/webapps/community/repository/rate_repository.mako
@@ -19,6 +19,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -83,6 +84,9 @@
%if can_upload:
<a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/tool_form.mako
--- a/templates/webapps/community/repository/tool_form.mako
+++ b/templates/webapps/community/repository/tool_form.mako
@@ -21,6 +21,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><html>
@@ -146,6 +147,9 @@
%if can_upload:
<a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp=webapp )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/view_changelog.mako
--- a/templates/webapps/community/repository/view_changelog.mako
+++ b/templates/webapps/community/repository/view_changelog.mako
@@ -18,6 +18,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -51,6 +52,9 @@
%else:
<a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp='community' )}">View README</a>
+ %endif
%if can_rate:
<a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/view_changeset.mako
--- a/templates/webapps/community/repository/view_changeset.mako
+++ b/templates/webapps/community/repository/view_changeset.mako
@@ -19,6 +19,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -52,6 +53,9 @@
%else:
<a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/view_repository.mako
--- a/templates/webapps/community/repository/view_repository.mako
+++ b/templates/webapps/community/repository/view_repository.mako
@@ -17,6 +17,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -28,35 +29,6 @@
%><%inherit file="${inherit(context)}"/>
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "jquery.rating" )}
- <style type="text/css">
- ul.fileBrowser,
- ul.toolFile {
- margin-left: 0;
- padding-left: 0;
- list-style: none;
- }
- ul.fileBrowser {
- margin-left: 20px;
- }
- .fileBrowser li,
- .toolFile li {
- padding-left: 20px;
- background-repeat: no-repeat;
- background-position: 0;
- min-height: 20px;
- }
- .toolFile li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white_compressed.png' )} );
- }
- .fileBrowser li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white.png' )} );
- }
- </style>
-</%def>
-
<%def name="javascripts()">
${parent.javascripts()}
${h.js( "libs/jquery/jquery.rating" )}
@@ -74,6 +46,9 @@
%if can_upload:
<a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp=webapp )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/view_tool_metadata.mako
--- a/templates/webapps/community/repository/view_tool_metadata.mako
+++ b/templates/webapps/community/repository/view_tool_metadata.mako
@@ -20,6 +20,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -59,6 +60,9 @@
%if can_upload:
<a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp=webapp )}">Upload files to repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp=webapp )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp=webapp )}">View change log</a>
%endif
diff -r f0eea6ef482453ccc3cc466917ae4ed93920666b -r c28c5f906c6bdbbe799cfcc559760f26029090ce templates/webapps/community/repository/view_workflow.mako
--- a/templates/webapps/community/repository/view_workflow.mako
+++ b/templates/webapps/community/repository/view_workflow.mako
@@ -22,6 +22,7 @@
browse_label = 'Browse or delete repository tip files'
else:
browse_label = 'Browse repository tip files'
+ has_readme = metadata and 'readme' in metadata
%><%!
@@ -54,6 +55,9 @@
%else:
<a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, webapp='community' )}">View repository</a>
%endif
+ %if has_readme:
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_readme', id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, webapp='community' )}">View README</a>
+ %endif
%if can_view_change_log:
<a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ), webapp='community' )}">View change log</a>
%endif
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: compile_templates.py: handle multi-template files better; (alternate_)history: fix download popup menus
by Bitbucket 26 Sep '12
by Bitbucket 26 Sep '12
26 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/f0eea6ef4824/
changeset: f0eea6ef4824
user: carlfeberhard
date: 2012-09-26 23:42:45
summary: compile_templates.py: handle multi-template files better; (alternate_)history: fix download popup menus
affected #: 15 files
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -66,14 +66,15 @@
};
function make_popupmenu(button_element, initial_options) {
-
/* Use the $.data feature to store options with the link element.
This allows options to be changed at a later time
*/
var element_menu_exists = (button_element.data("menu_options"));
button_element.data("menu_options", initial_options);
+
// If element already has menu, nothing else to do since HTML and actions are already set.
if (element_menu_exists) { return; }
+
button_element.bind("click.show_popup", function(e) {
// Close existing visible menus
$(".popmenu-wrapper").remove();
@@ -93,7 +94,8 @@
menu_element.append( $("<li></li>").addClass( "head" ).append( $("<a href='#'></a>").html(k) ) );
}
});
- var wrapper = $( "<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>" ).append( menu_element ).appendTo( "body" );
+ var wrapper = $( "<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>" )
+ .append( menu_element ).appendTo( "body" );
var x = e.pageX - wrapper.width() / 2 ;
x = Math.min( x, $(document).scrollLeft() + $(window).width() - $(wrapper).width() - 5 );
@@ -137,6 +139,7 @@
var confirmtext = link_dom.getAttribute( "confirm" ),
href = link_dom.getAttribute( "href" ),
target = link_dom.getAttribute( "target" );
+
if (!href) {
options[ link.text() ] = null;
} else {
@@ -161,6 +164,7 @@
};
}
});
+ // locate the element with the id corresponding to the menu's popupmenu attr
var box = $( "#" + menu.attr( 'popupmenu' ) );
// For menus with clickable link text, make clicking on the link go through instead
@@ -170,6 +174,7 @@
return true;
});
+ // attach the click events and menu box building to the box element
make_popupmenu(box, options);
box.addClass("popup");
menu.remove();
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/mvc/history.js
--- a/static/scripts/mvc/history.js
+++ b/static/scripts/mvc/history.js
@@ -1,4 +1,8 @@
-/*
+//define([
+// "../mvc/base-mvc"
+//
+//], function(){
+/* =============================================================================
Backbone.js implementation of history panel
TODO:
@@ -10,6 +14,8 @@
_render_displayApps
_render_downloadButton
widget building (popupmenu, etc.)
+ history.mako js: updater, etc.
+ have info bodies prev. opened, redisplay on refresh
don't draw body until it's first unhide event
all history.mako js -> this
@@ -30,26 +36,7 @@
move inline styles into base.less
add classes, ids on empty divs
watch the magic strings
-*/
-
-//==============================================================================
-
-//==============================================================================
-//TODO: move to Galaxy obj./namespace, decorate for current page (as GalaxyPaths)
-/*
-var Localizable = {
- localizedStrings : {},
- setLocalizedString : function( str, localizedString ){
- this.localizedStrings[ str ] = localizedString;
- },
- localize : function( str ){
- if( str in this.localizedStrings ){ return this.localizedStrings[ str ]; }
- return str;
- }
-};
-var LocalizableView = LoggingView.extend( Localizable );
-*/
-//TODO: wire up to views
+============================================================================= */
//==============================================================================
// jq plugin?
@@ -204,12 +191,7 @@
// set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.)
itemWrapper.find( '.tooltip' ).tooltip({ placement : 'bottom' });
- //TODO: broken
- var popupmenus = itemWrapper.find( '[popupmenu]' );
- popupmenus.each( function( i, menu ){
- menu = $( menu );
- make_popupmenu( menu );
- });
+ make_popup_menus();
//TODO: better transition/method than this...
this.$el.children().remove();
@@ -343,54 +325,23 @@
// ................................................................................ primary actions
_render_primaryActionButtons : function( buttonRenderingFuncs ){
- var primaryActionButtons = $( '<div/>' ),
+ var primaryActionButtons = $( '<div/>' ).attr( 'id', 'primary-actions-' + this.model.get( 'id' ) ),
view = this;
_.each( buttonRenderingFuncs, function( fn ){
- primaryActionButtons.append( fn.call( view ) );
+ var render_return = fn.call( view );
+ primaryActionButtons.append( render_return );
});
return primaryActionButtons;
},
_render_downloadButton : function(){
+ // don't show anything if the data's been purged
+ //if( this.model.get( 'purged' ) ){ return null; }
+
// return either: a single download icon-button (if there are no meta files)
// or a popupmenu with links to download assoc. meta files (if there are meta files)
-
- // don't show anything if the data's been purged
- if( this.model.get( 'purged' ) ){ return null; }
-
- var downloadLink = linkHTMLTemplate({
- title : 'Download',
- href : this.model.get( 'download_url' ),
- classes : [ 'icon-button', 'tooltip', 'disk' ]
- });
-
- // if no metafiles, return only the main download link
- var download_meta_urls = this.model.get( 'download_meta_urls' );
- if( !download_meta_urls ){
- return downloadLink;
- }
-
- // build the popupmenu for downloading main, meta files
- var popupmenu = $( '<div popupmenu="dataset-' + this.model.get( 'id' ) + '-popup"></div>' );
- popupmenu.append( linkHTMLTemplate({
- text : 'Download Dataset',
- title : 'Download',
- href : this.model.get( 'download_url' ),
- classes : [ 'icon-button', 'tooltip', 'disk' ]
- }));
- popupmenu.append( '<a>Additional Files</a>' );
- for( file_type in download_meta_urls ){
- popupmenu.append( linkHTMLTemplate({
- text : 'Download ' + file_type,
- href : download_meta_urls[ file_type ],
- classes : [ 'action-button' ]
- }));
- }
- var menuButton = $( ( '<div style="float:left;" class="menubutton split popup"'
- + ' id="dataset-${dataset_id}-popup"></div>' ) );
- menuButton.append( downloadLink );
- popupmenu.append( menuButton );
- return popupmenu;
+ var downloadLinkHTML = HistoryItemView.templates.downloadLinks( this.model.toJSON() );
+ return $( downloadLinkHTML );
},
//NOTE: button renderers have the side effect of caching their IconButtonViews to this view
@@ -451,8 +402,12 @@
// ................................................................................ secondary actions
_render_secondaryActionButtons : function( buttonRenderingFuncs ){
// move to the right (same level as primary)
- var secondaryActionButtons = $( '<div style="float: right;"></div>' ),
+ var secondaryActionButtons = $( '<div/>' ),
view = this;
+ secondaryActionButtons
+ .attr( 'style', 'float: right;' )
+ .attr( 'id', 'secondary-actions-' + this.model.get( 'id' ) );
+
_.each( buttonRenderingFuncs, function( fn ){
secondaryActionButtons.append( fn.call( view ) );
});
@@ -817,7 +772,8 @@
hdaSummary : 'template-history-hdaSummary',
failedMetadata : 'template-history-failedMetaData',
tagArea : 'template-history-tagArea',
- annotationArea : 'template-history-annotationArea'
+ annotationArea : 'template-history-annotationArea',
+ downloadLinks : 'template-history-downloadLinks'
}
});
@@ -967,163 +923,10 @@
//==============================================================================
-function createMockHistoryData(){
- mockHistory = {};
- mockHistory.data = {
-
- template : {
- id : 'a799d38679e985db',
- name : 'template',
- data_type : 'fastq',
- file_size : 226297533,
- genome_build : '?',
- metadata_data_lines : 0,
- metadata_dbkey : '?',
- metadata_sequences : 0,
- misc_blurb : '215.8 MB',
- misc_info : 'uploaded fastq file (misc_info)',
- model_class : 'HistoryDatasetAssociation',
- download_url : '',
- state : 'ok',
- visible : true,
- deleted : false,
- purged : false,
-
- hid : 0,
- //TODO: move to history
- for_editing : true,
- //for_editing : false,
-
- //?? not needed
- //can_edit : true,
- //can_edit : false,
-
- accessible : true,
-
- //TODO: move into model functions (build there (and cache?))
- //!! be careful with adding these accrd. to permissions
- //!! IOW, don't send them via template/API if the user doesn't have perms to use
- //!! (even if they don't show up)
- undelete_url : '',
- purge_url : '',
- unhide_url : '',
-
- display_url : 'example.com/display',
- edit_url : 'example.com/edit',
- delete_url : 'example.com/delete',
-
- show_params_url : 'example.com/show_params',
- rerun_url : 'example.com/rerun',
-
- retag_url : 'example.com/retag',
- annotate_url : 'example.com/annotate',
-
- peek : [
- '<table cellspacing="0" cellpadding="3"><tr><th>1.QNAME</th><th>2.FLAG</th><th>3.RNAME</th><th>4.POS</th><th>5.MAPQ</th><th>6.CIGAR</th><th>7.MRNM</th><th>8.MPOS</th><th>9.ISIZE</th><th>10.SEQ</th><th>11.QUAL</th><th>12.OPT</th></tr>',
- '<tr><td colspan="100%">@SQ SN:gi|87159884|ref|NC_007793.1| LN:2872769</td></tr>',
- '<tr><td colspan="100%">@PG ID:bwa PN:bwa VN:0.5.9-r16</td></tr>',
- '<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 73 gi|87159884|ref|NC_007793.1| 2720169 37 101M = 2720169 0 NAATATGACATTATTTTCAAAACAGCTGAAAATTTAGACGTACCGATTTATCTACATCCCGCGCCAGTTAACAGTGACATTTATCAATCATACTATAAAGG !!!!!!!!!!$!!!$!!!!!$!!!!!!$!$!$$$!!$!!$!!!!!!!!!!!$!</td></tr>',
- '<tr><td colspan="100%">!!!$!$!$$!!$$!!$!!!!!!!!!!!!!!!!!!!!!!!!!!$!!$!! XT:A:U NM:i:1 SM:i:37 AM:i:0 X0:i:1 X1:i:0 XM:i:1 XO:i:0 XG:i:0 MD:Z:0A100</td></tr>',
- '<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 133 gi|87159884|ref|NC_007793.1| 2720169 0 * = 2720169 0 NAAACTGTGGCTTCGTTNNNNNNNNNNNNNNNGTGANNNNNNNNNNNNNNNNNNNGNNNNNNNNNNNNNNNNNNNNCNAANNNNNNNNNNNNNNNNNNNNN !!!!!!!!!!!!$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>',
- '<tr><td colspan="100%">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>',
- '</table>'
- ].join( '' )
- }
-
- };
- _.extend( mockHistory.data, {
-
- notAccessible :
- _.extend( _.clone( mockHistory.data.template ),
- { accessible : false }),
-
- //deleted, purged, visible
- deleted :
- _.extend( _.clone( mockHistory.data.template ),
- { deleted : true,
- delete_url : '',
- purge_url : 'example.com/purge',
- undelete_url : 'example.com/undelete' }),
- purgedNotDeleted :
- _.extend( _.clone( mockHistory.data.template ),
- { purged : true,
- delete_url : '' }),
- notvisible :
- _.extend( _.clone( mockHistory.data.template ),
- { visible : false,
- unhide_url : 'example.com/unhide' }),
-
- hasDisplayApps :
- _.extend( _.clone( mockHistory.data.template ),
- { display_apps : {
- 'display in IGB' : {
- Web: "/display_application/63cd3858d057a6d1/igb_bam/Web",
- Local: "/display_application/63cd3858d057a6d1/igb_bam/Local"
- }
- }
- }
- ),
- canTrackster :
- _.extend( _.clone( mockHistory.data.template ),
- { trackster_urls : {
- 'data-url' : "example.com/trackster-data",
- 'action-url' : "example.com/trackster-action",
- 'new-url' : "example.com/trackster-new"
- }
- }
- ),
- zeroSize :
- _.extend( _.clone( mockHistory.data.template ),
- { file_size : 0 }),
-
- hasMetafiles :
- _.extend( _.clone( mockHistory.data.template ), {
- download_meta_urls : {
- 'bam_index' : "example.com/bam-index"
- }
- }),
-
- //states
- upload :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.UPLOAD }),
- queued :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.QUEUED }),
- running :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.RUNNING }),
- empty :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.EMPTY }),
- error :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.ERROR,
- report_error_url: 'example.com/report_err' }),
- discarded :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.DISCARDED }),
- setting_metadata :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.SETTING_METADATA }),
- failed_metadata :
- _.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.FAILED_METADATA })
-/*
-*/
- });
-
- $( document ).ready( function(){
- //mockHistory.views.deleted.logger = console;
- mockHistory.items = {};
- mockHistory.views = {};
- for( key in mockHistory.data ){
- mockHistory.items[ key ] = new HistoryItem( mockHistory.data[ key ] );
- mockHistory.items[ key ].set( 'name', key );
- mockHistory.views[ key ] = new HistoryItemView({ model : mockHistory.items[ key ] });
- //console.debug( 'view: ', mockHistory.views[ key ] );
- $( 'body' ).append( mockHistory.views[ key ].render() );
- }
- });
-}
-
+//return {
+// HistoryItem : HistoryItem,
+// HitoryItemView : HistoryItemView,
+// HistoryCollection : HistoryCollection,
+// History : History,
+// HistoryView : HistoryView
+//};});
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/compile_templates.py
--- a/static/scripts/templates/compile_templates.py
+++ b/static/scripts/templates/compile_templates.py
@@ -46,153 +46,99 @@
from glob import glob
from subprocess import call
-from shutil import copyfile
-from os import path
+import os
from optparse import OptionParser
-from HTMLParser import HTMLParser
+import re
-import logging
-log = logging.getLogger( __name__ )
+import logging as log
+log.basicConfig(
+ #level = log.DEBUG,
+ name = __name__
+)
COMPILED_DIR = 'compiled'
COMPILED_EXT = '.js'
COMPILE_CMD_STR = "handlebars %s -f %s"
COMPILE_MINIMIZE_SWITCH = ' -m'
+TEMPLATE_TAG = 'script'
+TEMPLATE_TYPE = 'text/template'
+HELPER_TYPE = 'text/javascript'
+
# both of these are off by default for backward compat
DEFAULT_MINIMIZATION = False
DEFAULT_MULTI_EXT = None #'.html'
# ------------------------------------------------------------------------------
-class HTMLMultiTemplateParser( HTMLParser ):
- """Parses multiple templates from an HTML file, saving them to a map of:
- { id : template_text, ... }
+def parse_html_tag_attrs( string ):
+ attrs = {}
+ for match in re.finditer( r'(?P<key>\w+?)=[\'|\"](?P<val>.*?)[\'|\"]', string, re.DOTALL | re.MULTILINE ):
+ match = match.groupdict()
+ key = match[ 'key' ]
+ val = match[ 'val' ]
+ attrs[ key ] = val
+ return attrs
+
+def split_on_html_tag( string, tag ):
+ tag_pattern = r'<%s\s*(?P<attrs>.*?)>(?P<body>.*?)</%s>' % ( tag, tag )
+ log.debug( tag_pattern )
+ tag_pattern = re.compile( tag_pattern, re.MULTILINE | re.DOTALL )
+
+ found_list = re.findall( tag_pattern, string )
+ for attrs, body in found_list:
+ yield ( parse_html_tag_attrs( attrs ), body )
+
+def filter_on_tag_type( generator, type_attr_to_match ):
+ for attrs, body in generator:
+ log.debug( 'attrs: %s', str( attrs ) )
+ if( ( 'type' in attrs )
+ and ( attrs[ 'type' ] == type_attr_to_match ) ):
+ yield attrs, body
+
- Templates must:
- * be within the TEMPLATE_TAG
- * TEMPLATE_TAG must have a type attribute
- * that attr must == TEMPLATE_TYPE
- * TEMPLATE_TAG cannot be nested within one another
- * TEMPLATE_TAG must have an id attribute
- """
- TEMPLATE_TAG = 'script'
- TEMPLATE_TYPES = [ 'text/template' ]
-
- HELPER_TAG = 'script'
- HELPER_TYPES = [ 'text/javascript' ]
-
- def __init__( self ):
- HTMLParser.__init__( self )
- self.templates = {}
- self.curr_template_id = None
- self.template_data = ''
-
- self.helpers = {}
- self.curr_helper_id = None
- self.helper_data = ''
-
- def is_template_tag( self, tag, attr_dict ):
- # both tag and type attr must match
- return ( ( tag == self.TEMPLATE_TAG )
- and ( 'type' in attr_dict )
- and ( attr_dict[ 'type' ] in self.TEMPLATE_TYPES ) )
-
- def is_helper_tag( self, tag, attr_dict ):
- # both tag and type attr must match
- return ( ( tag == self.HELPER_TAG )
- and ( 'type' in attr_dict )
- and ( attr_dict[ 'type' ] in self.HELPER_TYPES ) )
-
- def handle_starttag( self, tag, attrs ):
- attr_dict = dict( attrs )
- if self.is_template_tag( tag, attr_dict ):
- log.debug( "\t template tag: %s, %s", tag, str( attr_dict ) );
-
- # as far as I know these tags can't/shouldn't nest/overlap
- #pre: not already inside a template/helper tag
- assert self.curr_template_id == None, "Found nested template tag: %s" % ( self.curr_template_id )
- assert self.curr_helper_id == None, "Found template tag inside helper: %s" % ( self.curr_helper_id )
- #pre: must have an id
- assert 'id' in attr_dict, "No id attribute in template: " + str( attr_dict )
-
- self.curr_template_id = attr_dict[ 'id' ]
-
- elif self.is_helper_tag( tag, attr_dict ):
- log.debug( "\t helper tag: %s, %s", tag, str( attr_dict ) );
-
- #pre: not already inside a template/helper tag
- assert self.curr_helper_id == None, "Found nested helper tag: %s" % ( self.curr_helper_id )
- assert self.curr_template_id == None, "Found helper tag inside template: %s" % ( self.curr_template_id )
- #pre: must have an id
- assert 'id' in attr_dict, "No id attribute in helper: " + str( attr_dict )
-
- self.curr_helper_id = attr_dict[ 'id' ]
-
- def handle_endtag( self, tag ):
- if( ( tag == self.TEMPLATE_TAG )
- and ( self.curr_template_id ) ):
- log.debug( "\t ending template tag :", tag, self.curr_template_id );
-
- # store the template data by the id
- if self.template_data:
- self.templates[ self.curr_template_id ] = self.template_data
-
- #! reset for next template
- self.curr_template_id = None
- self.template_data = ''
-
- elif( ( tag == self.HELPER_TAG )
- and ( self.curr_helper_id ) ):
- log.debug( "\t ending helper tag :", tag, self.curr_template_id );
-
- # store the template data by the id
- if self.helper_data:
- self.helpers[ self.curr_helper_id ] = self.helper_data
-
- #! reset for next template
- self.curr_helper_id = None
- self.helper_data = ''
-
- def handle_data(self, data):
- data = data.strip()
- if data:
- if self.curr_template_id:
- log.debug( "\t template text :", data );
- self.template_data += data
-
- elif self.curr_helper_id:
- log.debug( "\t helper js fn :", data );
- self.helper_data += data
-
-
# ------------------------------------------------------------------------------
def break_multi_template( multi_template_filename ):
"""parse the multi template, writing each template into a new handlebars tmpl and returning their names"""
template_filenames = []
- parser = HTMLMultiTemplateParser()
# parse the multi template
print "\nBreaking multi-template file %s into individual templates and helpers:" % ( multi_template_filename )
with open( multi_template_filename, 'r' ) as multi_template_file:
- # wish I could use a gen here
- parser.feed( multi_template_file.read() )
+ multi_template_file_text = multi_template_file.read()
- # after breaking, write each indiv. template and save the names
- for template_id, template_text in parser.templates.items():
+ # write a template file for each template (name based on id in tag)
+ tag_generator = split_on_html_tag( multi_template_file_text, TEMPLATE_TAG )
+ for attrs, template_text in filter_on_tag_type( tag_generator, TEMPLATE_TYPE ):
+ if( 'id' not in attrs ):
+ log.warning( 'Template has no "id". attrs: %s' %( str( attrs ) ) )
+ continue
+
+ template_id = attrs[ 'id' ]
+ template_text = template_text.strip()
handlebar_template_filename = template_id + '.handlebars'
with open( handlebar_template_filename, 'w' ) as handlebar_template_file:
handlebar_template_file.write( template_text )
+ log.debug( "%s\n%s\n", template_id, template_text )
template_filenames.append( handlebar_template_filename )
- # write all helpers to a 'helper-' prefixed js file in the compilation dir
- if parser.helpers:
- helper_filename = 'helpers-' + path.splitext( multi_template_filename )[0] + '.js'
- helper_filename = path.join( COMPILED_DIR, helper_filename )
+ ## write all helpers to a single 'helper-' prefixed js file in the compilation dir
+ helper_fns = []
+ # same tag, different type
+ tag_generator = split_on_html_tag( multi_template_file_text, TEMPLATE_TAG )
+ for attrs, helper_text in filter_on_tag_type( tag_generator, HELPER_TYPE ):
+ helper_text = helper_text.strip()
+ print '(helper):', ( attrs[ 'id' ] if 'id' in attrs else '(No id)' )
+
+ helper_fns.append( helper_text )
+
+ if helper_fns:
+ # prefix original filename (in compiled dir) and write all helper funcs to that file
+ helper_filename = 'helpers-' + os.path.splitext( multi_template_filename )[0] + '.js'
+ helper_filename = os.path.join( COMPILED_DIR, helper_filename )
with open( helper_filename, 'w' ) as helper_file:
- for helper_fn_name, helper_fn in parser.helpers.items():
- print '(helper)', helper_fn_name
- helper_file.write( helper_fn + '\n' )
+ helper_file.write( '\n'.join( helper_fns ) )
+ print '(helper functions written to %s)' % helper_filename
print '\n'.join( template_filenames )
return template_filenames
@@ -204,8 +150,8 @@
Use the basename of the template file for the outputed js.
"""
- template_basename = path.splitext( path.split( template_filename )[1] )[0]
- compiled_filename = path.join( COMPILED_DIR, template_basename + COMPILED_EXT )
+ template_basename = os.path.splitext( os.path.split( template_filename )[1] )[0]
+ compiled_filename = os.path.join( COMPILED_DIR, template_basename + COMPILED_EXT )
command_string = COMPILE_CMD_STR % ( template_filename, compiled_filename )
if minimize:
@@ -233,6 +179,7 @@
# if desired, break up any passed-in or found multi template files
# adding the names of the new single templates to those needing compilation
+ multi_template_template_filenames = []
if options.multi_ext:
multi_templates = []
if len( args ) >= 1:
@@ -241,10 +188,10 @@
multi_templates = glob( '*' + options.multi_ext )
for multi_template_filename in multi_templates:
- handlebars_templates.extend( break_multi_template( multi_template_filename ) )
+ multi_template_template_filenames.extend( break_multi_template( multi_template_filename ) )
# unique filenames only (Q&D)
- handlebars_templates = list( set( handlebars_templates ) )
+ handlebars_templates = list( set( handlebars_templates + multi_template_template_filenames ) )
# compile the templates
print "\nCompiling templates:"
@@ -260,6 +207,12 @@
print ',\n'.join( filenames_w_possible_errors )
print "\nCall this script with the '-h' for more help"
+ # delete multi template intermediate files
+ print "\nCleaning up intermediate multi-template template files:"
+ for filename in multi_template_template_filenames:
+ print 'removing', filename
+ os.remove( filename )
+
# ------------------------------------------------------------------------------
if __name__ == '__main__':
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/compiled/helpers-common-templates.js
--- a/static/scripts/templates/compiled/helpers-common-templates.js
+++ b/static/scripts/templates/compiled/helpers-common-templates.js
@@ -3,6 +3,11 @@
Handlebars.registerPartial( 'clearFloatDiv', function( options ){
return '<div class="clear"></div>';
});
+/** Renders a warning in a (mostly css) highlighted, iconned warning box
+ */
+Handlebars.registerHelper( 'warningmessagesmall', function( options ){
+ return '<div class="warningmessagesmall"><strong>' + options.fn( this ) + '</strong></div>'
+});
/** Renders a glx style icon-button (see IconButton in mvc/ui.js)
* can be used in either of the following ways:
* within a template: {{> iconButton buttonData}}
@@ -29,9 +34,4 @@
buffer += '>' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
return buffer;
-});
-/** Renders a warning in a (mostly css) highlighted, iconned warning box
- */
-Handlebars.registerHelper( 'warningmessagesmall', function( options ){
- return '<div class="warningmessagesmall"><strong>' + options.fn( this ) + '</strong></div>'
-});
+});
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/compiled/template-history-downloadLinks.js
--- /dev/null
+++ b/static/scripts/templates/compiled/template-history-downloadLinks.js
@@ -0,0 +1,55 @@
+(function() {
+ var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+templates['template-history-downloadLinks'] = template(function (Handlebars,depth0,helpers,partials,data) {
+ helpers = helpers || Handlebars.helpers;
+ var stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+ var buffer = "", stack1, foundHelper;
+ buffer += "\n<div popupmenu=\"dataset-";
+ foundHelper = helpers.id;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "-popup\">\n <a class=\"action-button\" href=\"";
+ foundHelper = helpers.download_url;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.download_url; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "\">Download Dataset</a>\n <a>Additional Files</a>\n ";
+ stack1 = depth0.meta_files;
+ stack1 = helpers.each.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(2, program2, data)});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n</div>\n<div style=\"float:left;\" class=\"menubutton split popup\" id=\"dataset-";
+ foundHelper = helpers.id;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "-popup\">\n <a href=\"";
+ foundHelper = helpers.download_url;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.download_url; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "\" title=\"Download\" class=\"icon-button disk tooltip\"></a>\n</div>\n";
+ return buffer;}
+function program2(depth0,data) {
+
+ var buffer = "", stack1, foundHelper;
+ buffer += "\n <a class=\"action-button\" href=\"";
+ foundHelper = helpers.meta_download_url;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.meta_download_url; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "\">Download ";
+ foundHelper = helpers.meta_file_type;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.meta_file_type; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "</a>\n ";
+ return buffer;}
+
+function program4(depth0,data) {
+
+
+ return "\n <a href=\"\" title=\"Download\" class=\"icon-button disk tooltip\"></a>\n";}
+
+ stack1 = depth0.meta_files;
+ stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data)});
+ if(stack1 || stack1 === 0) { return stack1; }
+ else { return ''; }});
+})();
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/history-templates.html
--- a/static/scripts/templates/history-templates.html
+++ b/static/scripts/templates/history-templates.html
@@ -70,3 +70,21 @@
</div></script>
+<script type="text/template" class="template-history" id="template-history-downloadLinks">
+{{#if meta_files}}
+<div popupmenu="dataset-{{id}}-popup">
+ <a class="action-button" href="{{download_url}}">Download Dataset</a>
+ <a>Additional Files</a>
+ {{#each meta_files}}
+ <a class="action-button" href="{{meta_download_url}}">Download {{meta_file_type}}</a>
+ {{/each}}
+</div>
+<div style="float:left;" class="menubutton split popup" id="dataset-{{id}}-popup">
+ <a href="{{download_url}}" title="Download" class="icon-button disk tooltip"></a>
+</div>
+{{else}}
+ <a href="" title="Download" class="icon-button disk tooltip"></a>
+{{/if}}
+</script>
+
+
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-history-annotationArea.handlebars
--- a/static/scripts/templates/template-history-annotationArea.handlebars
+++ /dev/null
@@ -1,7 +0,0 @@
-{{! TODO: move to mvc/annotations.js templates, editable-text }}
-<div id="{{ id }}-annotation-area" class="annotation-area" style="display: none;">
- <strong>Annotation:</strong>
- <div id="{{ id }}-anotation-elt" class="annotation-elt tooltip editable-text"
- style="margin: 1px 0px 1px 0px" title="Edit dataset annotation">
- </div>
-</div>
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-history-failedMetaData.handlebars
--- a/static/scripts/templates/template-history-failedMetaData.handlebars
+++ /dev/null
@@ -1,4 +0,0 @@
-{{#warningmessagesmall}}
-An error occurred setting the metadata for this dataset.
-You may be able to <a href="{{ edit_url }}" target="galaxy_main">set it manually or retry auto-detection</a>.
-{{/warningmessagesmall}}
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-history-hdaSummary.handlebars
--- a/static/scripts/templates/template-history-hdaSummary.handlebars
+++ /dev/null
@@ -1,13 +0,0 @@
-<div class="hda-summary">
- {{ misc_blurb }}<br />
- format: <span class="{{ data_type }}">{{ data_type }}</span>,
- database:
- {{#if dbkey_unknown_and_editable }}
- <a href="{{ edit_url }}" target="galaxy_main">{{ metadata_dbkey }}</a>
- {{else}}
- <span class="{{ metadata_dbkey }}">{{ metadata_dbkey }}</span>
- {{/if}}
-</div>
-{{#if misc_info}}
-<div class="hda-info">{{ misc_info }}</div>
-{{/if}}
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-history-tagArea.handlebars
--- a/static/scripts/templates/template-history-tagArea.handlebars
+++ /dev/null
@@ -1,6 +0,0 @@
-{{! TODO: move to mvc/tag.js templates }}
-<div class="tag-area" style="display: none;">
- <strong>Tags:</strong>
- <div class="tag-elt">
- </div>
-</div>
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-history-titleLink.handlebars
--- a/static/scripts/templates/template-history-titleLink.handlebars
+++ /dev/null
@@ -1,1 +0,0 @@
-<a href="javascript:void(0);"><span class="historyItemTitle">{{ hid }}: {{ name }}</span></a>
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-history-warning-messages.handlebars
--- a/static/scripts/templates/template-history-warning-messages.handlebars
+++ /dev/null
@@ -1,23 +0,0 @@
-{{#if deleted}}{{#warningmessagesmall}}
- This dataset has been deleted.
- {{#if undelete_url}}
- Click <a href="{{ undelete_url }}" class="historyItemUndelete" id="historyItemUndeleter-{{ id }}"
- target="galaxy_history">here</a> to undelete it
- {{#if purge_url}}
- or <a href="{{ purge_url }}" class="historyItemPurge" id="historyItemPurger-{{ id }}"
- target="galaxy_history">here</a> to immediately remove it from disk
- {{/if}}
- {{/if}}
-{{/warningmessagesmall}}{{/if}}
-
-{{#if purged}}{{#warningmessagesmall}}
- This dataset has been deleted and removed from disk.
-{{/warningmessagesmall}}{{/if}}
-
-{{#unless visible}}{{#warningmessagesmall}}
- This dataset has been hidden.
- {{#if unhide_url}}
- Click <a href="{{ unhide_url }}" class="historyItemUnhide" id="historyItemUnhider-{{ id }}"
- target="galaxy_history">here</a> to unhide it
- {{/if}}
-{{/warningmessagesmall}}{{/unless}}
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-iconButton.handlebars
--- a/static/scripts/templates/template-iconButton.handlebars
+++ /dev/null
@@ -1,2 +0,0 @@
-{{! alternate template-based icon-button }}
-{{> iconButton this}}
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b static/scripts/templates/template-warningmessagesmall.handlebars
--- a/static/scripts/templates/template-warningmessagesmall.handlebars
+++ /dev/null
@@ -1,2 +0,0 @@
-{{! renders a warning in a (mostly css) highlighted, iconned warning box }}
- <div class="warningmessagesmall"><strong>{{{ warning }}}</strong></div>
\ No newline at end of file
diff -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff -r f0eea6ef482453ccc3cc466917ae4ed93920666b templates/root/alternate_history.mako
--- a/templates/root/alternate_history.mako
+++ b/templates/root/alternate_history.mako
@@ -7,6 +7,40 @@
## ?? add: if string != _(string)
</%def>
+##<%def name="render_download_links( data, dataset_id )">
+## ##
+## %if data.purged: return
+## <%
+## from galaxy.datatypes.metadata import FileParameter
+## download_url = h.url_for( controller='/dataset', action='display', dataset_id=dataset_id, to_ext=data.ext )
+## meta_files = []
+## for k in data.metadata.spec.keys():
+## if isinstance( data.metadata.spec[ k ].param, FileParameter ):
+## file_type = k
+## download_url = h.url_for( controller='/dataset', action='get_metadata_file',
+## hda_id=dataset_id, metadata_name=file_type )
+## meta_files.append( ( file_type, download_url ) )
+## %>
+##
+## %if meta_files:
+## <div popupmenu="dataset-${dataset_id}-popup">
+## <a class="action-button" href="${download_url}">Download Dataset</a>
+##
+## <a>Additional Files</a>
+## %for meta_file_type, meta_download_url in zip( meta_download_types, meta_download_urls ):
+## <a class="action-button" href="${meta_download_url}">Download ${meta_file_type}</a>
+## %endfor
+##
+## <div style="float:left;" class="menubutton split popup" id="dataset-${dataset_id}-popup">
+## <a href="${download_url}" title='${_("Download")}' class="icon-button disk tooltip"></a>
+## </div>
+## </div>
+##
+## %else
+## <a href="${download_url}" title='${_("Download")}' class="icon-button disk tooltip"></a>
+## %endif
+##</%def>
+
<%def name="get_page_localized_strings()">
## a list of localized strings used in the backbone views, etc. (to be loaded and cached)
##! change on per page basis
@@ -54,33 +88,34 @@
<%def name="get_urls_for_hda( hda, encoded_data_id, for_editing )"><%
from galaxy.datatypes.metadata import FileParameter
+ #print '\n', hda.name
data_dict = {}
def add_to_data( **kwargs ):
data_dict.update( kwargs )
- # download links (for both main hda and associated meta files)
- if hda.has_data():
- add_to_data( download_url=h.url_for( controller='/dataset', action='display',
- dataset_id=encoded_data_id, to_ext=hda.ext ) )
-
- download_meta_urls = {}
- for file_type in hda.metadata.spec.keys():
- if not isinstance( hda.metadata.spec[ file_type ].param, FileParameter ):
- continue
-
- download_meta_urls[ file_type ] = h.url_for( controller='/dataset', action='get_metadata_file',
- hda_id=encoded_data_id, metadata_name=file_type )
- if download_meta_urls:
- #TODO:?? needed? isn't this the same as download_url?
- add_to_data( download_dataset_url=h.url_for( controller='dataset', action='display',
- dataset_id=encoded_data_id, to_ext=hda.ext ) )
- add_to_data( download_meta_urls=download_meta_urls )
-
#TODO??: better way to do urls (move into js galaxy_paths (decorate) - _not_ dataset specific)
deleted = hda.deleted
purged = hda.purged
+ # download links (for both main hda and associated meta files)
+ if not hda.purged:
+ add_to_data( download_url=h.url_for( controller='/dataset', action='display',
+ dataset_id=encoded_data_id, to_ext=hda.ext ) )
+
+ meta_files = []
+ for k in hda.metadata.spec.keys():
+ if isinstance( hda.metadata.spec[ k ].param, FileParameter ):
+ file_type = k
+ download_url = h.url_for( controller='/dataset', action='get_metadata_file',
+ hda_id=encoded_data_id, metadata_name=file_type )
+ meta_files.append( dict( meta_file_type=file_type, meta_download_url=download_url ) )
+
+ if meta_files:
+ print hda.name, meta_files
+ add_to_data( meta_files=meta_files )
+
+
#purged = purged or hda.dataset.purged //??
# all of these urls are 'datasets/data_id/<action>
@@ -305,7 +340,8 @@
"template-history-hdaSummary",
"template-history-failedMetadata",
"template-history-tagArea",
- "template-history-annotationArea"
+ "template-history-annotationArea",
+ "template-history-downloadLinks"
)}
## if using in-dom templates they need to go here (before the Backbone classes are defined)
@@ -339,6 +375,7 @@
createMockHistoryData();
return;
+ //TODO: handle empty history
} else if ( window.USE_CURR_DATA ){
if( console && console.debug ){ console.debug( '\t using current history data' ); }
glx_history = new History( pageData.history ).loadDatasetsAsHistoryItems( pageData.hdas );
@@ -409,3 +446,163 @@
</%def><body class="historyPage"></body>
+
+<script type="text/javascript">
+function createMockHistoryData(){
+ mockHistory = {};
+ mockHistory.data = {
+
+ template : {
+ id : 'a799d38679e985db',
+ name : 'template',
+ data_type : 'fastq',
+ file_size : 226297533,
+ genome_build : '?',
+ metadata_data_lines : 0,
+ metadata_dbkey : '?',
+ metadata_sequences : 0,
+ misc_blurb : '215.8 MB',
+ misc_info : 'uploaded fastq file (misc_info)',
+ model_class : 'HistoryDatasetAssociation',
+ download_url : '',
+ state : 'ok',
+ visible : true,
+ deleted : false,
+ purged : false,
+
+ hid : 0,
+ //TODO: move to history
+ for_editing : true,
+ //for_editing : false,
+
+ //?? not needed
+ //can_edit : true,
+ //can_edit : false,
+
+ accessible : true,
+
+ //TODO: move into model functions (build there (and cache?))
+ //!! be careful with adding these accrd. to permissions
+ //!! IOW, don't send them via template/API if the user doesn't have perms to use
+ //!! (even if they don't show up)
+ undelete_url : '',
+ purge_url : '',
+ unhide_url : '',
+
+ display_url : 'example.com/display',
+ edit_url : 'example.com/edit',
+ delete_url : 'example.com/delete',
+
+ show_params_url : 'example.com/show_params',
+ rerun_url : 'example.com/rerun',
+
+ retag_url : 'example.com/retag',
+ annotate_url : 'example.com/annotate',
+
+ peek : [
+ '<table cellspacing="0" cellpadding="3"><tr><th>1.QNAME</th><th>2.FLAG</th><th>3.RNAME</th><th>4.POS</th><th>5.MAPQ</th><th>6.CIGAR</th><th>7.MRNM</th><th>8.MPOS</th><th>9.ISIZE</th><th>10.SEQ</th><th>11.QUAL</th><th>12.OPT</th></tr>',
+ '<tr><td colspan="100%">@SQ SN:gi|87159884|ref|NC_007793.1| LN:2872769</td></tr>',
+ '<tr><td colspan="100%">@PG ID:bwa PN:bwa VN:0.5.9-r16</td></tr>',
+ '<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 73 gi|87159884|ref|NC_007793.1| 2720169 37 101M = 2720169 0 NAATATGACATTATTTTCAAAACAGCTGAAAATTTAGACGTACCGATTTATCTACATCCCGCGCCAGTTAACAGTGACATTTATCAATCATACTATAAAGG !!!!!!!!!!$!!!$!!!!!$!!!!!!$!$!$$$!!$!!$!!!!!!!!!!!$!</td></tr>',
+ '<tr><td colspan="100%">!!!$!$!$$!!$$!!$!!!!!!!!!!!!!!!!!!!!!!!!!!$!!$!! XT:A:U NM:i:1 SM:i:37 AM:i:0 X0:i:1 X1:i:0 XM:i:1 XO:i:0 XG:i:0 MD:Z:0A100</td></tr>',
+ '<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 133 gi|87159884|ref|NC_007793.1| 2720169 0 * = 2720169 0 NAAACTGTGGCTTCGTTNNNNNNNNNNNNNNNGTGANNNNNNNNNNNNNNNNNNNGNNNNNNNNNNNNNNNNNNNNCNAANNNNNNNNNNNNNNNNNNNNN !!!!!!!!!!!!$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>',
+ '<tr><td colspan="100%">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>',
+ '</table>'
+ ].join( '' )
+ }
+
+ };
+ _.extend( mockHistory.data, {
+
+ notAccessible :
+ _.extend( _.clone( mockHistory.data.template ),
+ { accessible : false }),
+
+ //deleted, purged, visible
+ deleted :
+ _.extend( _.clone( mockHistory.data.template ),
+ { deleted : true,
+ delete_url : '',
+ purge_url : 'example.com/purge',
+ undelete_url : 'example.com/undelete' }),
+ purgedNotDeleted :
+ _.extend( _.clone( mockHistory.data.template ),
+ { purged : true,
+ delete_url : '' }),
+ notvisible :
+ _.extend( _.clone( mockHistory.data.template ),
+ { visible : false,
+ unhide_url : 'example.com/unhide' }),
+
+ hasDisplayApps :
+ _.extend( _.clone( mockHistory.data.template ),
+ { display_apps : {
+ 'display in IGB' : {
+ Web: "/display_application/63cd3858d057a6d1/igb_bam/Web",
+ Local: "/display_application/63cd3858d057a6d1/igb_bam/Local"
+ }
+ }
+ }
+ ),
+ canTrackster :
+ _.extend( _.clone( mockHistory.data.template ),
+ { trackster_urls : {
+ 'data-url' : "example.com/trackster-data",
+ 'action-url' : "example.com/trackster-action",
+ 'new-url' : "example.com/trackster-new"
+ }
+ }
+ ),
+ zeroSize :
+ _.extend( _.clone( mockHistory.data.template ),
+ { file_size : 0 }),
+
+ hasMetafiles :
+ _.extend( _.clone( mockHistory.data.template ), {
+ download_meta_urls : {
+ 'bam_index' : "example.com/bam-index"
+ }
+ }),
+
+ //states
+ upload :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.UPLOAD }),
+ queued :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.QUEUED }),
+ running :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.RUNNING }),
+ empty :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.EMPTY }),
+ error :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.ERROR,
+ report_error_url: 'example.com/report_err' }),
+ discarded :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.DISCARDED }),
+ setting_metadata :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.SETTING_METADATA }),
+ failed_metadata :
+ _.extend( _.clone( mockHistory.data.template ),
+ { state : HistoryItem.STATES.FAILED_METADATA })
+/*
+*/
+ });
+
+ //mockHistory.views.deleted.logger = console;
+ mockHistory.items = {};
+ mockHistory.views = {};
+ for( key in mockHistory.data ){
+ mockHistory.items[ key ] = new HistoryItem( mockHistory.data[ key ] );
+ mockHistory.items[ key ].set( 'name', key );
+ mockHistory.views[ key ] = new HistoryItemView({ model : mockHistory.items[ key ] });
+ //console.debug( 'view: ', mockHistory.views[ key ] );
+ $( 'body' ).append( mockHistory.views[ key ].render() );
+ }
+}
+</script>
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Update Cuffdiff wrapper to support v2.0 and add multi-read correction option.
by Bitbucket 26 Sep '12
by Bitbucket 26 Sep '12
26 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/9c29a51ec0b1/
changeset: 9c29a51ec0b1
user: jgoecks
date: 2012-09-26 17:08:59
summary: Update Cuffdiff wrapper to support v2.0 and add multi-read correction option.
affected #: 5 files
diff -r 199767a1714b27a9a5c3f2376ad0133a70cd7c51 -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff test-data/cuffdiff_out10.txt
--- a/test-data/cuffdiff_out10.txt
+++ b/test-data/cuffdiff_out10.txt
@@ -1,88 +1,88 @@
test_id gene_id gene locus sample_1 sample_2 status value_1 value_2 sqrt(JS) test_stat p_value q_value significant
-XLOC_000001 XLOC_000001 Xkr4 chr1:3204754-3204833 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000002 XLOC_000002 - chr1:3111449-3111490 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000003 XLOC_000003 - chr1:3111545-3111576 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000004 XLOC_000004 - chr1:3174765-3174792 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000005 XLOC_000005 - chr1:3187401-3187428 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000006 XLOC_000006 - chr1:3188521-3188548 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000007 XLOC_000007 - chr1:3189810-3190789 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000008 XLOC_000008 - chr1:3190858-3191434 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000009 XLOC_000009 - chr1:3191512-3192077 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000010 XLOC_000010 - chr1:3192250-3192336 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000011 XLOC_000011 - chr1:3192441-3192494 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000012 XLOC_000012 - chr1:3192550-3192629 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000013 XLOC_000013 - chr1:3192649-3192676 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000014 XLOC_000014 - chr1:3192731-3192811 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000015 XLOC_000015 - chr1:3192940-3193042 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000016 XLOC_000016 - chr1:3194185-3194226 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000017 XLOC_000017 - chr1:3194302-3194329 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000018 XLOC_000018 - chr1:3194706-3194733 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000019 XLOC_000019 - chr1:3195083-3195110 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000020 XLOC_000020 - chr1:3195450-3195477 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000021 XLOC_000021 - chr1:3197089-3197116 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000022 XLOC_000022 - chr1:3197246-3197273 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000023 XLOC_000023 - chr1:3197346-3197373 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000024 XLOC_000024 - chr1:3197425-3197452 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000025 XLOC_000025 - chr1:3200022-3200191 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000026 XLOC_000026 - chr1:3200325-3200352 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000027 XLOC_000027 - chr1:3200430-3200457 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000028 XLOC_000028 - chr1:3201007-3201039 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000029 XLOC_000029 - chr1:3201077-3201481 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000030 XLOC_000030 - chr1:3201596-3201666 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000031 XLOC_000031 - chr1:3201672-3201699 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000032 XLOC_000032 - chr1:3201725-3201809 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000033 XLOC_000033 Xkr4 chr1:3211521-3211561 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000034 XLOC_000034 Xkr4 chr1:3212213-3212292 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000035 XLOC_000035 Xkr4 chr1:3212367-3212439 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000036 XLOC_000036 Xkr4 chr1:3212717-3212801 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000037 XLOC_000037 Xkr4 chr1:3213095-3213242 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000038 XLOC_000038 Xkr4 chr1:3240606-3240633 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000039 XLOC_000039 Xkr4 chr1:3242479-3242512 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000040 XLOC_000040 Xkr4 chr1:3242633-3242923 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000041 XLOC_000041 Xkr4 chr1:3242924-3243005 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000042 XLOC_000042 Xkr4 chr1:3243018-3243079 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000043 XLOC_000043 Xkr4 chr1:3243108-3243154 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000044 XLOC_000044 Xkr4 chr1:3243347-3243401 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000045 XLOC_000045 Xkr4 chr1:3254079-3254106 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000046 XLOC_000046 Xkr4 chr1:3256974-3257011 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000047 XLOC_000047 Xkr4 chr1:3277155-3277182 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000048 XLOC_000048 Xkr4 chr1:3277190-3277218 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000049 XLOC_000049 Xkr4 chr1:3277913-3278390 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000050 XLOC_000050 Xkr4 chr1:3280117-3280144 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000051 XLOC_000051 Xkr4 chr1:3280498-3280525 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000052 XLOC_000052 Xkr4 chr1:3280686-3280741 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000053 XLOC_000053 Xkr4 chr1:3282504-3282531 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000054 XLOC_000054 Xkr4 chr1:3282650-3282677 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000055 XLOC_000055 Xkr4 chr1:3282760-3282832 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000056 XLOC_000056 Xkr4 chr1:3284966-3284993 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000057 XLOC_000057 Xkr4 chr1:3290488-3290553 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000058 XLOC_000058 Xkr4 chr1:3290798-3290859 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000059 XLOC_000059 Xkr4 chr1:3290919-3291273 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000060 XLOC_000060 Xkr4 chr1:3299443-3299664 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000061 XLOC_000061 Xkr4 chr1:3299691-3299733 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000062 XLOC_000062 Xkr4 chr1:3300051-3300078 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000063 XLOC_000063 Xkr4 chr1:3307748-3307775 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000064 XLOC_000064 Xkr4 chr1:3318620-3318647 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000065 XLOC_000065 Xkr4 chr1:3318999-3319051 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000066 XLOC_000066 Xkr4 chr1:3330527-3330554 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000067 XLOC_000067 Xkr4 chr1:3351240-3351311 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000068 XLOC_000068 Xkr4 chr1:3355887-3356119 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000069 XLOC_000069 Xkr4 chr1:3356180-3356225 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000070 XLOC_000070 Xkr4 chr1:3363076-3363176 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000071 XLOC_000071 Xkr4 chr1:3363214-3363278 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000072 XLOC_000072 Xkr4 chr1:3363387-3363446 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000073 XLOC_000073 Xkr4 chr1:3363753-3363849 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000074 XLOC_000074 Xkr4 chr1:3364871-3364919 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000075 XLOC_000075 Xkr4 chr1:3367135-3367162 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000076 XLOC_000076 Xkr4 chr1:3367210-3367237 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000077 XLOC_000077 Xkr4 chr1:3367333-3367382 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000078 XLOC_000078 Xkr4 chr1:3369580-3369607 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000079 XLOC_000079 Xkr4 chr1:3375001-3375028 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000080 XLOC_000080 Xkr4 chr1:3377211-3377262 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000081 XLOC_000081 Xkr4 chr1:3379888-3379915 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000082 XLOC_000082 Xkr4 chr1:3386739-3386836 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000083 XLOC_000083 Xkr4 chr1:3391325-3391352 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000084 XLOC_000084 Xkr4 chr1:3435841-3435880 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000085 XLOC_000085 Xkr4 chr1:3447761-3447788 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000086 XLOC_000086 Xkr4 chr1:3450906-3450965 q1 q2 NOTEST 0 0 0 0 0 1 no
-XLOC_000087 XLOC_000087 Xkr4 chr1:3451051-3451109 q1 q2 NOTEST 0 0 0 0 0 1 no
+XLOC_000001 XLOC_000001 Xkr4 chr1:3204754-3204833 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000002 XLOC_000002 - chr1:3111449-3111490 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000003 XLOC_000003 - chr1:3111545-3111576 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000004 XLOC_000004 - chr1:3174765-3174792 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000005 XLOC_000005 - chr1:3187401-3187428 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000006 XLOC_000006 - chr1:3188521-3188548 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000007 XLOC_000007 - chr1:3189810-3190789 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000008 XLOC_000008 - chr1:3190858-3191434 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000009 XLOC_000009 - chr1:3191512-3192077 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000010 XLOC_000010 - chr1:3192250-3192336 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000011 XLOC_000011 - chr1:3192441-3192494 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000012 XLOC_000012 - chr1:3192550-3192629 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000013 XLOC_000013 - chr1:3192649-3192676 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000014 XLOC_000014 - chr1:3192731-3192811 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000015 XLOC_000015 - chr1:3192940-3193042 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000016 XLOC_000016 - chr1:3194185-3194226 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000017 XLOC_000017 - chr1:3194302-3194329 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000018 XLOC_000018 - chr1:3194706-3194733 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000019 XLOC_000019 - chr1:3195083-3195110 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000020 XLOC_000020 - chr1:3195450-3195477 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000021 XLOC_000021 - chr1:3197089-3197116 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000022 XLOC_000022 - chr1:3197246-3197273 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000023 XLOC_000023 - chr1:3197346-3197373 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000024 XLOC_000024 - chr1:3197425-3197452 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000025 XLOC_000025 - chr1:3200022-3200191 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000026 XLOC_000026 - chr1:3200325-3200352 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000027 XLOC_000027 - chr1:3200430-3200457 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000028 XLOC_000028 - chr1:3201007-3201039 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000029 XLOC_000029 - chr1:3201077-3201481 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000030 XLOC_000030 - chr1:3201596-3201666 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000031 XLOC_000031 - chr1:3201672-3201699 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000032 XLOC_000032 - chr1:3201725-3201809 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000033 XLOC_000033 Xkr4 chr1:3211521-3211561 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000034 XLOC_000034 Xkr4 chr1:3212213-3212292 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000035 XLOC_000035 Xkr4 chr1:3212367-3212439 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000036 XLOC_000036 Xkr4 chr1:3212717-3212801 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000037 XLOC_000037 Xkr4 chr1:3213095-3213242 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000038 XLOC_000038 Xkr4 chr1:3240606-3240633 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000039 XLOC_000039 Xkr4 chr1:3242479-3242512 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000040 XLOC_000040 Xkr4 chr1:3242633-3242923 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000041 XLOC_000041 Xkr4 chr1:3242924-3243005 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000042 XLOC_000042 Xkr4 chr1:3243018-3243079 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000043 XLOC_000043 Xkr4 chr1:3243108-3243154 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000044 XLOC_000044 Xkr4 chr1:3243347-3243401 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000045 XLOC_000045 Xkr4 chr1:3254079-3254106 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000046 XLOC_000046 Xkr4 chr1:3256974-3257011 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000047 XLOC_000047 Xkr4 chr1:3277155-3277182 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000048 XLOC_000048 Xkr4 chr1:3277190-3277218 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000049 XLOC_000049 Xkr4 chr1:3277913-3278390 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000050 XLOC_000050 Xkr4 chr1:3280117-3280144 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000051 XLOC_000051 Xkr4 chr1:3280498-3280525 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000052 XLOC_000052 Xkr4 chr1:3280686-3280741 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000053 XLOC_000053 Xkr4 chr1:3282504-3282531 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000054 XLOC_000054 Xkr4 chr1:3282650-3282677 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000055 XLOC_000055 Xkr4 chr1:3282760-3282832 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000056 XLOC_000056 Xkr4 chr1:3284966-3284993 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000057 XLOC_000057 Xkr4 chr1:3290488-3290553 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000058 XLOC_000058 Xkr4 chr1:3290798-3290859 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000059 XLOC_000059 Xkr4 chr1:3290919-3291273 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000060 XLOC_000060 Xkr4 chr1:3299443-3299664 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000061 XLOC_000061 Xkr4 chr1:3299691-3299733 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000062 XLOC_000062 Xkr4 chr1:3300051-3300078 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000063 XLOC_000063 Xkr4 chr1:3307748-3307775 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000064 XLOC_000064 Xkr4 chr1:3318620-3318647 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000065 XLOC_000065 Xkr4 chr1:3318999-3319051 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000066 XLOC_000066 Xkr4 chr1:3330527-3330554 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000067 XLOC_000067 Xkr4 chr1:3351240-3351311 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000068 XLOC_000068 Xkr4 chr1:3355887-3356119 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000069 XLOC_000069 Xkr4 chr1:3356180-3356225 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000070 XLOC_000070 Xkr4 chr1:3363076-3363176 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000071 XLOC_000071 Xkr4 chr1:3363214-3363278 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000072 XLOC_000072 Xkr4 chr1:3363387-3363446 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000073 XLOC_000073 Xkr4 chr1:3363753-3363849 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000074 XLOC_000074 Xkr4 chr1:3364871-3364919 q1 q2 NOTEST 0 0 0 0 1 1 no
+XLOC_000075 XLOC_000075 Xkr4 chr1:3367135-3367162 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000076 XLOC_000076 Xkr4 chr1:3367210-3367237 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000077 XLOC_000077 Xkr4 chr1:3367333-3367382 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000078 XLOC_000078 Xkr4 chr1:3369580-3369607 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000079 XLOC_000079 Xkr4 chr1:3375001-3375028 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000080 XLOC_000080 Xkr4 chr1:3377211-3377262 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000081 XLOC_000081 Xkr4 chr1:3379888-3379915 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000082 XLOC_000082 Xkr4 chr1:3386739-3386836 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000083 XLOC_000083 Xkr4 chr1:3391325-3391352 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000084 XLOC_000084 Xkr4 chr1:3435841-3435880 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000085 XLOC_000085 Xkr4 chr1:3447761-3447788 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000086 XLOC_000086 Xkr4 chr1:3450906-3450965 q1 q2 LOWDATA 0 0 0 0 0 1 no
+XLOC_000087 XLOC_000087 Xkr4 chr1:3451051-3451109 q1 q2 LOWDATA 0 0 0 0 0 1 no
diff -r 199767a1714b27a9a5c3f2376ad0133a70cd7c51 -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff test-data/cuffdiff_out7.txt
--- a/test-data/cuffdiff_out7.txt
+++ b/test-data/cuffdiff_out7.txt
@@ -1,15 +1,15 @@
tracking_id class_code nearest_ref_id gene_id gene_short_name tss_id locus length coverage q1_FPKM q1_conf_lo q1_conf_hi q1_status q2_FPKM q2_conf_lo q2_conf_hi q2_status
-TSS1 - - XLOC_000001 Xkr4 TSS1 chr1:3204754-3204833 - - 0 0 0 OK 8.3103e+06 0 2.00628e+07 OK
-TSS10 - - XLOC_000008 - TSS10 chr1:3190858-3191434 - - 474092 138279 809906 OK 369273 113039 625507 OK
-TSS11 - - XLOC_000009 - TSS11 chr1:3191512-3192077 - - 502845 149756 855934 OK 739818 487934 991702 OK
-TSS13 - - XLOC_000010 - TSS13 chr1:3192250-3192336 - - 3.994e+06 0 1.1982e+07 OK 2.93812e+06 0 8.81435e+06 OK
-TSS14 - - XLOC_000011 - TSS14 chr1:3192441-3192494 - - 0 0 0 OK 8.52143e+07 0 1.83611e+08 OK
-TSS15 - - XLOC_000012 - TSS15 chr1:3192550-3192629 - - 0 0 0 OK 4.15515e+06 0 1.24654e+07 OK
+TSS1 - - XLOC_000001 Xkr4 TSS1 chr1:3204754-3204833 - - 0 0 0 OK 5.42247e+06 0 1.83844e+07 OK
+TSS10 - - XLOC_000008 - TSS10 chr1:3190858-3191434 - - 227564 0 483427 OK 240951 0 505030 OK
+TSS11 - - XLOC_000009 - TSS11 chr1:3191512-3192077 - - 241366 0 509259 OK 482731 109420 856042 OK
+TSS13 - - XLOC_000010 - TSS13 chr1:3192250-3192336 - - 1.91712e+06 0 7.66198e+06 OK 1.91712e+06 0 7.66198e+06 OK
+TSS14 - - XLOC_000011 - TSS14 chr1:3192441-3192494 - - 0 0 0 OK 5.56023e+07 0 1.86077e+08 OK
+TSS15 - - XLOC_000012 - TSS15 chr1:3192550-3192629 - - 0 0 0 OK 2.71123e+06 0 1.08357e+07 OK
TSS16 - - XLOC_000013 - TSS16 chr1:3192649-3192676 - - 0 0 0 OK 0 0 0 OK
TSS17 - - XLOC_000014 - TSS17 chr1:3192731-3192811 - - 0 0 0 OK 0 0 0 OK
-TSS18 - - XLOC_000015 - TSS18 chr1:3192940-3193042 - - 0 0 0 OK 6.02976e+06 0 1.34147e+07 OK
-TSS19 - - XLOC_000016 - TSS19 chr1:3194185-3194226 - - 0 0 0 OK 2.1403e+08 0 6.42089e+08 OK
-TSS2 - - XLOC_000002 - TSS2 chr1:3111449-3111490 - - 0 0 0 OK 2.1403e+08 0 6.42089e+08 OK
+TSS18 - - XLOC_000015 - TSS18 chr1:3192940-3193042 - - 0 0 0 OK 3.93442e+06 0 1.25021e+07 OK
+TSS19 - - XLOC_000016 - TSS19 chr1:3194185-3194226 - - 0 0 0 OK 1.39654e+08 0 5.58144e+08 OK
+TSS2 - - XLOC_000002 - TSS2 chr1:3111449-3111490 - - 0 0 0 OK 1.39654e+08 0 5.58144e+08 OK
TSS20 - - XLOC_000017 - TSS20 chr1:3194302-3194329 - - 0 0 0 OK 0 0 0 OK
TSS21 - - XLOC_000018 - TSS21 chr1:3194706-3194733 - - 0 0 0 OK 0 0 0 OK
TSS22 - - XLOC_000019 - TSS22 chr1:3195083-3195110 - - 0 0 0 OK 0 0 0 OK
@@ -18,62 +18,62 @@
TSS25 - - XLOC_000022 - TSS25 chr1:3197246-3197273 - - 0 0 0 OK 0 0 0 OK
TSS26 - - XLOC_000023 - TSS26 chr1:3197346-3197373 - - 0 0 0 OK 0 0 0 OK
TSS27 - - XLOC_000024 - TSS27 chr1:3197425-3197452 - - 0 0 0 OK 0 0 0 OK
-TSS28 - - XLOC_000025 - TSS28 chr1:3200022-3200191 - - 959058 0 2.06648e+06 OK 705514 0 1.52017e+06 OK
+TSS28 - - XLOC_000025 - TSS28 chr1:3200022-3200191 - - 460348 0 1.54058e+06 OK 460348 0 1.54058e+06 OK
TSS29 - - XLOC_000026 - TSS29 chr1:3200325-3200352 - - 0 0 0 OK 0 0 0 OK
TSS3 - - XLOC_000003 - TSS3 chr1:3111545-3111576 - - 0 0 0 OK 0 0 0 OK
TSS30 - - XLOC_000027 - TSS30 chr1:3200430-3200457 - - 0 0 0 OK 0 0 0 OK
TSS31 - - XLOC_000028 - TSS31 chr1:3201007-3201039 - - 0 0 0 OK 0 0 0 OK
-TSS32 - - XLOC_000029 - TSS32 chr1:3201077-3201481 - - 77513.9 0 167019 OK 285108 21736.5 548480 OK
-TSS33 - - XLOC_000030 - TSS33 chr1:3201596-3201666 - - 1.89853e+07 0 4.58345e+07 OK 0 0 0 OK
+TSS32 - - XLOC_000029 - TSS32 chr1:3201077-3201481 - - 37206.6 0 124514 OK 186033 0 476912 OK
+TSS33 - - XLOC_000030 - TSS33 chr1:3201596-3201666 - - 9.11292e+06 0 3.08965e+07 OK 0 0 0 OK
TSS34 - - XLOC_000031 - TSS34 chr1:3201672-3201699 - - 0 0 0 OK 0 0 0 OK
-TSS35 - - XLOC_000032 - TSS35 chr1:3201725-3201809 - - 1.75659e+07 0 3.90796e+07 OK 0 0 0 OK
+TSS35 - - XLOC_000032 - TSS35 chr1:3201725-3201809 - - 8.43162e+06 0 2.67925e+07 OK 0 0 0 OK
TSS36 - - XLOC_000033 Xkr4 TSS36 chr1:3211521-3211561 - - 0 0 0 OK 0 0 0 OK
-TSS37 - - XLOC_000034 Xkr4 TSS37 chr1:3212213-3212292 - - 0 0 0 OK 8.3103e+06 0 2.00628e+07 OK
-TSS38 - - XLOC_000035 Xkr4 TSS38 chr1:3212367-3212439 - - 0 0 0 OK 2.4671e+07 0 5.48867e+07 OK
-TSS39 - - XLOC_000036 Xkr4 TSS39 chr1:3212717-3212801 - - 4.39147e+06 0 1.31744e+07 OK 0 0 0 OK
+TSS37 - - XLOC_000034 Xkr4 TSS37 chr1:3212213-3212292 - - 0 0 0 OK 5.42247e+06 0 1.83844e+07 OK
+TSS38 - - XLOC_000035 Xkr4 TSS38 chr1:3212367-3212439 - - 0 0 0 OK 1.60978e+07 0 5.11527e+07 OK
+TSS39 - - XLOC_000036 Xkr4 TSS39 chr1:3212717-3212801 - - 2.10791e+06 0 8.42447e+06 OK 0 0 0 OK
TSS4 - - XLOC_000004 - TSS4 chr1:3174765-3174792 - - 0 0 0 OK 0 0 0 OK
-TSS40 - - XLOC_000037 Xkr4 TSS40 chr1:3213095-3213242 - - 8.89174e+06 0 2.05036e+07 OK 1.82908e+06 0 5.48723e+06 OK
+TSS40 - - XLOC_000037 Xkr4 TSS40 chr1:3213095-3213242 - - 2.84535e+06 0 1.07397e+07 OK 1.19347e+06 0 5.96736e+06 OK
TSS41 - - XLOC_000038 Xkr4 TSS41 chr1:3240606-3240633 - - 0 0 0 OK 0 0 0 OK
TSS42 - - XLOC_000039 Xkr4 TSS42 chr1:3242479-3242512 - - 0 0 0 OK 0 0 0 OK
-TSS43 - - XLOC_000040 Xkr4 TSS43 chr1:3242633-3242923 - - 56312.4 0 168937 OK 372827 0 761430 OK
+TSS43 - - XLOC_000040 Xkr4 TSS43 chr1:3242633-3242923 - - 27029.9 0 108028 OK 243269 0 681799 OK
TSS44 - - XLOC_000041 Xkr4 TSS44 chr1:3242924-3243005 - - 0 0 0 OK 0 0 0 OK
-TSS45 - - XLOC_000042 Xkr4 TSS45 chr1:3243018-3243079 - - 0 0 0 OK 2.66226e+07 0 6.42725e+07 OK
-TSS46 - - XLOC_000043 Xkr4 TSS46 chr1:3243108-3243154 - - 9.99919e+07 0 2.99976e+08 OK 0 0 0 OK
-TSS47 - - XLOC_000044 Xkr4 TSS47 chr1:3243347-3243401 - - 0 0 0 OK 5.0951e+07 0 1.23007e+08 OK
+TSS45 - - XLOC_000042 Xkr4 TSS45 chr1:3243018-3243079 - - 0 0 0 OK 1.73712e+07 0 5.88955e+07 OK
+TSS46 - - XLOC_000043 Xkr4 TSS46 chr1:3243108-3243154 - - 4.79961e+07 0 1.91822e+08 OK 0 0 0 OK
+TSS47 - - XLOC_000044 Xkr4 TSS47 chr1:3243347-3243401 - - 0 0 0 OK 3.32455e+07 0 1.12716e+08 OK
TSS48 - - XLOC_000045 Xkr4 TSS48 chr1:3254079-3254106 - - 0 0 0 OK 0 0 0 OK
-TSS49 - - XLOC_000046 Xkr4 TSS49 chr1:3256974-3257011 - - 0 0 0 OK 2.06814e+09 0 4.99293e+09 OK
+TSS49 - - XLOC_000046 Xkr4 TSS49 chr1:3256974-3257011 - - 0 0 0 OK 1.34946e+09 0 4.57522e+09 OK
TSS5 - - XLOC_000005 - TSS5 chr1:3187401-3187428 - - 0 0 0 OK 0 0 0 OK
TSS50 - - XLOC_000047 Xkr4 TSS50 chr1:3277155-3277182 - - 0 0 0 OK 0 0 0 OK
TSS51 - - XLOC_000048 Xkr4 TSS51 chr1:3277190-3277218 - - 0 0 0 OK 0 0 0 OK
-TSS52 - - XLOC_000049 Xkr4 TSS52 chr1:3277913-3278390 - - 265614 16793 514436 OK 41870.3 0 90217.9 OK
+TSS52 - - XLOC_000049 Xkr4 TSS52 chr1:3277913-3278390 - - 127495 0 331348 OK 27320.3 0 91429.2 OK
TSS54 - - XLOC_000050 Xkr4 TSS54 chr1:3280117-3280144 - - 0 0 0 OK 0 0 0 OK
TSS55 - - XLOC_000051 Xkr4 TSS55 chr1:3280498-3280525 - - 0 0 0 OK 0 0 0 OK
-TSS56 - - XLOC_000052 Xkr4 TSS56 chr1:3280686-3280741 - - 0 0 0 OK 2.29576e+07 0 6.88728e+07 OK
+TSS56 - - XLOC_000052 Xkr4 TSS56 chr1:3280686-3280741 - - 0 0 0 OK 1.49798e+07 0 5.98686e+07 OK
TSS57 - - XLOC_000053 Xkr4 TSS57 chr1:3282504-3282531 - - 0 0 0 OK 0 0 0 OK
TSS58 - - XLOC_000054 Xkr4 TSS58 chr1:3282650-3282677 - - 0 0 0 OK 0 0 0 OK
TSS59 - - XLOC_000055 Xkr4 TSS59 chr1:3282760-3282832 - - 0 0 0 OK 0 0 0 OK
TSS6 - - XLOC_000006 - TSS6 chr1:3188521-3188548 - - 0 0 0 OK 0 0 0 OK
TSS60 - - XLOC_000056 Xkr4 TSS60 chr1:3284966-3284993 - - 0 0 0 OK 0 0 0 OK
-TSS61 - - XLOC_000057 Xkr4 TSS61 chr1:3290488-3290553 - - 0 0 0 OK 9.79535e+06 0 2.9386e+07 OK
-TSS62 - - XLOC_000058 Xkr4 TSS62 chr1:3290798-3290859 - - 1.8095e+07 0 5.4285e+07 OK 0 0 0 OK
-TSS63 - - XLOC_000059 Xkr4 TSS63 chr1:3290919-3291273 - - 342218 0 691214 OK 75524 0 162732 OK
-TSS65 - - XLOC_000060 Xkr4 TSS65 chr1:3299443-3299664 - - 937403 0 1.99795e+06 OK 137917 0 413751 OK
+TSS61 - - XLOC_000057 Xkr4 TSS61 chr1:3290488-3290553 - - 0 0 0 OK 6.39146e+06 0 2.55442e+07 OK
+TSS62 - - XLOC_000058 Xkr4 TSS62 chr1:3290798-3290859 - - 8.68561e+06 0 3.4713e+07 OK 0 0 0 OK
+TSS63 - - XLOC_000059 Xkr4 TSS63 chr1:3290919-3291273 - - 164265 0 453103 OK 49279.4 0 164917 OK
+TSS65 - - XLOC_000060 Xkr4 TSS65 chr1:3299443-3299664 - - 449954 0 1.56567e+06 OK 89990.7 0 449954 OK
TSS66 - - XLOC_000060 Xkr4 TSS66 chr1:3299443-3299664 - - 0 0 0 OK 0 0 0 OK
TSS67 - - XLOC_000061 Xkr4 TSS67 chr1:3299691-3299733 - - 0 0 0 OK 0 0 0 OK
TSS68 - - XLOC_000062 Xkr4 TSS68 chr1:3300051-3300078 - - 0 0 0 OK 0 0 0 OK
TSS69 - - XLOC_000063 Xkr4 TSS69 chr1:3307748-3307775 - - 0 0 0 OK 0 0 0 OK
-TSS7 - - XLOC_000007 - TSS7 chr1:3189810-3190789 - - 415851 231920 599782 OK 458870 363705 554035 OK
+TSS7 - - XLOC_000007 - TSS7 chr1:3189810-3190789 - - 199608 33901.5 365315 OK 299412 183619 415206 OK
TSS70 - - XLOC_000064 Xkr4 TSS70 chr1:3318620-3318647 - - 0 0 0 OK 0 0 0 OK
TSS71 - - XLOC_000065 Xkr4 TSS71 chr1:3318999-3319051 - - 0 0 0 OK 0 0 0 OK
TSS72 - - XLOC_000066 Xkr4 TSS72 chr1:3330527-3330554 - - 0 0 0 OK 0 0 0 OK
-TSS73 - - XLOC_000067 Xkr4 TSS73 chr1:3351240-3351311 - - 8.91489e+06 0 2.67447e+07 OK 0 0 0 OK
-TSS74 - - XLOC_000068 Xkr4 TSS74 chr1:3355887-3356119 - - 585828 0 1.30332e+06 OK 0 0 0 OK
-TSS75 - - XLOC_000069 Xkr4 TSS75 chr1:3356180-3356225 - - 1.19208e+08 0 3.57623e+08 OK 0 0 0 OK
-TSS76 - - XLOC_000070 Xkr4 TSS76 chr1:3363076-3363176 - - 4.42166e+06 0 1.06748e+07 OK 0 0 0 OK
+TSS73 - - XLOC_000067 Xkr4 TSS73 chr1:3351240-3351311 - - 4.27915e+06 0 1.71021e+07 OK 0 0 0 OK
+TSS74 - - XLOC_000068 Xkr4 TSS74 chr1:3355887-3356119 - - 281197 0 1.06014e+06 OK 0 0 0 OK
+TSS75 - - XLOC_000069 Xkr4 TSS75 chr1:3356180-3356225 - - 5.72196e+07 0 2.28684e+08 OK 0 0 0 OK
+TSS76 - - XLOC_000070 Xkr4 TSS76 chr1:3363076-3363176 - - 2.1224e+06 0 7.19579e+06 OK 0 0 0 OK
TSS77 - - XLOC_000071 Xkr4 TSS77 chr1:3363214-3363278 - - 0 0 0 OK 0 0 0 OK
-TSS78 - - XLOC_000072 Xkr4 TSS78 chr1:3363387-3363446 - - 6.42536e+07 0 1.38447e+08 OK 0 0 0 OK
+TSS78 - - XLOC_000072 Xkr4 TSS78 chr1:3363387-3363446 - - 3.08417e+07 0 1.03214e+08 OK 0 0 0 OK
TSS79 - - XLOC_000073 Xkr4 TSS79 chr1:3363753-3363849 - - 0 0 0 OK 0 0 0 OK
-TSS80 - - XLOC_000074 Xkr4 TSS80 chr1:3364871-3364919 - - 7.29939e+07 0 2.18982e+08 OK 0 0 0 OK
+TSS80 - - XLOC_000074 Xkr4 TSS80 chr1:3364871-3364919 - - 3.50371e+07 0 1.40029e+08 OK 0 0 0 OK
TSS81 - - XLOC_000075 Xkr4 TSS81 chr1:3367135-3367162 - - 0 0 0 OK 0 0 0 OK
TSS82 - - XLOC_000076 Xkr4 TSS82 chr1:3367210-3367237 - - 0 0 0 OK 0 0 0 OK
TSS83 - - XLOC_000077 Xkr4 TSS83 chr1:3367333-3367382 - - 0 0 0 OK 0 0 0 OK
diff -r 199767a1714b27a9a5c3f2376ad0133a70cd7c51 -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff test-data/cuffdiff_out9.txt
--- a/test-data/cuffdiff_out9.txt
+++ b/test-data/cuffdiff_out9.txt
@@ -1,89 +1,89 @@
test_id gene_id gene locus sample_1 sample_2 status value_1 value_2 sqrt(JS) test_stat p_value q_value significant
-TSS1 XLOC_000001 Xkr4 chr1:3204754-3204833 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS10 XLOC_000008 - chr1:3190858-3191434 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS11 XLOC_000009 - chr1:3191512-3192077 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS13 XLOC_000010 - chr1:3192250-3192336 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS14 XLOC_000011 - chr1:3192441-3192494 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS15 XLOC_000012 - chr1:3192550-3192629 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS16 XLOC_000013 - chr1:3192649-3192676 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS17 XLOC_000014 - chr1:3192731-3192811 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS18 XLOC_000015 - chr1:3192940-3193042 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS19 XLOC_000016 - chr1:3194185-3194226 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS2 XLOC_000002 - chr1:3111449-3111490 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS20 XLOC_000017 - chr1:3194302-3194329 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS21 XLOC_000018 - chr1:3194706-3194733 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS22 XLOC_000019 - chr1:3195083-3195110 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS23 XLOC_000020 - chr1:3195450-3195477 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS24 XLOC_000021 - chr1:3197089-3197116 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS25 XLOC_000022 - chr1:3197246-3197273 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS26 XLOC_000023 - chr1:3197346-3197373 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS27 XLOC_000024 - chr1:3197425-3197452 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS28 XLOC_000025 - chr1:3200022-3200191 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS29 XLOC_000026 - chr1:3200325-3200352 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS3 XLOC_000003 - chr1:3111545-3111576 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS30 XLOC_000027 - chr1:3200430-3200457 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS31 XLOC_000028 - chr1:3201007-3201039 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS32 XLOC_000029 - chr1:3201077-3201481 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS33 XLOC_000030 - chr1:3201596-3201666 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS34 XLOC_000031 - chr1:3201672-3201699 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS35 XLOC_000032 - chr1:3201725-3201809 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS36 XLOC_000033 Xkr4 chr1:3211521-3211561 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS37 XLOC_000034 Xkr4 chr1:3212213-3212292 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS38 XLOC_000035 Xkr4 chr1:3212367-3212439 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS39 XLOC_000036 Xkr4 chr1:3212717-3212801 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS4 XLOC_000004 - chr1:3174765-3174792 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS40 XLOC_000037 Xkr4 chr1:3213095-3213242 q1 q2 OK 0 0 0.249945 0.143447 0.135175 0.135175 no
-TSS41 XLOC_000038 Xkr4 chr1:3240606-3240633 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS42 XLOC_000039 Xkr4 chr1:3242479-3242512 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS43 XLOC_000040 Xkr4 chr1:3242633-3242923 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS44 XLOC_000041 Xkr4 chr1:3242924-3243005 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS45 XLOC_000042 Xkr4 chr1:3243018-3243079 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS46 XLOC_000043 Xkr4 chr1:3243108-3243154 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS47 XLOC_000044 Xkr4 chr1:3243347-3243401 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS48 XLOC_000045 Xkr4 chr1:3254079-3254106 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS49 XLOC_000046 Xkr4 chr1:3256974-3257011 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS5 XLOC_000005 - chr1:3187401-3187428 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS50 XLOC_000047 Xkr4 chr1:3277155-3277182 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS51 XLOC_000048 Xkr4 chr1:3277190-3277218 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS52 XLOC_000049 Xkr4 chr1:3277913-3278390 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS54 XLOC_000050 Xkr4 chr1:3280117-3280144 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS55 XLOC_000051 Xkr4 chr1:3280498-3280525 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS56 XLOC_000052 Xkr4 chr1:3280686-3280741 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS57 XLOC_000053 Xkr4 chr1:3282504-3282531 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS58 XLOC_000054 Xkr4 chr1:3282650-3282677 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS59 XLOC_000055 Xkr4 chr1:3282760-3282832 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS6 XLOC_000006 - chr1:3188521-3188548 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS60 XLOC_000056 Xkr4 chr1:3284966-3284993 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS61 XLOC_000057 Xkr4 chr1:3290488-3290553 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS62 XLOC_000058 Xkr4 chr1:3290798-3290859 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS63 XLOC_000059 Xkr4 chr1:3290919-3291273 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS65 XLOC_000060 Xkr4 chr1:3299443-3299664 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS66 XLOC_000060 Xkr4 chr1:3299443-3299664 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS67 XLOC_000061 Xkr4 chr1:3299691-3299733 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS68 XLOC_000062 Xkr4 chr1:3300051-3300078 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS69 XLOC_000063 Xkr4 chr1:3307748-3307775 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS7 XLOC_000007 - chr1:3189810-3190789 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS70 XLOC_000064 Xkr4 chr1:3318620-3318647 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS71 XLOC_000065 Xkr4 chr1:3318999-3319051 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS72 XLOC_000066 Xkr4 chr1:3330527-3330554 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS73 XLOC_000067 Xkr4 chr1:3351240-3351311 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS74 XLOC_000068 Xkr4 chr1:3355887-3356119 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS75 XLOC_000069 Xkr4 chr1:3356180-3356225 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS76 XLOC_000070 Xkr4 chr1:3363076-3363176 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS77 XLOC_000071 Xkr4 chr1:3363214-3363278 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS78 XLOC_000072 Xkr4 chr1:3363387-3363446 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS79 XLOC_000073 Xkr4 chr1:3363753-3363849 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS80 XLOC_000074 Xkr4 chr1:3364871-3364919 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS81 XLOC_000075 Xkr4 chr1:3367135-3367162 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS82 XLOC_000076 Xkr4 chr1:3367210-3367237 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS83 XLOC_000077 Xkr4 chr1:3367333-3367382 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS84 XLOC_000078 Xkr4 chr1:3369580-3369607 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS85 XLOC_000079 Xkr4 chr1:3375001-3375028 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS86 XLOC_000080 Xkr4 chr1:3377211-3377262 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS87 XLOC_000081 Xkr4 chr1:3379888-3379915 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS88 XLOC_000082 Xkr4 chr1:3386739-3386836 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS89 XLOC_000083 Xkr4 chr1:3391325-3391352 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS90 XLOC_000084 Xkr4 chr1:3435841-3435880 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS91 XLOC_000085 Xkr4 chr1:3447761-3447788 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS92 XLOC_000086 Xkr4 chr1:3450906-3450965 q1 q2 NOTEST 0 0 0 0 0 1 no
-TSS93 XLOC_000087 Xkr4 chr1:3451051-3451109 q1 q2 NOTEST 0 0 0 0 0 1 no
+TSS1 XLOC_000001 Xkr4 chr1:3204754-3204833 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS10 XLOC_000008 - chr1:3190858-3191434 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS11 XLOC_000009 - chr1:3191512-3192077 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS13 XLOC_000010 - chr1:3192250-3192336 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS14 XLOC_000011 - chr1:3192441-3192494 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS15 XLOC_000012 - chr1:3192550-3192629 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS16 XLOC_000013 - chr1:3192649-3192676 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS17 XLOC_000014 - chr1:3192731-3192811 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS18 XLOC_000015 - chr1:3192940-3193042 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS19 XLOC_000016 - chr1:3194185-3194226 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS2 XLOC_000002 - chr1:3111449-3111490 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS20 XLOC_000017 - chr1:3194302-3194329 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS21 XLOC_000018 - chr1:3194706-3194733 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS22 XLOC_000019 - chr1:3195083-3195110 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS23 XLOC_000020 - chr1:3195450-3195477 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS24 XLOC_000021 - chr1:3197089-3197116 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS25 XLOC_000022 - chr1:3197246-3197273 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS26 XLOC_000023 - chr1:3197346-3197373 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS27 XLOC_000024 - chr1:3197425-3197452 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS28 XLOC_000025 - chr1:3200022-3200191 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS29 XLOC_000026 - chr1:3200325-3200352 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS3 XLOC_000003 - chr1:3111545-3111576 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS30 XLOC_000027 - chr1:3200430-3200457 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS31 XLOC_000028 - chr1:3201007-3201039 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS32 XLOC_000029 - chr1:3201077-3201481 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS33 XLOC_000030 - chr1:3201596-3201666 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS34 XLOC_000031 - chr1:3201672-3201699 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS35 XLOC_000032 - chr1:3201725-3201809 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS36 XLOC_000033 Xkr4 chr1:3211521-3211561 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS37 XLOC_000034 Xkr4 chr1:3212213-3212292 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS38 XLOC_000035 Xkr4 chr1:3212367-3212439 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS39 XLOC_000036 Xkr4 chr1:3212717-3212801 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS4 XLOC_000004 - chr1:3174765-3174792 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS40 XLOC_000037 Xkr4 chr1:3213095-3213242 q1 q2 NOTEST 0 0 0.249947 0 0.557805 1 no
+TSS41 XLOC_000038 Xkr4 chr1:3240606-3240633 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS42 XLOC_000039 Xkr4 chr1:3242479-3242512 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS43 XLOC_000040 Xkr4 chr1:3242633-3242923 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS44 XLOC_000041 Xkr4 chr1:3242924-3243005 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS45 XLOC_000042 Xkr4 chr1:3243018-3243079 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS46 XLOC_000043 Xkr4 chr1:3243108-3243154 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS47 XLOC_000044 Xkr4 chr1:3243347-3243401 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS48 XLOC_000045 Xkr4 chr1:3254079-3254106 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS49 XLOC_000046 Xkr4 chr1:3256974-3257011 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS5 XLOC_000005 - chr1:3187401-3187428 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS50 XLOC_000047 Xkr4 chr1:3277155-3277182 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS51 XLOC_000048 Xkr4 chr1:3277190-3277218 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS52 XLOC_000049 Xkr4 chr1:3277913-3278390 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS54 XLOC_000050 Xkr4 chr1:3280117-3280144 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS55 XLOC_000051 Xkr4 chr1:3280498-3280525 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS56 XLOC_000052 Xkr4 chr1:3280686-3280741 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS57 XLOC_000053 Xkr4 chr1:3282504-3282531 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS58 XLOC_000054 Xkr4 chr1:3282650-3282677 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS59 XLOC_000055 Xkr4 chr1:3282760-3282832 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS6 XLOC_000006 - chr1:3188521-3188548 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS60 XLOC_000056 Xkr4 chr1:3284966-3284993 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS61 XLOC_000057 Xkr4 chr1:3290488-3290553 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS62 XLOC_000058 Xkr4 chr1:3290798-3290859 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS63 XLOC_000059 Xkr4 chr1:3290919-3291273 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS65 XLOC_000060 Xkr4 chr1:3299443-3299664 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS66 XLOC_000060 Xkr4 chr1:3299443-3299664 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS67 XLOC_000061 Xkr4 chr1:3299691-3299733 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS68 XLOC_000062 Xkr4 chr1:3300051-3300078 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS69 XLOC_000063 Xkr4 chr1:3307748-3307775 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS7 XLOC_000007 - chr1:3189810-3190789 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS70 XLOC_000064 Xkr4 chr1:3318620-3318647 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS71 XLOC_000065 Xkr4 chr1:3318999-3319051 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS72 XLOC_000066 Xkr4 chr1:3330527-3330554 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS73 XLOC_000067 Xkr4 chr1:3351240-3351311 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS74 XLOC_000068 Xkr4 chr1:3355887-3356119 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS75 XLOC_000069 Xkr4 chr1:3356180-3356225 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS76 XLOC_000070 Xkr4 chr1:3363076-3363176 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS77 XLOC_000071 Xkr4 chr1:3363214-3363278 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS78 XLOC_000072 Xkr4 chr1:3363387-3363446 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS79 XLOC_000073 Xkr4 chr1:3363753-3363849 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS80 XLOC_000074 Xkr4 chr1:3364871-3364919 q1 q2 NOTEST 0 0 0 0 1 1 no
+TSS81 XLOC_000075 Xkr4 chr1:3367135-3367162 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS82 XLOC_000076 Xkr4 chr1:3367210-3367237 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS83 XLOC_000077 Xkr4 chr1:3367333-3367382 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS84 XLOC_000078 Xkr4 chr1:3369580-3369607 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS85 XLOC_000079 Xkr4 chr1:3375001-3375028 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS86 XLOC_000080 Xkr4 chr1:3377211-3377262 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS87 XLOC_000081 Xkr4 chr1:3379888-3379915 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS88 XLOC_000082 Xkr4 chr1:3386739-3386836 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS89 XLOC_000083 Xkr4 chr1:3391325-3391352 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS90 XLOC_000084 Xkr4 chr1:3435841-3435880 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS91 XLOC_000085 Xkr4 chr1:3447761-3447788 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS92 XLOC_000086 Xkr4 chr1:3450906-3450965 q1 q2 LOWDATA 0 0 0 0 0 1 no
+TSS93 XLOC_000087 Xkr4 chr1:3451051-3451109 q1 q2 LOWDATA 0 0 0 0 0 1 no
diff -r 199767a1714b27a9a5c3f2376ad0133a70cd7c51 -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff tools/ngs_rna/cuffdiff_wrapper.py
--- a/tools/ngs_rna/cuffdiff_wrapper.py
+++ b/tools/ngs_rna/cuffdiff_wrapper.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+# Wrapper supports Cuffdiff versions v1.3.0-v2.0
+
import optparse, os, shutil, subprocess, sys, tempfile
def group_callback( option, op_str, value, parser ):
@@ -59,6 +61,7 @@
where each end is 50bp, you should set -r to be 200. The default is 45bp.')
parser.add_option( '-c', '--min-alignment-count', dest='min_alignment_count', help='The minimum number of alignments in a locus for needed to conduct significance testing on changes in that locus observed between samples. If no testing is performed, changes in the locus are deemed not signficant, and the locus\' observed changes don\'t contribute to correction for multiple testing. The default is 1,000 fragment alignments (up to 2,000 paired reads).' )
parser.add_option( '--FDR', dest='FDR', help='The allowed false discovery rate. The default is 0.05.' )
+ parser.add_option( '-u', '--multi-read-correct', dest='multi_read_correct', action="store_true", help='Tells Cufflinks to do an initial estimation procedure to more accurately weight reads mapping to multiple locations in the genome')
# Advanced Options:
parser.add_option( '--num-importance-samples', dest='num_importance_samples', help='Sets the number of importance samples generated for each locus during abundance estimation. Default: 1000' )
@@ -153,6 +156,8 @@
cmd += ( " -c %i" % int ( options.min_alignment_count ) )
if options.FDR:
cmd += ( " --FDR %f" % float( options.FDR ) )
+ if options.multi_read_correct:
+ cmd += ( " -u" )
if options.num_importance_samples:
cmd += ( " --num-importance-samples %i" % int ( options.num_importance_samples ) )
if options.max_mle_iterations:
diff -r 199767a1714b27a9a5c3f2376ad0133a70cd7c51 -r 9c29a51ec0b1e21c2578250ceb00c37325cbe1ff tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -1,5 +1,5 @@
<tool id="cuffdiff" name="Cuffdiff" version="0.0.5">
- <!-- Wrapper supports Cuffdiff versions v1.0.0-v1.3.0 -->
+ <!-- Wrapper supports Cuffdiff versions v1.3.0-v2.0 --><description>find significant changes in transcript expression, splicing, and promoter use</description><requirements><requirement type="package">cufflinks</requirement>
@@ -33,7 +33,11 @@
-N
#end if
-
+ ## Multi-read correct?
+ #if str($multiread_correct) == "Yes":
+ -u
+ #end if
+
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
-b
@@ -89,11 +93,19 @@
</conditional><param name="fdr" type="float" value="0.05" label="False Discovery Rate" help="The allowed false discovery rate."/>
+
<param name="min_alignment_count" type="integer" value="10" label="Min Alignment Count" help="The minimum number of alignments in a locus for needed to conduct significance testing on changes in that locus observed between samples."/>
+
<param name="do_normalization" type="select" label="Perform quartile normalization" help="Removes top 25% of genes from FPKM denominator to improve accuracy of differential expression calls for low abundance transcripts."><option value="No">No</option><option value="Yes">Yes</option></param>
+
+ <param name="multiread_correct" type="select" label="Use multi-read correct" help="Tells Cufflinks to do an initial estimation procedure to more accurately weight reads mapping to multiple locations in the genome.">
+ <option value="No" selected="true">No</option>
+ <option value="Yes">Yes</option>
+ </param>
+
<conditional name="bias_correction"><param name="do_bias_correction" type="select" label="Perform Bias Correction" help="Bias detection and correction can significantly improve accuracy of transcript abundance estimates."><option value="No">No</option>
@@ -113,6 +125,7 @@
</when><when value="No"></when></conditional>
+
<conditional name="additional"><param name="sAdditional" type="select" label="Set Additional Parameters? (not recommended)"><option value="No">No</option>
@@ -154,6 +167,7 @@
<param name="min_alignment_count" value="0" /><param name="do_bias_correction" value="No" /><param name="do_normalization" value="No" />
+ <param name="multiread_correct" value="No"/><param name="sAdditional" value="No"/><!--
Line diffs are needed because cuffdiff does not produce deterministic output.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0