mutcleaner.cleaners.codon_dms_substitutions_cleaner#

Functions

clean_codon_dms_substitutions_dataset(pipeline)

Clean the Codon DMS Substitutions Dataset.

create_codon_dms_substitutions_cleaner(data_path)

Create the Codon DMS Substitutions Dataset cleaning pipeline.

Classes

CodonDMSSubstitutionsCleanerConfig([...])

Configuration class for the Codon DMS Substitutions Dataset cleaner.

class mutcleaner.cleaners.codon_dms_substitutions_cleaner.CodonDMSSubstitutionsCleanerConfig(pipeline_name='Codon DMS Substitutions Pipeline', num_workers=16, validate_config=True, column_mapping=<factory>, filters=<factory>, type_conversions=<factory>, mutation_sep=', ', offset=0, validate_mut_workers=16, process_workers=16, label_columns=<factory>, primary_label_column='label')[source]#

Bases: BaseCleanerConfig

Configuration class for the Codon DMS Substitutions Dataset cleaner.

Parameters:
  • column_mapping (Dict[str, str]) – Mapping from source column names to standardized column names.

  • filters (Dict[str, Callable]) – Filtering rules applied during data cleaning.

  • type_conversions (Dict[str, str]) – Data type conversion specifications.

  • mutation_sep (str) – Separator used between multiple codon mutations.

  • offset (int) – Number of the first codon in the source annotations. Subtracted from each codon position.

  • validate_mut_workers (int) – Number of workers used for mutation validation.

  • process_workers (int) – Number of workers used for mutation application.

  • label_columns (List[str]) – Label columns to aggregate.

  • primary_label_column (str) – Primary label column used in the final 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 Codon DMS Substitutions cleaner configuration.

column_mapping: Dict[str, str]#
filters: Dict[str, Callable]#
label_columns: List[str]#
mutation_sep: str = ','#
offset: int = 0#
pipeline_name: str = 'Codon DMS Substitutions Pipeline'#
primary_label_column: str = 'label'#
process_workers: int = 16#
type_conversions: Dict[str, str]#
validate()[source]#

Validate Codon DMS Substitutions cleaner configuration.

Return type:

None

validate_mut_workers: int = 16#
mutcleaner.cleaners.codon_dms_substitutions_cleaner.clean_codon_dms_substitutions_dataset(pipeline)[source]#

Clean the Codon DMS Substitutions Dataset.

Parameters:

pipeline (Pipeline) – Configured Codon DMS Substitutions cleaning pipeline.

Return type:

Tuple[Pipeline, MutationDataset]

Returns:

Executed pipeline and cleaned mutation dataset.

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

Create the Codon DMS Substitutions Dataset cleaning pipeline.

Parameters:
  • data_path (Union[str, Path]) – Path to the dataset directory or ZIP archive.

  • config (Union[CodonDMSSubstitutionsCleanerConfig, Dict[str, Any], str, Path, None]) – Cleaner configuration, partial configuration dictionary, JSON configuration path, or None to use defaults.

Return type:

Pipeline

Returns:

Configured cleaning pipeline.

Raises:
  • FileNotFoundError – If data_path does not exist.

  • TypeError – If data_path is neither a directory nor a ZIP file, or config has an invalid type.