biotrainer-core 2.0.0__py3-none-any.whl
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.
- biotrainer_core/__init__.py +7 -0
- biotrainer_core/data_classes/__init__.py +16 -0
- biotrainer_core/data_classes/autoeval/__init__.py +17 -0
- biotrainer_core/data_classes/autoeval/autoeval_flip_datasets.py +61 -0
- biotrainer_core/data_classes/autoeval/autoeval_mode.py +8 -0
- biotrainer_core/data_classes/autoeval/autoeval_pbc_datasets.py +44 -0
- biotrainer_core/data_classes/autoeval/autoeval_progress.py +11 -0
- biotrainer_core/data_classes/autoeval/autoeval_report.py +618 -0
- biotrainer_core/data_classes/autoeval/autoeval_supervised_dataset.py +13 -0
- biotrainer_core/data_classes/autoeval/autoeval_task.py +30 -0
- biotrainer_core/data_classes/bioengineer_data_classes.py +279 -0
- biotrainer_core/data_classes/biotrainer_model_result.py +88 -0
- biotrainer_core/data_classes/biotrainer_prediction.py +115 -0
- biotrainer_core/data_classes/contact.py +62 -0
- biotrainer_core/data_classes/embedding_stats.py +36 -0
- biotrainer_core/data_classes/metrics.py +58 -0
- biotrainer_core/data_classes/protocol.py +55 -0
- biotrainer_core/data_classes/sequence_data.py +297 -0
- biotrainer_core/functions/__init__.py +7 -0
- biotrainer_core/functions/bootstrapping.py +59 -0
- biotrainer_core/functions/hashing.py +94 -0
- biotrainer_core/functions/ranking.py +393 -0
- biotrainer_core/functions/seeding.py +22 -0
- biotrainer_core/h5_files/__init__.py +8 -0
- biotrainer_core/h5_files/emb_db_dto.py +90 -0
- biotrainer_core/h5_files/h5_db.py +100 -0
- biotrainer_core/h5_files/h5_handling.py +82 -0
- biotrainer_core/input_files/__init__.py +14 -0
- biotrainer_core/input_files/csv.py +33 -0
- biotrainer_core/input_files/fasta.py +99 -0
- biotrainer_core/input_files/npy.py +30 -0
- biotrainer_core/input_files/utils.py +74 -0
- biotrainer_core/utils/__init__.py +3 -0
- biotrainer_core/utils/constants.py +22 -0
- biotrainer_core-2.0.0.dist-info/METADATA +68 -0
- biotrainer_core-2.0.0.dist-info/RECORD +38 -0
- biotrainer_core-2.0.0.dist-info/WHEEL +4 -0
- biotrainer_core-2.0.0.dist-info/licenses/LICENSE +9 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from .protocol import Protocol
|
|
2
|
+
from .sequence_data import SequenceData
|
|
3
|
+
from .embedding_stats import EmbeddingStats
|
|
4
|
+
from .biotrainer_model_result import BiotrainerModelResult, DerivedValues, TrainingResult, TestResult, \
|
|
5
|
+
BiotrainerModelUpdate
|
|
6
|
+
from .biotrainer_prediction import BiotrainerPrediction, BiotrainerInferenceResult
|
|
7
|
+
from .metrics import EpochMetrics, MetricEstimate, BootstrappedMetric
|
|
8
|
+
from .bioengineer_data_classes import ZeroShotMethod, Mutation, SingleMutationScore, VariantScore, Variant, \
|
|
9
|
+
RankingResult, AggregatedRankingResult
|
|
10
|
+
from .contact import ContactDatasetResult, ContactSingleProteinResult
|
|
11
|
+
|
|
12
|
+
__all__ = ["BiotrainerModelResult", "BiotrainerPrediction", "Protocol", "EmbeddingStats",
|
|
13
|
+
"EpochMetrics", "MetricEstimate", "BootstrappedMetric", "SequenceData", "TestResult", "TrainingResult",
|
|
14
|
+
"DerivedValues", "BiotrainerModelUpdate", "BiotrainerInferenceResult",
|
|
15
|
+
"ZeroShotMethod", "Mutation", "SingleMutationScore", "VariantScore", "Variant", "RankingResult",
|
|
16
|
+
"AggregatedRankingResult", "ContactDatasetResult", "ContactSingleProteinResult"]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from .autoeval_flip_datasets import all_flip_datasets, FLIPDatasetName
|
|
2
|
+
from .autoeval_pbc_datasets import all_pbc_supervised_datasets, PBCSupervisedDatasetName
|
|
3
|
+
from .autoeval_progress import AutoEvalProgress
|
|
4
|
+
from .autoeval_report import (AutoEvalReport, SupervisedFrameworkReport, ContactFrameworkReport,
|
|
5
|
+
ZeroShotFrameworkReport,
|
|
6
|
+
ZeroShotCachedResults, ZeroShotContactCachedResults, FrameworkReport)
|
|
7
|
+
from .autoeval_supervised_dataset import AutoEvalSupervisedDataset
|
|
8
|
+
from .autoeval_task import AutoEvalTask
|
|
9
|
+
from .autoeval_mode import AutoEvalMode
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"AutoEvalProgress", "AutoEvalReport", "SupervisedFrameworkReport", "ContactFrameworkReport",
|
|
13
|
+
"ZeroShotFrameworkReport",
|
|
14
|
+
"ZeroShotCachedResults", "AutoEvalSupervisedDataset", "AutoEvalTask", "FLIPDatasetName", "all_flip_datasets",
|
|
15
|
+
"PBCSupervisedDatasetName", "all_pbc_supervised_datasets", "AutoEvalMode", "ZeroShotContactCachedResults",
|
|
16
|
+
"FrameworkReport"
|
|
17
|
+
]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
from .autoeval_supervised_dataset import AutoEvalSupervisedDataset
|
|
5
|
+
from ..protocol import Protocol
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FLIPDatasetName(str, Enum):
|
|
9
|
+
AAV = "aav"
|
|
10
|
+
BIND = "bind"
|
|
11
|
+
CONSERVATION = "conservation"
|
|
12
|
+
GB1 = "gb1"
|
|
13
|
+
MELTOME = "meltome"
|
|
14
|
+
SCL = "scl"
|
|
15
|
+
SAV = "sav"
|
|
16
|
+
SECONDARY_STRUCTURE = "secondary_structure"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def all_flip_datasets() -> Dict[str, AutoEvalSupervisedDataset]:
|
|
20
|
+
datasets = [AutoEvalSupervisedDataset(
|
|
21
|
+
name=f"{FLIPDatasetName.AAV}",
|
|
22
|
+
evaluation_metric="spearmans-corr-coeff",
|
|
23
|
+
protocol=Protocol.sequence_to_value,
|
|
24
|
+
splits=["des_mut", "mut_des", "one_vs_many", "two_vs_many", "seven_vs_many", "low_vs_high", "sampled"]
|
|
25
|
+
), AutoEvalSupervisedDataset(
|
|
26
|
+
name=f"{FLIPDatasetName.BIND}",
|
|
27
|
+
evaluation_metric="macro-f1_score",
|
|
28
|
+
protocol=Protocol.residue_to_class,
|
|
29
|
+
splits=["one_vs_many", "two_vs_many", "from_publication", "one_vs_sm", "one_vs_mn", "one_vs_sn"]
|
|
30
|
+
), AutoEvalSupervisedDataset(
|
|
31
|
+
name=f"{FLIPDatasetName.CONSERVATION}/sampled",
|
|
32
|
+
evaluation_metric="accuracy",
|
|
33
|
+
protocol=Protocol.residue_to_class
|
|
34
|
+
), AutoEvalSupervisedDataset(
|
|
35
|
+
name=f"{FLIPDatasetName.GB1}",
|
|
36
|
+
evaluation_metric="spearmans-corr-coeff",
|
|
37
|
+
protocol=Protocol.sequence_to_value,
|
|
38
|
+
splits=["one_vs_rest", "two_vs_rest", "three_vs_rest", "low_vs_high", "sampled"]
|
|
39
|
+
), AutoEvalSupervisedDataset(
|
|
40
|
+
name=f"{FLIPDatasetName.MELTOME}",
|
|
41
|
+
evaluation_metric="spearmans-corr-coeff",
|
|
42
|
+
protocol=Protocol.sequence_to_value,
|
|
43
|
+
splits=["mixed_split", "human", "human_cell"]
|
|
44
|
+
), AutoEvalSupervisedDataset(
|
|
45
|
+
name=f"{FLIPDatasetName.SCL}",
|
|
46
|
+
evaluation_metric="accuracy",
|
|
47
|
+
protocol=Protocol.sequence_to_class,
|
|
48
|
+
splits=["mixed_soft", "mixed_hard", "human_soft", "human_hard", "balanced", "mixed_vs_human_2"]
|
|
49
|
+
), AutoEvalSupervisedDataset(
|
|
50
|
+
name=f"{FLIPDatasetName.SAV}",
|
|
51
|
+
evaluation_metric="f1_score",
|
|
52
|
+
protocol=Protocol.sequence_to_class,
|
|
53
|
+
splits=["mixed", "human", "only_savs"]
|
|
54
|
+
), AutoEvalSupervisedDataset(
|
|
55
|
+
name=f"{FLIPDatasetName.SECONDARY_STRUCTURE}",
|
|
56
|
+
evaluation_metric="accuracy",
|
|
57
|
+
protocol=Protocol.residue_to_class,
|
|
58
|
+
splits=["sampled"]
|
|
59
|
+
)]
|
|
60
|
+
|
|
61
|
+
return {d.name: d for d in datasets}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from .autoeval_supervised_dataset import AutoEvalSupervisedDataset
|
|
5
|
+
|
|
6
|
+
from ..protocol import Protocol
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PBCSupervisedDatasetName(str, Enum):
|
|
10
|
+
CONSERVATION = "conservation"
|
|
11
|
+
DISORDER_CHEZOD = "disorder_chezod"
|
|
12
|
+
# DISORDER_TRIZOD = "disorder_trizod" Currently not used
|
|
13
|
+
FRUSTRATION_CLASSIFICATION = "frustration-classification"
|
|
14
|
+
FRUSTRATION_REGRESSION = "frustration-regression"
|
|
15
|
+
# MEMBRANE = "membrane" Currently not used
|
|
16
|
+
PHAGES = "phages"
|
|
17
|
+
SCL = "scl"
|
|
18
|
+
SECONDARY_STRUCTURE = "secondary_structure"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def all_pbc_supervised_datasets() -> Dict[str, AutoEvalSupervisedDataset]:
|
|
22
|
+
datasets = [AutoEvalSupervisedDataset(name=PBCSupervisedDatasetName.CONSERVATION,
|
|
23
|
+
evaluation_metric="accuracy",
|
|
24
|
+
protocol=Protocol.residue_to_class),
|
|
25
|
+
AutoEvalSupervisedDataset(name=PBCSupervisedDatasetName.DISORDER_CHEZOD,
|
|
26
|
+
evaluation_metric="spearmans-corr-coeff",
|
|
27
|
+
protocol=Protocol.residue_to_value),
|
|
28
|
+
AutoEvalSupervisedDataset(name=PBCSupervisedDatasetName.FRUSTRATION_CLASSIFICATION,
|
|
29
|
+
evaluation_metric="macro-f1_score",
|
|
30
|
+
protocol=Protocol.residue_to_class),
|
|
31
|
+
AutoEvalSupervisedDataset(name=PBCSupervisedDatasetName.FRUSTRATION_REGRESSION,
|
|
32
|
+
evaluation_metric="spearmans-corr-coeff",
|
|
33
|
+
protocol=Protocol.residue_to_value),
|
|
34
|
+
AutoEvalSupervisedDataset(name=PBCSupervisedDatasetName.PHAGES,
|
|
35
|
+
evaluation_metric="accuracy",
|
|
36
|
+
protocol=Protocol.sequence_to_class),
|
|
37
|
+
AutoEvalSupervisedDataset(name=PBCSupervisedDatasetName.SCL,
|
|
38
|
+
evaluation_metric="balanced-accuracy",
|
|
39
|
+
protocol=Protocol.sequence_to_class),
|
|
40
|
+
AutoEvalSupervisedDataset(name=PBCSupervisedDatasetName.SECONDARY_STRUCTURE,
|
|
41
|
+
evaluation_metric="accuracy",
|
|
42
|
+
protocol=Protocol.residue_to_class),
|
|
43
|
+
]
|
|
44
|
+
return {d.name: d for d in datasets}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
|
|
4
|
+
from .autoeval_report import FrameworkReport
|
|
5
|
+
|
|
6
|
+
class AutoEvalProgress(BaseModel):
|
|
7
|
+
completed_tasks: int = Field(description="Number of completed autoeval tasks", ge=0)
|
|
8
|
+
total_tasks: int = Field(description="Total number of autoeval tasks", ge=0)
|
|
9
|
+
current_framework_name: str = Field(description="Name of the current framework that is being evaluated")
|
|
10
|
+
current_task_name: str = Field(description="Name of the current task that is being executed")
|
|
11
|
+
final_report: Optional[FrameworkReport] = Field(default=None, description="Final Framework Report")
|