mutcleaner.cleaners#

Dataset-specific cleaning pipelines for MutCleaner.

class mutcleaner.cleaners.AntitoxinParD3CleanerConfig(pipeline_name='Antitoxin Pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, validate_mut_workers=16, process_workers=16, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for Antitoxin dataset cleaner. Inherits from BaseCleanerConfig and adds Antitoxin-specific configuration options.

Simply run mutcleaner.download_antitoxin_source_file() to download the dataset.

Alternatively, the raw Antitoxin file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for data cleaning

wt_sequencestr

Wildtype sequence for the dataset, used for mutation validation

type_conversionsDict[str, str]

Data type conversion specifications

validate_mut_workersint

Number of workers for mutation validation, set to -1 to use all available CPUs

process_workersint

Number of workers for applying mutations to sequences, set to -1 to use all available CPUs

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

pipeline_namestr

Name of the cleaning pipeline

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate Antitoxin-specific configuration parameters

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
pipeline_name: str = 'Antitoxin Pipeline'#
primary_label_column: str = 'label'#
process_workers: int = 16#
type_conversions: Dict[str, str]#
validate()[source]#

Validate Antitoxin-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

validate_mut_workers: int = 16#
wt_sequence = 'MANVEKMSVAVTPQQAAVMREAVEAGEYATASEIVREAVRDWLAKRELRHDDIRRLRQLWDEGKASGRPEPVDFDALRKEARQKLTEVPPNGR'#
class mutcleaner.cleaners.ArchStabMS1E10CleanerSup4Config(pipeline_name='archstabms1e10_cleaner', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, label_columns=<factory>, primary_label_column='fitness')[source]#

Bases: BaseCleanerConfig

Configuration class for ArchStabMS1E10 dataset cleaner. Inherits from BaseCleanerConfig and adds ArchStabMS1E10-specific configuration options.

Simply run mutcleaner.download_archstabms1e10_source_file() to download the dataset.

Alternatively, the raw archstabms1e10 file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for ndata cleaning

type_conversionsDict[str, str]

Data type conversion specifications

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate ArchStabMS1E10CleanerConfig

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
pipeline_name: str = 'archstabms1e10_cleaner'#
primary_label_column: str = 'fitness'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate ArchStabMS1E10CleanerConfig

Raises:

ValueError – If configuration is invalid

Return type:

None

class mutcleaner.cleaners.ArchStabMS1E10CleanerSup5Config(pipeline_name='archstabms1e10_sup5_cleaner pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, library_sequences=<factory>, type_conversions=<factory>, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for ArchStabMS1E10 dataset cleaner. Inherits from BaseCleanerConfig and adds ArchStabMS1E10-specific configuration options.

Simply run mutcleaner.download_archstabms1e10_source_file() to download the dataset.

Alternatively, the raw archstabms1e10 file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for ndata cleaning

type_conversionsDict[str, str]

Data type conversion specifications

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate ArchStabMS1E10CleanerConfig

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
library_sequences: Dict[int, str]#
pipeline_name: str = 'archstabms1e10_sup5_cleaner pipeline'#
primary_label_column: str = 'label'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate ArchStabMS1E10CleanerConfig

Raises:

ValueError – If configuration is invalid

Return type:

None

class mutcleaner.cleaners.CDNAProteolysisCleanerConfig(pipeline_name='cDNAProteolysis Pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, validate_mut_workers=16, validate_wt_workers=16, label_columns=<factory>, primary_label_column='label_cDNAProteolysis')[source]#

Bases: BaseCleanerConfig

Configuration class for cDNAProteolysis dataset cleaner. Inherits from BaseCleanerConfig and adds cDNAProteolysis-specific configuration options.

Simply run mutcleaner.download_cdna_proteolysis_source_file() to download the dataset.

Alternatively, the raw cDNAProteolysis file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for data cleaning

type_conversionsDict[str, str]

Data type conversion specifications

validate_mut_workersint

Number of workers for mutation validation, set to -1 to use all available CPUs

validate_wt_workersint

Number of workers for wildtype sequence validation, set to -1 to use all available CPUs

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate cDNAProteolysis-specific configuration parameters

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
pipeline_name: str = 'cDNAProteolysis Pipeline'#
primary_label_column: str = 'label_cDNAProteolysis'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate cDNAProteolysis-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

validate_mut_workers: int = 16#
validate_wt_workers: int = 16#
class mutcleaner.cleaners.CTXMCleanerConfig(pipeline_name='CTXM Cleaning Pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, process_workers=16, validate_mut_workers=16, label_columns=<factory>, ambler_to_seq_mapping=<factory>, wt_name='CTXM_ampicillin', primary_label_column='fitness')[source]#

Bases: BaseCleanerConfig

Configuration class for CTXM dataset cleaner. Inherits from BaseCleanerConfig and adds CTXM-specific configuration options.

Simply run mutcleaner.download_ctxm_source_file() to download the dataset.

Alternatively, the raw CTXM file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for data cleaning

type_conversionsDict[str, str]

Data type conversion specifications

validate_mut_workersint

Number of workers for mutation validation, set to -1 to use all available CPUs

validate_wt_workersint

Number of workers for wildtype sequence validation, set to -1 to use all available CPUs

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate CTXM-specific configuration parameters

ambler_to_seq_mapping: Dict[str, str]#
column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
pipeline_name: str = 'CTXM Cleaning Pipeline'#
primary_label_column: str = 'fitness'#
process_workers: int = 16#
type_conversions: Dict[str, str]#
validate()[source]#

Validate CTXM-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

validate_mut_workers: int = 16#
wt_name: str = 'CTXM_ampicillin'#
wt_sequence = 'RMMFAAAACIPLLLGSAPLYAQTSAVQQKLAALEKSSGGRLGVALIDTADNTQVLYRGDERFPMCSTSKVMAAAAVLKQSETQKQLLNQPVEIKPADLVNYNPIAEKHVNGTMTLAELSAAALQYSDNTAMNKLIAQLGGPGGVTAFARAIGDETFRLDRTEPTLNTAIPGDPRDTTTPRAMAQTLRQLTLGHALGETQRAQLVTWLKGNTTGAASIRAGLPTSWTVGDKTGSGDYGTTNDIAVIWPQGRAPLVLVTYFTQPQQNAESRRDVLASAARIIAEGL'#
class mutcleaner.cleaners.ChitosanasedTmCleanerConfig(pipeline_name='Chitosanase_dTm', num_workers=16, validate_config=True, infer_mut_workers=16, wt_separator='">wt', column_mapping=<factory>, columns_to_add=<factory>)[source]#

Bases: BaseCleanerConfig

Configuration for the Chitosanase_dTm cleaning pipeline.

Holds dataset-specific defaults for the Chitosanase pipeline. The pipeline expects each raw input file to contain a CSV block followed by a WT sequence separated by wt_separator.

Attributes:
infer_mut_workersint

Number of workers used when inferring/applying mutations (default 16).

pipeline_namestr

Human-readable pipeline name used in logs and artifacts.

wt_separatorstr

Token that separates CSV block and WT sequence in raw files.

column_mappingDict[str, str]

Mapping from raw Chitosanase columns to pipeline column names.

columns_to_addDict[str, Any]

Constant columns to attach during preprocessing.

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate the configuration

column_mapping: dict[str, str]#
columns_to_add: dict[str, Any]#
infer_mut_workers: int = 16#
pipeline_name: str = 'Chitosanase_dTm'#
validate()[source]#

Validate the configuration

This method should be implemented by subclasses to perform specific validation logic.

Raises:

ValueError – If configuration is invalid

Return type:

None

wt_separator: str = '">wt'#
class mutcleaner.cleaners.CodoncDNAProteolysisCleanerConfig(num_workers=16, validate_config=True, *, pipeline_name='Codon cDNAProteolysis Pipeline', sequence_source, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, validate_mut_workers=16, validate_wt_workers=16, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for cDNAProteolysis dataset cleaner. Inherits from BaseCleanerConfig and adds cDNAProteolysis-specific configuration options.

Simply run mutcleaner.download_cdna_proteolysis_source_file() to download the dataset.

Alternatively, the raw cDNAProteolysis file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for data cleaning

type_conversionsDict[str, str]

Data type conversion specifications

validate_mut_workersint

Number of workers for mutation validation, set to -1 to use all available CPUs

validate_wt_workersint

Number of workers for wildtype sequence validation, set to -1 to use all available CPUs

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate cDNAProteolysis-specific configuration parameters

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
pipeline_name: str = 'Codon cDNAProteolysis Pipeline'#
primary_label_column: str = 'label'#
sequence_source: Dict[str, str] | str | Path#
type_conversions: Dict[str, str]#
validate()[source]#

Validate cDNAProteolysis-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

validate_mut_workers: int = 16#
validate_wt_workers: int = 16#
class mutcleaner.cleaners.DdgDtmCleanerConfig(pipeline_name='ddG-dTm', num_workers=16, validate_config=True, column_mapping=<factory>, type_conversions=<factory>, infer_mut_workers=16, aggregation_strategy='nearest', nearest_by=<factory>, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for ddG-dTm dataset cleaner. Inherits from BaseCleanerConfig and adds ddG-dTm-specific configuration options.

Simply run mutcleaner.download_ddg_dtm_source_file() to download the dataset.

Alternatively, the raw ddG-dTm files can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

type_conversionsDict[str, str]

Data type conversion specifications

infer_mut_workersint

Number of workers for mutation inference, set to -1 to use all available CPUs

aggregation_strategyLiteral[“mean”, “first”, “nearest”]

Aggregate labels by name, see aggregate_labels_by_name for details

nearest_byList[Tuple[str, float]]

Keep mutation by distance, see aggregate_labels_by_name for details

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate ddG-dTm-specific configuration parameters

aggregation_strategy: Literal['mean', 'first', 'nearest'] = 'nearest'#
column_mapping: Dict[str, str]#
infer_mut_workers: int = 16#
label_columns: List[str]#
nearest_by: List[Tuple[str, float]]#
pipeline_name: str = 'ddG-dTm'#
primary_label_column: str = 'label'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate ddG-dTm-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

class mutcleaner.cleaners.HumanDomainomeSup2CleanerConfig(num_workers=16, validate_config=True, *, pipeline_name='human_domainome_cleaner', column_mapping=<factory>, filters=<factory>, drop_na_columns=<factory>, type_conversions=<factory>, validation_workers=16, infer_wt_workers=16, handle_multiple_wt='error', label_columns=<factory>, primary_label_column='label_humanDomainome')[source]#

Bases: BaseCleanerConfig

Configuration class for HumanDomainome dataset cleaner - SupplementaryTable2. Inherits from BaseCleanerConfig and adds HumanDomainome-specific configuration options.

Simply run mutcleaner.download_human_domainome_source_file() to download the dataset.

Alternatively, the raw HumanDomainome file and the wild type fasta file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for data cleaning

type_conversionsDict[str, str]

Data type conversion specifications

drop_na_columns: List[str]

List of column names where null values should be dropped

validation_workersint

Number of workers for mutations validation, set to -1 to use all available CPUs

infer_wt_workersint

Number of workers for wildtype sequences inference, set to -1 to use all available CPUs

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate HumanDomainome-specific configuration parameters

column_mapping: Dict[str, str]#
drop_na_columns: List#
filters: Dict[str, Callable]#
handle_multiple_wt: Literal['error', 'first', 'separate'] = 'error'#
infer_wt_workers: int = 16#
label_columns: List[str]#
pipeline_name: str = 'human_domainome_cleaner'#
primary_label_column: str = 'label_humanDomainome'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate HumanDomainome-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

validation_workers: int = 16#
class mutcleaner.cleaners.HumanDomainomeSup4CleanerConfig(num_workers=16, validate_config=True, *, pipeline_name='human_domainome_cleaner', sequence_source, header_parser=<function parse_uniprot_header>, column_mapping=<factory>, type_conversions=<factory>, drop_na_columns=<factory>, is_zero_based=False, process_workers=16, label_columns=<factory>, primary_label_column='label_humanDomainome')[source]#

Bases: BaseCleanerConfig

Configuration class for HumanDomainome dataset cleaner - SupplementaryTable4. Inherits from BaseCleanerConfig and adds HumanDomainome-specific configuration options.

Simply run mutcleaner.download_human_domainome_source_file() to download the dataset.

Attributes:
sequence_sourceUnion[str, Path]

Path to the file containing UniProt ID to sequence mapping

header_parserCallable[[str], Tuple[str, Dict[str, str]]]

Parse UniProt FASTA header to extract ID and metadata

column_mappingDict[str, str]

Mapping from source to target column names

type_conversionsDict[str, str]

Data type conversion specifications

drop_na_columns: List[str]

List of column names where null values should be dropped

is_zero_basedbool

Whether mutation positions are zero-based

process_workersint

Number of workers for parallel processing

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

header_parser()

Parse UniProt FASTA header to extract ID and metadata

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate HumanDomainome-specific configuration parameters

column_mapping: Dict[str, str]#
drop_na_columns: List#
header_parser()#

Parse UniProt FASTA header to extract ID and metadata

Parameters:

header (str) – FASTA header line (without ‘>’)

Return type:

Tuple[str, Dict[str, str]]

Returns:

(sequence_id, metadata_dict)

Examples

>>> parse_uniprot_header("sp|P12345|PROT_HUMAN Protein description OS=Homo sapiens")
('P12345', {'db': 'sp', 'entry_name': 'PROT_HUMAN', 'description': 'Protein description OS=Homo sapiens'})
>>> parse_uniprot_header("P12345|PROT_HUMAN Description")
('P12345', {'entry_name': 'PROT_HUMAN', 'description': 'Description'})
>>> parse_uniprot_header("P12345")
('P12345', {})
is_zero_based: bool = False#
label_columns: List[str]#
pipeline_name: str = 'human_domainome_cleaner'#
primary_label_column: str = 'label_humanDomainome'#
process_workers: int = 16#
sequence_source: str | Path#
type_conversions: Dict[str, str]#
validate()[source]#

Validate HumanDomainome-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

class mutcleaner.cleaners.HumanMyoglobinCleanerConfig(pipeline_name='hMb Cleaning Pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, validate_mut_workers=16, process_workers=16, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for human Myoglobin dataset cleaner. Inherits from BaseCleanerConfig and adds hMb-specific configuration options.

Simply run mutcleaner.download_hMb_source_file() to download the dataset.

Alternatively, the raw hMb file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Callable]

Filter conditions for data cleaning

type_conversionsDict[str, str]

Data type conversion specifications

validate_mut_workersint

Number of workers for mutation validation, set to -1 to use all available CPUs

process_workersint

Number of workers for parallel processing

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate hMb-specific configuration parameters

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
pipeline_name: str = 'hMb Cleaning Pipeline'#
primary_label_column: str = 'label'#
process_workers: int = 16#
type_conversions: Dict[str, str]#
validate()[source]#

Validate hMb-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

validate_mut_workers: int = 16#
wt_sequence = 'MGLSDGEWQLVLNVWGKVEADIPGHGQEVLIRLFKGHPETLEKFDKFKHLKSEDEMKASEDLKKHGATVLTALGGILKKKGHHEAEIKPLAQSHATKHKIPVKYLEFISECIIQVLQSKHPGDFGADAQGAMNKALELFRKDMASNYKELGFQG'#
class mutcleaner.cleaners.MGnifyddGCleanerConfig(pipeline_name='MGnify-ddG', num_workers=16, validate_config=True, column_mapping=<factory>, type_conversions=<factory>, infer_mut_workers=16, aggregation_strategy='mean', nearest_by=<factory>, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for MGnify protein stability dataset cleaner. Inherits from BaseCleanerConfig and adds MGnify-specific configuration options.

This configuration is specifically optimized for the MGnify cluster-subset schema which pre-calculates ddG values from sequence pairs without extra environmental columns (such as pH or temperature).

Attributes:
column_mappingDict[str, str]

Mapping from source columns to MutCleaner standard columns. Default targets are: ‘WT_name’ -> ‘name’, ‘wt_seq’ -> ‘wt_seq’, ‘mut_seq’ -> ‘mut_seq’, ‘ddG’ -> ‘label’.

type_conversionsDict[str, str]

Data type conversion specifications. Default forces ‘label’ to ‘float32’.

infer_mut_workersint

Number of parallel workers used for mutation inference. Set to -1 to use all CPUs.

aggregation_strategyLiteral[“mean”, “first”, “nearest”]

Strategy to aggregate labels sharing identical mutation keys. Defaults to “mean”.

nearest_byList[Tuple[str, float]]

Keep mutation by distance metrics. Unused for pure computational subsets.

label_columnsList[str]

List of score/label columns to process.

primary_label_columnstr

Primary score column for the dataset package.

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate MGnify-specific configuration parameters.

aggregation_strategy: Literal['mean', 'first', 'nearest'] = 'mean'#
column_mapping: Dict[str, str]#
infer_mut_workers: int = 16#
label_columns: List[str]#
nearest_by: List[Tuple[str, float]]#
pipeline_name: str = 'MGnify-ddG'#
primary_label_column: str = 'label'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate MGnify-specific configuration parameters.

Raises:

ValueError – If label columns are misconfigured or required mappings are missing.

Return type:

None

class mutcleaner.cleaners.ProteinGymCleanerConfig(pipeline_name='ProteinGym Pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, validation_workers=16, infer_wt_workers=16, handle_multiple_wt='error', label_columns=<factory>, primary_label_column='DMS_score')[source]#

Bases: BaseCleanerConfig

Configuration class for ProteinGym dataset cleaner. Inherits from BaseCleanerConfig and adds ProteinGym-specific configuration options.

Simply run mutcleaner.download_protein_gym_source_file() to download the dataset.

Alternatively, the raw ProteinGym file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Any]

Filter conditions for data cleaning

type_conversionsDict[str, str]

Data type conversion specifications

is_zero_basedbool

Whether mutation positions are zero-based

validation_workersint

Number of workers for mutation validation

infer_wt_workersint

Number of workers for wildtype sequence inference

handle_multiple_wtLiteral[“error”, “first”, “separate”]

Strategy for handling multiple wildtype sequences

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate ProteinGym-specific configuration parameters

column_mapping: Dict[str, str]#
filters: Dict[str, Any]#
handle_multiple_wt: Literal['error', 'first', 'separate'] = 'error'#
infer_wt_workers: int = 16#
label_columns: List[str]#
pipeline_name: str = 'ProteinGym Pipeline'#
primary_label_column: str = 'DMS_score'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate ProteinGym-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

validation_workers: int = 16#
class mutcleaner.cleaners.RBDACE2CleanerConfig(pipeline_name='RBDACE2 pipeline', num_workers=16, validate_config=True, reference_sequences=<factory>, target_name_aliases=<factory>, column_mapping=<factory>, drop_na_columns=<factory>, type_conversions=<factory>, validate_mut_workers=16, process_workers=16, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration for the RBD ACE2 cleaner.

Attributes:
reference_sequencesDict[str, str]

Canonical RBD target reference sequences.

target_name_aliasesDict[str, str]

RBD target alias-to-canonical-name mapping.

column_mappingDict[str, str]

Mapping from raw source column names to the standardized column names consumed by the RBD ACE2 cleaner.

validate_mut_workersint

Worker count for mutation validation.

process_workersint

Worker count for sequence materialization.

label_columnsList[str]

Label columns retained through the pipeline.

primary_label_columnstr

Label column written into the final MutationDataset.

pipeline_namestr

Pipeline name.

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate RBD ACE2 cleaner configuration values.

column_mapping: Dict[str, str]#
drop_na_columns: List[str]#
label_columns: List[str]#
pipeline_name: str = 'RBDACE2 pipeline'#
primary_label_column: str = 'label'#
process_workers: int = 16#
reference_sequences: Dict[str, str]#
target_name_aliases: Dict[str, str]#
type_conversions: Dict[str, str]#
validate()[source]#

Validate RBD ACE2 cleaner configuration values.

Raises:

ValueError – If the configuration is internally inconsistent.

Return type:

None

validate_mut_workers: int = 16#
class mutcleaner.cleaners.RBDAntibodyCleanerConfig(pipeline_name='RBDAntibody pipeline', num_workers=16, validate_config=True, reference_sequences=<factory>, target_name_aliases=<factory>, column_mapping=<factory>, filters=<factory>, drop_na_columns=<factory>, type_conversions=<factory>, fallback_reference_sequence=None, require_known_reference_sequence=True, validate_mut_workers=16, process_workers=16, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration for the RBD antibody cleaner.

Attributes:
reference_sequencesDict[str, str]

Canonical RBD reference sequences keyed by target/reference name.

target_name_aliasesDict[str, str]

RBD target alias-to-canonical-name mapping.

column_mappingDict[str, str]

Mapping from raw source column names to standardized column names consumed by the RBD antibody cleaner.

filtersDict[str, Any]

Filter conditions applied before mutation processing.

drop_na_columnsList[str]

Columns that must be present after filtering.

type_conversionsDict[str, str]

Data type conversion specifications for label columns.

fallback_reference_sequenceOptional[str]

Reference sequence used when a row has an unknown reference name.

require_known_reference_sequencebool

Whether reference names must be found in reference_sequences.

validate_mut_workersint

Worker count for mutation validation.

process_workersint

Worker count for sequence materialization.

label_columnsList[str]

Label columns retained through the pipeline.

primary_label_columnstr

Label column written into the final MutationDataset.

pipeline_namestr

Pipeline name.

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate the configuration

column_mapping: Dict[str, str]#
drop_na_columns: List[str]#
fallback_reference_sequence: str | None = None#
filters: Dict[str, Any]#
label_columns: List[str]#
pipeline_name: str = 'RBDAntibody pipeline'#
primary_label_column: str = 'label'#
process_workers: int = 16#
reference_sequences: Dict[str, str]#
require_known_reference_sequence: bool = True#
target_name_aliases: Dict[str, str]#
type_conversions: Dict[str, str]#
validate()[source]#

Validate the configuration

This method should be implemented by subclasses to perform specific validation logic.

Raises:

ValueError – If configuration is invalid

Return type:

None

validate_mut_workers: int = 16#
class mutcleaner.cleaners.TrpBCleanerConfig(pipeline_name='TrpB Cleaning Pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, wt_sequence='MKGYFGPYGGQYVPEILMGALEELEAAYEGIMKDESFWKEFNDLLRDYAGRPTPLYFARRLSEKYGARVYLKREDLLHTGAHKINNAIGQVLLAKLMGKTRIIAETGAGQHGVATATAAALFGMECVIYMGEEDTIRQKLNVERMKLLGAKVVPVKSGSRTLKDAIDEALRDWITNLQTTYYVFGSVVGPHPYPIIVRNFQKVIGEETKKQIPEKEGRLPDYIVACVSGGSNAAGIFYPFIDSGVKLIGVEAGGEGLETGKHAASLLKGKIGYLHGSKTFVLQDDWGQVQVSHSVSAGLDYSGVGPEHAYWRETGKVLYDAVTDEEALDAFIELSRLEGIIPALESSHALAYLKKINIKGKVVVVNLSGRGDKDLESVLNHPYVRERIRLEHHHHHH', label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for TrpB dataset cleaner. Inherits from BaseCleanerConfig and adds TrpB-specific configuration options. Simply run mutcleaner.download_trpb_source_file() to download the dataset.

Alternatively, the raw TrpB file can be obtained from:

Attributes:
column_mappingDict[str, str]

Mapping from source to target column names

filtersDict[str, Any]

Filter conditions for data cleaning

type_conversionsDict[str, str]

Data type conversion specifications

is_zero_basedbool

Whether mutation positions are zero-based

validation_workersint

Number of workers for mutation validation

infer_wt_workersint

Number of workers for wildtype sequence inference

handle_multiple_wtLiteral[“error”, “first”, “separate”]

Strategy for handling multiple wildtype sequences

label_columnsList[str]

List of score columns to process

primary_label_columnstr

Primary score column for the dataset

Methods

from_dict(config_dict)

Create configuration object from dictionary

from_json(json_path)

Load configuration from JSON file

get_summary()

Get a human-readable summary of the configuration

merge(partial_config)

Merge partial configuration with current configuration

to_dict([exclude_callables])

Convert configuration to dictionary

to_json(json_path, **json_kwargs)

Save configuration to JSON file

validate()

Validate TrpB-specific configuration parameters

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
num_workers: int = 16#
pipeline_name: str = 'TrpB Cleaning Pipeline'#
primary_label_column: str = 'label'#
type_conversions: Dict[str, str]#
validate()[source]#

Validate TrpB-specific configuration parameters

Raises:

ValueError – If configuration is invalid

Return type:

None

wt_sequence: str = 'MKGYFGPYGGQYVPEILMGALEELEAAYEGIMKDESFWKEFNDLLRDYAGRPTPLYFARRLSEKYGARVYLKREDLLHTGAHKINNAIGQVLLAKLMGKTRIIAETGAGQHGVATATAAALFGMECVIYMGEEDTIRQKLNVERMKLLGAKVVPVKSGSRTLKDAIDEALRDWITNLQTTYYVFGSVVGPHPYPIIVRNFQKVIGEETKKQIPEKEGRLPDYIVACVSGGSNAAGIFYPFIDSGVKLIGVEAGGEGLETGKHAASLLKGKIGYLHGSKTFVLQDDWGQVQVSHSVSAGLDYSGVGPEHAYWRETGKVLYDAVTDEEALDAFIELSRLEGIIPALESSHALAYLKKINIKGKVVVVNLSGRGDKDLESVLNHPYVRERIRLEHHHHHH'#
mutcleaner.cleaners.clean_antitoxin_pard3_dataset(pipeline)[source]#

Clean Antitoxin dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – Antitoxin dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned Antitoxin dataset

Examples

Use default configuration:

>>> pipeline = create_antitoxin_cleaner(df)  # df is raw Antitoxin dataset file

Use partial configuration:

>>> pipeline = create_antitoxin_cleaner(df, config={
...     "validate_mut_workers": 8,
... })

Load configuration from file:

>>> pipeline = create_antitoxin_cleaner(df, config="config.json")
>>> pipeline, dataset = clean_antitoxin_dataset(pipeline)
mutcleaner.cleaners.clean_archstabms_1e10_sup4_dataset(pipeline)[source]#

Clean ArchStabMS1E10 dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – ArchStabMS1E10 dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned ArchStabMS1E10 dataset

Examples

Use default configuration:

>>> pipeline = create_archstabms_1e10_sup4_cleaner(df)  # df is raw ArchStabMS1E10 dataset file

Use partial configuration:

>>> pipeline = create_archstabms_1e10_sup4_cleaner(df, config={
...     "column_mapping": {
...         "name": "name_column",
...         "WT":"wt",
...         "full_aa_seq": "mut_seq",
...         "fitness": "fitness",
... }})

Load configuration from file:

>>> pipeline = create_archstabms_1e10_sup4_cleaner(df, config="config.json")
>>> pipeline, dataset = clean_archstabms_1e10_sup4_dataset(pipeline)
mutcleaner.cleaners.clean_archstabms_1e10_sup5_dataset(pipeline)[source]#

Clean ArchStabMS1E10 dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – ArchStabMS1E10 dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned ArchStabMS1E10 dataset

Examples

Use default configuration:

>>> pipeline = create_archstabms_1e10_sup5_cleaner(df)  # df is raw ArchStabMS1E10 dataset file

Use partial configuration:

>>> pipeline = create_archstabms_1e10_sup5_cleaner(df, config={
...     "column_mapping": {
...         "mean_kcal/mol": "label",
...         "id_ref": "mutation_name",
...     },
... })

Load configuration from file:

>>> pipeline = create_archstabms_1e10_sup5_cleaner(df, config="config.json")
>>> pipeline, dataset = clean_archstabms_1e10_sup5_dataset(pipeline)
mutcleaner.cleaners.clean_cdna_proteolysis_dataset(pipeline)[source]#

Clean cDNAProteolysis dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – cDNAProteolysis dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned cDNAProteolysis dataset

Examples

Use default configuration:

>>> pipeline = create_cdna_proteolysis_cleaner(df)  # df is raw cDNAProteolysis dataset file

Use partial configuration:

>>> pipeline = create_cdna_proteolysis_cleaner(df, config={
...     "validate_mut_workers": 8,
... })

Load configuration from file:

>>> pipeline = create_cdna_proteolysis_cleaner(df, config="config.json")
>>> pipeline, dataset = clean_cdna_proteolysis_dataset(pipeline)
mutcleaner.cleaners.clean_chitosanase_dtm_dataset(pipeline)[source]#

Run the Chitosanase_dtm pipeline and return the formatted dataset.

Executes the provided Pipeline, converts the pipeline output into a MutationDataset, and returns both the executed pipeline and the dataset. Pipeline artifacts and diagnostics may be saved with pipeline.save_artifacts(path) by the caller.

Parameters:

pipeline (Pipeline) – The configured Chitosanase cleaning pipeline to execute.

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • The executed Pipeline. - The resulting MutationDataset built from the formatted DataFrame emitted by the pipeline.

Examples

>>> pipeline = create_chitosanase_dtm_cleaner("/path/to/file.csv")
>>> pipeline, dataset = clean_chitosanase_dtm_dataset(pipeline)
mutcleaner.cleaners.clean_codon_cdna_proteolysis_dataset(pipeline)[source]#

Clean cDNAProteolysis dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – cDNAProteolysis dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned cDNAProteolysis dataset

Examples

Use default configuration:

>>> pipeline = create_codon_cdna_proteolysis_cleaner(df)  # df is raw cDNAProteolysis dataset file

Use partial configuration:

>>> pipeline = create_codon_cdna_proteolysis_cleaner(df, config={
...     "validate_mut_workers": 8,
... })

Load configuration from file:

>>> pipeline = create_codon_cdna_proteolysis_cleaner(df, config="config.json")
>>> pipeline, dataset = clean_codon_cdna_proteolysis_dataset(pipeline)
mutcleaner.cleaners.clean_ctxm_dataset(pipeline)[source]#

Clean CTXM dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – CTXM dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned CTXM dataset

Examples

>>> pipeline = create_CTXM_cleaner(df)  # df is raw CTXM dataset file
Use default configuration:
>>> pipeline, dataset = clean_CTXM_dataset(pipeline)

Use partial configuration:

>>> pipeline, dataset = clean_CTXM_dataset(df, config={
...     "process_workers": 8,
... })

Load configuration from file:

>>> pipeline, dataset = clean_CTXM_dataset(df, config="config.json")
mutcleaner.cleaners.clean_ddg_dtm_dataset(pipeline)[source]#

Clean ddG-dTm dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – ddG-dTm dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned ddG-dTm dataset

Examples

>>> pipeline = create_ddg_dtm_cleaner(df)  # df is raw ddG-dTm dataset file

Use default configuration:

>>> pipeline, dataset = clean_ddg_dtm_dataset(pipeline)

Use partial configuration:

>>> pipeline, dataset = clean_ddg_dtm_dataset(df, config={
...     "infer_mut_workers": 8,
... })

Load configuration from file:

>>> pipeline, dataset = clean_ddg_dtm_dataset(df, config="config.json")
mutcleaner.cleaners.clean_human_domainome_sup2_dataset(pipeline)[source]#

Clean HumanDomainome dataset using configurable pipeline - SupplementaryTable2

Parameters:

pipeline (Pipeline) – HumanDomainome dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned HumanDomainome dataset

Raises:

RuntimeError – If pipeline execution fails

mutcleaner.cleaners.clean_human_domainome_sup4_dataset(pipeline)[source]#

Clean HumanDomainome dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – HumanDomainome dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned HumanDomainome dataset

Raises:

RuntimeError – If pipeline execution fails

mutcleaner.cleaners.clean_human_myoglobin_dataset(pipeline)[source]#

Clean human myoglobin dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – Human myoglobin dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned human myoglobin dataset

Examples

Use default configuration:

>>> pipeline = create_human_myoglobin_cleaner(df)  # df is raw human myoglobin dataset file

Use partial configuration:

>>> pipeline = create_human_myoglobin_cleaner(df, config={
...     "validate_mut_workers": 8,
... })

Load configuration from file:

>>> pipeline = create_human_myoglobin_cleaner(df, config="config.json")
>>> pipeline, dataset = clean_human_myoglobin_dataset(pipeline)
mutcleaner.cleaners.clean_mgnify_ddg_dataset(pipeline)[source]#

Execute the MGnify_ddG dataset cleaning pipeline and package into a MutationDataset.

Parameters:

pipeline (Pipeline) – The pre-constructed MGnify_ddG dataset cleaning pipeline.

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • pipeline: The executed pipeline instance. - mgnify_ddg_dataset: Standardized MutationDataset object containing data.csv, wt.fasta, and metadata.json.

mutcleaner.cleaners.clean_proteingym_dms_substitutions_dataset(pipeline)[source]#

Clean ProteinGym dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – ProteinGym dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned ProteinGym dataset

mutcleaner.cleaners.clean_rbd_ace2_dataset(pipeline)[source]#

Execute the RBD ACE2 cleaning pipeline.

Parameters:

pipeline (Pipeline) – Pipeline created by create_rbd_ace2_cleaner().

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

Executed pipeline and cleaned mutation dataset.

mutcleaner.cleaners.clean_rbd_antibody_dataset(pipeline)[source]#

Execute the RBD antibody cleaning pipeline.

Return type:

Tuple[Pipeline, MutationDataset]

mutcleaner.cleaners.clean_trpb_dataset(pipeline)[source]#

Clean TrpB dataset using configurable pipeline

Parameters:

pipeline (Pipeline) – TrpB dataset cleaning pipeline

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

  • Pipeline: The cleaned pipeline - MutationDataset: The cleaned TrpB dataset

Examples

>>> pipeline = create_TrpB_cleaner(df)  # df is raw TrpB dataset file
Use default configuration:
>>> pipeline, dataset = clean_TrpB_dataset(pipeline)

Use partial configuration:

>>> pipeline, dataset = clean_TrpB_dataset(df, config={
...     "validate_mut_workers": 8,
... })

Load configuration from file:

>>> pipeline, dataset = clean_TrpB_dataset(df, config="config.json")
mutcleaner.cleaners.create_antitoxin_pard3_cleaner(dataset_or_path=None, config=None)[source]#

Create Antitoxin dataset cleaning pipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to Antitoxin dataset.

  • config (Union[AntitoxinParD3CleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - AntitoxinCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

Pipeline: The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

mutcleaner.cleaners.create_archstabms_1e10_sup4_cleaner(dataset_or_path=None, config=None)[source]#

Create ArchStabMS1E10 dataset cleaning piipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to archstams 1e10 dataset

  • config (Union[ArchStabMS1E10CleanerSup4Config, Dict[str, Any], str, Path, None]) – Configuration for the cleaing pipeline. Can be: - CDNAProtelysisCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

Pipeline: The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

mutcleaner.cleaners.create_archstabms_1e10_sup5_cleaner(dataset_or_path=None, config=None)[source]#

Create ArchStabMS1E10 dataset cleaning piipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to archstams 1e10 dataset

  • config (Union[ArchStabMS1E10CleanerSup5Config, Dict[str, Any], str, Path, None]) – Configuration for the cleaing pipeline. Can be: - CDNAProtelysisCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

Pipeline: The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

mutcleaner.cleaners.create_cdna_proteolysis_cleaner(dataset_or_path, config=None)[source]#

Create cDNAProteolysis dataset cleaning pipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to cDNAProteolysis dataset.

  • config (Union[CDNAProteolysisCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - CDNAProteolysisCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

mutcleaner.cleaners.create_chitosanase_dtm_cleaner(dataset_or_path=None, config=None)[source]#

Create a configured Pipeline for cleaning Chitosanase_dTm raw files.

Parameters:
  • dataset_or_path (Union[str, Path, None]) – Path to a raw Chitosanase_dTm input file (or a DataFrame for programmatic callers). Raw files must contain a CSV block followed by the WT sequence separated by the configured wt_separator.

  • config (Union[ChitosanasedTmCleanerConfig, Dict[str, Any], str, Path, None]) – Pipeline configuration. Accepts a ChitosanasedTmCleanerConfig instance, a dict of overrides merged with defaults, or a path to a JSON configuration file.

Return type:

Pipeline

Returns:

A Pipeline instance ready for execution via pipeline.execute().

Examples

>>> pipeline = create_chitosanase_cleaner("/path/to/Chitosanase_dTm_Dataset.csv")
>>> pipeline.execute()
mutcleaner.cleaners.create_codon_cdna_proteolysis_cleaner(dataset_or_path, sequence_source, config=None)[source]#

Create cDNAProteolysis dataset cleaning pipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to cDNAProteolysis dataset.

  • config (Union[CodoncDNAProteolysisCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - CodoncDNAProteolysisCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

mutcleaner.cleaners.create_ctxm_cleaner(dataset_or_path=None, config=None)[source]#

Create CTXM dataset cleaning pipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to CTXM dataset.

  • config (Union[CTXMCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - CTXMCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

Pipeline: The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

mutcleaner.cleaners.create_ddg_dtm_cleaner(dataset_or_path=None, config=None)[source]#

Create ddG-dTm dataset cleaning pipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to ddG-dTm dataset.

  • config (Union[DdgDtmCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - DdgDtmCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

Pipeline: The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

Notes

Label columns (dTm or ddG) are automatically detected and added to the pipeline.

mutcleaner.cleaners.create_human_domainome_sup2_cleaner(dataset_or_path, config=None)[source]#

Create HumanDomainome ledataset cleaning pipeline - SupplementaryTable2

Parameters:
  • dataset_or_path (Union[str, Path, DataFrame]) – Raw HumanDomainome dataset DataFrame or file path to HumanDomainome - File: SupplementaryTable2.txt from the article ‘Site-saturation mutagenesis of 500 human protein domains’

  • config (Union[HumanDomainomeSup2CleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - HumanDomainomeCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

The cleaning pipeline

Raises:
  • FileNotFoundError – If data file or sequence dictionary file not found

  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

Examples

Basic usage:

>>> pipeline = create_human_domainome_sup2_cleaner(
...     "human_domainome.csv"
... )
>>> pipeline, dataset = clean_human_domainome_dataset(pipeline)

Custom configuration:

>>> config = {
...     "process_workers": 8,
...     "type_conversions": {"label_humanDomainome": "float32"}
... }
>>> pipeline = create_human_domainome_sup2_cleaner(
...     "human_domainome.csv"
...     config=config
... )

Load configuration from file:

>>> pipeline = create_human_domainome_sup2_cleaner(
...     "data.csv",
...     config="config.json"
... )
mutcleaner.cleaners.create_human_domainome_sup4_cleaner(dataset_or_path, sequence_source, config=None)[source]#

Create HumanDomainome dataset cleaning pipeline - SupplementaryTable4

Parameters:
  • dataset_or_path (Union[str, Path, DataFrame]) – Raw HumanDomainome dataset DataFrame or file path to HumanDomainome - File: SupplementaryTable4.txt from the article ‘Site-saturation mutagenesis of 500 human protein domains’

  • sequence_source (Union[str, Path]) – Path to file containing UniProt ID to sequence mapping

  • config (Union[HumanDomainomeSup4CleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - HumanDomainomeCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

The cleaning pipeline

Raises:
  • FileNotFoundError – If data file or sequence dictionary file not found

  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

Examples

Basic usage:

>>> pipeline = create_human_domainome_sup4_cleaner(
...     "human_domainome.csv",
...     "uniprot_sequences.fasta"
... )
>>> pipeline, dataset = clean_human_domainome_dataset(pipeline)

Custom configuration:

>>> config = {
...     "process_workers": 8,
...     "type_conversions": {"label_humanDomainome": "float32"}
... }
>>> pipeline = create_human_domainome_sup4_cleaner(
...     "human_domainome.csv",
...     "sequences.csv",
...     config=config
... )

Load configuration from file:

>>> pipeline = create_human_domainome_sup4_cleaner(
...     "data.csv",
...     "sequences.fasta",
...     config="config.json"
... )
mutcleaner.cleaners.create_human_myoglobin_cleaner(dataset_or_path=None, config=None)[source]#

Create human myoglobin dataset cleaning pipeline

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to human myoglobin dataset.

  • config (Union[HumanMyoglobinCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - HumanMyoglobinCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

Pipeline: The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

mutcleaner.cleaners.create_mgnify_ddg_cleaner(dataset_or_path=None, config=None)[source]#

Create MGnify protein stability dataset cleaning pipeline.

This function pieces together modular basic cleaners to standardize the MGnify subsets into regularized training matrices for deep learning architectures.

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw dataset DataFrame or file path to the raw MGnify_ddG_Dataset.csv file.

  • config (Union[MGnifyddGCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration instance, parameter dictionary, or path to a JSON config.

Return type:

Pipeline

Returns:

The constructed cleaning pipeline instance populated with delayed steps.

mutcleaner.cleaners.create_proteingym_dms_substitutions_cleaner(data_path, config=None)[source]#

Create ProteinGym dataset cleaning pipeline

Parameters:
  • data_path (Union[str, Path]) – Path to directory containing ProteinGym CSV files or path to zip file - Download from: https://proteingym.org/download - File: DMS_ProteinGym_substitutions.zip

  • config (Union[ProteinGymCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - ProteinGymCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

The cleaning pipeline

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

Examples

Process directory of ProteinGym CSV files:

>>> pipeline = create_protein_gym_cleaner("DMS_ProteinGym_substitutions/")
>>> pipeline, dataset = clean_protein_gym_dataset(pipeline)

Process zip file:

>>> pipeline = create_protein_gym_cleaner("DMS_ProteinGym_substitutions.zip")
>>> pipeline, dataset = clean_protein_gym_dataset(pipeline)

Custom configuration:

>>> config = {
...     "validation_workers": 8,
...     "handle_multiple_wt": "first"
... }
>>> pipeline = create_protein_gym_cleaner("data/", config=config)

Load configuration from file:

>>> pipeline = create_protein_gym_cleaner("data/", config="config.json")
mutcleaner.cleaners.create_rbd_ace2_cleaner(dataset_or_path=None, config=None)[source]#

Create the RBD ACE2 cleaning pipeline.

Parameters:
  • dataset_or_path (Union[DataFrame, str, Path, None]) – Raw RBD ACE2 dataframe or input file path.

  • config (Union[RBDACE2CleanerConfig, Dict[str, Any], str, Path, None]) – Cleaner configuration object, partial configuration dictionary, JSON path, or None to use the built-in default configuration.

Return type:

Pipeline

Returns:

Delayed cleaning pipeline.

Raises:

TypeError – If dataset_or_path or config uses an unsupported type.

mutcleaner.cleaners.create_rbd_antibody_cleaner(dataset_or_path=None, config=None)[source]#

Create the RBD antibody cleaning pipeline.

Return type:

Pipeline

mutcleaner.cleaners.create_trpb_cleaner(dataset_or_path, config=None)[source]#

Create TrpB dataset cleaning pipeline

Parameters:
  • dataset_or_path (Union[str, Path]) – Raw dataset DataFrame or file path to TrpB dataset.

  • config (Union[TrpBCleanerConfig, Dict[str, Any], str, Path, None]) – Configuration for the cleaning pipeline. Can be: - TrpBCleanerConfig object - Dictionary with configuration parameters (merged with defaults) - Path to JSON configuration file (str or Path) - None (uses default configuration)

Return type:

Pipeline

Returns:

Pipeline: The cleaning pipeline used

Raises:
  • TypeError – If config has invalid type

  • ValueError – If configuration validation fails

Modules