galaxy.dataset_collections package

Submodules

galaxy.dataset_collections.builder module

galaxy.dataset_collections.builder.build_collection(type, dataset_instances)[source]

Build DatasetCollection with populated DatasetcollectionElement objects corresponding to the supplied dataset instances or throw exception if this is not a valid collection of the specified type.

galaxy.dataset_collections.builder.set_collection_elements(dataset_collection, type, dataset_instances)[source]
class galaxy.dataset_collections.builder.CollectionBuilder(collection_type_description)[source]

Bases: object

Purely functional builder pattern for building a dataset collection.

__init__(collection_type_description)[source]
get_level(identifier)[source]
add_dataset(identifier, dataset_instance)[source]
build_elements()[source]
build()[source]
class galaxy.dataset_collections.builder.BoundCollectionBuilder(dataset_collection, collection_type_description)[source]

Bases: galaxy.dataset_collections.builder.CollectionBuilder

More stateful builder that is bound to a particular model object.

__init__(dataset_collection, collection_type_description)[source]
populate()[source]

galaxy.dataset_collections.matching module

class galaxy.dataset_collections.matching.CollectionsToMatch[source]

Bases: object

Structure representing a set of collections that need to be matched up when running tools (possibly workflows in the future as well).

__init__()[source]
add(input_name, hdca, subcollection_type=None, linked=True)[source]
has_collections()[source]
iteritems()[source]
class galaxy.dataset_collections.matching.MatchingCollections[source]

Bases: object

Structure holding the result of matching a list of collections together. This class being different than the class above and being created in the dataset_collections_service layer may seem like overkill but I suspect in the future plugins will be subtypable for instance so matching collections will need to make heavy use of the dataset collection type registry managed by the dataset collections sevice - hence the complexity now.

__init__()[source]
slice_collections()[source]
structure

Yield cross product of all unlinked datasets to linked dataset.

static for_collections(collections_to_match, collection_type_descriptions)[source]

galaxy.dataset_collections.registry module

class galaxy.dataset_collections.registry.DatasetCollectionTypesRegistry(app)[source]

Bases: object

__init__(app)[source]
get(plugin_type)[source]
prototype(plugin_type)[source]

galaxy.dataset_collections.structure module

Module for reasoning about structure of and matching hierarchical collections of data.

class galaxy.dataset_collections.structure.Leaf[source]

Bases: object

is_leaf
clone()[source]
multiply(other_structure)[source]
class galaxy.dataset_collections.structure.Tree(children, collection_type_description)[source]

Bases: object

__init__(children, collection_type_description)[source]
static for_dataset_collection(dataset_collection, collection_type_description)[source]
walk_collections(hdca_dict)[source]
is_leaf
can_match(other_structure)[source]
element_identifiers_for_outputs(trans, outputs)[source]
multiply(other_structure)[source]
clone()[source]
galaxy.dataset_collections.structure.dict_map(func, input_dict)[source]
galaxy.dataset_collections.structure.get_structure(dataset_collection_instance, collection_type_description, leaf_subcollection_type=None)[source]

galaxy.dataset_collections.subcollections module

galaxy.dataset_collections.subcollections.split_dataset_collection_instance(dataset_collection_instance, collection_type)[source]

Split up collection into collection.

galaxy.dataset_collections.type_description module

class galaxy.dataset_collections.type_description.CollectionTypeDescriptionFactory(type_registry)[source]

Bases: object

__init__(type_registry)[source]
for_collection_type(collection_type)[source]
class galaxy.dataset_collections.type_description.CollectionTypeDescription(collection_type, collection_type_description_factory)[source]

Bases: object

Abstraction over dataset collection type that ties together string reprentation in database/model with type registry.

>>> factory = CollectionTypeDescriptionFactory( None )
>>> nested_type_description = factory.for_collection_type( "list:paired" )
>>> paired_type_description = factory.for_collection_type( "paired" )
>>> nested_type_description.has_subcollections_of_type( "list" )
False
>>> nested_type_description.has_subcollections_of_type( "list:paired" )
False
>>> nested_type_description.has_subcollections_of_type( "paired" )
True
>>> nested_type_description.has_subcollections_of_type( paired_type_description )
True
>>> nested_type_description.has_subcollections( )
True
>>> paired_type_description.has_subcollections( )
False
>>> paired_type_description.rank_collection_type()
'paired'
>>> nested_type_description.rank_collection_type()
'list'
>>> nested_type_description.effective_collection_type( paired_type_description )
'list'
>>> nested_type_description.effective_collection_type_description( paired_type_description ).collection_type
'list'
__init__(collection_type, collection_type_description_factory)[source]
effective_collection_type_description(subcollection_type)[source]
effective_collection_type(subcollection_type)[source]
has_subcollections_of_type(other_collection_type)[source]

Take in another type (either flat string or another CollectionTypeDescription) and determine if this collection contains subcollections matching that type.

The way this is used in map/reduce it seems to make the most sense for this to return True if these subtypes are proper (i.e. a type is not considered to have subcollections of its own type).

is_subcollection_of_type(other_collection_type)[source]
can_match_type(other_collection_type)[source]
subcollection_type_description()[source]
has_subcollections()[source]
rank_collection_type()[source]

Return the top-level collection type corresponding to this collection type. For instance the “rank” type of a list of paired data (“list:paired”) is “list”.

rank_type_plugin()[source]
dimension
multiply(other_collection_type)[source]
galaxy.dataset_collections.type_description.map_over_collection_type(mapped_over_collection_type, target_collection_type)[source]