mutcleaner.cleaners.human_myoglobin_cleaner#

Functions

clean_human_myoglobin_dataset(pipeline)

Clean human myoglobin dataset using configurable pipeline

create_human_myoglobin_cleaner([...])

Create human myoglobin dataset cleaning pipeline

Classes

HumanMyoglobinCleanerConfig([pipeline_name, ...])

Configuration class for human Myoglobin dataset cleaner.

class mutcleaner.cleaners.human_myoglobin_cleaner.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'#
mutcleaner.cleaners.human_myoglobin_cleaner.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.human_myoglobin_cleaner.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