galaxy.model.dataset_collections package
Subpackages
Submodules
galaxy.model.dataset_collections.builder module
- galaxy.model.dataset_collections.builder.build_collection(type: BaseDatasetCollectionType, dataset_instances: DatasetInstanceMapping, collection: DatasetCollection | None = None, associated_identifiers: set[str] | None = None, fields: str | list[FieldDict] | None = None, column_definitions=None, rows: dict[str, SampleSheetRow | None] | None = None)[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.model.dataset_collections.builder.set_collection_elements(dataset_collection: DatasetCollection, type: BaseDatasetCollectionType, dataset_instances: DatasetInstanceMapping, associated_identifiers: set[str], fields: str | list[FieldDict] | None = None, rows: dict[str, SampleSheetRow | None] | None = None) DatasetCollection[source]
- galaxy.model.dataset_collections.builder.guess_fields(dataset_instances: DatasetInstanceMapping) list[FieldDict][source]
- class galaxy.model.dataset_collections.builder.CollectionBuilder(collection_type_description)[source]
Bases:
objectPurely functional builder pattern for building a dataset collection.
- replace_elements_in_collection(template_collection: CollectionAdapter | DatasetCollection, replacement_dict: dict[DatasetInstance, DatasetInstance]) None[source]
- get_level(identifier: str, row: SampleSheetRow | None = None) CollectionBuilder[source]
- add_dataset(identifier: str, dataset_instance: DatasetInstance, row: SampleSheetRow | None = None) None[source]
- build_elements_and_rows() tuple[DatasetInstanceMapping, dict[str, SampleSheetRow | None] | None][source]
- build() DatasetCollection[source]
galaxy.model.dataset_collections.matching module
- class galaxy.model.dataset_collections.matching.CollectionsToMatch[source]
Bases:
objectStructure representing a set of collections that need to be matched up when running tools (possibly workflows in the future as well).
- class galaxy.model.dataset_collections.matching.MatchingCollections[source]
Bases:
objectStructure holding the result of matching a list of collections together. This class being different than the class above and being created in the DatasetCollectionManager 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 service - hence the complexity now.
- property structure
Yield cross product of all unlinked collections structures to linked collection structure.
- static for_collections(collections_to_match, collection_type_descriptions) MatchingCollections | None[source]
galaxy.model.dataset_collections.registry module
galaxy.model.dataset_collections.structure module
Module for reasoning about structure of and matching hierarchical collections of data.
- class galaxy.model.dataset_collections.structure.Leaf[source]
Bases:
object- children_known = True
- property is_leaf
- class galaxy.model.dataset_collections.structure.BaseTree(collection_type_description)[source]
Bases:
object
- class galaxy.model.dataset_collections.structure.UninitializedTree(collection_type_description)[source]
Bases:
BaseTree- children_known = False
- property is_leaf
- class galaxy.model.dataset_collections.structure.Tree(children, collection_type_description, when_values=None, columns_metadata=None, column_definitions=None)[source]
Bases:
BaseTree- children_known = True
- __init__(children, collection_type_description, when_values=None, columns_metadata=None, column_definitions=None)[source]
- property is_leaf
- galaxy.model.dataset_collections.structure.tool_output_to_structure(get_sliced_input_collection_structure, tool_output, collections_manager)[source]
- galaxy.model.dataset_collections.structure.get_collection(dataset_collection_instance: CollectionLike) DatasetCollection[source]
Return the DatasetCollection contained by a collection instance.
- A DatasetCollectionElement has two collection references:
collection: the parent collection this element belongs tochild_collection: the nested collection this element contains
- An HDCA has one:
collection: the collection it wraps
This helper returns the contained collection in both cases (child_collection for DCE, collection for HDCA/adapters) and is intended for callers that still hold a wrapper object and need a DatasetCollection to pass to
get_structureorwalk_collections.
- galaxy.model.dataset_collections.structure.get_structure(collection: DatasetCollection, collection_type_description: CollectionTypeDescription, leaf_subcollection_type: str | None = None)[source]
Build a Tree (or UninitializedTree) describing a collection’s shape.
collection_type_descriptioncontrols the depth of the tree: elements belowleaf_subcollection_typeare treated as leaves.
galaxy.model.dataset_collections.subcollections module
- galaxy.model.dataset_collections.subcollections.split_dataset_collection_instance(dataset_collection_instance: HistoryDatasetCollectionAssociation, collection_type: str) list[DatasetCollectionElement | PromoteCollectionElementToCollectionAdapter][source]
Split up collection into collection.
galaxy.model.dataset_collections.type_description module
- class galaxy.model.dataset_collections.type_description.CollectionTypeDescriptionFactory(type_registry=<galaxy.model.dataset_collections.registry.DatasetCollectionTypesRegistry object>)[source]
Bases:
object
- class galaxy.model.dataset_collections.type_description.CollectionTypeDescription(collection_type: str | CollectionTypeDescription, collection_type_description_factory: CollectionTypeDescriptionFactory, fields: str | list[FieldDict] | None = None)[source]
Bases:
objectAbstraction over dataset collection type that ties together string representation in database/model with type registry.
- __init__(collection_type: str | CollectionTypeDescription, collection_type_description_factory: CollectionTypeDescriptionFactory, fields: str | list[FieldDict] | None = None)[source]
- has_subcollections_of_type(other_collection_type) bool[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).
- 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”.
- property dimension