Modules¶
application
¶
Classes¶
Modules¶
application_service_registry
¶
Provide an application service registry.
Classes¶
ApplicationServiceRegistry
¶Define an application service registry.
Source code in src/taxpasta/infrastructure/application/application_service_registry.py
41 42 43 44 45 46 47 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 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
profile_reader(profiler: SupportedProfiler) -> Type[ProfileReader]
classmethod
¶Return a profile reader of the correct type.
Source code in src/taxpasta/infrastructure/application/application_service_registry.py
profile_standardisation_service(profiler: SupportedProfiler) -> Type[ProfileStandardisationService]
classmethod
¶Return a profile standardisation service of the correct type.
Source code in src/taxpasta/infrastructure/application/application_service_registry.py
standard_profile_writer(file_format: StandardProfileFileFormat) -> Type[StandardProfileWriter]
classmethod
¶Return a standard profile writer of the correct type.
Source code in src/taxpasta/infrastructure/application/application_service_registry.py
table_reader(file_format: TableReaderFileFormat) -> Type[TableReader]
classmethod
¶Return a table reader of the correct type.
Source code in src/taxpasta/infrastructure/application/application_service_registry.py
tidy_observation_table_writer(file_format: TidyObservationTableFileFormat) -> Type[TidyObservationTableWriter]
classmethod
¶Return a tidy table writer of the correct type.
Source code in src/taxpasta/infrastructure/application/application_service_registry.py
wide_observation_table_writer(file_format: WideObservationTableFileFormat) -> Type[WideObservationTableWriter]
classmethod
¶Return a writer for wide observation tables in the specified format.
Source code in src/taxpasta/infrastructure/application/application_service_registry.py
bracken
¶
Classes¶
Modules¶
bracken_profile
¶Provide a description of the Bracken profile format.
BrackenProfile
¶
Bases: BaseDataFrameModel
Define the expected Bracken profile format.
Source code in src/taxpasta/infrastructure/application/bracken/bracken_profile.py
added_reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶fraction_total_reads: Series[float] = pa.Field(ge=0.0, le=1.0)
class-attribute
instance-attribute
¶kraken_assigned_reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶name: Series[str] = pa.Field()
class-attribute
instance-attribute
¶new_est_reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶taxonomy_id: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶taxonomy_lvl: Series[str] = pa.Field()
class-attribute
instance-attribute
¶check_added_reads_consistency(profile: DataFrame) -> Series[bool]
¶Check that Bracken added reads are consistent.
Source code in src/taxpasta/infrastructure/application/bracken/bracken_profile.py
check_compositionality(fraction_total_reads: Series[float]) -> bool
¶Check that the fractions of reads add up to one.
Source code in src/taxpasta/infrastructure/application/bracken/bracken_profile.py
bracken_profile_reader
¶Provide a reader for Bracken profiles.
BrackenProfileReader
¶
Bases: ProfileReader
Define a reader for Bracken profiles.
Source code in src/taxpasta/infrastructure/application/bracken/bracken_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[BrackenProfile]
classmethod
¶Read a Bracken taxonomic profile from the given source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
BufferOrFilepath
|
A source that contains a tab-separated taxonomic profile generated by Bracken. |
required |
Returns:
Type | Description |
---|---|
DataFrame[BrackenProfile]
|
A data frame representation of the Bracken profile. |
Source code in src/taxpasta/infrastructure/application/bracken/bracken_profile_reader.py
bracken_profile_standardisation_service
¶Provide a standardisation service for Bracken profiles.
BrackenProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for Bracken profiles.
Source code in src/taxpasta/infrastructure/application/bracken/bracken_profile_standardisation_service.py
transform(profile: DataFrame[BrackenProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given Bracken profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[BrackenProfile]
|
A taxonomic profile generated by Bracken. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Raises:
Type | Description |
---|---|
SchemaErrors
|
If the given profile does not conform with the
|
Source code in src/taxpasta/infrastructure/application/bracken/bracken_profile_standardisation_service.py
centrifuge
¶
Classes¶
Modules¶
centrifuge_profile
¶Provide a description of the centrifuge profile format.
CentrifugeProfile
¶
Bases: BaseDataFrameModel
Define the expected centrifuge profile format.
Source code in src/taxpasta/infrastructure/application/centrifuge/centrifuge_profile.py
clade_assigned_reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶direct_assigned_reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶name: Series[str] = pa.Field()
class-attribute
instance-attribute
¶percent: Series[float] = pa.Field(ge=0.0, le=100.0)
class-attribute
instance-attribute
¶taxonomy_id: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶taxonomy_level: Series[str] = pa.Field()
class-attribute
instance-attribute
¶check_compositionality(percent: Series[float]) -> bool
¶Check that the percent of 'unclassified' and 'root' add up to a hundred.
Source code in src/taxpasta/infrastructure/application/centrifuge/centrifuge_profile.py
centrifuge_profile_reader
¶Provide a reader for Centrifuge profiles.
CentrifugeProfileReader
¶
Bases: ProfileReader
Define a reader for centrifuge profiles.
Source code in src/taxpasta/infrastructure/application/centrifuge/centrifuge_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[CentrifugeProfile]
classmethod
¶Read a centrifuge taxonomic profile from the given source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
BufferOrFilepath
|
A source that contains a tab-separated taxonomic profile generated by centrifuge. |
required |
Returns:
Type | Description |
---|---|
DataFrame[CentrifugeProfile]
|
A data frame representation of the centrifuge profile. |
Source code in src/taxpasta/infrastructure/application/centrifuge/centrifuge_profile_reader.py
centrifuge_profile_standardisation_service
¶Provide a standardisation service for centrifuge profiles.
logger = logging.getLogger(__name__)
module-attribute
¶CentrifugeProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for centrifuge profiles.
Source code in src/taxpasta/infrastructure/application/centrifuge/centrifuge_profile_standardisation_service.py
transform(profile: DataFrame[CentrifugeProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given centrifuge profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[CentrifugeProfile]
|
A taxonomic profile generated by centrifuge. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/centrifuge/centrifuge_profile_standardisation_service.py
diamond
¶
Classes¶
Modules¶
diamond_profile
¶Provide a description of the diamond profile format.
DiamondProfile
¶
Bases: BaseDataFrameModel
Define the expected diamond profile format.
Source code in src/taxpasta/infrastructure/application/diamond/diamond_profile.py
diamond_profile_reader
¶Provide a reader for diamond profiles.
DiamondProfileReader
¶
Bases: ProfileReader
Define a reader for Diamond profiles.
Source code in src/taxpasta/infrastructure/application/diamond/diamond_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[DiamondProfile]
classmethod
¶Read a diamond taxonomic profile from a file.
Source code in src/taxpasta/infrastructure/application/diamond/diamond_profile_reader.py
diamond_profile_standardisation_service
¶Provide a standardisation service for diamond profiles.
DiamondProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for diamond profiles.
Source code in src/taxpasta/infrastructure/application/diamond/diamond_profile_standardisation_service.py
transform(profile: DataFrame[DiamondProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given diamond profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[DiamondProfile]
|
A taxonomic profile generated by diamond. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/diamond/diamond_profile_standardisation_service.py
ganon
¶
Classes¶
Modules¶
ganon_profile
¶Provide a description of the ganon profile format.
GanonProfile
¶
Bases: BaseDataFrameModel
Define the expected ganon profile format.
Source code in src/taxpasta/infrastructure/application/ganon/ganon_profile.py
lineage: Series[str] = pa.Field()
class-attribute
instance-attribute
¶name: Series[str] = pa.Field()
class-attribute
instance-attribute
¶number_children: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶number_cumulative: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶number_shared: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶number_unique: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶percent_cumulative: Series[float] = pa.Field(ge=0.0, le=100.0)
class-attribute
instance-attribute
¶rank: Series[str] = pa.Field()
class-attribute
instance-attribute
¶target: Series[str] = pa.Field()
class-attribute
instance-attribute
¶check_compositionality(profile: pd.DataFrame) -> bool
¶Check that the percent of 'unclassified' and 'root' add up to a hundred.
Source code in src/taxpasta/infrastructure/application/ganon/ganon_profile.py
ganon_profile_reader
¶Provide a reader for ganon profiles.
GanonProfileReader
¶
Bases: ProfileReader
Define a reader for ganon profiles.
Source code in src/taxpasta/infrastructure/application/ganon/ganon_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[GanonProfile]
classmethod
¶Read a ganon taxonomic profile from the given source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
BufferOrFilepath
|
A source that contains a tab-separated taxonomic profile generated by ganon. |
required |
Returns:
Type | Description |
---|---|
DataFrame[GanonProfile]
|
A data frame representation of the ganon profile. |
Source code in src/taxpasta/infrastructure/application/ganon/ganon_profile_reader.py
ganon_profile_standardisation_service
¶Provide a standardisation service for ganon profiles.
logger = logging.getLogger(__name__)
module-attribute
¶GanonProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for ganon profiles.
Source code in src/taxpasta/infrastructure/application/ganon/ganon_profile_standardisation_service.py
transform(profile: DataFrame[GanonProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given ganon profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[GanonProfile]
|
A taxonomic profile generated by ganon. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/ganon/ganon_profile_standardisation_service.py
kaiju
¶
Classes¶
Modules¶
kaiju_profile
¶Provide a description of the kaiju profile format.
KaijuProfile
¶
Bases: BaseDataFrameModel
Define the expected kaiju profile format.
Source code in src/taxpasta/infrastructure/application/kaiju/kaiju_profile.py
file: Series[str] = pa.Field()
class-attribute
instance-attribute
¶percent: Series[float] = pa.Field(ge=0.0, le=100.0)
class-attribute
instance-attribute
¶reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶taxon_id: Series[pd.Int64Dtype] = pa.Field(nullable=True)
class-attribute
instance-attribute
¶taxon_name: Series[str] = pa.Field()
class-attribute
instance-attribute
¶check_compositionality(percent: Series[float]) -> bool
¶Check that the percentages add up to a hundred.
Source code in src/taxpasta/infrastructure/application/kaiju/kaiju_profile.py
check_unique_filename(file_col: Series[str]) -> bool
¶Check that Kaiju filename is unique.
kaiju_profile_reader
¶Provide a reader for kaiju profiles.
KaijuProfileReader
¶
Bases: ProfileReader
Define a reader for kaiju profiles.
Source code in src/taxpasta/infrastructure/application/kaiju/kaiju_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[KaijuProfile]
classmethod
¶Read a kaiju taxonomic profile from the given source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
BufferOrFilepath
|
A source that contains a tab-separated taxonomic profile generated by kaiju. |
required |
Returns:
Type | Description |
---|---|
DataFrame[KaijuProfile]
|
A data frame representation of the kaiju profile. |
Source code in src/taxpasta/infrastructure/application/kaiju/kaiju_profile_reader.py
kaiju_profile_standardisation_service
¶Provide a standardisation service for kaiju profiles.
KaijuProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for kaiju profiles.
Source code in src/taxpasta/infrastructure/application/kaiju/kaiju_profile_standardisation_service.py
transform(profile: DataFrame[KaijuProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given kaiju profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[KaijuProfile]
|
A taxonomic profile generated by kaiju. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/kaiju/kaiju_profile_standardisation_service.py
kmcp
¶
Classes¶
Modules¶
kmcp_profile
¶Provide a description of the KMCP profile format.
KMCPProfile
¶
Bases: BaseDataFrameModel
Define the expected KMCP profile format.
Source code in src/taxpasta/infrastructure/application/kmcp/kmcp_profile.py
chunks_fraction: Series[float] = pa.Field(ge=0.0, le=1.0, alias='chunksFrac')
class-attribute
instance-attribute
¶chunks_relative_depth: Series[str] = pa.Field(alias='chunksRelDepth')
class-attribute
instance-attribute
¶chunks_relative_depth_std: Series[float] = pa.Field(ge=0.0, nullable=True, alias='chunksRelDepthStd')
class-attribute
instance-attribute
¶coverage: Series[float] = pa.Field(ge=0.0, nullable=True)
class-attribute
instance-attribute
¶high_confidence_unique_reads: Series[int] = pa.Field(ge=0, alias='hicureads')
class-attribute
instance-attribute
¶percentage: Series[float] = pa.Field(ge=0.0, le=100.0)
class-attribute
instance-attribute
¶rank: Series[str] = pa.Field(nullable=True)
class-attribute
instance-attribute
¶reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶reference: Series[str] = pa.Field(alias='ref')
class-attribute
instance-attribute
¶reference_name: Series[str] = pa.Field(nullable=True, alias='refname')
class-attribute
instance-attribute
¶reference_size: Series[int] = pa.Field(ge=0, alias='refsize')
class-attribute
instance-attribute
¶score: Series[float] = pa.Field(ge=0.0, le=100.0)
class-attribute
instance-attribute
¶taxid: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶taxonomic_name: Series[str] = pa.Field(nullable=True, alias='taxname')
class-attribute
instance-attribute
¶taxonomic_path: Series[str] = pa.Field(nullable=True, alias='taxpath')
class-attribute
instance-attribute
¶taxonomic_path_lineage: Series[str] = pa.Field(nullable=True, alias='taxpathsn')
class-attribute
instance-attribute
¶unique_reads: Series[int] = pa.Field(ge=0, alias='ureads')
class-attribute
instance-attribute
¶check_compositionality(percentage: Series[float]) -> bool
¶Check that the percentages add up to a hundred.
Source code in src/taxpasta/infrastructure/application/kmcp/kmcp_profile.py
kmcp_profile_reader
¶Provide a reader for KMCP profiles.
KMCPProfileReader
¶
Bases: ProfileReader
Define a reader for KMCP profiles.
Source code in src/taxpasta/infrastructure/application/kmcp/kmcp_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[KMCPProfile]
classmethod
¶Read a KMCP taxonomic profile from the given source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
BufferOrFilepath
|
A source that contains a tab-separated taxonomic profile generated by KMCP. |
required |
Returns:
Type | Description |
---|---|
DataFrame[KMCPProfile]
|
A data frame representation of the KMCP profile. |
Source code in src/taxpasta/infrastructure/application/kmcp/kmcp_profile_reader.py
kmcp_profile_standardisation_service
¶Provide a standardisation service for KMCP profiles.
logger = logging.getLogger(__name__)
module-attribute
¶KMCPProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for KMCP profiles.
Source code in src/taxpasta/infrastructure/application/kmcp/kmcp_profile_standardisation_service.py
transform(profile: DataFrame[KMCPProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given KMCP profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[KMCPProfile]
|
A taxonomic profile generated by KMCP. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/kmcp/kmcp_profile_standardisation_service.py
kraken2
¶
Classes¶
Modules¶
kraken2_profile
¶Provide a description of the kraken2 profile format.
Kraken2Profile
¶
Bases: BaseDataFrameModel
Define the expected kraken2 profile format.
Source code in src/taxpasta/infrastructure/application/kraken2/kraken2_profile.py
clade_assigned_reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶direct_assigned_reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶distinct_minimizers: Optional[Series[int]] = pa.Field(ge=0)
class-attribute
instance-attribute
¶name: Series[str] = pa.Field()
class-attribute
instance-attribute
¶num_minimizers: Optional[Series[int]] = pa.Field(ge=0)
class-attribute
instance-attribute
¶percent: Series[float] = pa.Field(ge=0.0, le=100.0)
class-attribute
instance-attribute
¶taxonomy_id: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶taxonomy_lvl: Series[str] = pa.Field()
class-attribute
instance-attribute
¶check_compositionality(profile: pd.DataFrame) -> bool
¶Check that the percent of 'unclassified' and 'root' add up to a hundred.
Source code in src/taxpasta/infrastructure/application/kraken2/kraken2_profile.py
kraken2_profile_reader
¶Provide a reader for kraken2 profiles.
Kraken2ProfileReader
¶
Bases: ProfileReader
Define a reader for kraken2 profiles.
Source code in src/taxpasta/infrastructure/application/kraken2/kraken2_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[Kraken2Profile]
classmethod
¶Read a kraken2 taxonomic profile from the given source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
BufferOrFilepath
|
A source that contains a tab-separated taxonomic profile generated by kraken2. |
required |
Returns:
Type | Description |
---|---|
DataFrame[Kraken2Profile]
|
A data frame representation of the kraken2 profile. |
Raises:
Type | Description |
---|---|
ValueError
|
In case the table does not contain exactly six or eight columns. |
Source code in src/taxpasta/infrastructure/application/kraken2/kraken2_profile_reader.py
kraken2_profile_standardisation_service
¶Provide a standardisation service for kraken2 profiles.
Kraken2ProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for kraken2 profiles.
Source code in src/taxpasta/infrastructure/application/kraken2/kraken2_profile_standardisation_service.py
transform(profile: DataFrame[Kraken2Profile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given kraken2 profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[Kraken2Profile]
|
A taxonomic profile generated by kraken2. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/kraken2/kraken2_profile_standardisation_service.py
krakenuniq
¶
Classes¶
Modules¶
krakenuniq_profile
¶Provide a description of the KrakenUniq profile format.
KrakenUniqProfile
¶
Bases: BaseDataFrameModel
Define the expected KrakenUniq profile format.
Source code in src/taxpasta/infrastructure/application/krakenuniq/krakenuniq_profile.py
coverage: Series[float] = pa.Field(ge=0.0, nullable=True, alias='cov')
class-attribute
instance-attribute
¶duplicates: Series[float] = pa.Field(ge=0.0, alias='dup')
class-attribute
instance-attribute
¶kmers: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶percent: Series[float] = pa.Field(ge=0.0, le=100.0, alias='%')
class-attribute
instance-attribute
¶rank: Series[str] = pa.Field()
class-attribute
instance-attribute
¶reads: Series[int] = pa.Field(ge=0)
class-attribute
instance-attribute
¶tax_id: Series[int] = pa.Field(alias='taxID', ge=0)
class-attribute
instance-attribute
¶tax_name: Series[str] = pa.Field(alias='taxName')
class-attribute
instance-attribute
¶tax_reads: Series[int] = pa.Field(ge=0, alias='taxReads')
class-attribute
instance-attribute
¶krakenuniq_profile_reader
¶Provide a reader for KrakenUniq profiles.
KrakenUniqProfileReader
¶
Bases: ProfileReader
Define a reader for KrakenUniq profiles.
Source code in src/taxpasta/infrastructure/application/krakenuniq/krakenuniq_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[KrakenUniqProfile]
classmethod
¶Read a krakenUniq taxonomic profile from the given source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
BufferOrFilepath
|
A source that contains a tab-separated taxonomic profile generated by KrakenUniq. |
required |
Returns:
Type | Description |
---|---|
DataFrame[KrakenUniqProfile]
|
A data frame representation of the KrakenUniq profile. |
Source code in src/taxpasta/infrastructure/application/krakenuniq/krakenuniq_profile_reader.py
krakenuniq_profile_standardisation_service
¶Provide a standardisation service for KrakenUniq profiles.
KrakenUniqProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for krakenUniq profiles.
Source code in src/taxpasta/infrastructure/application/krakenuniq/krakenuniq_profile_standardisation_service.py
transform(profile: DataFrame[KrakenUniqProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given krakenUniq profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[KrakenUniqProfile]
|
A taxonomic profile generated by KrakenUniq. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/krakenuniq/krakenuniq_profile_standardisation_service.py
megan6
¶
Classes¶
Modules¶
megan6_profile
¶Provide a description of the MEGAN6 rma2info profile format.
Megan6Profile
¶
Bases: BaseDataFrameModel
Define the expected MEGAN6 rma2info profile format.
Source code in src/taxpasta/infrastructure/application/megan6/megan6_profile.py
megan6_profile_reader
¶Provide a reader for megan6 profiles.
Megan6ProfileReader
¶
Bases: ProfileReader
Define a reader for MEGAN6 rma2info profiles.
Source code in src/taxpasta/infrastructure/application/megan6/megan6_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[Megan6Profile]
classmethod
¶Read a MEGAN6 rma2info taxonomic profile from a file.
Source code in src/taxpasta/infrastructure/application/megan6/megan6_profile_reader.py
megan6_profile_standardisation_service
¶Provide a standardisation service for megan6 profiles.
Megan6ProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for megan6 profiles.
Source code in src/taxpasta/infrastructure/application/megan6/megan6_profile_standardisation_service.py
transform(profile: DataFrame[Megan6Profile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given MEGAN6 rma2info profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[Megan6Profile]
|
A taxonomic profile generated by MEGAN6 rma2info. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/megan6/megan6_profile_standardisation_service.py
metaphlan
¶
Classes¶
Modules¶
metaphlan_profile
¶Provide a description of the metaphlan profile format.
MetaphlanProfile
¶
Bases: BaseDataFrameModel
Define the expected metaphlan profile format.
Source code in src/taxpasta/infrastructure/application/metaphlan/metaphlan_profile.py
additional_species: Optional[Series[str]] = pa.Field(nullable=True)
class-attribute
instance-attribute
¶clade_name: Series[str] = pa.Field()
class-attribute
instance-attribute
¶ncbi_tax_id: Series[str] = pa.Field(alias='NCBI_tax_id')
class-attribute
instance-attribute
¶relative_abundance: Series[float] = pa.Field(ge=0.0, le=100.0)
class-attribute
instance-attribute
¶check_compositionality(profile: pd.DataFrame) -> bool
¶Check that the percentages per rank add up to a hundred.
Source code in src/taxpasta/infrastructure/application/metaphlan/metaphlan_profile.py
metaphlan_profile_reader
¶Provide a reader for metaphlan profiles.
MetaphlanProfileReader
¶
Bases: ProfileReader
Define a reader for Metaphlan profiles.
Source code in src/taxpasta/infrastructure/application/metaphlan/metaphlan_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[MetaphlanProfile]
classmethod
¶Read a metaphlan taxonomic profile from a file.
Source code in src/taxpasta/infrastructure/application/metaphlan/metaphlan_profile_reader.py
metaphlan_profile_standardisation_service
¶Provide a standardisation service for metaphlan profiles.
logger = logging.getLogger(__name__)
module-attribute
¶MetaphlanProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for metaphlan profiles.
Source code in src/taxpasta/infrastructure/application/metaphlan/metaphlan_profile_standardisation_service.py
LARGE_INTEGER = 1000000
class-attribute
instance-attribute
¶transform(profile: DataFrame[MetaphlanProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given metaphlan profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[MetaphlanProfile]
|
A taxonomic profile generated by metaphlan. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/metaphlan/metaphlan_profile_standardisation_service.py
motus
¶
Classes¶
Modules¶
motus_profile
¶Provide a description of the mOTUs profile format.
MotusProfile
¶
Bases: BaseDataFrameModel
Define the expected mOTUs profile format.
Source code in src/taxpasta/infrastructure/application/motus/motus_profile.py
motus_profile_reader
¶Provide a reader for motus profiles.
MotusProfileReader
¶
Bases: ProfileReader
Define a reader for mOTUS profiles.
Source code in src/taxpasta/infrastructure/application/motus/motus_profile_reader.py
read(profile: BufferOrFilepath) -> DataFrame[MotusProfile]
classmethod
¶Read a mOTUs taxonomic profile from a file.
Source code in src/taxpasta/infrastructure/application/motus/motus_profile_reader.py
motus_profile_standardisation_service
¶Provide a standardisation service for mOTUs profiles.
MotusProfileStandardisationService
¶
Bases: ProfileStandardisationService
Define a standardisation service for mOTUs profiles.
Source code in src/taxpasta/infrastructure/application/motus/motus_profile_standardisation_service.py
transform(profile: DataFrame[MotusProfile]) -> DataFrame[StandardProfile]
classmethod
¶Tidy up and standardize a given mOTUs profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
DataFrame[MotusProfile]
|
A taxonomic profile generated by mOTUs. |
required |
Returns:
Type | Description |
---|---|
DataFrame[StandardProfile]
|
A standardized profile. |
Source code in src/taxpasta/infrastructure/application/motus/motus_profile_standardisation_service.py
sample_sheet
¶
Provide a description of samples and profile locations.
Classes¶
SampleSheet
¶
Bases: DataFrameModel
Define a description of samples and profile locations.
Source code in src/taxpasta/infrastructure/application/sample_sheet.py
profile: Series[str] = pa.Field()
class-attribute
instance-attribute
¶sample: Series[str] = pa.Field()
class-attribute
instance-attribute
¶Config
¶Configure the schema model.
Source code in src/taxpasta/infrastructure/application/sample_sheet.py
check_number_samples(table: DataFrame) -> bool
classmethod
¶Check that there are at least two samples.
Source code in src/taxpasta/infrastructure/application/sample_sheet.py
check_profile_presence(profile: Series[str]) -> Series[bool]
classmethod
¶Check that every profile is present at the specified location.
Source code in src/taxpasta/infrastructure/application/sample_sheet.py
standard_profile_file_format
¶
Provide a service for supported tabular file formats.
Classes¶
StandardProfileFileFormat
¶
Bases: str
, DependencyCheckMixin
, Enum
Define the supported standardized profile file formats.
Source code in src/taxpasta/infrastructure/application/standard_profile_file_format.py
CSV = 'CSV'
class-attribute
instance-attribute
¶ODS = 'ODS'
class-attribute
instance-attribute
¶TSV = 'TSV'
class-attribute
instance-attribute
¶XLSX = 'XLSX'
class-attribute
instance-attribute
¶arrow = 'arrow'
class-attribute
instance-attribute
¶parquet = 'parquet'
class-attribute
instance-attribute
¶
standard_profile_writer
¶
Modules¶
arrow_standard_profile_writer
¶Provide an arrow writer.
ArrowStandardProfileWriter
¶
Bases: StandardProfileWriter
Define the arrow writer.
Source code in src/taxpasta/infrastructure/application/standard_profile_writer/arrow_standard_profile_writer.py
csv_standard_profile_writer
¶Provide a CSV writer.
CSVStandardProfileWriter
¶
Bases: StandardProfileWriter
Define the CSV writer.
Source code in src/taxpasta/infrastructure/application/standard_profile_writer/csv_standard_profile_writer.py
ods_standard_profile_writer
¶Provide an ODS writer.
ODSStandardProfileWriter
¶
Bases: StandardProfileWriter
Define the ODS writer.
Source code in src/taxpasta/infrastructure/application/standard_profile_writer/ods_standard_profile_writer.py
parquet_standard_profile_writer
¶Provide an parquet writer.
ParquetStandardProfileWriter
¶
Bases: StandardProfileWriter
Define the parquet writer.