Re: [galaxy-dev] [galaxy-bugs] /tmp directory
by juan perin
Thanks for the answer! I've copied this response to the dev list email
instead, after realizing its probably best there.
I'm also having some trouble getting our PBS system configured. I have
pbs://hostname/ as my pbs parameter in the universe file, as well as
everything else specified in the documentation. I'm getting no error in the
interface, and the backend never actually gets the job. The error I see in
the logs says:
galaxy.jobs.runners.pbs ERROR 2009-10-30 13:40:27,762 Uncaught exception
queueing job
Traceback (most recent call last):
File "/home/perin/galaxy-dist/lib/galaxy/jobs/runners/pbs.py", line 144,
in run_next
self.queue_job( obj )
File "/home/perin/galaxy-dist/lib/galaxy/jobs/runners/pbs.py", line 219,
in queue_job
script = pbs_symlink_template % (job_wrapper.galaxy_lib_dir, "
".join(job_wrapper.get_input_fnames() + output_fnames),
self.app.config.pbs_stage_path, exec_dir, command_line)
TypeError: sequence item 1: expected string, DatasetPath found
I'm guessing this has something to do with my config parameters, and the
queue its trying to submit to. the pbs://hostname/ value was used under the
assumption that it would default to the 'default' queue on our cluster, so
I'm wondering if I need to hard code those values into the connection
string? I'm a little confused as to how the syntax translates to the actual
required string. My guess is, for our values:
pbs://variome.chop.edu/default
Perhaps its related to the scrambling of the egg instead? I simply passed
LIBTORQUE_DIR to the directory containing my libtorqure.so etc...
? Thanks in advance.
Juan Perin
On Fri, Oct 30, 2009 at 12:07 PM, Nate Coraor <nate(a)bx.psu.edu> wrote:
> Juan Perin wrote:
>
> I'm hosting galaxy locally and am trying to figure out how to change the
>> temporary upload location of files from the root / /tmp folder to something
>> else. My /tmp partition is too small to handle large fastq files and this
>> is causing me problems. I see where to change things in the universe file,
>> but that's the final location, not the temporary space.
>>
>
> Hi Juan,
>
> A quick solution is to set $TEMP in your shell environment. In the future,
> we'll force uploads to honor new_file_path in universe_wsgi.ini.
>
> --nate
>
12 years, 11 months
Latest download from repository
by Dijk, F van
Hi,
I have two questions to ask, firstly:
We've experienced some errors with Galaxy lately so we decided to
download the latest copy from your repository. After installing it, it
seems like some tools like "mapping with Bowtie and BWA" are missing.
When running run.sh it looks like they aren't loading properly.
Yesterday we did also download from these repositories and we didn't
experience these errors, so do you know what the problem can be?
Second:
What version of python do you use for Galaxy, because the older python
versions we use seem to give some problems.
I hope to hear from you soon.
Sincerely
Freerk van Dijk
De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht.
The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message.
13 years, 3 months
About cluster computing support
by sondos seif
Dear sir,
I am Sondos Seif El-Din, a student in biomedical engineering
department, Cairo University. I wanted to know if Galaxy supports
cluster computing.
Thanks in advance,
Sondos Seif El-Din
13 years, 3 months
toolpane info links
by Gunnar Rätsch
Hi there,
I just talked with Anton at the Genome Informatics meeting about the
possibility of including links to galaxy pages in the tools menu. This
can be useful for describing a set of tools or even explaining the
whole system. It would be useful to have these links on the top level
as well as on the tool level.
Would it be very hard to have more than one hierarchy in the tool menu?
Thanks a lot!
Gunnar
13 years, 3 months
Error uploading file
by Dijk, F van
Dear,
We are running Galaxy on our local server(linux 64 bit) and try to
upload a file (fasta, fastq) to the application. This returns the
following error:
Traceback (most recent call last):
File "/data/home/joris/galaxy_dist/tools/data_source/upload.py", line
10, in
import galaxy.model
File "/data/home/joris/galaxy_dist/lib/galaxy/model/__init__.py", line
13, in
import galaxy.datatypes.registry
File "/data/home/joris/galaxy_dist/lib/galaxy/datatypes/registry.py",
line 6, in
import data, tabular, interval, images, sequence, qualityscore,
genetics, xml, coverage, tracks, chrominfo
File "/data/home/joris/galaxy_dist/lib/galaxy/datatypes/data.py", line
6, in
import metadata
File "/data/home/joris/galaxy_dist/lib/galaxy/datatypes/metadata.py",
line 5, in
from galaxy.web import form_builder
File "/data/home/joris/galaxy_dist/lib/galaxy/web/__init__.py", line
5, in
from framework import expose, json, require_login, require_admin,
url_for, error, form, FormBuilder
File
"/data/home/joris/galaxy_dist/lib/galaxy/web/framework/__init__.py",
line 30, in
pkg_resources.require( "SQLAlchemy >= 0.4" )
File "/data/home/joris/galaxy_dist/lib/galaxy/eggs/__init__.py", line
544, in require
sys.path.remove(entry)
ValueError: list.remove(x): x not in list
Do you know how this error can be solved?
I hope to hear from you soon.
Sincerely,
Freerk van Dijk
De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht.
The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message.
13 years, 3 months
[hg] galaxy 2925: Changed the number of threads from 8 to 4 for ...
by Greg Von Kuster
details: http://www.bx.psu.edu/hg/galaxy/rev/c2bed70a9b58
changeset: 2925:c2bed70a9b58
user: Kelly Vincent <kpvincent(a)bx.psu.edu>
date: Tue Oct 27 14:31:59 2009 -0400
description:
Changed the number of threads from 8 to 4 for BWA wrapper and Bowtie wrapper
2 file(s) affected in this change:
tools/sr_mapping/bowtie_wrapper.xml
tools/sr_mapping/bwa_wrapper.xml
diffs (24 lines):
diff -r a471575d1e4a -r c2bed70a9b58 tools/sr_mapping/bowtie_wrapper.xml
--- a/tools/sr_mapping/bowtie_wrapper.xml Tue Oct 27 13:39:48 2009 -0400
+++ b/tools/sr_mapping/bowtie_wrapper.xml Tue Oct 27 14:31:59 2009 -0400
@@ -2,7 +2,7 @@
<description></description>
<command interpreter="python">
bowtie_wrapper.py
- --threads="8"
+ --threads="4"
--input1=$singlePaired.input1
#if $singlePaired.sPaired == "paired":
--input2=$singlePaired.input2
diff -r a471575d1e4a -r c2bed70a9b58 tools/sr_mapping/bwa_wrapper.xml
--- a/tools/sr_mapping/bwa_wrapper.xml Tue Oct 27 13:39:48 2009 -0400
+++ b/tools/sr_mapping/bwa_wrapper.xml Tue Oct 27 14:31:59 2009 -0400
@@ -2,7 +2,7 @@
<description></description>
<command interpreter="python">
bwa_wrapper.py
- --threads="8"
+ --threads="4"
#if $solidOrSolexa.solidRefGenomeSource.refGenomeSource == "history":
--ref=$solidOrSolexa.solidRefGenomeSource.ownFile
#else:
13 years, 3 months
[hg] galaxy 2926: Fix a bug whereby PYTHONPATH would grow endles...
by Greg Von Kuster
details: http://www.bx.psu.edu/hg/galaxy/rev/ea0342f2df03
changeset: 2926:ea0342f2df03
user: Nate Coraor <nate(a)bx.psu.edu>
date: Tue Oct 27 15:11:41 2009 -0400
description:
Fix a bug whereby PYTHONPATH would grow endlessly in the local runner
1 file(s) affected in this change:
lib/galaxy/jobs/runners/local.py
diffs (47 lines):
diff -r c2bed70a9b58 -r ea0342f2df03 lib/galaxy/jobs/runners/local.py
--- a/lib/galaxy/jobs/runners/local.py Tue Oct 27 14:31:59 2009 -0400
+++ b/lib/galaxy/jobs/runners/local.py Tue Oct 27 15:11:41 2009 -0400
@@ -20,6 +20,12 @@
"""Start the job runner with 'nworkers' worker threads"""
self.app = app
self.sa_session = app.model.context
+ # put lib into the PYTHONPATH for subprocesses
+ if 'PYTHONPATH' in os.environ:
+ os.environ['PYTHONPATH'] = '%s:%s' % ( os.environ['PYTHONPATH'], os.path.abspath( 'lib' ) )
+ else:
+ os.environ['PYTHONPATH'] = os.path.abspath( 'lib' )
+ # start workers
self.queue = Queue()
self.threads = []
nworkers = app.config.local_job_queue_workers
@@ -54,12 +60,6 @@
return
# If we were able to get a command line, run the job
if command_line:
- env = os.environ
- if job_wrapper.galaxy_lib_dir is not None:
- if 'PYTHONPATH' in os.environ:
- env['PYTHONPATH'] = "%s:%s" % ( os.environ['PYTHONPATH'], job_wrapper.galaxy_lib_dir )
- else:
- env['PYTHONPATH'] = job_wrapper.galaxy_lib_dir
try:
log.debug( 'executing: %s' % command_line )
proc = subprocess.Popen( args = command_line,
@@ -67,7 +67,7 @@
cwd = job_wrapper.working_directory,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
- env = env,
+ env = os.environ,
preexec_fn = os.setpgrp )
job_wrapper.set_runner( 'local:///', proc.pid )
job_wrapper.change_state( model.Job.states.RUNNING )
@@ -110,7 +110,7 @@
log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
external_metadata_proc = subprocess.Popen( args = external_metadata_script,
shell = True,
- env = env,
+ env = os.environ,
preexec_fn = os.setpgrp )
job_wrapper.external_output_metadata.set_job_runner_external_pid( external_metadata_proc.pid, self.sa_session )
external_metadata_proc.wait()
13 years, 3 months
[hg] galaxy 2921: trackster: fix layout issue
by Greg Von Kuster
details: http://www.bx.psu.edu/hg/galaxy/rev/9d0d6a33a435
changeset: 2921:9d0d6a33a435
user: Kanwei Li <kanwei(a)gmail.com>
date: Mon Oct 26 19:47:27 2009 -0400
description:
trackster: fix layout issue
2 file(s) affected in this change:
static/trackster.css
templates/tracks/browser.mako
diffs (115 lines):
diff -r fa0483a31237 -r 9d0d6a33a435 static/trackster.css
--- a/static/trackster.css Mon Oct 26 15:05:20 2009 -0400
+++ b/static/trackster.css Mon Oct 26 19:47:27 2009 -0400
@@ -15,14 +15,10 @@
overflow: auto;
}
-#nav {
+#nav-container {
position: fixed;
bottom: 0;
width: 100%;
- background: #333;
- color: white;
- font-weight: bold;
- text-align: center;
}
input {
@@ -36,14 +32,14 @@
background-position:top center;
background-repeat:repeat-x;border-top:solid #999 1px;
color:#333;font-weight:bold;
- }
+}
-/*
+
#nav-controls {
- padding: 15px 0;
+ text-align: center;
}
-*/
+
#nav-controls a {
color: white;
padding: 0.1em 0.4em;
@@ -77,14 +73,13 @@
/* border-top: solid #666 1px;*/
/* border-bottom: solid #aaa 1px;*/
background: white;
- border: solid grey 1px;
+ border: solid gray 1px;
margin: 5px;
}
#overview-box {
position: absolute;
margin-top: 0px;
height: 14px;
- background: grey;
background: #ddd url(images/visualization/draggable_horizontal.png) center center no-repeat;
/*border-style: outset;*/
}
@@ -143,5 +138,4 @@
#nav-labeltrack {
border-top: solid #999 1px;
- border-bottom: solid #999 1px;
}
diff -r fa0483a31237 -r 9d0d6a33a435 templates/tracks/browser.mako
--- a/templates/tracks/browser.mako Mon Oct 26 15:05:20 2009 -0400
+++ b/templates/tracks/browser.mako Mon Oct 26 19:47:27 2009 -0400
@@ -54,6 +54,7 @@
view.redraw();
});
+ // To adjust the size of the viewport to fit the fixed-height footer
$(window).resize( function( e ) {
$("#viewport").height( $(window).height() - 120 );
view.redraw();
@@ -105,24 +106,26 @@
<div id="content">
<div id="top-labeltrack"></div>
<div id="viewport"></div>
+</div>
+<div id="nav-container">
<div id="nav-labeltrack"></div>
-</div>
-<div id="nav">
- <div id="nav-controls">
- <form name="chr" id="chr" method="get">
- <select id="chrom" name="chrom" style="width: 15em;">
- <option value="">Loading</option>
- </select>
- <input id="low" size="12"></input>:<input id="high" size="12"></input>
- ## <input type="hidden" name="dataset_ids" value="${dataset_ids}" />
- <input type="hidden" name="id" value="${id}" />
- <a href="#" onclick="javascript:view.zoom_in();view.redraw();">+</a>
- <a href="#" onclick="javascript:view.zoom_out();view.redraw();">-</a>
- </form>
- </div>
- <div id="overview">
- <div id="overview-viewport">
- <div id="overview-box"></div>
+ <div id="nav">
+ <div id="overview">
+ <div id="overview-viewport">
+ <div id="overview-box"></div>
+ </div>
+ </div>
+ <div id="nav-controls">
+ <form name="chr" id="chr" method="get">
+ <select id="chrom" name="chrom" style="width: 15em;">
+ <option value="">Loading</option>
+ </select>
+ <input id="low" size="12" />:<input id="high" size="12" />
+ ## <input type="hidden" name="dataset_ids" value="${dataset_ids}" />
+ <input type="hidden" name="id" value="${id}" />
+ <a href="#" onclick="javascript:view.zoom_in();view.redraw();">+</a>
+ <a href="#" onclick="javascript:view.zoom_out();view.redraw();">-</a>
+ </form>
</div>
</div>
</div>
13 years, 3 months
[hg] galaxy 2922: A get_platform() monkeypatch for fat versions ...
by Greg Von Kuster
details: http://www.bx.psu.edu/hg/galaxy/rev/d8ce43b63ebb
changeset: 2922:d8ce43b63ebb
user: Nate Coraor <nate(a)bx.psu.edu>
date: Tue Oct 27 11:36:57 2009 -0400
description:
A get_platform() monkeypatch for fat versions of python on Mac. Also do more explicit version checking ( >= 2.4, <= 2.5 ) and provide helpful messages if the version is not supported.
6 file(s) affected in this change:
lib/galaxy/__init__.py
lib/galaxy/eggs/__init__.py
scripts/check_python.py
scripts/get_python.sh
scripts/paster.py
setup.sh
diffs (189 lines):
diff -r 9d0d6a33a435 -r d8ce43b63ebb lib/galaxy/__init__.py
--- a/lib/galaxy/__init__.py Mon Oct 26 19:47:27 2009 -0400
+++ b/lib/galaxy/__init__.py Tue Oct 27 11:36:57 2009 -0400
@@ -2,4 +2,29 @@
Galaxy root package -- this is a namespace package.
"""
-__import__( "pkg_resources" ).declare_namespace( __name__ )
\ No newline at end of file
+# Starting somewhere in 2.5.x, Python on Mac became broken - despite being fat,
+# the machine portion of the platform is not set to 'fat'.
+#
+# For more, see:
+#
+# http://bugs.python.org/setuptools/issue19
+#
+import os, sys
+from distutils.sysconfig import get_config_vars
+
+if ( os.uname()[-1] in ( 'i386', 'ppc' ) and sys.platform == 'darwin' and sys.prefix.startswith( '/System' ) ) or \
+ ( sys.platform == 'darwin' and get_config_vars().get('UNIVERSALSDK', '').strip() ):
+ # Has to be before anything imports pkg_resources
+ def _get_platform_monkeypatch():
+ plat = distutils.util._get_platform()
+ if plat.startswith( 'macosx-' ):
+ plat = 'macosx-10.3-fat'
+ return plat
+ import distutils.util
+ try:
+ assert distutils.util._get_platform
+ except:
+ distutils.util._get_platform = distutils.util.get_platform
+ distutils.util.get_platform = _get_platform_monkeypatch
+
+__import__( "pkg_resources" ).declare_namespace( __name__ )
diff -r 9d0d6a33a435 -r d8ce43b63ebb lib/galaxy/eggs/__init__.py
--- a/lib/galaxy/eggs/__init__.py Mon Oct 26 19:47:27 2009 -0400
+++ b/lib/galaxy/eggs/__init__.py Tue Oct 27 11:36:57 2009 -0400
@@ -533,9 +533,9 @@
egg = c.get_for_require( name )
try:
if egg is None:
- pkg_resources.working_set.require( pkg )
+ return pkg_resources.working_set.require( pkg )
else:
- pkg_resources.working_set.require( "%s==%s" % ( name, egg.get_vertag() ) )
+ return pkg_resources.working_set.require( "%s==%s" % ( name, egg.get_vertag() ) )
except pkg_resources.VersionConflict, e:
# there's a conflicting egg on the pythonpath, remove it
dist = e.args[0]
@@ -551,9 +551,10 @@
del working_set.by_key[dist.key]
working_set.entry_keys[entry] = []
sys.path.remove(entry)
- require( pkg )
+ r = require( pkg )
if location is not None and not location.endswith( '.egg' ):
working_set.entries.append( location ) # re-add to the set if it's a dir.
+ return r
except pkg_resources.DistributionNotFound, e:
# the initial require itself is the first dep, but it can have
# multiple deps, which will be fetched by the require below.
@@ -566,7 +567,7 @@
if not egg.have:
if not egg.fetch():
raise EggNotFetchable( egg.name )
- require( pkg )
+ return require( pkg )
# convenience stuff
def get_ucs():
diff -r 9d0d6a33a435 -r d8ce43b63ebb scripts/check_python.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/check_python.py Tue Oct 27 11:36:57 2009 -0400
@@ -0,0 +1,22 @@
+import os, sys
+
+def check_python():
+ try:
+ assert sys.version_info[:2] >= ( 2, 4 ) and sys.version_info[:2] <= ( 2, 5 )
+ except AssertionError:
+ print >>sys.stderr, "ERROR: Your Python version is:", sys.version.split( ' ', 1 )[0]
+ print >>sys.stderr, "Galaxy is currently only supported on Python 2.4 and Python 2.5."
+ if sys.version_info[:2] < ( 2, 4 ):
+ print >>sys.stderr, "To run Galaxy, please download and install Python 2.5 from http://python.org"
+ else:
+ print >>sys.stderr, "To track the progress of Python 2.6 support, please see:"
+ print >>sys.stderr, " http://bitbucket.org/galaxy/galaxy-central/issue/76/support-python-26"
+ print >>sys.stderr, "For hints on how to direct Galaxy to use a different python installation, see:"
+ print >>sys.stderr, " http://bitbucket.org/galaxy/galaxy-central/wiki/GetGalaxy"
+ raise
+
+if __name__ == '__main__':
+ try:
+ check_python()
+ except:
+ sys.exit( 1 )
diff -r 9d0d6a33a435 -r d8ce43b63ebb scripts/get_python.sh
--- a/scripts/get_python.sh Mon Oct 26 19:47:27 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# Try to find a usable python
-#
-
-if [ "$GALAXY_PYTHON" != "" ]; then
- PYTHONS="$GALAXY_PYTHON"
-else
- PYTHONS="python python2.4 python2.5"
-fi
-
-found=""
-for python in $PYTHONS; do
- version=`$python -c 'import sys; print sys.version[:3]' 2>/dev/null`
- if [ $? -eq 0 ]; then
- case $version in
- 2.4|2.5)
- found="$python"
- break
- ;;
- esac
- fi
-done
-
-if [ "$found" != "" ]; then
- GALAXY_PYTHON="$found"
-else
-
- # user manually defined $GALAXY_PYTHON
- if [ "$GALAXY_PYTHON" != "" ]; then
-
- /bin/cat <<EOF
-ERROR: \$GALAXY_PYTHON is set, but what it points to is not a suitable
-Python interpreter. This version of Galaxy requires either Python 2.4
-or 2.5. Possible solutions:
- * Unset \$GALAXY_PYTHON to let Galaxy attempt to find a suitable
- Python itself
- * Set \$GALAXY_PYTHON to a suitable Python interpreter.
-\$GALAXY_PYTHON is currently set to: $GALAXY_PYTHON
-EOF
-
- # couldn't find one in $PATH
- else
-
- /bin/cat <<EOF
-ERROR: Unable to find a suitable Python interpreter. This version of
-Galaxy requires either Python 2.4 or 2.5. Possible solutions:
- * If you have a suitable Python installed outside your \$PATH, modify
- your \$PATH to include it.
- * If you have a suitable Python installed outside your \$PATH and
- don't want to change your \$PATH, set the \$GALAXY_PYTHON environment
- variable to the path of your python executable.
- * If you don't have a suitable Python installed anywhere, install one.
-EOF
-
- fi
-
- exit 1
-
-fi
diff -r 9d0d6a33a435 -r d8ce43b63ebb scripts/paster.py
--- a/scripts/paster.py Mon Oct 26 19:47:27 2009 -0400
+++ b/scripts/paster.py Tue Oct 27 11:36:57 2009 -0400
@@ -7,7 +7,12 @@
import os, sys
-assert sys.version_info[:2] >= ( 2, 4 )
+# ensure supported version
+from check_python import check_python
+try:
+ check_python()
+except:
+ sys.exit( 1 )
new_path = [ os.path.join( os.getcwd(), "lib" ) ]
new_path.extend( sys.path[1:] ) # remove scripts/ from the path
diff -r 9d0d6a33a435 -r d8ce43b63ebb setup.sh
--- a/setup.sh Mon Oct 26 19:47:27 2009 -0400
+++ b/setup.sh Tue Oct 27 11:36:57 2009 -0400
@@ -1,4 +1,7 @@
#!/bin/sh
+
+python ./scripts/check_python.py
+[ $? -ne 0 ] && exit 1
SAMPLES="
datatypes_conf.xml.sample
13 years, 3 months
[hg] galaxy 2923: Fix display of stranded features without block...
by Greg Von Kuster
details: http://www.bx.psu.edu/hg/galaxy/rev/734722f10df8
changeset: 2923:734722f10df8
user: James Taylor <james(a)jamestaylor.org>
date: Tue Oct 27 13:28:25 2009 -0400
description:
Fix display of stranded features without blocks in trackster. Hacky.
4 file(s) affected in this change:
lib/galaxy/visualization/tracks/data/interval_index.py
static/images/visualization/strand_left_inv.png
static/images/visualization/strand_right_inv.png
static/scripts/trackster.js
diffs (114 lines):
diff -r d8ce43b63ebb -r 734722f10df8 lib/galaxy/visualization/tracks/data/interval_index.py
--- a/lib/galaxy/visualization/tracks/data/interval_index.py Tue Oct 27 11:36:57 2009 -0400
+++ b/lib/galaxy/visualization/tracks/data/interval_index.py Tue Oct 27 13:28:25 2009 -0400
@@ -21,7 +21,11 @@
for start, end, offset in index.find(chrom, start, end):
source.seek(offset)
feature = source.readline().split()
- payload = { 'start': start, 'end': end, 'name': feature[3], 'strand': feature[5] }
+ payload = { 'start': start, 'end': end, 'name': feature[3] }
+ try:
+ payload['strand'] = feature[5]
+ except IndexError:
+ pass
try:
block_sizes = [ int(n) for n in feature[10].split(',') if n != '']
block_starts = [ int(n) for n in feature[11].split(',') if n != '' ]
diff -r d8ce43b63ebb -r 734722f10df8 static/images/visualization/strand_left_inv.png
Binary file static/images/visualization/strand_left_inv.png has changed
diff -r d8ce43b63ebb -r 734722f10df8 static/images/visualization/strand_right_inv.png
Binary file static/images/visualization/strand_right_inv.png has changed
diff -r d8ce43b63ebb -r 734722f10df8 static/scripts/trackster.js
--- a/static/scripts/trackster.js Tue Oct 27 11:36:57 2009 -0400
+++ b/static/scripts/trackster.js Tue Oct 27 13:28:25 2009 -0400
@@ -19,6 +19,17 @@
left_img.src = "../images/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 = "../images/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 = "../images/visualization/strand_left_inv.png";
+left_img_inv.onload = function() {
+ LEFT_STRAND_INV = CONTEXT.createPattern(left_img_inv, "repeat");
}
function commatize( number ) {
@@ -402,7 +413,7 @@
y_center = this.slots[feature.name] * this.vertical_gap;
if (feature.strand && this.showing_labels) {
- if (feature.strand == "+") {
+ if (feature.strand == "+") {
ctx.fillStyle = RIGHT_STRAND;
} else if (feature.strand == "-") {
ctx.fillStyle = LEFT_STRAND;
@@ -415,26 +426,53 @@
}
if (this.showing_labels && ctx.fillText) {
- ctx.fillText(feature.name, f_start, y_center + 8);
+ ctx.fillText(feature.name, f_start - 1, y_center + 8);
}
+ // If there is no thickStart/thickEnd, draw the whole thing
+ // as thick.
var exon_start, exon_end;
if (feature.exon_start && feature.exon_end) {
exon_start = Math.floor( Math.max(0, (feature.exon_start - tile_low) * w_scale) );
exon_end = Math.ceil( Math.min(width, (feature.exon_end - tile_low) * w_scale) );
- }
+ } else {
+ exon_start = Math.floor( Math.max(0, (feature.start - tile_low) * w_scale) );
+ exon_end = Math.ceil( Math.min(width, (feature.end - tile_low) * w_scale) );
+ }
- if (feature.blocks && this.showing_labels) {
- for (var k = 0, k_len = feature.blocks.length; k < k_len; k++) {
- var block = feature.blocks[k],
+ if (this.showing_labels) {
+ // If there are no blocks, we treat the feature as one
+ // big exon
+ var blocks = feature.blocks;
+ var arrows_in_blocks = false;
+ if ( ! blocks ) {
+ blocks = [[feature.start,feature.end]];
+ arrows_in_blocks = true
+ }
+ for (var k = 0, k_len = blocks.length; k < k_len; k++) {
+ var block = blocks[k],
block_start = Math.floor( Math.max(0, (block[0] - tile_low) * w_scale) ),
block_end = Math.ceil( Math.min(width, (block[1] - tile_low) * w_scale) );
- var thickness = 5, y_start = 3;
+ var thickness, y_start;
if (exon_start && block_start >= exon_start && block_end <= exon_end) {
- thickness = 7;
- y_start = 2;
- }
- ctx.fillRect(block_start, y_center + y_start, block_end - block_start, thickness);
+ thickness = 9;
+ y_start = 1;
+ ctx.fillRect(block_start, y_center + y_start, block_end - block_start, thickness);
+ if ( feature.strand && arrows_in_blocks ) {
+ if (feature.strand == "+") {
+ ctx.fillStyle = RIGHT_STRAND_INV;
+ } else if (feature.strand == "-") {
+ ctx.fillStyle = LEFT_STRAND_INV;
+ }
+ ctx.fillRect(block_start, y_center, block_end - block_start, 10);
+ ctx.fillStyle = "#000";
+ }
+ } else {
+ thickness = 5;
+ y_start = 3;
+ ctx.fillRect(block_start, y_center + y_start, block_end - block_start, thickness);
+ }
+
// console.log(block_start, block_end);
}
}
13 years, 3 months