Application
Classes¶
Modules¶
consensus_application
¶
Provide an abstract base class for consensus building applications.
Classes¶
ConsensusApplication
¶
Bases: ABC
Define an abstract base class for consensus building applications.
Source code in taxpasta/application/consensus_application.py
Functions¶
run(profiles: Iterable[DataFrame[StandardProfile]], taxonomy) -> DataFrame
abstractmethod
classmethod
¶Build a consensus from two or more taxonomic profiles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profiles |
Iterable[DataFrame[StandardProfile]]
|
Standardized profiles. |
required |
Source code in taxpasta/application/consensus_application.py
error
¶
Classes¶
Modules¶
standardisation_error
¶
Provide an exception for errors during profile extraction and transformation.
Classes¶
StandardisationError
¶
Bases: TaxpastaError
Define an exception for errors during profile extraction and transformation.
Source code in taxpasta/application/error/standardisation_error.py
message = message
instance-attribute
¶profile = profile
instance-attribute
¶sample = sample
instance-attribute
¶__init__(*, sample: str, profile: Path, message: str, **kwargs) -> None
¶Initialize a taxpasta standardisation error.
Source code in taxpasta/application/error/standardisation_error.py
sample_merging_application
¶
Provide a sample merging application.
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
SampleMergingApplication
¶
Define a sample merging application.
Source code in taxpasta/application/sample_merging_application.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
Attributes¶
reader = profile_reader
instance-attribute
¶standardiser = profile_standardiser
instance-attribute
¶Functions¶
__init__(*, profile_reader: Type[ProfileReader], profile_standardiser: Type[ProfileStandardisationService], **kwargs: dict)
¶Initialize the application for a particular taxonomic profiler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile_reader |
Type[ProfileReader]
|
A profile reader for a specific taxonomic profile format. |
required |
profile_standardiser |
Type[ProfileStandardisationService]
|
A profile standardisation service for a specific taxonomic profile format. |
required |
**kwargs |
dict
|
Passed on for inheritance. |
{}
|
Source code in taxpasta/application/sample_merging_application.py
run(profiles: Iterable[Tuple[str, Path]], wide_format: bool, ignore_error: bool = False) -> DataFrame[WideObservationTable] | DataFrame[TidyObservationTable]
¶Extract and transform profiles into samples, then merge them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profiles |
Iterable[Tuple[str, Path]]
|
Pairs of name and profile path. |
required |
wide_format |
bool
|
Whether to create wide or (tidy) long format output. |
required |
ignore_error |
bool
|
Whether to ignore profiles that contain errors. |
False
|
Returns:
Type | Description |
---|---|
DataFrame[WideObservationTable] | DataFrame[TidyObservationTable]
|
A single table containing all samples in the desired format. |
Raises:
Type | Description |
---|---|
StandardisationError
|
If any of the given profiles does not match the validation schema. # noqa: DAR402 |
Source code in taxpasta/application/sample_merging_application.py
service
¶
Attributes¶
Classes¶
Modules¶
profile_reader
¶
Provide an abstract base class for reading taxonomic profiles.
Attributes¶
Classes¶
ProfileReader
¶
Bases: ABC
Define an abstract base class for reading taxonomic profiles.
Source code in taxpasta/application/service/profile_reader.py
profile_standardisation_service
¶
Provide an abstract base class for a profile standardisation service.
Classes¶
ProfileStandardisationService
¶
Bases: ABC
Define an abstract base class for a profile standardisation service.
Source code in taxpasta/application/service/profile_standardisation_service.py
transform(profile: DataFrame) -> DataFrame[StandardProfile]
abstractmethod
classmethod
¶Tidy up and standardize a given taxonomic profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame
|
The taxonomic profile of a particular tool. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in taxpasta/application/service/profile_standardisation_service.py
standard_profile_writer
¶
Provide an abstract base class for writing a standardized profile.
Attributes¶
Classes¶
StandardProfileWriter
¶
Bases: ABC
Define an abstract base class for writing a standardized profile.
Source code in taxpasta/application/service/standard_profile_writer.py
table_reader
¶
Provide an abstract base class for reading tables.
tidy_observation_table_writer
¶
Provide an abstract base class for writing tidy observation tables.
Attributes¶
Classes¶
TidyObservationTableWriter
¶
Bases: ABC
Define an abstract base class for writing tidy observation tables.
Source code in taxpasta/application/service/tidy_observation_table_writer.py
write(table: DataFrame[TidyObservationTable], target: BufferOrFilepath, taxonomy: Optional[Taxonomy] = None, **kwargs) -> None
abstractmethod
classmethod
¶Write a tidy observation table to the given buffer or file.
Source code in taxpasta/application/service/tidy_observation_table_writer.py
wide_observation_table_writer
¶
Provide an abstract base class for writing observation matrices.
Attributes¶
Classes¶
WideObservationTableWriter
¶
Bases: ABC
Define an abstract base class for writing observation matrices.
Source code in taxpasta/application/service/wide_observation_table_writer.py
write(matrix: DataFrame[WideObservationTable], target: BufferOrFilepath, taxonomy: Optional[Taxonomy] = None, **kwargs) -> None
abstractmethod
classmethod
¶Write an observation matrix to the given buffer or file.