galaxy-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
galaxy-dist commit 642edc1ae4f5: Fix grid link/label bug introduced in 4372:269c46003857
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1286376177 14400
# Node ID 642edc1ae4f50a0a7e6d00904654733f4172fbf7
# Parent 41cf53bdcca21a255c94ae90d20a9bd492cf6741
Fix grid link/label bug introduced in 4372:269c46003857
--- a/templates/grid_base.mako
+++ b/templates/grid_base.mako
@@ -860,13 +860,19 @@
cls = "menubutton split"
%>
- %if len(grid.operations) == 0:
- <td><a class="label" href="${href}">${v}</a></td>
- %elif href:
- <td><div id="${id}" class="${cls}" style="float: left;"><a class="label" href="${href}">${v}</a></div></td>
+ <td>
+ %if href:
+ %if len(grid.operations) != 0:
+ <div id="${id}" class="${cls}" style="float: left;">
+ %endif
+ <a class="label" href="${href}">${v}</a>
+ %if len(grid.operations) != 0:
+ </div>
+ %endif
%else:
- <td><div id="${id}" class="${cls}"><label for="${encoded_id}">${v}</label></div></td>
+ <div id="${id}" class="${cls}"><label for="${encoded_id}">${v}</label></div>
%endif
+ </td>
%endfor
%endif
%endfor
1
0
galaxy-dist commit 28dd2c50c023: updates to DAVID, LPS, and formatHelp help text
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Richard Burhans <burhans(a)bx.psu.edu>
# Date 1286294376 14400
# Node ID 28dd2c50c02380ed9b3e47b9b598783a0ab03e2c
# Parent 7698203440dec7457f6fd273a36f30ed89e05821
updates to DAVID, LPS, and formatHelp help text
--- a/tools/human_genome_variation/linkToDavid.xml
+++ b/tools/human_genome_variation/linkToDavid.xml
@@ -72,7 +72,7 @@ The list is limited to 400 IDs.
**Dataset formats**
-The input dataset is tabular_ format. The output dataset is html_ format with
+The input dataset is in tabular_ format. The output dataset is html_ with
a link to the DAVID website as described below.
(`Dataset missing?`_)
--- a/static/formatHelp.html
+++ b/static/formatHelp.html
@@ -1,5 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd"><html>
-<head><title>Galaxy Data Formats</title>
+<head>
+<title>Galaxy Data Formats</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css">
+ hr { margin-top: 3ex; margin-bottom: 1ex; border: 1px inset }
+</style></head><body><h2>Galaxy Data Formats</h2>
@@ -18,16 +26,15 @@ data, or even the correct columns needed
by format at least makes the list to select from a bit shorter.
<p>
Some of the formats are defined hierarchically, going from very
-general ones like <a href="#tab">tabular</a> (which includes any text
+general ones like <a href="#tab">Tabular</a> (which includes any text
file with tab-separated columns), to more restrictive sub-formats
-like <a href="#interval">interval</a> (where three of the columns
+like <a href="#interval">Interval</a> (where three of the columns
must be the chromosome, start position, and end position), and on
-to even more specific ones such as <a href="#bed">BED</a> or
-<a href="#gff">GFF</a> that have additional requirements. So for
-example if a tool's required input format is tabular, then all of
-your history items whose format is recorded as tabular will be
-listed, along with those in all sub-formats that also qualify as
-tabular (interval, BED, GFF, etc.).
+to even more specific ones such as <a href="#bed">BED</a> that have
+additional requirements. So for example if a tool's required input
+format is Tabular, then all of your history items whose format is
+recorded as Tabular will be listed, along with those in all
+sub-formats that also qualify as Tabular (Interval, BED, GFF, etc.).
<p>
There are two usual methods for changing a dataset's format in
Galaxy: if the file contents are already in the required format but
@@ -37,7 +44,7 @@ manually by clicking on the pencil icon
history. Or, if the file contents really are in a different format,
Galaxy provides a number of format conversion tools (e.g. in the
Text Manipulation and Convert Formats categories). For instance,
-if the tool you want to run requires tabular but your columns are
+if the tool you want to run requires Tabular but your columns are
delimited by spaces or commas, you can use the "Convert delimiters
to TAB" tool under Text Manipulation to reformat your data. However
if your files are in a completely unsupported format, then you need
@@ -47,7 +54,7 @@ to convert them yourself before uploadin
<h3>Format Descriptions</h3><ul>
-<li><a href="#ab1">Ab1</a>
+<li><a href="#ab1">AB1</a><li><a href="#axt">AXT</a><li><a href="#bam">BAM</a><li><a href="#bed">BED</a>
@@ -55,19 +62,19 @@ to convert them yourself before uploadin
<li><a href="#binseq">Binseq.zip</a><li><a href="#fasta">FASTA</a><li><a href="#fastqsolexa">FastqSolexa</a>
-<li><a href="#fped">fped</a>
+<li><a href="#fped">FPED</a><li><a href="#gff">GFF</a><li><a href="#gff3">GFF3</a><li><a href="#gtf">GTF</a><li><a href="#html">HTML</a><li><a href="#interval">Interval</a><li><a href="#lav">LAV</a>
-<li><a href="#lped">lped</a>
+<li><a href="#lped">LPED</a><li><a href="#maf">MAF</a>
-<li><a href="#pbed">pbed</a>
+<li><a href="#pbed">PBED</a><li><a href="#psl">PSL</a>
-<li><a href="#scf">Scf</a>
-<li><a href="#sff">Sff</a>
+<li><a href="#scf">SCF</a>
+<li><a href="#sff">SFF</a><li><a href="#table">Table</a><li><a href="#tab">Tabular</a><li><a href="#txtseqzip">Txtseq.zip</a>
@@ -75,17 +82,23 @@ to convert them yourself before uploadin
<li><a href="#text">Other text type</a></ul><p>
+
+<div><a name="ab1"></a></div><hr>
+<strong>AB1</strong>
+<p>
+This is one of the ABIF family of binary sequence formats from
+Applied Biosystems Inc.
+<!-- Their PDF
+<a href="http://www.appliedbiosystems.com/support/software_community/ABIF_File_Forma…"
+>format specification</a> is unfortunately password-protected. -->
+Files should have a '<code>.ab1</code>' file extension. You must
+manually select this file format when uploading the file.
+<p>
-<strong>Ab1</strong>
-<a name="ab1"/>
-<p>
-A binary sequence file in 'ab1' format with a '.ab1' file extension.
-You must manually select this file format when uploading the file.
-<hr/>
-
+<div><a name="axt"></a></div>
+<hr><strong>AXT</strong>
-<a name="axt"/><p>
Used for pairwise alignment output from BLASTZ, after post-processing.
Each alignment block contains three lines: a summary line and two
@@ -94,44 +107,53 @@ The summary line contains chromosomal po
about the alignment, and consists of nine required fields.
<a href="http://main.genome-browser.bx.psu.edu/goldenPath/help/axt.html"
>More information</a>
+<!-- (not available on Main)
<dl><dt>Can be converted to:
<dd><ul>
-<li>FASTA<br/>
-Convert Formats→AXT to FASTA
-<li>LAV<br/>
-Convert Formats→AXT to LAV
+<li>FASTA<br>
+Convert Formats → AXT to FASTA
+<li>LAV<br>
+Convert Formats → AXT to LAV
</ul></dl>
-<hr/>
+-->
+<p>
+<div><a name="bam"></a></div>
+<hr><strong>BAM</strong>
-<a name="bam"/><p>
-A binary file compressed in the BGZF format with a '.bam' file
-extension.
-<a href="http://samtools.sourceforge.net/SAM1.pdf">SAM</a> format
-is the human readable text version of these files.
+A binary alignment file compressed in the BGZF format with a
+'<code>.bam</code>' file extension.
+<!-- You must manually select this file format when uploading the file. -->
+<a href="http://samtools.sourceforge.net/SAM1.pdf">SAM</a>
+is the human-readable text version of this format.
<dl><dt>Can be converted to:
<dd><ul>
-<li>pileup<br/>
-NGS: SAM Tools→Generate pileup<br/>
-<li>interval<br/>
-First you have to go to pileup as above then
-NGS: SAM Tools→Pileup-to-Interval
+<li>SAM<br>
+NGS: SAM Tools → BAM-to-SAM
+<li>Pileup<br>
+NGS: SAM Tools → Generate pileup
+<li>Interval<br>
+First convert to Pileup as above, then use
+NGS: SAM Tools → Pileup-to-Interval
</ul></dl>
-<hr/>
+<p>
+<div><a name="bed"></a></div>
+<hr><strong>BED</strong>
-<a name="bed"/><p><ul>
-<li> also qualifies as tabular
-<li> also qualifies as interval
+<li> also qualifies as Tabular
+<li> also qualifies as Interval
</ul>
This tab-separated format describes a genomic interval, but has
strict field specifications for use in genome browsers. BED files
can have from 3 to 12 columns, but the order of the columns matters,
and only the end ones can be omitted. Some groups of columns must
-be all present or all absent.
+be all present or all absent. As in Interval format (but unlike
+GFF and its relatives), the interval endpoints use a 0-based,
+half-open numbering system.
<a href="http://main.genome-browser.bx.psu.edu/goldenPath/help/hgTracksHelp.html#BED"
>Field specifications</a><p>
@@ -142,17 +164,18 @@ chr22 2000 6000 cloneB 900 - 2000 6000 0
</pre><dl><dt>Can be converted to:
<dd><ul>
-<li>GFF<br/>
-Convert Formats→BED-to-GFF
+<li>GFF<br>
+Convert Formats → BED-to-GFF
</ul></dl>
-<hr/>
+<p>
+<div><a name="bedgraph"></a></div>
+<hr><strong>BedGraph</strong>
-<a name="bedgraph"/><p><ul>
-<li> also qualifies as tabular
-<li> also qualifies as interval
+<li> also qualifies as Tabular
+<li> also qualifies as Interval
<li> also qualifies as BED
</ul><a href="http://main.genome-browser.bx.psu.edu/goldenPath/help/bedgraph.html"
@@ -160,26 +183,28 @@ Convert Formats→BED-to-GFF
that is displayed as a wiggle score in tracks. Unlike in Wiggle
format, the exact value of this score can be retrieved after being
loaded as a track.
-<hr/>
+<p>
+<div><a name="binseq"></a></div>
+<hr><strong>Binseq.zip</strong>
-<a name="binseq"/><p>
-A zipped archive consisting of binary sequence files in either
-'ab1' or 'scf' format. All files in this archive must have the same
-file extension which is one of '.ab1' or '.scf'. You must manually
-select this file format when uploading the file.
-<hr/>
+A zipped archive consisting of binary sequence files in either AB1
+or SCF format. All files in this archive must have the same file
+extension which is one of '<code>.ab1</code>' or '<code>.scf</code>'.
+You must manually select this file format when uploading the file.
+<p>
+<div><a name="fasta"></a></div>
+<hr><strong>FASTA</strong>
-<a name="fasta"/><p>
A sequence in
<a href="http://www.ncbi.nlm.nih.gov/blast/fasta.shtml">FASTA</a>
format consists of a single-line description, followed by lines of
sequence data. The first character of the description line is a
-greater-than (">") symbol. All lines should be shorter than 80
-characters.
+greater-than ('<code>></code>') symbol. All lines should be
+shorter than 80 characters.
<pre>
>sequence1
atgcgtttgcgtgc
@@ -190,16 +215,17 @@ tggcgcggtga
</pre><dl><dt>Can be converted to:
<dd><ul>
-<li>tabular<br/>
-Convert Formats→FASTA-to-Tabular
+<li>Tabular<br>
+Convert Formats → FASTA-to-Tabular
</ul></dl>
-<hr/>
+<p>
+<div><a name="fastqsolexa"></a></div>
+<hr><strong>FastqSolexa</strong>
-<a name="fastqsolexa"/><p><a href="http://maq.sourceforge.net/fastq.shtml">FastqSolexa</a>
-is the Illumina (Solexa) variant of the Fastq format, which stores
+is the Illumina (Solexa) variant of the FASTQ format, which stores
sequences and quality scores in a single file.
<pre>
@seq1
@@ -224,82 +250,97 @@ 40 15 40 17 6 36 40 40 40 25 40 9 35 33
</pre><dl><dt>Can be converted to:
<dd><ul>
-<li>FASTA<br/>
-Convert Formats→FASTQ to FASTA
+<li>FASTA<br>
+NGS: QC and manipulation → Generic FASTQ manipulation → FASTQ to FASTA
+<li>Tabular<br>
+NGS: QC and manipulation → Generic FASTQ manipulation → FASTQ to Tabular
</ul></dl>
-<hr/>
+<p>
-<strong>fped</strong>
-<a name="fped"/>
+<div><a name="fped"></a></div>
+<hr>
+<strong>FPED</strong><p>
Also known as the FBAT format, for use with the
<a href="http://biosun1.harvard.edu/~fbat/fbat.htm">FBAT</a> program.
It consists of a pedigree file and a phenotype file.
-<hr/>
+<p>
+<div><a name="gff"></a></div>
+<hr><strong>GFF</strong>
-<a name="gff"/><p><ul>
-<li> also qualifies as tabular
-<li> also qualifies as interval
+<li> also qualifies as Tabular
</ul>
GFF is a tab-separated format somewhat similar to BED, but it has
different columns and is more flexible. There are
<a href="http://main.genome-browser.bx.psu.edu/FAQ/FAQformat#format3"
>nine required fields</a>.
+Note that unlike Interval and BED, GFF and its relatives (GFF3, GTF)
+use 1-based inclusive coordinates to specify genomic intervals.
<dl><dt>Can be converted to:
<dd><ul>
-<li>BED<br/>
-Convert Formats→GFF-to-BED
+<li>BED<br>
+Convert Formats → GFF-to-BED
</ul></dl>
-<hr/>
+<p>
+<div><a name="gff3"></a></div>
+<hr><strong>GFF3</strong>
-<a name="gff3"/><p><ul>
-<li> also qualifies as tabular
-<li> also qualifies as interval
+<li> also qualifies as Tabular
</ul>
The <a href="http://www.sequenceontology.org/gff3.shtml">GFF3</a>
-format addresses the most common extensions to GFF, while preserving
-backward compatibility with previous formats.
-<hr/>
+format addresses the most common extensions to GFF, while attempting
+to preserve compatibility with previous formats.
+Note that unlike Interval and BED, GFF and its relatives (GFF3, GTF)
+use 1-based inclusive coordinates to specify genomic intervals.
+<p>
+<div><a name="gtf"></a></div>
+<hr><strong>GTF</strong>
-<a name="gtf"/><p><ul>
-<li> also qualifies as tabular
-<li> also qualifies as interval
+<li> also qualifies as Tabular
</ul><a href="http://main.genome-browser.bx.psu.edu/FAQ/FAQformat#format4"
->GTF</a> is a format for describing genes and other features
-associated with DNA, RNA, and protein sequences.
+>GTF</a> is a format for describing genes and other features associated
+with DNA, RNA, and protein sequences. It is a refinement to GFF that
+tightens the specification.
+Note that unlike Interval and BED, GFF and its relatives (GFF3, GTF)
+use 1-based inclusive coordinates to specify genomic intervals.
+<!-- (not available on Main)
<dl><dt>Can be converted to:
<dd><ul>
-<li>BedGraph<br/>
-Convert Formats→GTF-to-BEDGraph
+<li>BedGraph<br>
+Convert Formats → GTF-to-BEDGraph
</ul></dl>
-<hr/>
+-->
+<p>
+<div><a name="html"></a></div>
+<hr><strong>HTML</strong>
-<a name="html"/><p>
This format is an HTML web page. Click the eye icon next to the
dataset to view it in your browser.
-<hr/>
+<p>
+<div><a name="interval"></a></div>
+<hr><strong>Interval</strong>
-<a name="interval"><p><ul>
-<li> also qualifies as tabular
+<li> also qualifies as Tabular
</ul>
This Galaxy format represents genomic intervals. It is tab-separated,
but has the added requirement that three of the columns must be the
-chromosome name, start position, and end position. An optional
+chromosome name, start position, and end position, where the positions
+use a 0-based, half-open numbering system (see below). An optional
strand column can also be specified, and an initial header row can
be used to label the columns, which do not have to be in any special
order. Arbitrary additional columns can also be present.
@@ -317,7 +358,8 @@ Required fields:
</ul>
Optional:
<ul>
-<li>STRAND - Defines the strand, either '+' or '-'.
+<li>STRAND - Defines the strand, either '<code>+</code>' or
+'<code>-</code>'.
<li>Header row
</ul>
Example:
@@ -328,173 +370,202 @@ Example:
</pre><dl><dt>Can be converted to:
<dd><ul>
-<li>BED<br/>
+<li>BED<br>
The exact changes needed and tools to run will vary with what fields
-are in the interval file and what type of BED you are converting to.
-In general you will likely use Text Manipulation→Compute, Cut,
+are in the Interval file and what type of BED you are converting to.
+In general you will likely use Text Manipulation → Compute, Cut,
or Merge Columns.
</ul></dl>
-<hr/>
+<p>
+<div><a name="lav"></a></div>
+<hr><strong>LAV</strong>
-<a name="lav"/><p><a href="http://www.bx.psu.edu/miller_lab/dist/lav_format.html">LAV</a>
is the raw pairwise alignment format that is output by BLASTZ. The
first line begins with <code>#:lav</code>.
+<!-- (not available on Main)
<dl><dt>Can be converted to:
<dd><ul>
-<li>BED<br/>
-Convert Formats→LAV to BED
+<li>BED<br>
+Convert Formats → LAV to BED
</ul></dl>
-<hr/>
+-->
+<p>
-<strong>lped</strong>
-<a name="lped"/>
+<div><a name="lped"></a></div>
+<hr>
+<strong>LPED</strong><p>
-This is the linkage pedigree format, which consists of separate
-<code>map</code> and <code>ped</code> files. Together these files
-describe SNPs; the map file contains the position and an identifier
-for the SNP, while the pedigree file has the alleles.
-To upload this format into Galaxy, do not use auto-detect for the
-file format; instead select <code>lped</code>. You will then be
-given two sections for uploading files, one for the pedigree file
-and one for the map file. For more information, see
-<a href="http://www.broadinstitute.org/science/programs/medical-and-population-genet…">linkage pedigree</a>,
-<a href="http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map">map</a>,
-and/or <a href="http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped">ped</a>.
+This is the linkage pedigree format, which consists of separate MAP and PED
+files. Together these files describe SNPs; the map file contains the position
+and an identifier for the SNP, while the pedigree file has the alleles. To
+upload this format into Galaxy, do not use Auto-detect for the file format;
+instead select <code>lped</code>. You will then be given two sections for
+uploading files, one for the pedigree file and one for the map file. For more
+information, see
+<a href="http://www.broadinstitute.org/science/programs/medical-and-population-genet…"
+>linkage pedigree</a>,
+<a href="http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#map">MAP</a>,
+and/or <a href="http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped">PED</a>.
<dl><dt>Can be converted to:
<dd><ul>
-<li>pbed<br/>Automatic
-<li>fped<br/>Automatic
+<li>PBED<br>Automatic
+<li>FPED<br>Automatic
</ul></dl>
-<hr/>
+<p>
+<div><a name="maf"></a></div>
+<hr><strong>MAF</strong>
-<a name="maf"/><p>
-Multiple alignment format that is output by TBA and Multiz. The
-first line begins with <code>##maf</code>. This word is followed by
-whitespace-separated "variable=value pairs". There should be no
-whitespace surrounding the "=".
<a href="http://main.genome-browser.bx.psu.edu/FAQ/FAQformat#format5"
->More information</a>
+>MAF</a> is the multi-sequence alignment format that is output by TBA
+and Multiz. The first line begins with '<code>##maf</code>'. This
+word is followed by whitespace-separated "variable<code>=</code>value"
+pairs. There should be no whitespace surrounding the '<code>=</code>'.
<dl><dt>Can be converted to:
<dd><ul>
-<li>BED<br/>
-Convert Formats→MAF to BED
-<li>interval<br/>
-Convert Formats→MAF to Interval
-<li>FASTA<br/>
-Convert Formats→MAF to FASTA
+<li>BED<br>
+Convert Formats → MAF to BED
+<li>Interval<br>
+Convert Formats → MAF to Interval
+<li>FASTA<br>
+Convert Formats → MAF to FASTA
</ul></dl>
-<hr/>
+<p>
-<strong>pbed</strong>
-<a name="pbed"/>
+<div><a name="pbed"></a></div>
+<hr>
+<strong>PBED</strong><p>
-This is the binary version of the lped file format.
+This is the binary version of the LPED format.
<dl><dt>Can be converted to:
<dd><ul>
-<li>lped<br/>Automatic
+<li>LPED<br>Automatic
</ul></dl>
-<hr/>
+<p>
+<div><a name="psl"></a></div>
+<hr><strong>PSL</strong>
-<a name="psl"/><p><a href="http://main.genome-browser.bx.psu.edu/FAQ/FAQformat#format2">PSL</a>
format is used for alignments returned by
<a href="http://genome.ucsc.edu/cgi-bin/hgBlat?command=start">BLAT</a>.
It does not include any sequence.
-<hr/>
+<p>
-<strong>Scf</strong>
-<a name="scf"/>
+<div><a name="scf"></a></div>
+<hr>
+<strong>SCF</strong><p>
-A binary sequence file in 'scf' format with a '.scf' file extension.
-You must manually select this file format when uploading the file.
+This is a binary sequence format originally designed for the Staden
+sequence handling software package. Files should have a
+'<code>.scf</code>' file extension. You must manually select this
+file format when uploading the file.
<a href="http://staden.sourceforge.net/manual/formats_unix_2.html"
>More information</a>
-<hr/>
+<p>
-<strong>Sff</strong>
-<a name="sff"/>
+<div><a name="sff"></a></div>
+<hr>
+<strong>SFF</strong><p>
-A binary file in 'Standard Flowgram Format' with a '.sff' file extension.
+This is a binary sequence format used by the Roche 454 GS FLX
+sequencing machine, and is documented on p. 528 of their
+<a href="http://sequence.otago.ac.nz/download/GS_FLX_Software_Manual.pdf"
+>software manual</a>. Files should have a '<code>.sff</code>' file
+extension.
+<!-- You must manually select this file format when uploading the file. --><dl><dt>Can be converted to:
<dd><ul>
-<li>FASTA<br/>
-Convert Formats→SFF converter
-<li>FASTQ<br/>
-Convert Formats→SFF converter
+<li>FASTA<br>
+Convert Formats → SFF converter
+<li>FASTQ<br>
+Convert Formats → SFF converter
</ul></dl>
-<hr/>
+<p>
+<div><a name="table"></a></div>
+<hr><strong>Table</strong>
-<a name="table"/><p>
Text data separated into columns by something other than tabs.
-<hr/>
+<p>
+<div><a name="tab"></a></div>
+<hr><strong>Tabular (tab-delimited)</strong>
-<a name="tab"/><p>
One or more columns of text data separated by tabs.
<dl><dt>Can be converted to:
<dd><ul>
-<li>FASTA<br/>
-Convert Formats→Tabular-to-FASTA<br/>
-The tabular file must have a title and sequence column.
-<li>interval<br/>
-If the tabular file has the chromosome, or is all on one chromosome,
-and has a position you can create an interval file (e.g. for SNPs).
-If it is all on one chromosome, use Text Manipulation→Add column
-to add a chromosome column. If the given position is 1-based, use
-Text Manipulation→Compute with the position column minus 1 to
-get the start, and use the original given column for the end.
-If the given position is 0-based, use it as the start, and compute
-that plus 1 to get the end.
+<li>FASTA<br>
+Convert Formats → Tabular-to-FASTA<br>
+The Tabular file must have a title and sequence column.
+<li>FASTQ<br>
+NGS: QC and manipulation → Generic FASTQ manipulation → Tabular to FASTQ
+<li>Interval<br>
+If the Tabular file has a chromosome column (or is all on one
+chromosome) and has a position column, you can create an Interval
+file (e.g. for SNPs). If it is all on one chromosome, use
+Text Manipulation → Add column to add a CHROM column.
+If the given position is 1-based, use
+Text Manipulation → Compute with the position column minus 1 to
+get the START, and use the original given column for the END.
+If the given position is 0-based, use it as the START, and compute
+that plus 1 to get the END.
</ul></dl>
-<hr/>
+<p>
+<div><a name="txtseqzip"></a></div>
+<hr><strong>Txtseq.zip</strong>
-<a name="txtseqzip"/><p>
A zipped archive consisting of flat text sequence files. All files
-in this archive must have the same file extension of '.txt'. You
-must manually select this file format when uploading the file.
-<hr/>
+in this archive must have the same file extension of
+'<code>.txt</code>'. You must manually select this file format when
+uploading the file.
+<p>
+<div><a name="wig"></a></div>
+<hr><strong>Wiggle custom track</strong>
-<a name="wig"/><p>
-The wiggle format is line-oriented. Wiggle data is preceded by a
-track definition line, which specifies the type of wiggle. There
-are three different types, for different uses.
+Wiggle tracks are typically used to display per-nucleotide scores
+in a genome browser. The Wiggle format for custom tracks is
+line-oriented, and the wiggle data is preceded by a track definition
+line that specifies which of three different types is being used.
<a href="http://main.genome-browser.bx.psu.edu/goldenPath/help/wiggle.html"
>More information</a><dl><dt>Can be converted to:
<dd><ul>
-<li>interval<br/>
-Convert Formats→Wiggle-to-Interval<br/>
-As a second step this could be converted to BED-3 or BED-4 by removing
-columns, using Text Manipulation→Cut columns from a table.
+<li>Interval<br>
+Get Genomic Scores → Wiggle-to-Interval
+<li>As a second step this could be converted to 3- or 4-column BED,
+by removing extra columns using
+Text Manipulation → Cut columns from a table.
</ul></dl>
-<hr/>
+<p>
+<div><a name="text"></a></div>
+<hr><strong>Other text type</strong>
-<a name="text"/><p>
Any text file.
<dl><dt>Can be converted to:
<dd><ul>
-<li>tabular<br/>
-If this has fields separated by spaces, commas, or some other
-delimiter it can be converted to tabular using
-Text Manipulation→Convert delimiters to TAB
+<li>Tabular<br>
+If the text has fields separated by spaces, commas, or some other
+delimiter, it can be converted to Tabular by using
+Text Manipulation → Convert delimiters to TAB.
</ul></dl>
+<p>
+
<!-- blank lines so internal links will jump farther to end -->
-<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
+<br><br><br><br><br><br><br><br><br><br><br><br>
+<br><br><br><br><br><br><br><br><br><br><br><br></body></html>
--- a/tools/human_genome_variation/lps.xml
+++ b/tools/human_genome_variation/lps.xml
@@ -224,9 +224,9 @@ Let **x** be a row from your input datas
from the results file. To compute the probability that row **x** has
a label value of +1:
- Probability(row **x** has label value = +1) = 1 / [1 + exp{**x** \* **b**\[1..n-1\] + **b**\[n\]}]
+ Probability(row **x** has label value = +1) = 1 / [1 + exp{**x** \* **b**\[1..N-1\] + **b**\[N\]}]
-where **x** \* **b**\[1..n-1\] represents matrix multiplication.
+where **x** \* **b**\[1..N-1\] represents matrix multiplication.
The second output dataset, called the log file, is a text file which
contains additional data about the fitted L1-regularized logistic
1
0
galaxy-dist commit 06d6ce09e0f1: Fix for checking whether the current user can access a specified library item.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Greg Von Kuster <greg(a)bx.psu.edu>
# Date 1286207081 14400
# Node ID 06d6ce09e0f152d38c632dae7ccba9337f25bab5
# Parent 8774252ac0531343953428a44a5a2b07e6fe514e
Fix for checking whether the current user can access a specified library item.
--- a/lib/galaxy/web/controllers/library_common.py
+++ b/lib/galaxy/web/controllers/library_common.py
@@ -2246,22 +2246,30 @@ class LibraryCommon( BaseController, Use
message=message,
status=status ) )
def _check_access( self, trans, cntrller, is_admin, item, current_user_roles, use_panels, library_id, show_deleted ):
+ can_access = True
if isinstance( item, trans.model.HistoryDatasetAssociation ):
- # Deny that the dataset exists if the user does not have the DATASET_ACCESS permission.
- if not item or \
- not ( trans.app.security_agent.can_access_dataset( current_user_roles, item.dataset ) and item.history.user==trans.user ):
- message = "Invalid history dataset id (%s) specified." % str( item.id )
- return trans.response.send_redirect( web.url_for( controller='library_common',
- action='browse_library',
- cntrller=cntrller,
- id=library_id,
- show_deleted=show_deleted,
- message=util.sanitize_text( message ),
- status='error' ) )
- # Deny that the item exists if the user does not have the LIBRARY_ACCESS permission on its parent library,
- # or if they are not able to access the item itself.
- if not item or ( not is_admin and not trans.app.security_agent.can_access_library_item( current_user_roles, item, trans.user ) ):
- message = "Invalid item id (%s) specified." % str( item.id )
+ # Make sure the user has the DATASET_ACCESS permission on the history_dataset_association.
+ if not item:
+ message = "Invalid history dataset (%s) specified." % str( item )
+ can_access = False
+ elif not trans.app.security_agent.can_access_dataset( current_user_roles, item.dataset ) and item.history.user==trans.user:
+ message = "You do not have permission to access the history dataset with id (%s)." % str( item.id )
+ can_access = False
+ else:
+ # Make sure the user has the LIBRARY_ACCESS permission on the library item.
+ if not item:
+ message = "Invalid library item (%s) specified." % str( item )
+ can_access = False
+ elif not ( is_admin or trans.app.security_agent.can_access_library_item( current_user_roles, item, trans.user ) ):
+ if isinstance( item, trans.model.Library ):
+ item_type = 'data library'
+ elif isinstance( item, trans.model.LibraryFolder ):
+ item_type = 'folder'
+ else:
+ item_type = '(unknown item type)'
+ message = "You do not have permission to access the %s with id (%s)." % ( item_type, str( item.id ) )
+ can_access = False
+ if not can_access:
if cntrller == 'api':
return 400, message
if isinstance( item, trans.model.Library ):
@@ -2282,7 +2290,7 @@ class LibraryCommon( BaseController, Use
def _check_add( self, trans, cntrller, is_admin, item, current_user_roles, use_panels, library_id, show_deleted ):
# Deny access if the user is not an admin and does not have the LIBRARY_ADD permission.
if not ( is_admin or trans.app.security_agent.can_add_library_item( current_user_roles, item ) ):
- message = "You are not authorized to add an item to '%s'." % item.name
+ message = "You are not authorized to add an item to (%s)." % item.name
# Redirect to the real parent library since we know we have access to it.
if cntrller == 'api':
return 403, message
@@ -2300,7 +2308,7 @@ class LibraryCommon( BaseController, Use
if not ( is_admin or \
( trans.app.security_agent.can_manage_library_item( current_user_roles, item ) and
trans.app.security_agent.can_manage_dataset( current_user_roles, library_dataset.library_dataset_dataset_association.dataset ) ) ):
- message = "You are not authorized to manage permissions on library dataset '%s'." % library_dataset.name
+ message = "You are not authorized to manage permissions on library dataset (%s)." % library_dataset.name
if cntrller == 'api':
return 403, message
return trans.response.send_redirect( web.url_for( controller='library_common',
@@ -2312,7 +2320,7 @@ class LibraryCommon( BaseController, Use
status='error' ) )
# Deny access if the user is not an admin and does not have the LIBRARY_MANAGE permission.
if not ( is_admin or trans.app.security_agent.can_manage_library_item( current_user_roles, item ) ):
- message = "You are not authorized to manage permissions on '%s'." % item.name
+ message = "You are not authorized to manage permissions on (%s)." % item.name
if cntrller == 'api':
return 403, message
return trans.response.send_redirect( web.url_for( controller='library_common',
@@ -2325,7 +2333,7 @@ class LibraryCommon( BaseController, Use
def _check_modify( self, trans, cntrller, is_admin, item, current_user_roles, use_panels, library_id, show_deleted ):
# Deny modification if the user is not an admin and does not have the LIBRARY_MODIFY permission.
if not ( is_admin or trans.app.security_agent.can_modify_library_item( current_user_roles, item ) ):
- message = "You are not authorized to modify '%s'." % item.name
+ message = "You are not authorized to modify (%s)." % item.name
if cntrller == 'api':
return 403, message
return trans.response.send_redirect( web.url_for( controller='library_common',
1
0
galaxy-dist commit 4990d7b95b72: Bug fix for signature of lib.galaxy_utils.sequence.transform.?NA_reverse_complement method.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dan Blankenberg <dan(a)bx.psu.edu>
# Date 1285944317 14400
# Node ID 4990d7b95b7273ba7159bfb2db1931a4e74a980a
# Parent 7b431b0dbc687c1496ef5fba92dd443476d61d60
Bug fix for signature of lib.galaxy_utils.sequence.transform.?NA_reverse_complement method.
--- a/lib/galaxy_utils/sequence/transform.py
+++ b/lib/galaxy_utils/sequence/transform.py
@@ -19,10 +19,10 @@ def DNA_complement( sequence ):
def RNA_complement( sequence ):
return sequence.translate( RNA_COMPLEMENT )
#returns the reverse complement of the sequence
-def DNA_reverse_complement( self, sequence ):
+def DNA_reverse_complement( sequence ):
sequence = reverse( sequence )
return DNA_complement( sequence )
-def RNA_reverse_complement( self, sequence ):
+def RNA_reverse_complement( sequence ):
sequence = reverse( sequence )
return RNA_complement( sequence )
def to_DNA( sequence ):
1
0
galaxy-dist commit 51aaa9eac818: Updates to LPS tool help text.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Richard Burhans <burhans(a)bx.psu.edu>
# Date 1285871526 14400
# Node ID 51aaa9eac8182b25dbbffd1de902b78c916cb0f5
# Parent ddf70ed04c8b24f9095d4b16f6041907f7c6d428
Updates to LPS tool help text.
--- a/tools/human_genome_variation/lps.xml
+++ b/tools/human_genome_variation/lps.xml
@@ -120,7 +120,7 @@
<param name="c1" type="float" value="1e-3" help="Parameter defining the margin by which the first-order step is required to decrease before being taken."><validator type="in_range" message="0.0 < c1 < 1.0" min="0.0" max="1.0"/></param>
- <param name="maxIter" type="integer" value="10000" label="Maximum number of iterations"/>
+ <param name="maxIter" type="integer" value="10000" label="Maximum number of iterations" help="Terminate with error if we exceed this."/><param name="stopTol" type="float" value="1e-6" label="Stop tolerance" help="Convergence tolerance for target value of lambda."/><param name="intermediateTol" type="float" value="1e-4" label="Intermediate tolerance" help="Convergence tolerance for intermediate values of lambda."/><param name="finalOnly" type="select" format="integer" label="Final only">
@@ -132,8 +132,8 @@
</inputs><outputs>
- <data name="output_file" format="tabular"/>
- <data name="log_file" format="txt"/>
+ <data name="output_file" format="tabular" label="${tool.name} on ${on_string}: results"/>
+ <data name="log_file" format="txt" label="${tool.name} on ${on_string}: log"/></outputs><requirements>
@@ -188,28 +188,52 @@ There is a second output dataset (a log)
**What it does**
-The LASSO-Patternsearch algorithm efficiently identifies patterns of multiple
-dichotomous risk factors for outcomes of interest in demographic and genomic
-studies. It is designed for the case where there is a possibly very large
-number of candidate patterns but it is believed that only a relatively small
-number are important.
+The LASSO-Patternsearch algorithm fits your dataset to an L1-regularized
+logistic regression model. A benefit of using L1-regularization is
+that it typically yields a weight vector with relatively few non-zero
+coefficients.
-If the "risky" direction (with respect to the outcome of interest) is known
-for all or almost all variables, the results are readily interpretable.
-If the risky direction is coded correctly for all of the variables, the
-fitted model can be expected to be sparser than that for any other coding.
-However, if a small number of risky variables are coded in the "wrong" way,
-this usually can be detected.
+For example, say you have a dataset containing M rows (subjects)
+and N columns (attributes) where one of these N attributes is binary,
+indicating whether or not the subject has some property of interest P.
+In simple terms, LPS calculates a weight for each of the other attributes
+in your dataset. This weight indicates how "relevant" that attribute
+is for predicting whether or not a given subject has property P.
+The L1-regularization causes most of these weights to be equal to zero,
+which means LPS will find a "small" subset of the remaining N-1 attributes
+in your dataset that can be used to predict P.
-The input file is tabular with rows representing individuals and columns
-representing variables. There is one special column, the label column,
-containing +1 for cases, and -1 for controls. The other columns should be
-0 or 1, with 1 representing the expected riskier value for each variable.
-For instance with SNPs the column would have a 1 if the individual (row)
-has the risk allele, or a 0 otherwise. The output file has one line for each
-variable, or "feature" in the input file, with a single column containing the
-calculated score for that feature. The log file provides information about
-the input and the internal values obtained during the computation process.
+In other words, LPS can be used for feature selection.
+
+The input dataset is tabular, and must contain a label column which
+indicates whether or not a given row has property P. In the current
+version of this tool, P must be encoded using +1 and -1. The Lambda_fac
+parameter ranges from 0 to 1, and controls how sparse the weight
+vector will be. At the low end, when Lambda_fac = 0, there will be
+no regularization. At the high end, when Lambda_fac = 1, there will be
+"too much" regularization, and all of the weights will equal zero.
+
+The LPS tool creates two output datasets. The first, called the results
+file, is a tabular dataset containing one column of weights for each
+value of the regularization parameter lambda that was tried. The weight
+columns are in order from left to right by decreasing values of lambda.
+The first N-1 rows in each column are the weights for the N-1 attributes
+in your input dataset. The final row is a constant, the intercept.
+
+Let **x** be a row from your input dataset and let **b** be a column
+from the results file. To compute the probability that row **x** has
+a label value of +1:
+
+ Probability(row **x** has label value = +1) = 1 / [1 + exp{**x** \* **b**\[1..n-1\] + **b**\[n\]}]
+
+where **x** \* **b**\[1..n-1\] represents matrix multiplication.
+
+The second output dataset, called the log file, is a text file which
+contains additional data about the fitted L1-regularized logistic
+regression model. These data include the number of features, the
+computed value of lambda_max, the actual values of lambda used, the
+optimal values of the log-likelihood and regularized log-likelihood
+functions, the number of non-zeros, and the number of iterations.
Website: http://pages.cs.wisc.edu/~swright/LPS/
@@ -235,11 +259,16 @@ Website: http://pages.cs.wisc.edu/~swrig
- output log file::
- Data set has 100 vectors with 50 features
- calculateLambdaMax: n=50, m=100, m+=50, m-=50
- computed value of lambda_max: 5.0000e-01
- lambda=2.50e-02 solution has 10 nonzeros.
- It required 546 iterations
+ Data set has 100 vectors with 50 features.
+ calculateLambdaMax: n=50, m=100, m+=50, m-=50
+ computed value of lambda_max: 5.0000e-01
+
+ lambda=2.96e-02 solution:
+ optimal log-likelihood function value: 6.46e-01
+ optimal *regularized* log-likelihood function value: 6.79e-01
+ number of nonzeros at the optimum: 5
+ number of iterations required: 43
+ etc.
-----
--- a/test-data/lps_arrhythmia_log.txt
+++ b/test-data/lps_arrhythmia_log.txt
@@ -1,5 +1,4 @@
-Data set has 452 vectors with 279 features
-
+Data set has 452 vectors with 279 features.
Sampled 452 points out of 452
calculateLambdaMax: n=279, m=452, m+=245, m-=207
computed value of lambda_max: 1.8231e+02
@@ -52,36 +51,147 @@ iter 1, gpnorm=1.7618e-09, nonzero=
**** Initial point: nz=1, f= 0.689609056404, lambda= 5.469e+00
iter 1, gpnorm=1.7618e-09, nonzero= 1 ( 0.4%), function=6.896090564044e-01, alpha=3.2768e-01
Function evals = 2, Gradient evals = 1.0
-lambda=1.64e+02 solution has 1 nonzeros.
-It required 6 iterations
-lambda=1.17e+02 solution has 1 nonzeros.
-It required 1 iterations
+lambda=1.64e+02 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 6
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=8.31e+01 solution has 1 nonzeros.
-It required 1 iterations
+lambda=1.17e+02 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=5.91e+01 solution has 1 nonzeros.
-It required 1 iterations
+lambda=8.31e+01 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=4.21e+01 solution has 1 nonzeros.
-It required 1 iterations
+lambda=5.91e+01 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=3.00e+01 solution has 1 nonzeros.
-It required 1 iterations
+lambda=4.21e+01 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=2.13e+01 solution has 1 nonzeros.
-It required 1 iterations
+lambda=3.00e+01 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=1.52e+01 solution has 1 nonzeros.
-It required 1 iterations
+lambda=2.13e+01 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=1.08e+01 solution has 1 nonzeros.
-It required 1 iterations
+lambda=1.52e+01 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=7.68e+00 solution has 1 nonzeros.
-It required 1 iterations
+lambda=1.08e+01 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
-lambda=5.47e+00 solution has 1 nonzeros.
-It required 1 iterations
+lambda=7.68e+00 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
+lambda=5.47e+00 solution:
+ optimal log-likelihood function value: 6.90e-01
+ optimal *regularized* log-likelihood function value: 6.90e-01
+ number of non-zeros at the optimum: 1
+ number of iterations required: 1
+ prediction using this solution:
+ 54.20% of vectors were correctly predicted.
+ 245 correctly predicted.
+ 207 in +1 predicted to be in -1.
+ 0 in -1 predicted to be in +1.
+ 0 in +1 with 50/50 chance.
+ 0 in -1 with 50/50 chance.
+
1
0
galaxy-dist commit e32d77e1f47b: Make links in split menubuttons take the link instead of popping up the menu options. Use new menubutton style in data libraries and sharing_base.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1286147560 14400
# Node ID e32d77e1f47b1fc94b3e7511094e4b0d760f1e97
# Parent ba6f40c5b3d3ee82aa6719f98f58d4285bcbd66d
Make links in split menubuttons take the link instead of popping up the menu options. Use new menubutton style in data libraries and sharing_base.
--- a/templates/sharing_base.mako
+++ b/templates/sharing_base.mako
@@ -241,8 +241,7 @@
<% user = association.user %><tr><td>
- ${user.email}
- <a id="user-${i}-popup" class="popup-arrow" style="display: none;">▼</a>
+ <div class="menubutton popup" id="user-${i}-popup">${user.email}</div></td><td><div popupmenu="user-${i}-popup">
--- a/static/scripts/packed/galaxy.base.js
+++ b/static/scripts/packed/galaxy.base.js
@@ -1,1 +1,1 @@
-function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.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 fa
lse};$(b).click(c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");if(obj_length(b)<=0){$("<li/>").html("No options").appendTo(a)}$.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 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).split(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,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var d=$(this);var g=d.find("option").length;if((g<a)||(g>b)){return}if(d.attr("multiple")==true){return}if(d.hasClass("no-autocomplete")){return}var m=d.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",d.attr("name"));c.attr("id",d.attr("id"));c.click(function(){var n=$(this).val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(n);$(this
).select()});var e=[];var i={};d.children("option").each(function(){var o=$(this).text();var n=$(this).attr("value");e.push(o);i[o]=n;i[n]=n;if(n==m){c.attr("value",o)}});if(m==""||m=="?"){c.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(e,f);d.replaceWith(c);var k=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){c.attr("value",n)}else{if(m!=""){c.attr("value",m)}else{c.attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_dbkeys",function(){k()});if(d.attr("refresh_on_change")=="true"){var h=d.attr("refresh_on_change_values"),l=d.attr("last_selected_value");if(h!==undefined){h=h.split(",")}var j=function(){var n=i[c.attr("value")];if(n!==null&&n!==undefined){if($.inArray(n,h)===-1&&$.inArray(l,h)===-1){return}c.attr("value",n);$(window).
trigger("refresh_on_change");c.parents("form").submit()}};c.bind("result",j);c.keyup(function(n){if(n.keyCode===13){j()}});c.keydown(function(n){if(n.keyCode===13){return false}})}})}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($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(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){if(o!=""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}funct
ion 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(0);'></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_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)}}retu
rn 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()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length==0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show
()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(".trackster-add").live("click",function(){var b=this,a=$(this);$.ajax({url:a.attr("data-url"),dataType:"html",error:function(){alert("Could not add this dataset to br
owser.")},success:function(c){var d=window.parent;d.show_modal("Add to Browser:",c,{"Insert into selected":function(){$(d.document).find("input[name=id]:checked").each(function(){var e=$(this).val();d.location=a.attr("action-url")+"&id="+e})},"Insert into new browser":function(){d.location=a.attr("new-url")},Cancel:function(){d.hide_modal()}})}})});$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500)});
+function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.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 fa
lse};$(b).bind("click",c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");if(obj_length(b)<=0){$("<li/>").html("No options").appendTo(a)}$.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"));a.find("a").bind("click",function(b){b.stopPropagation();return true});make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}funct
ion 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).split(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,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var d=$(this);var g=d.find("option").length;if((g<a)||(g>b)){return}if(d.attr("multiple")==true){return}if(d.hasClass("no-autocomplete")){return}var m=d.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",d.attr("name"));c.attr("id",d.attr("id"));c.click(function(){var n=$(this).
val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(n);$(this).select()});var e=[];var i={};d.children("option").each(function(){var o=$(this).text();var n=$(this).attr("value");e.push(o);i[o]=n;i[n]=n;if(n==m){c.attr("value",o)}});if(m==""||m=="?"){c.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(e,f);d.replaceWith(c);var k=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){c.attr("value",n)}else{if(m!=""){c.attr("value",m)}else{c.attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_dbkeys",function(){k()});if(d.attr("refresh_on_change")=="true"){var h=d.attr("refresh_on_change_values"),l=d.attr("last_selected_value");if(h!==undefined){h=h.split(",")}var j=function(){var n=i[c.attr("value")];if(n!==null&&n!==undefined){if
($.inArray(n,h)===-1&&$.inArray(l,h)===-1){return}c.attr("value",n);$(window).trigger("refresh_on_change");c.parents("form").submit()}};c.bind("result",j);c.keyup(function(n){if(n.keyCode===13){j()}});c.keydown(function(n){if(n.keyCode===13){return false}})}})}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($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(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){if(o!=""){l.text(o)}else{l.html("<em>None</em>")}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(0);'></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_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");i
f(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()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length==0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrappe
r"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(".trackster-add").live("click",function(){var b=this,a=$(this);$.ajax({url:a.attr("data-
url"),dataType:"html",error:function(){alert("Could not add this dataset to browser.")},success:function(c){var d=window.parent;d.show_modal("Add to Browser:",c,{"Insert into selected":function(){$(d.document).find("input[name=id]:checked").each(function(){var e=$(this).val();d.location=a.attr("action-url")+"&id="+e})},"Insert into new browser":function(){d.location=a.attr("new-url")},Cancel:function(){d.hide_modal()}})}})});$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500)});
--- a/templates/library/common/browse_library.mako
+++ b/templates/library/common/browse_library.mako
@@ -50,7 +50,7 @@
<%def name="grid_javascripts()"><script type="text/javascript">
- $( document ).ready( function () {
+ $(function () {
$("#library-grid").each( function() {
// Recursively fill in children and descendents of each row
var process_row = function( q, parents ) {
@@ -70,7 +70,7 @@
// remembering folder states, we'll need something
// more sophisticated here.
var visible = false;
- $(q).find( "span.expandLink").click( function() {
+ var expand_fn = function() {
if ( visible ) {
descendents.hide();
descendents.removeClass( "expanded" );
@@ -81,7 +81,9 @@
q.addClass( "expanded" );
visible = true;
}
- });
+ };
+ $(q).find("span.expandLink").click(expand_fn);
+ $(q).find("span.expandLink a").click(expand_fn);
// Check/uncheck boxes in subfolders.
q.children( "td" ).children( "input[type=checkbox]" ).click( function() {
if ( $(this).is(":checked") ) {
@@ -103,6 +105,17 @@
});
});
});
+
+ // For view info links, use a modal popup
+ /*$(".view-info").live("click", function() {
+ $.get( $(this).attr("href"), function(info) {
+ show_modal("View Information", info, {
+ "Close": function() { hide_modal(); }
+ });
+ });
+ return false;
+ });*/
+
function checkForm() {
if ( $("select#action_on_datasets_select option:selected").text() == "delete" ) {
if ( confirm( "Click OK to delete these datasets?" ) ) {
@@ -198,55 +211,56 @@
%endif
id="libraryItem-${ldda.id}"><td style="padding-left: ${pad+20}px;">
+ <input style="float: left;" type="checkbox" name="ldda_ids" value="${trans.security.encode_id( ldda.id )}"
%if selected:
- <input type="checkbox" name="ldda_ids" value="${trans.security.encode_id( ldda.id )}" checked/>
- %else:
- <input type="checkbox" name="ldda_ids" value="${trans.security.encode_id( ldda.id )}"/>
+ checked="checked"
%endif
+ />
%if ldda.library_dataset.deleted:
<span class="libraryItem-error">
- %endif
- <a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">${ldda.name[:50]}</a>
- %if ldda.library_dataset.deleted:
- </span>
- %endif
- %if not library.deleted:
- <a id="dataset-${ldda.id}-popup" class="popup-arrow" style="display: none;">▼</a>
- <div popupmenu="dataset-${ldda.id}-popup">
- %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
- <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">View information</a>
- %endif
- %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and not info_association:
- <a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add template</a>
- %endif
- %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and info_association:
- <a class="action-button" href="${h.url_for( controller='library_common', action='edit_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit template</a>
- <a class="action-button" href="${h.url_for( controller='library_common', action='delete_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Delete template</a>
- %endif
- %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_manage:
- %if not trans.app.security_agent.dataset_is_public( ldda.dataset ):
- <a class="action-button" href="${h.url_for( controller='library_common', action='make_library_item_public', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_type='ldda', id=trans.security.encode_id( ldda.dataset.id ), use_panels=use_panels, show_deleted=show_deleted )}">Make public</a>
- %endif
- <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_permissions', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a>
- %endif
- %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
- <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), replace_id=trans.security.encode_id( library_dataset.id ), show_deleted=show_deleted )}">Upload a new version of this dataset</a>
- %endif
- %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and ldda.has_data:
- <a class="action-button" href="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), ldda_ids=trans.security.encode_id( ldda.id ), do_action='import_to_history', use_panels=use_panels, show_deleted=show_deleted )}">Import this dataset into your current history</a>
- <a class="action-button" href="${h.url_for( controller='library_common', action='download_dataset_from_folder', cntrller=cntrller, id=trans.security.encode_id( ldda.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels )}">Download this dataset</a>
- %endif
- %if can_modify:
- %if not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.deleted:
- <a class="action-button" confirm="Click OK to delete dataset '${ldda.name}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Delete this dataset</a>
- %elif not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.purged and ldda.library_dataset.deleted:
- <a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Undelete this dataset</a>
- %endif
- %endif
- </div>
- %endif
+ %endif
+ <div style="float: left; margin-left: 1px;" class="menubutton split popup" id="dataset-${ldda.id}-popup">
+ <a class="view-info" href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">${ldda.name[:50]}</a>
+ </div>
+ %if ldda.library_dataset.deleted:
+ </span>
+ %endif
+ %if not library.deleted:
+ <div popupmenu="dataset-${ldda.id}-popup">
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
+ %else:
+ <a class="action-button" class="view-info" href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">View information</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and not info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add template</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and info_association:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='edit_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit template</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='delete_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Delete template</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_manage:
+ %if not trans.app.security_agent.dataset_is_public( ldda.dataset ):
+ <a class="action-button" href="${h.url_for( controller='library_common', action='make_library_item_public', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_type='ldda', id=trans.security.encode_id( ldda.dataset.id ), use_panels=use_panels, show_deleted=show_deleted )}">Make public</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='library_common', action='ldda_permissions', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), replace_id=trans.security.encode_id( library_dataset.id ), show_deleted=show_deleted )}">Upload a new version of this dataset</a>
+ %endif
+ %if not branch_deleted( folder ) and not ldda.library_dataset.deleted and ldda.has_data:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), ldda_ids=trans.security.encode_id( ldda.id ), do_action='import_to_history', use_panels=use_panels, show_deleted=show_deleted )}">Import this dataset into your current history</a>
+ <a class="action-button" href="${h.url_for( controller='library_common', action='download_dataset_from_folder', cntrller=cntrller, id=trans.security.encode_id( ldda.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels )}">Download this dataset</a>
+ %endif
+ %if can_modify:
+ %if not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.deleted:
+ <a class="action-button" confirm="Click OK to delete dataset '${ldda.name}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Delete this dataset</a>
+ %elif not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.purged and ldda.library_dataset.deleted:
+ <a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Undelete this dataset</a>
+ %endif
+ %endif
+ </div>
+ %endif
</td><td id="libraryItemInfo">${render_library_item_info( ldda )}</td><td>${uploaded_by}</td>
@@ -266,12 +280,12 @@
if root_folder:
pad = folder_pad
- expander = "/static/images/silk/resultset_bottom.png"
- folder_img = "/static/images/silk/folder_page.png"
+ expander = h.url_for("/static/images/silk/resultset_bottom.png")
+ folder_img = h.url_for("/static/images/silk/folder_page.png")
else:
pad = folder_pad + 20
- expander = "/static/images/silk/resultset_next.png"
- folder_img = "/static/images/silk/folder.png"
+ expander = h.url_for("/static/images/silk/resultset_next.png")
+ folder_img = h.url_for("/static/images/silk/folder.png")
if created_ldda_ids:
created_ldda_ids = util.listify( created_ldda_ids )
if str( folder.id ) in hidden_folder_ids:
@@ -311,14 +325,16 @@
%if folder.deleted:
<span class="libraryItem-error">
%endif
- <span class="expandLink"><span class="rowIcon"></span><a style="margin-left: 5px;" href="javascript:void(0);">${folder.name}</a></span>
+ <span class="expandLink"><span class="rowIcon"></span>
+ <div style="float: left; margin-left: 2px;" class="menubutton split popup" id="folder_img-${folder.id}-popup">
+ <a href="javascript:void(0);">${folder.name}</a>
+ </div>
%if folder.deleted:
</span>
%endif
%if not branch_deleted( folder ):
%if not library.deleted:
- <a id="folder_img-${folder.id}-popup" class="popup-arrow" style="display: none;">▼</a><div popupmenu="folder_img-${folder.id}-popup">
%if not branch_deleted( folder ) and can_add:
<a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add datasets</a>
@@ -328,7 +344,7 @@
%if can_modify:
<a class="action-button" href="${h.url_for( controller='library_common', action='folder_info', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
%else:
- <a class="action-button" href="${h.url_for( controller='library_common', action='folder_info', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">View information</a>
+ <a class="action-button" class="view-info" href="${h.url_for( controller='library_common', action='folder_info', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">View information</a>
%endif
%endif
%if not branch_deleted( folder ) and can_modify and not info_association:
--- a/static/june_2007_style/blue/library.css
+++ b/static/june_2007_style/blue/library.css
@@ -13,7 +13,7 @@ pre.peek{background:white;color:black;wi
pre.peek th{color:white;background:#023858;}
span.expandLink{padding-left:20px;display:inline-block;vertical-align:middle;background:url(../images/silk/resultset_next.png) no-repeat;}
.folderRow.expanded span.expandLink{background:url(../images/silk/resultset_bottom.png) no-repeat;}
-.folderRow span.rowIcon{width:16px;height:16px;display:inline-block;vertical-align:middle;background:url(../images/silk/folder.png);}
+.folderRow span.rowIcon{float:left;width:16px;height:16px;display:inline-block;vertical-align:middle;background:url(../images/silk/folder.png);}
.libraryItem-error{margin-right:2px;padding:0 2px 0 2px;border:1px solid #AA6666;background:#FFCCCC;}
.libraryItem-queued{margin-right:2px;padding:0 2px 0 2px;border:1px solid #888888;background:#EEEEEE;}
.libraryItem-running{margin-right:2px;padding:0 2px 0 2px;border:1px solid #AAAA66;background:#FFFFCC;}
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -43,7 +43,7 @@ function attach_popupmenu( button_elemen
$("#popup-helper").unbind( "click.popupmenu" ).hide();
// $(document).unbind( "click.popupmenu" );
};
- var click = function( e ) {
+ var click_handler = function( e ) {
// var o = $(button_element).offset();
$("#popup-helper").bind( "click.popupmenu", clean ).show();
// $(document).bind( "click.popupmenu", clean );
@@ -62,7 +62,7 @@ function attach_popupmenu( button_elemen
} );
return false;
};
- $( button_element ).click( click );
+ $(button_element).bind("click", click_handler);
}
function make_popupmenu( button_element, options ) {
@@ -112,6 +112,10 @@ function make_popup_menus() {
};
});
var b = $( "#" + $(this).attr( 'popupmenu' ) );
+ b.find("a").bind("click", function(e) {
+ e.stopPropagation(); // Stop bubbling so clicking on the link goes through
+ return true;
+ });
make_popupmenu( b, options );
$(this).remove();
b.addClass( "popup" ).show();
--- a/static/june_2007_style/library.css.tmpl
+++ b/static/june_2007_style/library.css.tmpl
@@ -76,6 +76,7 @@ span.expandLink {
}
.folderRow span.rowIcon {
+ float: left;
width: 16px;
height: 16px;
display: inline-block;
--- a/templates/library/common/library_info.mako
+++ b/templates/library/common/library_info.mako
@@ -34,9 +34,10 @@
<div class="toolForm"><div class="toolFormTitle">
- <a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}"><b>${library.name[:50]}</b></a>
+ <div class="menubutton split popup" id="library-${library.id}-popup">
+ <a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">${library.name[:50]}</a>
+ </div>
%if can_add or can_modify or can_manage:
- <a id="library-${library.id}-popup" class="popup-arrow" style="display: none;">▼</a><div popupmenu="library-${library.id}-popup">
%if not library.deleted:
%if can_add and not library.info_association:
--- a/templates/library/common/ldda_info.mako
+++ b/templates/library/common/ldda_info.mako
@@ -46,9 +46,8 @@
<div class="toolForm"><div class="toolFormTitle">
- Information about ${ldda.name}
+ Information about <div class="menubutton popup" id="dataset-${ldda.id}-popup">${ldda.name}</div>
%if not library.deleted and not branch_deleted( ldda.library_dataset.folder ) and not ldda.library_dataset.deleted:
- <a id="dataset-${ldda.id}-popup" class="popup-arrow" style="display: none;">▼</a><div popupmenu="dataset-${ldda.id}-popup">
%if can_modify:
<a class="action-button" href="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
1
0
galaxy-dist commit 8774252ac053: sample_tracking: migration script to modify the 'file_path' field type in 'sample_dataset' table to 'TEXT' so that it can support large file paths exceeding 255 characters
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1286199759 14400
# Node ID 8774252ac0531343953428a44a5a2b07e6fe514e
# Parent e32d77e1f47b1fc94b3e7511094e4b0d760f1e97
sample_tracking: migration script to modify the 'file_path' field type in 'sample_dataset' table to 'TEXT' so that it can support large file paths exceeding 255 characters
--- /dev/null
+++ b/lib/galaxy/model/migrate/versions/0059_sample_dataset_file_path.py
@@ -0,0 +1,59 @@
+"""
+Migration script to modify the 'file_path' field type in 'sample_dataset' table
+to 'TEXT' so that it can support large file paths exceeding 255 characters
+"""
+
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from migrate import *
+from migrate.changeset import *
+from sqlalchemy.exc import *
+
+from galaxy.model.custom_types import *
+from galaxy.util.json import from_json_string, to_json_string
+
+import datetime
+now = datetime.datetime.utcnow
+
+import logging
+log = logging.getLogger( __name__ )
+
+metadata = MetaData( migrate_engine )
+db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) )
+
+
+def upgrade():
+ print __doc__
+ metadata.reflect()
+ try:
+ SampleDataset_table = Table( "sample_dataset", metadata, autoload=True )
+ except NoSuchTableError, e:
+ SampleDataset_table = None
+ log.debug( "Failed loading table 'sample_dataset'" )
+
+ if SampleDataset_table:
+ cmd = "SELECT id, file_path FROM sample_dataset"
+ result = db_session.execute( cmd )
+ filepath_dict = {}
+ for r in result:
+ id = int(r[0])
+ filepath_dict[id] = r[1]
+ # remove the 'file_path' column
+ try:
+ SampleDataset_table.c.file_path.drop()
+ except Exception, e:
+ log.debug( "Deleting column 'file_path' from the 'sample_dataset' table failed: %s" % ( str( e ) ) )
+ # create the column again
+ try:
+ col = Column( "file_path", TEXT )
+ col.create( SampleDataset_table )
+ assert col is SampleDataset_table.c.file_path
+ except Exception, e:
+ log.debug( "Creating column 'file_path' in the 'sample_dataset' table failed: %s" % ( str( e ) ) )
+
+ for id, file_path in filepath_dict.items():
+ cmd = "update sample_dataset set file_path='%s' where id=%i" % (file_path, id)
+ db_session.execute( cmd )
+
+def downgrade():
+ pass
--- a/lib/galaxy/model/mapping.py
+++ b/lib/galaxy/model/mapping.py
@@ -620,7 +620,7 @@ SampleDataset.table = Table('sample_data
Column( "update_time", DateTime, default=now, onupdate=now ),
Column( "sample_id", Integer, ForeignKey( "sample.id" ), index=True ),
Column( "name", TrimmedString( 255 ), nullable=False ),
- Column( "file_path", TrimmedString( 255 ), nullable=False ),
+ Column( "file_path", TEXT ),
Column( "status", TrimmedString( 255 ), nullable=False ),
Column( "error_msg", TEXT ),
Column( "size", TrimmedString( 255 ) ) )
1
0
galaxy-dist commit ba6f40c5b3d3: Refactored refresh_on_change javascript code to run in galaxy.base when the page is loaded. Fixed bug with autocomplete_select: when switching from a value within refresh_on_change_values to a value outside of it, the page did not refresh. Removed duplicate code from templates.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1285964434 14400
# Node ID ba6f40c5b3d3ee82aa6719f98f58d4285bcbd66d
# Parent 4990d7b95b7273ba7159bfb2db1931a4e74a980a
Refactored refresh_on_change javascript code to run in galaxy.base when the page is loaded. Fixed bug with autocomplete_select: when switching from a value within refresh_on_change_values to a value outside of it, the page did not refresh. Removed duplicate code from templates.
--- a/templates/requests/common/new_request.mako
+++ b/templates/requests/common/new_request.mako
@@ -5,31 +5,6 @@
${render_msg( message, status )}
%endif
-<script type="text/javascript">
-$( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#new_request" ).submit();
- }
- });
-});
-</script>
-
<%def name="javascripts()">
${parent.javascripts()}
${h.js("jquery.autocomplete", "autocomplete_tagging" )}
--- a/templates/user/register.mako
+++ b/templates/user/register.mako
@@ -9,30 +9,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- <script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#registration" ).submit();
- }
- });
- });
- </script></%def><%
--- a/templates/library/common/folder_info.mako
+++ b/templates/library/common/folder_info.mako
@@ -4,30 +4,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- <script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#edit_info" ).submit();
- }
- });
- });
- </script></%def><%
--- a/static/scripts/packed/galaxy.base.js
+++ b/static/scripts/packed/galaxy.base.js
@@ -1,1 +1,1 @@
-function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.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 fa
lse};$(b).click(c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");if(obj_length(b)<=0){$("<li/>").html("No options").appendTo(a)}$.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 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).split(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,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var e=$(this);var h=e.find("option").length;if((h<a)||(h>b)){return}if(e.attr("multiple")==true){return}if(e.hasClass("no-autocomplete")){return}var l=e.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",e.attr("name"));c.attr("id",e.attr("id"));c.click(function(){var m=$(this).val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(m);$(this
).select()});var f=[];var i={};e.children("option").each(function(){var n=$(this).text();var m=$(this).attr("value");f.push(n);i[n]=m;i[m]=m;if(m==l){c.attr("value",n)}});if(l==""||l=="?"){c.attr("value","Click to Search or Select")}if(e.attr("name")=="dbkey"){f=f.sort(naturalSort)}var g={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(f,g);e.replaceWith(c);var k=function(){var n=c.attr("value");var m=i[n];if(m!==null&&m!==undefined){c.attr("value",m)}else{if(l!=""){c.attr("value",l)}else{c.attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_dbkeys",function(){k()});if(e.attr("refresh_on_change")=="true"){var d=e.attr("refresh_on_change_values");if(d!==undefined){d=d.split(",")}var j=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){refresh=false;if(d!==undefined){for(var m=0;m<d.length;m++){if(n==d[m]){refresh=true;break}}}else{refres
h=true}if(refresh){c.attr("value",n);c.parents("form").submit()}}};c.bind("result",j);c.keyup(function(m){if(m.keyCode===13){j()}});c.keydown(function(m){if(m.keyCode===13){return false}})}})}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($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(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){if(o!=""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();retur
n})}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(0);'></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_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()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length==0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(t
his).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}function GalaxyAsync(a){this.url_dict={};this.log_action=(a===undefined?false:a)}GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(".trackster-add").live("click",function(){var b=this,a=$(this);$.ajax({url:a.attr("data-url"),dataType:"html",error:function(){alert("Could not add this dataset t
o browser.")},success:function(c){var d=window.parent;d.show_modal("Add to Browser:",c,{"Insert into selected":function(){$(d.document).find("input[name=id]:checked").each(function(){var e=$(this).val();d.location=a.attr("action-url")+"&id="+e})},"Insert into new browser":function(){d.location=a.attr("new-url")},Cancel:function(){d.hide_modal()}})}})});$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500)});
+function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.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 fa
lse};$(b).click(c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");if(obj_length(b)<=0){$("<li/>").html("No options").appendTo(a)}$.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 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).split(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,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var d=$(this);var g=d.find("option").length;if((g<a)||(g>b)){return}if(d.attr("multiple")==true){return}if(d.hasClass("no-autocomplete")){return}var m=d.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",d.attr("name"));c.attr("id",d.attr("id"));c.click(function(){var n=$(this).val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(n);$(this
).select()});var e=[];var i={};d.children("option").each(function(){var o=$(this).text();var n=$(this).attr("value");e.push(o);i[o]=n;i[n]=n;if(n==m){c.attr("value",o)}});if(m==""||m=="?"){c.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(e,f);d.replaceWith(c);var k=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){c.attr("value",n)}else{if(m!=""){c.attr("value",m)}else{c.attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_dbkeys",function(){k()});if(d.attr("refresh_on_change")=="true"){var h=d.attr("refresh_on_change_values"),l=d.attr("last_selected_value");if(h!==undefined){h=h.split(",")}var j=function(){var n=i[c.attr("value")];if(n!==null&&n!==undefined){if($.inArray(n,h)===-1&&$.inArray(l,h)===-1){return}c.attr("value",n);$(window).
trigger("refresh_on_change");c.parents("form").submit()}};c.bind("result",j);c.keyup(function(n){if(n.keyCode===13){j()}});c.keydown(function(n){if(n.keyCode===13){return false}})}})}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($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(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){if(o!=""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}funct
ion 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(0);'></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_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)}}retu
rn 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()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length==0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show
()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(".trackster-add").live("click",function(){var b=this,a=$(this);$.ajax({url:a.attr("data-url"),dataType:"html",error:function(){alert("Could not add this dataset to br
owser.")},success:function(c){var d=window.parent;d.show_modal("Add to Browser:",c,{"Insert into selected":function(){$(d.document).find("input[name=id]:checked").each(function(){var e=$(this).val();d.location=a.attr("action-url")+"&id="+e})},"Insert into new browser":function(){d.location=a.attr("new-url")},Cancel:function(){d.hide_modal()}})}})});$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500)});
--- a/templates/library/common/library_info.mako
+++ b/templates/library/common/library_info.mako
@@ -4,30 +4,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- <script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#edit_info" ).submit();
- }
- });
- });
- </script></%def><%
--- a/templates/tool_form.mako
+++ b/templates/tool_form.mako
@@ -13,43 +13,24 @@ from galaxy.util.expressions import Expr
${h.css( "base", "autocomplete_tagging" )}
${h.js( "jquery", "galaxy.base", "jquery.autocomplete" )}
<script type="text/javascript">
-$( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
+$(function() {
+ $(window).bind("refresh_on_change", function() {
+ $(':file').each( function() {
+ var file = $(this);
+ var file_value = file.val();
+ if (file_value) {
+ // disable file input, since we don't want to upload the file on refresh
+ var file_name = $(this).attr("name");
+ file.attr( { name: 'replaced_file_input_' + file_name, disabled: true } );
+ // create a new hidden field which stores the filename and has the original name of the file input
+ var new_file_input = $('<input type="hidden" />');
+ new_file_input.attr( { "value": file_value, "name": file_name } );
+ file.after(new_file_input);
}
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( ':file' ).each( function() {
- var file_value = $( this )[0].value;
- if ( file_value ) {
- //disable file input, since we don't want to upload the file on refresh
- var file_name = $( this )[0].name;
- $( this )[0].name = 'replaced_file_input_' + file_name
- $( this )[0].disable = true;
- //create a new hidden field which stores the filename and has the original name of the file input
- var new_file_input = document.createElement( 'input' );
- new_file_input.type = 'hidden';
- new_file_input.value = file_value;
- new_file_input.name = file_name;
- document.getElementById( 'tool_form' ).appendChild( new_file_input );
- }
- } );
- $( "#tool_form" ).submit();
- }
- });
+ });
+ });
});
+
%if not add_frame.debug:
if( window.name != "galaxy_main" ) {
location.replace( '${h.url_for( controller='root', action='index', tool_id=tool.id )}' );
--- a/templates/requests/common/find.mako
+++ b/templates/requests/common/find.mako
@@ -5,31 +5,6 @@
${render_msg( message, status )}
%endif
-<script type="text/javascript">
-$( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#find_request" ).submit();
- }
- });
-});
-</script>
-
<%def name="javascripts()">
${parent.javascripts()}
${h.js("jquery.autocomplete", "autocomplete_tagging" )}
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -119,7 +119,7 @@ function make_popup_menus() {
}
// Alphanumeric/natural sort fn
-function naturalSort(a, b){
+function naturalSort(a, b) {
// setup temp-scope variables for comparison evauluation
var re = /(-?[0-9\.]+)/g,
x = a.toString().toLowerCase() || '',
@@ -249,45 +249,24 @@ function replace_big_select_inputs(min_l
$(document).bind("convert_dbkeys", function() { submit_hook(); } );
// If select is refresh on change, mirror this behavior.
- if (select_elt.attr('refresh_on_change') == 'true')
- {
+ if (select_elt.attr('refresh_on_change') == 'true') {
// Get refresh vals.
- var refresh_vals = select_elt.attr('refresh_on_change_values');
- if (refresh_vals !== undefined)
- refresh_vals = refresh_vals.split(",");
-
+ var ref_on_change_vals = select_elt.attr('refresh_on_change_values'),
+ last_selected_value = select_elt.attr("last_selected_value");
+ if (ref_on_change_vals !== undefined)
+ ref_on_change_vals = ref_on_change_vals.split(',');
+
// Function that attempts to refresh based on the value in the text element.
- var try_refresh_fn = function()
- {
- //
- // If value entered can be matched to value, do so and refresh by submitting parent form.
- //
-
+ var try_refresh_fn = function() {
// Get new value and see if it can be matched.
- var cur_value = text_input_elt.attr('value');
- var new_value = select_mapping[cur_value];
- if (new_value !== null && new_value !== undefined)
- {
- // Do refresh if new value is refresh value or if there are no refresh values.
- refresh = false;
- if (refresh_vals !== undefined)
- {
- for (var i= 0; i < refresh_vals.length; i++ )
- if (new_value == refresh_vals[i])
- {
- refresh = true;
- break;
- }
+ var new_value = select_mapping[text_input_elt.attr('value')];
+ if (new_value !== null && new_value !== undefined) {
+ if ($.inArray(new_value, ref_on_change_vals) === -1 && $.inArray(last_selected_value, ref_on_change_vals) === -1) {
+ return;
}
- else
- // Refresh for all values.
- refresh = true;
-
- if (refresh)
- {
- text_input_elt.attr('value', new_value);
- text_input_elt.parents('form').submit();
- }
+ text_input_elt.attr('value', new_value);
+ $(window).trigger("refresh_on_change");
+ text_input_elt.parents('form').submit();
}
};
@@ -295,15 +274,17 @@ function replace_big_select_inputs(min_l
// case a user may have manually entered a value that needs to be refreshed).
text_input_elt.bind("result", try_refresh_fn);
text_input_elt.keyup( function(e) {
- if ( e.keyCode === 13 ) // Return key
+ if (e.keyCode === 13) { // Return key
try_refresh_fn();
+ }
});
- // Disable return key so that it does not submit the form automatically. This is done because elememnt should behave like a
+ // Disable return key so that it does not submit the form automatically. This is done because element should behave like a
// select (enter = select), not text input (enter = submit form).
text_input_elt.keydown( function(e) {
- if ( e.keyCode === 13 ) // Return key
+ if (e.keyCode === 13) { // Return key
return false;
+ }
});
}
});
@@ -482,13 +463,13 @@ function commatize( number ) {
}
// Reset tool search to start state.
-function reset_tool_search( initValue )
-{
+function reset_tool_search( initValue ) {
// Function may be called in top frame or in tool_menu_frame;
// in either case, get the tool menu frame.
var tool_menu_frame = $("#galaxy_tools").contents();
- if (tool_menu_frame.length == 0)
+ if (tool_menu_frame.length == 0) {
tool_menu_frame = $(document);
+ }
// Remove classes that indicate searching is active.
$(this).removeClass("search_active");
@@ -499,18 +480,18 @@ function reset_tool_search( initValue )
tool_menu_frame.find(".toolTitle").show();
tool_menu_frame.find(".toolPanelLabel").show();
tool_menu_frame.find(".toolSectionWrapper").each( function() {
- if ($(this).attr('id') != 'recently_used_wrapper')
+ if ($(this).attr('id') != 'recently_used_wrapper') {
// Default action.
$(this).show();
- else if ($(this).hasClass("user_pref_visible"))
+ } else if ($(this).hasClass("user_pref_visible")) {
$(this).show();
+ }
});
tool_menu_frame.find("#search-no-results").hide();
// Reset search input.
tool_menu_frame.find("#search-spinner").hide();
- if (initValue)
- {
+ if (initValue) {
var search_input = tool_menu_frame.find("#tool-search-query");
search_input.val("search tools");
search_input.css("font-style", "italic");
@@ -518,20 +499,17 @@ function reset_tool_search( initValue )
}
// Create GalaxyAsync object.
-function GalaxyAsync(log_action)
-{
+var GalaxyAsync = function(log_action) {
this.url_dict = {};
this.log_action = (log_action === undefined ? false : log_action);
}
-GalaxyAsync.prototype.set_func_url = function( func_name, url )
-{
- this.url_dict[func_name] = url;
+GalaxyAsync.prototype.set_func_url = function( func_name, url ) {
+ this.url_dict[func_name] = url;
};
// Set user preference asynchronously.
-GalaxyAsync.prototype.set_user_pref = function( pref_name, pref_value )
-{
+GalaxyAsync.prototype.set_user_pref = function( pref_name, pref_value ) {
// Get URL.
var url = this.url_dict[arguments.callee];
if (url === undefined) { return false; }
@@ -544,8 +522,7 @@ GalaxyAsync.prototype.set_user_pref = fu
};
// Log user action asynchronously.
-GalaxyAsync.prototype.log_user_action = function( action, context, params )
-{
+GalaxyAsync.prototype.log_user_action = function( action, context, params ) {
if (!this.log_action) { return; }
// Get URL.
@@ -588,7 +565,24 @@ GalaxyAsync.prototype.log_user_action =
});
+
$(document).ready( function() {
+ $("select[refresh_on_change='true']").change( function() {
+ var select_field = $(this),
+ select_val = select_field.val(),
+ refresh = false,
+ ref_on_change_vals = select_field.attr("refresh_on_change_values");
+ if (ref_on_change_vals) {
+ ref_on_change_vals = ref_on_change_vals.split(',');
+ var last_selected_value = select_field.attr("last_selected_value");
+ if ($.inArray(select_val, ref_on_change_vals) === -1 && $.inArray(last_selected_value, ref_on_change_vals) === -1) {
+ return;
+ }
+ }
+ $(window).trigger("refresh_on_change");
+ select_field.get(0).form.submit();
+ });
+
// Links with confirmation
$( "a[confirm]" ).click( function() {
return confirm( $(this).attr("confirm") );
--- a/templates/requests/common/edit_request.mako
+++ b/templates/requests/common/edit_request.mako
@@ -5,31 +5,6 @@
${render_msg( message, status )}
%endif
-<script type="text/javascript">
-$( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#edit_request" ).submit();
- }
- });
-});
-</script>
-
<br/><br/><ul class="manage-table-actions">
--- a/templates/webapps/galaxy/user/info.mako
+++ b/templates/webapps/galaxy/user/info.mako
@@ -2,31 +2,6 @@
<%namespace file="/user/info.mako" import="render_user_info" /><%namespace file="/message.mako" import="render_msg" />
-<script type="text/javascript">
-$( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#user_info" ).submit();
- }
- });
-});
-</script>
-
%if message:
${render_msg( message, status )}
%endif
--- a/templates/admin/forms/edit_form.mako
+++ b/templates/admin/forms/edit_form.mako
@@ -6,31 +6,6 @@
%endif
<script type="text/javascript">
-$( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#edit_form" ).submit();
- }
- });
-});
-</script>
-
-<script type="text/javascript">
$(document).ready(function(){
//hide the all of the element with class msg_body
$(".msg_body").hide();
--- a/templates/library/common/upload.mako
+++ b/templates/library/common/upload.mako
@@ -14,31 +14,6 @@
<%def name="javascripts()">
${parent.javascripts()}
${h.js("jquery.autocomplete", "autocomplete_tagging" )}
-
- <script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#upload_library_dataset" ).submit();
- }
- });
- });
- </script></%def><%def name="stylesheets()">
--- a/templates/library/common/ldda_edit_info.mako
+++ b/templates/library/common/ldda_edit_info.mako
@@ -6,30 +6,6 @@
<%def name="javascripts()">
${parent.javascripts()}
${h.js("jquery.autocomplete", "autocomplete_tagging" )}
- <script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#edit_info" ).submit();
- }
- });
- });
- </script></%def><%def name="stylesheets()">
--- a/templates/library/common/library_dataset_info.mako
+++ b/templates/library/common/library_dataset_info.mako
@@ -4,30 +4,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- <script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#edit_info" ).submit();
- }
- });
- });
- </script></%def>
%if library_dataset == library_dataset.library_dataset_dataset_association.library_dataset:
--- a/templates/requests/common/show_request.mako
+++ b/templates/requests/common/show_request.mako
@@ -19,29 +19,6 @@
<%def name="javascripts()">
${parent.javascripts()}
<script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#show_request" ).submit();
- }
- });
- });
-
function showContent(vThis)
{
// http://www.javascriptjunkie.com
--- a/templates/library/common/select_template.mako
+++ b/templates/library/common/select_template.mako
@@ -5,30 +5,6 @@
from galaxy.web.form_builder import CheckboxField
inheritable_check_box = CheckboxField( 'inheritable' )
%>
-<script type="text/javascript">
-$( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#select_template" ).submit();
- }
- });
-});
-</script><br/><br/><ul class="manage-table-actions">
--- a/templates/library/common/ldda_info.mako
+++ b/templates/library/common/ldda_info.mako
@@ -25,30 +25,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- <script type="text/javascript">
- $( function() {
- $( "select[refresh_on_change='true']").change( function() {
- var refresh = false;
- var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
- if ( refresh_on_change_values ) {
- refresh_on_change_values = refresh_on_change_values.value.split( ',' );
- var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
- for( i= 0; i < refresh_on_change_values.length; i++ ) {
- if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
- refresh = true;
- break;
- }
- }
- }
- else {
- refresh = true;
- }
- if ( refresh ){
- $( "#edit_info" ).submit();
- }
- });
- });
- </script></%def>
%if current_version:
1
0
galaxy-dist commit 8f2e21b07986: Enable export history jobs to work when application option 'outputs_to_working_directory' is set to true. This will enable export history jobs to work on galaxy main and, more generally, when galaxy datasets are mounted read-only.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1286208862 14400
# Node ID 8f2e21b079864cb02b2c4e5bfc3343cbf867e259
# Parent 06d6ce09e0f152d38c632dae7ccba9337f25bab5
Enable export history jobs to work when application option 'outputs_to_working_directory' is set to true. This will enable export history jobs to work on galaxy main and, more generally, when galaxy datasets are mounted read-only.
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -321,6 +321,20 @@ class JobWrapper( object ):
inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] )
out_data = dict( [ ( da.name, da.dataset ) for da in job.output_datasets ] )
out_data.update( [ ( da.name, da.dataset ) for da in job.output_library_datasets ] )
+
+ # Set up output dataset association for export history jobs. Because job
+ # uses a Dataset rather than an HDA or LDA, it's necessary to set up a
+ # fake dataset association that provides the needed attributes for
+ # preparing a job.
+ class FakeDatasetAssociation ( object ):
+ def __init__( self, dataset=None ):
+ self.dataset = dataset
+ self.file_name = dataset.file_name
+ self.metadata = dict()
+ self.children = []
+ jeha = self.sa_session.query( model.JobExportHistoryArchive ).filter_by( job=job ).first()
+ if jeha:
+ out_data[ "output_file" ] = FakeDatasetAssociation( dataset=jeha.dataset )
# These can be passed on the command line if wanted as $userId $userEmail
if job.history and job.history.user: # check for anonymous user!
userId = '%d' % job.history.user.id
@@ -632,13 +646,21 @@ class JobWrapper( object ):
return self.false_path
job = self.sa_session.query( model.Job ).get( self.job_id )
+ # Job output datasets are combination of output datasets, library datasets, and jeha datasets.
+ jeha = self.sa_session.query( model.JobExportHistoryArchive ).filter_by( job=job ).first()
if self.app.config.outputs_to_working_directory:
self.output_paths = []
for name, data in [ ( da.name, da.dataset.dataset ) for da in job.output_datasets + job.output_library_datasets ]:
false_path = os.path.abspath( os.path.join( self.working_directory, "galaxy_dataset_%d.dat" % data.id ) )
self.output_paths.append( DatasetPath( data.id, data.file_name, false_path ) )
+ if jeha:
+ false_path = os.path.abspath( os.path.join( self.working_directory, "galaxy_dataset_%d.dat" % jeha.dataset.id ) )
+ self.output_paths.append( DatasetPath( jeha.dataset.id, jeha.dataset.file_name, false_path ) )
else:
self.output_paths = [ DatasetPath( da.dataset.dataset.id, da.dataset.file_name ) for da in job.output_datasets + job.output_library_datasets ]
+ if jeha:
+ self.output_paths.append( DatasetPath( jeha.dataset.id, jeha.dataset.file_name ) )
+
return self.output_paths
def get_output_file_id( self, file ):
--- a/lib/galaxy/tools/imp_exp/__init__.py
+++ b/lib/galaxy/tools/imp_exp/__init__.py
@@ -15,12 +15,15 @@ def load_history_imp_exp_tools( toolbox
<tool id="__EXPORT_HISTORY__" name="Export History" version="0.1" tool_type="export_history"><type class="ExportHistoryTool" module="galaxy.tools"/><action module="galaxy.tools.actions.history_imp_exp" class="ExportHistoryToolAction"/>
- <command>$__SET_EXPORT_HISTORY_COMMAND_LINE__</command>
+ <command>$__EXPORT_HISTORY_COMMAND_INPUTS_OPTIONS__ $output_file</command><inputs><param name="__HISTORY_TO_EXPORT__" type="hidden"/><param name="compress" type="boolean"/>
- <param name="__SET_EXPORT_HISTORY_COMMAND_LINE__" type="hidden"/>
+ <param name="__EXPORT_HISTORY_COMMAND_INPUTS_OPTIONS__" type="hidden"/></inputs>
+ <outputs>
+ <data format="gzip" name="output_file"/>
+ </outputs></tool>
"""
tmp_name = tempfile.NamedTemporaryFile()
@@ -40,7 +43,9 @@ class JobExportHistoryArchiveWrapper( ob
# jeha = job_export_history_archive for the job.
""" Perform setup for job to export a history into an archive. Method generates
attribute files for export, sets the corresponding attributes in the jeha
- object, and returns a command line for running the job. """
+ object, and returns a command line for running the job. The command line
+ includes the command, inputs, and options; it does not include the output
+ file because it must be set at runtime. """
#
# Helper methods/classes.
@@ -199,10 +204,9 @@ class JobExportHistoryArchiveWrapper( ob
options = ""
if jeha.compressed:
options = "-G"
- return "python %s %s %s %s %s %s" % (
+ return "python %s %s %s %s %s" % (
os.path.join( os.path.abspath( os.getcwd() ), "lib/galaxy/tools/imp_exp/export_history.py" ), \
- options, history_attrs_filename, datasets_attrs_filename, jobs_attrs_filename, \
- jeha.dataset.file_name )
+ options, history_attrs_filename, datasets_attrs_filename, jobs_attrs_filename )
def cleanup_after_job( self, db_session ):
""" Remove temporary directory and attribute files generated during setup for this job. """
--- a/lib/galaxy/tools/actions/history_imp_exp.py
+++ b/lib/galaxy/tools/actions/history_imp_exp.py
@@ -61,7 +61,7 @@ class ExportHistoryToolAction( ToolActio
# Set additional parameters.
incoming[ '__HISTORY_TO_EXPORT__' ] = history.id
- incoming[ '__SET_EXPORT_HISTORY_COMMAND_LINE__' ] = cmd_line
+ incoming[ '__EXPORT_HISTORY_COMMAND_INPUTS_OPTIONS__' ] = cmd_line
for name, value in tool.params_to_strings( incoming, trans.app ).iteritems():
job.add_parameter( name, value )
1
0
galaxy-dist commit 7b431b0dbc68: Fixed broken indentation.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Richard Burhans <burhans(a)bx.psu.edu>
# Date 1285872631 14400
# Node ID 7b431b0dbc687c1496ef5fba92dd443476d61d60
# Parent 51aaa9eac8182b25dbbffd1de902b78c916cb0f5
Fixed broken indentation.
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -646,10 +646,10 @@ class TwillTestCase( unittest.TestCase )
s2 = os.path.getsize(local_name)
if abs(s1-s2) > int(delta):
raise Exception, 'Files %s=%db but %s=%db - compare (delta=%s) failed' % (temp_name,s1,local_name,s2,delta)
- else:
- raise Exception, 'Unimplemented Compare type: %s' % compare
- if extra_files:
- self.verify_extra_files_content( extra_files, elem.get( 'id' ) )
+ else:
+ raise Exception, 'Unimplemented Compare type: %s' % compare
+ if extra_files:
+ self.verify_extra_files_content( extra_files, elem.get( 'id' ) )
except AssertionError, err:
errmsg = 'History item %s different than expected, difference (using %s):\n' % ( hid, compare )
errmsg += str( err )
1
0
galaxy-dist commit f60654e287a8: Fix bug that was causing Page item selection grids to be initialized twice and hence causing grid paging to fail.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1285782366 14400
# Node ID f60654e287a8534bbf3aea756064ef2d15600f6d
# Parent d681ef7538ed0c2314b3ec6ed9f99050b5a2ef03
Fix bug that was causing Page item selection grids to be initialized twice and hence causing grid paging to fail.
--- a/templates/tracks/add_tracks.mako
+++ b/templates/tracks/add_tracks.mako
@@ -7,6 +7,7 @@
${render_grid_table( grid, show_item_checkboxes=True )}
## Initialize the grid.
+## TODO: This may not be necessary -- check when adding tracks is working again.
<script type="text/javascript">
init_grid_elements();
init_grid_controls();
--- a/templates/page/select_items_grid.mako
+++ b/templates/page/select_items_grid.mako
@@ -5,9 +5,3 @@
${stylesheets()}
${render_grid_header( grid, False )}
${render_grid_table( grid, show_item_checkboxes=True )}
-
-## Initialize the grid.
-<script type="text/javascript">
- init_grid_elements();
- init_grid_controls();
-</script>
1
0
galaxy-dist commit c4441790bfaa: Fixed naming of the library selectfield for sample operations
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1290028751 18000
# Node ID c4441790bfaae82d4e84ad11ec58cea7715ea6ef
# Parent 29227c9c599292f7608e61cdd4b2be424b7a7bfc
Fixed naming of the library selectfield for sample operations
Fixed the broken popup menu in the data transfer grid
Fixed the missing required/optional field info in the request form
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1584,7 +1584,7 @@ class FormDefinition( object ):
if field[ 'helptext' ]:
helptext='%s (%s)' % ( field[ 'helptext' ], req )
else:
- helptext = ''
+ helptext = '(%s)' % req
widgets.append( dict( label=field[ 'label' ],
widget=field_widget,
helptext=helptext ) )
--- a/lib/galaxy/web/controllers/requests_common.py
+++ b/lib/galaxy/web/controllers/requests_common.py
@@ -185,7 +185,7 @@ class RequestsCommon( BaseController, Us
if request_type is not None or status == 'error':
# Either the user selected a request_type or an error exists on the form.
if is_admin:
- if not user_id_encoded:
+ if not user_id_encoded and user:
selected_user_id = trans.security.encode_id( user.id )
else:
selected_user_id = user_id
@@ -465,7 +465,7 @@ class RequestsCommon( BaseController, Us
sample_copy = self.__build_copy_sample_select_field( trans, displayable_sample_widgets )
libraries_select_field, folders_select_field = self.__build_library_and_folder_select_fields( trans,
request.user,
- 0,
+ 'sample_operation',
libraries,
None,
**kwd )
@@ -810,7 +810,6 @@ class RequestsCommon( BaseController, Us
# See if the user has selected a sample to copy.
copy_sample_index = int( params.get( 'copy_sample_index', -1 ) )
for index in range( num_samples_to_add ):
- id_index = len( displayable_sample_widgets ) + 1
if copy_sample_index != -1:
# The user has selected a sample to copy.
library_id = displayable_sample_widgets[ copy_sample_index][ 'library_select_field' ].get_selected( return_value=True )
@@ -826,7 +825,7 @@ class RequestsCommon( BaseController, Us
# Build the library_select_field and folder_select_field for the new sample being added.
library_select_field, folder_select_field = self.__build_library_and_folder_select_fields( trans,
user=request.user,
- sample_index=id_index,
+ sample_index=len( displayable_sample_widgets ),
libraries=libraries,
sample=None,
library_id=library_id,
@@ -1080,13 +1079,8 @@ class RequestsCommon( BaseController, Us
action='update_request_state',
request_id=trans.security.encode_id( request.id ) ) )
elif sample_operation == trans.model.Sample.bulk_operations.SELECT_LIBRARY:
- # TODO: fix the code so that the sample_operation_select_field does not use
- # sample_0_library_id as it's name. it should use something like sample_operation_library_id
- # and sample_operation_folder_id because the name sample_0_library_id should belong to the
- # first sample since all other form field values are named like this. The library and folder
- # are skewed to be named +1 resulting in the forced use of id_index everywhere...
- library_id = params.get( 'sample_0_library_id', 'none' )
- folder_id = params.get( 'sample_0_folder_id', 'none' )
+ library_id = params.get( 'sample_operation_library_id', 'none' )
+ folder_id = params.get( 'sample_operation_folder_id', 'none' )
library, folder = self.__get_library_and_folder( trans, library_id, folder_id )
for sample_index in range( len( samples ) ):
current_sample = samples[ sample_index ]
@@ -1254,15 +1248,14 @@ class RequestsCommon( BaseController, Us
if sample_operation != 'none':
# The sample_operatin param has a value other than 'none', and a specified
# set of samples was received.
- library_id = util.restore_text( params.get( 'sample_0_library_id', 'none' ) )
- folder_id = util.restore_text( params.get( 'sample_0_folder_id', 'none' ) )
+ library_id = util.restore_text( params.get( 'sample_operation_library_id', 'none' ) )
+ folder_id = util.restore_text( params.get( 'sample_operation_folder_id', 'none' ) )
# Build the list of widgets which will be used to render each sample row on the request page
if not request:
return sample_widgets
libraries = trans.app.security_agent.get_accessible_libraries( trans, request.user )
# Build the list if sample widgets, populating the values from kwd.
for index, sample in enumerate( samples ):
- id_index = index + 1
if sample is None:
# Use the sample from the request object since it will not have updated values from kwd.
sample = request.samples[ index ]
@@ -1277,10 +1270,10 @@ class RequestsCommon( BaseController, Us
sample_id = None
name = util.restore_text( params.get( 'sample_%i_name' % index, sample.name ) )
bar_code = util.restore_text( params.get( 'sample_%i_bar_code' % index, sample.bar_code ) )
- library_id = util.restore_text( params.get( 'sample_%i_library_id' % id_index, '' ) )
+ library_id = util.restore_text( params.get( 'sample_%i_library_id' % index, '' ) )
if not library_id and sample.library:
library_id = trans.security.encode_id( sample.library.id )
- folder_id = util.restore_text( params.get( 'sample_%i_folder_id' % id_index, '' ) )
+ folder_id = util.restore_text( params.get( 'sample_%i_folder_id' % index, '' ) )
if not folder_id and sample.folder:
folder_id = trans.security.encode_id( sample.folder.id )
library, folder = self.__get_library_and_folder( trans, library_id, folder_id )
@@ -1290,7 +1283,7 @@ class RequestsCommon( BaseController, Us
field_values.append( field_value )
library_select_field, folder_select_field = self.__build_library_and_folder_select_fields( trans=trans,
user=request.user,
- sample_index=id_index,
+ sample_index=index,
libraries=libraries,
sample=sample,
library_id=library_id,
@@ -1311,17 +1304,16 @@ class RequestsCommon( BaseController, Us
name = util.restore_text( params.get( 'sample_%i_name' % index, '' ) )
if not name:
break
- id_index = index + 1
bar_code = util.restore_text( params.get( 'sample_%i_bar_code' % index, '' ) )
- library_id = util.restore_text( params.get( 'sample_%i_library_id' % id_index, '' ) )
- folder_id = util.restore_text( params.get( 'sample_%i_folder_id' % id_index, '' ) )
+ library_id = util.restore_text( params.get( 'sample_%i_library_id' % index, '' ) )
+ folder_id = util.restore_text( params.get( 'sample_%i_folder_id' % index, '' ) )
library, folder = self.__get_library_and_folder( trans, library_id, folder_id )
field_values = []
for field_index in range( len( request.type.sample_form.fields ) ):
field_values.append( util.restore_text( params.get( 'sample_%i_field_%i' % ( index, field_index ), '' ) ) )
library_select_field, folder_select_field = self.__build_library_and_folder_select_fields( trans=trans,
user=request.user,
- sample_index=id_index,
+ sample_index=index,
libraries=libraries,
sample=None,
library_id=library_id,
@@ -1376,8 +1368,13 @@ class RequestsCommon( BaseController, Us
# not have ACCESS permissions associated with them (only LIBRARY_ADD, LIBRARY_MODIFY, LIBRARY_MANAGE), so all folders will
# be present in the folder_select_field for each library selected.
params = util.Params( kwd )
- library_select_field_name= "sample_%i_library_id" % sample_index
- folder_select_field_name = "sample_%i_folder_id" % sample_index
+ if sample_index == 'sample_operation':
+ # build the library selection widget for the bulk sample operation
+ library_select_field_name= "sample_operation_library_id"
+ folder_select_field_name = "sample_operation_folder_id"
+ else:
+ library_select_field_name= "sample_%i_library_id" % sample_index
+ folder_select_field_name = "sample_%i_folder_id" % sample_index
if not library_id:
library_id = params.get( library_select_field_name, None )
if not folder_id:
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -127,17 +127,14 @@ class DataTransferGrid( grids.Grid ):
operations = [
grids.GridOperation( "Transfer",
allow_multiple=True,
- condition=( lambda item: item.status in [ model.SampleDataset.transfer_status.NOT_STARTED ] ),
- url_args=dict( webapp="galaxy" ) ),
+ condition=( lambda item: item.status in [ model.SampleDataset.transfer_status.NOT_STARTED ] ) ),
grids.GridOperation( "Rename",
allow_multiple=True,
allow_popup=False,
- condition=( lambda item: item.status in [ model.SampleDataset.transfer_status.NOT_STARTED ] ),
- url_args=dict( webapp="galaxy" ) ),
+ condition=( lambda item: item.status in [ model.SampleDataset.transfer_status.NOT_STARTED ] ) ),
grids.GridOperation( "Delete",
allow_multiple=True,
- condition=( lambda item: item.status in [ model.SampleDataset.transfer_status.NOT_STARTED ] ),
- url_args=dict( webapp="galaxy" ) )
+ condition=( lambda item: item.status in [ model.SampleDataset.transfer_status.NOT_STARTED ] ) )
]
def apply_query_filter( self, trans, query, **kwd ):
sample_id = kwd.get( 'sample_id', None )
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1571,10 +1571,9 @@ class TwillTestCase( unittest.TestCase )
self.check_page_for_string( check_str )
for sample_index, ( sample_name, target_library_info, sample_field_values ) in enumerate( sample_value_tuples ):
tc.fv( "1", "sample_%i_name" % sample_index, sample_name )
- lib_widget_index = sample_index + 1
- tc.fv( "1", "sample_%i_library_id" % lib_widget_index, target_library_info[ 'library' ] )
- self.refresh_form( "sample_%i_library_id" % lib_widget_index, target_library_info[ 'library' ] )
- tc.fv( "1", "sample_%i_folder_id" % lib_widget_index, target_library_info[ 'folder' ] )
+ tc.fv( "1", "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] )
+ self.refresh_form( "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] )
+ tc.fv( "1", "sample_%i_folder_id" % sample_index, target_library_info[ 'folder' ] )
for field_index, field_value in enumerate( sample_field_values ):
tc.fv( "1", "sample_%i_field_%i" % ( sample_index, field_index ), field_value )
# Do not click on Add sample button when all the sample have been added
@@ -1592,10 +1591,9 @@ class TwillTestCase( unittest.TestCase )
self.check_page_for_string( check_str )
for sample_index, ( sample_name, target_library_info, sample_field_values ) in enumerate( sample_value_tuples ):
tc.fv( "1", "sample_%i_name" % sample_index, sample_name )
- lib_widget_index = sample_index + 1
- tc.fv( "1", "sample_%i_library_id" % lib_widget_index, target_library_info[ 'library' ] )
- self.refresh_form( "sample_%i_library_id" % lib_widget_index, target_library_info[ 'library' ] )
- tc.fv( "1", "sample_%i_folder_id" % lib_widget_index, target_library_info[ 'folder' ] )
+ tc.fv( "1", "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] )
+ self.refresh_form( "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] )
+ tc.fv( "1", "sample_%i_folder_id" % sample_index, target_library_info[ 'folder' ] )
for field_index, field_value in enumerate( sample_field_values ):
tc.fv( "1", "sample_%i_field_%i" % ( sample_index, field_index ), field_value )
tc.submit( "save_samples_button" )
@@ -1631,6 +1629,7 @@ class TwillTestCase( unittest.TestCase )
for sample_id in sample_ids:
tc.fv( "1", "select_sample_%i" % sample_id, True )
tc.fv( "1", "sample_operation", 'Change state' )
+ # refresh on change to show the sample states selectfield
self.refresh_form( "sample_operation", 'Change state' )
self.check_page_for_string( "Change current state" )
tc.fv( "1", "sample_state_id", new_sample_state_id )
@@ -1646,12 +1645,15 @@ class TwillTestCase( unittest.TestCase )
for sample_id in sample_ids:
tc.fv( "1", "select_sample_%i" % sample_id, True )
tc.fv( "1", "sample_operation", 'Select data library and folder' )
+ # refresh on change to show the data libraries selectfield
self.refresh_form( "sample_operation", 'Select data library and folder' )
self.check_page_for_string( "Select data library:" )
- tc.fv( "1", "sample_0_library_id", new_library_id )
- self.refresh_form( "sample_0_library_id", new_library_id )
+ tc.fv( "1", "sample_operation_library_id", new_library_id )
+ # refresh on change to show the selectfield with the list of
+ # folders in the selected data library above
+ self.refresh_form( "sample_operation_library_id", new_library_id )
self.check_page_for_string( "Select folder:" )
- tc.fv( "1", "sample_0_folder_id", new_folder_id )
+ tc.fv( "1", "sample_operation_folder_id", new_folder_id )
tc.submit( "save_samples_button" )
for check_str in strings_displayed_after_submit:
self.check_page_for_string( check_str )
--- a/templates/requests/common/view_request.mako
+++ b/templates/requests/common/view_request.mako
@@ -72,7 +72,7 @@
<div class="toolFormBody"><div class="form-row"><label>Current state:</label>
- ${request.state}
+ <a href="${h.url_for( controller='requests_common', action='view_request_history', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">${request.state}</a><div style="clear: both"></div></div><div class="form-row">
@@ -100,11 +100,7 @@
%><div class="form-row"><label>${field_label}:</label>
- %if field_label == 'State':
- <a href="${h.url_for( controller='requests_common', action='view_request_history', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">${field_value}</a>
- %else:
- ${field_value}
- %endif
+ ${field_value}
</div><div style="clear: both"></div>
%endfor
--- a/templates/requests/common/common.mako
+++ b/templates/requests/common/common.mako
@@ -476,13 +476,7 @@
<th>Name</th>
%for index, field in fields_dict.items():
<th>
- ${field['label']}
- ## TODO: help comments in the grid header are UGLY!
- ## If they are needed display them more appropriately,
- ## if they are not, delete this commented code.
- ##<div class="toolParamHelp" style="clear: both;">
- ## <i>${field['helptext']}</i>
- ##</div>
+ <a class="display tooltip" title="${field['helptext']}" >${field['label']}</a></th>
%endfor
<th></th>
1
0
galaxy-dist commit 940d77bec4d5: Remove unneeded grid initialization code.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1285797982 14400
# Node ID 940d77bec4d59a5418f9f731ca6ca114d748aa5d
# Parent 2aee56b5875a201b09f736764390651a177702d8
Remove unneeded grid initialization code.
--- a/templates/tracks/add_tracks.mako
+++ b/templates/tracks/add_tracks.mako
@@ -5,10 +5,3 @@
${grid_javascripts()}
${render_grid_header( grid, False )}
${render_grid_table( grid, show_item_checkboxes=True )}
-
-## Initialize the grid.
-## TODO: This may not be necessary -- check when adding tracks is working again.
-<script type="text/javascript">
- init_grid_elements();
- init_grid_controls();
-</script>
1
0
galaxy-dist commit a9694088cf69: trackster: Move "Add Tracks" button to main pane, UI tweaks for overview
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1285782969 14400
# Node ID a9694088cf69e31fbd3f940cca497e1d2e366f75
# Parent f60654e287a8534bbf3aea756064ef2d15600f6d
trackster: Move "Add Tracks" button to main pane, UI tweaks for overview
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -43,30 +43,12 @@
<div style="float:left;" id="title"></div><a class="panel-header-button right-float" href="${h.url_for( controller='visualization', action='list' )}">Close</a><a id="save-button" class="panel-header-button right-float" href="javascript:void(0);">Save</a>
- <a id="refresh-button" class="panel-header-button right-float" href="javascript:void(0);" onclick="view.update_options();return false;">Refresh</a>
+ <a id="add-track" class="panel-header-button right-float" href="javascript:void(0);">Add Tracks</a></div></div></%def>
-<%def name="right_panel()">
- <div class="unified-panel-header" unselectable="on">
- <div class="unified-panel-header-inner">Configuration
- <a id="add-track" class="panel-header-button right-float" href="javascript:void(0);">Add Tracks</a>
- </div>
- </div>
- <form action="#" onsubmit="view.update_options();return false;">
- <div id="show-hide-move">
- <div id="no-tracks" class="warningmessage" style="margin: 5px; display:none;">
- There are currently no tracks in this browser. Add tracks via the button above.
- </div>
- <ul id="sortable-ul"></ul>
- </div>
- <input type="submit" id="refresh-button" value="Refresh" style="display:none" />
- </form>
-
-</%def>
-
<%def name="javascripts()">
${parent.javascripts()}
${h.js( "galaxy.base", "galaxy.panels", "json2", "jquery", "jquery.event.drag", "jquery.autocomplete", "jquery.mousewheel", "trackster", "ui.core", "ui.sortable" )}
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -383,7 +383,7 @@ var View = function( container, chrom, t
var left_px = ( this.low / (this.max_high - this.max_low) ) * this.overview_viewport.width();
var width_px = (this.high - this.low)/(this.max_high - this.max_low) * this.overview_viewport.width();
- this.overview_box.css({ left: left_px, width: Math.max(12, width_px) - 2 }).show();
+ this.overview_box.css({ left: left_px, width: Math.max(12, width_px) }).show();
if (this.overview_highlight) {
this.overview_highlight.css({ left: left_px, width: width_px });
}
--- a/static/june_2007_style/blue/trackster.css
+++ b/static/june_2007_style/blue/trackster.css
@@ -6,12 +6,12 @@
.nav-controls a{padding:0 0.4em;}
.nav-input{font-size:12px;width:30em;z-index:1000;}
.location{display:inline-block;width:15em;margin:0px 10px;}
-.intro{position:absolute;top:50%;left:30%;color:#555;font-size:16px;}
+.intro{margin-top:200px;margin-left:auto;margin-right:auto;color:#555;text-align:center;font-size:16px;}
.overview{width:100%;margin:0px;color:white;}
.overview-viewport{position:relative;height:14px;background:white;border-bottom:solid gray 1px;margin:0;}
.overview-highlight{opacity:0.5;top:0px;position:absolute;z-index:100;border-style:solid;border-color:#6a6;border-width:0px 1px;}
-.overview-boxback{width:100%;bottom:0px;z-index:50;position:absolute;height:14px;background:#F8F8F8;}
-.overview-box{opacity:0.5;bottom:0px;z-index:100;position:absolute;margin-top:0px;height:14px;background:#cfc url(../images/visualization/draggable_horizontal.png) center center no-repeat;border-style:solid;border-color:#6a6;border-width:0px 2px;}
+.overview-boxback{width:100%;bottom:0px;z-index:50;position:absolute;height:14px;background:#eee;}
+.overview-box{opacity:0.5;bottom:0px;z-index:100;position:absolute;margin-top:0px;height:14px;background:#cfc url(../images/visualization/draggable_horizontal.png) center center no-repeat;border-style:solid;border-color:#6a6;border-width:0px 1px;}
.viewport-canvas{width:100%;height:100px;}
.yaxislabel{color:#777;}
.line-track .track-content{border-top:1px solid #ddd;border-bottom:1px solid #ddd;}
--- a/static/june_2007_style/trackster.css.tmpl
+++ b/static/june_2007_style/trackster.css.tmpl
@@ -35,10 +35,11 @@
margin: 0px 10px;
}
.intro {
- position: absolute;
- top: 50%;
- left: 30%;
+ margin-top: 200px;
+ margin-left: auto;
+ margin-right: auto;
color: #555;
+ text-align: center;
font-size: 16px;
}
.overview {
@@ -70,7 +71,7 @@
z-index: 50;
position: absolute;
height: 14px;
- background: #F8F8F8;
+ background: #eee;
}
.overview-box {
opacity: 0.5;
@@ -82,7 +83,7 @@
background: #cfc url(../images/visualization/draggable_horizontal.png) center center no-repeat;
border-style: solid;
border-color: #6a6;
- border-width: 0px 2px;
+ border-width: 0px 1px;
}
.viewport-canvas {
width: 100%;
--- a/static/scripts/packed/trackster.js
+++ b/static/scripts/packed/trackster.js
@@ -1,1 +1,1 @@
-var DENSITY=200,FEATURE_LEVELS=10,MAX_FEATURE_DEPTH=100,DATA_ERROR="There was an error in indexing this dataset. ",DATA_NOCONVERTER="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=5,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),PX_PER_CHAR=CONTEXT.measureText("A").width,RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src=image_path+"/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src=image_path+"/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src=image_path+"/visualization/strand_right_inv.png";right_img_inv.onload=function()
{RIGHT_STRAND_INV=CONTEXT.createPattern(right_img_inv,"repeat")};var left_img_inv=new Image();left_img_inv.src=image_path+"/visualization/strand_left_inv.png";left_img_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};function round_1000(a){return Math.round(a*1000)/1000}var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(a,c,e,d,b){this.container=a;this.vis_id=d;this.dbkey=b;this.title=e;this.chrom=c;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.num_tracks=0;this.track_id_counter=0;this.zoom_factor=3;this.
min_separation=30;this.has_changes=false;this.init();this.reset()};$.extend(View.prototype,{init:function(){var c=this.container,a=this;this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(c);this.content_div=$("<div/>").addClass("content").css("position","relative").hide().appendTo(c);this.intro_div=$("<div/>").addClass("intro").text("Select a chrom from the dropdown below").hide().appendTo(c);this.viewport_container=$("<div/>").addClass("viewport-container").addClass("viewport-container").appendTo(this.content_div);this.nav_container=$("<div/>").addClass("nav-container").appendTo(c);this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.nav_container);this.nav=$("<div/>").addClass("nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.nav);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_box_background=$("<div/>").addClass("overview-boxback").app
endTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_form=$("<form/>").attr("action",function(){void (0)}).appendTo(this.nav_controls);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.chrom_form);var b=function(d){if(d.type==="focusout"||(d.keyCode||d.which)===13||(d.keyCode||d.which)===27){if((d.keyCode||d.which)!==27){a.go_to($(this).val())}$(this).hide();a.location_span.show();a.chrom_select.show();return false}};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keypress focusout",b).appendTo(this.chrom_form);this.location_span=$("<span/>").addClass("location").appendTo(this.chrom_form);this.location_span.bind("click",function(){a.location_span.hi
de();a.chrom_select.hide();a.nav_input.css("display","inline-block");a.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.chrom_form)}this.zo_link=$("<a/>").click(function(){a.zoom_out();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom-out.png" />').appendTo(this.chrom_form);this.zi_link=$("<a/>").click(function(){a.zoom_in();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom.png" />').appendTo(this.chrom_form);$.ajax({url:chrom_url,data:(this.vis_id!==undefined?{vis_id:this.vis_id}:{dbkey:this.dbkey}),dataType:"json",success:function(d){if(d.reference){a.add_label_track(new ReferenceTrack(a))}a.chrom_data=d.chrom_info;var f='<option value="">Select Chrom/Contig</option>';for(i in a.chrom_data){var e=a.chrom_data[i]["chrom"];f+='<option value="'+e+'">'+e+"</option>"}a.chrom_select.html(f);a.intro_div.show();a.content_div.hide();a.chrom_select.bind("change",function
(){a.change_chrom(a.chrom_select.val())})},error:function(){alert("Could not load chroms for this dbkey:",a.dbkey)}});this.content_div.bind("dblclick",function(d){a.zoom_in(d.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(d){this.current_x=d.offsetX}).bind("drag",function(d){var g=d.offsetX-this.current_x;this.current_x=d.offsetX;var f=Math.round(g/a.viewport_container.width()*(a.max_high-a.max_low));a.move_delta(-f)});this.viewport_container.bind("dragstart",function(d){this.original_low=a.low;this.current_height=d.clientY;this.current_x=d.offsetX;this.active=(d.clientX<a.viewport_container.width()-16)?true:false}).bind("drag",function(g){if(!this.active){return}var d=$(this);var j=g.offsetX-this.current_x;var f=d.scrollTop()-(g.clientY-this.current_height);d.scrollTop(f);this.current_height=g.clientY;this.current_x=g.offsetX;var h=Math.round(j/a.viewport_container.width()*(a.high-a.low));a.move_delta(h)});this.top_labeltrack.bind("dragstart",f
unction(d){this.drag_origin_x=d.clientX;this.drag_origin_pos=d.clientX/a.viewport_container.width()*(a.high-a.low)+a.low;this.drag_div=$("<div />").css({height:a.content_div.height()+30,top:"0px",position:"absolute","background-color":"#cfc",border:"1px solid #6a6",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(j){var f=Math.min(j.clientX,this.drag_origin_x)-a.container.offset().left,d=Math.max(j.clientX,this.drag_origin_x)-a.container.offset().left,h=(a.high-a.low),g=a.viewport_container.width();a.update_location(Math.round(f/g*h)+a.low,Math.round(d/g*h)+a.low);this.drag_div.css({left:f+"px",width:(d-f)+"px"})}).bind("dragend",function(k){var f=Math.min(k.clientX,this.drag_origin_x),d=Math.max(k.clientX,this.drag_origin_x),h=(a.high-a.low),g=a.viewport_container.width(),j=a.low;a.low=Math.round(f/g*h)+j;a.high=Math.round(d/g*h)+j;this.drag_div.remove();a.redraw()});this.add_label_track(new LabelTrack(this,this.top_labeltrack));this.add_label_track(new
LabelTrack(this,this.nav_labeltrack))},update_location:function(a,b){this.location_span.text(commatize(a)+" - "+commatize(b));this.nav_input.val(this.chrom+":"+commatize(a)+"-"+commatize(b))},change_chrom:function(d,a,f){var c=this;var e=$.grep(c.chrom_data,function(h,j){return h.chrom===d})[0];if(e===undefined){return}if(d!==c.chrom){c.chrom=d;if(c.chrom===""){c.intro_div.show();c.content_div.hide()}else{c.intro_div.hide();c.content_div.show()}c.chrom_select.val(c.chrom);c.max_high=e.len;c.reset();c.redraw(true);for(var g in c.tracks){var b=c.tracks[g];if(b.init){b.init()}}}if(a!==undefined&&f!==undefined){c.low=Math.max(a,0);c.high=Math.min(f,c.max_high)}c.overview_viewport.find("canvas").remove();c.redraw()},go_to:function(f){var k=this,b=f.split(":"),h=b[0],j=b[1];if(j!==undefined){try{var g=j.split("-"),a=parseInt(g[0].replace(/,/g,"")),d=parseInt(g[1].replace(/,/g,""))}catch(c){return false}}k.change_chrom(h,a,d)},move_delta:function(c){var a=this;var b=a.high-a.low;i
f(a.low-c<a.max_low){a.low=a.max_low;a.high=a.max_low+b}else{if(a.high-c>a.max_high){a.high=a.max_high;a.low=a.max_high-b}else{a.high-=c;a.low-=c}}a.redraw()},add_track:function(a){a.view=this;a.track_id=this.track_id_counter;this.tracks.push(a);if(a.init){a.init()}a.container_div.attr("id","track_"+a.track_id);this.track_id_counter+=1;this.num_tracks+=1},add_label_track:function(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){this.has_changes=true;a.container_div.fadeOut("slow",function(){$(this).remove()});delete this.tracks[this.tracks.indexOf(a)];this.num_tracks-=1},update_options:function(){this.has_changes=true;var b=$("ul#sortable-ul").sortable("toArray");for(var c in b){var e=b[c].split("_li")[0].split("track_")[1];this.viewport_container.append($("#track_"+e))}for(var d in view.tracks){var a=view.tracks[d];if(a&&a.update_options){a.update_options(d)}}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".ya
xislabel").remove()},redraw:function(h){var d=this.high-this.low,b=this.low,f=this.high;if(b<this.max_low){b=this.max_low}if(f>this.max_high){f=this.max_high}if(this.high!==0&&d<this.min_separation){f=b+this.min_separation}this.low=Math.floor(b);this.high=Math.ceil(f);this.resolution=Math.pow(10,Math.ceil(Math.log((this.high-this.low)/200)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));var e=(this.low/(this.max_high-this.max_low))*this.overview_viewport.width();var g=(this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width();this.overview_box.css({left:e,width:Math.max(12,g)-2}).show();if(this.overview_highlight){this.overview_highlight.css({left:e,width:g})}this.update_location(this.low,this.high);if(!h){for(var c=0,a=this.tracks.length;c<a;c++){if(this.tracks[c]&&this.tracks[c].enabled){this.tracks[c].draw()}}for(var c=0,a=this.label_tracks.length;c<a;c++){thi
s.label_tracks[c].draw()}}},zoom_in:function(b,c){if(this.max_high===0||this.high-this.low<this.min_separation){return}var d=this.high-this.low,e=d/2+this.low,a=(d/this.zoom_factor)/2;if(b){e=b/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(e-a);this.high=Math.round(e+a);this.redraw()},zoom_out:function(){if(this.max_high===0){return}var b=this.high-this.low,c=b/2+this.low,a=(b*this.zoom_factor)/2;this.low=Math.round(c-a);this.high=Math.round(c+a);this.redraw()}});var Track=function(b,a,c){this.name=b;this.parent_element=c;this.view=a;this.init_global()};$.extend(Track.prototype,{init_global:function(){this.container_div=$("<div />").addClass("track");if(!this.hidden){this.header_div=$("<div class='track-header' />").appendTo(this.container_div);this.name_div=$("<div class='menubutton popup' />").appendTo(this.header_div);this.name_div.text(this.name)}this.content_div=$("<div class='track-content'>").appendTo(this.container_div);this.parent
_element.append(this.container_div)},init_each:function(c,b){var a=this;a.enabled=false;a.data_queue={};a.tile_cache.clear();a.data_cache.clear();a.initial_canvas=undefined;a.content_div.css("height","auto");if(!a.content_div.text()){a.content_div.text(DATA_LOADING)}a.container_div.removeClass("nodata error pending");if(a.view.chrom){$.getJSON(data_url,c,function(d){if(!d||d==="error"||d.kind==="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR);if(d.message){var f=a.view.tracks.indexOf(a);var e=$("<a href='javascript:void(0);'></a>").attr("id",f+"_error");e.text("Click to view error");$("#"+f+"_error").live("click",function(){show_modal("Trackster Error","<pre>"+d.message+"</pre>",{Close:hide_modal})});a.content_div.append(e)}}else{if(d==="no converter"){a.container_div.addClass("error");a.content_div.text(DATA_NOCONVERTER)}else{if(d.data!==undefined&&(d.data===null||d.data.length===0)){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}e
lse{if(d==="pending"){a.container_div.addClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");a.enabled=true;b(d);a.draw()}}}}})}else{a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}}});var TiledTrack=function(){var d=this,c=d.view;if(d.hidden){return}if(d.display_modes!==undefined){if(d.mode_div===undefined){d.mode_div=$("<div class='right-float menubutton popup' />").appendTo(d.header_div);var h=d.display_modes[0];d.mode=h;d.mode_div.text(h);var a=function(j){d.mode_div.text(j);d.mode=j;d.tile_cache.clear();d.draw()};var f={};for(var e in d.display_modes){var g=d.display_modes[e];f[g]=function(j){return function(){a(j)}}(g)}make_popupmenu(d.mode_div,f)}else{d.mode_div.hide()}}var b={};b["Set track as overview"]=function(){c.overview_viewport.find("canvas").remove();d.is_overview=true;d.set_overview();for(var j in c.tracks){if(c.tracks[j]!==d){c.track
s[j].is_overview=false}}};b["Edit configuration"]=function(){show_modal("Configure Track",d.gen_options(d.track_id),{Cancel:function(){hide_modal()},OK:function(){d.update_options(d.track_id);hide_modal()}})};b.Remove=function(){c.remove_track(d);if(c.num_tracks===0){$("#no-tracks").show()}};make_popupmenu(d.name_div,b)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var j=this.view.low,e=this.view.high,f=e-j,d=this.view.resolution;var l=$("<div style='position: relative;'></div>"),m=this.content_div.width()/f,h;this.content_div.children(":first").remove();this.content_div.append(l),this.max_height=0;var a=Math.floor(j/d/DENSITY);while((a*DENSITY*d)<e){var k=this.content_div.width()+"_"+m+"_"+a;var c=this.tile_cache.get(k);if(c){var g=a*DENSITY*d;var b=(g-j)*m;if(this.left_offset){b-=this.left_offset}c.css({left:b});l.append(c);this.max_height=Math.max(this.max_height,c.height());this.content_div.css("height",this.max_height+"px")}else{this.delayed_draw(this,
k,j,e,a,d,l,m)}a+=1}},delayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_element){if(!c.initial_canvas){c.initial_canvas=$(tile_element).clone();var l=tile_element.get(0).getContext("2d");var j=c.initial_canvas.get(0).getContext("2d");var k=l.getImageData(0,0,l.canvas.width,l.canvas.height);j.putImageData(k,0,0);c.set_overview()}c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height+"px")}}},50)},set_overview:function(){var a=this.view;a.overview_viewport.height(a.default_overview_height);a.overview_box.height(a.default_overview_height);if(this.initial_canvas&&this.is_overview){if(!a.overview_highlight){a.overview_highlight=$("<div />").addClass("overview-highlight").appendTo(a.overview_viewport)}a.overview_viewport.append(this.initial_canvas);a.overview_highlight.height(this.initial_canvas.height());a.overview_vie
wport.height(this.initial_canvas.height()+a.overview_box.height())}$(window).trigger("resize")}});var LabelTrack=function(a,b){this.track_type="LabelTrack";this.hidden=true;Track.call(this,null,a,b);this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var ReferenceTrack=function(a){this.track_type="ReferenceTrack";this.hidden=true;Track.call(this,null,a,a.top_labeltrack);TiledTrack.call(this);this.height_px=12;this.container_div.addClass("reference-track");this.dummy_canvas=$("<canvas></canvas>").get(0).getContex
t("2d");this.data_queue={};this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE)};$.extend(ReferenceTrack.prototype,TiledTrack.prototype,{get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:reference_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dbkey:this.view.dbkey},success:function(g){c.data_cache.set(e,g);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(f,b,k,o){var g=b*DENSITY*f,d=DENSITY*f,e=$("<canvas class='tile'></canvas>"),n=e.get(0).getContext("2d"),j=f+"_"+b;if(o>PX_PER_CHAR){if(this.data_cache.get(j)===undefined){this.get_data(f,b);return}var m=this.data_cache.get(j);if(m===null){this.content_div.css("height","0px");return}e.get(0).width=Math.ceil(d*o+this.left_offset);e.get(0).height=this.height_px;e.css({position:"absolute",top:0,left:(g-this.view.low)*o-this.left_offset});for(var h=0,l=m.le
ngth;h<l;h++){var a=Math.round(h*o);n.fillText(m[h],a+this.left_offset,10)}k.append(e);return e}this.content_div.css("height","0px")}});var LineTrack=function(d,b,a,c){this.track_type="LineTrack";this.display_modes=["Line","Filled","Intensity"];this.mode="Line";Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=80;this.dataset_id=a;this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE);this.prefs={min_value:undefined,max_value:undefined,mode:"Line"};if(c.min_value!==undefined){this.prefs.min_value=c.min_value}if(c.max_value!==undefined){this.prefs.max_value=c.max_value}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.tracks.indexOf(a);a.vertical_range=undefined;this.init_each({stats:true,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){a.container_div.addClass("line-track");data=c.data;if(isNaN(parseFloat(a.prefs.min_value))||isNaN(parseFloat(a.prefs.max
_value))){a.prefs.min_value=data.min;a.prefs.max_value=data.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.vertical_range=a.prefs.max_value-a.prefs.min_value;a.total_frequency=data.total_frequency;$("#linetrack_"+b+"_minval").remove();$("#linetrack_"+b+"_maxval").remove();var e=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(round_1000(a.prefs.min_value));var d=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(round_1000(a.prefs.max_value));d.css({position:"relative",top:"32px",left:"10px"});d.prependTo(a.container_div);e.css({position:"relative",top:a.height_px+32+"px",left:"10px"});e.prependTo(a.container_div)})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:data_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution}
,success:function(g){data=g.data;c.data_cache.set(e,data);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(p,r,c,e){if(this.vertical_range===undefined){return}var s=r*DENSITY*p,a=DENSITY*p,b=$("<canvas class='tile'></canvas>"),v=p+"_"+r;if(this.data_cache.get(v)===undefined){this.get_data(p,r);return}var j=this.data_cache.get(v);if(j===null){return}b.css({position:"absolute",top:0,left:(s-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var o=b.get(0).getContext("2d"),k=false,l=this.prefs.min_value,g=this.prefs.max_value,n=this.vertical_range,t=this.total_frequency,d=this.height_px,m=this.mode;o.beginPath();if(data.length>1){var f=Math.ceil((data[1][0]-data[0][0])*e)}else{var f=10}var u,h;for(var q=0;q<data.length;q++){u=(data[q][0]-s)*e;h=data[q][1];if(m=="Intensity"){if(h===null){continue}if(h<=l){h=l}else{if(h>=g){h=g}}h=255-Math.floor((h-l)/n*255);o.fillStyle="rgb("+h+","+h+","+h+")";o.fillRe
ct(u,0,f,this.height_px)}else{if(h===null){if(k&&m==="Filled"){o.lineTo(u,d)}k=false;continue}else{if(h<=l){h=l}else{if(h>=g){h=g}}h=Math.round(d-(h-l)/n*d);if(k){o.lineTo(u,h)}else{k=true;if(m==="Filled"){o.moveTo(u,d);o.lineTo(u,h)}else{o.moveTo(u,h)}}}}}if(m==="Filled"){if(k){o.lineTo(u,d)}o.fill()}else{o.stroke()}c.append(b);return b},gen_options:function(k){var a=$("<div />").addClass("form-row");var e="track_"+k+"_minval",h=$("<label></label>").attr("for",e).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),j=$("<input></input>").attr("id",e).val(b),g="track_"+k+"_maxval",d=$("<label></label>").attr("for",g).text("Max value:"),f=(this.prefs.max_value===undefined?"":this.prefs.max_value),c=$("<input></input>").attr("id",g).val(f);return a.append(h).append(j).append(d).append(c)},update_options:function(c){var a=$("#track_"+c+"_minval").val(),b=$("#track_"+c+"_maxval").val();if(a!==this.prefs.min_value||b!==this.prefs.max_value){this.prefs.m
in_value=parseFloat(a);this.prefs.max_value=parseFloat(b);this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+c+"_minval").text(this.prefs.min_value);$("#linetrack_"+c+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(d,b,a,c){this.track_type="FeatureTrack";this.display_modes=["Auto","Dense","Squish","Pack"];Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=0;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=2;this.summary_draw_height=20;this.default_font="9px Monaco, Lucida Console, monospace";this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.tile_cache=new Cache(CACHED_TILES_FEATURE);this.data_cache=new Cache(20);this.left_offset=200;this.prefs={block_color:"black",label_color:"black",show_counts:true};if(c.block_colo
r!==undefined){this.prefs.block_color=c.block_color}if(c.label_color!==undefined){this.prefs.label_color=c.label_color}if(c.show_counts!==undefined){this.prefs.show_counts=c.show_counts}};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b="initial";this.init_each({low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom,resolution:this.view.resolution,mode:a.mode},function(c){a.mode_div.show();a.data_cache.set(b,c);a.draw()})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.getJSON(data_url,{chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,resolution:this.view.resolution,mode:this.mode},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},incremental_slots:function(a,h,c,r){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=a;this.inc_slots[a].mode=r;this.s_e_by_tile[a]={}}var n=this.inc_slots[a].w_scale,z=[],l=0,b=$("<canvas></canvas>"
).get(0).getContext("2d"),o=this.view.max_low;var B=[];if(this.inc_slots[a].mode!==r){delete this.inc_slots[a];this.inc_slots[a]={mode:r,w_scale:n};delete this.s_e_by_tile[a];this.s_e_by_tile[a]={}}for(var w=0,x=h.length;w<x;w++){var g=h[w],m=g[0];if(this.inc_slots[a][m]!==undefined){l=Math.max(l,this.inc_slots[a][m]);B.push(this.inc_slots[a][m])}else{z.push(w)}}for(var w=0,x=z.length;w<x;w++){var g=h[z[w]],m=g[0],s=g[1],d=g[2],q=g[3],e=Math.floor((s-o)*n),f=Math.ceil((d-o)*n);if(q!==undefined&&!c){var t=b.measureText(q).width;if(e-t<0){f+=t}else{e-=t}}var v=0;while(true){var p=true;if(this.s_e_by_tile[a][v]!==undefined){for(var u=0,A=this.s_e_by_tile[a][v].length;u<A;u++){var y=this.s_e_by_tile[a][v][u];if(f>y[0]&&e<y[1]){p=false;break}}}if(p){if(this.s_e_by_tile[a][v]===undefined){this.s_e_by_tile[a][v]=[]}this.s_e_by_tile[a][v].push([e,f]);this.inc_slots[a][m]=v;l=Math.max(l,v);break}v++}}return l},rect_or_text:function(n,o,f,m,b,d,k,e,h){n.textAlign="center";var j=Math.r
ound(o/2);if((this.mode==="Pack"||this.mode==="Auto")&&d!==undefined&&o>PX_PER_CHAR){n.fillStyle=this.prefs.block_color;n.fillRect(k,h+1,e,9);n.fillStyle="#eee";for(var g=0,l=d.length;g<l;g++){if(b+g>=f&&b+g<=m){var a=Math.floor(Math.max(0,(b+g-f)*o));n.fillText(d[g],a+this.left_offset+j,h+9)}}}else{n.fillStyle=this.prefs.block_color;n.fillRect(k,h+4,e,3)}},draw_tile:function(aa,l,o,an){var H=l*DENSITY*aa,ag=(l+1)*DENSITY*aa,G=ag-H;var ah=(!this.initial_canvas?"initial":H+"_"+ag);var C=this.data_cache.get(ah);var d;if(C===undefined||(this.mode!=="Auto"&&C.dataset_type==="summary_tree")){this.data_queue[[H,ag]]=true;this.get_data(H,ag);return}var a=Math.ceil(G*an),O=$("<canvas class='tile'></canvas>"),ac=this.prefs.label_color,g=this.prefs.block_color,n=this.mode,r=25,Y=(n==="Squish")||(n==="Dense")&&(n!=="Pack")||(n==="Auto"&&(C.extra_info==="no_detail")),S=this.left_offset,am,v,ao;if(C.dataset_type==="summary_tree"){v=this.summary_draw_height}else{if(n==="Dense"){v=r;ao=10}
else{ao=(Y?this.vertical_nodetail_px:this.vertical_detail_px);var s=(an<0.0001?1/view.zoom_res:an);v=this.incremental_slots(s,C.data,Y,n)*ao+r;am=this.inc_slots[s]}}O.css({position:"absolute",top:0,left:(H-this.view.low)*an-S});O.get(0).width=a+S;O.get(0).height=v;o.parent().css("height",Math.max(this.height_px,v)+"px");var D=O.get(0).getContext("2d");D.fillStyle=g;D.font=this.default_font;D.textAlign="right";if(C.dataset_type=="summary_tree"){var N,K=55,af=255-K,h=af*2/3,U=C.data,F=C.max,m=C.avg,b=Math.ceil(C.delta*an);for(var aj=0,B=U.length;aj<B;aj++){var W=Math.floor((U[aj][0]-H)*an);var V=U[aj][1];if(!V){continue}N=Math.floor(af-(V/F)*af);D.fillStyle="rgb("+N+","+N+","+N+")";D.fillRect(W+S,0,b,this.summary_draw_height);if(this.prefs.show_counts&&D.measureText(V).width<b){if(N>h){D.fillStyle="black"}else{D.fillStyle="#ddd"}D.textAlign="center";D.fillText(V,W+S+(b/2),12)}}d="Summary";o.append(O);return O}if(C.message){O.css({border:"solid red","border-width":"2px 2px 2px
0px"});D.fillStyle="red";D.textAlign="left";D.fillText(C.message,100+S,ao)}var al=C.data;var ai=0;for(var aj=0,B=al.length;aj<B;aj++){var P=al[aj],M=P[0],ak=P[1],X=P[2],I=P[3];if(ak<=ag&&X>=H){var Z=Math.floor(Math.max(0,(ak-H)*an)),E=Math.ceil(Math.min(a,Math.max(0,(X-H)*an))),T=(n==="Dense"?1:(1+am[M]))*ao;if(C.dataset_type==="bai"){D.fillStyle=g;if(P[4] instanceof Array){var w=Math.floor(Math.max(0,(P[4][0]-H)*an)),L=Math.ceil(Math.min(a,Math.max(0,(P[4][1]-H)*an))),u=Math.floor(Math.max(0,(P[5][0]-H)*an)),q=Math.ceil(Math.min(a,Math.max(0,(P[5][1]-H)*an)));if(P[4][1]>=H&&P[4][0]<=ag){this.rect_or_text(D,an,H,ag,P[4][0],P[4][2],w+S,L-w,T)}if(P[5][1]>=H&&P[5][0]<=ag){this.rect_or_text(D,an,H,ag,P[5][0],P[5][2],u+S,q-u,T)}if(u>L){D.fillStyle="#999";D.fillRect(L+S,T+5,u-L,1)}}else{D.fillStyle=g;this.rect_or_text(D,an,H,ag,ak,I,Z+S,E-Z,T)}if(n!=="Dense"&&!Y&&ak>H){D.fillStyle=this.prefs.label_color;if(l===0&&Z-D.measureText(I).width<0){D.textAlign="left";D.fillText(M,E+2+S,T+
8)}else{D.textAlign="right";D.fillText(M,Z-2+S,T+8)}D.fillStyle=g}}else{if(C.dataset_type==="interval_index"){if(Y){D.fillStyle=g;D.fillRect(Z+S,T+5,E-Z,1)}else{var A=P[4],R=P[5],ab=P[6],f=P[7];var z,ad,J=null,ap=null;if(R&&ab){J=Math.floor(Math.max(0,(R-H)*an));ap=Math.ceil(Math.min(a,Math.max(0,(ab-H)*an)))}if(n!=="Dense"&&I!==undefined&&ak>H){D.fillStyle=ac;if(l===0&&Z-D.measureText(I).width<0){D.textAlign="left";D.fillText(I,E+2+S,T+8)}else{D.textAlign="right";D.fillText(I,Z-2+S,T+8)}D.fillStyle=g}if(f){if(A){if(A=="+"){D.fillStyle=RIGHT_STRAND}else{if(A=="-"){D.fillStyle=LEFT_STRAND}}D.fillRect(Z+S,T,E-Z,10);D.fillStyle=g}for(var ah=0,e=f.length;ah<e;ah++){var p=f[ah],c=Math.floor(Math.max(0,(p[0]-H)*an)),Q=Math.ceil(Math.min(a,Math.max((p[1]-H)*an)));if(c>Q){continue}z=5;ad=3;D.fillRect(c+S,T+ad,Q-c,z);if(J!==undefined&&!(c>ap||Q<J)){z=9;ad=1;var ae=Math.max(c,J),t=Math.min(Q,ap);D.fillRect(ae+S,T+ad,t-ae,z)}}}else{z=9;ad=1;D.fillRect(Z+S,T+ad,E-Z,z);if(P.strand){if(P.
strand=="+"){D.fillStyle=RIGHT_STRAND_INV}else{if(P.strand=="-"){D.fillStyle=LEFT_STRAND_INV}}D.fillRect(Z+S,T,E-Z,10);D.fillStyle=g}}}}}ai++}}o.append(O);return O},gen_options:function(j){var a=$("<div />").addClass("form-row");var e="track_"+j+"_block_color",l=$("<label />").attr("for",e).text("Block color:"),m=$("<input />").attr("id",e).attr("name",e).val(this.prefs.block_color),k="track_"+j+"_label_color",g=$("<label />").attr("for",k).text("Text color:"),h=$("<input />").attr("id",k).attr("name",k).val(this.prefs.label_color),f="track_"+j+"_show_count",c=$("<label />").attr("for",f).text("Show summary counts"),b=$('<input type="checkbox" style="float:left;"></input>').attr("id",f).attr("name",f).attr("checked",this.prefs.show_counts),d=$("<div />").append(b).append(c);return a.append(l).append(m).append(g).append(h).append(d)},update_options:function(e){var b=$("#track_"+e+"_block_color").val(),d=$("#track_"+e+"_label_color").val(),c=$("#track_"+e+"_mode option:selecte
d").val(),a=$("#track_"+e+"_show_count").attr("checked");if(b!==this.prefs.block_color||d!==this.prefs.label_color||a!==this.prefs.show_counts){this.prefs.block_color=b;this.prefs.label_color=d;this.prefs.show_counts=a;this.tile_cache.clear();this.draw()}}});var ReadTrack=function(d,b,a,c){FeatureTrack.call(this,d,b,a,c);this.track_type="ReadTrack";this.vertical_detail_px=10;this.vertical_nodetail_px=5};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{});
+var DENSITY=200,FEATURE_LEVELS=10,MAX_FEATURE_DEPTH=100,DATA_ERROR="There was an error in indexing this dataset. ",DATA_NOCONVERTER="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=5,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),PX_PER_CHAR=CONTEXT.measureText("A").width,RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src=image_path+"/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src=image_path+"/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src=image_path+"/visualization/strand_right_inv.png";right_img_inv.onload=function()
{RIGHT_STRAND_INV=CONTEXT.createPattern(right_img_inv,"repeat")};var left_img_inv=new Image();left_img_inv.src=image_path+"/visualization/strand_left_inv.png";left_img_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};function round_1000(a){return Math.round(a*1000)/1000}var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(a,c,e,d,b){this.container=a;this.vis_id=d;this.dbkey=b;this.title=e;this.chrom=c;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.num_tracks=0;this.track_id_counter=0;this.zoom_factor=3;this.
min_separation=30;this.has_changes=false;this.init();this.reset()};$.extend(View.prototype,{init:function(){var c=this.container,a=this;this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(c);this.content_div=$("<div/>").addClass("content").css("position","relative").hide().appendTo(c);this.intro_div=$("<div/>").addClass("intro").text("Select a chrom from the dropdown below").hide().appendTo(c);this.viewport_container=$("<div/>").addClass("viewport-container").addClass("viewport-container").appendTo(this.content_div);this.nav_container=$("<div/>").addClass("nav-container").appendTo(c);this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.nav_container);this.nav=$("<div/>").addClass("nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.nav);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_box_background=$("<div/>").addClass("overview-boxback").app
endTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_form=$("<form/>").attr("action",function(){void (0)}).appendTo(this.nav_controls);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.chrom_form);var b=function(d){if(d.type==="focusout"||(d.keyCode||d.which)===13||(d.keyCode||d.which)===27){if((d.keyCode||d.which)!==27){a.go_to($(this).val())}$(this).hide();a.location_span.show();a.chrom_select.show();return false}};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keypress focusout",b).appendTo(this.chrom_form);this.location_span=$("<span/>").addClass("location").appendTo(this.chrom_form);this.location_span.bind("click",function(){a.location_span.hi
de();a.chrom_select.hide();a.nav_input.css("display","inline-block");a.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.chrom_form)}this.zo_link=$("<a/>").click(function(){a.zoom_out();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom-out.png" />').appendTo(this.chrom_form);this.zi_link=$("<a/>").click(function(){a.zoom_in();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom.png" />').appendTo(this.chrom_form);$.ajax({url:chrom_url,data:(this.vis_id!==undefined?{vis_id:this.vis_id}:{dbkey:this.dbkey}),dataType:"json",success:function(d){if(d.reference){a.add_label_track(new ReferenceTrack(a))}a.chrom_data=d.chrom_info;var f='<option value="">Select Chrom/Contig</option>';for(i in a.chrom_data){var e=a.chrom_data[i]["chrom"];f+='<option value="'+e+'">'+e+"</option>"}a.chrom_select.html(f);a.intro_div.show();a.content_div.hide();a.chrom_select.bind("change",function
(){a.change_chrom(a.chrom_select.val())})},error:function(){alert("Could not load chroms for this dbkey:",a.dbkey)}});this.content_div.bind("dblclick",function(d){a.zoom_in(d.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(d){this.current_x=d.offsetX}).bind("drag",function(d){var g=d.offsetX-this.current_x;this.current_x=d.offsetX;var f=Math.round(g/a.viewport_container.width()*(a.max_high-a.max_low));a.move_delta(-f)});this.viewport_container.bind("dragstart",function(d){this.original_low=a.low;this.current_height=d.clientY;this.current_x=d.offsetX;this.active=(d.clientX<a.viewport_container.width()-16)?true:false}).bind("drag",function(g){if(!this.active){return}var d=$(this);var j=g.offsetX-this.current_x;var f=d.scrollTop()-(g.clientY-this.current_height);d.scrollTop(f);this.current_height=g.clientY;this.current_x=g.offsetX;var h=Math.round(j/a.viewport_container.width()*(a.high-a.low));a.move_delta(h)});this.top_labeltrack.bind("dragstart",f
unction(d){this.drag_origin_x=d.clientX;this.drag_origin_pos=d.clientX/a.viewport_container.width()*(a.high-a.low)+a.low;this.drag_div=$("<div />").css({height:a.content_div.height()+30,top:"0px",position:"absolute","background-color":"#cfc",border:"1px solid #6a6",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(j){var f=Math.min(j.clientX,this.drag_origin_x)-a.container.offset().left,d=Math.max(j.clientX,this.drag_origin_x)-a.container.offset().left,h=(a.high-a.low),g=a.viewport_container.width();a.update_location(Math.round(f/g*h)+a.low,Math.round(d/g*h)+a.low);this.drag_div.css({left:f+"px",width:(d-f)+"px"})}).bind("dragend",function(k){var f=Math.min(k.clientX,this.drag_origin_x),d=Math.max(k.clientX,this.drag_origin_x),h=(a.high-a.low),g=a.viewport_container.width(),j=a.low;a.low=Math.round(f/g*h)+j;a.high=Math.round(d/g*h)+j;this.drag_div.remove();a.redraw()});this.add_label_track(new LabelTrack(this,this.top_labeltrack));this.add_label_track(new
LabelTrack(this,this.nav_labeltrack))},update_location:function(a,b){this.location_span.text(commatize(a)+" - "+commatize(b));this.nav_input.val(this.chrom+":"+commatize(a)+"-"+commatize(b))},change_chrom:function(d,a,f){var c=this;var e=$.grep(c.chrom_data,function(h,j){return h.chrom===d})[0];if(e===undefined){return}if(d!==c.chrom){c.chrom=d;if(c.chrom===""){c.intro_div.show();c.content_div.hide()}else{c.intro_div.hide();c.content_div.show()}c.chrom_select.val(c.chrom);c.max_high=e.len;c.reset();c.redraw(true);for(var g in c.tracks){var b=c.tracks[g];if(b.init){b.init()}}}if(a!==undefined&&f!==undefined){c.low=Math.max(a,0);c.high=Math.min(f,c.max_high)}c.overview_viewport.find("canvas").remove();c.redraw()},go_to:function(f){var k=this,b=f.split(":"),h=b[0],j=b[1];if(j!==undefined){try{var g=j.split("-"),a=parseInt(g[0].replace(/,/g,"")),d=parseInt(g[1].replace(/,/g,""))}catch(c){return false}}k.change_chrom(h,a,d)},move_delta:function(c){var a=this;var b=a.high-a.low;i
f(a.low-c<a.max_low){a.low=a.max_low;a.high=a.max_low+b}else{if(a.high-c>a.max_high){a.high=a.max_high;a.low=a.max_high-b}else{a.high-=c;a.low-=c}}a.redraw()},add_track:function(a){a.view=this;a.track_id=this.track_id_counter;this.tracks.push(a);if(a.init){a.init()}a.container_div.attr("id","track_"+a.track_id);this.track_id_counter+=1;this.num_tracks+=1},add_label_track:function(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){this.has_changes=true;a.container_div.fadeOut("slow",function(){$(this).remove()});delete this.tracks[this.tracks.indexOf(a)];this.num_tracks-=1},update_options:function(){this.has_changes=true;var b=$("ul#sortable-ul").sortable("toArray");for(var c in b){var e=b[c].split("_li")[0].split("track_")[1];this.viewport_container.append($("#track_"+e))}for(var d in view.tracks){var a=view.tracks[d];if(a&&a.update_options){a.update_options(d)}}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".ya
xislabel").remove()},redraw:function(h){var d=this.high-this.low,b=this.low,f=this.high;if(b<this.max_low){b=this.max_low}if(f>this.max_high){f=this.max_high}if(this.high!==0&&d<this.min_separation){f=b+this.min_separation}this.low=Math.floor(b);this.high=Math.ceil(f);this.resolution=Math.pow(10,Math.ceil(Math.log((this.high-this.low)/200)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));var e=(this.low/(this.max_high-this.max_low))*this.overview_viewport.width();var g=(this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width();this.overview_box.css({left:e,width:Math.max(12,g)}).show();if(this.overview_highlight){this.overview_highlight.css({left:e,width:g})}this.update_location(this.low,this.high);if(!h){for(var c=0,a=this.tracks.length;c<a;c++){if(this.tracks[c]&&this.tracks[c].enabled){this.tracks[c].draw()}}for(var c=0,a=this.label_tracks.length;c<a;c++){this.
label_tracks[c].draw()}}},zoom_in:function(b,c){if(this.max_high===0||this.high-this.low<this.min_separation){return}var d=this.high-this.low,e=d/2+this.low,a=(d/this.zoom_factor)/2;if(b){e=b/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(e-a);this.high=Math.round(e+a);this.redraw()},zoom_out:function(){if(this.max_high===0){return}var b=this.high-this.low,c=b/2+this.low,a=(b*this.zoom_factor)/2;this.low=Math.round(c-a);this.high=Math.round(c+a);this.redraw()}});var Track=function(b,a,c){this.name=b;this.parent_element=c;this.view=a;this.init_global()};$.extend(Track.prototype,{init_global:function(){this.container_div=$("<div />").addClass("track");if(!this.hidden){this.header_div=$("<div class='track-header' />").appendTo(this.container_div);this.name_div=$("<div class='menubutton popup' />").appendTo(this.header_div);this.name_div.text(this.name)}this.content_div=$("<div class='track-content'>").appendTo(this.container_div);this.parent_e
lement.append(this.container_div)},init_each:function(c,b){var a=this;a.enabled=false;a.data_queue={};a.tile_cache.clear();a.data_cache.clear();a.initial_canvas=undefined;a.content_div.css("height","auto");if(!a.content_div.text()){a.content_div.text(DATA_LOADING)}a.container_div.removeClass("nodata error pending");if(a.view.chrom){$.getJSON(data_url,c,function(d){if(!d||d==="error"||d.kind==="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR);if(d.message){var f=a.view.tracks.indexOf(a);var e=$("<a href='javascript:void(0);'></a>").attr("id",f+"_error");e.text("Click to view error");$("#"+f+"_error").live("click",function(){show_modal("Trackster Error","<pre>"+d.message+"</pre>",{Close:hide_modal})});a.content_div.append(e)}}else{if(d==="no converter"){a.container_div.addClass("error");a.content_div.text(DATA_NOCONVERTER)}else{if(d.data!==undefined&&(d.data===null||d.data.length===0)){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}els
e{if(d==="pending"){a.container_div.addClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");a.enabled=true;b(d);a.draw()}}}}})}else{a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}}});var TiledTrack=function(){var d=this,c=d.view;if(d.hidden){return}if(d.display_modes!==undefined){if(d.mode_div===undefined){d.mode_div=$("<div class='right-float menubutton popup' />").appendTo(d.header_div);var h=d.display_modes[0];d.mode=h;d.mode_div.text(h);var a=function(j){d.mode_div.text(j);d.mode=j;d.tile_cache.clear();d.draw()};var f={};for(var e in d.display_modes){var g=d.display_modes[e];f[g]=function(j){return function(){a(j)}}(g)}make_popupmenu(d.mode_div,f)}else{d.mode_div.hide()}}var b={};b["Set track as overview"]=function(){c.overview_viewport.find("canvas").remove();d.is_overview=true;d.set_overview();for(var j in c.tracks){if(c.tracks[j]!==d){c.tracks[
j].is_overview=false}}};b["Edit configuration"]=function(){show_modal("Configure Track",d.gen_options(d.track_id),{Cancel:function(){hide_modal()},OK:function(){d.update_options(d.track_id);hide_modal()}})};b.Remove=function(){c.remove_track(d);if(c.num_tracks===0){$("#no-tracks").show()}};make_popupmenu(d.name_div,b)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var j=this.view.low,e=this.view.high,f=e-j,d=this.view.resolution;var l=$("<div style='position: relative;'></div>"),m=this.content_div.width()/f,h;this.content_div.children(":first").remove();this.content_div.append(l),this.max_height=0;var a=Math.floor(j/d/DENSITY);while((a*DENSITY*d)<e){var k=this.content_div.width()+"_"+m+"_"+a;var c=this.tile_cache.get(k);if(c){var g=a*DENSITY*d;var b=(g-j)*m;if(this.left_offset){b-=this.left_offset}c.css({left:b});l.append(c);this.max_height=Math.max(this.max_height,c.height());this.content_div.css("height",this.max_height+"px")}else{this.delayed_draw(this,k,
j,e,a,d,l,m)}a+=1}},delayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_element){if(!c.initial_canvas){c.initial_canvas=$(tile_element).clone();var l=tile_element.get(0).getContext("2d");var j=c.initial_canvas.get(0).getContext("2d");var k=l.getImageData(0,0,l.canvas.width,l.canvas.height);j.putImageData(k,0,0);c.set_overview()}c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height+"px")}}},50)},set_overview:function(){var a=this.view;a.overview_viewport.height(a.default_overview_height);a.overview_box.height(a.default_overview_height);if(this.initial_canvas&&this.is_overview){if(!a.overview_highlight){a.overview_highlight=$("<div />").addClass("overview-highlight").appendTo(a.overview_viewport)}a.overview_viewport.append(this.initial_canvas);a.overview_highlight.height(this.initial_canvas.height());a.overview_viewp
ort.height(this.initial_canvas.height()+a.overview_box.height())}$(window).trigger("resize")}});var LabelTrack=function(a,b){this.track_type="LabelTrack";this.hidden=true;Track.call(this,null,a,b);this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var ReferenceTrack=function(a){this.track_type="ReferenceTrack";this.hidden=true;Track.call(this,null,a,a.top_labeltrack);TiledTrack.call(this);this.height_px=12;this.container_div.addClass("reference-track");this.dummy_canvas=$("<canvas></canvas>").get(0).getContext(
"2d");this.data_queue={};this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE)};$.extend(ReferenceTrack.prototype,TiledTrack.prototype,{get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:reference_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dbkey:this.view.dbkey},success:function(g){c.data_cache.set(e,g);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(f,b,k,o){var g=b*DENSITY*f,d=DENSITY*f,e=$("<canvas class='tile'></canvas>"),n=e.get(0).getContext("2d"),j=f+"_"+b;if(o>PX_PER_CHAR){if(this.data_cache.get(j)===undefined){this.get_data(f,b);return}var m=this.data_cache.get(j);if(m===null){this.content_div.css("height","0px");return}e.get(0).width=Math.ceil(d*o+this.left_offset);e.get(0).height=this.height_px;e.css({position:"absolute",top:0,left:(g-this.view.low)*o-this.left_offset});for(var h=0,l=m.leng
th;h<l;h++){var a=Math.round(h*o);n.fillText(m[h],a+this.left_offset,10)}k.append(e);return e}this.content_div.css("height","0px")}});var LineTrack=function(d,b,a,c){this.track_type="LineTrack";this.display_modes=["Line","Filled","Intensity"];this.mode="Line";Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=80;this.dataset_id=a;this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE);this.prefs={min_value:undefined,max_value:undefined,mode:"Line"};if(c.min_value!==undefined){this.prefs.min_value=c.min_value}if(c.max_value!==undefined){this.prefs.max_value=c.max_value}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.tracks.indexOf(a);a.vertical_range=undefined;this.init_each({stats:true,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){a.container_div.addClass("line-track");data=c.data;if(isNaN(parseFloat(a.prefs.min_value))||isNaN(parseFloat(a.prefs.max_v
alue))){a.prefs.min_value=data.min;a.prefs.max_value=data.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.vertical_range=a.prefs.max_value-a.prefs.min_value;a.total_frequency=data.total_frequency;$("#linetrack_"+b+"_minval").remove();$("#linetrack_"+b+"_maxval").remove();var e=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(round_1000(a.prefs.min_value));var d=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(round_1000(a.prefs.max_value));d.css({position:"relative",top:"32px",left:"10px"});d.prependTo(a.container_div);e.css({position:"relative",top:a.height_px+32+"px",left:"10px"});e.prependTo(a.container_div)})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:data_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},s
uccess:function(g){data=g.data;c.data_cache.set(e,data);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(p,r,c,e){if(this.vertical_range===undefined){return}var s=r*DENSITY*p,a=DENSITY*p,b=$("<canvas class='tile'></canvas>"),v=p+"_"+r;if(this.data_cache.get(v)===undefined){this.get_data(p,r);return}var j=this.data_cache.get(v);if(j===null){return}b.css({position:"absolute",top:0,left:(s-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var o=b.get(0).getContext("2d"),k=false,l=this.prefs.min_value,g=this.prefs.max_value,n=this.vertical_range,t=this.total_frequency,d=this.height_px,m=this.mode;o.beginPath();if(data.length>1){var f=Math.ceil((data[1][0]-data[0][0])*e)}else{var f=10}var u,h;for(var q=0;q<data.length;q++){u=(data[q][0]-s)*e;h=data[q][1];if(m=="Intensity"){if(h===null){continue}if(h<=l){h=l}else{if(h>=g){h=g}}h=255-Math.floor((h-l)/n*255);o.fillStyle="rgb("+h+","+h+","+h+")";o.fillRect
(u,0,f,this.height_px)}else{if(h===null){if(k&&m==="Filled"){o.lineTo(u,d)}k=false;continue}else{if(h<=l){h=l}else{if(h>=g){h=g}}h=Math.round(d-(h-l)/n*d);if(k){o.lineTo(u,h)}else{k=true;if(m==="Filled"){o.moveTo(u,d);o.lineTo(u,h)}else{o.moveTo(u,h)}}}}}if(m==="Filled"){if(k){o.lineTo(u,d)}o.fill()}else{o.stroke()}c.append(b);return b},gen_options:function(k){var a=$("<div />").addClass("form-row");var e="track_"+k+"_minval",h=$("<label></label>").attr("for",e).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),j=$("<input></input>").attr("id",e).val(b),g="track_"+k+"_maxval",d=$("<label></label>").attr("for",g).text("Max value:"),f=(this.prefs.max_value===undefined?"":this.prefs.max_value),c=$("<input></input>").attr("id",g).val(f);return a.append(h).append(j).append(d).append(c)},update_options:function(c){var a=$("#track_"+c+"_minval").val(),b=$("#track_"+c+"_maxval").val();if(a!==this.prefs.min_value||b!==this.prefs.max_value){this.prefs.min
_value=parseFloat(a);this.prefs.max_value=parseFloat(b);this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+c+"_minval").text(this.prefs.min_value);$("#linetrack_"+c+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(d,b,a,c){this.track_type="FeatureTrack";this.display_modes=["Auto","Dense","Squish","Pack"];Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=0;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=2;this.summary_draw_height=20;this.default_font="9px Monaco, Lucida Console, monospace";this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.tile_cache=new Cache(CACHED_TILES_FEATURE);this.data_cache=new Cache(20);this.left_offset=200;this.prefs={block_color:"black",label_color:"black",show_counts:true};if(c.block_color!
==undefined){this.prefs.block_color=c.block_color}if(c.label_color!==undefined){this.prefs.label_color=c.label_color}if(c.show_counts!==undefined){this.prefs.show_counts=c.show_counts}};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b="initial";this.init_each({low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom,resolution:this.view.resolution,mode:a.mode},function(c){a.mode_div.show();a.data_cache.set(b,c);a.draw()})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.getJSON(data_url,{chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,resolution:this.view.resolution,mode:this.mode},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},incremental_slots:function(a,h,c,r){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=a;this.inc_slots[a].mode=r;this.s_e_by_tile[a]={}}var n=this.inc_slots[a].w_scale,z=[],l=0,b=$("<canvas></canvas>").
get(0).getContext("2d"),o=this.view.max_low;var B=[];if(this.inc_slots[a].mode!==r){delete this.inc_slots[a];this.inc_slots[a]={mode:r,w_scale:n};delete this.s_e_by_tile[a];this.s_e_by_tile[a]={}}for(var w=0,x=h.length;w<x;w++){var g=h[w],m=g[0];if(this.inc_slots[a][m]!==undefined){l=Math.max(l,this.inc_slots[a][m]);B.push(this.inc_slots[a][m])}else{z.push(w)}}for(var w=0,x=z.length;w<x;w++){var g=h[z[w]],m=g[0],s=g[1],d=g[2],q=g[3],e=Math.floor((s-o)*n),f=Math.ceil((d-o)*n);if(q!==undefined&&!c){var t=b.measureText(q).width;if(e-t<0){f+=t}else{e-=t}}var v=0;while(true){var p=true;if(this.s_e_by_tile[a][v]!==undefined){for(var u=0,A=this.s_e_by_tile[a][v].length;u<A;u++){var y=this.s_e_by_tile[a][v][u];if(f>y[0]&&e<y[1]){p=false;break}}}if(p){if(this.s_e_by_tile[a][v]===undefined){this.s_e_by_tile[a][v]=[]}this.s_e_by_tile[a][v].push([e,f]);this.inc_slots[a][m]=v;l=Math.max(l,v);break}v++}}return l},rect_or_text:function(n,o,f,m,b,d,k,e,h){n.textAlign="center";var j=Math.rou
nd(o/2);if((this.mode==="Pack"||this.mode==="Auto")&&d!==undefined&&o>PX_PER_CHAR){n.fillStyle=this.prefs.block_color;n.fillRect(k,h+1,e,9);n.fillStyle="#eee";for(var g=0,l=d.length;g<l;g++){if(b+g>=f&&b+g<=m){var a=Math.floor(Math.max(0,(b+g-f)*o));n.fillText(d[g],a+this.left_offset+j,h+9)}}}else{n.fillStyle=this.prefs.block_color;n.fillRect(k,h+4,e,3)}},draw_tile:function(aa,l,o,an){var H=l*DENSITY*aa,ag=(l+1)*DENSITY*aa,G=ag-H;var ah=(!this.initial_canvas?"initial":H+"_"+ag);var C=this.data_cache.get(ah);var d;if(C===undefined||(this.mode!=="Auto"&&C.dataset_type==="summary_tree")){this.data_queue[[H,ag]]=true;this.get_data(H,ag);return}var a=Math.ceil(G*an),O=$("<canvas class='tile'></canvas>"),ac=this.prefs.label_color,g=this.prefs.block_color,n=this.mode,r=25,Y=(n==="Squish")||(n==="Dense")&&(n!=="Pack")||(n==="Auto"&&(C.extra_info==="no_detail")),S=this.left_offset,am,v,ao;if(C.dataset_type==="summary_tree"){v=this.summary_draw_height}else{if(n==="Dense"){v=r;ao=10}el
se{ao=(Y?this.vertical_nodetail_px:this.vertical_detail_px);var s=(an<0.0001?1/view.zoom_res:an);v=this.incremental_slots(s,C.data,Y,n)*ao+r;am=this.inc_slots[s]}}O.css({position:"absolute",top:0,left:(H-this.view.low)*an-S});O.get(0).width=a+S;O.get(0).height=v;o.parent().css("height",Math.max(this.height_px,v)+"px");var D=O.get(0).getContext("2d");D.fillStyle=g;D.font=this.default_font;D.textAlign="right";if(C.dataset_type=="summary_tree"){var N,K=55,af=255-K,h=af*2/3,U=C.data,F=C.max,m=C.avg,b=Math.ceil(C.delta*an);for(var aj=0,B=U.length;aj<B;aj++){var W=Math.floor((U[aj][0]-H)*an);var V=U[aj][1];if(!V){continue}N=Math.floor(af-(V/F)*af);D.fillStyle="rgb("+N+","+N+","+N+")";D.fillRect(W+S,0,b,this.summary_draw_height);if(this.prefs.show_counts&&D.measureText(V).width<b){if(N>h){D.fillStyle="black"}else{D.fillStyle="#ddd"}D.textAlign="center";D.fillText(V,W+S+(b/2),12)}}d="Summary";o.append(O);return O}if(C.message){O.css({border:"solid red","border-width":"2px 2px 2px 0p
x"});D.fillStyle="red";D.textAlign="left";D.fillText(C.message,100+S,ao)}var al=C.data;var ai=0;for(var aj=0,B=al.length;aj<B;aj++){var P=al[aj],M=P[0],ak=P[1],X=P[2],I=P[3];if(ak<=ag&&X>=H){var Z=Math.floor(Math.max(0,(ak-H)*an)),E=Math.ceil(Math.min(a,Math.max(0,(X-H)*an))),T=(n==="Dense"?1:(1+am[M]))*ao;if(C.dataset_type==="bai"){D.fillStyle=g;if(P[4] instanceof Array){var w=Math.floor(Math.max(0,(P[4][0]-H)*an)),L=Math.ceil(Math.min(a,Math.max(0,(P[4][1]-H)*an))),u=Math.floor(Math.max(0,(P[5][0]-H)*an)),q=Math.ceil(Math.min(a,Math.max(0,(P[5][1]-H)*an)));if(P[4][1]>=H&&P[4][0]<=ag){this.rect_or_text(D,an,H,ag,P[4][0],P[4][2],w+S,L-w,T)}if(P[5][1]>=H&&P[5][0]<=ag){this.rect_or_text(D,an,H,ag,P[5][0],P[5][2],u+S,q-u,T)}if(u>L){D.fillStyle="#999";D.fillRect(L+S,T+5,u-L,1)}}else{D.fillStyle=g;this.rect_or_text(D,an,H,ag,ak,I,Z+S,E-Z,T)}if(n!=="Dense"&&!Y&&ak>H){D.fillStyle=this.prefs.label_color;if(l===0&&Z-D.measureText(I).width<0){D.textAlign="left";D.fillText(M,E+2+S,T+8)
}else{D.textAlign="right";D.fillText(M,Z-2+S,T+8)}D.fillStyle=g}}else{if(C.dataset_type==="interval_index"){if(Y){D.fillStyle=g;D.fillRect(Z+S,T+5,E-Z,1)}else{var A=P[4],R=P[5],ab=P[6],f=P[7];var z,ad,J=null,ap=null;if(R&&ab){J=Math.floor(Math.max(0,(R-H)*an));ap=Math.ceil(Math.min(a,Math.max(0,(ab-H)*an)))}if(n!=="Dense"&&I!==undefined&&ak>H){D.fillStyle=ac;if(l===0&&Z-D.measureText(I).width<0){D.textAlign="left";D.fillText(I,E+2+S,T+8)}else{D.textAlign="right";D.fillText(I,Z-2+S,T+8)}D.fillStyle=g}if(f){if(A){if(A=="+"){D.fillStyle=RIGHT_STRAND}else{if(A=="-"){D.fillStyle=LEFT_STRAND}}D.fillRect(Z+S,T,E-Z,10);D.fillStyle=g}for(var ah=0,e=f.length;ah<e;ah++){var p=f[ah],c=Math.floor(Math.max(0,(p[0]-H)*an)),Q=Math.ceil(Math.min(a,Math.max((p[1]-H)*an)));if(c>Q){continue}z=5;ad=3;D.fillRect(c+S,T+ad,Q-c,z);if(J!==undefined&&!(c>ap||Q<J)){z=9;ad=1;var ae=Math.max(c,J),t=Math.min(Q,ap);D.fillRect(ae+S,T+ad,t-ae,z)}}}else{z=9;ad=1;D.fillRect(Z+S,T+ad,E-Z,z);if(P.strand){if(P.st
rand=="+"){D.fillStyle=RIGHT_STRAND_INV}else{if(P.strand=="-"){D.fillStyle=LEFT_STRAND_INV}}D.fillRect(Z+S,T,E-Z,10);D.fillStyle=g}}}}}ai++}}o.append(O);return O},gen_options:function(j){var a=$("<div />").addClass("form-row");var e="track_"+j+"_block_color",l=$("<label />").attr("for",e).text("Block color:"),m=$("<input />").attr("id",e).attr("name",e).val(this.prefs.block_color),k="track_"+j+"_label_color",g=$("<label />").attr("for",k).text("Text color:"),h=$("<input />").attr("id",k).attr("name",k).val(this.prefs.label_color),f="track_"+j+"_show_count",c=$("<label />").attr("for",f).text("Show summary counts"),b=$('<input type="checkbox" style="float:left;"></input>').attr("id",f).attr("name",f).attr("checked",this.prefs.show_counts),d=$("<div />").append(b).append(c);return a.append(l).append(m).append(g).append(h).append(d)},update_options:function(e){var b=$("#track_"+e+"_block_color").val(),d=$("#track_"+e+"_label_color").val(),c=$("#track_"+e+"_mode option:selected"
).val(),a=$("#track_"+e+"_show_count").attr("checked");if(b!==this.prefs.block_color||d!==this.prefs.label_color||a!==this.prefs.show_counts){this.prefs.block_color=b;this.prefs.label_color=d;this.prefs.show_counts=a;this.tile_cache.clear();this.draw()}}});var ReadTrack=function(d,b,a,c){FeatureTrack.call(this,d,b,a,c);this.track_type="ReadTrack";this.vertical_detail_px=10;this.vertical_nodetail_px=5};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{});
1
0
galaxy-dist commit 516a02525898: Move export_history.py script into lib/galaxy/tools/imp_exp so that it's simpler to execute.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1285793202 14400
# Node ID 516a02525898381be3a9af8f3ffec205133dbda1
# Parent a9694088cf69e31fbd3f940cca497e1d2e366f75
Move export_history.py script into lib/galaxy/tools/imp_exp so that it's simpler to execute.
--- /dev/null
+++ b/lib/galaxy/tools/imp_exp/export_history.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+"""
+Export a history to an archive file using attribute files.
+
+usage: %prog history_attrs dataset_attrs job_attrs out_file
+ -G, --gzip: gzip archive file
+"""
+
+from galaxy import eggs
+from galaxy.util.json import *
+import optparse, sys, os, tempfile, tarfile
+
+def create_archive( history_attrs_file, datasets_attrs_file, jobs_attrs_file, out_file, gzip=False ):
+ """ Create archive from the given attribute/metadata files and save it to out_file. """
+ tarfile_mode = "w"
+ if gzip:
+ tarfile_mode += ":gz"
+ try:
+
+ history_archive = tarfile.open( out_file, tarfile_mode )
+
+ # Read datasets attributes from file.
+ datasets_attr_in = open( datasets_attrs_file, 'rb' )
+ datasets_attr_str = ''
+ buffsize = 1048576
+ try:
+ while True:
+ datasets_attr_str += datasets_attr_in.read( buffsize )
+ if not datasets_attr_str or len( datasets_attr_str ) % buffsize != 0:
+ break
+ except OverflowError:
+ pass
+ datasets_attr_in.close()
+ datasets_attrs = from_json_string( datasets_attr_str )
+
+ # Add datasets to archive and update dataset attributes.
+ # TODO: security check to ensure that files added are in Galaxy dataset directory?
+ for dataset_attrs in datasets_attrs:
+ dataset_file_name = dataset_attrs[ 'file_name' ] # Full file name.
+ dataset_archive_name = os.path.join( "datasets", os.path.split( dataset_file_name )[-1] )
+ history_archive.add( dataset_file_name, arcname=dataset_archive_name )
+ # Update dataset filename to be archive name.
+ dataset_attrs[ 'file_name' ] = dataset_archive_name
+
+ # Rewrite dataset attributes file.
+ datasets_attrs_out = open( datasets_attrs_file, 'w' )
+ datasets_attrs_out.write( to_json_string( datasets_attrs ) )
+ datasets_attrs_out.close()
+
+ # Finish archive.
+ history_archive.add( history_attrs_file, arcname="history_attrs.txt" )
+ history_archive.add( datasets_attrs_file, arcname="datasets_attrs.txt" )
+ history_archive.add( jobs_attrs_file, arcname="jobs_attrs.txt" )
+ history_archive.close()
+
+ # Status.
+ return 'Created history archive.'
+ except Exception, e:
+ return 'Error creating history archive: %s' % str( e ), sys.stderr
+
+if __name__ == "__main__":
+ # Parse command line.
+ parser = optparse.OptionParser()
+ parser.add_option( '-G', '--gzip', dest='gzip', action="store_true", help='Compress archive using gzip.' )
+ (options, args) = parser.parse_args()
+ gzip = bool( options.gzip )
+ history_attrs, dataset_attrs, job_attrs, out_file = args
+
+ # Create archive.
+ status = create_archive( history_attrs, dataset_attrs, job_attrs, out_file, gzip )
+ print status
--- a/lib/galaxy/tools/imp_exp/__init__.py
+++ b/lib/galaxy/tools/imp_exp/__init__.py
@@ -199,9 +199,10 @@ class JobExportHistoryArchiveWrapper( ob
options = ""
if jeha.compressed:
options = "-G"
- return "%s %s %s %s %s %s" % ( os.path.join( os.path.abspath( os.getcwd() ), "export_history.sh" ), \
- options, history_attrs_filename, datasets_attrs_filename, \
- jobs_attrs_filename, jeha.dataset.file_name )
+ return "python %s %s %s %s %s %s" % (
+ os.path.join( os.path.abspath( os.getcwd() ), "lib/galaxy/tools/imp_exp/export_history.py" ), \
+ options, history_attrs_filename, datasets_attrs_filename, jobs_attrs_filename, \
+ jeha.dataset.file_name )
def cleanup_after_job( self, db_session ):
""" Remove temporary directory and attribute files generated during setup for this job. """
--- a/scripts/export_history.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env python
-"""
-Export a history to an archive file using attribute files.
-
-NOTE: This should not be called directly. Use the set_metadata.sh script in Galaxy's
-top level directly.
-
-usage: %prog history_attrs dataset_attrs job_attrs out_file
- -G, --gzip: gzip archive file
- -D, --delete_dir: delete attribute files' directory if operation completed successfully
-"""
-from galaxy import eggs
-import os, pkg_resources, tempfile, tarfile
-pkg_resources.require( "bx-python" )
-import sys, traceback, fileinput
-from galaxy.util.json import *
-from warnings import warn
-from bx.cookbook import doc_optparse
-
-def create_archive( history_attrs_file, datasets_attrs_file, jobs_attrs_file, out_file, gzip=False ):
- """ Create archive from the given attribute/metadata files and save it to out_file. """
- tarfile_mode = "w"
- if gzip:
- tarfile_mode += ":gz"
- try:
-
- history_archive = tarfile.open( out_file, tarfile_mode )
-
- # Read datasets attributes from file.
- datasets_attr_in = open( datasets_attrs_file, 'rb' )
- datasets_attr_str = ''
- buffsize = 1048576
- try:
- while True:
- datasets_attr_str += datasets_attr_in.read( buffsize )
- if not datasets_attr_str or len( datasets_attr_str ) % buffsize != 0:
- break
- except OverflowError:
- pass
- datasets_attr_in.close()
- datasets_attrs = from_json_string( datasets_attr_str )
-
- # Add datasets to archive and update dataset attributes.
- # TODO: security check to ensure that files added are in Galaxy dataset directory?
- for dataset_attrs in datasets_attrs:
- dataset_file_name = dataset_attrs[ 'file_name' ] # Full file name.
- dataset_archive_name = os.path.join( "datasets", os.path.split( dataset_file_name )[-1] )
- history_archive.add( dataset_file_name, arcname=dataset_archive_name )
- # Update dataset filename to be archive name.
- dataset_attrs[ 'file_name' ] = dataset_archive_name
-
- # Rewrite dataset attributes file.
- datasets_attrs_out = open( datasets_attrs_file, 'w' )
- datasets_attrs_out.write( to_json_string( datasets_attrs ) )
- datasets_attrs_out.close()
-
- # Finish archive.
- history_archive.add( history_attrs_file, arcname="history_attrs.txt" )
- history_archive.add( datasets_attrs_file, arcname="datasets_attrs.txt" )
- history_archive.add( jobs_attrs_file, arcname="jobs_attrs.txt" )
- history_archive.close()
-
- # Status.
- return 'Created history archive.'
- except Exception, e:
- return 'Error creating history archive: %s' + str( e ), sys.stderr
-
-if __name__ == "__main__":
- # Parse command line.
- options, args = doc_optparse.parse( __doc__ )
- try:
- gzip = bool( options.gzip )
- delete_dir = bool( options.delete_dir )
- history_attrs, dataset_attrs, job_attrs, out_file = args
- except:
- doc_optparse.exception()
-
- # Create archive.
- status = create_archive( history_attrs, dataset_attrs, job_attrs, out_file, gzip )
- print status
--- a/lib/galaxy/tools/actions/history_imp_exp.py
+++ b/lib/galaxy/tools/actions/history_imp_exp.py
@@ -54,9 +54,6 @@ class ExportHistoryToolAction( ToolActio
job_wrapper = JobExportHistoryArchiveWrapper( job )
cmd_line = job_wrapper.setup_job( trans, jeha, include_hidden=incoming[ 'include_hidden' ], \
include_deleted=incoming[ 'include_deleted' ] )
-
- # Save jeha.
- trans.sa_session.flush()
#
# Add parameters to job_parameter table.
--- a/export_history.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-cd `dirname $0`
-python ./scripts/export_history.py $@
1
0
galaxy-dist commit 2aee56b5875a: Updated test outputs for pdf/image output tools that differ slightly on updated dependencies.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate(a)bx.psu.edu>
# Date 1285795531 14400
# Node ID 2aee56b5875a201b09f736764390651a177702d8
# Parent 516a02525898381be3a9af8f3ffec205133dbda1
Updated test outputs for pdf/image output tools that differ slightly on updated dependencies.
--- a/test-data/kpca_out2.pdf
+++ b/test-data/kpca_out2.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20100310152519)
-/ModDate (D:20100310152519)
+/CreationDate (D:20100929155208)
+/ModDate (D:20100929155208)
/Title (R Graphics Output)
-/Producer (R 2.10.0)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
@@ -28,7 +28,7 @@ 6 0 obj
/Length 7 0 R
>>
stream
-q
+1 J 1 j q
Q q 47.81 276.05 240.19 228.24 re W n
Q q
0.000 0.000 0.000 RG
@@ -1115,7 +1115,7 @@ Q
endstream
endobj
7 0 obj
-22476
+22484
endobj
3 0 obj
<<
@@ -1170,15 +1170,15 @@ 0 12
0000000000 65535 f
0000000021 00000 n
0000000164 00000 n
-0000022843 00000 n
-0000022926 00000 n
+0000022851 00000 n
+0000022934 00000 n
0000000213 00000 n
0000000293 00000 n
-0000022822 00000 n
-0000023030 00000 n
-0000023287 00000 n
-0000023370 00000 n
-0000023467 00000 n
+0000022830 00000 n
+0000023038 00000 n
+0000023295 00000 n
+0000023378 00000 n
+0000023475 00000 n
trailer
<<
/Size 12
@@ -1186,5 +1186,5 @@ trailer
/Root 2 0 R
>>
startxref
-23569
+23577
%%EOF
--- a/test-data/cca_out2.pdf
+++ b/test-data/cca_out2.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20100310155029)
-/ModDate (D:20100310155029)
+/CreationDate (D:20100929152548)
+/ModDate (D:20100929152548)
/Title (R Graphics Output)
-/Producer (R 2.10.0)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
@@ -28,7 +28,7 @@ 6 0 obj
/Length 7 0 R
>>
stream
-q
+1 J 1 j q
Q q 59.04 73.44 486.72 443.52 re W n
0.000 0.000 0.000 RG
0.75 w
@@ -400,7 +400,7 @@ Q
endstream
endobj
7 0 obj
-5992
+6000
endobj
8 0 obj
<<
@@ -415,7 +415,7 @@ 9 0 obj
/Length 10 0 R
>>
stream
-q
+1 J 1 j q
Q q 59.04 73.44 486.72 443.52 re W n
Q q 59.04 73.44 486.72 443.52 re W n
0.000 0.000 0.000 RG
@@ -788,7 +788,7 @@ Q
endstream
endobj
10 0 obj
-6029
+6037
endobj
3 0 obj
<<
@@ -805,7 +805,7 @@ 4 0 obj
<<
/ProcSet [/PDF /Text]
/Font <</F2 12 0 R /F3 13 0 R >>
-/ExtGState << >>
+/ExtGState << /GSais 14 0 R >>
>>
endobj
11 0 obj
@@ -831,28 +831,35 @@ 13 0 obj <<
/BaseFont /Helvetica-Bold
/Encoding 11 0 R
>> endobj
+14 0 obj
+<<
+/Type /ExtGState
+/AIS false
+>>
+endobj
xref
-0 14
+0 15
0000000000 65535 f
0000000021 00000 n
0000000164 00000 n
-0000012542 00000 n
-0000012631 00000 n
+0000012558 00000 n
+0000012647 00000 n
0000000213 00000 n
0000000293 00000 n
-0000006338 00000 n
-0000006358 00000 n
-0000006438 00000 n
-0000012521 00000 n
-0000012724 00000 n
-0000012982 00000 n
-0000013080 00000 n
+0000006346 00000 n
+0000006366 00000 n
+0000006446 00000 n
+0000012537 00000 n
+0000012754 00000 n
+0000013012 00000 n
+0000013110 00000 n
+0000013213 00000 n
trailer
<<
-/Size 14
+/Size 15
/Info 1 0 R
/Root 2 0 R
>>
startxref
-13183
+13263
%%EOF
--- a/test-data/q_values.tabular
+++ b/test-data/q_values.tabular
@@ -1,4 +1,4 @@
-pi0: 0.243863648325618
+pi0: 0.243863648325618
FDR level: 0.05
--- a/test-data/kpca_out4.pdf
+++ b/test-data/kpca_out4.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20100310154313)
-/ModDate (D:20100310154313)
+/CreationDate (D:20100929160535)
+/ModDate (D:20100929160535)
/Title (R Graphics Output)
-/Producer (R 2.10.0)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
@@ -28,7 +28,7 @@ 6 0 obj
/Length 7 0 R
>>
stream
-q
+1 J 1 j q
Q q 59.04 73.44 486.72 443.52 re W n
0.000 0.000 0.000 RG
0.75 w
@@ -549,7 +549,7 @@ Q
endstream
endobj
7 0 obj
-10735
+10743
endobj
3 0 obj
<<
@@ -604,15 +604,15 @@ 0 12
0000000000 65535 f
0000000021 00000 n
0000000164 00000 n
-0000011102 00000 n
-0000011185 00000 n
+0000011110 00000 n
+0000011193 00000 n
0000000213 00000 n
0000000293 00000 n
-0000011081 00000 n
-0000011289 00000 n
-0000011546 00000 n
-0000011629 00000 n
-0000011726 00000 n
+0000011089 00000 n
+0000011297 00000 n
+0000011554 00000 n
+0000011637 00000 n
+0000011734 00000 n
trailer
<<
/Size 12
@@ -620,5 +620,5 @@ trailer
/Root 2 0 R
>>
startxref
-11828
+11836
%%EOF
--- a/test-data/histogram_out1.pdf
+++ b/test-data/histogram_out1.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20091214150037)
-/ModDate (D:20091214150037)
+/CreationDate (D:20100929153637)
+/ModDate (D:20100929153637)
/Title (R Graphics Output)
-/Producer (R 2.10.0)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
@@ -28,7 +28,7 @@ 6 0 obj
/Length 7 0 R
>>
stream
-q
+1 J 1 j q
Q q
BT
0.000 0.000 0.000 rg
@@ -479,7 +479,7 @@ Q
endstream
endobj
7 0 obj
-7417
+7425
endobj
3 0 obj
<<
@@ -495,7 +495,7 @@ 4 0 obj
<<
/ProcSet [/PDF /Text]
/Font <</F2 9 0 R /F3 10 0 R >>
-/ExtGState << >>
+/ExtGState << /GSais 11 0 R >>
>>
endobj
8 0 obj
@@ -521,25 +521,32 @@ 10 0 obj <<
/BaseFont /Helvetica-Bold
/Encoding 8 0 R
>> endobj
+11 0 obj
+<<
+/Type /ExtGState
+/AIS false
+>>
+endobj
xref
-0 11
+0 12
0000000000 65535 f
0000000021 00000 n
0000000164 00000 n
-0000007783 00000 n
-0000007866 00000 n
+0000007791 00000 n
+0000007874 00000 n
0000000213 00000 n
0000000293 00000 n
-0000007763 00000 n
-0000007958 00000 n
-0000008215 00000 n
-0000008311 00000 n
+0000007771 00000 n
+0000007980 00000 n
+0000008237 00000 n
+0000008333 00000 n
+0000008435 00000 n
trailer
<<
-/Size 11
+/Size 12
/Info 1 0 R
/Root 2 0 R
>>
startxref
-8413
+8485
%%EOF
--- a/test-data/pca_out4.pdf
+++ b/test-data/pca_out4.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20100310155851)
-/ModDate (D:20100310155851)
+/CreationDate (D:20100929163248)
+/ModDate (D:20100929163248)
/Title (R Graphics Output)
-/Producer (R 2.10.0)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
@@ -28,7 +28,7 @@ 6 0 obj
/Length 7 0 R
>>
stream
-q
+1 J 1 j q
Q q
0.000 0.000 0.000 RG
0.75 w
@@ -647,7 +647,7 @@ Q
endstream
endobj
7 0 obj
-12853
+12861
endobj
3 0 obj
<<
@@ -663,7 +663,7 @@ 4 0 obj
<<
/ProcSet [/PDF /Text]
/Font <</F2 9 0 R >>
-/ExtGState << >>
+/ExtGState << /GSais 10 0 R >>
>>
endobj
8 0 obj
@@ -682,24 +682,31 @@ 9 0 obj <<
/BaseFont /Helvetica
/Encoding 8 0 R
>> endobj
+10 0 obj
+<<
+/Type /ExtGState
+/AIS false
+>>
+endobj
xref
-0 10
+0 11
0000000000 65535 f
0000000021 00000 n
0000000164 00000 n
-0000013220 00000 n
-0000013303 00000 n
+0000013228 00000 n
+0000013311 00000 n
0000000213 00000 n
0000000293 00000 n
-0000013199 00000 n
-0000013384 00000 n
-0000013641 00000 n
+0000013207 00000 n
+0000013406 00000 n
+0000013663 00000 n
+0000013759 00000 n
trailer
<<
-/Size 10
+/Size 11
/Info 1 0 R
/Root 2 0 R
>>
startxref
-13737
+13809
%%EOF
--- a/test-data/pca_out6.pdf
+++ b/test-data/pca_out6.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20100914141739)
-/ModDate (D:20100914141739)
+/CreationDate (D:20100929164125)
+/ModDate (D:20100929164125)
/Title (R Graphics Output)
-/Producer (R 2.11.1)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
Binary file test-data/454Score.png has changed
--- a/test-data/regr_out.pdf
+++ b/test-data/regr_out.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20100603105440)
-/ModDate (D:20100603105440)
+/CreationDate (D:20100929153009)
+/ModDate (D:20100929153009)
/Title (R Graphics Output)
-/Producer (R 2.9.2)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
@@ -28,7 +28,7 @@ 6 0 obj
/Length 7 0 R
>>
stream
-q
+1 J 1 j q
Q q 38.02 358.66 166.66 160.32 re W n
Q q
0.000 0.000 0.000 RG
@@ -524,7 +524,7 @@ Q
endstream
endobj
7 0 obj
-9361
+9369
endobj
8 0 obj
<<
@@ -539,7 +539,7 @@ 9 0 obj
/Length 10 0 R
>>
stream
-q
+1 J 1 j q
Q q 59.04 73.44 486.72 443.52 re W n
Q q
0.000 0.000 0.000 RG
@@ -695,7 +695,7 @@ Q
endstream
endobj
10 0 obj
-3090
+3098
endobj
11 0 obj
<<
@@ -710,7 +710,7 @@ 12 0 obj
/Length 13 0 R
>>
stream
-q
+1 J 1 j q
Q q 59.04 73.44 486.72 443.52 re W n
Q q 59.04 73.44 486.72 443.52 re W n
0.000 0.000 0.000 RG
@@ -850,7 +850,7 @@ Q
endstream
endobj
13 0 obj
-2841
+2849
endobj
14 0 obj
<<
@@ -865,7 +865,7 @@ 15 0 obj
/Length 16 0 R
>>
stream
-q
+1 J 1 j q
Q q 59.04 73.44 486.72 443.52 re W n
Q q
0.000 0.000 0.000 RG
@@ -1090,7 +1090,7 @@ Q
endstream
endobj
16 0 obj
-4322
+4330
endobj
17 0 obj
<<
@@ -1105,7 +1105,7 @@ 18 0 obj
/Length 19 0 R
>>
stream
-q
+1 J 1 j q
Q q 59.04 73.44 486.72 443.52 re W n
Q q
0.000 0.000 0.000 RG
@@ -1499,7 +1499,7 @@ Q
endstream
endobj
19 0 obj
-6882
+6890
endobj
3 0 obj
<<
@@ -1519,7 +1519,7 @@ 4 0 obj
<<
/ProcSet [/PDF /Text]
/Font << /F1 21 0 R /F2 22 0 R /F3 23 0 R >>
-/ExtGState << >>
+/ExtGState << /GSais 24 0 R >>
>>
endobj
20 0 obj
@@ -1553,38 +1553,45 @@ 23 0 obj <<
/BaseFont /Helvetica-Bold
/Encoding 20 0 R
>> endobj
+24 0 obj
+<<
+/Type /ExtGState
+/AIS false
+>>
+endobj
xref
-0 24
+0 25
0000000000 65535 f
0000000021 00000 n
-0000000163 00000 n
-0000027490 00000 n
-0000027600 00000 n
-0000000212 00000 n
-0000000292 00000 n
-0000009706 00000 n
-0000009726 00000 n
-0000009806 00000 n
-0000012950 00000 n
-0000012971 00000 n
-0000013053 00000 n
-0000015949 00000 n
-0000015970 00000 n
-0000016052 00000 n
-0000020429 00000 n
-0000020450 00000 n
-0000020532 00000 n
-0000027469 00000 n
-0000027705 00000 n
-0000027963 00000 n
-0000028047 00000 n
-0000028145 00000 n
+0000000164 00000 n
+0000027531 00000 n
+0000027641 00000 n
+0000000213 00000 n
+0000000293 00000 n
+0000009715 00000 n
+0000009735 00000 n
+0000009815 00000 n
+0000012967 00000 n
+0000012988 00000 n
+0000013070 00000 n
+0000015974 00000 n
+0000015995 00000 n
+0000016077 00000 n
+0000020462 00000 n
+0000020483 00000 n
+0000020565 00000 n
+0000027510 00000 n
+0000027760 00000 n
+0000028018 00000 n
+0000028102 00000 n
+0000028200 00000 n
+0000028303 00000 n
trailer
<<
-/Size 24
+/Size 25
/Info 1 0 R
/Root 2 0 R
>>
startxref
-28248
+28353
%%EOF
--- a/test-data/pca_out2.pdf
+++ b/test-data/pca_out2.pdf
@@ -2,10 +2,10 @@
%���ρ�\r
1 0 obj
<<
-/CreationDate (D:20100310155829)
-/ModDate (D:20100310155829)
+/CreationDate (D:20100929163120)
+/ModDate (D:20100929163120)
/Title (R Graphics Output)
-/Producer (R 2.10.0)
+/Producer (R 2.11.0)
/Creator (R)
>>
endobj
@@ -28,7 +28,7 @@ 6 0 obj
/Length 7 0 R
>>
stream
-q
+1 J 1 j q
Q q
0.000 0.000 0.000 RG
0.75 w
@@ -647,7 +647,7 @@ Q
endstream
endobj
7 0 obj
-12848
+12856
endobj
3 0 obj
<<
@@ -663,7 +663,7 @@ 4 0 obj
<<
/ProcSet [/PDF /Text]
/Font <</F2 9 0 R >>
-/ExtGState << >>
+/ExtGState << /GSais 10 0 R >>
>>
endobj
8 0 obj
@@ -682,24 +682,31 @@ 9 0 obj <<
/BaseFont /Helvetica
/Encoding 8 0 R
>> endobj
+10 0 obj
+<<
+/Type /ExtGState
+/AIS false
+>>
+endobj
xref
-0 10
+0 11
0000000000 65535 f
0000000021 00000 n
0000000164 00000 n
-0000013215 00000 n
-0000013298 00000 n
+0000013223 00000 n
+0000013306 00000 n
0000000213 00000 n
0000000293 00000 n
-0000013194 00000 n
-0000013379 00000 n
-0000013636 00000 n
+0000013202 00000 n
+0000013401 00000 n
+0000013658 00000 n
+0000013754 00000 n
trailer
<<
-/Size 10
+/Size 11
/Info 1 0 R
/Root 2 0 R
>>
startxref
-13732
+13804
%%EOF
Binary file test-data/boxplot_summary_statistics_out.png has changed
Binary file test-data/solexaScore.png has changed
1
0
galaxy-dist commit 546dc4845175: New hyphy nj tree test output for ps2pdf version standardized across all systems, and fix for the wig_to_bigwig test.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate(a)bx.psu.edu>
# Date 1285818943 14400
# Node ID 546dc4845175c92c91e181af61b6e1d2a108230e
# Parent 940d77bec4d59a5418f9f731ca6ca114d748aa5d
New hyphy nj tree test output for ps2pdf version standardized across all systems, and fix for the wig_to_bigwig test.
--- /dev/null
+++ b/test-data/wig_to_bigwig_hg17.len
@@ -0,0 +1,46 @@
+chr10 135413628
+chr10_random 113275
+chr11 134452384
+chr12 132449811
+chr12_random 466818
+chr13 114142980
+chr13_random 186858
+chr14 106368585
+chr15 100338915
+chr15_random 784346
+chr16 88827254
+chr16_random 105485
+chr17 78774742
+chr17_random 2618010
+chr18 76117153
+chr18_random 4262
+chr19 63811651
+chr19_random 301858
+chr1 245522847
+chr1_random 3897131
+chr20 62435964
+chr21 46944323
+chr22 49554710
+chr22_random 257318
+chr2 243018229
+chr2_random 418158
+chr3 199505740
+chr3_random 970716
+chr4 191411218
+chr4_random 1030282
+chr5 180857866
+chr5_random 143687
+chr6 170975699
+chr6_random 1875562
+chr6_hla_hap1 139182
+chr6_hla_hap2 150447
+chr7 158628139
+chr7_random 778964
+chr8 146274826
+chr8_random 943810
+chr9 138429268
+chr9_random 1312665
+chrM 16571
+chrX 154824264
+chrX_random 1719168
+chrY 57701691
Binary file test-data/nj_tree_pdf_out.pdf has changed
--- a/buildbot_setup.sh
+++ b/buildbot_setup.sh
@@ -108,4 +108,10 @@ for dir in $DIRS; do
fi
done
+# for wig_to_bigWig
+if [ ! -f "tool-data/shared/ucsc/chrom/hg17.len" -a -f "test-data/wig_to_bigwig_hg17.len" ]; then
+ mkdir -p tool-data/shared/ucsc/chrom
+ cp test-data/wig_to_bigwig_hg17.len tool-data/shared/ucsc/chrom/hg17.len
+fi
+
python ./scripts/fetch_eggs.py all
1
0
galaxy-dist commit 8729d2e29b02: removed unused mako template
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1290029052 18000
# Node ID 8729d2e29b02be031448abff34d5587b5d0d94c3
# Parent c4441790bfaae82d4e84ad11ec58cea7715ea6ef
removed unused mako template
--- a/templates/admin/requests/edit_request_type.mako
+++ /dev/null
@@ -1,79 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<% num_states=len(states_list) %>
-
-<div class="toolForm">
- <div class="toolFormTitle">Edit the sequencer configuration</div>
- <div class="toolFormBody">
- <form name="library" action="${h.url_for( controller='admin', action='request_type', save_changes=True, create=False, id=request_type.id, num_states=num_states )}" method="post" >
- <div class="form-row">
- <label>Name:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="name" value="${request_type.name}" size="40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Description:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="description" value="${request_type.desc}" size="40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>
- Sequencing request form definition:
- </label>
- <select name="form_id">
- %for form in forms:
- %if form.id == request_type.request_form_id:
- <option value="${form.id}" selected>${form.name}</option>
- %else:
- <option value="${form.id}">${form.name}</option>
- %endif
- %endfor
- </select>
- </div>
- <div class="form-row">
- <label>
- Sample form definition:
- </label>
- <select name="form_id">
- %for form in forms:
- %if form.id == request_type.sample_form_id:
- <option value="${form.id}" selected>${form.name}</option>
- %else:
- <option value="${form.id}">${form.name}</option>
- %endif
- %endfor
- </select>
- </div>
- <div class="toolFormBody">
- %for element_count, state in enumerate(states_list):
- <div class="form-row">
- <label>${1+element_count}) State name:</label>
- <input type="text" name="new_element_name_${element_count}" value="${state.name}" size="40"/>
- <label>State help text (optional):</label>
- <input type="text" name="new_element_description_${element_count}" value="${state.desc}" size="40"/>
- </div>
- <div style="clear: both"></div>
- %endfor
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="hidden" name="new" value="submitted" size="40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <input type="submit" name="edit_request_type_button" value="Save"/>
- </div>
- </form>
- </div>
-</div>
1
0
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1285855763 14400
# Node ID ddf70ed04c8b24f9095d4b16f6041907f7c6d428
# Parent 546dc4845175c92c91e181af61b6e1d2a108230e
sff_extractor tool
output is now explicitly set to fastqsanger when the fastq option is selected. patch by peter(a)maubp.freeserve.co.uk
--- a/tools/filters/sff_extractor.xml
+++ b/tools/filters/sff_extractor.xml
@@ -14,7 +14,7 @@
<param name="fastq_output" type="boolean" truevalue="fastq_true" falsevalue="fastq_false" checked="False" label="Do you want FASTQ file instead of FASTA + FASTA quality file?" /></inputs><outputs>
- <data format="fastq" name="out_file1" >
+ <data format="fastqsanger" name="out_file1" ><filter>fastq_output is True</filter></data><data format="xml" name="out_file2">
1
0
galaxy-dist commit 5ec30f459e8e: Merge with d1baa724b393de6871df7249ebe35ecfe2054e31
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1290011973 18000
# Node ID 5ec30f459e8e4a1186f666f4879e14f082f17352
# Parent 7d46c23bb276790160fe05560aa87c3d41185a27
# Parent d1baa724b393de6871df7249ebe35ecfe2054e31
Merge with d1baa724b393de6871df7249ebe35ecfe2054e31
1
0
galaxy-dist commit d1baa724b393: Modified some test fastq files to make valid
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kelly Vincent <kpvincent(a)bx.psu.edu>
# Date 1290011865 18000
# Node ID d1baa724b393de6871df7249ebe35ecfe2054e31
# Parent 39f41821aa4eec15b04509d24715946552bb14a6
Modified some test fastq files to make valid
--- a/test-data/bwa_wrapper_in2.fastq
+++ b/test-data/bwa_wrapper_in2.fastq
@@ -1,120 +1,120 @@
@seq1/1
GGACTCAGATAGTAATCC
-+/1
++
II#IIIIIII$5+.(9II
@seq2/1
ATTCGACCTATCCTTGCG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq3/1
GTAACAAAGTTTGGATTG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq4/1
AGCCGCTCGTCTTTTATG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq5/1
CAGTTATATGGCTTTTGG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq6/1
AGGCGCTCGTCTTGGTAT
-+/1
++
IIIIIIIIIIIIIIIIII
@seq7/1
TGTAGGTGGTCAACCAAT
-+/1
++
IIIIIIIIIIIIIIIIII
@seq8/1
ACACCCGTCCTTTACGTC
-+/1
++
IIIIIIIIIIIIIIIIII
@seq9/1
GCCGCTATTCAGGTTGTT
-+/1
++
IIIIIIIIIIIIIIIIII
@seq10/1
ATTCTTTCTTTTCGTATC
-+/1
++
IIIIIIIIIIIIIIIIII
@seq11/1
GCATTTCTACTCCTTCTC
-+/1
++
II#IIIIIII$5+.(9II
@seq12/1
CGCGCTTCGATAAAAATG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq13/1
ATTTCTACTCTTTCTCAT
-+/1
++
IIIIIIIIIIIIIIIIII
@seq14/1
CCCTTTTGAATGTCACGC
-+/1
++
IIIIIIIIIIIIIIIIII
@seq15/1
CCAACTTACCAAGGTGGG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq16/1
TCAGGGTATTAAAAGAGA
-+/1
++
IIIIIIIIIIIIIIIIII
@seq17/1
GTGATGTGCTTGCTACCG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq18/1
TCAATCCCCCATGCTTGG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq19/1
TTCCTGCGCTTAATGCTT
-+/1
++
IIIIIIIIIIIIIIIIII
@seq20/1
CTTATTACCATTTCAACT
-+/1
++
IIIIIIIIIIIIIIIIII
@seq21/1
CTGATACCAATAAAACCC
-+/1
++
II#IIIIIII$5+.(9II
@seq22/1
AATCAAACTTACCAAGGG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq23/1
TGTGCTTCCCCAACTTGA
-+/1
++
IIIIIIIIIIIIIIIIII
@seq24/1
TTTCTCAATCCCCAATGC
-+/1
++
IIIIIIIIIIIIIIIIII
@seq25/1
TTGCTACTGACCGCTCTT
-+/1
++
IIIIIIIIIIIIIIIIII
@seq26/1
CCGCGTGAAATTTCTATG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq27/1
CGCTAATCAAGTTGTTTC
-+/1
++
IIIIIIIIIIIIIIIIII
@seq28/1
AAAGAGATTATTTGTCGG
-+/1
++
IIIIIIIIIIIIIIIIII
@seq29/1
CAAATTAATGCGCGCTTC
-+/1
++
IIIIIIIIIIIIIIIIII
@seq30/1
ATCCCCTATGCTTGGCTT
-+/1
++
IIIIIIIIIIIIIIIIII
--- a/test-data/bwa_wrapper_in3.fastq
+++ b/test-data/bwa_wrapper_in3.fastq
@@ -1,74 +1,74 @@
@seq1/2
ACGCTCCTTTAAAATATC
-+/2
++
IIIII$%*$G$A31I&&B
@seq2/2
CAGCTCGAGAAGCTCTTA
-+/2
++
IIIIIIIIIIIIIIIIII
@seq3/2
CTACTGACCGCTCTCGTG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq4/2
TAGGTGGTCAACCATTTT
-+/2
++
IIIIIIIIIIIIIIIIII
@seq5/2
TTTCTATGTGGCTTAATA
-+/2
++
IIIIIIIIIIIIIIIIII
@seq6/2
GTAGGTGGTCAACAATTT
-+/2
++
IIIIIIIIIIIIIIIIII
@seq7/2
TTTAATTGCAGGGGCTTC
-+/2
++
IIIIIIIIIIIIIIIIII
@seq8/2
ATGCGCTCTATTCTCTGG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq9/2
TTCTGTTGGTGCTGATAT
-+/2
++
IIIIIIIIIIIIIIIIII
@seq10/2
AGGGCGTTGAGTTCGATA
-+/2
++
IIIIIIIIIIIIIIIIII
@seq11/2
ATCCCCAATGCTTGGCTT
-+/2
++
IIIII$%*$G$A31I&&B
@seq12/2
GGATTGGCGTTTCCAACC
-+/2
++
IIIIIIIIIIIIIIIIII
@seq13/2
CCCCAATCCTTGCCTTCC
-+/2
++
IIIAAIIIIIIIIIIIII
@seq14/2
TGATATTTTGACTTTGAG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq15/2
TTACGAAACGCGACGCCG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq16/2
TTATTTTTCTCCAGCCAC
-+/2
++
IIIIIIIIIIIIIIIIII
@seq17/2
AAACAATACTTTAGGCAT
-+/2
++
IIIIIIIIIIIIIIIIII
@seq18/2
CCGTTCCATAAGCAGATG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq19/2
GAGCGTCCTGGTGCTGAT
@@ -76,45 +76,45 @@ GAGCGTCCTGGTGCTGAT
IIIIIIIIIIIIIIIIII
@seq20/2
ACTCCGGTTATCGCTGGC
-+/2
++
IIIIIIIIIIIIIIIIII
@seq21/2
TAAGCATTTGGTTCAGGG
-+/2
++
IIIII$%*$G$A31I&&B
@seq22/2
GTTACGACGCGACGCCGT
-+/2
++
IIIIIIIIIIIIIIIIII
@seq23/2
TTTAATAACCCTATAGAC
-+/2
++
IIIIIIIIIIIIIIIIII
@seq24/2
CTTGGCTTCCCTAAGCAG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq25/2
CGTGCTCGTTGCTGCGTT
-+/2
++
IIIIIIIIIIIIIIIIII
@seq26/2
AAGGATGTTTTCCGTTCT
-+/2
++
IIIIIIIIIIIIIIIIII
@seq27/2
TGTTTGGTGCTGATATTG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq28/2
TCCAGCCACTAAAGTGAG
-+/2
++
IIIIIIIIIIIIIIIIII
@seq29/2
GATAATGATTGGGGTATC
-+/2
++
IIIIIIIIIIIIIIIIII
@seq30/2
ACCATAAGCAGATGGATA
-+/2
++
IIIIIIIIIIIIIIIIII
--- a/test-data/bowtie_in2.fastqsanger
+++ b/test-data/bowtie_in2.fastqsanger
@@ -1,5 +1,5 @@
@HWI-EAS91_1_30788AAXX:1:1:1513:715/1
GTTTTTTNNGCATAGATGTTTAGTTGTGGTAGTCAG
-+/1
++
IIIIIII""IIIIIIIIIIIIIIIIIIIDI?II-+I
1
0
galaxy-dist commit 39f41821aa4e: Adding data table configuration file for backwards compatibility with local installs: for people who don't want to update loc file style (changes made in rev 4550:535d276c92bc)
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kelly Vincent <kpvincent(a)bx.psu.edu>
# Date 1290011565 18000
# Node ID 39f41821aa4eec15b04509d24715946552bb14a6
# Parent 19b10fff133595cb5cd1851a7f24024c2637ad2b
Adding data table configuration file for backwards compatibility with local installs: for people who don't want to update loc file style (changes made in rev 4550:535d276c92bc)
--- /dev/null
+++ b/tool_data_table_conf.xml.oldlocstyle
@@ -0,0 +1,73 @@
+<!-- Use this file if you don't want to update your loc files as changed in revision 4550:535d276c92bc-->
+<tables>
+ <!-- Locations of all fasta files under genome directory -->
+ <table name="all_fasta" comment_char="#">
+ <columns>value, dbkey, name, path</columns>
+ <file path="tool-data/all_fasta.loc" />
+ </table>
+ <!-- Locations of indexes in the BFAST mapper format -->
+ <table name="bfast_indexes" comment_char="#">
+ <columns>value, dbkey, formats, name, path</columns>
+ <file path="tool-data/bfast_indexes.loc" />
+ </table>
+ <!-- Locations of nucleotide (mega)blast databases -->
+ <table name="blastdb" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/blastdb.loc" />
+ </table>
+ <!-- Locations of protein (mega)blast databases -->
+ <table name="blastdb_p" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/blastdb_p.loc" />
+ </table>
+ <!-- Locations of indexes in the Bowtie mapper format -->
+ <table name="bowtie_indexes" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/bowtie_indices.loc" />
+ </table>
+ <!-- Locations of indexes in the Bowtie color mapper format -->
+ <table name="bowtie_indexes_color" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/bowtie_indices_color.loc" />
+ </table>
+ <!-- Locations of indexes in the BWA mapper format -->
+ <table name="bwa_indexes" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/bwa_index.loc" />
+ </table>
+ <!-- Locations of MAF files that have been indexed with bx-python -->
+ <table name="indexed_maf_files">
+ <columns>name, value, dbkey, species</columns>
+ <file path="tool-data/maf_index.loc" />
+ </table>
+ <!-- Locations of fasta files appropriate for NGS simulation -->
+ <table name="ngs_sim_fasta" comment_char="#">
+ <columns>value, dbkey, name, path</columns>
+ <file path="tool-data/ngs_sim_fasta.loc" />
+ </table>
+ <!-- Locations of 2bit sequence files for use in Lastz -->
+ <table name="lastz_seqs" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/lastz_seqs.loc" />
+ </table>
+ <!-- Locations of PerM base index files -->
+ <table name="perm_base_indexes" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/perm_base_index.loc" />
+ </table>
+ <!-- Locations of PerM color index files -->
+ <table name="perm_color_indexes" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/perm_color_index.loc" />
+ </table>
+ <!-- Location of SRMA dict file and other files -->
+ <table name="srma_indexes" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/srma_index.loc" />
+ </table>
+ <!-- Locations of indexes in the Bowtie mapper format for TopHat to use -->
+ <table name="tophat_indexes" comment_char="#">
+ <columns>name, value</columns>
+ <file path="tool-data/bowtie_indices.loc" />
+ </table>
+</tables>
1
0
galaxy-dist commit 29227c9c5992: Relax GTF sniffer ever so slightly so that Ensembl GTF files are sniffed correctly.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1290019719 18000
# Node ID 29227c9c599292f7608e61cdd4b2be424b7a7bfc
# Parent 1ee9e2490e1968957f5f440a9dd08fb75aa3eb70
Relax GTF sniffer ever so slightly so that Ensembl GTF files are sniffed correctly.
--- a/lib/galaxy/datatypes/interval.py
+++ b/lib/galaxy/datatypes/interval.py
@@ -965,7 +965,9 @@ class Gtf( Gff ):
if len( attributes ) >= 2:
try:
# Imprecise: should check for a single space per the spec.
- attr_name, attr_value = attributes[0].split(" ")
+ # strip() needed b/c Ensembl GTF files include an (illegal)
+ # space before attributes string.
+ attr_name, attr_value = attributes[0].strip().split(" ")
if attr_name != 'gene_id':
return False
except:
1
0
galaxy-dist commit 8ce82d60b2ab: - added the change data library sample operation functional test.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1290011634 18000
# Node ID 8ce82d60b2ab55966d133db136fcb2f809201c4b
# Parent 19b10fff133595cb5cd1851a7f24024c2637ad2b
- added the change data library sample operation functional test.
- renaming dataset now checks for incorrect filename characters
- fixed bugs
--- a/lib/galaxy/web/controllers/requests_common.py
+++ b/lib/galaxy/web/controllers/requests_common.py
@@ -1079,7 +1079,7 @@ class RequestsCommon( BaseController, Us
cntrller=cntrller,
action='update_request_state',
request_id=trans.security.encode_id( request.id ) ) )
- elif sample_operation == trans.model.sample.bulk_operations.SELECT_LIBRARY:
+ elif sample_operation == trans.model.Sample.bulk_operations.SELECT_LIBRARY:
# TODO: fix the code so that the sample_operation_select_field does not use
# sample_0_library_id as it's name. it should use something like sample_operation_library_id
# and sample_operation_folder_id because the name sample_0_library_id should belong to the
--- a/templates/admin/requests/rename_datasets.mako
+++ b/templates/admin/requests/rename_datasets.mako
@@ -16,6 +16,7 @@
<div class="toolForm"><form name="rename_datasets" id="rename_datasets" action="${h.url_for( controller='requests_admin', action='rename_datasets', id_list=id_list, sample_id=trans.security.encode_id( sample.id ) )}" method="post" >
+
<table class="grid"><thead><tr>
@@ -43,9 +44,16 @@
</tbody></table><br/>
+ <div class="form-row">
+ <div class="toolParamHelp" style="clear: both;">
+ A dataset name should only contain the alphanumeric characters or underscore(_).
+ If a dataset name contains any other character, it would be replaced by an underscore(_).
+ </div>
+ </div><div class="form-row"><input type="submit" name="rename_datasets_button" value="Save"/><input type="submit" name="cancel_rename_datasets_button" value="Close"/></div></form>
+
</div>
--- a/scripts/galaxy_messaging/server/setup_rabbitmq.py
+++ b/scripts/galaxy_messaging/server/setup_rabbitmq.py
@@ -24,7 +24,7 @@ def main( config_file ):
cmd_list = [
'add_user %s %s' % ( username, password ),
- 'add_vhost %s' % config.get( 'galaxy_amqp', 'virtual_host' ),
+ 'add_vhost %s' % virtual_host,
'set_permissions -p %s %s ".*" ".*" ".*"' % ( virtual_host, username )
]
--- a/test/functional/test_sample_tracking.py
+++ b/test/functional/test_sample_tracking.py
@@ -430,8 +430,8 @@ class TestFormsAndRequests( TwillTestCas
"""Testing editing the sample information of new request1"""
# logged in as regular_user1
# target data library - change it to library1
- target_library_info = dict(library=self.security.encode_id(library1.id),
- folder=self.security.encode_id(library1_folder1.id) )
+ target_library_info = dict(library=self.security.encode_id( library1.id ),
+ folder=self.security.encode_id( library1_folder1.id ) )
new_sample_value_tuples = \
[ ( 'Sample1_renamed', target_library_info, [ 'option2', 'sample1 field2 value edited', 'sample1 field3 value edited' ] ),
( 'Sample2_renamed', target_library_info, [ 'option1', 'sample2 field2 value edited', 'sample2 field3 value edited' ] ),
@@ -494,6 +494,23 @@ class TestFormsAndRequests( TwillTestCas
strings_displayed_count=strings_displayed_count,
strings_not_displayed=[ request1.states.COMPLETE,
request1.states.REJECTED ] )
+ # change the target data library back to library2 using sample operation user interface
+ self.change_sample_target_data_library( cntrller='requests',
+ request_id=self.security.encode_id( request1.id ),
+ sample_ids=[ sample.id for sample in request1.samples ],
+ new_library_id=self.security.encode_id( library2.id ),
+ new_folder_id=self.security.encode_id( library2_folder1.id ),
+ strings_displayed=[ 'Edit Current Samples of Sequencing Request "%s"' % request1.name ],
+ strings_displayed_after_submit=[ 'Changes made to the samples have been saved.' ] )
+ # check the changed target data library & folder on the request page
+ strings_displayed_count = []
+ strings_displayed_count.append( ( library2.name, len( request1.samples ) ) )
+ strings_displayed_count.append( ( library2_folder1.name, len( request1.samples ) ) )
+ self.view_request( cntrller='requests',
+ request_id=self.security.encode_id( request1.id ),
+ strings_displayed=[],
+ strings_displayed_count=strings_displayed_count )
+
#
# ====== Sequencing request test methods - Admin perspective ================
#
@@ -537,7 +554,7 @@ class TestFormsAndRequests( TwillTestCas
request1.type.states[4].desc ]
# check history of each sample
for sample in request1.samples:
- strings_displayed = [ 'Events for Sample "%s"' % sample.name,
+ strings_displayed = [ 'History of sample "%s"' % sample.name,
'Sequencing request submitted and sample state set to %s' % request1.type.states[0].name,
request1.type.states[0].name,
request1.type.states[1].name ]
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -361,17 +361,29 @@ class RequestsAdmin( BaseController, Use
sample_dataset = trans.sa_session.query( trans.app.model.SampleDataset ).get( trans.security.decode_id( sample_dataset_id ) )
sample_datasets.append( sample_dataset )
if params.get( 'rename_datasets_button', False ):
+ incorrect_dataset_names = []
for sample_dataset in sample_datasets:
encoded_id = trans.security.encode_id( sample_dataset.id )
selected_option = util.restore_text( params.get( 'rename_datasets_for_sample_%s' % encoded_id, '' ) )
new_name = util.restore_text( params.get( 'new_name_%s' % encoded_id, '' ) )
+ if not new_name:
+ incorrect_dataset_names.append( sample_dataset.name )
+ continue
+ new_name = util.sanitize_for_filename( new_name )
if selected_option == 'none':
sample_dataset.name = new_name
else:
sample_dataset.name = '%s_%s' % ( selected_option, new_name )
trans.sa_session.add( sample_dataset )
trans.sa_session.flush()
- message = 'Changes saved successfully.'
+ if len( sample_datasets ) == len( incorrect_dataset_names ):
+ status = 'error'
+ message = 'All datasets renamed incorrectly.'
+ elif len( incorrect_dataset_names ):
+ status = 'done'
+ message = 'Changes saved successfully. The following datasets were renamed incorrectly: %s.' % str( incorrect_dataset_names )
+ else:
+ message = 'Changes saved successfully.'
return trans.fill_template( '/admin/requests/rename_datasets.mako',
sample=sample,
id_list=id_list,
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1638,6 +1638,23 @@ class TwillTestCase( unittest.TestCase )
tc.submit( "save_samples_button" )
for check_str in strings_displayed_after_submit:
self.check_page_for_string( check_str )
+ def change_sample_target_data_library( self, cntrller, request_id, sample_ids, new_library_id, new_folder_id, comment='', strings_displayed=[], strings_displayed_after_submit=[] ):
+ url = "%s/requests_common/edit_samples?cntrller=%s&id=%s&editing_samples=True" % ( self.url, cntrller, request_id )
+ self.visit_url( url )
+ for check_str in strings_displayed:
+ self.check_page_for_string( check_str )
+ for sample_id in sample_ids:
+ tc.fv( "1", "select_sample_%i" % sample_id, True )
+ tc.fv( "1", "sample_operation", 'Select data library and folder' )
+ self.refresh_form( "sample_operation", 'Select data library and folder' )
+ self.check_page_for_string( "Select data library:" )
+ tc.fv( "1", "sample_0_library_id", new_library_id )
+ self.refresh_form( "sample_0_library_id", new_library_id )
+ self.check_page_for_string( "Select folder:" )
+ tc.fv( "1", "sample_0_folder_id", new_folder_id )
+ tc.submit( "save_samples_button" )
+ for check_str in strings_displayed_after_submit:
+ self.check_page_for_string( check_str )
def add_user_address( self, user_id, address_dict ):
self.home()
self.visit_url( "%s/user/new_address?admin_view=False&user_id=%i" % ( self.url, user_id ) )
--- a/lib/galaxy/web/controllers/forms.py
+++ b/lib/galaxy/web/controllers/forms.py
@@ -635,8 +635,8 @@ class Forms( BaseController ):
if form_type == trans.model.FormDefinition.types.SAMPLE:
for ft in trans.model.Sample.supported_field_types:
if ft.__name__ == field[ 'type' ]:
- self.fieldtype.add_option( ft.__name__, ft__name__, selected=True )
- if ft == 'SelectField':
+ self.fieldtype.add_option( ft.__name__, ft.__name__, selected=True )
+ if ft.__name__ == 'SelectField':
self.selectbox_ui( field )
else:
self.fieldtype.add_option( ft.__name__, ft.__name__ )
@@ -644,7 +644,7 @@ class Forms( BaseController ):
for ft in trans.model.FormDefinition.supported_field_types:
if ft.__name__ == field[ 'type' ]:
self.fieldtype.add_option( ft.__name__, ft.__name__, selected=True )
- if ft == 'SelectField':
+ if ft.__name__ == 'SelectField':
self.selectbox_ui( field )
else:
self.fieldtype.add_option( ft.__name__, ft.__name__ )
1
0
galaxy-dist commit 7d46c23bb276: Merge with 39f41821aa4eec15b04509d24715946552bb14a6
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1290011867 18000
# Node ID 7d46c23bb276790160fe05560aa87c3d41185a27
# Parent 8ce82d60b2ab55966d133db136fcb2f809201c4b
# Parent 39f41821aa4eec15b04509d24715946552bb14a6
Merge with 39f41821aa4eec15b04509d24715946552bb14a6
1
0