mutcleaner.cleaners.archstabms_1e10_sup4_cleaner#

Functions

clean_archstabms_1e10_sup4_dataset(pipeline)

Clean ArchStabMS1E10 dataset using configurable pipeline

create_archstabms_1e10_sup4_cleaner([...])

Create ArchStabMS1E10 dataset cleaning piipeline

Classes

ArchStabMS1E10CleanerSup4Config([...])

Configuration class for ArchStabMS1E10 dataset cleaner.

class mutcleaner.cleaners.archstabms_1e10_sup4_cleaner.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

mutcleaner.cleaners.archstabms_1e10_sup4_cleaner.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.archstabms_1e10_sup4_cleaner.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