1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/03e9b373ec42/
Changeset: 03e9b373ec42
User: nsoranzo
Date: 2014-08-28 15:09:10
Summary: Fix SQlite datatype sniffing for old sqlite3. Remove unused imports.
Bug fixed: when uploading a gzipped FASTQ file through upload1 tool on a
machine with SQLite 3.3.6, it was detected as 'sqlite' datatype and not
decompressed.
In fact, the sqlite3 command 'pragma schema_version' on any file returns
without error on this SQLite version.
Affected #: 1 file
diff -r 59b6f95bfdd51bcf6c7da17fb9ad2fd4ad7f3133 -r 03e9b373ec42cf727a5d735876f55ab442f73310 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -11,10 +11,7 @@
import struct
import subprocess
import tempfile
-import zipfile
-import sqlite3
-from urllib import urlencode, quote_plus
from galaxy import eggs
eggs.require( "bx-python" )
@@ -22,7 +19,6 @@
from galaxy.datatypes.metadata import MetadataElement,ListParameter,DictParameter
from galaxy.datatypes import metadata
-from galaxy.datatypes.sniff import *
import dataproviders
log = logging.getLogger(__name__)
@@ -580,14 +576,12 @@
except Exception, exc:
pass
- # Connects and runs a query that should work on any real database
- # If the file is not sqlite, an exception will be thrown and the sniffer will return false
def sniff( self, filename ):
+ # The first 16 bytes of any SQLite3 database file is 'SQLite format 3\0', and the file is binary. For details
+ # about the format, see http://www.sqlite.org/fileformat.html
try:
- conn = sqlite3.connect(filename)
- schema_version=conn.cursor().execute("pragma schema_version").fetchone()
- conn.close()
- if schema_version is not None:
+ header = open(filename).read(16)
+ if binascii.b2a_hex(header) == binascii.hexlify('SQLite format 3\0'):
return True
return False
except:
@@ -622,5 +616,5 @@
return dataproviders.dataset.SQliteDataProvider( dataset_source, **settings )
-Binary.register_sniffable_binary_format("sqlite","sqlite",SQlite)
+Binary.register_sniffable_binary_format("sqlite", "sqlite", SQlite)
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 commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a6cfe95047eb/
Changeset: a6cfe95047eb
Branch: stable
User: nsoranzo
Date: 2014-08-28 15:09:10
Summary: Fix SQlite datatype sniffing for old sqlite3. Remove unused imports.
Bug fixed: when uploading a gzipped FASTQ file through upload1 tool on a
machine with SQLite 3.3.6, it was detected as 'sqlite' datatype and not
decompressed.
In fact, the sqlite3 command 'pragma schema_version' on any file returns
without error on this SQLite version.
Affected #: 1 file
diff -r 57d1b775b0ca8515fd1fc71cee91e5db41cd9ec1 -r a6cfe95047eb7e85e3d0aa54e8bcce0ce449c880 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -11,10 +11,7 @@
import struct
import subprocess
import tempfile
-import zipfile
-import sqlite3
-from urllib import urlencode, quote_plus
from galaxy import eggs
eggs.require( "bx-python" )
@@ -22,7 +19,6 @@
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes import metadata
-from galaxy.datatypes.sniff import *
import dataproviders
log = logging.getLogger(__name__)
@@ -552,14 +548,12 @@
class SQlite ( Binary ):
file_ext = "sqlite"
- # Connects and runs a query that should work on any real database
- # If the file is not sqlite, an exception will be thrown and the sniffer will return false
def sniff( self, filename ):
+ # The first 16 bytes of any SQLite3 database file is 'SQLite format 3\0', and the file is binary. For details
+ # about the format, see http://www.sqlite.org/fileformat.html
try:
- conn = sqlite3.connect(filename)
- schema_version=conn.cursor().execute("pragma schema_version").fetchone()
- conn.close()
- if schema_version is not None:
+ header = open(filename).read(16)
+ if binascii.b2a_hex(header) == binascii.hexlify('SQLite format 3\0'):
return True
return False
except:
@@ -586,5 +580,5 @@
return dataproviders.dataset.SQliteDataProvider( dataset_source, **settings )
-Binary.register_sniffable_binary_format("sqlite","sqlite",SQlite)
+Binary.register_sniffable_binary_format("sqlite", "sqlite", SQlite)
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 commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/59b6f95bfdd5/
Changeset: 59b6f95bfdd5
User: carlfeberhard
Date: 2014-08-28 15:49:00
Summary: Fix to df2a994: remove debuggging statements
Affected #: 1 file
diff -r df2a99433e850b7ba594994fece91fdc87c24181 -r 59b6f95bfdd51bcf6c7da17fb9ad2fd4ad7f3133 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -229,14 +229,14 @@
Run a visualization's data_source tests to find out if
it can be applied to the target_object.
"""
- log.debug( 'is_object_applicable( self, trans, %s, %s )', target_object, data_source_tests )
+ #log.debug( 'is_object_applicable( self, trans, %s, %s )', target_object, data_source_tests )
for test in data_source_tests:
test_type = test[ 'type' ]
result_type = test[ 'result_type' ]
test_result = test[ 'result' ]
test_fn = test[ 'fn' ]
- log.debug( '%s %s: %s, %s, %s, %s', str( target_object ), 'is_object_applicable',
- test_type, result_type, test_result, test_fn )
+ #log.debug( '%s %s: %s, %s, %s, %s', str( target_object ), 'is_object_applicable',
+ # test_type, result_type, test_result, test_fn )
if test_type == 'isinstance':
# parse test_result based on result_type (curr: only datatype has to do this)
@@ -254,7 +254,7 @@
#NOTE: tests are OR'd, if any test passes - the visualization can be applied
if test_fn( target_object, test_result ):
- log.debug( '\t test passed' )
+ #log.debug( '\t test passed' )
return True
return 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 commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/df2a99433e85/
Changeset: df2a99433e85
User: carlfeberhard
Date: 2014-08-28 15:44:56
Summary: Vis registry: add two tests (has_attribute, not_eq); add see also for test types in visualization.dtd; correct applicability tests for trackster and circster using not_eq on datatype.track_type
Affected #: 4 files
diff -r f36c6fc80e8cd2bc6a5c6f77f0806aa7271e65f0 -r df2a99433e850b7ba594994fece91fdc87c24181 config/plugins/visualizations/circster/config/circster.xml
--- a/config/plugins/visualizations/circster/config/circster.xml
+++ b/config/plugins/visualizations/circster/config/circster.xml
@@ -4,13 +4,13 @@
<data_sources><data_source><model_class>HistoryDatasetAssociation</model_class>
- <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <test type="not_eq" test_attr="datatype.track_type">None</test><to_param param_attr="id">dataset_id</to_param><to_param assign="hda">hda_ldda</to_param></data_source><data_source><model_class>LibraryDatasetDatasetAssociation</model_class>
- <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <test type="not_eq" test_attr="datatype.track_type">None</test><to_param param_attr="id">dataset_id</to_param><to_param assign="ldda">hda_ldda</to_param></data_source>
diff -r f36c6fc80e8cd2bc6a5c6f77f0806aa7271e65f0 -r df2a99433e850b7ba594994fece91fdc87c24181 config/plugins/visualizations/trackster/config/trackster.xml
--- a/config/plugins/visualizations/trackster/config/trackster.xml
+++ b/config/plugins/visualizations/trackster/config/trackster.xml
@@ -5,14 +5,14 @@
<data_sources><data_source><model_class>HistoryDatasetAssociation</model_class>
- <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <test type="not_eq" test_attr="datatype.track_type">None</test><to_param param_attr="id">dataset_id</to_param><to_param assign="hda">hda_ldda</to_param><to_param param_attr="dbkey">dbkey</to_param></data_source><data_source><model_class>LibraryDatasetDatasetAssociation</model_class>
- <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <test type="not_eq" test_attr="datatype.track_type">None</test><to_param param_attr="id">dataset_id</to_param><to_param assign="ldda">hda_ldda</to_param></data_source>
diff -r f36c6fc80e8cd2bc6a5c6f77f0806aa7271e65f0 -r df2a99433e850b7ba594994fece91fdc87c24181 config/plugins/visualizations/visualization.dtd
--- a/config/plugins/visualizations/visualization.dtd
+++ b/config/plugins/visualizations/visualization.dtd
@@ -33,7 +33,8 @@
Currently, all tests are OR'd and there is no logical grouping. Tests are run in order.
(text): the text of this element is what the given target will be compared to (REQUIRED)
type: what type of test to run (e.g. when the target is an HDA the test will often be of type 'isinstance'
- and test whether the HDA's datatype isinstace of a class)
+ and test whether the HDA's datatype isinstace of a class).
+ See lib/galaxy/visualizations/registry.py, DataSourceParser.parse_tests for test type options.
DEFAULT: string comparison.
test_attr: what attribute of the target object should be used in the test. For instance, 'datatype'
will attempt to get the HDA.datatype from a target HDA. If the given object doesn't have
diff -r f36c6fc80e8cd2bc6a5c6f77f0806aa7271e65f0 -r df2a99433e850b7ba594994fece91fdc87c24181 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -203,6 +203,7 @@
#log.debug( '\t passed model_class' )
# tests are optional - default is the above class test
+#TODO: not true: must have test currently
tests = data_source[ 'tests' ]
if tests and not self.is_object_applicable( trans, target_object, tests ):
continue
@@ -228,14 +229,14 @@
Run a visualization's data_source tests to find out if
it can be applied to the target_object.
"""
- #log.debug( 'is_object_applicable( self, trans, %s, %s )', target_object, data_source_tests )
+ log.debug( 'is_object_applicable( self, trans, %s, %s )', target_object, data_source_tests )
for test in data_source_tests:
test_type = test[ 'type' ]
result_type = test[ 'result_type' ]
test_result = test[ 'result' ]
test_fn = test[ 'fn' ]
- #log.debug( '%s %s: %s, %s, %s, %s', str( target_object ), 'is_object_applicable',
- # test_type, result_type, test_result, test_fn )
+ log.debug( '%s %s: %s, %s, %s, %s', str( target_object ), 'is_object_applicable',
+ test_type, result_type, test_result, test_fn )
if test_type == 'isinstance':
# parse test_result based on result_type (curr: only datatype has to do this)
@@ -253,7 +254,7 @@
#NOTE: tests are OR'd, if any test passes - the visualization can be applied
if test_fn( target_object, test_result ):
- #log.debug( '\t test passed' )
+ log.debug( '\t test passed' )
return True
return False
@@ -407,6 +408,7 @@
# allow manually turning off a vis by checking for a disabled property
if 'disabled' in xml_tree.attrib:
+#TODO: differentiate between disabled and failed to parse, log.warn only on failure, log.info otherwise
return None
# a text display name for end user links
@@ -627,6 +629,13 @@
test_fn = lambda o, result: ( hasattr( getter( o ), 'has_dataprovider' )
and getter( o ).has_dataprovider( result ) )
+ elif test_type == 'has_attribute':
+ # does the object itself have attr in 'result' (no equivalence checking)
+ test_fn = lambda o, result: hasattr( getter( o ), result )
+
+ elif test_type == 'not_eq':
+ test_fn = lambda o, result: str( getter( o ) ) != result
+
else:
# default to simple (string) equilavance (coercing the test_attr to a string)
test_fn = lambda o, result: str( getter( o ) ) == result
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 commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/57d1b775b0ca/
Changeset: 57d1b775b0ca
Branch: stable
User: natefoo
Date: 2014-08-28 15:00:13
Summary: Update tag latest_2014.08.11 for changeset 109b170188e9
Affected #: 1 file
diff -r 109b170188e97fbfc2c998ec174aff9546dd1bd8 -r 57d1b775b0ca8515fd1fc71cee91e5db41cd9ec1 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -18,4 +18,4 @@
81fbe25bd02edcd53065e8e4476dd1dfb5a72cf2 latest_2013.11.04
2a756ca2cb1826db7796018e77d12e2dd7b67603 latest_2014.02.10
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
-9a4b43021fd1c5808c17329da7b6acbfd9ae27ed latest_2014.08.11
+109b170188e97fbfc2c998ec174aff9546dd1bd8 latest_2014.08.11
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 commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/109b170188e9/
Changeset: 109b170188e9
Branch: stable
User: jmchilton
Date: 2014-08-27 20:39:43
Summary: Fix using multiple list collections with different identifiers in workflows.
Tools will pair off (or triplize, quadraplate, quintukify, etc...) based only on the index of the elements in the collection (so any N element list can be used in the same tool execution as any other N element list). Originally, I had decided to require the element identifiers to be the same in both collections (allows mixing a matching fewer collections in tools - but probably less likely to mismatch in a way the user did not intend). At any rate - I changed that decision and updated tool execution appropriately but not every aspect workflow collection 'pairing' - this fixes that and closes out this card https://trello.com/c/m5PiF1lR.
In very partical terms tools would ideally be consuming collection pairs - but for those that are still consuming two separate files (i.e. all of them) one can use two lists of datasets with pairs at matching indices and feed them into these tools - for workflows this doesn't work without this patch unless the identifiers and the indices match on these collections.
Thanks for Michael Crusoe and takadonet for the bug reports.
Affected #: 1 file
diff -r 51de5214e6f9e59b9bad5a05ae6a79d6e8944a9e -r 109b170188e97fbfc2c998ec174aff9546dd1bd8 lib/galaxy/dataset_collections/structure.py
--- a/lib/galaxy/dataset_collections/structure.py
+++ b/lib/galaxy/dataset_collections/structure.py
@@ -35,9 +35,9 @@
return self._walk_collections( dict_map( lambda hdca: hdca.collection, hdca_dict ) )
def _walk_collections( self, collection_dict ):
- for ( identifier, substructure ) in self.children:
+ for index, ( identifier, substructure ) in enumerate( self.children ):
def element( collection ):
- return collection[ identifier ]
+ return collection[ index ]
if substructure.is_leaf:
yield dict_map( element, collection_dict )
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 commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8c0b86881425/
Changeset: 8c0b86881425
User: jmchilton
Date: 2014-08-27 19:06:26
Summary: Fix upload tool for 6cb895d.
Web form (at least for older style upload tool) was passing in '' and the UUID custom datatype treats this as an invalid UUID (probably correct) instead of a None. This changeset fixes that by ensuring these values coming in through the controllers are transformed into None-s.
Affected #: 1 file
diff -r 3e00d002e7ba1fdd9d914bcd68589aad5c1e21ff -r 8c0b86881425de9ba43c6aa604e868236cb7a9c9 lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -278,7 +278,7 @@
ftp_files = context['ftp_files']
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
- uuid = context.get( 'uuid', None )
+ uuid = context.get( 'uuid', None ) or None # Turn '' to None
warnings = []
to_posix_lines = False
if context.get( 'to_posix_lines', None ) not in [ "None", None, False ]:
@@ -324,7 +324,7 @@
data_file = context['file_data']
url_paste = context['url_paste']
ftp_files = context['ftp_files']
- uuid = context.get( 'uuid', None )
+ uuid = context.get( 'uuid', None ) or None # Turn '' to None
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
to_posix_lines = 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.