From 7183eabb52b3e899bc03e12a7d9d1d61da190978 Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Mon, 6 Jun 2011 09:08:59 -0400 Subject: [PATCH 001/473] Removed unspecified build validators from Cufflinks/compare/diff tools as these cause trouble when running tools on custom genomes. --- tools/ngs_rna/cuffcompare_wrapper.xml | 4 +--- tools/ngs_rna/cuffdiff_wrapper.xml | 4 +--- tools/ngs_rna/cufflinks_wrapper.xml | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/ngs_rna/cuffcompare_wrapper.xml b/tools/ngs_rna/cuffcompare_wrapper.xml index 42972199893..34dbfaff455 100644 --- a/tools/ngs_rna/cuffcompare_wrapper.xml +++ b/tools/ngs_rna/cuffcompare_wrapper.xml @@ -33,9 +33,7 @@ #end for - - - + diff --git a/tools/ngs_rna/cuffdiff_wrapper.xml b/tools/ngs_rna/cuffdiff_wrapper.xml index 68678863183..b15512cbd37 100644 --- a/tools/ngs_rna/cuffdiff_wrapper.xml +++ b/tools/ngs_rna/cuffdiff_wrapper.xml @@ -67,9 +67,7 @@ - - - + diff --git a/tools/ngs_rna/cufflinks_wrapper.xml b/tools/ngs_rna/cufflinks_wrapper.xml index 538d1a5c1a1..c0f0dc10ac1 100644 --- a/tools/ngs_rna/cufflinks_wrapper.xml +++ b/tools/ngs_rna/cufflinks_wrapper.xml @@ -41,9 +41,7 @@ #end if - - - + From 788c4b0f5d1ed3cd49a509c3b1ecb58ea17406d8 Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Mon, 6 Jun 2011 09:37:06 -0400 Subject: [PATCH 002/473] Disable update check in cuffdiff wrapper. --- tools/ngs_rna/cuffdiff_wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ngs_rna/cuffdiff_wrapper.py b/tools/ngs_rna/cuffdiff_wrapper.py index f263a8256c0..3cb33804642 100644 --- a/tools/ngs_rna/cuffdiff_wrapper.py +++ b/tools/ngs_rna/cuffdiff_wrapper.py @@ -101,7 +101,7 @@ def __main__(): try: tmp = tempfile.NamedTemporaryFile().name tmp_stdout = open( tmp, 'wb' ) - proc = subprocess.Popen( args='cuffdiff 2>&1', shell=True, stdout=tmp_stdout ) + proc = subprocess.Popen( args='cuffdiff --no-update-check 2>&1', shell=True, stdout=tmp_stdout ) tmp_stdout.close() returncode = proc.wait() stdout = None @@ -135,7 +135,7 @@ def __main__(): # Build command. # Base; always use quiet mode to avoid problems with storing log output. - cmd = "cuffdiff -q" + cmd = "cuffdiff --no-update-check -q" # Add options. if options.inner_dist_std_dev: From f057f6b79dcd5b8b9437f44e4b364797f30718f6 Mon Sep 17 00:00:00 2001 From: Kanwei Li Date: Mon, 6 Jun 2011 11:12:04 -0400 Subject: [PATCH 003/473] Restore error icon for color-blindness; needs further testing --- templates/root/history_common.mako | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/root/history_common.mako b/templates/root/history_common.mako index 83647b81b70..a55e3bb6634 100644 --- a/templates/root/history_common.mako +++ b/templates/root/history_common.mako @@ -69,6 +69,7 @@ %endif + ${hid}: ${data.display_name()} From dd90b520b38cd9c2c977b038d5b05c262195b777 Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Mon, 6 Jun 2011 11:17:31 -0400 Subject: [PATCH 004/473] Trackster: use error padding only when needed by placing error messages in div above tiles rather than in tiles. --- static/june_2007_style/blue/trackster.css | 1 + static/june_2007_style/trackster.css.tmpl | 7 +++ static/scripts/trackster.js | 68 ++++++++++++++--------- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/static/june_2007_style/blue/trackster.css b/static/june_2007_style/blue/trackster.css index 077866f050b..f4c265ed8a4 100644 --- a/static/june_2007_style/blue/trackster.css +++ b/static/june_2007_style/blue/trackster.css @@ -26,6 +26,7 @@ .label-track .track-content{background:white;} .track-tile{background:white;} .track-tile canvas{position:relative;z-index:100;border:solid white;border-width:2px 0px 0px 0px;} +.tile-message {border-bottom:solid 1px red;text-align:center;color:red;background-color:white;} .track.error .track-content{background-color:#ECB4AF;background-image:none;} .track.nodata .track-content{background-color:#eee;background-image:none;} .track.pending .track-content{background-color:white;background-image:none;} diff --git a/static/june_2007_style/trackster.css.tmpl b/static/june_2007_style/trackster.css.tmpl index 722804991b1..e17c9cb9e2a 100644 --- a/static/june_2007_style/trackster.css.tmpl +++ b/static/june_2007_style/trackster.css.tmpl @@ -167,6 +167,13 @@ border-width: 2px 0px 0px 0px; } +.tile-message { + border-bottom: solid 1px red; + text-align: center; + color: red; + background-color: white; +} + .track.error .track-content { background-color: #ECB4AF; background-image: none; diff --git a/static/scripts/trackster.js b/static/scripts/trackster.js index 7c02608131f..eb2a50377bc 100644 --- a/static/scripts/trackster.js +++ b/static/scripts/trackster.js @@ -172,7 +172,7 @@ var // height of individual features within tracks. Feature height, then, should always be less // than track height. CHAR_HEIGHT_PX = 9, // FIXME: font size may not be static - ERROR_PADDING = 10, // Padding at the top of tracks for error messages + ERROR_PADDING = 15, // Padding at the top of tracks for error messages SUMMARY_TREE_TOP_PADDING = CHAR_HEIGHT_PX + 2, // Maximum number of rows un a slotted track MAX_FEATURE_DEPTH = 100, @@ -1507,8 +1507,9 @@ var SummaryTreeTile = function(index, resolution, canvas, max_val) { this.max_val = max_val; }; -var FeatureTrackTile = function(index, resolution, canvas) { +var FeatureTrackTile = function(index, resolution, canvas, message) { Tile.call(this, index, resolution, canvas); + this.message = message; }; /** @@ -1993,6 +1994,27 @@ extend(TiledTrack.prototype, Track.prototype, { } } + // + // If some tiles have messages, set padding of tiles without messages + // so features and rows align. + // + var messages_to_show = false; + for (var tile_index = 0; tile_index < drawn_tiles.length; tile_index++) { + if (drawn_tiles[tile_index].message) { + messages_to_show = true; + break; + } + } + if (messages_to_show) { + for (var tile_index = 0; tile_index < drawn_tiles.length; tile_index++) { + tile = drawn_tiles[tile_index]; + if (!tile.message) { + // Need to align with other tile(s) that have message(s). + tile.canvas.css("padding-top", ERROR_PADDING); + } + } + } + // Store initial canvas in case we need to use it for overview /* This is completely broken, just saves the first tile it sees regardless of if it should be the overview @@ -2620,8 +2642,7 @@ extend(FeatureTrack.prototype, TiledTrack.prototype, { // Create painter, and canvas of sufficient size to contain all features // HACK: ref_seq will only be defined for ReadTracks, and only the ReadPainter accepts that argument var painter = new (this.painter)( filtered, tile_low, tile_high, this.prefs, mode, ref_seq ); - // FIXME: ERROR_PADDING is an ugly gap most of the time - var required_height = painter.get_required_height( slots_required ) + ERROR_PADDING; + var required_height = painter.get_required_height(slots_required); var canvas = this.view.canvas_manager.new_canvas(); canvas.width = width + left_offset; @@ -2634,31 +2655,26 @@ extend(FeatureTrack.prototype, TiledTrack.prototype, { ctx.textAlign = "right"; this.container_div.find(".yaxislabel").remove(); - // If there is a message, draw it on canvas so that it moves around with canvas, and make the border red - // to indicate region where message is applicable - if (result.message) { - ctx.fillStyle = "red"; - ctx.textAlign = "left"; - var old_base = ctx.textBaseline; - ctx.textBaseline = "top"; - ctx.fillRect(left_offset, 0, canvas.width - left_offset, 1); - ctx.fillText(result.message, left_offset, 2); - ctx.textBaseline = old_base; + if (result.data) { + // Set example feature. This is needed so that track can update its UI based on feature attributes. + this.example_feature = (result.data.length ? result.data[0] : undefined); - // If there's no data, return. - if (!result.data) { - return new Tile(tile_index, resolution, canvas, required_height); - } + // Draw features. + painter.draw(ctx, width, required_height, slots); + } + + // If tile has a message, create container div with both a message div and the canvas. + if (result.message) { + var container_div = $("
"); + var message_div = $("
").addClass("tile-message").text(result.message).css('width', canvas.width); + message_div.css({position: 'absolute', top: 0}); + $(canvas).css("top", 15); + container_div.append(message_div); + container_div.append(canvas); + canvas = container_div; } - // Set example feature. This is needed so that track can update its UI based on feature attributes. - this.example_feature = (result.data.length ? result.data[0] : undefined); - - // Draw features - ctx.translate(left_offset, ERROR_PADDING); - painter.draw(ctx, width, required_height, slots); - - return new FeatureTrackTile(tile_index, resolution, canvas); + return new FeatureTrackTile(tile_index, resolution, canvas, result.message); } }); From ebd9ecfab1abac4f5df46f67e3da62c870f3c662 Mon Sep 17 00:00:00 2001 From: Kanwei Li Date: Mon, 6 Jun 2011 13:17:18 -0400 Subject: [PATCH 005/473] trackster: Fix VCF data provider --- lib/galaxy/visualization/tracks/data_providers.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/visualization/tracks/data_providers.py b/lib/galaxy/visualization/tracks/data_providers.py index 2df14d9cfe4..b157fa4b132 100644 --- a/lib/galaxy/visualization/tracks/data_providers.py +++ b/lib/galaxy/visualization/tracks/data_providers.py @@ -607,12 +607,12 @@ class BedDataProvider( TabixDataProvider ): out.write( line ) out.close() -class VcfDataProvider( TracksDataProvider ): +class VcfDataProvider( TabixDataProvider ): """ VCF data provider for the Galaxy track browser. Payload format: - [ uid (offset), start, end, ID, reference base(s), alternate base(s), quality score] + [ uid (offset), start, end, ID, reference base(s), alternate base(s), quality score ] """ col_name_data_attr_mapping = { 'Qual' : { 'index': 6 , 'name' : 'Qual' } } @@ -622,21 +622,20 @@ class VcfDataProvider( TracksDataProvider ): count = 0 message = None - reader = galaxy_utils.sequence.vcf.Reader( iterator ) - for line in reader: + for line in iterator: if count >= MAX_VALS: message = ERROR_MAX_VALS % "features" break count += 1 feature = line.split() - payload = [ hash(line), vcf_line.pos-1, vcf_line.pos, \ + payload = [ hash(line), int(feature[1])-1, int(feature[1]), # ID: - feature[2], \ + feature[2], # reference base(s): - feature[3], \ + feature[3], # alternative base(s) - feature[4], \ + feature[4], # phred quality score int( feature[5] )] rval.append(payload) From 2f911c47ce65c92705bec531d48e6ca0a81f6cf7 Mon Sep 17 00:00:00 2001 From: Kanwei Li Date: Mon, 6 Jun 2011 15:30:02 -0400 Subject: [PATCH 006/473] Improve docs for Grouping tool. Closes #576 --- tools/stats/grouping.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/stats/grouping.xml b/tools/stats/grouping.xml index 037c1e4054f..9d7815ac7a2 100644 --- a/tools/stats/grouping.xml +++ b/tools/stats/grouping.xml @@ -88,7 +88,11 @@ **Syntax** -This tool allows you to group the input dataset by a particular column and perform aggregate functions: Mean, Median, Mode, Sum, Max, Min, Count, Randomly pick, and Concatenate on any column. +This tool allows you to group the input dataset by a particular column and perform aggregate functions: Mean, Median, Mode, Sum, Max, Min, Count, Concatenate, and Randomly pick on any column(s). + +The Concatenate function will take, for each group, each item in the specified column and build a comma delimited list. Concatenate Unique will do the same but will build a list of unique items with no repetition. + +Count and Count Unique are equivalent to Concatenate and Concatenate Unique, but will only count the number of items and will return an integer. - If multiple modes are present, all are reported. From d93393f24be25308c1a623a0aa79f4d77640382b Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Mon, 6 Jun 2011 15:45:16 -0400 Subject: [PATCH 007/473] Code cleanup for uploading files to a repo in the tool shed. --- .../community/controllers/repository.py | 13 +- .../webapps/community/controllers/upload.py | 244 +++++------------- .../webapps/community/upload/upload.mako | 242 ----------------- 3 files changed, 75 insertions(+), 424 deletions(-) delete mode 100644 templates/webapps/community/upload/upload.mako diff --git a/lib/galaxy/webapps/community/controllers/repository.py b/lib/galaxy/webapps/community/controllers/repository.py index fcb9d420cdd..4a2ec172dc0 100644 --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -16,9 +16,12 @@ log = logging.getLogger( __name__ ) # Characters that must be html escaped MAPPED_CHARS = { '>' :'>', - '<' :'<' } + '<' :'<', + '"' : '"', + '&' : '&', + '\'' : ''' } MAX_CONTENT_SIZE = 32768 -VALID_CHARS = set( string.letters + string.digits + "'\"-=_.()/+*^,:?!#[]%\\$@;" ) +VALID_CHARS = set( string.letters + string.digits + "'\"-=_.()/+*^,:?!#[]%\\$@;{}" ) VALID_REPOSITORYNAME_RE = re.compile( "^[a-z0-9\_]+$" ) class CategoryListGrid( grids.Grid ): @@ -673,7 +676,7 @@ class RepositoryController( BaseController, ItemRatings ): for i, line in enumerate( open( file_path ) ): to_html = '%s%s' % ( to_html, self.to_html_str( line ) ) if len( to_html ) > MAX_CONTENT_SIZE: - large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %d\n' % 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 ) to_html = '%s%s' % ( to_html, self.to_html_str( large_str ) ) break return to_html @@ -706,9 +709,9 @@ class RepositoryController( BaseController, ItemRatings ): translated.append( ' ' ) elif c == '\t': translated.append( '    ' ) - elif c in [ '\r\n', '\n' ]: + elif c == '\n': translated.append( '
' ) - else: + elif c not in [ '\r' ]: translated.append( 'X' ) return ''.join( translated ) def __build_allow_push_select_field( self, trans, current_push_list, selected_value='none' ): diff --git a/lib/galaxy/webapps/community/controllers/upload.py b/lib/galaxy/webapps/community/controllers/upload.py index be9c32aaa99..717cf79e526 100644 --- a/lib/galaxy/webapps/community/controllers/upload.py +++ b/lib/galaxy/webapps/community/controllers/upload.py @@ -60,12 +60,9 @@ class UploadController( BaseController ): elif file_data not in ( '', None ): uploaded_file = file_data.file if uploaded_file: - # TODO: our current support for browsing repo contents requires a copy - # of the repository files in the repo root directory. To produce these - # copies, we update without passing the -r null flag (see below). When - # we're uploading more files, we have to clean out the repo root directory - # so we can move them into it. We need to eliminate all this when we figure - # out how to browse the repository files. + # Our current support for browsing repo contents requires a copy of the + # repository files in the repo root directory. To produce these copies, + # we update without passing the "-r null" flag. os.chdir( repo_dir ) os.system( 'hg update -r null > /dev/null 2>&1' ) os.chdir( current_working_dir ) @@ -76,16 +73,16 @@ class UploadController( BaseController ): tar = tarfile.open( uploaded_file.name ) istar = True except tarfile.ReadError, e: + tar = None istar = False - if istar: - ok, message = self.__check_archive( tar ) - if ok: - if repository.is_new: + if repository.is_new: + if istar: + # We have an archive ( a tarball ) + ok, message = self.__check_archive( tar ) + if ok: tar.extractall( path=repo_dir ) tar.close() uploaded_file.close() - # TODO: The following will only work on new, empty repos, - # need to also handle repos with existing contents for root, dirs, files in os.walk( repo_dir, topdown=False ): # Don't visit .hg directories and don't include hgrc files in commit. if not root.find( '.hg' ) >= 0 and not root.find( 'hgrc' ) >= 0: @@ -109,78 +106,9 @@ class UploadController( BaseController ): repo.dirstate.add( file_path ) files_to_commit.append( file_path ) else: - # The repo already contains the file, so we need to make sure the file being - # uploaded is different from the file in the repo. This is a temporary brute- - # force method. - # Make a clone of the repository in a temporary location - tmp_dir = tempfile.mkdtemp() - tmp_archive_dir = os.path.join( tmp_dir, 'tmp_archive_dir' ) - if not os.path.exists( tmp_archive_dir ): - os.makedirs( tmp_archive_dir ) - cmd = "hg clone %s > /dev/null 2>&1" % os.path.abspath( repo_dir ) - os.chdir( tmp_archive_dir ) - os.system( cmd ) - os.chdir( current_working_dir ) - cloned_repo_dir = os.path.join( tmp_archive_dir, 'repo_%d' % repository.id ) - if upload_point is not None: - full_path = os.path.abspath( os.path.join( cloned_repo_dir, upload_point, file_data.filename ) ) - else: - full_path = os.path.abspath( os.path.join( cloned_repo_dir, file_data.filename ) ) - # Extract the uploaded tarball to the load_point within the cloned repository hierarchy - tar.extractall( path=full_path ) tar.close() - uploaded_file.close() - # We want these change sets to be associated with the owner of the repository, so we'll - # set the HGUSER environment variable accordingly. - os.environ[ 'HGUSER' ] = trans.user.username - # Add the file to the cloned repository. If it's already tracked, this should do nothing. - os.chdir( cloned_repo_dir ) - os.system( 'hg add > /dev/null 2>&1' ) - os.chdir( current_working_dir ) - os.chdir( cloned_repo_dir ) - # Commit the change set to the cloned repository - os.system( "hg commit -m '%s' > /dev/null 2>&1" % commit_message ) - os.chdir( current_working_dir ) - # Push the change set to the master repository - cmd = "hg push %s > /dev/null 2>&1" % os.path.abspath( repo_dir ) - os.chdir( cloned_repo_dir ) - os.system( cmd ) - # Change the current working directory to the original - os.chdir( current_working_dir ) - # Since we extracted the archive into repo_dir, a copy of the archive's - # files remains there. The following will remove them. It would be - # more ideal if we could use the mercurial api to do this, but I haven't - # yet discovered a way to pass the -r null flag to repo.update(). - # TODO: our current support for browsing repo contents requires a copy - # of the repository files in the repo root directory. To produce these - # copies, we'll update without passing the -r null flag. When we figure - # out how to browse the repository files, uncomment the -r flag below. - os.chdir( repo_dir ) - os.system( 'hg update > /dev/null 2>&1' ) - os.chdir( current_working_dir ) - # Remove tmp directory - shutil.rmtree( tmp_dir ) - message = "The file '%s' has been successfully uploaded to the repository." % file_data.filename - trans.response.send_redirect( web.url_for( controller='repository', - action='browse_repository', - message=message, - id=trans.security.encode_id( repository.id ) ) ) - - else: - tar.close() - else: - """ - # TODO: This segment uses the mercurial api (and works), but we need the - # api section below to be functional in order for this segment to be used. - # In the meantime, we use the repository.is_new check below... - repo_contains = file_path in [ i for i in ctx.manifest() ] - if not repo_contains: - repo.dirstate.add( file_path ) - files_to_commit.append( file_path ) - """ - if repository.is_new: - # We're uploading a single file + # We have a single file if upload_point is not None: full_path = os.path.abspath( os.path.join( upload_point, file_data.filename ) ) file_path = os.path.join( upload_point, file_data.filename ) @@ -190,98 +118,18 @@ class UploadController( BaseController ): shutil.move( uploaded_file.name, full_path ) repo.dirstate.add( file_path ) files_to_commit.append( file_path ) - else: - """ - # TODO: This segment attempts to use the mercurial api, but is not functional. - # Until we get it working, we're using the brute force method below it. - fctx = None - for changeset in repo.changelog: - ctx = repo.changectx( changeset ) - if file_path not in ctx.files(): - continue - fctx = ctx[ file_path ] - break - # We now have the parent version of the upload file. - if fctx: - data = fctx.data() - # TODO: obviously very bad way of comparing files... - file_path_data = open( full_path ).read() - different = data != file_path_data - if different: - # TODO: how do you insert a new version of an existing file using the mercurial api??? - # the follwoin gis not correct! - #repo.dirstate.normallookup( file_path ) - #files_to_commit.append( file_path ) - pass - """ - # The repo already contains the file, so we need to make sure the file being - # uploaded is different from the file in the repo. This is a temporary brute- - # force method. - # Make a clone of the repository in a temporary location - tmp_dir = tempfile.mkdtemp() - tmp_archive_dir = os.path.join( tmp_dir, 'tmp_archive_dir' ) - if not os.path.exists( tmp_archive_dir ): - os.makedirs( tmp_archive_dir ) - cmd = "hg clone %s > /dev/null 2>&1" % os.path.abspath( repo_dir ) - os.chdir( tmp_archive_dir ) - os.system( cmd ) - os.chdir( current_working_dir ) - cloned_repo_dir = os.path.join( tmp_archive_dir, 'repo_%d' % repository.id ) - if upload_point is not None: - full_path = os.path.abspath( os.path.join( cloned_repo_dir, upload_point, file_data.filename ) ) - else: - full_path = os.path.abspath( os.path.join( cloned_repo_dir, file_data.filename ) ) - # Move the uploaded file to the load_point within the cloned repository hierarchy - shutil.move( uploaded_file.name, full_path ) - # We want these change sets to be associated with the owner of the repository, so we'll - # set the HGUSER environment variable accordingly. - os.environ[ 'HGUSER' ] = trans.user.username - # Add the file to the cloned repository. If it's already tracked, this should do nothing. - os.chdir( cloned_repo_dir ) - os.system( 'hg add > /dev/null 2>&1' ) - os.chdir( current_working_dir ) - os.chdir( cloned_repo_dir ) - # Commit the change set to the cloned repository - os.system( "hg commit -m '%s' > /dev/null 2>&1" % commit_message ) - os.chdir( current_working_dir ) - # Push the change set to the master repository - cmd = "hg push %s > /dev/null 2>&1" % os.path.abspath( repo_dir ) - os.chdir( cloned_repo_dir ) - os.system( cmd ) - os.chdir( current_working_dir ) - # Since we extracted the archive into repo_dir, a copy of the archive's - # files remains there. The following will remove them. It would be - # more ideal if we could use the mercurial api to do this, but I haven't - # yet discovered a way to pass the -r null flag to repo.update(). - # TODO: our current support for browsing repo contents requires a copy - # of the repository files in the repo root directory. To produce these - # copies, we'll update without passing the -r null flag. When we figure - # out how to browse the repository files, uncomment the -r flag below. - os.chdir( repo_dir ) - os.system( 'hg update > /dev/null 2>&1' ) - os.chdir( current_working_dir ) - # Remove tmp directory - shutil.rmtree( tmp_dir ) - message = "The file '%s' has been successfully uploaded to the repository." % file_data.filename - trans.response.send_redirect( web.url_for( controller='repository', - action='browse_repository', - message=message, - id=trans.security.encode_id( repository.id ) ) ) + else: + # We're uploading files to a repository with existing + # contents, so clone the repository to a temporary location. + tmp_dir, cloned_repo_dir = self.__handle_hg_clone( trans, repository, upload_point, uploaded_file, file_data, repo_dir, current_working_dir, istar, tar=tar ) + # Commit and push the changes from the cloned repo to the master repo. + self.__handle_hg_push( trans, repository, file_data, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir ) if ok: if files_to_commit: repo.dirstate.write() repo.commit( text=commit_message ) - # Since we extracted the archive into repo_dir, a copy of the archive's - # files remains there. The following will remove them. It would be - # more ideal if we could use the mercurial api to do this, but I haven't - # yet discovered a way to pass the -r null flag to repo.update(). - # TODO: our current support for browsing repo contents requires a copy - # of the repository files in the repo root directory. To produce these - # copies, we'll update without passing the -r null flag. When we figure - # out how to browse the repository files, uncomment the -r flag below. os.chdir( repo_dir ) os.system( 'hg update > /dev/null 2>&1' ) - #os.system( 'hg update -r null' ) os.chdir( current_working_dir ) message = "The file '%s' has been successfully uploaded to the repository." % file_data.filename trans.response.send_redirect( web.url_for( controller='repository', @@ -290,17 +138,8 @@ class UploadController( BaseController ): id=trans.security.encode_id( repository.id ) ) ) else: status = 'error' - # Since we extracted the archive into repo_dir, a copy of the archive's - # files remains there. The following will remove them. It would be - # more ideal if we could use the mercurial api to do this, but I haven't - # yet discovered a way to pass the -r null flag to repo.update(). - # TODO: our current support for browsing repo contents requires a copy - # of the repository files in the repo root directory. To produce these - # copies, we'll update without passing the -r null flag. When we figure - # out how to browse the repository files, uncomment the -r flag below. os.chdir( repo_dir ) os.system( 'hg update > /dev/null 2>&1' ) - #os.system( 'hg update -r null' ) os.chdir( current_working_dir ) selected_categories = [ trans.security.decode_id( id ) for id in category_ids ] return trans.fill_template( '/webapps/community/repository/upload.mako', @@ -308,6 +147,57 @@ class UploadController( BaseController ): commit_message=commit_message, message=message, status=status ) + def __handle_hg_clone( self, trans, repository, upload_point, uploaded_file, file_data, repo_dir, current_working_dir, istar, tar=None ): + tmp_dir = tempfile.mkdtemp() + tmp_archive_dir = os.path.join( tmp_dir, 'tmp_archive_dir' ) + if not os.path.exists( tmp_archive_dir ): + os.makedirs( tmp_archive_dir ) + # Make a clone of the repository in a temporary location + cmd = "hg clone %s > /dev/null 2>&1" % os.path.abspath( repo_dir ) + os.chdir( tmp_archive_dir ) + os.system( cmd ) + os.chdir( current_working_dir ) + cloned_repo_dir = os.path.join( tmp_archive_dir, 'repo_%d' % repository.id ) + if upload_point is not None: + full_path = os.path.abspath( os.path.join( cloned_repo_dir, upload_point, file_data.filename ) ) + else: + full_path = os.path.abspath( os.path.join( cloned_repo_dir, file_data.filename ) ) + if istar: + # Extract the uploaded tarball to the load_point within the cloned repository hierarchy + tar.extractall( path=full_path ) + tar.close() + uploaded_file.close() + else: + # Move the uploaded file to the load_point within the cloned repository hierarchy + shutil.move( uploaded_file.name, full_path ) + return tmp_dir, cloned_repo_dir + def __handle_hg_push( self, trans, repository, file_data, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir ): + # We want these change sets to be associated with the owner of the repository, so we'll + # set the HGUSER environment variable accordingly. + os.environ[ 'HGUSER' ] = trans.user.username + # Add the file to the cloned repository. If it's already tracked, this should do nothing. + os.chdir( cloned_repo_dir ) + os.system( 'hg add > /dev/null 2>&1' ) + os.chdir( current_working_dir ) + os.chdir( cloned_repo_dir ) + # Commit the change set to the cloned repository + os.system( "hg commit -m '%s' > /dev/null 2>&1" % commit_message ) + os.chdir( current_working_dir ) + # Push the change set to the master repository + cmd = "hg push %s > /dev/null 2>&1" % os.path.abspath( repo_dir ) + os.chdir( cloned_repo_dir ) + os.system( cmd ) + os.chdir( current_working_dir ) + # Make a copy of the updated repository files for browsing. + os.chdir( repo_dir ) + os.system( 'hg update > /dev/null 2>&1' ) + os.chdir( current_working_dir ) + shutil.rmtree( tmp_dir ) + message = "The file '%s' has been successfully uploaded to the repository." % file_data.filename + trans.response.send_redirect( web.url_for( controller='repository', + action='browse_repository', + message=message, + id=trans.security.encode_id( repository.id ) ) ) def __check_archive( self, archive ): for member in archive.getmembers(): # Allow regular files and directories only diff --git a/templates/webapps/community/upload/upload.mako b/templates/webapps/community/upload/upload.mako deleted file mode 100644 index b853d3cb237..00000000000 --- a/templates/webapps/community/upload/upload.mako +++ /dev/null @@ -1,242 +0,0 @@ -<%namespace file="/message.mako" import="render_msg" /> - -<%! - def inherit(context): - if context.get('use_panels'): - return '/webapps/community/base_panels.mako' - else: - return '/base.mako' -%> - -<%inherit file="${inherit(context)}"/> - -<% - if selected_upload_type == 'tool': - title = 'Upload a tool archive' - type_label = 'tool' - elif selected_upload_type == 'toolsuite': - title = 'Upload a tool suite archive' - type_label = 'tool suite' -%> - -<%def name="title()"> - ${title} - - -<%def name="javascripts()"> - ${parent.javascripts()} - - - -

${title}

- -%if message: - ${render_msg( message, status )} -%endif - -
-
${title}
-
- ## TODO: nginx -
- %if replace_id is not None: - - %endif -
- -
- ${upload_type_select_list.get_html()} -
-
- Need help creating a ${type_label} archive? See details below. -
-
-
-
- -
-
-
-
- -
- -
-
-
-
- -
-
- Instead of uploading directly from your computer, you may instruct Galaxy to download the file from a Web or FTP address. -
-
-
-
- -
-
-
-
-

-

Creating an archive containing a tool or a suite of tools
-

- A tool or tool suite archive is a tar-format file (bzipped or gzipped tar are valid) - containing all the files necessary to load the tool(s) into a Galaxy instance. -

-%if selected_upload_type == 'toolsuite': -

Tool Suite Archive

-

- A tools suite must include a file named suite_config.xml which provides information about the id, name, - version and description of the tool suite, as well as the id, name, version and description of each tool - in the suite. Here is an example suite_config.xml file. -

-

-

-    <suite id="lastz_toolsuite" name="Suite of Lastz tools" version="1.0.0">
-        <description>This suite contains all of my Lastz tools for Galaxy</description>
-        <tool id="lastz_wrapper_2" name="Lastz" version="1.1.0">
-            <description> map short reads against reference sequence</description>
-        </tool>
-        <tool id="lastz_paired_reads_wrapper" name="Lastz paired reads" version="1.0.0">
-            <description> map short paired reads against reference sequence</description>
-        </tool>
-    </suite>
-
-

-

-

- New versions of the suite can be uploaded, replacing an older version of the suite, but the version attribute - of the tag must be altered the same way that the version attribute of a single tool config must be altered - if uploading a new version of a tool. -

-

- The id, name and version attributes of each tag in the suite_config.xml file must exactly match the same - attributes in each associated tool config in the archive or you will not be allowed to upload the archive. -

-

- In addition to the suite_config.xml file, the archive must include all - tool config files, - executables, functional test data (if your tool config includes functional tests) and other files needed for each - of the tools in your suite to function within Galaxy. See the information about single tool archives below for - additional hints to enable ease-of-use when others download your suite of tools. -

-

- For example, to package the above Lastz suite of tools: -

-    user@host:~% tar jcvf ~/Desktop/galaxy_lastz_toolsuite.tar.bz2 lastzsuite
-    lastzsuite/
-    lastzsuite/README
-    lastzsuite/suite_config.xml
-    lastzsuite/lastz_paired_reads_wrapper.py
-    lastzsuite/lastz_paired_reads_wrapper.xml
-    lastzsuite/lastz_wrapper.py
-    lastzsuite/lastz_wrapper.xml
-    lastzsuite/lastz-distrib-1.02.00/
-    lastzsuite/lastz-distrib-1.02.00/src/
-    lastzsuite/lastz-distrib-1.02.00/src/Makefile
-    lastzsuite/lastz-distrib-1.02.00/src/version.mak
-    lastzsuite/lastz-distrib-1.02.00/src/lastz.c
-    lastzsuite/lastz-distrib-1.02.00/src/lastz.h
-    ...
-
- ~/Desktop/galaxy_lastz_tool.tar.bz2 is now ready to be uploaded. -

-%endif -

Single Tool Archive

-

- A single tool archive must include a - tool config file - and will probably also include a tool script. If any steps are necessary to install your tool beyond the basic - instructions below, include a README file to provide details. If the tool (or parts of it) are written in C, - the source code can be included (or put links to the source in the README). Do not include pre-compiled binaries - without source since Galaxy is run on a wide variety of platforms. Also, if you are only wrapping or providing a - Galaxy config for a tool that is not your own, be sure the license allows for redistribution before including any - part of that tool in the archive. -

-

- There are no requirements about the directory structure inside the archive, but for ease of use it's generally - a good idea to put everything inside a sub-directory, instead of directly at the top level. -

-

- For example, to package the Lastz tool's config file, Galaxy wrapper, and the C source: -

-    user@host:~% tar jcvf ~/Desktop/galaxy_lastz_tool.tar.bz2 lastz
-    lastz/
-    lastz/README
-    lastz/lastz_wrapper.py
-    lastz/lastz_wrapper.xml
-    lastz/lastz-distrib-1.02.00/
-    lastz/lastz-distrib-1.02.00/src/
-    lastz/lastz-distrib-1.02.00/src/Makefile
-    lastz/lastz-distrib-1.02.00/src/version.mak
-    lastz/lastz-distrib-1.02.00/src/lastz.c
-    lastz/lastz-distrib-1.02.00/src/lastz.h
-    ...
-
- ~/Desktop/galaxy_lastz_tool.tar.bz2 is now ready to be uploaded. -

-

Editing Information, Categories, and Submitting For Approval

-

- Simply uploading a tool to the Galaxy too shed will not allow other users to find and download your tool. It will - need to be approved by an administrator before it appears in the tool list. -

-

- After your archive has successfully uploaded, you will be redirected to the Edit Tool page. Provide a detailed - description of what the tool does - this will be used by administrators to understand the tool before approving it - for display on the site. Once approved, this information will be displayed to users who view your tool. In addition, - the site administrators will have configured a number of categories with which you can associate your tool to make it - easy to find by users looking to solve specific problems. Associate as many categories as are relevant to your tool. - You may change the description and associated categories as often as you'd like until you click the "Submit for - approval" button. Once submitted, the tool will be approved or rejected by an administrator. If the tool is - rejected, you will see information about why it was rejected, and you can make appropriate changes to the archive and - re-submit it for approval. When it is approved, your archive will be visible to everyone. At that point, the description - and associated categories can only be changed by an administrator. -

-

- When the tool has been approved or rejected, you may upload a new version by browsing to the tool's "View Tool" page, - clicking the "Tool actions" menu in the upper right corner of the page, and selecting "Upload a new version" from the - menu. -

-
-

Downloading and Installing Tools

-

- A tool's download link will send you the tool archive. Once downloaded, unpack the tool on your local Galaxy instance's server: -

-    user@host:~% tar xvf galaxy_lastz_tool.tar
-    ...
-    user@host:~% tar zxvf galaxy_lastz_tool.tar.gz
-    ...
-    user@host:~% tar jxvf galaxy_lastz_tool.tar.bz2
-    ...
-
- If the archive includes a README file, consult it for installation instructions. If not, follow these basic steps: -
    -
  1. Create a directory under galaxy_dist/tools/ to house downloaded tool(s).
  2. -
  3. In the new directory, place the XML and any script file(s) which were contained in the archive.
  4. -
  5. - If the tool includes binaries, you'll need to copy them to a directory on your $PATH. If the tool depends on - C binaries but does not come with them (only source), you'll need to compile the source first. -
  6. -
  7. Add the tool to galaxy_dist/tool_conf.xml.
  8. -
  9. Restart your Galaxy server process.
  10. -
-

-

- In the near future, we plan to implement a more direct method to install tools via the Galaxy administrator user interface instead - of placing files on the filesystem and manually managing the tool_conf.xml file. -

From 439cb5aa358e380a614e8fc7fb735886d5a020eb Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Mon, 6 Jun 2011 16:17:09 -0400 Subject: [PATCH 008/473] Fix GFF3 reader bug. --- lib/galaxy/datatypes/util/gff_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/util/gff_util.py b/lib/galaxy/datatypes/util/gff_util.py index 759aa1b0742..3a5e7771728 100644 --- a/lib/galaxy/datatypes/util/gff_util.py +++ b/lib/galaxy/datatypes/util/gff_util.py @@ -217,7 +217,7 @@ class GFFReaderWrapper( NiceReaderWrapper ): # GFF3 test: parent_id = interval.attributes.get( 'Parent', None ) cur_id = interval.attributes.get( 'ID', None ) - if feature_id and parent_id != feature_parent_id and feature_id != cur_id: + if ( cur_id and cur_id != feature_id ) or ( parent_id and parent_id != feature_id ): break # GTF test: gene_id = interval.attributes.get( 'gene_id', None ) From f618b49852e916727cf5b2613b62cb7545f33ea1 Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Tue, 7 Jun 2011 09:04:55 -0400 Subject: [PATCH 009/473] Fix for incorrect variable name reuse ('roles'), occurring when importing multiple datasets from a history into a library. --- lib/galaxy/web/controllers/library_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/web/controllers/library_common.py b/lib/galaxy/web/controllers/library_common.py index 337c9812d6f..b290b3734ba 100644 --- a/lib/galaxy/web/controllers/library_common.py +++ b/lib/galaxy/web/controllers/library_common.py @@ -1221,7 +1221,7 @@ class LibraryCommon( BaseController, UsesFormDefinitions ): # it exists, then we need to apply the LIBRARY_MANAGE permission to the library dataset. dataset_manage_permissions_action = trans.app.security_agent.get_action( 'DATASET_MANAGE_PERMISSIONS' ).action flush_needed = False - for action, roles in dataset_permissions_dict.items(): + for action, dataset_permissions_roles in dataset_permissions_dict.items(): if isinstance( action, Action ): action = action.action if action == dataset_manage_permissions_action: @@ -1229,7 +1229,7 @@ class LibraryCommon( BaseController, UsesFormDefinitions ): action = trans.app.security_agent.get_action( 'LIBRARY_MANAGE' ).action # Allow the permissions inherited from the folder to over-ride the same permissions on the dataset. if action not in current_library_dataset_actions: - for ldp in [ trans.model.LibraryDatasetPermissions( action, ldda.library_dataset, role ) for role in roles ]: + for ldp in [ trans.model.LibraryDatasetPermissions( action, ldda.library_dataset, role ) for role in dataset_permissions_roles ]: trans.sa_session.add( ldp ) flush_needed = True if flush_needed: From 26cc51ab767a0075a0dbf644e3cd925c11bad89d Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Tue, 7 Jun 2011 10:46:52 -0400 Subject: [PATCH 010/473] Fix for Select All / Unselect All functionality when more than one set of checkboxes is present on a page. --- templates/tool_form.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/tool_form.mako b/templates/tool_form.mako index 3f9a5fbe6b3..c23f6559fa0 100644 --- a/templates/tool_form.mako +++ b/templates/tool_form.mako @@ -51,7 +51,7 @@ $(function() { }); function checkUncheckAll( name, check ) { - $("input[name=" + name + "][type='checkbox']").attr('checked', !!check); + $("input[name='" + name + "'][type='checkbox']").attr('checked', !!check); } // Inserts the Select All / Unselect All buttons for checkboxes From daba048e420efaef80ca94a701c4a736dd40e169 Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Tue, 7 Jun 2011 11:06:50 -0400 Subject: [PATCH 011/473] Add the ability to download repository files in tar.gz, tar.bz2 or zip format from the tool shed. --- .../community/controllers/repository.py | 17 +++++++++ .../webapps/community/controllers/upload.py | 38 ++++++++++--------- .../repository/browse_repository.mako | 3 ++ .../repository/manage_repository.mako | 3 ++ .../community/repository/rate_repository.mako | 3 ++ .../community/repository/view_changelog.mako | 3 ++ .../community/repository/view_changeset.mako | 3 ++ .../community/repository/view_repository.mako | 3 ++ 8 files changed, 55 insertions(+), 18 deletions(-) diff --git a/lib/galaxy/webapps/community/controllers/repository.py b/lib/galaxy/webapps/community/controllers/repository.py index 4a2ec172dc0..00eb6e57760 100644 --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -611,6 +611,23 @@ class RepositoryController( BaseController, ItemRatings ): rra=rra, message=message, status=status ) + @web.expose + def download( self, trans, repository_id, file_type, **kwd ): + # Download an archive of the repository files compressed as zip, gz or bz2. + params = util.Params( kwd ) + repository = get_repository( trans, repository_id ) + # Allow hgweb to handle the download. This requires the tool shed + # server account's .hgrc file to include the following setting: + # [web] + # allow_archive = bz2, gz, zip + if file_type == 'zip': + file_type_str = 'tip.zip' + elif file_type == 'bz2': + file_type_str = 'tip.tar.bz2' + elif file_type == 'gz': + file_type_str = 'tip.tar.gz' + download_url = '/repos/%s/%s/archive/%s' % ( repository.user.username, repository.name, file_type_str ) + return trans.response.send_redirect( download_url ) @web.json def open_folder( self, trans, repository_id, key ): # TODO: The tool shed includes a repository source file browser, which currently depends upon diff --git a/lib/galaxy/webapps/community/controllers/upload.py b/lib/galaxy/webapps/community/controllers/upload.py index 717cf79e526..8b598213699 100644 --- a/lib/galaxy/webapps/community/controllers/upload.py +++ b/lib/galaxy/webapps/community/controllers/upload.py @@ -119,11 +119,12 @@ class UploadController( BaseController ): repo.dirstate.add( file_path ) files_to_commit.append( file_path ) else: - # We're uploading files to a repository with existing - # contents, so clone the repository to a temporary location. - tmp_dir, cloned_repo_dir = self.__handle_hg_clone( trans, repository, upload_point, uploaded_file, file_data, repo_dir, current_working_dir, istar, tar=tar ) + # Clone the repository to a temporary location. + tmp_dir, cloned_repo_dir = self.__hg_clone( trans, repository, repo_dir, current_working_dir ) + # Move the uploaded files to the upload_point within the cloned repository. + self.__move_to_upload_point( upload_point, uploaded_file, file_data, cloned_repo_dir, istar, tar ) # Commit and push the changes from the cloned repo to the master repo. - self.__handle_hg_push( trans, repository, file_data, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir ) + self.__hg_push( trans, repository, file_data, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir ) if ok: if files_to_commit: repo.dirstate.write() @@ -147,7 +148,7 @@ class UploadController( BaseController ): commit_message=commit_message, message=message, status=status ) - def __handle_hg_clone( self, trans, repository, upload_point, uploaded_file, file_data, repo_dir, current_working_dir, istar, tar=None ): + def __hg_clone( self, trans, repository, repo_dir, current_working_dir ): tmp_dir = tempfile.mkdtemp() tmp_archive_dir = os.path.join( tmp_dir, 'tmp_archive_dir' ) if not os.path.exists( tmp_archive_dir ): @@ -158,20 +159,8 @@ class UploadController( BaseController ): os.system( cmd ) os.chdir( current_working_dir ) cloned_repo_dir = os.path.join( tmp_archive_dir, 'repo_%d' % repository.id ) - if upload_point is not None: - full_path = os.path.abspath( os.path.join( cloned_repo_dir, upload_point, file_data.filename ) ) - else: - full_path = os.path.abspath( os.path.join( cloned_repo_dir, file_data.filename ) ) - if istar: - # Extract the uploaded tarball to the load_point within the cloned repository hierarchy - tar.extractall( path=full_path ) - tar.close() - uploaded_file.close() - else: - # Move the uploaded file to the load_point within the cloned repository hierarchy - shutil.move( uploaded_file.name, full_path ) return tmp_dir, cloned_repo_dir - def __handle_hg_push( self, trans, repository, file_data, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir ): + def __hg_push( self, trans, repository, file_data, commit_message, current_working_dir, cloned_repo_dir, repo_dir, tmp_dir ): # We want these change sets to be associated with the owner of the repository, so we'll # set the HGUSER environment variable accordingly. os.environ[ 'HGUSER' ] = trans.user.username @@ -198,6 +187,19 @@ class UploadController( BaseController ): action='browse_repository', message=message, id=trans.security.encode_id( repository.id ) ) ) + def __move_to_upload_point( self, upload_point, uploaded_file, file_data, cloned_repo_dir, istar, tar ): + if upload_point is not None: + full_path = os.path.abspath( os.path.join( cloned_repo_dir, upload_point, file_data.filename ) ) + else: + full_path = os.path.abspath( os.path.join( cloned_repo_dir, file_data.filename ) ) + if istar: + # Extract the uploaded tarball to the load_point within the cloned repository hierarchy + tar.extractall( path=full_path ) + tar.close() + uploaded_file.close() + else: + # Move the uploaded file to the load_point within the cloned repository hierarchy + shutil.move( uploaded_file.name, full_path ) def __check_archive( self, archive ): for member in archive.getmembers(): # Allow regular files and directories only diff --git a/templates/webapps/community/repository/browse_repository.mako b/templates/webapps/community/repository/browse_repository.mako index caece1c69ff..072853c66f8 100644 --- a/templates/webapps/community/repository/browse_repository.mako +++ b/templates/webapps/community/repository/browse_repository.mako @@ -79,6 +79,9 @@ %if can_rate: Rate repository %endif + Download as a .tar.gz file + Download as a .tar.bz2 file + Download as a zip file
%endif diff --git a/templates/webapps/community/repository/manage_repository.mako b/templates/webapps/community/repository/manage_repository.mako index e3850167a6b..7bdd2d40e7b 100644 --- a/templates/webapps/community/repository/manage_repository.mako +++ b/templates/webapps/community/repository/manage_repository.mako @@ -76,6 +76,9 @@ %if can_browse_contents: Browse repository %endif + Download as a .tar.gz file + Download as a .tar.bz2 file + Download as a zip file
%endif diff --git a/templates/webapps/community/repository/rate_repository.mako b/templates/webapps/community/repository/rate_repository.mako index 9e886e024e6..e67173281d2 100644 --- a/templates/webapps/community/repository/rate_repository.mako +++ b/templates/webapps/community/repository/rate_repository.mako @@ -81,6 +81,9 @@ %if can_browse_contents: Browse repository %endif + Download as a .tar.gz file + Download as a .tar.bz2 file + Download as a zip file %endif diff --git a/templates/webapps/community/repository/view_changelog.mako b/templates/webapps/community/repository/view_changelog.mako index 547d1dac4bb..543c2db8eae 100644 --- a/templates/webapps/community/repository/view_changelog.mako +++ b/templates/webapps/community/repository/view_changelog.mako @@ -50,6 +50,9 @@ %if can_browse_contents: Browse repository %endif + Download as a .tar.gz file + Download as a .tar.bz2 file + Download as a zip file diff --git a/templates/webapps/community/repository/view_changeset.mako b/templates/webapps/community/repository/view_changeset.mako index 75e883f2043..8233e74248b 100644 --- a/templates/webapps/community/repository/view_changeset.mako +++ b/templates/webapps/community/repository/view_changeset.mako @@ -54,6 +54,9 @@ %if can_browse_contents: Browse repository %endif + Download as a .tar.gz file + Download as a .tar.bz2 file + Download as a zip file diff --git a/templates/webapps/community/repository/view_repository.mako b/templates/webapps/community/repository/view_repository.mako index d5b246f0bee..5c0e55d0268 100644 --- a/templates/webapps/community/repository/view_repository.mako +++ b/templates/webapps/community/repository/view_repository.mako @@ -76,6 +76,9 @@ %if can_browse_contents: Browse repository %endif + Download as a .tar.gz file + Download as a .tar.bz2 file + Download as a zip file %endif From cbd7fd8caaab85b330de0520253aca010bd42d80 Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Tue, 7 Jun 2011 11:32:11 -0400 Subject: [PATCH 012/473] Commit versions of tools from the last_gen tool shed in order of oldest -> newest in the next-gen tool shed. Fixes issue # 578. --- scripts/tool_shed/migrate_tools_to_repositories.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tool_shed/migrate_tools_to_repositories.py b/scripts/tool_shed/migrate_tools_to_repositories.py index cd1a97246c5..37068de94c3 100644 --- a/scripts/tool_shed/migrate_tools_to_repositories.py +++ b/scripts/tool_shed/migrate_tools_to_repositories.py @@ -59,12 +59,12 @@ def get_versions( app, item ): this_item = item while item.newer_version: if item.newer_version.state in valid_states: - versions.insert( 0, item.newer_version ) + versions.append( item.newer_version ) item = item.newer_version item = this_item while item.older_version: if item.older_version[ 0 ].state in valid_states: - versions.append( item.older_version[ 0 ] ) + versions.insert( 0, item.older_version[ 0 ] ) item = item.older_version[ 0 ] return versions From 08cdedc42a926f19dea068a21936a3d7ca3a7f59 Mon Sep 17 00:00:00 2001 From: Richard Burhans Date: Tue, 7 Jun 2011 14:30:52 -0400 Subject: [PATCH 013/473] don't show metadata items that are not visible --- templates/library/common/ldda_info.mako | 30 +++++++++++++------------ 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/templates/library/common/ldda_info.mako b/templates/library/common/ldda_info.mako index e05096f0ec8..26024882c5a 100644 --- a/templates/library/common/ldda_info.mako +++ b/templates/library/common/ldda_info.mako @@ -136,20 +136,22 @@
${ldda.blurb}
%for name, spec in ldda.metadata.spec.items(): -
- - <% - metadata_val = ldda.metadata.get( name ) - if isinstance( metadata_val, trans.model.MetadataFile ): - metadata_val = metadata_val.file_name - elif isinstance( metadata_val, list ): - # Make sure list items are strings - metadata_val = [ str( item ) for item in metadata_val ] - metadata_val = ', '.join( metadata_val ) - %> - ${metadata_val} -
-
+ %if spec.visible: +
+ + <% + metadata_val = ldda.metadata.get( name ) + if isinstance( metadata_val, trans.model.MetadataFile ): + metadata_val = metadata_val.file_name + elif isinstance( metadata_val, list ): + # Make sure list items are strings + metadata_val = [ str( item ) for item in metadata_val ] + metadata_val = ', '.join( metadata_val ) + %> + ${metadata_val} +
+
+ %endif %endfor %if ldda.peek != "no peek":
From 83b9814814c1d0f300e715efccc18b2e2cde0399 Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Tue, 7 Jun 2011 14:31:35 -0400 Subject: [PATCH 014/473] Rename and reorder Cuffdiff outputs for clarity. --- tools/ngs_rna/cuffdiff_wrapper.xml | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/ngs_rna/cuffdiff_wrapper.xml b/tools/ngs_rna/cuffdiff_wrapper.xml index b15512cbd37..7a0c0a37995 100644 --- a/tools/ngs_rna/cuffdiff_wrapper.xml +++ b/tools/ngs_rna/cuffdiff_wrapper.xml @@ -132,17 +132,17 @@ - - - - - - - + + + + - - - + + + + + + @@ -164,17 +164,17 @@ Line diffs are needed because cuffdiff does not produce deterministic output. TODO: can we find datasets that lead to deterministic behavior? --> - - - - - - - - + + + + + + + + From 839499361d5874b8a952ff13dc8628d48fe97063 Mon Sep 17 00:00:00 2001 From: Richard Burhans Date: Tue, 7 Jun 2011 14:36:46 -0400 Subject: [PATCH 015/473] allow lines starting with arbitrary characters to be excluded from the peek --- lib/galaxy/datatypes/data.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/datatypes/data.py b/lib/galaxy/datatypes/data.py index e37744b69d3..4e9874a299e 100644 --- a/lib/galaxy/datatypes/data.py +++ b/lib/galaxy/datatypes/data.py @@ -417,13 +417,13 @@ class Text( Data ): if line and not line.startswith( '#' ): data_lines += 1 return data_lines - def set_peek( self, dataset, line_count=None, is_multi_byte=False ): + def set_peek( self, dataset, line_count=None, is_multi_byte=False, skipchars=[] ): """ Set the peek. This method is used by various subclasses of Text. """ if not dataset.dataset.purged: # The file must exist on disk for the get_file_peek() method - dataset.peek = get_file_peek( dataset.file_name, is_multi_byte=is_multi_byte ) + dataset.peek = get_file_peek( dataset.file_name, is_multi_byte=is_multi_byte, skipchars=skipchars ) if line_count is None: # See if line_count is stored in the metadata if dataset.metadata.data_lines: @@ -461,7 +461,7 @@ def get_test_fname( fname ): path, name = os.path.split(__file__) full_path = os.path.join( path, 'test', fname ) return full_path -def get_file_peek( file_name, is_multi_byte=False, WIDTH=256, LINE_COUNT=5 ): +def get_file_peek( file_name, is_multi_byte=False, WIDTH=256, LINE_COUNT=5, skipchars=[] ): """ Returns the first LINE_COUNT lines wrapped to WIDTH @@ -489,8 +489,14 @@ def get_file_peek( file_name, is_multi_byte=False, WIDTH=256, LINE_COUNT=5 ): data_checked = True if file_type in [ 'gzipped', 'binary' ]: break - lines.append( line ) - count += 1 + skip_line = False + for skipchar in skipchars: + if line.startswith( skipchar ): + skip_line = True + break + if not skip_line: + lines.append( line ) + count += 1 temp.close() if file_type in [ 'gzipped', 'binary' ]: text = "%s file" % file_type From 29dd621d5c4b37b893e4dea7448768ff75ae310c Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Tue, 7 Jun 2011 14:53:53 -0400 Subject: [PATCH 016/473] Revert change set 2b4d50205705, adding a [missing] comment so all meta data items will always be displayed on the ldda_info page. --- templates/library/common/ldda_info.mako | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/templates/library/common/ldda_info.mako b/templates/library/common/ldda_info.mako index 26024882c5a..9a9da99beef 100644 --- a/templates/library/common/ldda_info.mako +++ b/templates/library/common/ldda_info.mako @@ -135,23 +135,22 @@
${ldda.blurb}
+ ## We want to display all metadata item here, whether marked visible or not since they are all pretty useful %for name, spec in ldda.metadata.spec.items(): - %if spec.visible: -
- - <% - metadata_val = ldda.metadata.get( name ) - if isinstance( metadata_val, trans.model.MetadataFile ): - metadata_val = metadata_val.file_name - elif isinstance( metadata_val, list ): - # Make sure list items are strings - metadata_val = [ str( item ) for item in metadata_val ] - metadata_val = ', '.join( metadata_val ) - %> - ${metadata_val} -
-
- %endif +
+ + <% + metadata_val = ldda.metadata.get( name ) + if isinstance( metadata_val, trans.model.MetadataFile ): + metadata_val = metadata_val.file_name + elif isinstance( metadata_val, list ): + # Make sure list items are strings + metadata_val = [ str( item ) for item in metadata_val ] + metadata_val = ', '.join( metadata_val ) + %> + ${metadata_val} +
+
%endfor %if ldda.peek != "no peek":
From 84b4d476706cb1b094fe64697000291c5ed016b5 Mon Sep 17 00:00:00 2001 From: Enis Afgan Date: Wed, 8 Jun 2011 11:15:42 -0400 Subject: [PATCH 017/473] Do not display non-functional buttons for editing tags/annotations on history Show Structure page --- templates/history/display_structured.mako | 2 +- templates/root/history_common.mako | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/history/display_structured.mako b/templates/history/display_structured.mako index 70910709a9d..db6ccd1cbd4 100644 --- a/templates/history/display_structured.mako +++ b/templates/history/display_structured.mako @@ -91,7 +91,7 @@ elif entity_name == "WorkflowInvocation": <%def name="render_item_hda( hda, children )"> - ${render_dataset( hda, hda.hid )} + ${render_dataset( hda, hda.hid, display_structured=True )} <%def name="render_item_job( job, children )"> diff --git a/templates/root/history_common.mako b/templates/root/history_common.mako index a55e3bb6634..85ea8e3a8e2 100644 --- a/templates/root/history_common.mako +++ b/templates/root/history_common.mako @@ -1,6 +1,6 @@ <% _=n_ %> ## Render the dataset `data` as history item, using `hid` as the displayed id -<%def name="render_dataset( data, hid, show_deleted_on_refresh = False, for_editing = True )"> +<%def name="render_dataset( data, hid, show_deleted_on_refresh = False, for_editing = True, display_structured = False )"> <% dataset_id = trans.security.encode_id( data.id ) from galaxy.datatypes.metadata import FileParameter @@ -171,10 +171,12 @@ new-url="${h.url_for( controller='tracks', action='index', dataset_id=dataset_id, default_dbkey=data.dbkey)}" title="Visualize in Trackster"> %endif %if trans.user: -
- - -
+ %if not display_structured: +
+ + +
+ %endif