dnakit 0.1.0.dev0__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.
- dnakit/__init__.py +108 -0
- dnakit/_version.py +5 -0
- dnakit/alignment/__init__.py +6 -0
- dnakit/alignment/pairwise.py +512 -0
- dnakit/alignment/results.py +188 -0
- dnakit/backends/__init__.py +80 -0
- dnakit/backends/external.py +517 -0
- dnakit/backends/registry.py +207 -0
- dnakit/batch.py +452 -0
- dnakit/cache/__init__.py +5 -0
- dnakit/cache/store.py +424 -0
- dnakit/chunking.py +920 -0
- dnakit/cli/__init__.py +5 -0
- dnakit/cli/__main__.py +6 -0
- dnakit/cli/app.py +814 -0
- dnakit/cli/workflow.py +94 -0
- dnakit/config/__init__.py +5 -0
- dnakit/config/loader.py +381 -0
- dnakit/core/__init__.py +80 -0
- dnakit/core/_json.py +206 -0
- dnakit/core/backend_info.py +70 -0
- dnakit/core/collection.py +163 -0
- dnakit/core/coordinates.py +295 -0
- dnakit/core/enums.py +95 -0
- dnakit/core/facade.py +719 -0
- dnakit/core/feature.py +90 -0
- dnakit/core/gap.py +82 -0
- dnakit/core/issues.py +62 -0
- dnakit/core/provenance.py +305 -0
- dnakit/core/record.py +161 -0
- dnakit/core/results.py +134 -0
- dnakit/core/sequence.py +327 -0
- dnakit/datasets/__init__.py +100 -0
- dnakit/datasets/_advanced_shared.py +198 -0
- dnakit/datasets/_metadata.py +33 -0
- dnakit/datasets/advanced_deduplicate.py +183 -0
- dnakit/datasets/advanced_split.py +302 -0
- dnakit/datasets/clustering.py +286 -0
- dnakit/datasets/config.py +531 -0
- dnakit/datasets/deduplicate.py +303 -0
- dnakit/datasets/evaluation.py +244 -0
- dnakit/datasets/filter.py +135 -0
- dnakit/datasets/neural_clustering.py +221 -0
- dnakit/datasets/results.py +520 -0
- dnakit/datasets/split.py +450 -0
- dnakit/descriptors/__init__.py +102 -0
- dnakit/descriptors/_dinucleotide.py +345 -0
- dnakit/descriptors/_shared.py +180 -0
- dnakit/descriptors/all.py +917 -0
- dnakit/descriptors/basic.py +193 -0
- dnakit/descriptors/codon.py +195 -0
- dnakit/descriptors/complexity.py +201 -0
- dnakit/descriptors/entropy.py +101 -0
- dnakit/descriptors/homopolymer.py +105 -0
- dnakit/descriptors/kmer.py +88 -0
- dnakit/descriptors/results.py +286 -0
- dnakit/descriptors/schema.py +414 -0
- dnakit/descriptors/window.py +203 -0
- dnakit/download/__init__.py +54 -0
- dnakit/download/catalogs.py +166 -0
- dnakit/download/ena.py +131 -0
- dnakit/download/encode.py +103 -0
- dnakit/download/files.py +469 -0
- dnakit/download/indexes.py +233 -0
- dnakit/download/metadata.py +164 -0
- dnakit/download/models.py +227 -0
- dnakit/download/ncbi.py +333 -0
- dnakit/download/sequence.py +133 -0
- dnakit/download/ucsc.py +99 -0
- dnakit/evaluation/__init__.py +81 -0
- dnakit/evaluation/_shared.py +288 -0
- dnakit/evaluation/collection.py +270 -0
- dnakit/evaluation/config.py +591 -0
- dnakit/evaluation/distribution.py +287 -0
- dnakit/evaluation/frechet.py +223 -0
- dnakit/evaluation/generative.py +381 -0
- dnakit/evaluation/reference.py +409 -0
- dnakit/evaluation/results.py +137 -0
- dnakit/evaluation/scorecard.py +211 -0
- dnakit/evaluation/sequence.py +403 -0
- dnakit/evaluation/synthesis.py +249 -0
- dnakit/exceptions.py +189 -0
- dnakit/fingerprints/__init__.py +109 -0
- dnakit/fingerprints/_shared.py +116 -0
- dnakit/fingerprints/advanced.py +829 -0
- dnakit/fingerprints/bit.py +229 -0
- dnakit/fingerprints/encoding.py +351 -0
- dnakit/fingerprints/kmer.py +170 -0
- dnakit/fingerprints/results.py +531 -0
- dnakit/fingerprints/sketch.py +246 -0
- dnakit/io/__init__.py +112 -0
- dnakit/io/_advanced_common.py +105 -0
- dnakit/io/_formats.py +994 -0
- dnakit/io/annotations.py +1179 -0
- dnakit/io/api.py +759 -0
- dnakit/io/config.py +315 -0
- dnakit/io/genbank.py +523 -0
- dnakit/io/indexed.py +1146 -0
- dnakit/io/metadata.py +452 -0
- dnakit/io/parquet.py +56 -0
- dnakit/io/results.py +131 -0
- dnakit/io/source.py +138 -0
- dnakit/io/tables.py +1237 -0
- dnakit/molbio/__init__.py +101 -0
- dnakit/molbio/_shared.py +266 -0
- dnakit/molbio/assembly.py +279 -0
- dnakit/molbio/crispr.py +181 -0
- dnakit/molbio/optimization.py +897 -0
- dnakit/molbio/primer3_design.py +667 -0
- dnakit/molbio/primers.py +899 -0
- dnakit/molbio/restriction.py +573 -0
- dnakit/molbio/results.py +583 -0
- dnakit/ops/__init__.py +588 -0
- dnakit/ops/_common.py +201 -0
- dnakit/ops/circular.py +193 -0
- dnakit/ops/concat.py +204 -0
- dnakit/ops/direction.py +27 -0
- dnakit/ops/edit.py +443 -0
- dnakit/ops/evolution.py +991 -0
- dnakit/ops/mutation.py +151 -0
- dnakit/ops/records.py +1012 -0
- dnakit/ops/translation.py +257 -0
- dnakit/patterns/__init__.py +81 -0
- dnakit/patterns/_shared.py +282 -0
- dnakit/patterns/coding.py +360 -0
- dnakit/patterns/crispr.py +337 -0
- dnakit/patterns/motif.py +721 -0
- dnakit/patterns/regions.py +341 -0
- dnakit/patterns/repeats.py +480 -0
- dnakit/patterns/restriction.py +281 -0
- dnakit/patterns/results.py +411 -0
- dnakit/py.typed +1 -0
- dnakit/references/__init__.py +27 -0
- dnakit/references/models.py +155 -0
- dnakit/references/ncbi.py +785 -0
- dnakit/representations/__init__.py +29 -0
- dnakit/representations/backends.py +928 -0
- dnakit/representations/checkpoints.py +356 -0
- dnakit/representations/extraction.py +220 -0
- dnakit/representations/models.py +395 -0
- dnakit/representations/results.py +79 -0
- dnakit/search/__init__.py +132 -0
- dnakit/search/_http.py +271 -0
- dnakit/search/_shared.py +108 -0
- dnakit/search/blast.py +516 -0
- dnakit/search/ena.py +245 -0
- dnakit/search/encode.py +102 -0
- dnakit/search/ensembl.py +874 -0
- dnakit/search/models.py +159 -0
- dnakit/search/ncbi.py +756 -0
- dnakit/search/ucsc.py +388 -0
- dnakit/secondary_structure/__init__.py +38 -0
- dnakit/secondary_structure/dotbracket.py +410 -0
- dnakit/secondary_structure/nupack.py +589 -0
- dnakit/secondary_structure/results.py +142 -0
- dnakit/similarity/__init__.py +125 -0
- dnakit/similarity/_shared.py +152 -0
- dnakit/similarity/approximate.py +258 -0
- dnakit/similarity/compare.py +162 -0
- dnakit/similarity/dashing.py +936 -0
- dnakit/similarity/distance.py +279 -0
- dnakit/similarity/index.py +365 -0
- dnakit/similarity/matrix.py +254 -0
- dnakit/similarity/results.py +676 -0
- dnakit/similarity/search.py +286 -0
- dnakit/similarity/sketch.py +96 -0
- dnakit/similarity/vector.py +662 -0
- dnakit/standardize/__init__.py +77 -0
- dnakit/standardize/_shared.py +100 -0
- dnakit/standardize/config.py +411 -0
- dnakit/standardize/gaps.py +1060 -0
- dnakit/standardize/normalize.py +565 -0
- dnakit/standardize/results.py +247 -0
- dnakit/standardize/validate.py +487 -0
- dnakit/structure3d/__init__.py +47 -0
- dnakit/structure3d/_shared.py +47 -0
- dnakit/structure3d/geometry.py +773 -0
- dnakit/structure3d/pdb.py +253 -0
- dnakit/structure3d/results.py +233 -0
- dnakit/structure3d/threedna.py +174 -0
- dnakit/thermodynamics/__init__.py +112 -0
- dnakit/thermodynamics/_shared.py +92 -0
- dnakit/thermodynamics/backends.py +653 -0
- dnakit/thermodynamics/calculations.py +837 -0
- dnakit/thermodynamics/config.py +175 -0
- dnakit/thermodynamics/equilibrium.py +340 -0
- dnakit/thermodynamics/optics.py +385 -0
- dnakit/thermodynamics/parameters.py +79 -0
- dnakit/thermodynamics/results.py +445 -0
- dnakit/visualization/__init__.py +43 -0
- dnakit/visualization/_svg.py +185 -0
- dnakit/visualization/advanced.py +314 -0
- dnakit/visualization/config.py +255 -0
- dnakit/visualization/export.py +349 -0
- dnakit/visualization/matrix.py +279 -0
- dnakit/visualization/report.py +431 -0
- dnakit/visualization/results.py +236 -0
- dnakit/visualization/sequence.py +459 -0
- dnakit/workflows/__init__.py +45 -0
- dnakit/workflows/manifest.py +365 -0
- dnakit/workflows/runner.py +1548 -0
- dnakit/workflows/schema.py +898 -0
- dnakit-0.1.0.dev0.dist-info/METADATA +126 -0
- dnakit-0.1.0.dev0.dist-info/RECORD +210 -0
- dnakit-0.1.0.dev0.dist-info/WHEEL +5 -0
- dnakit-0.1.0.dev0.dist-info/entry_points.txt +2 -0
- dnakit-0.1.0.dev0.dist-info/licenses/DISCLAIMER.md +26 -0
- dnakit-0.1.0.dev0.dist-info/licenses/LICENSE +21 -0
- dnakit-0.1.0.dev0.dist-info/licenses/THIRD_PARTY_NOTICES.md +73 -0
- dnakit-0.1.0.dev0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""Bounded native thermodynamics and conditional backend discovery."""
|
|
2
|
+
|
|
3
|
+
from .backends import (
|
|
4
|
+
Primer3CLIAdapter,
|
|
5
|
+
ThermodynamicsBackend,
|
|
6
|
+
conditional_capabilities,
|
|
7
|
+
probe_primer3,
|
|
8
|
+
validate_primer3_result,
|
|
9
|
+
)
|
|
10
|
+
from .calculations import (
|
|
11
|
+
duplex_stability,
|
|
12
|
+
extinction_coefficient_260nm,
|
|
13
|
+
melting_temperature,
|
|
14
|
+
molecular_weight,
|
|
15
|
+
nearest_neighbor,
|
|
16
|
+
salt_correction,
|
|
17
|
+
stacking_interactions,
|
|
18
|
+
window_tm,
|
|
19
|
+
)
|
|
20
|
+
from .config import NearestNeighborConfig, SaltModel, ThermodynamicConditions, TmMethod
|
|
21
|
+
from .equilibrium import (
|
|
22
|
+
MeltingCurveProgress,
|
|
23
|
+
binding_equilibrium,
|
|
24
|
+
cosolvent_tm_correction,
|
|
25
|
+
terminal_stability,
|
|
26
|
+
theoretical_melting_curve,
|
|
27
|
+
)
|
|
28
|
+
from .optics import concentration_from_a260, convert_oligo_quantity, optical_properties
|
|
29
|
+
from .parameters import (
|
|
30
|
+
PARAMETER_SETS,
|
|
31
|
+
SANTALUCIA_1998,
|
|
32
|
+
NearestNeighborParameter,
|
|
33
|
+
NearestNeighborParameterSet,
|
|
34
|
+
)
|
|
35
|
+
from .results import (
|
|
36
|
+
A260ConcentrationResult,
|
|
37
|
+
BindingEquilibriumResult,
|
|
38
|
+
ConditionalCapability,
|
|
39
|
+
CosolventCorrectionResult,
|
|
40
|
+
DuplexStabilityResult,
|
|
41
|
+
ExtinctionCoefficientResult,
|
|
42
|
+
LabelAbsorbanceCorrection,
|
|
43
|
+
MeltingCurvePoint,
|
|
44
|
+
MeltingTemperatureResult,
|
|
45
|
+
MolecularWeightResult,
|
|
46
|
+
NearestNeighborResult,
|
|
47
|
+
OligoQuantityResult,
|
|
48
|
+
OpticalModification,
|
|
49
|
+
OpticalPropertiesResult,
|
|
50
|
+
Primer3ThermodynamicResult,
|
|
51
|
+
SaltCorrectionResult,
|
|
52
|
+
StackingResult,
|
|
53
|
+
StackingStep,
|
|
54
|
+
TerminalStabilityResult,
|
|
55
|
+
TheoreticalMeltingCurveResult,
|
|
56
|
+
WindowTmPoint,
|
|
57
|
+
WindowTmResult,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
__all__ = [
|
|
61
|
+
"PARAMETER_SETS",
|
|
62
|
+
"SANTALUCIA_1998",
|
|
63
|
+
"A260ConcentrationResult",
|
|
64
|
+
"BindingEquilibriumResult",
|
|
65
|
+
"ConditionalCapability",
|
|
66
|
+
"CosolventCorrectionResult",
|
|
67
|
+
"DuplexStabilityResult",
|
|
68
|
+
"ExtinctionCoefficientResult",
|
|
69
|
+
"LabelAbsorbanceCorrection",
|
|
70
|
+
"MeltingCurvePoint",
|
|
71
|
+
"MeltingCurveProgress",
|
|
72
|
+
"MeltingTemperatureResult",
|
|
73
|
+
"MolecularWeightResult",
|
|
74
|
+
"NearestNeighborConfig",
|
|
75
|
+
"NearestNeighborParameter",
|
|
76
|
+
"NearestNeighborParameterSet",
|
|
77
|
+
"NearestNeighborResult",
|
|
78
|
+
"OligoQuantityResult",
|
|
79
|
+
"OpticalModification",
|
|
80
|
+
"OpticalPropertiesResult",
|
|
81
|
+
"Primer3CLIAdapter",
|
|
82
|
+
"Primer3ThermodynamicResult",
|
|
83
|
+
"SaltCorrectionResult",
|
|
84
|
+
"SaltModel",
|
|
85
|
+
"StackingResult",
|
|
86
|
+
"StackingStep",
|
|
87
|
+
"TerminalStabilityResult",
|
|
88
|
+
"TheoreticalMeltingCurveResult",
|
|
89
|
+
"ThermodynamicConditions",
|
|
90
|
+
"ThermodynamicsBackend",
|
|
91
|
+
"TmMethod",
|
|
92
|
+
"WindowTmPoint",
|
|
93
|
+
"WindowTmResult",
|
|
94
|
+
"binding_equilibrium",
|
|
95
|
+
"concentration_from_a260",
|
|
96
|
+
"conditional_capabilities",
|
|
97
|
+
"convert_oligo_quantity",
|
|
98
|
+
"cosolvent_tm_correction",
|
|
99
|
+
"duplex_stability",
|
|
100
|
+
"extinction_coefficient_260nm",
|
|
101
|
+
"melting_temperature",
|
|
102
|
+
"molecular_weight",
|
|
103
|
+
"nearest_neighbor",
|
|
104
|
+
"optical_properties",
|
|
105
|
+
"probe_primer3",
|
|
106
|
+
"salt_correction",
|
|
107
|
+
"stacking_interactions",
|
|
108
|
+
"terminal_stability",
|
|
109
|
+
"theoretical_melting_curve",
|
|
110
|
+
"validate_primer3_result",
|
|
111
|
+
"window_tm",
|
|
112
|
+
]
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""Shared validation and provenance helpers for native thermodynamics."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dnakit.core import (
|
|
6
|
+
DNA,
|
|
7
|
+
Citation,
|
|
8
|
+
DNASequence,
|
|
9
|
+
ExecutionMode,
|
|
10
|
+
ImplementationInfo,
|
|
11
|
+
ImplementationLabel,
|
|
12
|
+
OriginClass,
|
|
13
|
+
Provenance,
|
|
14
|
+
Topology,
|
|
15
|
+
)
|
|
16
|
+
from dnakit.core.facade import resolve_single_dna
|
|
17
|
+
from dnakit.core.gap import Gap
|
|
18
|
+
from dnakit.exceptions import (
|
|
19
|
+
ConfigurationError,
|
|
20
|
+
InvalidAlphabetError,
|
|
21
|
+
UnsupportedGapOperationError,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def canonical_linear_symbols(
|
|
26
|
+
sequence: DNA | DNASequence,
|
|
27
|
+
*,
|
|
28
|
+
operation: str,
|
|
29
|
+
min_length: int,
|
|
30
|
+
max_length: int,
|
|
31
|
+
) -> str:
|
|
32
|
+
if isinstance(sequence, DNA):
|
|
33
|
+
sequence, _ = resolve_single_dna(sequence)
|
|
34
|
+
if not isinstance(sequence, DNASequence):
|
|
35
|
+
raise ConfigurationError(
|
|
36
|
+
f"{operation} requires a DNASequence.",
|
|
37
|
+
code="INVALID_THERMODYNAMIC_SEQUENCE",
|
|
38
|
+
)
|
|
39
|
+
if sequence.topology is Topology.CIRCULAR:
|
|
40
|
+
raise ConfigurationError(
|
|
41
|
+
f"{operation} does not define terminal corrections for circular DNA.",
|
|
42
|
+
code="CIRCULAR_THERMODYNAMICS_UNSUPPORTED",
|
|
43
|
+
)
|
|
44
|
+
if any(isinstance(part, Gap) for part in sequence.parts):
|
|
45
|
+
raise UnsupportedGapOperationError(
|
|
46
|
+
f"{operation} cannot silently omit or bridge explicit Gap objects.",
|
|
47
|
+
code="THERMODYNAMIC_GAP_UNSUPPORTED",
|
|
48
|
+
)
|
|
49
|
+
symbols = sequence.symbols
|
|
50
|
+
if any(symbol not in "ACGT" for symbol in symbols):
|
|
51
|
+
raise InvalidAlphabetError(
|
|
52
|
+
f"{operation} requires unambiguous A/C/G/T symbols.",
|
|
53
|
+
code="AMBIGUOUS_THERMODYNAMICS_UNSUPPORTED",
|
|
54
|
+
)
|
|
55
|
+
if len(symbols) < min_length:
|
|
56
|
+
raise ConfigurationError(
|
|
57
|
+
f"{operation} requires at least {min_length} nucleotide(s).",
|
|
58
|
+
code="THERMODYNAMIC_SEQUENCE_TOO_SHORT",
|
|
59
|
+
context={"sequence_length": len(symbols), "minimum": min_length},
|
|
60
|
+
)
|
|
61
|
+
if len(symbols) > max_length:
|
|
62
|
+
raise ConfigurationError(
|
|
63
|
+
f"{operation} input exceeds its explicit applicability or resource limit.",
|
|
64
|
+
code="THERMODYNAMIC_SEQUENCE_TOO_LONG",
|
|
65
|
+
context={"sequence_length": len(symbols), "maximum": max_length},
|
|
66
|
+
)
|
|
67
|
+
return symbols
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def native_provenance(*, citation: bool = True) -> Provenance:
|
|
71
|
+
citations = (
|
|
72
|
+
(
|
|
73
|
+
Citation(
|
|
74
|
+
"santalucia1998",
|
|
75
|
+
title="A unified view of DNA nearest-neighbor thermodynamics",
|
|
76
|
+
doi="10.1073/pnas.95.4.1460",
|
|
77
|
+
),
|
|
78
|
+
)
|
|
79
|
+
if citation
|
|
80
|
+
else ()
|
|
81
|
+
)
|
|
82
|
+
return Provenance(
|
|
83
|
+
implementation=ImplementationInfo(
|
|
84
|
+
label=ImplementationLabel.REIMPLEMENTATION,
|
|
85
|
+
execution_mode=ExecutionMode.INTERNAL,
|
|
86
|
+
origin_class=OriginClass.PUBLISHED_ALGORITHM,
|
|
87
|
+
citations=citations,
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
__all__ = ["canonical_linear_symbols", "native_provenance"]
|