diff --git a/.hgignore b/.hgignore index 2934ae2b1ff..b5acfbd1abf 100644 --- a/.hgignore +++ b/.hgignore @@ -20,6 +20,7 @@ database/job_working_directory database/pbs database/tmp database/*.sqlite +database/openid_consumer_cache # Python bytecode *.pyc @@ -35,6 +36,11 @@ tool_shed_webapp.log tool_shed_webapp.pid hgweb.config* +# Reports Runtime Files +reports_webapp.lock +reports_webapp.log +reports_webapp.pid + # Config files universe_wsgi.ini reports_wsgi.ini @@ -54,7 +60,7 @@ shed_tool_data_table_conf.xml job_conf.xml data_manager_conf.xml shed_data_manager_conf.xml - +visualizations_conf.xml static/welcome.html.* static/welcome.html @@ -75,6 +81,7 @@ tool-data/genome/* # Test output run_functional_tests.html +test/tool_shed/tmp/* # Project files *.kpf diff --git a/buildbot_setup.sh b/buildbot_setup.sh index 5e98c8bba00..d4917e8c8e2 100644 --- a/buildbot_setup.sh +++ b/buildbot_setup.sh @@ -93,26 +93,49 @@ database/pbs JARS="/galaxy/software/jars" -for link in $LINKS; do - echo "Linking $link" - rm -f tool-data/`basename $link` - ln -sf $link tool-data -done - -if [ -d "$HYPHY" ]; then - echo "Linking $HYPHY" - rm -f tool-data/HYPHY - ln -sf $HYPHY tool-data/HYPHY +if [ ! $1 ]; then + type="standard" +elif [ $1 == "-ec2" ]; then + type="external-ec2" +else + type="unknown" fi -if [ -d "$JARS" ]; then - echo "Linking $JARS" - rm -f tool-data/shared/jars - ln -sf $JARS tool-data/shared/jars -fi +case $type in + external*) + echo "Running standalone buildbot setup..." + for sample in tool-data/*.sample; do + basename=${sample%.sample} + if [ ! -f $basename ]; then + echo "Copying $sample to $basename" + cp "$sample" "$basename" + fi + done + ;; + *) + echo "Running standard buildbot setup..." + for link in $LINKS; do + echo "Linking $link" + rm -f tool-data/`basename $link` + ln -sf $link tool-data + done + + if [ -d "$HYPHY" ]; then + echo "Linking $HYPHY" + rm -f tool-data/HYPHY + ln -sf $HYPHY tool-data/HYPHY + fi + + if [ -d "$JARS" ]; then + echo "Linking $JARS" + rm -f tool-data/shared/jars + ln -sf $JARS tool-data/shared/jars + fi + ;; +esac for sample in $SAMPLES; do - file=`echo $sample | sed -e 's/\.sample$//'` + file=${sample%.sample} echo "Copying $sample to $file" cp $sample $file done diff --git a/datatypes_conf.xml.sample b/datatypes_conf.xml.sample index 57122d0d8c3..d8c222260c0 100644 --- a/datatypes_conf.xml.sample +++ b/datatypes_conf.xml.sample @@ -3,16 +3,13 @@ + + - - + @@ -20,10 +17,9 @@ - - + @@ -49,7 +45,7 @@ - + @@ -91,7 +87,7 @@ - + @@ -101,7 +97,7 @@ - + @@ -113,7 +109,7 @@ - + @@ -154,10 +150,13 @@ - + - + + + + @@ -167,7 +166,7 @@ - + @@ -185,7 +184,7 @@ - + @@ -198,7 +197,6 @@ - diff --git a/doc/source/lib/galaxy.webapps.tool_shed.api.rst b/doc/source/lib/galaxy.webapps.tool_shed.api.rst new file mode 100644 index 00000000000..854f99f3e03 --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.api.rst @@ -0,0 +1,19 @@ +api Package +=========== + +:mod:`repositories` Module +-------------------------- + +.. automodule:: galaxy.webapps.tool_shed.api.repositories + :members: + :undoc-members: + :show-inheritance: + +:mod:`repository_revisions` Module +---------------------------------- + +.. automodule:: galaxy.webapps.tool_shed.api.repository_revisions + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.controllers.rst b/doc/source/lib/galaxy.webapps.tool_shed.controllers.rst new file mode 100644 index 00000000000..01163fcd545 --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.controllers.rst @@ -0,0 +1,59 @@ +controllers Package +=================== + +:mod:`controllers` Package +-------------------------- + +.. automodule:: galaxy.webapps.tool_shed.controllers + :members: + :undoc-members: + :show-inheritance: + +:mod:`admin` Module +------------------- + +.. automodule:: galaxy.webapps.tool_shed.controllers.admin + :members: + :undoc-members: + :show-inheritance: + +:mod:`hg` Module +---------------- + +.. automodule:: galaxy.webapps.tool_shed.controllers.hg + :members: + :undoc-members: + :show-inheritance: + +:mod:`repository` Module +------------------------ + +.. automodule:: galaxy.webapps.tool_shed.controllers.repository + :members: + :undoc-members: + :show-inheritance: + +:mod:`repository_review` Module +------------------------------- + +.. automodule:: galaxy.webapps.tool_shed.controllers.repository_review + :members: + :undoc-members: + :show-inheritance: + +:mod:`upload` Module +-------------------- + +.. automodule:: galaxy.webapps.tool_shed.controllers.upload + :members: + :undoc-members: + :show-inheritance: + +:mod:`user` Module +------------------ + +.. automodule:: galaxy.webapps.tool_shed.controllers.user + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.framework.middleware.rst b/doc/source/lib/galaxy.webapps.tool_shed.framework.middleware.rst new file mode 100644 index 00000000000..4de7ea427c2 --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.framework.middleware.rst @@ -0,0 +1,27 @@ +middleware Package +================== + +:mod:`middleware` Package +------------------------- + +.. automodule:: galaxy.webapps.tool_shed.framework.middleware + :members: + :undoc-members: + :show-inheritance: + +:mod:`hg` Module +---------------- + +.. automodule:: galaxy.webapps.tool_shed.framework.middleware.hg + :members: + :undoc-members: + :show-inheritance: + +:mod:`remoteuser` Module +------------------------ + +.. automodule:: galaxy.webapps.tool_shed.framework.middleware.remoteuser + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.framework.rst b/doc/source/lib/galaxy.webapps.tool_shed.framework.rst new file mode 100644 index 00000000000..d0f4b8abdf8 --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.framework.rst @@ -0,0 +1,18 @@ +framework Package +================= + +:mod:`framework` Package +------------------------ + +.. automodule:: galaxy.webapps.tool_shed.framework + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + galaxy.webapps.tool_shed.framework.middleware + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.model.migrate.rst b/doc/source/lib/galaxy.webapps.tool_shed.model.migrate.rst new file mode 100644 index 00000000000..2d4197c30a3 --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.model.migrate.rst @@ -0,0 +1,11 @@ +migrate Package +=============== + +:mod:`check` Module +------------------- + +.. automodule:: galaxy.webapps.tool_shed.model.migrate.check + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.model.rst b/doc/source/lib/galaxy.webapps.tool_shed.model.rst new file mode 100644 index 00000000000..429f0d57917 --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.model.rst @@ -0,0 +1,26 @@ +model Package +============= + +:mod:`model` Package +-------------------- + +.. automodule:: galaxy.webapps.tool_shed.model + :members: + :undoc-members: + :show-inheritance: + +:mod:`mapping` Module +--------------------- + +.. automodule:: galaxy.webapps.tool_shed.model.mapping + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + galaxy.webapps.tool_shed.model.migrate + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.rst b/doc/source/lib/galaxy.webapps.tool_shed.rst new file mode 100644 index 00000000000..1590f2988c1 --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.rst @@ -0,0 +1,47 @@ +tool_shed Package +================= + +:mod:`tool_shed` Package +------------------------ + +.. automodule:: galaxy.webapps.tool_shed + :members: + :undoc-members: + :show-inheritance: + +:mod:`app` Module +----------------- + +.. automodule:: galaxy.webapps.tool_shed.app + :members: + :undoc-members: + :show-inheritance: + +:mod:`buildapp` Module +---------------------- + +.. automodule:: galaxy.webapps.tool_shed.buildapp + :members: + :undoc-members: + :show-inheritance: + +:mod:`config` Module +-------------------- + +.. automodule:: galaxy.webapps.tool_shed.config + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + galaxy.webapps.tool_shed.api + galaxy.webapps.tool_shed.controllers + galaxy.webapps.tool_shed.framework + galaxy.webapps.tool_shed.model + galaxy.webapps.tool_shed.security + galaxy.webapps.tool_shed.util + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.security.rst b/doc/source/lib/galaxy.webapps.tool_shed.security.rst new file mode 100644 index 00000000000..ac3f17fb38d --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.security.rst @@ -0,0 +1,11 @@ +security Package +================ + +:mod:`security` Package +----------------------- + +.. automodule:: galaxy.webapps.tool_shed.security + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/galaxy.webapps.tool_shed.util.rst b/doc/source/lib/galaxy.webapps.tool_shed.util.rst new file mode 100644 index 00000000000..a8623852afa --- /dev/null +++ b/doc/source/lib/galaxy.webapps.tool_shed.util.rst @@ -0,0 +1,35 @@ +util Package +============ + +:mod:`common_util` Module +------------------------- + +.. automodule:: galaxy.webapps.tool_shed.util.common_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`container_util` Module +---------------------------- + +.. automodule:: galaxy.webapps.tool_shed.util.container_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`hgweb_config` Module +-------------------------- + +.. automodule:: galaxy.webapps.tool_shed.util.hgweb_config + :members: + :undoc-members: + :show-inheritance: + +:mod:`shed_statistics` Module +----------------------------- + +.. automodule:: galaxy.webapps.tool_shed.util.shed_statistics + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/tool_shed.galaxy_install.grids.rst b/doc/source/lib/tool_shed.galaxy_install.grids.rst new file mode 100644 index 00000000000..c75c5c716ea --- /dev/null +++ b/doc/source/lib/tool_shed.galaxy_install.grids.rst @@ -0,0 +1,11 @@ +grids Package +============= + +:mod:`admin_toolshed_grids` Module +---------------------------------- + +.. automodule:: tool_shed.galaxy_install.grids.admin_toolshed_grids + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/tool_shed.galaxy_install.migrate.rst b/doc/source/lib/tool_shed.galaxy_install.migrate.rst new file mode 100644 index 00000000000..5d553b446d1 --- /dev/null +++ b/doc/source/lib/tool_shed.galaxy_install.migrate.rst @@ -0,0 +1,19 @@ +migrate Package +=============== + +:mod:`check` Module +------------------- + +.. automodule:: tool_shed.galaxy_install.migrate.check + :members: + :undoc-members: + :show-inheritance: + +:mod:`common` Module +-------------------- + +.. automodule:: tool_shed.galaxy_install.migrate.common + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/tool_shed.galaxy_install.rst b/doc/source/lib/tool_shed.galaxy_install.rst new file mode 100644 index 00000000000..28e61519afe --- /dev/null +++ b/doc/source/lib/tool_shed.galaxy_install.rst @@ -0,0 +1,44 @@ +galaxy_install Package +====================== + +:mod:`galaxy_install` Package +----------------------------- + +.. automodule:: tool_shed.galaxy_install + :members: + :undoc-members: + :show-inheritance: + +:mod:`install_manager` Module +----------------------------- + +.. automodule:: tool_shed.galaxy_install.install_manager + :members: + :undoc-members: + :show-inheritance: + +:mod:`repository_util` Module +----------------------------- + +.. automodule:: tool_shed.galaxy_install.repository_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`update_manager` Module +---------------------------- + +.. automodule:: tool_shed.galaxy_install.update_manager + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + tool_shed.galaxy_install.grids + tool_shed.galaxy_install.migrate + tool_shed.galaxy_install.tool_dependencies + diff --git a/doc/source/lib/tool_shed.galaxy_install.tool_dependencies.rst b/doc/source/lib/tool_shed.galaxy_install.tool_dependencies.rst new file mode 100644 index 00000000000..4871c0b1f58 --- /dev/null +++ b/doc/source/lib/tool_shed.galaxy_install.tool_dependencies.rst @@ -0,0 +1,27 @@ +tool_dependencies Package +========================= + +:mod:`common_util` Module +------------------------- + +.. automodule:: tool_shed.galaxy_install.tool_dependencies.common_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`fabric_util` Module +------------------------- + +.. automodule:: tool_shed.galaxy_install.tool_dependencies.fabric_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`install_util` Module +-------------------------- + +.. automodule:: tool_shed.galaxy_install.tool_dependencies.install_util + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/tool_shed.grids.rst b/doc/source/lib/tool_shed.grids.rst new file mode 100644 index 00000000000..154f92b8369 --- /dev/null +++ b/doc/source/lib/tool_shed.grids.rst @@ -0,0 +1,35 @@ +grids Package +============= + +:mod:`admin_grids` Module +------------------------- + +.. automodule:: tool_shed.grids.admin_grids + :members: + :undoc-members: + :show-inheritance: + +:mod:`repository_grids` Module +------------------------------ + +.. automodule:: tool_shed.grids.repository_grids + :members: + :undoc-members: + :show-inheritance: + +:mod:`repository_review_grids` Module +------------------------------------- + +.. automodule:: tool_shed.grids.repository_review_grids + :members: + :undoc-members: + :show-inheritance: + +:mod:`util` Module +------------------ + +.. automodule:: tool_shed.grids.util + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/lib/tool_shed.rst b/doc/source/lib/tool_shed.rst new file mode 100644 index 00000000000..76794397c1c --- /dev/null +++ b/doc/source/lib/tool_shed.rst @@ -0,0 +1,20 @@ +tool_shed Package +================= + +:mod:`tool_shed_registry` Module +-------------------------------- + +.. automodule:: tool_shed.tool_shed_registry + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + tool_shed.galaxy_install + tool_shed.grids + tool_shed.util + diff --git a/doc/source/lib/tool_shed.util.rst b/doc/source/lib/tool_shed.util.rst new file mode 100644 index 00000000000..17d6e4c490d --- /dev/null +++ b/doc/source/lib/tool_shed.util.rst @@ -0,0 +1,107 @@ +util Package +============ + +:mod:`common_install_util` Module +--------------------------------- + +.. automodule:: tool_shed.util.common_install_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`common_util` Module +------------------------- + +.. automodule:: tool_shed.util.common_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`data_manager_util` Module +------------------------------- + +.. automodule:: tool_shed.util.data_manager_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`datatype_util` Module +--------------------------- + +.. automodule:: tool_shed.util.datatype_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`encoding_util` Module +--------------------------- + +.. automodule:: tool_shed.util.encoding_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`metadata_util` Module +--------------------------- + +.. automodule:: tool_shed.util.metadata_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`readme_util` Module +------------------------- + +.. automodule:: tool_shed.util.readme_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`repository_dependency_util` Module +---------------------------------------- + +.. automodule:: tool_shed.util.repository_dependency_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`review_util` Module +------------------------- + +.. automodule:: tool_shed.util.review_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`shed_util_common` Module +------------------------------ + +.. automodule:: tool_shed.util.shed_util_common + :members: + :undoc-members: + :show-inheritance: + +:mod:`tool_dependency_util` Module +---------------------------------- + +.. automodule:: tool_shed.util.tool_dependency_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`tool_util` Module +----------------------- + +.. automodule:: tool_shed.util.tool_util + :members: + :undoc-members: + :show-inheritance: + +:mod:`workflow_util` Module +--------------------------- + +.. automodule:: tool_shed.util.workflow_util + :members: + :undoc-members: + :show-inheritance: + diff --git a/eggs.ini b/eggs.ini index fc426d2eecc..872ee3c0caa 100644 --- a/eggs.ini +++ b/eggs.ini @@ -14,7 +14,6 @@ no_auto = pbs_python DRMAA_python [eggs:platform] bx_python = 0.7.1 Cheetah = 2.2.2 -ctypes = 1.0.2 DRMAA_python = 0.2 MarkupSafe = 0.12 mercurial = 2.2.3 @@ -29,6 +28,7 @@ python_lzo = 1.08_2.03_static simplejson = 2.1.1 threadframe = 0.2 guppy = 0.1.8 +SQLAlchemy = 0.7.9 ; msgpack_python = 0.2.4 [eggs:noplatform] @@ -46,17 +46,17 @@ Mako = 0.4.1 nose = 0.11.1 NoseHTML = 0.4.1 NoseTestDiff = 0.1 +Parsley = 1.1 Paste = 1.7.5.1 PasteDeploy = 1.5.0 pexpect = 2.4 python_openid = 2.2.5 python_daemon = 1.5.5 Routes = 1.12.3 -SQLAlchemy = 0.5.6 -sqlalchemy_migrate = 0.5.4 +sqlalchemy_migrate = 0.7.2 ssh = 1.7.14 SVGFig = 1.1.6 -Tempita = 0.1 +Tempita = 0.5.1 twill = 0.9 WebError = 0.8a WebHelpers = 0.2 @@ -75,7 +75,6 @@ pysqlite = _3.6.17_static MySQL_python = _5.1.41_static bx_python = _7b95ff194725 GeneTrack = _dev_48da9e998f0caf01c5be731e926f4b0481f658f0 -SQLAlchemy = _dev_r6498 pysam = _kanwei_b10f6e722e9a ; dependency source urls, necessary for scrambling. for an explanation, see diff --git a/job_conf.xml.sample_advanced b/job_conf.xml.sample_advanced index a14fd17b65a..6a9a6c6e3e0 100644 --- a/job_conf.xml.sample_advanced +++ b/job_conf.xml.sample_advanced @@ -7,7 +7,7 @@ - + @@ -40,7 +40,6 @@ - python foo diff --git a/lib/fpconst.py b/lib/fpconst.py deleted file mode 100644 index 28653610827..00000000000 --- a/lib/fpconst.py +++ /dev/null @@ -1,163 +0,0 @@ -"""Utilities for handling IEEE 754 floating point special values - -This python module implements constants and functions for working with -IEEE754 double-precision special values. It provides constants for -Not-a-Number (NaN), Positive Infinity (PosInf), and Negative Infinity -(NegInf), as well as functions to test for these values. - -The code is implemented in pure python by taking advantage of the -'struct' standard module. Care has been taken to generate proper -results on both big-endian and little-endian machines. Some efficiency -could be gained by translating the core routines into C. - -See -for reference material on the IEEE 754 floating point standard. - -Further information on this package is available at -. - -Author: Gregory R. Warnes -Date:: 2003-04-08 -Copyright: (c) 2003, Pfizer, Inc. -""" - -__version__ = "0.7.0" -ident = "$Id: fpconst.py,v 1.12 2004/05/22 04:38:17 warnes Exp $" - -import struct, operator - -# check endianess -_big_endian = struct.pack('i',1)[0] != '\x01' - -# and define appropriate constants -if(_big_endian): - NaN = struct.unpack('d', '\x7F\xF8\x00\x00\x00\x00\x00\x00')[0] - PosInf = struct.unpack('d', '\x7F\xF0\x00\x00\x00\x00\x00\x00')[0] - NegInf = -PosInf -else: - NaN = struct.unpack('d', '\x00\x00\x00\x00\x00\x00\xf8\xff')[0] - PosInf = struct.unpack('d', '\x00\x00\x00\x00\x00\x00\xf0\x7f')[0] - NegInf = -PosInf - -def _double_as_bytes(dval): - "Use struct.unpack to decode a double precision float into eight bytes" - tmp = list(struct.unpack('8B',struct.pack('d', dval))) - if not _big_endian: - tmp.reverse() - return tmp - -## -## Functions to extract components of the IEEE 754 floating point format -## - -def _sign(dval): - "Extract the sign bit from a double-precision floating point value" - bb = _double_as_bytes(dval) - return bb[0] >> 7 & 0x01 - -def _exponent(dval): - """Extract the exponentent bits from a double-precision floating - point value. - - Note that for normalized values, the exponent bits have an offset - of 1023. As a consequence, the actual exponentent is obtained - by subtracting 1023 from the value returned by this function - """ - bb = _double_as_bytes(dval) - return (bb[0] << 4 | bb[1] >> 4) & 0x7ff - -def _mantissa(dval): - """Extract the _mantissa bits from a double-precision floating - point value.""" - - bb = _double_as_bytes(dval) - mantissa = bb[1] & 0x0f << 48 - mantissa += bb[2] << 40 - mantissa += bb[3] << 32 - mantissa += bb[4] - return mantissa - -def _zero_mantissa(dval): - """Determine whether the mantissa bits of the given double are all - zero.""" - bb = _double_as_bytes(dval) - return ((bb[1] & 0x0f) | reduce(operator.or_, bb[2:])) == 0 - -## -## Functions to test for IEEE 754 special values -## - -def isNaN(value): - "Determine if the argument is a IEEE 754 NaN (Not a Number) value." - return (_exponent(value)==0x7ff and not _zero_mantissa(value)) - -def isInf(value): - """Determine if the argument is an infinite IEEE 754 value (positive - or negative inifinity)""" - return (_exponent(value)==0x7ff and _zero_mantissa(value)) - -def isFinite(value): - """Determine if the argument is an finite IEEE 754 value (i.e., is - not NaN, positive or negative inifinity)""" - return (_exponent(value)!=0x7ff) - -def isPosInf(value): - "Determine if the argument is a IEEE 754 positive infinity value" - return (_sign(value)==0 and _exponent(value)==0x7ff and \ - _zero_mantissa(value)) - -def isNegInf(value): - "Determine if the argument is a IEEE 754 negative infinity value" - return (_sign(value)==1 and _exponent(value)==0x7ff and \ - _zero_mantissa(value)) - -## -## Functions to test public functions. -## - -def test_isNaN(): - assert( not isNaN(PosInf) ) - assert( not isNaN(NegInf) ) - assert( isNaN(NaN ) ) - assert( not isNaN( 1.0) ) - assert( not isNaN( -1.0) ) - -def test_isInf(): - assert( isInf(PosInf) ) - assert( isInf(NegInf) ) - assert( not isInf(NaN ) ) - assert( not isInf( 1.0) ) - assert( not isInf( -1.0) ) - -def test_isFinite(): - assert( not isFinite(PosInf) ) - assert( not isFinite(NegInf) ) - assert( not isFinite(NaN ) ) - assert( isFinite( 1.0) ) - assert( isFinite( -1.0) ) - -def test_isPosInf(): - assert( isPosInf(PosInf) ) - assert( not isPosInf(NegInf) ) - assert( not isPosInf(NaN ) ) - assert( not isPosInf( 1.0) ) - assert( not isPosInf( -1.0) ) - -def test_isNegInf(): - assert( not isNegInf(PosInf) ) - assert( isNegInf(NegInf) ) - assert( not isNegInf(NaN ) ) - assert( not isNegInf( 1.0) ) - assert( not isNegInf( -1.0) ) - -# overall test -def test(): - test_isNaN() - test_isInf() - test_isFinite() - test_isPosInf() - test_isNegInf() - -if __name__ == "__main__": - test() - diff --git a/lib/galaxy/__init__.py b/lib/galaxy/__init__.py index 21a75feed6f..36cd328f48c 100644 --- a/lib/galaxy/__init__.py +++ b/lib/galaxy/__init__.py @@ -95,10 +95,15 @@ except: pkg_resources.Distribution._insert_on = pkg_resources.Distribution.insert_on pkg_resources.Distribution.insert_on = _insert_on -# patch to add the NullHandler class to logging -if sys.version_info[:2] < ( 2, 7 ): - import logging +# compat: BadZipFile introduced in Python 2.7 +import zipfile +if not hasattr( zipfile, 'BadZipFile' ): + zipfile.BadZipFile = zipfile.error + +# compat: patch to add the NullHandler class to logging +import logging +if not hasattr( logging, 'NullHandler' ): class NullHandler( logging.Handler ): def emit( self, record ): pass - logging.NullHandler = NullHandler + logging.NullHandler = NullHandler \ No newline at end of file diff --git a/lib/galaxy/app.py b/lib/galaxy/app.py index 4c37bde4fda..a017e6ff5b5 100644 --- a/lib/galaxy/app.py +++ b/lib/galaxy/app.py @@ -15,6 +15,7 @@ import galaxy.quota from galaxy.tags.tag_handler import GalaxyTagHandler from galaxy.visualization.genomes import Genomes from galaxy.visualization.data_providers.registry import DataProviderRegistry +from galaxy.visualization.registry import VisualizationsRegistry from galaxy.tools.imp_exp import load_history_imp_exp_tools from galaxy.tools.genome_index import load_genome_index_tools from galaxy.sample_tracking import external_service_types @@ -61,7 +62,8 @@ class UniverseApplication( object ): self.config.database_engine_options, database_query_profiling_proxy = self.config.database_query_profiling_proxy, object_store = self.object_store, - trace_logger=self.trace_logger ) + trace_logger=self.trace_logger, + use_pbkdf2=self.config.get_bool( 'use_pbkdf2', True ) ) # Manage installed tool shed repositories. self.installed_repository_manager = tool_shed.galaxy_install.InstalledRepositoryManager( self ) # Create an empty datatypes registry. @@ -120,6 +122,9 @@ class UniverseApplication( object ): load_history_imp_exp_tools( self.toolbox ) # Load genome indexer tool. load_genome_index_tools( self.toolbox ) + # visualizations registry: associates resources with visualizations, controls how to render + self.visualizations_registry = ( VisualizationsRegistry( self.config.root, self.config.visualizations_conf_path ) + if self.config.visualizations_conf_path else None ) # Load security policy. self.security_agent = self.model.security_agent self.host_security_agent = galaxy.security.HostAgent( model=self.security_agent.model, permitted_actions=self.security_agent.permitted_actions ) diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index c5f35983246..297eee9ba84 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -86,7 +86,6 @@ class Configuration( object ): self.galaxy_data_manager_data_path = kwargs.get( 'galaxy_data_manager_data_path', self.tool_data_path ) self.tool_secret = kwargs.get( "tool_secret", "" ) self.id_secret = kwargs.get( "id_secret", "USING THE DEFAULT IS NOT SECURE!" ) - self.set_metadata_externally = string_as_bool( kwargs.get( "set_metadata_externally", "False" ) ) self.retry_metadata_internally = string_as_bool( kwargs.get( "retry_metadata_internally", "True" ) ) self.use_remote_user = string_as_bool( kwargs.get( "use_remote_user", "False" ) ) self.remote_user_maildomain = kwargs.get( "remote_user_maildomain", None ) @@ -155,6 +154,10 @@ class Configuration( object ): self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites', "main,test,archaea,ucla" ).lower().split(",") self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "modencode,sgd_yeast,tair,wormbase,wormbase_ws120,wormbase_ws140,wormbase_ws170,wormbase_ws180,wormbase_ws190,wormbase_ws200,wormbase_ws204,wormbase_ws210,wormbase_ws220,wormbase_ws225" ).lower().split(",") self.brand = kwargs.get( 'brand', None ) + # Configuration for the message box directly below the masthead. + self.message_box_visible = kwargs.get( 'message_box_visible', False ) + self.message_box_content = kwargs.get( 'message_box_content', None ) + self.message_box_class = kwargs.get( 'message_box_class', 'info' ) self.support_url = kwargs.get( 'support_url', 'http://wiki.g2.bx.psu.edu/Support' ) self.wiki_url = kwargs.get( 'wiki_url', 'http://g2.trac.bx.psu.edu/' ) self.blog_url = kwargs.get( 'blog_url', None ) @@ -166,6 +169,7 @@ class Configuration( object ): self.enable_whoosh_library_search = string_as_bool( kwargs.get( 'enable_whoosh_library_search', False ) ) self.whoosh_index_dir = resolve_path( kwargs.get( "whoosh_index_dir", "database/whoosh_indexes" ), self.root ) self.ftp_upload_dir = kwargs.get( 'ftp_upload_dir', None ) + self.ftp_upload_dir_identifier = kwargs.get( 'ftp_upload_dir_identifier', 'email' ) # attribute on user - email, username, id, etc... self.ftp_upload_site = kwargs.get( 'ftp_upload_site', None ) self.allow_library_path_paste = kwargs.get( 'allow_library_path_paste', False ) self.disable_library_comptypes = kwargs.get( 'disable_library_comptypes', '' ).lower().split( ',' ) @@ -271,6 +275,8 @@ class Configuration( object ): self.fluent_log = string_as_bool( kwargs.get( 'fluent_log', False ) ) self.fluent_host = kwargs.get( 'fluent_host', 'localhost' ) self.fluent_port = int( kwargs.get( 'fluent_port', 24224 ) ) + # visualizations registry config path + self.visualizations_conf_path = kwargs.get( 'visualizations_conf_path', None ) @property def sentry_dsn_public( self ): diff --git a/lib/galaxy/datatypes/assembly.py b/lib/galaxy/datatypes/assembly.py index f9ee0b7bee2..3a0207a8ca5 100644 --- a/lib/galaxy/datatypes/assembly.py +++ b/lib/galaxy/datatypes/assembly.py @@ -5,14 +5,14 @@ for velvet assembler tool in galaxy """ import data +import logging +import os +import re +import sys from galaxy.datatypes import sequence -import logging, os, sys, time, tempfile, shutil, string, glob, re -import galaxy.model -from galaxy.datatypes import metadata -from galaxy.datatypes.metadata import MetadataElement -from galaxy import util from galaxy.datatypes.images import Html -from sniff import * +from galaxy.datatypes.metadata import MetadataElement + log = logging.getLogger(__name__) @@ -174,7 +174,6 @@ class Velvet( Html ): gen_msg = '' try: efp = dataset.extra_files_path - flist = os.listdir(efp) log_path = os.path.join(efp,'Log') f = open(log_path,'r') log_content = f.read(1000) @@ -223,5 +222,5 @@ class Velvet( Html ): self.regenerate_primary_file(dataset) if __name__ == '__main__': - import doctest, sys + import doctest doctest.testmod(sys.modules[__name__]) diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index 8d51135af31..2a478d7f6df 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -2,18 +2,26 @@ Binary classes """ -import data, logging, binascii +import binascii +import data +import gzip +import logging +import os +import shutil +import struct +import subprocess +import tempfile +import zipfile + +from urllib import urlencode, quote_plus +from galaxy import eggs +eggs.require( "bx-python" ) + +from bx.seq.twobit import TWOBIT_MAGIC_NUMBER, TWOBIT_MAGIC_NUMBER_SWAP, TWOBIT_MAGIC_SIZE + from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes import metadata from galaxy.datatypes.sniff import * -from galaxy import eggs -import pkg_resources -pkg_resources.require( "bx-python" ) -from bx.seq.twobit import TWOBIT_MAGIC_NUMBER, TWOBIT_MAGIC_NUMBER_SWAP, TWOBIT_MAGIC_SIZE -from urllib import urlencode, quote_plus -import zipfile, gzip -import os, subprocess, tempfile -import struct log = logging.getLogger(__name__) @@ -85,9 +93,18 @@ class Ab1( Binary ): Binary.register_unsniffable_binary_ext("ab1") +class GenericAsn1Binary( Binary ): + """Class for generic ASN.1 binary format""" + file_ext = "asn1-binary" + +Binary.register_unsniffable_binary_ext("asn1-binary") + class Bam( Binary ): """Class describing a BAM binary file""" file_ext = "bam" + track_type = "ReadTrack" + data_sources = { "data": "bai", "index": "bigwig" } + MetadataElement( name="bam_index", desc="BAM Index File", param=metadata.FileParameter, file_ext="bai", readonly=True, no_value=None, visible=False, optional=True ) def _get_samtools_version( self ): @@ -238,9 +255,7 @@ class Bam( Binary ): return dataset.peek except: return "Binary bam alignments file (%s)" % ( data.nice_size( dataset.get_size() ) ) - def get_track_type( self ): - return "ReadTrack", { "data": "bai", "index": [ "bigwig", "summary_tree" ] } - + Binary.register_sniffable_binary_format("bam", "bam", Bam) class H5( Binary ): @@ -318,6 +333,9 @@ class BigWig(Binary): The supplemental info in the paper has the binary details: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btq351v1 """ + track_type = "LineTrack" + data_sources = { "data_standalone": "bigwig" } + def __init__( self, **kwd ): Binary.__init__( self, **kwd ) self._magic = 0x888FFC26 @@ -342,19 +360,18 @@ class BigWig(Binary): return dataset.peek except: return "Binary UCSC %s file (%s)" % ( self._name, data.nice_size( dataset.get_size() ) ) - def get_track_type( self ): - return "LineTrack", {"data_standalone": "bigwig"} - + Binary.register_sniffable_binary_format("bigwig", "bigwig", BigWig) class BigBed(BigWig): """BigBed support from UCSC.""" + + data_sources = { "data_standalone": "bigbed" } + def __init__( self, **kwd ): Binary.__init__( self, **kwd ) self._magic = 0x8789F2EB self._name = "BigBed" - def get_track_type( self ): - return "LineTrack", {"data_standalone": "bigbed"} Binary.register_sniffable_binary_format("bigbed", "bigbed", BigBed) diff --git a/lib/galaxy/datatypes/chrominfo.py b/lib/galaxy/datatypes/chrominfo.py index 3f20a5f2dbc..14e73714801 100644 --- a/lib/galaxy/datatypes/chrominfo.py +++ b/lib/galaxy/datatypes/chrominfo.py @@ -1,7 +1,3 @@ -import data -from galaxy import util -from galaxy.datatypes.sniff import * -from galaxy.web import url_for from tabular import Tabular from galaxy.datatypes import metadata from galaxy.datatypes.metadata import MetadataElement diff --git a/lib/galaxy/datatypes/converters/bam_to_bigwig_converter.xml b/lib/galaxy/datatypes/converters/bam_to_bigwig_converter.xml index 739cca3d268..35f7b224083 100644 --- a/lib/galaxy/datatypes/converters/bam_to_bigwig_converter.xml +++ b/lib/galaxy/datatypes/converters/bam_to_bigwig_converter.xml @@ -1,7 +1,14 @@