DNA-Chisel¶
Algorithmic DNA sequence feature extractor that computes 20 biophysical and compositional features -- GC content, codon adaptation, hairpin score, restriction sites, and more -- for synthetic biology quality control and sequence characterization.
License: MIT · Molecules: dna · Tasks: feature_extraction
Actions: encode · Variants: 1
At a glance¶
Use it when
- You need deterministic, interpretable DNA sequence features for synthetic biology QC — codon adaptation, GC content, restriction sites, homopolymers, and hairpins
- You are performing pre-synthesis quality control on optimized gene constructs and need to verify they meet synthesis provider specifications
- You need hand-engineered features to complement learned embeddings from DNA foundation models (Evo, NT, DNABERT-2, Omni-DNA) in downstream ML pipelines
- You need the fastest, cheapest DNA analysis available — CPU-only inference with sub-second response times for high-throughput screening
- You are building an expression prediction model and want interpretable codon usage features (CAI, rare codon frequency) alongside GC content and sequence complexity metrics
- You are evaluating codon optimization results and need quantitative metrics to compare alternative optimized sequences for the same protein
Strengths
- Fully deterministic and interpretable — every output feature (CAI, GC content, restriction sites, homopolymers) has a clear biological definition and is computed from established algorithms, not learned weights
- CPU-only, zero-GPU inference with minimal memory (0.25 CPU, 1 GB RAM) makes it the cheapest model in this catalog to deploy and the fastest for high-throughput feature extraction
- Species-specific codon adaptation index (CAI) using organism-specific codon tables for E. coli, H. sapiens, S. cerevisiae, and other common expression hosts
- Comprehensive 20-feature output in a single API call covers codon usage, sequence composition, structural hazards, cloning compatibility, and complexity metrics
- MIT license — the most permissive license in this catalog, suitable for any commercial, academic, or clinical application without restrictions
- Validated in published synthetic biology workflows for codon optimization quality assessment, pre-synthesis QC, and multi-criteria gene design evaluation
- Complements every ML-based DNA model by providing interpretable features that can be combined with learned embeddings in downstream pipelines
Limitations
- No learned representations — cannot capture complex, non-linear sequence patterns that DNA language models (DNABERT-2, NT, Evo) learn from genomic data
- Not a machine learning model — cannot improve with additional data or be fine-tuned for specific tasks; fixed algorithmic feature computation only
- No generative capability — cannot design or optimize sequences; only evaluates existing sequences against predefined feature criteria
- Codon-level features (CAI, rare codon frequency) are meaningful only for coding sequences; non-coding DNA analysis is limited to compositional features
- Restriction site checking uses a configurable but limited enzyme list (default: EcoRI, BsaI); comprehensive restriction site analysis requires specifying all relevant enzymes
- No variant effect prediction capability — cannot score the functional impact of mutations like language model-based approaches
- Kozak sequence strength uses a simplified consensus check rather than a quantitative model of translation initiation efficiency
Reach for something else when
- You need DNA sequence embeddings that capture complex, non-linear genomic patterns for classification or clustering (use dnabert2, nt, omni_dna, or evo2)
- You need to generate or design novel DNA sequences (use evo or evo2 for DNA generation)
- You need variant effect prediction for non-coding or coding DNA variants (use nt, dnabert2, or evo2 for log-probability-based variant scoring)
- You need regulatory element classification (promoter, enhancer, splice site detection) that requires learned contextual representations (use dnabert2 or nt)
- You need cross-species genomic analysis leveraging patterns learned from multi-species training data (use nt or dnabert2)
- You need to analyze non-coding DNA regions where codon-level features are not meaningful and compositional features alone are insufficient
- You need a model that can adapt or improve with domain-specific training data
Alternatives
| Model | Better when | Worse when |
|---|---|---|
| dnabert2 | Provides learned DNA embeddings that capture complex regulatory patterns, supports variant effect scoring via pseudo-log-likelihood, and generalizes across species | Black-box neural network — features are not directly interpretable; requires GPU; cannot compute species-specific CAI or check restriction sites; DNA-Chisel's features have clear biological definitions |
| omni_dna | Learned embeddings from multi-species training capture complex genomic patterns; supports variant effect prediction and regulatory element classification | Requires GPU and features are not interpretable; DNA-Chisel provides deterministic, explainable features with zero compute overhead |
API & schema¶
Call an action with POST /api/v1/{slug}/{action} — the request envelope is {"items": [...], "params": {...}} and a success returns {"results": [...]}. See the HTTP API page for the base URL, error shape, and full contract.
encode¶
Call it
curl -X POST http://127.0.0.1:8000/api/v1/dna-chisel/encode \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"sequence": "MKTAYIAKQRQISFVKSHFSRQLEERLGLIE"
}
]
}'
Request — DnaChiselEncodeRequest
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
params |
DnaChiselEncodeRequestParams | no | Optional parameters controlling this action (defaults are used when omitted). | |
items |
list[DnaChiselEncodeRequestItem] | yes | items 1–1 | Batch of inputs to process in a single request. Up to 1 sequence per request. |
Nested types
DnaChiselEncodeRequestItem
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
sequence |
string | yes | len 1– | A DNA sequence (A/C/G/T, uppercase only). |
DnaChiselEncodeRequestParams
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
include |
list[DnaChiselFeatureOptions] | no | default ['gc_content', 'cai', 'hairpin_score', … |
Optional outputs to compute and include in the response. |
species |
SupportedSpecies | no | default e_coli |
Species name for codon-related features (e.g., CAI, rare codons). |
restriction_enzymes |
list[string] | null | no | default ['EcoRI', 'BsaI'] |
List of restriction enzymes for site-count feature. Set to None or an empty list to disable. |
DnaChiselFeatureOptions
Allowed values: gc_content, cai, hairpin_score, melting_temperature, restriction_site_count, codon_usage_entropy, rare_codon_frequency, homopolymer_run_length, dinucleotide_frequencies, sequence_length, tata_box_count, non_unique_6mer_count, in_frame_stop_codon_count, methionine_frequency, at_skew, gc_skew, nucleotide_entropy, tandem_repeat_count, gc_content_std_dev, kozak_sequence_strength
SupportedSpecies
Allowed values: e_coli, s_cerevisiae, h_sapiens, c_elegans, b_subtilis, d_melanogaster
Raw JSON Schema
{
"$defs": {
"DnaChiselEncodeRequestItem": {
"additionalProperties": false,
"properties": {
"sequence": {
"description": "A DNA sequence (A/C/G/T, uppercase only).",
"minLength": 1,
"title": "Sequence",
"type": "string"
}
},
"required": [
"sequence"
],
"title": "DnaChiselEncodeRequestItem",
"type": "object"
},
"DnaChiselEncodeRequestParams": {
"additionalProperties": false,
"properties": {
"include": {
"description": "Optional outputs to compute and include in the response.",
"items": {
"$ref": "#/$defs/DnaChiselFeatureOptions"
},
"title": "Include",
"type": "array",
"default": [
"gc_content",
"cai",
"hairpin_score",
"melting_temperature",
"restriction_site_count",
"codon_usage_entropy",
"rare_codon_frequency",
"homopolymer_run_length",
"dinucleotide_frequencies",
"sequence_length",
"tata_box_count",
"non_unique_6mer_count",
"in_frame_stop_codon_count",
"methionine_frequency",
"at_skew",
"gc_skew",
"nucleotide_entropy",
"tandem_repeat_count",
"gc_content_std_dev",
"kozak_sequence_strength"
]
},
"species": {
"$ref": "#/$defs/SupportedSpecies",
"default": "e_coli",
"description": "Species name for codon-related features (e.g., CAI, rare codons)."
},
"restriction_enzymes": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [
"EcoRI",
"BsaI"
],
"description": "List of restriction enzymes for site-count feature. Set to None or an empty list to disable.",
"title": "Restriction Enzymes"
}
},
"title": "DnaChiselEncodeRequestParams",
"type": "object"
},
"DnaChiselFeatureOptions": {
"enum": [
"gc_content",
"cai",
"hairpin_score",
"melting_temperature",
"restriction_site_count",
"codon_usage_entropy",
"rare_codon_frequency",
"homopolymer_run_length",
"dinucleotide_frequencies",
"sequence_length",
"tata_box_count",
"non_unique_6mer_count",
"in_frame_stop_codon_count",
"methionine_frequency",
"at_skew",
"gc_skew",
"nucleotide_entropy",
"tandem_repeat_count",
"gc_content_std_dev",
"kozak_sequence_strength"
],
"title": "DnaChiselFeatureOptions",
"type": "string"
},
"SupportedSpecies": {
"description": "Enum for species supported by `python_codon_tables`.",
"enum": [
"e_coli",
"s_cerevisiae",
"h_sapiens",
"c_elegans",
"b_subtilis",
"d_melanogaster"
],
"title": "SupportedSpecies",
"type": "string"
}
},
"additionalProperties": false,
"properties": {
"params": {
"$ref": "#/$defs/DnaChiselEncodeRequestParams",
"description": "Optional parameters controlling this action (defaults are used when omitted)."
},
"items": {
"description": "Batch of inputs to process in a single request. Up to 1 sequence per request.",
"items": {
"$ref": "#/$defs/DnaChiselEncodeRequestItem"
},
"maxItems": 1,
"minItems": 1,
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "DnaChiselEncodeRequest",
"type": "object"
}
Response — DnaChiselEncodeResponse
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
results |
list[DnaChiselEncodeResponseResult] | yes | Per-input results, returned in the same order as the request items. |
Nested types
DnaChiselEncodeResponseResult
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
gc_content |
number | null | no | GC content of the sequence as a fraction (0–1). | |
cai |
number | null | no | Naive CAI approximation for the selected species: arithmetic mean of per-codon relative adaptiveness weights. Higher values indicate better codon optimization. Note: this is an arithmetic-mean approximation, not the classical geometric-mean CAI; values will differ from published CAI calculators. | |
hairpin_score |
number | null | no | Number of potential hairpin-forming regions detected in the sequence. | |
melting_temperature |
number | null | no | Computed melting temperature of the sequence in degrees Celsius. | |
restriction_site_count |
object | null | no | Number of occurrences of each restriction enzyme recognition site. | |
codon_usage_entropy |
number | null | no | Shannon entropy of the codon usage distribution; higher values indicate more uniform usage. | |
rare_codon_frequency |
number | null | no | Proportion of rare codons (relative usage < 0.1) in the sequence for the selected species. | |
homopolymer_run_length |
integer | null | no | Maximum length of consecutive identical nucleotides (longest homopolymer run). | |
dinucleotide_frequencies |
object | null | no | Relative frequencies of each possible dinucleotide pair. | |
sequence_length |
integer | null | no | Length of the input DNA sequence in nucleotides. | |
tata_box_count |
integer | null | no | Number of TATA box motifs found in the sequence. | |
non_unique_6mer_count |
integer | null | no | Number of distinct 6-mers that appear more than once in the sequence. | |
in_frame_stop_codon_count |
integer | null | no | Number of in-frame stop codons; null if sequence length is not a multiple of 3. | |
methionine_frequency |
number | null | no | Frequency of methionine in the translated protein sequence; null if sequence length is not a multiple of 3. | |
at_skew |
number | null | no | AT skew of the sequence, computed as (A - T) / (A + T). | |
gc_skew |
number | null | no | GC skew of the sequence, computed as (G - C) / (G + C). | |
nucleotide_entropy |
number | null | no | Shannon entropy of the nucleotide composition. | |
tandem_repeat_count |
integer | null | no | Number of tandem repeats (homopolymers) of length >= 3. | |
gc_content_std_dev |
number | null | no | Standard deviation of GC content computed in 50 bp sliding windows. | |
kozak_sequence_strength |
number | null | no | Binary score (1.0/0.0) for whether the sequence starts with the Kozak consensus (GCCRCCATGG). |
Raw JSON Schema
{
"$defs": {
"DnaChiselEncodeResponseResult": {
"properties": {
"gc_content": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "GC content of the sequence as a fraction (0\u20131).",
"title": "Gc Content"
},
"cai": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Naive CAI approximation for the selected species: arithmetic mean of per-codon relative adaptiveness weights. Higher values indicate better codon optimization. Note: this is an arithmetic-mean approximation, not the classical geometric-mean CAI; values will differ from published CAI calculators.",
"title": "Cai"
},
"hairpin_score": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of potential hairpin-forming regions detected in the sequence.",
"title": "Hairpin Score"
},
"melting_temperature": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Computed melting temperature of the sequence in degrees Celsius.",
"title": "Melting Temperature"
},
"restriction_site_count": {
"anyOf": [
{
"additionalProperties": {
"type": "integer"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of occurrences of each restriction enzyme recognition site.",
"title": "Restriction Site Count"
},
"codon_usage_entropy": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Shannon entropy of the codon usage distribution; higher values indicate more uniform usage.",
"title": "Codon Usage Entropy"
},
"rare_codon_frequency": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Proportion of rare codons (relative usage < 0.1) in the sequence for the selected species.",
"title": "Rare Codon Frequency"
},
"homopolymer_run_length": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum length of consecutive identical nucleotides (longest homopolymer run).",
"title": "Homopolymer Run Length"
},
"dinucleotide_frequencies": {
"anyOf": [
{
"additionalProperties": {
"type": "number"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Relative frequencies of each possible dinucleotide pair.",
"title": "Dinucleotide Frequencies"
},
"sequence_length": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Length of the input DNA sequence in nucleotides.",
"title": "Sequence Length"
},
"tata_box_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of TATA box motifs found in the sequence.",
"title": "Tata Box Count"
},
"non_unique_6mer_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of distinct 6-mers that appear more than once in the sequence.",
"title": "Non Unique 6Mer Count"
},
"in_frame_stop_codon_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of in-frame stop codons; null if sequence length is not a multiple of 3.",
"title": "In Frame Stop Codon Count"
},
"methionine_frequency": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Frequency of methionine in the translated protein sequence; null if sequence length is not a multiple of 3.",
"title": "Methionine Frequency"
},
"at_skew": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "AT skew of the sequence, computed as (A - T) / (A + T).",
"title": "At Skew"
},
"gc_skew": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "GC skew of the sequence, computed as (G - C) / (G + C).",
"title": "Gc Skew"
},
"nucleotide_entropy": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Shannon entropy of the nucleotide composition.",
"title": "Nucleotide Entropy"
},
"tandem_repeat_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of tandem repeats (homopolymers) of length >= 3.",
"title": "Tandem Repeat Count"
},
"gc_content_std_dev": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Standard deviation of GC content computed in 50 bp sliding windows.",
"title": "Gc Content Std Dev"
},
"kozak_sequence_strength": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Binary score (1.0/0.0) for whether the sequence starts with the Kozak consensus (GCCRCCATGG).",
"title": "Kozak Sequence Strength"
}
},
"title": "DnaChiselEncodeResponseResult",
"type": "object"
}
},
"properties": {
"results": {
"description": "Per-input results, returned in the same order as the request items.",
"items": {
"$ref": "#/$defs/DnaChiselEncodeResponseResult"
},
"title": "Results",
"type": "array"
}
},
"required": [
"results"
],
"title": "DnaChiselEncodeResponse",
"type": "object"
}
Usage¶
One-line summary: Algorithmic DNA sequence feature extractor that computes 20 biophysical and compositional features -- GC content, codon adaptation, hairpin score, restriction sites, and more -- for synthetic biology quality control and sequence characterization.
Overview¶
DNA-Chisel is a deterministic, CPU-only DNA analysis tool built on the DnaChisel library from the Edinburgh Genome Foundry. It is not a machine learning model -- it uses rule-based algorithms to compute sequence features. This makes it fully reproducible, fast, and interpretable.
By default, if no additional parameters are provided, all 20 features are computed. Users can select any subset of features via the include parameter and specify species-specific codon tables and restriction enzymes.
Architecture¶
| Property | Value |
|---|---|
| Architecture | Algorithmic (rule-based) |
| Parameters | 0 (no learnable parameters) |
| GPU required | No (CPU only) |
| Deterministic | Yes |
| License | MIT |
Capabilities & Limitations¶
CAN be used for: - Computing GC content, CAI, hairpin score, melting temperature, and 16 other DNA features - Checking restriction enzyme site counts for cloning compatibility - Assessing codon optimization quality for a target species - Generating interpretable feature vectors for downstream ML pipelines - Pre-synthesis quality control of synthetic DNA constructs
CANNOT be used for: - Sequence generation or design (use Evo or Evo2 instead) - Learned embeddings or representations (use Nucleotide Transformer or Evo2 instead) - RNA analysis (input must be DNA: A, C, G, T only) - Protein analysis (operates on DNA only)
Other considerations:
- Batch size is 1 (one sequence per request)
- Some features return null when sequence length is not a multiple of 3 (in-frame stop codons, methionine frequency)
Features¶
- GC Content: Fraction of G and C nucleotides (0–1).
- CAI: Codon Adaptation Index for a specified species (default:
e_coli). - Hairpin Score: Number of potential hairpin-forming regions.
- Melting Temperature: Computed melting temperature of the sequence (using
primer3.calc_tm). - Restriction Site Count: Number of occurrences of specified restriction sites.
Enzyme names (default:
["EcoRI", "BsaI"]) are automatically converted into their recognition sequences using Biopython's Restriction module. - Codon Usage Entropy: Shannon entropy of the codon usage distribution.
- Rare Codon Frequency: Proportion of rare codons in the sequence.
- Homopolymer Run Length: Maximum length of consecutive identical nucleotides.
- Dinucleotide Frequencies: Frequencies of each possible dinucleotide.
- Sequence Length: Length of the DNA sequence.
- TATA Box Count: Number of TATA box motifs.
- Non-Unique 6-mer Count: Number of 6-mers that appear more than once.
- In-Frame Stop Codon Count: Number of stop codons in the reading frame.
- Methionine Frequency: Frequency of methionine in the translated sequence.
- AT Skew: (A - T) / (A + T)
- GC Skew: (G - C) / (G + C)
- Nucleotide Entropy: Shannon entropy of nucleotide distribution.
- Tandem Repeat Count: Number of tandem repeats (homopolymers) of length >= 3.
- GC Content Std Dev: Standard deviation of GC content in 50bp windows.
- Kozak Sequence Strength: Score based on the presence of a Kozak consensus sequence.
Usage Examples¶
# Compute all features with default parameters
from models.dna_chisel.schema import (
DnaChiselEncodeRequest,
DnaChiselEncodeRequestItem,
)
request = DnaChiselEncodeRequest(
items=[DnaChiselEncodeRequestItem(sequence="ATGCGTACG")]
)
# Compute specific features for a target species
from models.dna_chisel.schema import (
DnaChiselEncodeRequest,
DnaChiselEncodeRequestItem,
DnaChiselEncodeRequestParams,
DnaChiselFeatureOptions,
)
request = DnaChiselEncodeRequest(
params=DnaChiselEncodeRequestParams(
include=[
DnaChiselFeatureOptions.GC_CONTENT,
DnaChiselFeatureOptions.CAI,
DnaChiselFeatureOptions.RARE_CODON_FREQUENCY,
],
species="h_sapiens",
restriction_enzymes=["EcoRI", "BamHI", "HindIII"],
),
items=[DnaChiselEncodeRequestItem(sequence="ATGAAAGCAATTTTCGTACTG")],
)
Architecture & training¶
Architecture¶
Model Type & Innovation¶
DNA-Chisel is not a machine learning model. It is an algorithmic DNA sequence analysis toolkit built on the DnaChisel library from the Edinburgh Genome Foundry. Rather than learning representations from data, it computes 20 biophysical and sequence-composition features using deterministic algorithms -- GC content, codon adaptation, hairpin detection, restriction site counting, and more.
The key value of wrapping DNA-Chisel as a BioLM endpoint is providing a standardized, always-available API for DNA feature extraction that can be composed with ML-based models (e.g., Evo, Nucleotide Transformer) in multi-model workflows. Unlike ML models, DNA-Chisel is fully deterministic, requires no GPU, and has negligible latency.
Parameters & Layers¶
| Property | Value |
|---|---|
| Architecture | Algorithmic (rule-based) |
| Learnable parameters | 0 |
| GPU required | No |
| Deterministic | Yes |
Training Data¶
Not applicable. DNA-Chisel does not use training data. Feature computations rely on:
- Codon usage tables: From python_codon_tables, covering 6 species (E. coli, S. cerevisiae, H. sapiens, C. elegans, B. subtilis, D. melanogaster)
- Restriction enzyme database: From Biopython's Bio.Restriction module
- Primer3: For melting temperature calculation
Loss Function & Objective¶
Not applicable (algorithmic tool).
Tokenization / Input Processing¶
| Property | Details |
|---|---|
| Input type | Raw DNA sequence (string) |
| Alphabet | A, C, G, T (unambiguous DNA only) |
| Preprocessing | Input must be uppercase A/C/G/T; validation rejects lowercase |
| Max length | No hard limit (practical limit depends on feature) |
| Batch size | 1 sequence per request |
Performance & Benchmarks¶
Published Benchmarks¶
Not applicable. DNA-Chisel computes standard bioinformatics features; there are no accuracy benchmarks in the ML sense.
BioLM Verification Results¶
| Metric | Threshold | Status |
|---|---|---|
| Relative tolerance | 1e-4 | PASS |
Tests cover both explicit parameter selection (subset of features) and default parameters (all 20 features).
Comparison to Alternatives¶
| Tool | Advantage | Disadvantage |
|---|---|---|
| DNA-Chisel (this) | 20 features in one API call; composable with BioLM models | Not a learning model; no embeddings |
| BioPython SeqUtils | More comprehensive sequence utilities | No unified API; requires local installation |
| Benchling API | Full design suite with GUI | Commercial; not open-source |
| CodonW | Specialized codon usage analysis | Narrower scope; command-line only |
Error Bars & Confidence¶
All features are deterministic. The same input always produces the same output. No stochasticity or hardware-dependent variation.
Strengths & Limitations¶
Pros¶
- Fully deterministic -- no randomness, no hardware-dependent variation
- No GPU required -- runs on CPU with minimal resources (0.25 CPU, 1 GB RAM)
- Fast inference -- all features computed in milliseconds
- Comprehensive -- 20 distinct DNA features in a single endpoint
- Species-aware -- codon-related features use species-specific codon tables
- Configurable -- select any subset of features via the
includeparameter
Cons¶
- Not a learning model -- cannot generalize to novel patterns
- Single-sequence processing only (batch_size = 1)
- Some features require sequence length to be a multiple of 3 (in-frame stop codons, methionine frequency)
- Kozak sequence strength is a naive binary check (starts with "GCCRCCATGG" or not)
- Hairpin detection uses fixed parameters (stem_size=20, window=200)
Known Failure Modes¶
- Very short sequences (< 6 nt): Some features like non-unique 6-mer count and GC content std dev will return 0 or degenerate values
- Non-divisible-by-3 sequences: In-frame stop codon count and methionine frequency return
null(not an error) - Invalid restriction enzymes: Validation catches these at request time with a clear error message
Implementation Details¶
Inference Pipeline¶
Request
|-- 1. Validate DNA sequence (A/C/G/T only)
|-- 2. Uppercase sequence
|-- 3. For each feature in params.include:
| |-- Dispatch to compute_* method
| |-- GC content: dnachisel.biotools.gc_content
| |-- CAI: python_codon_tables lookup + arithmetic mean of relative adaptiveness (naive approximation)
| |-- Hairpin: AvoidHairpins specification scoring
| |-- Melting temp: primer3.calc_tm
| |-- Restriction sites: DnaNotationPattern matching
| |-- Entropy features: scipy.stats.entropy
| |-- Others: custom algorithms on raw sequence
|-- 4. Assemble DnaChiselEncodeResponseResult
|-- 5. Return DnaChiselEncodeResponse
Memory & Compute Profile¶
| Property | Value |
|---|---|
| GPU | None (CPU only) |
| Memory | 1 GB |
| CPU | 0.25 cores |
| Cold start | Fast (memory snapshot enabled) |
Determinism & Reproducibility¶
| Setting | Value |
|---|---|
| Deterministic | Yes (all features) |
| Random seeds | Not applicable |
| Hardware dependence | None |
All features are computed using exact arithmetic or well-defined numerical algorithms. Results are identical across all hardware.
Caching Behavior¶
Response caching is handled by the serving layer, not by the model container: - Cache key derived from input sequence and parameters (include list, species, restriction enzymes) - Cache hits are always valid since outputs are deterministic
Versions & Changelog¶
| Version | Date | Changes |
|---|---|---|
| v1 | -- | Initial implementation with 20 DNA features via encode action |
Biology¶
Molecule Coverage¶
Primary Molecule Type(s)¶
DNA-Chisel operates on DNA sequences composed of the four unambiguous nucleotides (A, C, G, T). It computes biophysical and compositional features that are relevant to gene expression, sequence stability, and synthetic biology design.
The tool is applicable to: - Coding sequences (CDS): Codon-level features (CAI, rare codon frequency, in-frame stop codons) are most meaningful for protein-coding DNA - Promoter regions: TATA box count and Kozak sequence strength target regulatory elements - Any DNA: Sequence-level features (GC content, entropy, homopolymer runs) apply to any DNA regardless of function
Cross-Applicability¶
| Molecule Type | Applicability | Evidence | Caveats |
|---|---|---|---|
| Coding DNA (prokaryotic) | High | CAI and codon tables available for E. coli, B. subtilis | Species-specific codon tables must match target organism |
| Coding DNA (eukaryotic) | High | Codon tables for H. sapiens, C. elegans, D. melanogaster, S. cerevisiae | Kozak strength uses a simple consensus check |
| Promoter/regulatory DNA | Moderate | TATA box and GC content features apply | No comprehensive regulatory motif library |
| Synthetic constructs | High | All features designed for synthetic biology QC | Restriction site counting is configurable |
| Non-coding DNA | Moderate | Compositional features (GC, entropy, dinucleotides) apply | Codon-based features are not meaningful |
| RNA sequences | Not supported | Input validation rejects non-ACGT characters | Convert U to T before analysis if needed |
Biological Problems Addressed¶
Problem 1: Codon Optimization Quality Assessment¶
Why this matters: In synthetic biology and recombinant protein expression, the choice of codons affects translation efficiency, mRNA stability, and protein folding. After codon-optimizing a gene for a target host organism, researchers need to verify that the optimization achieved its goals -- high CAI, low rare codon frequency, and no introduced problems (restriction sites, hairpins, homopolymers).
How DNA-Chisel addresses it: The encode action computes CAI (Codon Adaptation Index) and rare codon frequency using species-specific codon usage tables. By including gc_content, gc_content_std_dev, hairpin_score, and homopolymer_run_length, users get a comprehensive quality report for their optimized sequence in a single API call.
Practical interpretation: - CAI close to 1.0 indicates codons match the host's preferred usage - Rare codon frequency close to 0.0 indicates no codons below the 10% relative usage threshold - Homopolymer runs > 6 may cause sequencing or synthesis errors - Hairpin score > 0 indicates potential secondary structure issues
Problem 2: Cloning Compatibility Verification¶
Why this matters: Before ordering synthetic DNA for cloning, researchers must verify that the sequence is free of unwanted restriction enzyme recognition sites that would interfere with the cloning strategy. They also need to check for features that could cause synthesis failures (extreme GC content, long homopolymer runs, repetitive elements).
How DNA-Chisel addresses it: The restriction_site_count feature counts occurrences of any specified restriction enzyme recognition sites (configurable list, default: EcoRI and BsaI). Combined with non_unique_6mer_count (repeated 6-mers that may cause recombination) and tandem_repeat_count, this provides a synthesis-readiness assessment.
Problem 3: Sequence Characterization for ML Pipelines¶
Why this matters: Machine learning models for gene expression prediction, promoter design, or variant effect classification often use hand-engineered features alongside learned representations. DNA-Chisel features (GC content, dinucleotide frequencies, nucleotide entropy, AT/GC skew) provide a standardized, reproducible feature vector for any DNA sequence.
How DNA-Chisel addresses it: All 20 features can be computed in a single API call and returned as a structured JSON response, ready for ingestion into downstream ML pipelines. This is especially useful as complementary features to embeddings from models like Evo or Nucleotide Transformer.
Applied Use Cases¶
Use Case 1: Pre-Synthesis Quality Control (Published)¶
Source: Edinburgh Genome Foundry (2020). DnaChisel is used in automated DNA assembly pipelines for quality-checking optimized sequences before synthesis.
DNA-Chisel features serve as a pre-synthesis checklist: - No unwanted restriction sites - GC content within synthesis-friendly range (25-65%) - No extreme homopolymer runs - Acceptable hairpin score
Use Case 2: Feature Engineering for Expression Prediction (Anticipated)¶
Combining DNA-Chisel features with sequence embeddings from DNA foundation models (Evo, Nucleotide Transformer) for training expression level predictors. The deterministic, interpretable features complement the opaque learned representations.
Related Models¶
Complementary Models¶
- Evo / Evo2: DNA language models that provide learned representations and sequence generation. DNA-Chisel features can complement Evo embeddings as interpretable input features for downstream classifiers.
- Nucleotide Transformer: Provides learned DNA embeddings. DNA-Chisel features can serve as interpretable baselines or complementary features alongside NT embeddings.
Alternative Models¶
| Alternative | Advantage over DNA-Chisel | Disadvantage vs DNA-Chisel |
|---|---|---|
| BioPython SeqUtils | Broader bioinformatics toolkit | No unified API; requires custom integration |
| Benchling | Full design platform with GUI | Commercial; not composable with BioLM models |
| GenScript tools | Industry-standard codon optimization | Commercial; limited to codon analysis |
Biological Background¶
DNA (deoxyribonucleic acid) encodes genetic information as a linear sequence of four nucleotide bases: adenine (A), cytosine (C), guanine (G), and thymine (T). When a gene is expressed, the DNA is transcribed into messenger RNA and then translated into protein according to the genetic code, where each triplet of nucleotides (a "codon") specifies one amino acid.
Key concepts relevant to DNA-Chisel features:
- GC content: The proportion of G and C bases in a sequence. Affects DNA stability (higher GC = higher melting temperature), gene expression efficiency, and synthesis feasibility. Extreme values (< 25% or > 65%) can cause problems for DNA synthesis and PCR.
- Codon Adaptation Index (CAI): A measure of how well the codons in a gene match the preferred codon usage of a target organism. Higher CAI generally correlates with higher protein expression levels. Different organisms use synonymous codons at different frequencies.
- Restriction enzyme sites: Short DNA motifs (4-8 bp) recognized and cut by bacterial restriction endonucleases. Essential for molecular cloning, but unwanted sites within a gene can interfere with cloning strategies.
- Hairpin structures: Regions where a DNA strand can fold back on itself due to complementary sequences, forming stem-loop structures. These can impede transcription, replication, and DNA synthesis.
- Homopolymer runs: Stretches of a single repeated nucleotide (e.g., AAAAAAA). Long runs cause errors in sequencing technologies (especially nanopore and older Illumina chemistry) and can impede DNA synthesis.
- Dinucleotide frequencies: The frequency of each possible pair of adjacent nucleotides. Some dinucleotides (e.g., CpG in mammals) have biological significance due to methylation patterns.
- Shannon entropy: A measure of sequence complexity. Low entropy indicates repetitive or biased composition; high entropy indicates diverse nucleotide usage.
Sources & license¶
License: MIT (text)
Papers
- DNA Chisel, a versatile sequence optimizer — Bioinformatics, 36(16), 4508-4509, 2020 · DOI
Source repositories