galaxy-commits
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
May 2010
- 2 participants
- 158 discussions
details: http://www.bx.psu.edu/hg/galaxy/rev/e47ff545931f
changeset: 3669:e47ff545931f
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Mon Apr 19 17:41:35 2010 -0400
description:
Cuffcompare wrapper.
diffstat:
tools/ngs_rna/cuffcompare_wrapper.py | 86 ++++++++++++++++++++
tools/ngs_rna/cuffcompare_wrapper.xml | 142 ++++++++++++++++++++++++++++++++++
2 files changed, 228 insertions(+), 0 deletions(-)
diffs (237 lines):
diff -r 91b8f0abffc8 -r e47ff545931f tools/ngs_rna/cuffcompare_wrapper.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ngs_rna/cuffcompare_wrapper.py Mon Apr 19 17:41:35 2010 -0400
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+
+import optparse, os, shutil, subprocess, sys, tempfile
+
+def stop_err( msg ):
+ sys.stderr.write( "%s\n" % msg )
+ sys.exit()
+
+def __main__():
+ #Parse Command Line
+ parser = optparse.OptionParser()
+ parser.add_option( '-r', dest='ref_annotation', help='An optional "reference" annotation GTF. Each sample is matched against this file, and sample isoforms are tagged as overlapping, matching, or novel where appropriate. See the refmap and tmap output file descriptions below.' )
+ parser.add_option( '-R', action="store_true", dest='ignore_nonoverlap', help='If -r was specified, this option causes cuffcompare to ignore reference transcripts that are not overlapped by any transcript in one of cuff1.gtf,...,cuffN.gtf. Useful for ignoring annotated transcripts that are not present in your RNA-Seq samples and thus adjusting the "sensitivity" calculation in the accuracy report written in the transcripts accuracy file' )
+
+ # Wrapper / Galaxy options.
+ parser.add_option( '-A', '--transcripts-accuracy-output', dest='transcripts_accuracy_output_file', help='' )
+ parser.add_option( '-B', '--transcripts-combined-output', dest='transcripts_combined_output_file', help='' )
+ parser.add_option( '-C', '--transcripts-tracking-output', dest='transcripts_tracking_output_file', help='' )
+
+ (options, args) = parser.parse_args()
+
+ # Make temp directory for output.
+ tmp_output_dir = tempfile.mkdtemp()
+
+ # Build command.
+
+ # Base.
+ cmd = "cuffcompare -o cc_output"
+
+ # Add options.
+ if options.ref_annotation:
+ cmd += " -r %s" % options.ref_annotation
+ if options.ignore_nonoverlap:
+ cmd += " -R "
+
+ # Add input files.
+ if type(args) is list:
+ args = " ".join(args)
+ cmd += " " + args
+ print cmd
+
+ # Run command.
+ try:
+ tmp_name = tempfile.NamedTemporaryFile( dir=tmp_output_dir ).name
+ tmp_stderr = open( tmp_name, 'wb' )
+ proc = subprocess.Popen( args=cmd, shell=True, cwd=tmp_output_dir, stderr=tmp_stderr.fileno() )
+ returncode = proc.wait()
+ tmp_stderr.close()
+
+ # Get stderr, allowing for case where it's very large.
+ tmp_stderr = open( tmp_name, 'rb' )
+ stderr = ''
+ buffsize = 1048576
+ try:
+ while True:
+ stderr += tmp_stderr.read( buffsize )
+ if not stderr or len( stderr ) % buffsize != 0:
+ break
+ except OverflowError:
+ pass
+ tmp_stderr.close()
+
+ # Error checking.
+ if returncode != 0:
+ raise Exception, stderr
+
+ # check that there are results in the output file
+ if len( open( tmp_output_dir + "/cc_output", 'rb' ).read().strip() ) == 0:
+ raise Exception, 'The main output file is empty, there may be an error with your input file or settings.'
+ except Exception, e:
+ stop_err( 'Error running cuffcompare. ' + str( e ) )
+
+ # Copy output files from tmp directory to specified files.
+ try:
+ try:
+ shutil.copyfile( tmp_output_dir + "/cc_output", options.transcripts_accuracy_output_file )
+ shutil.copyfile( tmp_output_dir + "/cc_output.combined.gtf", options.transcripts_combined_output_file )
+ shutil.copyfile( tmp_output_dir + "/cc_output.tracking", options.transcripts_tracking_output_file )
+ except Exception, e:
+ stop_err( 'Error in cuffcompare:\n' + str( e ) )
+ finally:
+ # Clean up temp dirs
+ if os.path.exists( tmp_output_dir ):
+ shutil.rmtree( tmp_output_dir )
+
+if __name__=="__main__": __main__()
\ No newline at end of file
diff -r 91b8f0abffc8 -r e47ff545931f tools/ngs_rna/cuffcompare_wrapper.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ngs_rna/cuffcompare_wrapper.xml Mon Apr 19 17:41:35 2010 -0400
@@ -0,0 +1,142 @@
+<tool id="cuffcompare" name="Cuffcompare" version="0.8.2">
+ <description>compare assembled transcripts to a reference annotation and track Cufflinks transcripts across multiple experiments</description>
+ <command interpreter="python">
+ cuffcompare_wrapper.py
+ --transcripts-accuracy-output=$transcripts_accuracy
+ --transcripts-combined-output=$transcripts_combined
+ --transcripts-tracking-output=$transcripts_tracking
+ #if $annotation.use_ref_annotation == "Yes":
+ -r $annotation.reference_annotation
+ #if $annotation.ignore_nonoverlapping_reference:
+ -R
+ #end if
+ #end if
+ $input1
+ $input2
+ </command>
+ <inputs>
+ <param format="gtf" name="input1" type="data" label="SAM file of aligned RNA-Seq reads" help=""/>
+ <param format="gtf" name="input2" type="data" label="SAM file of aligned RNA-Seq reads" help=""/>
+ <conditional name="annotation">
+ <param name="use_ref_annotation" type="select" label="Use Reference Annotation?">
+ <option value="No">No</option>
+ <option value="Yes">Yes</option>
+ </param>
+ <when value="Yes">
+ <param format="gtf" name="reference_annotation" type="data" label="Reference Annotation" help=""/>
+ <param name="ignore_nonoverlapping_reference" type="boolean" label="Ignore reference transcripts that are not overlapped by any transcript in input files"/>
+ </when>
+ <when value="No">
+ </when>
+ </conditional>
+ </inputs>
+
+ <outputs>
+ <data format="gtf" name="transcripts_combined" />
+ <data format="tracking" name="transcripts_tracking" />
+ <data format="gtf" name="transcripts_accuracy" />
+ </outputs>
+
+ <tests>
+ <test>
+ </test>
+ </tests>
+
+ <help>
+**Cuffcompare Overview**
+
+Cuffcompare is part of Cufflinks_. Cuffcompare helps you: (a) compare your assembled transcripts to a reference annotation and (b) track Cufflinks transcripts across multiple experiments (e.g. across a time course). Please cite: Trapnell C, Williams BA, Pertea G, Mortazavi AM, Kwan G, van Baren MJ, Salzberg SL, Wold B, Pachter L. Transcript assembly and abundance estimation from RNA-Seq reveals thousands of new transcripts and switching among isoforms. (manuscript in press)
+
+.. _Cufflinks: http://cufflinks.cbcb.umd.edu/
+
+------
+
+**Know what you are doing**
+
+.. class:: warningmark
+
+There is no such thing (yet) as an automated gearshift in expression analysis. It is all like stick-shift driving in San Francisco. In other words, running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading the `documentation`__ and experimenting. Fortunately, Galaxy makes experimenting easy.
+
+.. __: http://cufflinks.cbcb.umd.edu/manual.html#cuffcompare
+
+------
+
+**Input format**
+
+Cuffcompare takes Cufflinks' GTF output as input, and optionally can take a "reference" annotation (such as from Ensembl___)
+
+.. ___: http://www.todo.org
+
+------
+
+**Outputs**
+
+Cuffcompare produces the following output files:
+
+Transcripts Accuracy File:
+
+Cuffcompare reports various statistics related to the "accuracy" of the transcripts in each sample when compared to the reference annotation data. The typical gene finding measures of "sensitivity" and "specificity" (as defined in Burset, M., Guigó, R. : Evaluation of gene structure prediction programs (1996) Genomics, 34 (3), pp. 353-367. doi: 10.1006/geno.1996.0298) are calculated at various levels (nucleotide, exon, intron, transcript, gene) for each input file and reported in this file. The Sn and Sp columns show specificity and sensitivity values at each level, while the fSn and fSp columns are "fuzzy" variants of these same accuracy calculations, allowing for a very small variation in exon boundaries to still be counted as a "match".
+
+Transcripts Combined File:
+
+Cuffcompare reports a GTF file containing the "union" of all transfrags in each sample. If a transfrag is present in both samples, it is thus reported once in the combined gtf.
+
+Transcripts Tracking File:
+
+This file matches transcripts up between samples. Each row contains a transcript structure that is present in one or more input GTF files. Because the transcripts will generally have different IDs (unless you assembled your RNA-Seq reads against a reference transcriptome), cuffcompare examines the structure of each the transcripts, matching transcripts that agree on the coordinates and order of all of their introns, as well as strand. Matching transcripts are allowed to differ on the length of the first and last exons, since these lengths will naturally vary from sample to sample due to the random nature of sequencing.
+If you ran cuffcompare with the -r option, the first and second columns contain the closest matching reference transcript to the one described by each row.
+
+Here's an example of a line from the tracking file::
+
+ TCONS_00000045 XLOC_000023 Tcea|uc007afj.1 j \
+ q1:exp.115|exp.115.0|100|3.061355|0.350242|0.350207 \
+ q2:60hr.292|60hr.292.0|100|4.094084|0.000000|0.000000
+
+In this example, a transcript present in the two input files, called exp.115.0 in the first and 60hr.292.0 in the second, doesn't match any reference transcript exactly, but shares exons with uc007afj.1, an isoform of the gene Tcea, as indicated by the class code j. The first three columns are as follows::
+
+ Column number Column name Example Description
+ -----------------------------------------------------------------------
+ 1 Cufflinks transfrag id TCONS_00000045 A unique internal id for the transfrag
+ 2 Cufflinks locus id XLOC_000023 A unique internal id for the locus
+ 3 Reference gene id Tcea The gene_name attribute of the reference GTF record for this transcript, or '-' if no reference transcript overlaps this Cufflinks transcript
+ 4 Reference transcript id uc007afj.1 The transcript_id attribute of the reference GTF record for this transcript, or '-' if no reference transcript overlaps this Cufflinks transcript
+ 5 Class code c The type of match between the Cufflinks transcripts in column 6 and the reference transcript. See class codes
+
+Each of the columns after the fifth have the following format:
+ qJ:gene_id|transcript_id|FMI|FPKM|conf_lo|conf_hi
+
+A transcript need be present in all samples to be reported in the tracking file. A sample not containing a transcript will have a "-" in its entry in the row for that transcript.
+
+Class Codes
+
+If you ran cuffcompare with the -r option, tracking rows will contain the following values. If you did not use -r, the rows will all contain "-" in their class code column::
+
+ Priority Code Description
+ ---------------------------------
+ 1 = Match
+ 2 c Contained
+ 3 j New isoform
+ 4 e A single exon transcript overlapping a reference exon and at least 10 bp of a reference intron, indicating a possible pre-mRNA fragment.
+ 5 i A single exon transcript falling entirely with a reference intron
+ 6 r Repeat. Currently determined by looking at the reference sequence and applied to transcripts where at least 50% of the bases are lower case
+ 7 p Possible polymerase run-on fragment
+ 8 u Unknown, intergenic transcript
+ 9 o Unknown, generic overlap with reference
+ 10 . (.tracking file only, indicates multiple classifications)
+
+-------
+
+**Settings**
+
+All of the options have a default value. You can change any of them. Most of the options in Cuffcompare have been implemented here.
+
+------
+
+**Cuffcompare parameter list**
+
+This is a list of implemented Cuffcompare options::
+
+ -r An optional "reference" annotation GTF. Each sample is matched against this file, and sample isoforms are tagged as overlapping, matching, or novel where appropriate. See the refmap and tmap output file descriptions below.
+ -R If -r was specified, this option causes cuffcompare to ignore reference transcripts that are not overlapped by any transcript in one of cuff1.gtf,...,cuffN.gtf. Useful for ignoring annotated transcripts that are not present in your RNA-Seq samples and thus adjusting the "sensitivity" calculation in the accuracy report written in the transcripts_accuracy file
+ </help>
+</tool>
1
0

10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/b8d25aabb98d
changeset: 3670:b8d25aabb98d
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Tue Apr 20 11:47:51 2010 -0400
description:
Make failing to load datatype converters and display applications more graceful when given nonexistent file paths. A missing converter will still allow the application to start and a missing display application will not prevent a datatype from loading.
diffstat:
lib/galaxy/datatypes/registry.py | 46 ++++++++++++++++++++++-----------------
1 files changed, 26 insertions(+), 20 deletions(-)
diffs (63 lines):
diff -r e47ff545931f -r b8d25aabb98d lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py Mon Apr 19 17:41:35 2010 -0400
+++ b/lib/galaxy/datatypes/registry.py Tue Apr 20 11:47:51 2010 -0400
@@ -90,20 +90,22 @@
mimetype = composite_file.get( 'mimetype', None )
self.datatypes_by_extension[extension].add_composite_file( name, optional=optional, mimetype=mimetype )
for display_app in elem.findall( 'display' ):
- display_file = display_app.get( 'file', None )
- assert display_file is not None, "A file must be specified for a datatype display tag."
- inherit = galaxy.util.string_as_bool( display_app.get( 'inherit', 'False' ) )
- display_app = DisplayApplication.from_file( os.path.join( self.display_applications_path, display_file ), self )
- if display_app:
- if display_app.id in self.display_applications:
- #if we already loaded this display application, we'll use the first one again
- display_app = self.display_applications[ display_app.id ]
- self.log.debug( "Loaded display application '%s' for datatype '%s', inherit=%s" % ( display_app.id, extension, inherit ) )
- self.display_applications[ display_app.id ] = display_app #Display app by id
- self.datatypes_by_extension[ extension ].add_display_application( display_app )
- if inherit and ( self.datatypes_by_extension[extension], display_app ) not in inherit_display_application_by_class:
- #subclass inheritance will need to wait until all datatypes have been loaded
- inherit_display_application_by_class.append( ( self.datatypes_by_extension[extension], display_app ) )
+ display_file = os.path.join( self.display_applications_path, display_app.get( 'file', None ) )
+ try:
+ inherit = galaxy.util.string_as_bool( display_app.get( 'inherit', 'False' ) )
+ display_app = DisplayApplication.from_file( display_file, self )
+ if display_app:
+ if display_app.id in self.display_applications:
+ #if we already loaded this display application, we'll use the first one again
+ display_app = self.display_applications[ display_app.id ]
+ self.log.debug( "Loaded display application '%s' for datatype '%s', inherit=%s" % ( display_app.id, extension, inherit ) )
+ self.display_applications[ display_app.id ] = display_app #Display app by id
+ self.datatypes_by_extension[ extension ].add_display_application( display_app )
+ if inherit and ( self.datatypes_by_extension[extension], display_app ) not in inherit_display_application_by_class:
+ #subclass inheritance will need to wait until all datatypes have been loaded
+ inherit_display_application_by_class.append( ( self.datatypes_by_extension[extension], display_app ) )
+ except:
+ self.log.exception( "error reading display application from path: %s" % display_file )
except Exception, e:
self.log.warning( 'Error loading datatype "%s", problem: %s' % ( extension, str( e ) ) )
# Handle display_application subclass inheritance here:
@@ -290,12 +292,16 @@
tool_config = elem[0]
source_datatype = elem[1]
target_datatype = elem[2]
- converter = toolbox.load_tool( os.path.join( self.datatype_converters_path, tool_config ) )
- toolbox.tools_by_id[converter.id] = converter
- if source_datatype not in self.datatype_converters:
- self.datatype_converters[source_datatype] = odict()
- self.datatype_converters[source_datatype][target_datatype] = converter
- self.log.debug( "Loaded converter: %s", converter.id )
+ converter_path = os.path.join( self.datatype_converters_path, tool_config )
+ try:
+ converter = toolbox.load_tool( converter_path )
+ toolbox.tools_by_id[converter.id] = converter
+ if source_datatype not in self.datatype_converters:
+ self.datatype_converters[source_datatype] = odict()
+ self.datatype_converters[source_datatype][target_datatype] = converter
+ self.log.debug( "Loaded converter: %s", converter.id )
+ except:
+ self.log.exception( "error reading converter from path: %s" % converter_path )
def load_external_metadata_tool( self, toolbox ):
"""Adds a tool which is used to set external metadata"""
1
0

10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/91b8f0abffc8
changeset: 3668:91b8f0abffc8
user: Kanwei Li <kanwei(a)gmail.com>
date: Mon Apr 19 16:03:24 2010 -0400
description:
User-custom dbkeys can now be set for datasets in Edit Attributes and upload
Always use autocomplete for dbkey entry (used to be >20)
diffstat:
lib/galaxy/web/controllers/tracks.py | 15 +++++++--------
lib/galaxy/web/framework/__init__.py | 12 +++++++++---
static/scripts/galaxy.base.js | 8 ++++----
static/scripts/packed/galaxy.base.js | 2 +-
4 files changed, 21 insertions(+), 16 deletions(-)
diffs (104 lines):
diff -r 3c6ffa5362d2 -r 91b8f0abffc8 lib/galaxy/web/controllers/tracks.py
--- a/lib/galaxy/web/controllers/tracks.py Mon Apr 19 14:09:07 2010 -0400
+++ b/lib/galaxy/web/controllers/tracks.py Mon Apr 19 16:03:24 2010 -0400
@@ -21,7 +21,6 @@
from galaxy.web.framework import simplejson
from galaxy.web.framework.helpers import time_ago, grids
from galaxy.util.bunch import Bunch
-from galaxy.util import dbnames
from galaxy.visualization.tracks.data.array_tree import ArrayTreeDataProvider
from galaxy.visualization.tracks.data.interval_index import IntervalIndexDataProvider
@@ -79,7 +78,7 @@
"""
available_tracks = None
- len_dbkeys = None
+ len_files = None
@web.expose
@web.require_login()
@@ -91,17 +90,17 @@
@web.expose
@web.require_login()
def new_browser( self, trans ):
- if not self.len_dbkeys:
+ if not self.len_files:
len_files = glob.glob(os.path.join( trans.app.config.tool_data_path, 'shared','ucsc','chrom', "*.len" ))
- len_files = [ os.path.split(f)[1].split(".len")[0] for f in len_files ] # get xxx.len
- loaded_dbkeys = dbnames
- self.len_dbkeys = [ (k, v) for k, v in loaded_dbkeys if k in len_files ]
+ self.len_files = [ os.path.split(f)[1].split(".len")[0] for f in len_files ] # get xxx.len
- user_keys = None
+ user_keys = {}
user = trans.get_user()
if 'dbkeys' in user.preferences:
user_keys = from_json_string( user.preferences['dbkeys'] )
- return trans.fill_template( "tracks/new_browser.mako", user_keys=user_keys, dbkeys=self.len_dbkeys )
+
+ dbkeys = [ (k, v) for k, v in trans.db_builds if k in self.len_files or k in user_keys ]
+ return trans.fill_template( "tracks/new_browser.mako", dbkeys=dbkeys )
@web.json
@web.require_login()
diff -r 3c6ffa5362d2 -r 91b8f0abffc8 lib/galaxy/web/framework/__init__.py
--- a/lib/galaxy/web/framework/__init__.py Mon Apr 19 14:09:07 2010 -0400
+++ b/lib/galaxy/web/framework/__init__.py Mon Apr 19 16:03:24 2010 -0400
@@ -10,7 +10,7 @@
import base
import pickle
from galaxy import util
-from galaxy.util.json import to_json_string
+from galaxy.util.json import to_json_string, from_json_string
pkg_resources.require( "simplejson" )
import simplejson
@@ -657,10 +657,16 @@
dbnames = list()
datasets = self.sa_session.query( self.app.model.HistoryDatasetAssociation ) \
.filter_by( deleted=False, history_id=self.history.id, extension="len" )
- if datasets.count() > 0:
- dbnames.append( (util.dbnames.default_value, '--------- User Defined Builds ----------') )
+
for dataset in datasets:
dbnames.append( (dataset.dbkey, dataset.name) )
+
+ user = self.get_user()
+ if user and 'dbkeys' in user.preferences:
+ user_keys = from_json_string( user.preferences['dbkeys'] )
+ for key, chrom_dict in user_keys.iteritems():
+ dbnames.append((key, "%s (%s) [Custom]" % (chrom_dict['name'], key) ))
+
dbnames.extend( util.dbnames )
return dbnames
diff -r 3c6ffa5362d2 -r 91b8f0abffc8 static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js Mon Apr 19 14:09:07 2010 -0400
+++ b/static/scripts/galaxy.base.js Mon Apr 19 16:03:24 2010 -0400
@@ -144,13 +144,13 @@
return 0;
}
-// Replace any select box with 20+ options with a text input box + autocomplete.
+// Replace select box with a text input box + autocomplete.
// TODO: make work with dynamic tool inputs and then can replace all big selects.
-function replace_big_select_inputs() {
+function replace_big_select_inputs(min_length) {
$('select[name=dbkey]').each( function() {
var select_elt = $(this);
- // Skip if there are < 20 options.
- if (select_elt.find('option').length < 20)
+ // Skip if # of options < threshold
+ if (min_length !== undefined && select_elt.find('option').length < min_length)
return;
// Replace select with text + autocomplete.
diff -r 3c6ffa5362d2 -r 91b8f0abffc8 static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js Mon Apr 19 14:09:07 2010 -0400
+++ b/static/scripts/packed/galaxy.base.js Mon Apr 19 16:03:24 2010 -0400
@@ -1,1 +1,1 @@
-$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmen!
u(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function naturalSort(i,g){var n=/(-?[0-9\.]+)/g,j=i.toString().toLowerCase()||"",f=g.toString()!
.toLowerCase()||"",k=String.fromCharCode(0),l=j.replace(n,k+"$1"+k).sp
lit(k),e=f.replace(n,k+"$1"+k).split(k),d=(new Date(j)).getTime(),m=d?(new Date(f)).getTime():null;if(m){if(d<m){return -1}else{if(d>m){return 1}}}for(var h=0,c=Math.max(l.length,e.length);h<c;h++){oFxNcL=parseFloat(l[h])||l[h];oFyNcL=parseFloat(e[h])||e[h];if(oFxNcL<oFyNcL){return -1}else{if(oFxNcL>oFyNcL){return 1}}}return 0}function replace_big_select_inputs(){$("select[name=dbkey]").each(function(){var a=$(this);if(a.find("option").length<20){return}var b=a.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",a.attr("name"));c.attr("id",a.attr("id"));c.click(function(){var h=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",h);$(this).select()});var g=[];var f={};a.children("option").each(function(){var i=$(this).text();var h=$(this).attr("value");if(h=="?"){return}g.push(i);f[i]=h;f[h]=h;if(h==b){c.attr("value",i)}});g.push("unspecified (?)");f["unsp!
ecified (?)"]="?";f["?"]="?";if(c.attr("value")==""){c.attr("value","Click to Search or Select")}g=g.sort(naturalSort);var e={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};c.autocomplete(g,e);a.replaceWith(c);var d=function(){var i=c.attr("value");var h=f[i];if(h!==null&&h!==undefined){c.attr("value",h)}else{if(b!=""){c.attr("value",b)}else{c.attr("value","?")}}};c.parents("form").submit(function(){d()});$(document).bind("convert_dbkeys",function(){d()})})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this!
).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();
$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStore.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id;var h=$(this).children("div.historyItemBody");var i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void();'></a>").click(function(){if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){var k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("history_expand_st!
ate",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.engineReady(function(){b()})}}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
+$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmen!
u(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function naturalSort(i,g){var n=/(-?[0-9\.]+)/g,j=i.toString().toLowerCase()||"",f=g.toString()!
.toLowerCase()||"",k=String.fromCharCode(0),l=j.replace(n,k+"$1"+k).sp
lit(k),e=f.replace(n,k+"$1"+k).split(k),d=(new Date(j)).getTime(),m=d?(new Date(f)).getTime():null;if(m){if(d<m){return -1}else{if(d>m){return 1}}}for(var h=0,c=Math.max(l.length,e.length);h<c;h++){oFxNcL=parseFloat(l[h])||l[h];oFyNcL=parseFloat(e[h])||e[h];if(oFxNcL<oFyNcL){return -1}else{if(oFxNcL>oFyNcL){return 1}}}return 0}function replace_big_select_inputs(a){$("select[name=dbkey]").each(function(){var b=$(this);if(a!==undefined&&b.find("option").length<a){return}var c=b.attr("value");var d=$("<input type='text' class='text-and-autocomplete-select'></input>");d.attr("size",40);d.attr("name",b.attr("name"));d.attr("id",b.attr("id"));d.click(function(){var i=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",i);$(this).select()});var h=[];var g={};b.children("option").each(function(){var j=$(this).text();var i=$(this).attr("value");if(i=="?"){return}h.push(j);g[j]=i;g[i]=i;if(i==c){d.attr("value",j)}});h.push("unspecifie!
d (?)");g["unspecified (?)"]="?";g["?"]="?";if(d.attr("value")==""){d.attr("value","Click to Search or Select")}h=h.sort(naturalSort);var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};d.autocomplete(h,f);b.replaceWith(d);var e=function(){var j=d.attr("value");var i=g[j];if(i!==null&&i!==undefined){d.attr("value",i)}else{if(c!=""){d.attr("value",c)}else{d.attr("value","?")}}};d.parents("form").submit(function(){e()});$(document).bind("convert_dbkeys",function(){e()})})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCo!
de===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]
=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStore.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id;var h=$(this).children("div.historyItemBody");var i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void();'></a>").click(function(){if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){var k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("hi!
story_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.engineReady(function(){b()})}}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/3c6ffa5362d2
changeset: 3667:3c6ffa5362d2
user: Kanwei Li <kanwei(a)gmail.com>
date: Mon Apr 19 14:09:07 2010 -0400
description:
Fix autocomplete for Edit Attributes dbkeys
diffstat:
templates/dataset/edit_attributes.mako | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r af004e0932b7 -r 3c6ffa5362d2 templates/dataset/edit_attributes.mako
--- a/templates/dataset/edit_attributes.mako Mon Apr 19 11:40:20 2010 -0400
+++ b/templates/dataset/edit_attributes.mako Mon Apr 19 14:09:07 2010 -0400
@@ -4,12 +4,12 @@
<%def name="title()">${_('Edit Dataset Attributes')}</%def>
<%def name="stylesheets()">
- ${h.css( "base" )}
+ ${h.css( "base", "autocomplete_tagging" )}
</%def>
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "galaxy.base" )}
+ ${h.js( "galaxy.base", "jquery.autocomplete", "autocomplete_tagging" )}
</%def>
<%def name="datatype( dataset, datatypes )">
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/af004e0932b7
changeset: 3666:af004e0932b7
user: Nate Coraor <nate(a)bx.psu.edu>
date: Mon Apr 19 11:40:20 2010 -0400
description:
Add column join tool to main tool conf
diffstat:
tool_conf.xml.main | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diffs (11 lines):
diff -r 239fb5cf4e37 -r af004e0932b7 tool_conf.xml.main
--- a/tool_conf.xml.main Mon Apr 19 11:14:19 2010 -0400
+++ b/tool_conf.xml.main Mon Apr 19 11:40:20 2010 -0400
@@ -70,6 +70,7 @@
<tool file="filters/compare.xml"/>
<tool file="new_operations/subtract_query.xml"/>
<tool file="stats/grouping.xml" />
+ <tool file="new_operations/column_join.xml"/>
</section>
<section name="Extract Features" id="features">
<tool file="filters/ucsc_gene_bed_to_exon_bed.xml" />
1
0

10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/239fb5cf4e37
changeset: 3665:239fb5cf4e37
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Mon Apr 19 11:14:19 2010 -0400
description:
Add GTF file format to Galaxy. GTF format is an extension of GFF format that is used by Tophat and Cufflinks tool suite.
diffstat:
datatypes_conf.xml.sample | 1 +
lib/galaxy/datatypes/interval.py | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diffs (25 lines):
diff -r d3ff52561d78 -r 239fb5cf4e37 datatypes_conf.xml.sample
--- a/datatypes_conf.xml.sample Mon Apr 19 11:08:25 2010 -0400
+++ b/datatypes_conf.xml.sample Mon Apr 19 11:14:19 2010 -0400
@@ -51,6 +51,7 @@
<datatype extension="gff3" type="galaxy.datatypes.interval:Gff3" display_in_upload="true"/>
<datatype extension="gif" type="galaxy.datatypes.images:Image" mimetype="image/gif"/>
<datatype extension="gmaj.zip" type="galaxy.datatypes.images:Gmaj" mimetype="application/zip"/>
+ <datatype extension="gtf" type="galaxy.datatypes.interval:Gtf" display_in_upload="true"/>
<datatype extension="html" type="galaxy.datatypes.images:Html" mimetype="text/html"/>
<datatype extension="interval" type="galaxy.datatypes.interval:Interval" display_in_upload="true">
<converter file="interval_to_bed_converter.xml" target_datatype="bed"/>
diff -r d3ff52561d78 -r 239fb5cf4e37 lib/galaxy/datatypes/interval.py
--- a/lib/galaxy/datatypes/interval.py Mon Apr 19 11:08:25 2010 -0400
+++ b/lib/galaxy/datatypes/interval.py Mon Apr 19 11:14:19 2010 -0400
@@ -831,6 +831,10 @@
except:
return False
+class Gtf( Tabular ):
+ """Tab delimited data in Gtf format"""
+ file_ext = "gtf"
+
class Wiggle( Tabular, _RemoteCallMixin ):
"""Tab delimited data in wiggle format"""
file_ext = "wig"
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/d3ff52561d78
changeset: 3664:d3ff52561d78
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Mon Apr 19 11:08:25 2010 -0400
description:
Complete Cufflinks wrapper.
diffstat:
tools/ngs_rna/cufflinks_wrapper.py | 64 +++++++++++++++++++-------
tools/ngs_rna/cufflinks_wrapper.xml | 88 ++++++++++++++++++++++++++++++++++--
2 files changed, 128 insertions(+), 24 deletions(-)
diffs (244 lines):
diff -r efd404f7a60b -r d3ff52561d78 tools/ngs_rna/cufflinks_wrapper.py
--- a/tools/ngs_rna/cufflinks_wrapper.py Fri Apr 16 18:46:35 2010 -0400
+++ b/tools/ngs_rna/cufflinks_wrapper.py Mon Apr 19 11:08:25 2010 -0400
@@ -10,20 +10,20 @@
#Parse Command Line
parser = optparse.OptionParser()
parser.add_option( '-1', '--input', dest='input', help=' file of RNA-Seq read alignments in the SAM format. SAM is a standard short read alignment, that allows aligners to attach custom tags to individual alignments, and Cufflinks requires that the alignments you supply have some of these tags. Please see Input formats for more details.' )
- parser.add_option( '-s', '--inner-dist-std-dev', help='The standard deviation for the distribution on inner distances between mate pairs. The default is 20bp.' )
- parser.add_option( '-I', '--max-intron-length', help='The minimum intron length. Cufflinks will not report transcripts with introns longer than this, and will ignore SAM alignments with REF_SKIP CIGAR operations longer than this. The default is 300,000.' )
- parser.add_option( '-F', '--min-isoform-fraction', help='After calculating isoform abundance for a gene, Cufflinks filters out transcripts that it believes are very low abundance, because isoforms expressed at extremely low levels often cannot reliably be assembled, and may even be artifacts of incompletely spliced precursors of processed transcripts. This parameter is also used to filter out introns that have far fewer spliced alignments supporting them. The default is 0.05, or 5% of the most abundant isoform (the major isoform) of the gene.' )
- parser.add_option( '-j', '--pre-mrna-fraction', help='Some RNA-Seq protocols produce a significant amount of reads that originate from incompletely spliced transcripts, and these reads can confound the assembly of fully spliced mRNAs. Cufflinks uses this parameter to filter out alignments that lie within the intronic intervals implied by the spliced alignments. The minimum depth of coverage in the intronic region covered by the alignment is divided by the number of spliced reads, and if the result is lower than this parameter value, the intronic alignments are ignored. The default is 5%.' )
- parser.add_option( '-p', '--num-threads', help='Use this many threads to align reads. The default is 1.' )
+ parser.add_option( '-s', '--inner-dist-std-dev', dest='inner_dist_std_dev', help='The standard deviation for the distribution on inner distances between mate pairs. The default is 20bp.' )
+ parser.add_option( '-I', '--max-intron-length', dest='max_intron_len', help='The minimum intron length. Cufflinks will not report transcripts with introns longer than this, and will ignore SAM alignments with REF_SKIP CIGAR operations longer than this. The default is 300,000.' )
+ parser.add_option( '-F', '--min-isoform-fraction', dest='min_isoform_fraction', help='After calculating isoform abundance for a gene, Cufflinks filters out transcripts that it believes are very low abundance, because isoforms expressed at extremely low levels often cannot reliably be assembled, and may even be artifacts of incompletely spliced precursors of processed transcripts. This parameter is also used to filter out introns that have far fewer spliced alignments supporting them. The default is 0.05, or 5% of the most abundant isoform (the major isoform) of the gene.' )
+ parser.add_option( '-j', '--pre-mrna-fraction', dest='pre_mrna_fraction', help='Some RNA-Seq protocols produce a significant amount of reads that originate from incompletely spliced transcripts, and these reads can confound the assembly of fully spliced mRNAs. Cufflinks uses this parameter to filter out alignments that lie within the intronic intervals implied by the spliced alignments. The minimum depth of coverage in the intronic region covered by the alignment is divided by the number of spliced reads, and if the result is lower than this parameter value, the intronic alignments are ignored. The default is 5%.' )
+ parser.add_option( '-p', '--num-threads', dest='num_threads', help='Use this many threads to align reads. The default is 1.' )
parser.add_option( '-m', '--inner-mean-dist', dest='inner_mean_dist', help='This is the expected (mean) inner distance between mate pairs. \
For, example, for paired end runs with fragments selected at 300bp, \
where each end is 50bp, you should set -r to be 200. The default is 45bp.')
- parser.add_option( '-Q', '--min-mapqual', help='Instructs Cufflinks to ignore alignments with a SAM mapping quality lower than this number. The default is 0.' )
- parser.add_option( '-L', '--label', help='Cufflinks will report transfrags in GTF format, with a prefix given by this option. The default prefix is "CUFF".' )
- parser.add_option( '-G', '--GTF', help='Tells Cufflinks to use the supplied reference annotation to estimate isoform expression. It will not assemble novel transcripts, and the program will ignore alignments not structurally compatible with any reference transcript.' )
+ parser.add_option( '-Q', '--min-mapqual', dest='min_mapqual', help='Instructs Cufflinks to ignore alignments with a SAM mapping quality lower than this number. The default is 0.' )
+ parser.add_option( '-G', '--GTF', dest='GTF', help='Tells Cufflinks to use the supplied reference annotation to estimate isoform expression. It will not assemble novel transcripts, and the program will ignore alignments not structurally compatible with any reference transcript.' )
+
# Advanced Options:
- parser.add_option( '--num-importance-samples', help='Sets the number of importance samples generated for each locus during abundance estimation. Default: 1000' )
- parser.add_option( '--max-mle-iterations', help='Sets the number of iterations allowed during maximum likelihood estimation of abundances. Default: 5000' )
+ 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' )
+ parser.add_option( '--max-mle-iterations', dest='max_mle_iterations', help='Sets the number of iterations allowed during maximum likelihood estimation of abundances. Default: 5000' )
# Wrapper / Galaxy options.
parser.add_option( '-A', '--assembled-isoforms-output', dest='assembled_isoforms_output_file', help='Assembled isoforms output file; formate is GTF.' )
@@ -41,31 +41,61 @@
cmd = "cufflinks"
# Add options.
+ if options.inner_dist_std_dev:
+ cmd += ( " -s %i" % int ( options.inner_dist_std_dev ) )
+ if options.max_intron_len:
+ cmd += ( " -I %i" % int ( options.max_intron_len ) )
+ if options.min_isoform_fraction:
+ cmd += ( " -F %f" % float ( options.min_isoform_fraction ) )
+ if options.pre_mrna_fraction:
+ cmd += ( " -j %f" % float ( options.pre_mrna_fraction ) )
+ if options.num_threads:
+ cmd += ( " -p %i" % int ( options.num_threads ) )
if options.inner_mean_dist:
cmd += ( " -m %i" % int ( options.inner_mean_dist ) )
+ if options.min_mapqual:
+ cmd += ( " -Q %i" % int ( options.min_mapqual ) )
+ if options.GTF:
+ cmd += ( " -G %i" % options.GTF )
+ if options.num_importance_samples:
+ cmd += ( " --num-importance-samples %i" % int ( options.num_importance_samples ) )
+ if options.max_mle_iterations:
+ cmd += ( " --max-mle-iterations %i" % int ( options.max_mle_iterations ) )
# Add input files.
cmd += " " + options.input
-
- # Run
+ print cmd
+
+ # Run command.
try:
- proc = subprocess.Popen( args=cmd, shell=True, cwd=tmp_output_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
+ tmp_name = tempfile.NamedTemporaryFile( dir=tmp_output_dir ).name
+ tmp_stderr = open( tmp_name, 'wb' )
+ proc = subprocess.Popen( args=cmd, shell=True, cwd=tmp_output_dir, stderr=tmp_stderr.fileno() )
returncode = proc.wait()
+ tmp_stderr.close()
+
+ # Get stderr, allowing for case where it's very large.
+ tmp_stderr = open( tmp_name, 'rb' )
stderr = ''
buffsize = 1048576
try:
while True:
- stderr += proc.stderr.read( buffsize )
+ stderr += tmp_stderr.read( buffsize )
if not stderr or len( stderr ) % buffsize != 0:
break
except OverflowError:
pass
+ tmp_stderr.close()
+
+ # Error checking.
if returncode != 0:
raise Exception, stderr
+
+ # check that there are results in the output file
+ if len( open( tmp_output_dir + "/transcripts.gtf", 'rb' ).read().strip() ) == 0:
+ raise Exception, 'The main output file is empty, there may be an error with your input file or settings.'
except Exception, e:
- stop_err( 'Error in cufflinks:\n' + str( e ) )
-
- # TODO: look for errors in program output.
+ stop_err( 'Error running cufflinks. ' + str( e ) )
# Copy output files from tmp directory to specified files.
try:
diff -r efd404f7a60b -r d3ff52561d78 tools/ngs_rna/cufflinks_wrapper.xml
--- a/tools/ngs_rna/cufflinks_wrapper.xml Fri Apr 16 18:46:35 2010 -0400
+++ b/tools/ngs_rna/cufflinks_wrapper.xml Mon Apr 19 11:08:25 2010 -0400
@@ -1,5 +1,5 @@
<tool id="cufflinks" name="Cufflinks" version="0.8.2">
- <description>Transcript assembly, differential expression, and differential regulation for RNA-Seq</description>
+ <description>transcript assembly, differential expression, and differential regulation for RNA-Seq</description>
<command interpreter="python">
cufflinks_wrapper.py
--input=$input
@@ -7,24 +7,46 @@
--transcripts-expression-output=$transcripts_expression
--genes-expression-output=$genes_expression
--num-threads="4"
+ -I $max_intron_len
+ -F $min_isoform_fraction
+ -j $pre_mrna_fraction
+ -Q $min_map_quality
+ #if $reference_annotation.use_ref == "Yes":
+ -G $reference_annotation.reference_annotation_file
+ #end if
#if $singlePaired.sPaired == "paired":
-r $singlePaired.mean_inner_distance
+ -s $singlePaired.inner_distance_std_dev
#end if
</command>
<inputs>
<param format="sam" name="input" type="data" label="SAM file of aligned RNA-Seq reads" help=""/>
+ <param name="max_intron_len" type="integer" value="300000" label="Max Intron Length" help=""/>
+ <param name="min_isoform_fraction" type="float" value="0.05" label="Min Isoform Fraction" help=""/>
+ <param name="pre_mrna_fraction" type="float" value="0.05" label="Pre MRNA Fraction" help=""/>
+ <param name="min_map_quality" type="integer" value="0" label="Min SAM Map Quality" help=""/>
+ <conditional name="reference_annotation">
+ <param name="use_ref" type="select" label="Use Reference Annotation?">
+ <option value="No">No</option>
+ <option value="Yes">Yes</option>
+ </param>
+ <when value="No"></when>
+ <when value="Yes">
+ <param format="gtf" name="reference_annotation_file" type="data" label="Reference Annotation" help=""/>
+ </when>
+ </conditional>
<conditional name="singlePaired">
<param name="sPaired" type="select" label="Is this library mate-paired?">
<option value="single">Single-end</option>
<option value="paired">Paired-end</option>
</param>
- <when value="single">
-
- </when>
+ <when value="single"></when>
<when value="paired">
<param name="mean_inner_distance" type="integer" value="20" label="Mean Inner Distance between Mate Pairs"/>
+ <param name="inner_distance_std_dev" type="integer" value="20" label="Standard Deviation for Inner Distance between Mate Pairs"/>
</when>
</conditional>
+
</inputs>
<outputs>
@@ -67,19 +89,64 @@
**Input formats**
-Cufflinks accepts files in SAM format.
+Cufflinks takes a text file of SAM alignments as input. The RNA-Seq read mapper TopHat produces output in this format, and is recommended for use with Cufflinks. However Cufflinks will accept SAM alignments generated by any read mapper. Here's an example of an alignment Cufflinks will accept::
+
+ s6.25mer.txt-913508 16 chr1 4482736 255 14M431N11M * 0 0 \
+ CAAGATGCTAGGCAAGTCTTGGAAG IIIIIIIIIIIIIIIIIIIIIIIII NM:i:0 XS:A:-
+
+Note the use of the custom tag XS. This attribute, which must have a value of "+" or "-", indicates which strand the RNA that produced this read came from. While this tag can be applied to any alignment, including unspliced ones, it must be present for all spliced alignment records (those with a 'N' operation in the CIGAR string).
+The SAM file supplied to Cufflinks must be sorted by reference position. If you aligned your reads with TopHat, your alignments will be properly sorted already. If you used another tool, you may want to make sure they are properly sorted as follows::
+
+ sort -k 3,3 -k 4,4n hits.sam > hits.sam.sorted
+
+NOTE: Cufflinks currently only supports SAM alignments with the CIGAR match ('M') and reference skip ('N') operations. Support for the other operations, such as insertions, deletions, and clipping, will be added in the future.
------
**Outputs**
-TODO
+Cufflinks produces three output files:
+
+Transcripts and Genes:
+
+This GTF file contains Cufflinks' assembled isoforms. The first 7 columns are standard GTF, and the last column contains attributes, some of which are also standardized (e.g. gene_id, transcript_id). There one GTF record per row, and each record represents either a transcript or an exon within a transcript. The columns are defined as follows::
+
+ Column number Column name Example Description
+ -----------------------------------------------------
+ 1 seqname chrX Chromosome or contig name
+ 2 source Cufflinks The name of the program that generated this file (always 'Cufflinks')
+ 3 feature exon The type of record (always either "transcript" or "exon").
+ 4 start 77696957 The leftmost coordinate of this record (where 0 is the leftmost possible coordinate)
+ 5 end 77712009 The rightmost coordinate of this record, inclusive.
+ 6 score 77712009 The most abundant isoform for each gene is assigned a score of 1000. Minor isoforms are scored by the ratio (minor FPKM/major FPKM)
+ 7 strand + Cufflinks' guess for which strand the isoform came from. Always one of '+', '-' '.'
+ 7 frame . Cufflinks does not predict where the start and stop codons (if any) are located within each transcript, so this field is not used.
+ 8 attributes See below
+
+Each GTF record is decorated with the following attributes::
+
+ Attribute Example Description
+ -----------------------------------------
+ gene_id CUFF.1 Cufflinks gene id
+ transcript_id CUFF.1.1 Cufflinks transcript id
+ FPKM 101.267 Isoform-level relative abundance in Reads Per Kilobase of exon model per Million mapped reads
+ frac 0.7647 Reserved. Please ignore, as this attribute may be deprecated in the future
+ conf_lo 0.07 Lower bound of the 95% confidence interval of the abundance of this isoform, as a fraction of the isoform abundance. That is, lower bound = FPKM * (1.0 - conf_lo)
+ conf_hi 0.1102 Upper bound of the 95% confidence interval of the abundance of this isoform, as a fraction of the isoform abundance. That is, upper bound = FPKM * (1.0 + conf_lo)
+ cov 100.765 Estimate for the absolute depth of read coverage across the whole transcript
+
+
+Transcripts only:
+ This file is simply a tab delimited file containing one row per transcript and with columns containing the attributes above. There are a few additional attributes not in the table above, but these are reserved for debugging, and may change or disappear in the future.
+
+Genes only:
+This file contains gene-level coordinates and expression values.
-------
**Cufflinks settings**
-All of the options have a default value. You can change any of them. Some of the options in Cufflinks have been implemented here.
+All of the options have a default value. You can change any of them. Most of the options in Cufflinks have been implemented here.
------
@@ -87,5 +154,12 @@
This is a list of implemented Cufflinks options::
+ -m INT This is the expected (mean) inner distance between mate pairs. For, example, for paired end runs with fragments selected at 300bp, where each end is 50bp, you should set -r to be 200. The default is 45bp.
+ -s INT The standard deviation for the distribution on inner distances between mate pairs. The default is 20bp.
+ -I INT The minimum intron length. Cufflinks will not report transcripts with introns longer than this, and will ignore SAM alignments with REF_SKIP CIGAR operations longer than this. The default is 300,000.
+ -F After calculating isoform abundance for a gene, Cufflinks filters out transcripts that it believes are very low abundance, because isoforms expressed at extremely low levels often cannot reliably be assembled, and may even be artifacts of incompletely spliced precursors of processed transcripts. This parameter is also used to filter out introns that have far fewer spliced alignments supporting them. The default is 0.05, or 5% of the most abundant isoform (the major isoform) of the gene.
+ -j Some RNA-Seq protocols produce a significant amount of reads that originate from incompletely spliced transcripts, and these reads can confound the assembly of fully spliced mRNAs. Cufflinks uses this parameter to filter out alignments that lie within the intronic intervals implied by the spliced alignments. The minimum depth of coverage in the intronic region covered by the alignment is divided by the number of spliced reads, and if the result is lower than this parameter value, the intronic alignments are ignored. The default is 5%.
+ -Q Instructs Cufflinks to ignore alignments with a SAM mapping quality lower than this number. The default is 0.
+ -G Tells Cufflinks to use the supplied reference annotation to estimate isoform expression. It will not assemble novel transcripts, and the program will ignore alignments not structurally compatible with any reference transcript.
</help>
</tool>
1
0

10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/efd404f7a60b
changeset: 3663:efd404f7a60b
user: Kanwei Li <kanwei(a)gmail.com>
date: Fri Apr 16 18:46:35 2010 -0400
description:
Fix issue where you cannot expand datasets in history pane after uploading a new dataset
Alphanumeric sort when generating select field for dbkeys
trackster now supports custom dbkeys (but datasets don't yet)
diffstat:
lib/galaxy/web/controllers/tracks.py | 37 ++++++++++++++-----
static/images/fugue/chart.png | 0
static/june_2007_style/base.css.tmpl | 8 ++-
static/june_2007_style/blue/base.css | 1 +
static/scripts/galaxy.base.js | 48 +++++++++++++++++++++----
static/scripts/packed/galaxy.base.js | 2 +-
templates/display_base.mako | 2 +-
templates/history/view.mako | 2 +-
templates/page/display.mako | 2 +-
templates/root/history.mako | 29 +++++++++++++++
templates/root/history_common.mako | 14 +++++--
templates/tracks/browser.mako | 65 +++++++++++++++++++---------------
templates/tracks/new_browser.mako | 16 +++++--
templates/user/dbkeys.mako | 4 +-
14 files changed, 165 insertions(+), 65 deletions(-)
diffs (527 lines):
diff -r 6be8d5818087 -r efd404f7a60b lib/galaxy/web/controllers/tracks.py
--- a/lib/galaxy/web/controllers/tracks.py Thu Apr 15 21:41:50 2010 -0400
+++ b/lib/galaxy/web/controllers/tracks.py Fri Apr 16 18:46:35 2010 -0400
@@ -13,14 +13,15 @@
need to support that, but need to make user defined build support better)
"""
-import math, re, logging
+import math, re, logging, glob
log = logging.getLogger(__name__)
-from galaxy.util.json import to_json_string
+from galaxy.util.json import to_json_string, from_json_string
from galaxy.web.base.controller import *
from galaxy.web.framework import simplejson
from galaxy.web.framework.helpers import time_ago, grids
from galaxy.util.bunch import Bunch
+from galaxy.util import dbnames
from galaxy.visualization.tracks.data.array_tree import ArrayTreeDataProvider
from galaxy.visualization.tracks.data.interval_index import IntervalIndexDataProvider
@@ -78,8 +79,10 @@
"""
available_tracks = None
+ len_dbkeys = None
@web.expose
+ @web.require_login()
def index( self, trans ):
config = {}
@@ -88,12 +91,17 @@
@web.expose
@web.require_login()
def new_browser( self, trans ):
- dbkeys = [ d.metadata.dbkey for d in trans.get_history().datasets if not d.deleted ]
- dbkey_set = set( dbkeys )
- if not dbkey_set:
- return trans.show_error_message( "Current history has no valid datasets to visualize." )
- else:
- return trans.fill_template( "tracks/new_browser.mako", dbkey_set=dbkey_set )
+ if not self.len_dbkeys:
+ len_files = glob.glob(os.path.join( trans.app.config.tool_data_path, 'shared','ucsc','chrom', "*.len" ))
+ len_files = [ os.path.split(f)[1].split(".len")[0] for f in len_files ] # get xxx.len
+ loaded_dbkeys = dbnames
+ self.len_dbkeys = [ (k, v) for k, v in loaded_dbkeys if k in len_files ]
+
+ user_keys = None
+ user = trans.get_user()
+ if 'dbkeys' in user.preferences:
+ user_keys = from_json_string( user.preferences['dbkeys'] )
+ return trans.fill_template( "tracks/new_browser.mako", user_keys=user_keys, dbkeys=self.len_dbkeys )
@web.json
@web.require_login()
@@ -150,6 +158,7 @@
return trans.fill_template( 'tracks/browser.mako', config=config )
@web.json
+ @web.require_login()
def chroms(self, trans, dbkey=None ):
"""
Returns a naturally sorted list of chroms/contigs for the given dbkey
@@ -173,6 +182,12 @@
Called by the browser to get a list of valid chromosomes and lengths
"""
# If there is any dataset in the history of extension `len`, this will use it
+ user = trans.get_user()
+ if 'dbkeys' in user.preferences:
+ user_keys = from_json_string( user.preferences['dbkeys'] )
+ if dbkey in user_keys:
+ return user_keys[dbkey]['chroms']
+
db_manifest = trans.db_dataset_for( dbkey )
if not db_manifest:
db_manifest = os.path.join( trans.app.config.tool_data_path, 'shared','ucsc','chrom', "%s.len" % dbkey )
@@ -214,8 +229,6 @@
if not converted_dataset or converted_dataset.state != model.Dataset.states.OK:
return messages.PENDING
-
-
extra_info = None
if 'index' in data_sources:
@@ -236,6 +249,10 @@
data = data_provider.get_data( chrom, low, high, **kwargs )
return { "dataset_type": dataset_type, "extra_info": extra_info, "data": data }
+ @web.expose
+ def list_tracks( self, trans, hid ):
+ return None
+
@web.json
def save( self, trans, **kwargs ):
session = trans.sa_session
diff -r 6be8d5818087 -r efd404f7a60b static/images/fugue/chart.png
Binary file static/images/fugue/chart.png has changed
diff -r 6be8d5818087 -r efd404f7a60b static/june_2007_style/base.css.tmpl
--- a/static/june_2007_style/base.css.tmpl Thu Apr 15 21:41:50 2010 -0400
+++ b/static/june_2007_style/base.css.tmpl Fri Apr 16 18:46:35 2010 -0400
@@ -791,13 +791,15 @@
-sprite-group: fugue;
-sprite-image: fugue/sticky-note-text.png;
}
-
+.icon-button.vis-chart {
+ background: url(/static/images/fugue/chart.png) no-repeat;
+}
.icon-button.go-to-full-screen {
- background: url(/static/images/fugue/arrow-045.png) no-repeat
+ background: url(/static/images/fugue/arrow-045.png) no-repeat;
}
.icon-button.import {
- background:url(/static/images/fugue/plus-circle.png) no-repeat
+ background:url(/static/images/fugue/plus-circle.png) no-repeat;
}
.tipsy {
diff -r 6be8d5818087 -r efd404f7a60b static/june_2007_style/blue/base.css
--- a/static/june_2007_style/blue/base.css Thu Apr 15 21:41:50 2010 -0400
+++ b/static/june_2007_style/blue/base.css Fri Apr 16 18:46:35 2010 -0400
@@ -136,6 +136,7 @@
.icon-button.bug{background:url(fugue.png) no-repeat 0px -182px;}
.icon-button.disk{background:url(fugue.png) no-repeat 0px -208px;}
.icon-button.annotate{background:url(fugue.png) no-repeat 0px -234px;}
+.icon-button.vis-chart{background:url(/static/images/fugue/chart.png) no-repeat;}
.icon-button.go-to-full-screen{background:url(/static/images/fugue/arrow-045.png) no-repeat}
.icon-button.import{background:url(/static/images/fugue/plus-circle.png) no-repeat}
.tipsy{padding:5px;font-size:10px;filter:alpha(opacity=80);background-repeat:no-repeat;background-image:url(../images/tipsy.gif);}
diff -r 6be8d5818087 -r efd404f7a60b static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js Thu Apr 15 21:41:50 2010 -0400
+++ b/static/scripts/galaxy.base.js Fri Apr 16 18:46:35 2010 -0400
@@ -119,6 +119,31 @@
return count;
}
+// Alphanumeric/natural sort fn
+function naturalSort(a, b){
+ // setup temp-scope variables for comparison evauluation
+ var re = /(-?[0-9\.]+)/g,
+ x = a.toString().toLowerCase() || '',
+ y = b.toString().toLowerCase() || '',
+ nC = String.fromCharCode(0),
+ xN = x.replace( re, nC + '$1' + nC ).split(nC),
+ yN = y.replace( re, nC + '$1' + nC ).split(nC),
+ xD = (new Date(x)).getTime(),
+ yD = xD ? (new Date(y)).getTime() : null;
+ // natural sorting of dates
+ if ( yD )
+ if ( xD < yD ) return -1;
+ else if ( xD > yD ) return 1;
+ // natural sorting through split numeric strings and default strings
+ for( var cLoc = 0, numS = Math.max(xN.length, yN.length); cLoc < numS; cLoc++ ) {
+ oFxNcL = parseFloat(xN[cLoc]) || xN[cLoc];
+ oFyNcL = parseFloat(yN[cLoc]) || yN[cLoc];
+ if (oFxNcL < oFyNcL) return -1;
+ else if (oFxNcL > oFyNcL) return 1;
+ }
+ return 0;
+}
+
// Replace any select box with 20+ options with a text input box + autocomplete.
// TODO: make work with dynamic tool inputs and then can replace all big selects.
function replace_big_select_inputs() {
@@ -135,6 +160,7 @@
var text_input_elt = $("<input type='text' class='text-and-autocomplete-select'></input>");
text_input_elt.attr('size', 40);
text_input_elt.attr('name', select_elt.attr('name'));
+ text_input_elt.attr('id', select_elt.attr('id'));
text_input_elt.click( function() {
// Show all. Also provide note that load is happening since this can be slow.
var cur_value = $(this).attr('value');
@@ -175,12 +201,15 @@
select_options.push( "unspecified (?)" );
select_mapping[ "unspecified (?)" ] = "?";
select_mapping[ "?" ] = "?";
-
+
// Set initial text if it's empty.
if ( text_input_elt.attr('value') == '' ) {
text_input_elt.attr('value', 'Click to Search or Select');
}
+ // Sort option list
+ select_options = select_options.sort(naturalSort);
+
// Do autocomplete.
var autocomplete_options = { selectFirst: false, autoFill: false, mustMatch: false, matchContains: true, max: 1000, minChars : 0, hideForLessThanMinChars : false };
text_input_elt.autocomplete(select_options, autocomplete_options);
@@ -189,7 +218,7 @@
select_elt.replaceWith(text_input_elt);
// Set trigger to replace text with value when element's form is submitted. If text doesn't correspond to value, default to start value.
- text_input_elt.parents('form').submit( function() {
+ var submit_hook = function() {
// Try to convert text to value.
var cur_value = text_input_elt.attr('value');
var new_value = select_mapping[cur_value];
@@ -205,7 +234,10 @@
text_input_elt.attr('value', '?');
}
}
- });
+ };
+
+ text_input_elt.parents('form').submit( function() { submit_hook(); } );
+ $(document).bind("convert_dbkeys", function() { submit_hook(); } );
});
}
@@ -282,7 +314,7 @@
});
}
-function init_history_items(historywrapper, noinit) {
+function init_history_items(historywrapper, noinit, nochanges) {
var action = function() {
// Load saved state and show as necessary
@@ -309,13 +341,13 @@
var id = this.id;
var body = $(this).children( "div.historyItemBody" );
var peek = body.find( "pre.peek" )
- $(this).children( ".historyItemTitleBar" ).find( ".historyItemTitle" ).wrap( "<a href='#'></a>" ).click( function() {
+ $(this).find( ".historyItemTitleBar > .historyItemTitle" ).wrap( "<a href='javascript:void();'></a>" ).click( function() {
if ( body.is(":visible") ) {
// Hiding stuff here
- if ( $.browser.mozilla ) { peek.css( "overflow", "hidden" ) }
+ if ( $.browser.mozilla ) { peek.css( "overflow", "hidden" ); }
body.slideUp( "fast" );
- if (!noinit) { // Ignore embedded item actions
+ if (!nochanges) { // Ignore embedded item actions
// Save setting
var prefs = $.jStore.store("history_expand_state");
if (prefs) {
@@ -329,7 +361,7 @@
if ( $.browser.mozilla ) { peek.css( "overflow", "auto" ); }
});
- if (!noinit) {
+ if (!nochanges) {
// Save setting
var prefs = $.jStore.store("history_expand_state");
if (prefs === undefined) { prefs = {}; }
diff -r 6be8d5818087 -r efd404f7a60b static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js Thu Apr 15 21:41:50 2010 -0400
+++ b/static/scripts/packed/galaxy.base.js Fri Apr 16 18:46:35 2010 -0400
@@ -1,1 +1,1 @@
-$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmen!
u(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function replace_big_select_inputs(){$("select[name=dbkey]").each(function(){var a=$(this);if(a!
.find("option").length<20){return}var b=a.attr("value");var c=$("<inpu
t type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",a.attr("name"));c.click(function(){var g=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",g);$(this).select()});var f=[];var e={};a.children("option").each(function(){var h=$(this).text();var g=$(this).attr("value");if(g=="?"){return}f.push(h);e[h]=g;e[g]=g;if(g==b){c.attr("value",h)}});f.push("unspecified (?)");e["unspecified (?)"]="?";e["?"]="?";if(c.attr("value")==""){c.attr("value","Click to Search or Select")}var d={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};c.autocomplete(f,d);a.replaceWith(c);c.parents("form").submit(function(){var h=c.attr("value");var g=e[h];if(g!==null&&g!==undefined){c.attr("value",g)}else{if(b!=""){c.attr("value",b)}else{c.attr("value","?")}}})})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefin!
ed){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(c,a){var b=function(){try{var d=$.jStore.store("history_expand_state");if(d){for(var f in d){$("#"+f+" div.historyItemBody").show()}}}catch(e){$.jStore.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.pee!
k").css("overflow","hidden")}})}c.each(function(){var i=this.id;var g=
$(this).children("div.historyItemBody");var h=g.find("pre.peek");$(this).children(".historyItemTitleBar").find(".historyItemTitle").wrap("<a href='#'></a>").click(function(){if(g.is(":visible")){if($.browser.mozilla){h.css("overflow","hidden")}g.slideUp("fast");if(!a){var j=$.jStore.store("history_expand_state");if(j){delete j[i];$.jStore.store("history_expand_state",j)}}}else{g.slideDown("fast",function(){if($.browser.mozilla){h.css("overflow","auto")}});if(!a){var j=$.jStore.store("history_expand_state");if(j===undefined){j={}}j[i]=true;$.jStore.store("history_expand_state",j)}}return false})});$("#top-links > a.toggle").click(function(){var g=$.jStore.store("history_expand_state");if(g===undefined){g={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(g){delete g[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",g)}).show()};if(a){b()}else{$.jStore.init("!
galaxy");$.jStore.engineReady(function(){b()})}}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
+$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmen!
u(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function naturalSort(i,g){var n=/(-?[0-9\.]+)/g,j=i.toString().toLowerCase()||"",f=g.toString()!
.toLowerCase()||"",k=String.fromCharCode(0),l=j.replace(n,k+"$1"+k).sp
lit(k),e=f.replace(n,k+"$1"+k).split(k),d=(new Date(j)).getTime(),m=d?(new Date(f)).getTime():null;if(m){if(d<m){return -1}else{if(d>m){return 1}}}for(var h=0,c=Math.max(l.length,e.length);h<c;h++){oFxNcL=parseFloat(l[h])||l[h];oFyNcL=parseFloat(e[h])||e[h];if(oFxNcL<oFyNcL){return -1}else{if(oFxNcL>oFyNcL){return 1}}}return 0}function replace_big_select_inputs(){$("select[name=dbkey]").each(function(){var a=$(this);if(a.find("option").length<20){return}var b=a.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",a.attr("name"));c.attr("id",a.attr("id"));c.click(function(){var h=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",h);$(this).select()});var g=[];var f={};a.children("option").each(function(){var i=$(this).text();var h=$(this).attr("value");if(h=="?"){return}g.push(i);f[i]=h;f[h]=h;if(h==b){c.attr("value",i)}});g.push("unspecified (?)");f["unsp!
ecified (?)"]="?";f["?"]="?";if(c.attr("value")==""){c.attr("value","Click to Search or Select")}g=g.sort(naturalSort);var e={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};c.autocomplete(g,e);a.replaceWith(c);var d=function(){var i=c.attr("value");var h=f[i];if(h!==null&&h!==undefined){c.attr("value",h)}else{if(b!=""){c.attr("value",b)}else{c.attr("value","?")}}};c.parents("form").submit(function(){d()});$(document).bind("convert_dbkeys",function(){d()})})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this!
).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();
$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStore.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id;var h=$(this).children("div.historyItemBody");var i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void();'></a>").click(function(){if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){var k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("history_expand_st!
ate",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.engineReady(function(){b()})}}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
diff -r 6be8d5818087 -r efd404f7a60b templates/display_base.mako
--- a/templates/display_base.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/display_base.mako Fri Apr 16 18:46:35 2010 -0400
@@ -64,7 +64,7 @@
});
});
// Init history boxes
- init_history_items( $("div.historyItemWrapper") );
+ init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
});
</script>
</%def>
diff -r 6be8d5818087 -r efd404f7a60b templates/history/view.mako
--- a/templates/history/view.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/history/view.mako Fri Apr 16 18:46:35 2010 -0400
@@ -8,7 +8,7 @@
${h.js( "galaxy.base", "jquery", "json2", "class", "jquery.jstore" )}
<script type="text/javascript">
$(function() {
- init_history_items( $("div.historyItemWrapper") );
+ init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
});
</script>
</%def>
diff -r 6be8d5818087 -r efd404f7a60b templates/page/display.mako
--- a/templates/page/display.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/page/display.mako Fri Apr 16 18:46:35 2010 -0400
@@ -29,7 +29,7 @@
container.find(".toggle-contract").show();
// Init needed for history items.
- init_history_items( container.find("div.historyItemWrapper"), true );
+ init_history_items( container.find("div.historyItemWrapper"), "noinit", "nochanges" );
container.find( "div.historyItemBody:visible" ).each( function() {
if ( $.browser.mozilla ) {
$(this).find( "pre.peek" ).css( "overflow", "hidden" );
diff -r 6be8d5818087 -r efd404f7a60b templates/root/history.mako
--- a/templates/root/history.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/root/history.mako Fri Apr 16 18:46:35 2010 -0400
@@ -155,6 +155,35 @@
});
});
+ // Trackster links
+ function init_trackster_links() {
+ $("a.trackster").live( "click", function() {
+ var link = $(this),
+ hid = link.attr("id").split("_")[1]; // visualize_{id}
+
+ $.ajax({
+ url: "${h.url_for( controller='tracks', action='list_tracks' )}",
+ data: {'hid': hid},
+ error: function() { alert( "Visualization error" ); },
+ success: function(html) {
+ show_modal("Add Track — Select Dataset(s)", html, {
+ "New Browser": function() {
+ hide_modal();
+ },
+ "Insert": function() {
+ hide_modal();
+ },
+ "Cancel": function() {
+ hide_modal();
+ }
+ });
+ }
+ });
+ });
+ }
+
+ init_trackster_links();
+
// History rename functionality.
async_save_text("history-name-container", "history-name", "${h.url_for( controller="/history", action="rename_async", id=trans.security.encode_id(history.id) )}", "new_name", 18);
diff -r 6be8d5818087 -r efd404f7a60b templates/root/history_common.mako
--- a/templates/root/history_common.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/root/history_common.mako Fri Apr 16 18:46:35 2010 -0400
@@ -91,6 +91,9 @@
<a href="${h.url_for( controller='dataset', action='display', dataset_id=dataset_id, to_ext=data.ext )}" title="Save" class="icon-button disk tooltip"></a>
%if user_owns_dataset:
<a href="${h.url_for( controller='tool_runner', action='rerun', id=data.id )}" target="galaxy_main" title="Run this job again" class="icon-button arrow-circle tooltip"></a>
+ %if app.config.get_bool( 'enable_tracks', False ) and data.ext in app.datatypes_registry.get_available_tracks():
+ <a class="icon-button vis-chart tooltip trackster" title="Visualize in Trackster" id="visualize_${hid}"></a>
+ %endif
%if trans.user:
<div style="float: right">
<a href="${h.url_for( controller='tag', action='retag', item_class=data.__class__.__name__, item_id=dataset_id )}" target="galaxy_main" title="Edit dataset tags" class="icon-button tags tooltip"></a>
@@ -105,8 +108,12 @@
<strong>Annotation:</strong>
<div id="${dataset_id}-annotation-elt" style="margin: 1px 0px 1px 0px" class="annotation-elt tooltip editable-text" title="Edit dataset annotation"></div>
</div>
+
%endif
%endif
+ %if data.peek != "no peek":
+ <div><pre id="peek${data.id}" class="peek">${_(data.display_peek())}</pre></div>
+ %endif
<div style="clear: both"></div>
%for display_app in data.datatype.get_display_types():
<% target_frame, display_links = data.datatype.get_display_links( data, display_app, app, request.base ) %>
@@ -121,13 +128,12 @@
%for display_app in data.get_display_applications( trans ).itervalues():
| ${display_app.name}
%for link_app in display_app.links.itervalues():
- <a target="${link_app.url.get( 'target_frame', '_blank' )}" href="${link_app.get_display_url( data, trans )}">${_(link_app.name)}</a>
+ <a target="${link_app.url.get( 'target_frame', '_blank' )}" href="${link_app.get_display_url( data, trans )}">${_(link_app.name)}</a>
%endfor
%endfor
+
</div>
- %if data.peek != "no peek":
- <div><pre id="peek${data.id}" class="peek">${_(data.display_peek())}</pre></div>
- %endif
+
%else:
<div>${_('Error: unknown dataset state "%s".') % data_state}</div>
%endif
diff -r 6be8d5818087 -r efd404f7a60b templates/tracks/browser.mako
--- a/templates/tracks/browser.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/tracks/browser.mako Fri Apr 16 18:46:35 2010 -0400
@@ -12,7 +12,7 @@
<%def name="stylesheets()">
${parent.stylesheets()}
-${h.css( "history" )}
+${h.css( "history", "autocomplete_tagging" )}
<link rel="stylesheet" type="text/css" href="${h.url_for('/static/trackster.css')}" />
<style type="text/css">
ul#sortable-ul {
@@ -82,7 +82,7 @@
<%def name="javascripts()">
${parent.javascripts()}
-${h.js( 'galaxy.base', 'galaxy.panels', "json2", "jquery", "jquery.event.drag", "jquery.mousewheel", "trackster", "ui.core", "ui.sortable" )}
+${h.js( 'galaxy.base', 'galaxy.panels', "json2", "jquery", "jquery.event.drag", "jquery.autocomplete", "jquery.mousewheel", "trackster", "ui.core", "ui.sortable" )}
<script type="text/javascript">
@@ -112,9 +112,10 @@
success: function(form_html) {
show_modal("New Track Browser", form_html, {
"Cancel": function() { window.location = "/"; },
- "Continue": continue_fn
+ "Continue": function() { $(document).trigger("convert_dbkeys"); continue_fn(); }
});
$("#new-title").focus();
+ replace_big_select_inputs();
}
});
%endif
@@ -194,7 +195,7 @@
$.ajax({
url: "${h.url_for( action='list_datasets' )}",
data: {},
- error: function() { alert( "Grid refresh failed" ) },
+ error: function() { alert( "Grid refresh failed" ); },
success: function(table_html) {
show_modal("Add Track — Select Dataset(s)", table_html, {
"Insert": function() {
@@ -271,31 +272,39 @@
view.add_label_track( new LabelTrack( $("#top-labeltrack" ) ) );
view.add_label_track( new LabelTrack( $("#nav-labeltrack" ) ) );
- $.getJSON( "${h.url_for( action='chroms' )}", { dbkey: view.dbkey }, function ( data ) {
- view.chrom_data = data;
- var chrom_options = '<option value="">Select Chrom/Contig</option>';
- for (i in data) {
- var chrom = data[i]['chrom']
- chrom_options += '<option value="' + chrom + '">' + chrom + '</option>';
+ $.ajax({
+ url: "${h.url_for( action='chroms' )}",
+ data: { dbkey: view.dbkey },
+ dataType: "json",
+ success: function ( data ) {
+ view.chrom_data = data;
+ var chrom_options = '<option value="">Select Chrom/Contig</option>';
+ for (i in data) {
+ var chrom = data[i]['chrom']
+ chrom_options += '<option value="' + chrom + '">' + chrom + '</option>';
+ }
+ $("#chrom").html(chrom_options);
+ $("#chrom").bind( "change", function () {
+ view.chrom = $("#chrom").val();
+ var found = $.grep(view.chrom_data, function(v, i) {
+ return v.chrom === view.chrom;
+ })[0];
+ view.max_high = found.len;
+ view.reset();
+ view.redraw(true);
+
+ for (var track_id in view.tracks) {
+ var track = view.tracks[track_id];
+ if (track.init) {
+ track.init();
+ }
+ }
+ view.redraw();
+ });
+ },
+ error: function() {
+ alert( "Could not load chroms for this dbkey:", view.dbkey );
}
- $("#chrom").html(chrom_options);
- $("#chrom").bind( "change", function () {
- view.chrom = $("#chrom").val();
- var found = $.grep(view.chrom_data, function(v, i) {
- return v.chrom === view.chrom;
- })[0];
- view.max_high = found.len;
- view.reset();
- view.redraw(true);
-
- for (var track_id in view.tracks) {
- var track = view.tracks[track_id];
- if (track.init) {
- track.init();
- }
- }
- view.redraw();
- });
});
function sidebar_box(track) {
diff -r 6be8d5818087 -r efd404f7a60b templates/tracks/new_browser.mako
--- a/templates/tracks/new_browser.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/tracks/new_browser.mako Fri Apr 16 18:46:35 2010 -0400
@@ -1,18 +1,24 @@
-<form id="new-browser-form" method="post" onsubmit="continue_fn(); return false;">
+<form id="new-browser-form" action="javascript:void();" method="post" onsubmit="return false;">
<div class="form-row">
- <label for="title">Browser name:</label>
+ <label for="new-title">Browser name:</label>
<div class="form-row-input">
<input type="text" name="title" id="new-title" value="Unnamed"></input>
</div>
<div style="clear: both;"></div>
</div>
<div class="form-row">
- <label for="dbkey">Reference genome build (dbkey): </label>
+ <label for="new-dbkey">Reference genome build (dbkey): </label>
<div class="form-row-input">
<select name="dbkey" id="new-dbkey">
- %for dbkey in dbkey_set:
- <option value="${dbkey}">${dbkey}</option>
+ %for dbkey in dbkeys:
+ <option value="${dbkey[0]}">${dbkey[1]}</option>
%endfor
+
+ %if user_keys:
+ %for key, chrom_dict in user_keys.iteritems():
+ <option value="${key}">${chrom_dict['name']} (${key})</option>
+ %endfor
+ %endif
</select>
</div>
<div style="clear: both;"></div>
diff -r 6be8d5818087 -r efd404f7a60b templates/user/dbkeys.mako
--- a/templates/user/dbkeys.mako Thu Apr 15 21:41:50 2010 -0400
+++ b/templates/user/dbkeys.mako Fri Apr 16 18:46:35 2010 -0400
@@ -28,9 +28,7 @@
% if message:
<div class="errormessagelarge">${message}</div>
-% endif
-
-% if lines_skipped > 0:
+% elif lines_skipped > 0:
<div class="warningmessagelarge">Skipped ${lines_skipped} lines that could not be parsed</div>
% endif
1
0