mutcleaner.cleaners.chitosanase_dtm_cleaner#

Functions

clean_chitosanase_dtm_dataset(pipeline)

Run the Chitosanase_dtm pipeline and return the formatted dataset.

create_chitosanase_dtm_cleaner([...])

Create a configured Pipeline for cleaning Chitosanase_dTm raw files.

Classes

ChitosanasedTmCleanerConfig([pipeline_name, ...])

Configuration for the Chitosanase_dTm cleaning pipeline.

class mutcleaner.cleaners.chitosanase_dtm_cleaner.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'#
mutcleaner.cleaners.chitosanase_dtm_cleaner.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.chitosanase_dtm_cleaner.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()