1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/4f14387d3178/
changeset: r5230:4f14387d3178
user: dan
date: 2011-03-17 20:44:05
summary: And 1em margin to the top and bottom of tables in Pages.
affected #: 1 file (61 bytes)
--- a/templates/page/display.mako Thu Mar 17 09:57:25 2011 -0400
+++ b/templates/page/display.mako Thu Mar 17 15:44:05 2011 -0400
@@ -98,6 +98,8 @@
padding: 8px 5px 5px;
min-width: 500px;
border: none;
+ margin-top: 1em;
+ margin-bottom: 1em;
}
.page-body caption {
text-align: left;
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/0861dc121b0f/
changeset: r5229:0861dc121b0f
user: dan
date: 2011-03-17 14:57:25
summary: Fix check for displaying old-style display applications when line count approximation is used. Additional cleaner link display for display applications which was started in 4886:f820c9d2c285.
affected #: 3 files (37 bytes)
--- a/lib/galaxy/datatypes/interval.py Wed Mar 16 22:27:15 2011 -0400
+++ b/lib/galaxy/datatypes/interval.py Thu Mar 17 09:57:25 2011 -0400
@@ -144,7 +144,7 @@
return dataset.has_data() \
and dataset.state == dataset.states.OK \
and dataset.metadata.columns > 0 \
- and dataset.metadata.data_lines > 0 \
+ and dataset.metadata.data_lines != 0 \
and dataset.metadata.chromCol \
and dataset.metadata.startCol \
and dataset.metadata.endCol
--- a/lib/galaxy/datatypes/tabular.py Wed Mar 16 22:27:15 2011 -0400
+++ b/lib/galaxy/datatypes/tabular.py Thu Mar 17 09:57:25 2011 -0400
@@ -235,7 +235,7 @@
return dataset.has_data() \
and dataset.state == dataset.states.OK \
and dataset.metadata.columns > 0 \
- and dataset.metadata.data_lines > 0
+ and dataset.metadata.data_lines != 0
except:
return False
def as_gbrowse_display_file( self, dataset, **kwd ):
--- a/templates/root/history_common.mako Wed Mar 16 22:27:15 2011 -0400
+++ b/templates/root/history_common.mako Thu Mar 17 09:57:25 2011 -0400
@@ -179,6 +179,7 @@
%for display_name, display_link in display_links:
<a target="${target_frame}" href="${display_link}">${_(display_name)}</a>
%endfor
+ <br />
%endif
%endfor
%for display_app in data.get_display_applications( trans ).itervalues():
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/b32617347a63/
changeset: r5228:b32617347a63
user: dan
date: 2011-03-17 03:27:15
summary: When using re_match comparison method in functional tests and line counts do not match, print out first 40 lines of the history file.
affected #: 1 file (66 bytes)
--- a/test/base/twilltestcase.py Wed Mar 16 18:36:27 2011 -0400
+++ b/test/base/twilltestcase.py Wed Mar 16 22:27:15 2011 -0400
@@ -109,7 +109,7 @@
"""Checks the contents of 2 files for differences using re.match"""
local_file = open( file1, 'U' ).readlines() #regex file
history_data = open( file2, 'U' ).readlines()
- assert len( local_file ) == len( history_data ), 'Data File and Regular Expression File contain a different number of lines (%s != %s)' % ( len( local_file ), len( history_data ) )
+ assert len( local_file ) == len( history_data ), 'Data File and Regular Expression File contain a different number of lines (%s != %s)\nHistory Data (first 40 lines):\n%s' % ( len( local_file ), len( history_data ), ''.join( history_data[:40] ) )
if attributes is None:
attributes = {}
if attributes.get( 'sort', False ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/6ae06d89fec7/
changeset: r5225:6ae06d89fec7
user: kanwei
date: 2011-03-16 14:01:57
summary: Small tweaks to custom builds
affected #: 1 file (70 bytes)
--- a/templates/user/dbkeys.mako Tue Mar 15 23:40:53 2011 -0400
+++ b/templates/user/dbkeys.mako Wed Mar 16 09:01:57 2011 -0400
@@ -116,22 +116,20 @@
<form action="dbkeys" method="post" enctype="multipart/form-data"><div class="toolForm" style="float: left;"><div class="toolFormTitle">Add a Custom Build</div>
-
-
<div class="toolFormBody"><div class="form-row">
- <label for="name">Build Name (eg: Human Chromosome):</label>
+ <label for="name">Build Name (eg: Mouse):</label><input type="text" id="name" name="name" /></div><div class="form-row">
- <label for="key">Build Key (eg: hg18):</label>
+ <label for="key">Build Key (eg: mm9):</label><input type="text" id="key" name="key" /></div><div class="form-row">
- <label for="len_file">Chromosome Length file upload (.len file):</label>
+ <label for="len_file">Upload .len file:</label><input type="file" id="len_file" name="len_file" /><br /><label for="len_text">Or paste length info below:</label>
- <textarea id="len_text" name="len_text" cols="40" rows="10"></textarea>
+ <textarea id="len_text" name="len_text" cols="30" rows="10"></textarea></div><div class="form-row"><input type="submit" name="add" value="Submit"/></div>
@@ -157,8 +155,7 @@
<p>Trackster uses this information to populate the select box for chrom/contig, and
to set the maximum basepair of the track browser. You may either upload a .len file
- of this format, or directly enter the information in the box.
- </p>
+ of this format, or directly enter the information into the box.</p></div></%def>
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/9e327e97acba/
changeset: r5224:9e327e97acba
user: kanwei
date: 2011-03-16 04:40:53
summary: Improved custom builds UI. Better help text explaining len file format. Now split on last whitespace instead of tab only so that len info can be typed into the box directly.
affected #: 2 files (1.7 KB)
--- a/lib/galaxy/web/controllers/user.py Tue Mar 15 15:39:35 2011 -0400
+++ b/lib/galaxy/web/controllers/user.py Tue Mar 15 23:40:53 2011 -0400
@@ -5,7 +5,7 @@
from galaxy.web.base.controller import *
from galaxy.model.orm import *
from galaxy import util, model
-import logging, os, string, re, smtplib, socket
+import logging, os, string, re, smtplib, socket, glob
from random import choice
from email.MIMEText import MIMEText
from galaxy.web.form_builder import *
@@ -53,6 +53,8 @@
class User( BaseController, UsesFormDefinitions ):
user_openid_grid = UserOpenIDGrid()
+ installed_len_files = None
+
@web.expose
def index( self, trans, webapp='galaxy', **kwd ):
return trans.fill_template( '/user/index.mako', webapp=webapp )
@@ -1237,12 +1239,21 @@
""" Log a user action asynchronously. If user is not logged in, do nothing. """
if trans.user:
trans.log_action( trans.get_user(), action, context, params )
+
@web.expose
@web.require_login()
def dbkeys( self, trans, **kwds ):
user = trans.get_user()
message = None
lines_skipped = 0
+ if self.installed_len_files is None:
+ installed_builds = []
+ for build in glob.glob( os.path.join(trans.app.config.len_file_path, "*.len") ):
+ installed_builds.append( os.path.basename(build).split(".len")[0] )
+
+ self.installed_len_files = ", ".join(installed_builds)
+
+
if 'dbkeys' not in user.preferences:
dbkeys = {}
else:
@@ -1263,6 +1274,8 @@
len_text = kwds.get('len_text', '')
if not name or not key or not len_text:
message = "You must specify values for all the fields."
+ elif key in dbkeys:
+ message = "There is already a custom build with that key. Delete it first if you want to replace it."
else:
# Create new len file
new_len = trans.app.model.HistoryDatasetAssociation( extension="len", create_dataset=True, sa_session=trans.sa_session )
@@ -1278,7 +1291,7 @@
# LEN files have format:
# <chrom_name><tab><chrom_length>
for line in len_text.split("\n"):
- lst = line.strip().split("\t")
+ lst = line.strip().rsplit(None, 1) # Splits at the last whitespace in the line
if not lst or len(lst) < 2:
lines_skipped += 1
continue
@@ -1300,6 +1313,7 @@
user=user,
dbkeys=dbkeys,
message=message,
+ installed_len_files=self.installed_len_files,
lines_skipped=lines_skipped,
use_panels=kwds.get( 'use_panels', None ) )
@web.expose
--- a/templates/user/dbkeys.mako Tue Mar 15 15:39:35 2011 -0400
+++ b/templates/user/dbkeys.mako Tue Mar 15 23:40:53 2011 -0400
@@ -61,27 +61,28 @@
</script></%def>
-% if message:
- <div class="errormessagelarge">${message}</div>
-% elif lines_skipped > 0:
- <div class="warningmessagelarge">Skipped ${lines_skipped} lines that could not be parsed</div>
-% endif
-
<%def name="center_panel()">
${self.body()}
</%def><%def name="body()">
+
+ % if message:
+ <div class="errormessagelarge">${message}</div>
+ % elif lines_skipped > 0:
+ <div class="warningmessagelarge">Skipped ${lines_skipped} lines that could not be parsed. (Line was either blank or not 2-column, with 2nd column being an integer)</div>
+ % endif
+
<h2>Custom Database/Builds</h2>
- <p>You may specify your own database/builds here.</p>
+ <p>Current custom builds:</p>
% if dbkeys:
<table id="custom_dbkeys" class="colored" cellspacing="0" cellpadding="0"><tr class="header"><th>Name</th><th>Key</th>
- <th>Number of Chroms</th>
+ <th>Number of chroms/contigs</th><th></th></tr>
% for key, dct in dbkeys.iteritems():
@@ -109,23 +110,27 @@
% else:
<p>You currently have no custom builds.</p>
% endif
+ <p>Builds with system-installed len files: <em>${installed_len_files}</em></p><br />
+
<form action="dbkeys" method="post" enctype="multipart/form-data">
- <div class="toolForm">
- <div class="toolFormTitle">Add a Build</div>
+ <div class="toolForm" style="float: left;">
+ <div class="toolFormTitle">Add a Custom Build</div>
+
+
<div class="toolFormBody"><div class="form-row">
- <label for="name">Name (eg: Human Chromosome):</label>
+ <label for="name">Build Name (eg: Human Chromosome):</label><input type="text" id="name" name="name" /></div><div class="form-row">
- <label for="key">Key (eg: hg18):</label>
+ <label for="key">Build Key (eg: hg18):</label><input type="text" id="key" name="key" /></div><div class="form-row"><label for="len_file">Chromosome Length file upload (.len file):</label><input type="file" id="len_file" name="len_file" /><br />
- <label for="len_text">Alternatively, paste length info:</label>
+ <label for="len_text">Or paste length info below:</label><textarea id="len_text" name="len_text" cols="40" rows="10"></textarea></div>
@@ -133,4 +138,27 @@
</div></div></form>
+ <div class="infomessagesmall" style="float: left; margin-left: 10px; width: 40%;">
+ <h3>Length Format</h3>
+ <p>
+ The length format is two-column, separated by whitespace, of the form:
+ <pre>chrom/contig length of chrom/contig</pre>
+ </p>
+ <p>
+ For example, the first few entries of <em>mm9.len</em> are as follows:
+ <pre>
+chr1 197195432
+chr2 181748087
+chr3 159599783
+chr4 155630120
+chr5 152537259
+ </pre>
+ </p>
+
+ <p>Trackster uses this information to populate the select box for chrom/contig, and
+ to set the maximum basepair of the track browser. You may either upload a .len file
+ of this format, or directly enter the information in the box.
+ </p>
+
+ </div></%def>
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/82f9422864ff/
changeset: r5223:82f9422864ff
user: dannon
date: 2011-03-15 20:39:35
summary: Fix for example workflow api script failing when the requested library doesn't exist and an attempt is made to create it.
affected #: 1 file (3 bytes)
--- a/scripts/api/example_watch_folder.py Tue Mar 15 14:43:06 2011 -0400
+++ b/scripts/api/example_watch_folder.py Tue Mar 15 15:39:35 2011 -0400
@@ -27,7 +27,7 @@
if not library_id:
lib_create_data = {'name':data_library}
library = submit(api_key, api_url + 'libraries', lib_create_data, return_formatted=False)
- library_id = library['id']
+ library_id = library[0]['id']
folders = display(api_key, api_url + "libraries/%s/contents" % library_id, return_formatted = False)
for f in folders:
if f['name'] == "/":
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/b5ecb8f4839d/
changeset: r5221:b5ecb8f4839d
user: greg
date: 2011-03-15 14:38:29
summary: Don't alter the contents of a file while uploading to a data library if using the filesystem_paths option. This partially resolves the issue where a supposedly sorted BAM file was being resorted upon upload to a data library when using this option. A better imlementation of determining whether a BAM file has been sorted (so that it does not get resorted) remains to be done.
affected #: 4 files (832 bytes)
--- a/lib/galaxy/datatypes/binary.py Mon Mar 14 23:01:11 2011 -0400
+++ b/lib/galaxy/datatypes/binary.py Tue Mar 15 09:38:29 2011 -0400
@@ -59,7 +59,8 @@
output = subprocess.Popen(params, stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0]
# find returns -1 if string is not found
return output.find("SO:coordinate") != -1 or output.find("SO:sorted") != -1
-
+ def dataset_content_needs_grooming( self, file_name ):
+ return not self._is_coordinate_sorted( file_name )
def groom_dataset_content( self, file_name ):
"""
Ensures that the Bam file contents are sorted. This function is called
@@ -72,11 +73,9 @@
## This command may also create temporary files <out.prefix>.%d.bam when the
## whole alignment cannot be fitted into memory ( controlled by option -m ).
#do this in a unique temp directory, because of possible <out.prefix>.%d.bam temp files
-
- if self._is_coordinate_sorted(file_name):
+ if not self.dataset_content_needs_grooming( file_name ):
# Don't re-sort if already sorted
return
-
tmp_dir = tempfile.mkdtemp()
tmp_sorted_dataset_file_name_prefix = os.path.join( tmp_dir, 'sorted' )
stderr_name = tempfile.NamedTemporaryFile( dir = tmp_dir, prefix = "bam_sort_stderr" ).name
@@ -84,7 +83,6 @@
command = "samtools sort %s %s" % ( file_name, tmp_sorted_dataset_file_name_prefix )
proc = subprocess.Popen( args=command, shell=True, cwd=tmp_dir, stderr=open( stderr_name, 'wb' ) )
exit_code = proc.wait()
-
#Did sort succeed?
stderr = open( stderr_name ).read().strip()
if stderr:
@@ -93,10 +91,8 @@
raise Exception, "Error Grooming BAM file contents: %s" % stderr
else:
print stderr
-
# Move samtools_created_sorted_file_name to our output dataset location
shutil.move( samtools_created_sorted_file_name, file_name )
-
# Remove temp file and empty temporary directory
os.unlink( stderr_name )
os.rmdir( tmp_dir )
@@ -124,9 +120,7 @@
raise Exception, "Error Setting BAM Metadata: %s" % stderr
else:
print stderr
-
dataset.metadata.bam_index = index_file
-
# Remove temp file
os.unlink( stderr_name )
def sniff( self, filename ):
--- a/lib/galaxy/datatypes/data.py Mon Mar 14 23:01:11 2011 -0400
+++ b/lib/galaxy/datatypes/data.py Tue Mar 15 09:38:29 2011 -0400
@@ -88,8 +88,11 @@
except OSError, e:
log.exception('%s reading a file that does not exist %s' % (self.__class__.__name__, dataset.file_name))
return ''
+ def dataset_content_needs_grooming( self, file_name ):
+ """This function is called on an output dataset file after the content is initially generated."""
+ return False
def groom_dataset_content( self, file_name ):
- """This function is called on an output dataset file after the content is initially generated."""
+ """This function is called on an output dataset file if dataset_content_needs_grooming returns True."""
pass
def init_meta( self, dataset, copy_from=None ):
# Metadata should be left mostly uninitialized. Dataset will
--- a/test/base/twilltestcase.py Mon Mar 14 23:01:11 2011 -0400
+++ b/test/base/twilltestcase.py Tue Mar 15 09:38:29 2011 -0400
@@ -637,10 +637,10 @@
try:
if attributes is None:
attributes = {}
+ compare = attributes.get( 'compare', 'diff' )
if attributes.get( 'ftype', None ) == 'bam':
local_fh, temp_name = self._bam_to_sam( local_name, temp_name )
local_name = local_fh.name
- compare = attributes.get( 'compare', 'diff' )
extra_files = attributes.get( 'extra_files', None )
if compare == 'diff':
self.files_diff( local_name, temp_name, attributes=attributes )
--- a/tools/data_source/upload.py Mon Mar 14 23:01:11 2011 -0400
+++ b/tools/data_source/upload.py Tue Mar 15 09:38:29 2011 -0400
@@ -334,8 +334,7 @@
file_err( 'The uploaded file contains inappropriate HTML content', dataset, json_file )
return
if data_type != 'binary':
- # don't convert newlines on data we're only going to symlink
- if link_data_only == 'link_to_files':
+ if link_data_only == 'copy_files':
in_place = True
if dataset.type in ( 'server_dir', 'path_paste' ):
in_place = False
@@ -353,8 +352,16 @@
ext = dataset.ext
if ext == 'auto':
ext = 'data'
- # Move the dataset to its "real" path
+ datatype = registry.get_datatype_by_extension( ext )
+ if dataset.type in ( 'server_dir', 'path_paste' ) and link_data_only == 'link_to_files':
+ # Never alter a file that will not be copied to Galaxy's local file store.
+ if datatype.dataset_content_needs_grooming( output_path ):
+ err_msg = 'The uploaded files need grooming, so change your <b>Copy data into Galaxy?</b> selection to be ' + \
+ '<b>Copy files into Galaxy</b> instead of <b>Link to files without copying into Galaxy</b> so grooming can be performed.'
+ file_err( err_msg, dataset, json_file )
+ return
if link_data_only == 'copy_files' and dataset.type in ( 'server_dir', 'path_paste' ):
+ # Move the dataset to its "real" path
if converted_path is not None:
shutil.copy( converted_path, output_path )
try:
@@ -362,7 +369,7 @@
except:
pass
else:
- # this should not happen, but it's here just in case
+ # This should not happen, but it's here just in case
shutil.copy( dataset.path, output_path )
elif link_data_only == 'copy_files':
shutil.move( dataset.path, output_path )
@@ -375,9 +382,9 @@
name = dataset.name,
line_count = line_count )
json_file.write( to_json_string( info ) + "\n" )
- # Groom the dataset content if necessary
- datatype = registry.get_datatype_by_extension( ext )
- datatype.groom_dataset_content( output_path )
+ if datatype.dataset_content_needs_grooming( output_path ):
+ # Groom the dataset content if necessary
+ datatype.groom_dataset_content( output_path )
def add_composite_file( dataset, registry, json_file, output_path, files_path ):
if dataset.composite_files:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.