mutcleaner.cleaners.chitosanase_dtm_custom_cleaner#

Functions

parse_chitosanase_raw_file(file_path[, ...])

Parse a raw Chitosanase input file and return the raw DataFrame.

mutcleaner.cleaners.chitosanase_dtm_custom_cleaner.parse_chitosanase_raw_file(file_path, wt_separator='">wt')[source]#

Parse a raw Chitosanase input file and return the raw DataFrame.

The raw file contains a CSV block followed by a wild-type sequence. This step only reads the file, splits the two blocks, parses the CSV into a DataFrame, and attaches the WT sequence as a constant column so that the downstream pipeline steps can do the actual cleaning and formatting.

Parameters:
  • file_path (str | Path) – Path to the raw Chitosanase input file. The file should contain a CSV section then the WT sequence separated by wt_separator.

  • wt_separator (str) – Substring that separates CSV and WT sequence blocks (default ‘”>wt’).

Return type:

DataFrame

Returns:

Raw DataFrame parsed from the CSV block. It keeps the original input columns and adds wt_seq so downstream pipeline steps can create the sequence-related columns.

Raises:

ValueError – If the expected WT separator is not found.

Examples

>>> from pathlib import Path
>>> df = parse_chitosanase_dtm_raw_file(Path("/path/to/Chitosanase_dTm_Dataset.csv"))
>>> sorted(df.columns)
['Tm', 'aa_mut', 'wt_seq']