mutcleaner.cleaners.archstabms_1e10_sup5_cleaner#
Functions
|
Clean ArchStabMS1E10 dataset using configurable pipeline |
Create ArchStabMS1E10 dataset cleaning piipeline |
Classes
Configuration class for ArchStabMS1E10 dataset cleaner. |
- class mutcleaner.cleaners.archstabms_1e10_sup5_cleaner.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:
BaseCleanerConfigConfiguration 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]#
- mutcleaner.cleaners.archstabms_1e10_sup5_cleaner.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.archstabms_1e10_sup5_cleaner.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 datasetconfig (
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:
- Returns:
Pipeline: The cleaning pipeline used
- Raises:
TypeError – If config has invalid type
ValueError – If configuration validation fails