pna-calc is a lightweight sequence analysis tool for Peptide Nucleic Acid (PNA) PCR clamp design. Created to automate the role of PNAtool (used commonly in PNA discovery workflows) but also designed to be more flexible.
It reads candidate sequences (FASTA), computes sequence metrics, predicts DNA/DNA nearest-neighbor Tm and PNA/DNA Tm, and writes results to CSV. One FASTA file can contain one or many sequences; each input record is processed independently.
For each sequence, pna-calc reports:
dna_tm: DNA/DNA nearest-neighbor melting temperature from BiopythonMeltingTemp.Tm_NN.pna_tm: PNA/DNA melting temperature using the Giesen et al. (1998) empirical correction on top ofdna_tm.- Sequence-derived metrics:
- length
- base counts
- GC content
- purine content
- longest purine stretch
- reverse complement
- internal self-complementarity score
conda create -n pna_calc python=3.11 -y
conda activate pna_calc
conda install -c conda-forge biopython -ypip install -r requirements.txtRun:
python -m pna_calc.cli <input.fasta> -o <output.csv> [options]- Positional
fasta: input FASTA file path. -o,--output: output CSV path.
The input FASTA can contain multiple sequences; output CSV has one row per sequence.
- Profile default:
pnatool. - Profile tuned to be as similar to PNA tool as possible
- No override arguments are applied unless explicitly passed.
-p,--profile {allawi_1997,pnatool}
Profiles provide preset parameter sets for DNA melting temperature calculations.
Profile definitions live in pna_calc/profiles.py.
You can override profile values directly from CLI:
--dnac1(float, nM)--dnac2(float, nM)--na(float, mM)--k(float, mM)--tris(float, mM)--mg(float, mM)--dntps(float, mM)--saltcorr(int, 0-7)--selfcomp(flag)
dnac1 must be greater than or equal to dnac2. This follows Biopython
Tm_NN conventions, where dnac1 is the higher-concentration strand.
If dnac1 < dnac2, the CLI exits with an error.
Default profile (pnatool):
python -m pna_calc.cli test/test.fasta -o results.csvUse the allawi_1997 profile:
python -m pna_calc.cli tests/test.fasta -o results.csv --profile allawi_1997Use profile plus explicit overrides:
python -m pna_calc.cli tests/test.fasta -o results.csv \
--profile pnatool \
--dnac1 6000 \
--dnac2 100 \
--saltcorr 0from pna_calc.tm import dna_nn_tm, pna_tm
from pna_calc.analyze import analyze_sequence, analyze_batch
from pna_calc.profiles import PROFILESdna_nn_tm(seq, ...)requiresseq.pna_tm(seq, ...)requiresseq(validated for lengths 6-30 nt).analyze_sequence(seq, ...)requiresseq.analyze_batch(records, ...)requires an iterable of records with at least{"sequence": ...}.
Simple Tm calls:
dna = dna_nn_tm("CAGTCCAGTT", profile="pnatool")
pna = pna_tm("CAGTCCAGTT", profile="pnatool")Tm call with overrides:
dna = dna_nn_tm(
"CAGTCCAGTT",
profile="allawi_1997",
dnac1=200000,
dnac2=200000,
Na=1000,
saltcorr=0,
)Full sequence analysis:
result = analyze_sequence(
"CAGTCCAGTT",
seq_id="candidate_1",
profile="pnatool",
tm_overrides={"dnac1": 6000, "dnac2": 100, "saltcorr": 0},
)
print("DNA_tm:", result["dna_tm"])
print( "PNA_tm:", result["pna_tm"])CSV output includes one row per input sequence with at least:
idsequencedna_tmpna_tm- metric columns from
pna_calc/metrics.py
Built-in profile registry is in pna_calc/profiles.py:
allawi_1997pnatool
Each profile is an NNProfile object that maps directly to Biopython
Tm_NN parameters. Override values can be supplied via CLI flags or API
keyword arguments.
- This tool currently assumes perfect complementarity for Tm calculations.
- Mismatch handling via
c_seqis not yet exposed.
- Biopython
MeltingTemp(Tm_NNAPI used for DNA Tm prediction and parameter definitions): Bio.SeqUtils.MeltingTemp module (Biopython 1.79)
- Fully replicate Allawi et al 1997 Tm preds
- Better approximate PNAtool Tm preds
- Use PoacV9_01 as check example