Skip to content
lorcaiPublic

About

Peptide Nucleic Acid (PNA) melting temperature and sequence metric screening tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

pna-calc

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.

What It Does

For each sequence, pna-calc reports:

  • dna_tm: DNA/DNA nearest-neighbor melting temperature from Biopython MeltingTemp.Tm_NN.
  • pna_tm: PNA/DNA melting temperature using the Giesen et al. (1998) empirical correction on top of dna_tm.
  • Sequence-derived metrics:
    • length
    • base counts
    • GC content
    • purine content
    • longest purine stretch
    • reverse complement
    • internal self-complementarity score

Installation

Option 1: Conda environment

conda create -n pna_calc python=3.11 -y
conda activate pna_calc
conda install -c conda-forge biopython -y

Option 2: Using an existing Python environment

pip install -r requirements.txt

CLI Usage

Run:

python -m pna_calc.cli <input.fasta> -o <output.csv> [options]

Mandatory CLI parameters

  • 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.

Defaults

  • Profile default: pnatool.
  • Profile tuned to be as similar to PNA tool as possible
  • No override arguments are applied unless explicitly passed.

Profile selection

  • -p, --profile {allawi_1997,pnatool}

Profiles provide preset parameter sets for DNA melting temperature calculations. Profile definitions live in pna_calc/profiles.py.

Experimental overrides (optional)

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)

Important constraint (dnac1 >= dnac2)

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.

CLI examples

Default profile (pnatool):

python -m pna_calc.cli test/test.fasta -o results.csv

Use the allawi_1997 profile:

python -m pna_calc.cli tests/test.fasta -o results.csv --profile allawi_1997

Use profile plus explicit overrides:

python -m pna_calc.cli tests/test.fasta -o results.csv \
  --profile pnatool \
  --dnac1 6000 \
  --dnac2 100 \
  --saltcorr 0

Python API Usage

Import core functions

from pna_calc.tm import dna_nn_tm, pna_tm
from pna_calc.analyze import analyze_sequence, analyze_batch
from pna_calc.profiles import PROFILES

Mandatory API inputs

  • dna_nn_tm(seq, ...) requires seq.
  • pna_tm(seq, ...) requires seq (validated for lengths 6-30 nt).
  • analyze_sequence(seq, ...) requires seq.
  • analyze_batch(records, ...) requires an iterable of records with at least {"sequence": ...}.

API examples

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"])

Output Format

CSV output includes one row per input sequence with at least:

  • id
  • sequence
  • dna_tm
  • pna_tm
  • metric columns from pna_calc/metrics.py

Profiles

Built-in profile registry is in pna_calc/profiles.py:

  • allawi_1997
  • pnatool

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.

Notes

  • This tool currently assumes perfect complementarity for Tm calculations.
  • Mismatch handling via c_seq is not yet exposed.

References

To do

  • Fully replicate Allawi et al 1997 Tm preds
  • Better approximate PNAtool Tm preds
  • Use PoacV9_01 as check example

About

Peptide Nucleic Acid (PNA) melting temperature and sequence metric screening tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages