Warning

This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

Source code for galaxy.model.dataset_collections.types.paired

from galaxy.model import (
    DatasetCollectionElement,
    HistoryDatasetAssociation,
)
from . import BaseDatasetCollectionType

FORWARD_IDENTIFIER = "forward"
REVERSE_IDENTIFIER = "reverse"


[docs]class PairedDatasetCollectionType(BaseDatasetCollectionType): """ Paired (left/right) datasets. """ collection_type = "paired"
[docs] def generate_elements(self, elements): if forward_dataset := elements.get(FORWARD_IDENTIFIER): left_association = DatasetCollectionElement( element=forward_dataset, element_identifier=FORWARD_IDENTIFIER, ) yield left_association if reverse_dataset := elements.get(REVERSE_IDENTIFIER): right_association = DatasetCollectionElement( element=reverse_dataset, element_identifier=REVERSE_IDENTIFIER, ) yield right_association
[docs] def prototype_elements(self): left_association = DatasetCollectionElement( element=HistoryDatasetAssociation(), element_identifier=FORWARD_IDENTIFIER, ) right_association = DatasetCollectionElement( element=HistoryDatasetAssociation(), element_identifier=REVERSE_IDENTIFIER, ) yield left_association yield right_association