mutcleaner 0.1.0.post1.dev40__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/PKG-INFO +6 -1
  2. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/README.md +5 -0
  3. mutcleaner-0.3.0/doc/changelog/CHANGELOG_0.2.0.md +26 -0
  4. mutcleaner-0.3.0/doc/changelog/CHANGELOG_0.3.0.md +23 -0
  5. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/conf.py +1 -1
  6. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/user_guide/overview.md +2 -0
  7. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/user_guide/supported_datasets.md +57 -0
  8. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/__init__.py +3 -1
  9. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/__init__.py +9 -0
  10. mutcleaner-0.3.0/mutcleaner/cleaners/chitosanase_cleaner.py +220 -0
  11. mutcleaner-0.3.0/mutcleaner/cleaners/chitosanase_custom_cleaners.py +69 -0
  12. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/__init__.py +2 -0
  13. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/data_source.py +10 -0
  14. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/raw_data_downloader.py +20 -0
  15. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner.egg-info/PKG-INFO +6 -1
  16. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner.egg-info/SOURCES.txt +4 -0
  17. mutcleaner-0.3.0/tools/release.sh +102 -0
  18. mutcleaner-0.1.0.post1.dev40/tools/release.sh +0 -65
  19. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/.github/workflows/docs.yml +0 -0
  20. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/.gitignore +0 -0
  21. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/CONTRIBUTING.md +0 -0
  22. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/LICENSE +0 -0
  23. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/Makefile +0 -0
  24. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/changelog/CHANGELOG_0.1.0.md +0 -0
  25. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/make.bat +0 -0
  26. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/requirements.in +0 -0
  27. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/requirements.txt +0 -0
  28. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/_static/custom.css +0 -0
  29. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/api/index.rst +0 -0
  30. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/index.rst +0 -0
  31. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/user_guide/common_workflow.md +0 -0
  32. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/doc/source/user_guide/index.rst +0 -0
  33. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/antitoxin_pard3_cleaner.py +0 -0
  34. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/antitoxin_pard3_custom_cleaners.py +0 -0
  35. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/archstabms_1e10_cleaner.py +0 -0
  36. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/archstabms_1e10_custom_cleaners.py +0 -0
  37. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/base_config.py +0 -0
  38. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/basic_cleaners.py +0 -0
  39. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/cdna_proteolysis_cleaner.py +0 -0
  40. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/cdna_proteolysis_custom_cleaners.py +0 -0
  41. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/ctxm_cleaner.py +0 -0
  42. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/ddg_dtm_cleaners.py +0 -0
  43. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/human_domainome_custom_cleaners.py +0 -0
  44. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/human_domainome_sup2_cleaner.py +0 -0
  45. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/human_myoglobin_cleaner.py +0 -0
  46. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/human_myoglobin_custom_cleaners.py +0 -0
  47. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/proteingym_dms_substitutions_cleaner.py +0 -0
  48. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/proteingym_dms_substitutions_custom_cleaners.py +0 -0
  49. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/rbd_ace2_cleaner.py +0 -0
  50. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/rbd_antibody_cleaner.py +0 -0
  51. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/rbd_custom_cleaner.py +0 -0
  52. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/cleaners/trpb_cleaner.py +0 -0
  53. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/__init__.py +0 -0
  54. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/alphabet.py +0 -0
  55. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/codon.py +0 -0
  56. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/constants.py +0 -0
  57. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/dataset.py +0 -0
  58. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/mutation.py +0 -0
  59. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/pipeline.py +0 -0
  60. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/sequence.py +0 -0
  61. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/core/types.py +0 -0
  62. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/cleaner_workers.py +0 -0
  63. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/dataset_builders.py +0 -0
  64. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/label_resolvers.py +0 -0
  65. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/mutation_converter.py +0 -0
  66. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/sequence_io.py +0 -0
  67. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner/utils/type_converter.py +0 -0
  68. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner.egg-info/dependency_links.txt +0 -0
  69. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner.egg-info/requires.txt +0 -0
  70. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/mutcleaner.egg-info/top_level.txt +0 -0
  71. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/pyproject.toml +0 -0
  72. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/setup.cfg +0 -0
  73. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/tests/test_dataset.py +0 -0
  74. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/tests/test_mutation.py +0 -0
  75. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/tests/test_pipeline.py +0 -0
  76. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/tests/test_sequence.py +0 -0
  77. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/tools/changelog.py +0 -0
  78. {mutcleaner-0.1.0.post1.dev40 → mutcleaner-0.3.0}/tools/generate_changelog.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mutcleaner
3
- Version: 0.1.0.post1.dev40
3
+ Version: 0.3.0
4
4
  Summary: An efficient framework for cleaning, standardizing, and processing biological mutation data.
5
5
  Author: Yuxiang Tang, Ziyu Shi
6
6
  License-Expression: BSD-3-Clause
@@ -234,6 +234,11 @@ See the [Data Cleaners Usage Guide](https://xulab-research.github.io/MutCleaner/
234
234
  <td><a href="https://doi.org/10.1038/s41586-021-03807-6">SARS-CoV-2 RBD antibodies that maximize breadth and resistance to escape</a></td>
235
235
  <td><a href="https://huggingface.co/datasets/xulab-research/MutCleaner/blob/main/RBD_Antibody_Dataset/SARS-CoV-2-RBD_MAP_Vir_mAbs.csv">SARS-CoV-2-RBD_MAP_Vir_mAbs.csv</a></td>
236
236
  </tr>
237
+ <tr>
238
+ <td>Chitosanase Dataset</td>
239
+ <td>None</td>
240
+ <td><a href="https://huggingface.co/datasets/xulab-research/MutCleaner/blob/main/Chitosanase_Dataset/Chitosanase_Dataset.csv">Chitosanase_Dataset.csv</a></td>
241
+ </tr>
237
242
  </tbody>
238
243
  </table>
239
244
 
@@ -188,6 +188,11 @@ See the [Data Cleaners Usage Guide](https://xulab-research.github.io/MutCleaner/
188
188
  <td><a href="https://doi.org/10.1038/s41586-021-03807-6">SARS-CoV-2 RBD antibodies that maximize breadth and resistance to escape</a></td>
189
189
  <td><a href="https://huggingface.co/datasets/xulab-research/MutCleaner/blob/main/RBD_Antibody_Dataset/SARS-CoV-2-RBD_MAP_Vir_mAbs.csv">SARS-CoV-2-RBD_MAP_Vir_mAbs.csv</a></td>
190
190
  </tr>
191
+ <tr>
192
+ <td>Chitosanase Dataset</td>
193
+ <td>None</td>
194
+ <td><a href="https://huggingface.co/datasets/xulab-research/MutCleaner/blob/main/Chitosanase_Dataset/Chitosanase_Dataset.csv">Chitosanase_Dataset.csv</a></td>
195
+ </tr>
191
196
  </tbody>
192
197
  </table>
193
198
 
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2026-06-02
9
+
10
+ ### Added
11
+
12
+ - Added ACE2-RBD & Antibody-RBD cleaner-related files for the data preprocessing workflow. ([#5](https://github.com/xulab-research/MutCleaner/pull/5)) by @Lodaisthirsty
13
+
14
+ ### Other Changes
15
+
16
+ - Make the records in the dataset more detailed. ([#2](https://github.com/xulab-research/MutCleaner/pull/2)) by @Lodaisthirsty
17
+
18
+ ### Contributors
19
+
20
+ A total of 2 people contributed to this release. People with a "+" by their names contributed a patch for the first time.
21
+
22
+ - Yancheng Shi +
23
+ - Ziyu Shi
24
+
25
+
26
+ **Full Changelog**: [v0.1.0..v0.2.0](https://github.com/xulab-research/MutCleaner/compare/v0.1.0..v0.2.0)
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.0] - 2026-06-02
9
+
10
+ ### Other Changes
11
+
12
+ - Chitosanase ([#6](https://github.com/xulab-research/MutCleaner/pull/6)) by @MnZnYang
13
+
14
+ ### Contributors
15
+
16
+ A total of 3 people contributed to this release. People with a "+" by their names contributed a patch for the first time.
17
+
18
+ - Mengxin Yang +
19
+ - Ziyu Shi
20
+ - yukiko-shi
21
+
22
+
23
+ **Full Changelog**: [v0.2.0..v0.3.0](https://github.com/xulab-research/MutCleaner/compare/v0.2.0..v0.3.0)
@@ -7,7 +7,7 @@ sys.path.insert(0, f"{project_root}")
7
7
  project = "mutcleaner"
8
8
  copyright = "2026, Ziyu Shi, Yuxiang Tang"
9
9
  author = "Yuxiang Tang and Ziyu Shi"
10
- release = "0.1.0"
10
+ release = "0.3.0"
11
11
 
12
12
  extensions = [
13
13
  "sphinx.ext.autodoc",
@@ -13,3 +13,5 @@ This guide provides usage examples for data cleaning modules organized by datase
13
13
  - [**CTXM Epistasis Dataset**](supported_datasets.md#ctxm-epistasis-dataset): A large-scale pairwise deep mutational scanning dataset of the CTX-M-14 β-lactamase active site, covering 49,096 double mutants across 17 active-site residues. Fitness measurements were obtained from functional selection under ampicillin and cefotaxime, providing substrate-dependent fitness landscapes for studying epistasis, compensatory mutations, and antibiotic resistance prediction.
14
14
  - [**RBD-ACE2 Dataset**](supported_datasets.md#rbd-ace2-dataset): SARS-CoV-2 RBD sequences with ACE2 binding affinity scores, labeled by `log10Ka` where higher values indicate stronger ACE2 binding affinity.
15
15
  - [**RBD-Antibody Dataset**](supported_datasets.md#rbd-antibody-dataset): SARS-CoV-2 RBD antibody escape data with mutation-level antibody escape scores.
16
+ - [**Chitosanase Dataset**](supported_datasets.md#chitosanase-dataset): Wet-lab generated chitosanase mutation dataset containing wild-type protein sequences, amino acid mutation annotations, and experimentally measured melting temperatures (Tm). The Tm value serves as the label for protein thermostability prediction and mutation effect analysis.
17
+
@@ -849,3 +849,60 @@ Alternatively, you can download it from
849
849
  ### Advanced Settings
850
850
 
851
851
  See {py:class}`mutcleaner.cleaners.RBDAntibodyCleanerConfig` for details.
852
+
853
+
854
+ ## Chitosanase Dataset
855
+
856
+ ### Basic Usage
857
+
858
+ You can download the source file directly by running (see {py:func}`mutcleaner.utils.download_chitosanase_source_file` for details):
859
+ ```python
860
+ import pickle
861
+ from pathlib import Path
862
+ from mutcleaner import download_chitosanase_source_file
863
+ from mutcleaner.cleaners import (
864
+ create_chitosanase_cleaner,
865
+ clean_chitosanase_dataset,
866
+ )
867
+
868
+
869
+ def main():
870
+ # Prepare data
871
+ raw_data_dir = Path("raw_dataset/Chitosanase_Dataset")
872
+ download_chitosanase_source_file(raw_data_dir, overwrite=True)
873
+
874
+ # File settings
875
+ for dataset_filepath in sorted(raw_data_dir.glob("*.csv")):
876
+ artifact_path = Path(f"logs/Chitosanase_Dataset/artifacts.pkl")
877
+ artifact_csv_dir = Path(f"logs/Chitosanase_Dataset")
878
+
879
+ artifact_csv_dir.mkdir(parents=True, exist_ok=True)
880
+
881
+ # Clean data
882
+ chitosanase_cleaning_pipeline = create_chitosanase_cleaner(dataset_filepath)
883
+ chitosanase_cleaning_pipeline, chitosanase_dataset = clean_chitosanase_dataset(chitosanase_cleaning_pipeline)
884
+
885
+ # Save data
886
+ chitosanase_dataset.save(f"cleaned_dataset/cleaned_Chitosanase_Dataset")
887
+ chitosanase_cleaning_pipeline.save_artifacts(artifact_path)
888
+
889
+ # open the pickle file
890
+ with open(artifact_path, "rb") as file:
891
+ artifacts = pickle.load(file)
892
+
893
+ for artifact_name, artifact_df in artifacts.items():
894
+ artifact_df.to_csv(f"{artifact_csv_dir}/{artifact_name}.csv", index=False)
895
+
896
+
897
+ if __name__ == "__main__":
898
+ import multiprocessing
899
+
900
+ multiprocessing.freeze_support()
901
+ main()
902
+
903
+
904
+ ```
905
+
906
+ ### Advanced Settings
907
+
908
+ See {py:class}`mutcleaner.cleaners.ChitosanaseCleanerConfig` for details.
@@ -5,7 +5,7 @@ MutCleaner: An efficient framework for cleaning, standardizing, and processing b
5
5
 
6
6
  __author__ = "Yuxiang Tang and Ziyu Shi"
7
7
 
8
- __version__ = "0.1.0"
8
+ __version__ = "0.3.0"
9
9
 
10
10
  from .core import (
11
11
  # Alphabet
@@ -38,6 +38,7 @@ from .cleaners import (
38
38
  trpb_cleaner,
39
39
  antitoxin_pard3_cleaner,
40
40
  rbd_ace2_cleaner,
41
+ chitosanase_cleaner,
41
42
  )
42
43
 
43
44
  from .utils import (
@@ -55,4 +56,5 @@ from .utils import (
55
56
  download_antitoxin_pard3_source_file,
56
57
  download_rbd_antibody_source_file,
57
58
  download_rbd_ace2_source_file,
59
+ download_chitosanase_source_file,
58
60
  )
@@ -56,6 +56,12 @@ from .rbd_antibody_cleaner import (
56
56
  create_rbd_antibody_cleaner,
57
57
  )
58
58
 
59
+ from .chitosanase_cleaner import (
60
+ ChitosanaseCleanerConfig,
61
+ create_chitosanase_cleaner,
62
+ clean_chitosanase_dataset,
63
+ )
64
+
59
65
  __all__ = [
60
66
  "CDNAProteolysisCleanerConfig",
61
67
  "create_cdna_proteolysis_cleaner",
@@ -87,6 +93,9 @@ __all__ = [
87
93
  "RBDACE2CleanerConfig",
88
94
  "create_rbd_ace2_cleaner",
89
95
  "clean_rbd_ace2_dataset",
96
+ "ChitosanaseCleanerConfig",
97
+ "create_chitosanase_cleaner",
98
+ "clean_chitosanase_dataset",
90
99
  "RBDAntibodyCleanerConfig",
91
100
  "create_rbd_antibody_cleaner",
92
101
  "clean_rbd_antibody_dataset",
@@ -0,0 +1,220 @@
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ from dataclasses import dataclass, field
5
+ from pathlib import Path
6
+ from typing import TYPE_CHECKING
7
+
8
+ import numpy as np
9
+
10
+ from .base_config import BaseCleanerConfig
11
+ from .basic_cleaners import (
12
+ add_columns,
13
+ apply_mutations_to_sequences,
14
+ convert_data_types,
15
+ convert_to_mutation_dataset_format,
16
+ extract_and_rename_columns,
17
+ filter_and_clean_data,
18
+ subtract_labels_by_wt,
19
+ )
20
+ from .chitosanase_custom_cleaners import parse_chitosanase_raw_file
21
+ from ..core.dataset import MutationDataset
22
+ from ..core.pipeline import Pipeline, create_pipeline
23
+
24
+ if TYPE_CHECKING:
25
+ from typing import Any, Dict, List, Optional, Tuple, Union
26
+
27
+ __all__ = [
28
+ "ChitosanaseCleanerConfig",
29
+ "create_chitosanase_cleaner",
30
+ "clean_chitosanase_dataset",
31
+ ]
32
+
33
+
34
+ def __dir__() -> List[str]:
35
+ return __all__
36
+
37
+
38
+ # Create module logger
39
+ logger = logging.getLogger(__name__)
40
+
41
+
42
+ @dataclass
43
+ class ChitosanaseCleanerConfig(BaseCleanerConfig):
44
+ """Configuration for the Chitosanase cleaning pipeline.
45
+
46
+ Holds dataset-specific defaults for the Chitosanase pipeline. The
47
+ pipeline expects each raw input file to contain a CSV block followed by
48
+ a WT sequence separated by ``wt_separator``.
49
+
50
+ Attributes
51
+ ----------
52
+ infer_mut_workers : int
53
+ Number of workers used when inferring/applying mutations (default 16).
54
+ pipeline_name : str
55
+ Human-readable pipeline name used in logs and artifacts.
56
+ wt_separator : str
57
+ Token that separates CSV block and WT sequence in raw files.
58
+ column_mapping : Dict[str, str]
59
+ Mapping from raw Chitosanase columns to pipeline column names.
60
+ columns_to_add : Dict[str, Any]
61
+ Constant columns to attach during preprocessing.
62
+ """
63
+
64
+ infer_mut_workers: int = 16
65
+ pipeline_name: str = "Chitosanase"
66
+ wt_separator: str = '">wt'
67
+ column_mapping: dict[str, str] = field(
68
+ default_factory=lambda: {
69
+ "aa_mut": "mut_info",
70
+ "Tm": "label",
71
+ "wt_seq": "sequence",
72
+ }
73
+ )
74
+ columns_to_add: dict[str, Any] = field(
75
+ default_factory=lambda: {
76
+ "name": "Chitosanase",
77
+ }
78
+ )
79
+
80
+ def validate(self) -> None:
81
+ super().validate()
82
+
83
+
84
+ def create_chitosanase_cleaner(
85
+ dataset_or_path: Optional[Union[str, Path]] = None,
86
+ config: Optional[Union[ChitosanaseCleanerConfig, Dict[str, Any], str, Path]] = None,
87
+ ) -> Pipeline:
88
+ """Create a configured Pipeline for cleaning Chitosanase raw files.
89
+
90
+ Parameters
91
+ ----------
92
+ dataset_or_path : Optional[Union[str, Path]]
93
+ Path to a raw Chitosanase input file (or a DataFrame for programmatic
94
+ callers). Raw files must contain a CSV block followed by the WT
95
+ sequence separated by the configured ``wt_separator``.
96
+ config : Optional[Union[ChitosanaseCleanerConfig, Dict[str, Any], str, Path]]
97
+ Pipeline configuration. Accepts a `ChitosanaseCleanerConfig` instance,
98
+ a dict of overrides merged with defaults, or a path to a JSON
99
+ configuration file.
100
+
101
+ Returns
102
+ -------
103
+ Pipeline
104
+ A :class:`Pipeline` instance ready for execution via
105
+ ``pipeline.execute()``.
106
+
107
+ Examples
108
+ --------
109
+ >>> pipeline = create_chitosanase_cleaner("/path/to/Chitosanase_Dataset.csv")
110
+ >>> pipeline.execute()
111
+ """
112
+ # Handle config
113
+ if config is None:
114
+ final_config = ChitosanaseCleanerConfig()
115
+ elif isinstance(config, ChitosanaseCleanerConfig):
116
+ final_config = config
117
+ elif isinstance(config, dict):
118
+ final_config = ChitosanaseCleanerConfig().merge(config)
119
+ elif isinstance(config, (str, Path)):
120
+ final_config = ChitosanaseCleanerConfig.from_json(config)
121
+ else:
122
+ raise TypeError(f"config has invalid type: {type(config)}")
123
+
124
+ if dataset_or_path is None:
125
+ raise TypeError("dataset_or_path must be a Chitosanase file path")
126
+
127
+ try:
128
+ pipeline = create_pipeline(dataset_or_path, final_config.pipeline_name)
129
+ mutation_column = final_config.column_mapping.get("aa_mut", "aa_mut")
130
+ label_column = final_config.column_mapping.get("Tm", "Tm")
131
+ sequence_column = final_config.column_mapping.get("wt_seq", "wt_seq")
132
+
133
+ # Add cleaning steps
134
+ pipeline = (
135
+ pipeline.delayed_then(parse_chitosanase_raw_file, wt_separator=final_config.wt_separator)
136
+ .delayed_then(filter_and_clean_data, drop_na_columns=["Tm"])
137
+ .delayed_then(convert_data_types, type_conversions={"Tm": np.float32})
138
+ .delayed_then(
139
+ extract_and_rename_columns,
140
+ column_mapping={
141
+ "aa_mut": mutation_column,
142
+ "Tm": label_column,
143
+ "wt_seq": sequence_column,
144
+ },
145
+ )
146
+ .delayed_then(
147
+ add_columns,
148
+ columns_to_add=final_config.columns_to_add,
149
+ )
150
+ .delayed_then(
151
+ subtract_labels_by_wt,
152
+ name_column="name",
153
+ label_columns=label_column,
154
+ mutation_column=mutation_column,
155
+ wt_identifier="WT",
156
+ in_place=True,
157
+ drop_wt_row=True,
158
+ )
159
+ .delayed_then(
160
+ apply_mutations_to_sequences,
161
+ sequence_column=sequence_column,
162
+ mutation_column=mutation_column,
163
+ sequence_type="protein",
164
+ is_zero_based=False,
165
+ num_workers=final_config.infer_mut_workers,
166
+ )
167
+ .delayed_then(
168
+ convert_to_mutation_dataset_format,
169
+ name_column="name",
170
+ mutation_column=mutation_column,
171
+ sequence_column=sequence_column,
172
+ mutated_sequence_column="mut_seq",
173
+ label_column=label_column,
174
+ is_zero_based=False,
175
+ )
176
+ )
177
+ return pipeline
178
+ except Exception as e:
179
+ logger.error(f"Error in creating Chitosanase cleaning pipeline: {str(e)}")
180
+ raise RuntimeError(f"Error in creating Chitosanase cleaning pipeline: {str(e)}")
181
+
182
+
183
+ def clean_chitosanase_dataset(
184
+ pipeline: Pipeline,
185
+ ) -> Tuple[Pipeline, MutationDataset]:
186
+ """Run the Chitosanase pipeline and return the formatted dataset.
187
+
188
+ Executes the provided :class:`Pipeline`, converts the pipeline output
189
+ into a :class:`MutationDataset`, and returns both the executed pipeline
190
+ and the dataset. Pipeline artifacts and diagnostics may be saved with
191
+ ``pipeline.save_artifacts(path)`` by the caller.
192
+
193
+ Parameters
194
+ ----------
195
+ pipeline : Pipeline
196
+ The configured Chitosanase cleaning pipeline to execute.
197
+
198
+ Returns
199
+ -------
200
+ Tuple[Pipeline, MutationDataset]
201
+ - The executed :class:`Pipeline`.
202
+ - The resulting :class:`MutationDataset` built from the formatted
203
+ DataFrame emitted by the pipeline.
204
+
205
+ Examples
206
+ --------
207
+ >>> pipeline = create_chitosanase_cleaner("/path/to/file.csv")
208
+ >>> pipeline, dataset = clean_chitosanase_dataset(pipeline)
209
+ """
210
+ try:
211
+ pipeline.execute()
212
+
213
+ formatted_df, ref_dict = pipeline.data
214
+ chitosanase_dataset = MutationDataset.from_dataframe(formatted_df, reference_sequences=ref_dict)
215
+
216
+ logger.info(f"Successfully cleaned Chitosanase dataset: " f"{len(formatted_df)} mutations from {len(ref_dict)} proteins")
217
+ return pipeline, chitosanase_dataset
218
+ except Exception as e:
219
+ logger.error(f"Error in running Chitosanase cleaning pipeline: {str(e)}")
220
+ raise RuntimeError(f"Error in running Chitosanase cleaning pipeline: {str(e)}")
@@ -0,0 +1,69 @@
1
+ from __future__ import annotations
2
+
3
+ import io
4
+ from pathlib import Path
5
+ import pandas as pd
6
+ from typing import TYPE_CHECKING
7
+
8
+ from ..core.pipeline import pipeline_step
9
+
10
+ if TYPE_CHECKING:
11
+ from typing import List
12
+
13
+ __all__ = ["parse_chitosanase_raw_file"]
14
+
15
+
16
+ def __dir__() -> List[str]:
17
+ return __all__
18
+
19
+
20
+ @pipeline_step
21
+ def parse_chitosanase_raw_file(file_path: str | Path, wt_separator: str = '">wt') -> pd.DataFrame:
22
+ """Parse a raw Chitosanase input file and return the raw DataFrame.
23
+
24
+ The raw file contains a CSV block followed by a wild-type sequence.
25
+ This step only reads the file, splits the two blocks, parses the CSV into
26
+ a DataFrame, and attaches the WT sequence as a constant column so that the
27
+ downstream pipeline steps can do the actual cleaning and formatting.
28
+
29
+ Parameters
30
+ ----------
31
+ file_path : str | pathlib.Path
32
+ Path to the raw Chitosanase input file. The file should contain a
33
+ CSV section then the WT sequence separated by ``wt_separator``.
34
+ wt_separator : str, optional
35
+ Substring that separates CSV and WT sequence blocks (default '\">wt').
36
+
37
+ Returns
38
+ -------
39
+ pd.DataFrame
40
+ Raw DataFrame parsed from the CSV block. It keeps the original input
41
+ columns and adds ``wt_seq`` so downstream pipeline steps can create
42
+ the sequence-related columns.
43
+
44
+ Raises
45
+ ------
46
+ ValueError
47
+ If the expected WT separator is not found.
48
+
49
+ Examples
50
+ --------
51
+ >>> from pathlib import Path
52
+ >>> df = parse_chitosanase_raw_file(Path("/path/to/Chitosanase_Dataset.csv"))
53
+ >>> sorted(df.columns)
54
+ ['Tm', 'aa_mut', 'wt_seq']
55
+ """
56
+ with open(file_path, "r") as f:
57
+ raw_text = f.read()
58
+
59
+ if wt_separator in raw_text:
60
+ parts = raw_text.split(wt_separator)
61
+ csv_text = parts[0].strip()
62
+ wt_seq = parts[1].replace('"', "").replace(",", "").strip()
63
+ wt_seq = "".join(wt_seq.split())
64
+ else:
65
+ raise ValueError(f"Cannot find WT sequence separator '{wt_separator}' in the expected format.")
66
+
67
+ df = pd.read_csv(io.StringIO(csv_text))
68
+ df["wt_seq"] = wt_seq
69
+ return df
@@ -18,6 +18,7 @@ from .raw_data_downloader import (
18
18
  download_antitoxin_pard3_source_file,
19
19
  download_rbd_antibody_source_file,
20
20
  download_rbd_ace2_source_file,
21
+ download_chitosanase_source_file
21
22
  )
22
23
 
23
24
  # fmt: off
@@ -36,4 +37,5 @@ __all__ = [
36
37
  "download_antitoxin_pard3_source_file",
37
38
  "download_rbd_antibody_source_file",
38
39
  "download_rbd_ace2_source_file",
40
+ "download_chitosanase_source_file"
39
41
  ]
@@ -293,6 +293,15 @@ DATASETS = {
293
293
  },
294
294
  },
295
295
  },
296
+ "Chitosanase Dataset": {
297
+ "paper_title": "Chitosanase_dataset",
298
+ "official_doi": None,
299
+ "files": ["Chitosanase_Dataset.csv"],
300
+ "huggingface_repos": [
301
+ "datasets/xulab-research/MutCleaner/resolve/main/Chitosanase_Dataset/Chitosanase_Dataset.csv?download=true",
302
+ ],
303
+ "file_name": ["Chitosanase_Dataset.csv"],
304
+ },
296
305
  }
297
306
 
298
307
 
@@ -320,6 +329,7 @@ def list_datasets_with_built_in_cleaners() -> None:
320
329
  - CTXM Epistasis Dataset
321
330
  - RBD Antibody Dataset
322
331
  - RBD ACE2 Dataset
332
+ - Chitosanase Dataset
323
333
  """
324
334
  print("Public datasets with ready-to-use cleaning pipelines:")
325
335
  for key, info in DATASETS.items():
@@ -747,3 +747,23 @@ def download_rbd_ace2_source_file(
747
747
  overwrite=overwrite,
748
748
  sub_dataset=sub_dataset,
749
749
  )
750
+
751
+
752
+ def download_chitosanase_source_file(dir: str, *, overwrite: bool = False) -> Dict[str, str]:
753
+ """
754
+ Download the source file for Chitosanase Dataset from the original source.
755
+
756
+ Parameters
757
+ ----------
758
+ dir : str
759
+ The target directory where the file will be saved
760
+ overwrite : bool, default=False
761
+ Whether to overwrite the file if it already exists. Default is False.
762
+
763
+ Returns
764
+ -------
765
+ Dict[str, str]
766
+ key: file name,
767
+ value: file path pointing to Chitosanase Dataset source file
768
+ """
769
+ return download_source_file_from_huggingface("Chitosanase Dataset", dir, overwrite=overwrite)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mutcleaner
3
- Version: 0.1.0.post1.dev40
3
+ Version: 0.3.0
4
4
  Summary: An efficient framework for cleaning, standardizing, and processing biological mutation data.
5
5
  Author: Yuxiang Tang, Ziyu Shi
6
6
  License-Expression: BSD-3-Clause
@@ -234,6 +234,11 @@ See the [Data Cleaners Usage Guide](https://xulab-research.github.io/MutCleaner/
234
234
  <td><a href="https://doi.org/10.1038/s41586-021-03807-6">SARS-CoV-2 RBD antibodies that maximize breadth and resistance to escape</a></td>
235
235
  <td><a href="https://huggingface.co/datasets/xulab-research/MutCleaner/blob/main/RBD_Antibody_Dataset/SARS-CoV-2-RBD_MAP_Vir_mAbs.csv">SARS-CoV-2-RBD_MAP_Vir_mAbs.csv</a></td>
236
236
  </tr>
237
+ <tr>
238
+ <td>Chitosanase Dataset</td>
239
+ <td>None</td>
240
+ <td><a href="https://huggingface.co/datasets/xulab-research/MutCleaner/blob/main/Chitosanase_Dataset/Chitosanase_Dataset.csv">Chitosanase_Dataset.csv</a></td>
241
+ </tr>
237
242
  </tbody>
238
243
  </table>
239
244
 
@@ -9,6 +9,8 @@ doc/make.bat
9
9
  doc/requirements.in
10
10
  doc/requirements.txt
11
11
  doc/changelog/CHANGELOG_0.1.0.md
12
+ doc/changelog/CHANGELOG_0.2.0.md
13
+ doc/changelog/CHANGELOG_0.3.0.md
12
14
  doc/source/conf.py
13
15
  doc/source/index.rst
14
16
  doc/source/_static/custom.css
@@ -32,6 +34,8 @@ mutcleaner/cleaners/base_config.py
32
34
  mutcleaner/cleaners/basic_cleaners.py
33
35
  mutcleaner/cleaners/cdna_proteolysis_cleaner.py
34
36
  mutcleaner/cleaners/cdna_proteolysis_custom_cleaners.py
37
+ mutcleaner/cleaners/chitosanase_cleaner.py
38
+ mutcleaner/cleaners/chitosanase_custom_cleaners.py
35
39
  mutcleaner/cleaners/ctxm_cleaner.py
36
40
  mutcleaner/cleaners/ddg_dtm_cleaners.py
37
41
  mutcleaner/cleaners/human_domainome_custom_cleaners.py
@@ -0,0 +1,102 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ VERSION=${1:-}
5
+
6
+ if [ -z "$VERSION" ]; then
7
+ echo "Usage: ./tools/release.sh 0.3.0"
8
+ exit 1
9
+ fi
10
+
11
+ if [ -z "${GITHUB_TOKEN:-}" ]; then
12
+ echo "Error: Please set GITHUB_TOKEN"
13
+ exit 1
14
+ fi
15
+
16
+ if [ "$(git branch --show-current)" != "main" ]; then
17
+ echo "Error: release must be run from main branch"
18
+ exit 1
19
+ fi
20
+
21
+ if [ -n "$(git status --porcelain)" ]; then
22
+ echo "Error: working tree is not clean"
23
+ git status --short
24
+ exit 1
25
+ fi
26
+
27
+ echo "Starting release v$VERSION"
28
+ echo "========================================"
29
+
30
+ echo "[1/9] Pulling latest main..."
31
+ git pull --ff-only origin main
32
+
33
+ echo "[2/9] Running tests..."
34
+ pytest tests/ -v
35
+
36
+ if grep -q '^version = ' pyproject.toml; then
37
+ sed -i -E "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
38
+ else
39
+ echo "pyproject.toml uses dynamic version; package version will come from tag v$VERSION"
40
+ fi
41
+
42
+ if grep -q '^__version__ = ' mutcleaner/__init__.py; then
43
+ sed -i -E "s/^__version__ = \".*\"/__version__ = \"$VERSION\"/" mutcleaner/__init__.py
44
+ fi
45
+
46
+ if grep -q '^release = ' doc/source/conf.py; then
47
+ sed -i -E "s/^release = \".*\"/release = \"$VERSION\"/" doc/source/conf.py
48
+ fi
49
+
50
+ echo "[4/9] Generating changelog..."
51
+ LAST_TAG=$(git describe --tags --abbrev=0)
52
+ CHANGELOG="doc/changelog/CHANGELOG_$VERSION.md"
53
+
54
+ python tools/changelog.py \
55
+ "$GITHUB_TOKEN" \
56
+ "xulab-research/MutCleaner" \
57
+ "$LAST_TAG..HEAD" \
58
+ --template keepachangelog \
59
+ --output "$CHANGELOG"
60
+
61
+ sed -i "s/## \[HEAD\]/## [$VERSION]/" "$CHANGELOG"
62
+ sed -i "s/$LAST_TAG..HEAD/$LAST_TAG..v$VERSION/g" "$CHANGELOG"
63
+
64
+ echo "[5/9] Committing release changes..."
65
+ git add pyproject.toml mutcleaner/__init__.py doc/source/conf.py "$CHANGELOG"
66
+ git commit -m "chore: release v$VERSION"
67
+
68
+ echo "[6/9] Creating local tag..."
69
+ git tag -a "v$VERSION" -m "Release v$VERSION"
70
+
71
+ echo "[7/9] Building distribution..."
72
+ rm -rf dist/ build/ *.egg-info
73
+ python -m build
74
+
75
+ python - <<EOF
76
+ from pathlib import Path
77
+
78
+ version = "$VERSION"
79
+ files = [p.name for p in Path("dist").iterdir()]
80
+ if not files or any(version not in f for f in files):
81
+ raise SystemExit(f"Unexpected dist files: {files}")
82
+ print("\\n".join(files))
83
+ EOF
84
+
85
+ echo "[8/9] Checking distribution..."
86
+ twine check dist/*
87
+
88
+ echo "[9/9] Pushing and uploading..."
89
+ git push origin main
90
+ git push origin "v$VERSION"
91
+ twine upload dist/*
92
+
93
+ echo "========================================"
94
+ echo "Release v$VERSION completed!"
95
+ echo ""
96
+ echo "Next steps:"
97
+ echo "1. Create GitHub Release:"
98
+ echo " https://github.com/xulab-research/MutCleaner/releases/new?tag=v$VERSION"
99
+ echo "2. Verify PyPI:"
100
+ echo " https://pypi.org/project/mutcleaner/$VERSION/"
101
+ echo "3. Verify docs:"
102
+ echo " https://xulab-research.github.io/MutCleaner/"
@@ -1,65 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- VERSION=$1
5
- if [ -z "$VERSION" ]; then
6
- echo "Usage: ./tools/release.sh 0.5.0"
7
- exit 1
8
- fi
9
-
10
- echo "Starting release process for v$VERSION"
11
- echo "========================================"
12
-
13
- if [ -z "$GITHUB_TOKEN" ]; then
14
- echo "Error: Please set GITHUB_TOKEN"
15
- exit 1
16
- fi
17
-
18
- echo "[1/8] Running tests..."
19
- pytest tests/ -v
20
-
21
-
22
- echo "[2/8] Updating version to $VERSION..."
23
- OLD_VERSION=$(grep 'version = ' pyproject.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
24
- sed -i "s/version = \"$OLD_VERSION\"/version = \"$VERSION\"/" pyproject.toml
25
- sed -i "s/__version__ = \"$OLD_VERSION\"/__version__ = \"$VERSION\"/" mutcleaner/__init__.py
26
- sed -i "s/release = \"$OLD_VERSION\"/release = \"$VERSION\"/" doc/source/conf.py
27
-
28
- echo "[3/8] Generating CHANGELOG..."
29
- LAST_TAG=$(git describe --tags --abbrev=0)
30
-
31
- python tools/changelog.py \
32
- "$GITHUB_TOKEN" \
33
- "xulab-research/MutCleaner" \
34
- "$LAST_TAG..HEAD" \
35
- --template keepachangelog \
36
- --output "./doc/changelog/CHANGELOG_$1.md"
37
-
38
- echo "[4/8] Building distribution..."
39
- rm -rf dist/ build/
40
- python -m build
41
-
42
- echo "[5/8] Checking distribution..."
43
- twine check dist/*
44
-
45
- echo "[6/8] Committing changes..."
46
- git add pyproject.toml mutcleaner/__init__.py doc/source/conf.py "doc/changelog/CHANGELOG_$VERSION.md"
47
- git commit -m "chore: bump version to $VERSION"
48
- git push origin main
49
-
50
- echo "[7/8] Creating and pushing tag v$VERSION..."
51
- git tag -a "v$VERSION" -m "Release v$VERSION"
52
- git push origin "v$VERSION"
53
-
54
-
55
- echo "[8/8] Uploading to PyPI..."
56
- twine upload dist/*
57
-
58
- echo "========================================"
59
- echo "Release v$VERSION completed!"
60
- echo ""
61
- echo "Next steps:"
62
- echo "1. Create GitHub Release at:"
63
- echo " https://github.com/xulab-research/MutCleaner/releases/new?tag=v$VERSION"
64
- echo "2. Verify PyPI: https://pypi.org/project/mutcleaner/$VERSION/"
65
- echo "3. Verify docs: https://xulab-research.github.io/MutCleaner/"