agentleFS
pradyumnasagarpradyumnasagar/open-research-skills/skills/bioinformatics-sequence/sequence-properties/SKILL.md

sequence-properties

Skill8 starsChanged 5 months agoMITView on GitHub

Compute GC content, molecular weight, melting temperature, isoelectric point, and instability index for DNA, RNA, and protein sequences.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No fabricated citations: Every cited work must resolve to a verifiable

    line 20
  2. Distinctive:

    No claim without provenance: Every quantitative or factual claim

    line 21
  3. Distinctive:

    No silent failure: Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero.

    line 22
  4. Very specific:

    Use primer3-py for production work — see the primer-design reference.

    line 79
  5. Distinctive:

    Wallace Tm is wrong for oligos > 14 nt: Use nearest-neighbor (SantaLucia 1998) for production.

    line 164

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- metadata: category: bioinformatics-sequence oversight: low version: 1.0.0 author: Pradyumna Jayaram tags: [bioinformatics-sequence, research] difficulty: intermediate -->

Sequence Properties

Hard rules

  1. No fabricated citations. Every cited work must resolve to a verifiable
  2. No claim without provenance. Every quantitative or factual claim
  3. No silent failure. Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero. A skill that silently swallows errors is a violation.

When to use

  • Pre-alignment sanity checks (a sequence with 90% Ns is not real).
  • Primer/probe design: Tm, GC, hairpin, dimer.
  • Protein characterization: MW, pI, instability, aromaticity, GRAVY.
  • Genome composition: GC content by window, by chromosome, by gene.

When NOT to use

  • Production primer design → use primer3-py (handles salt, oligo concentration, mismatches).
  • Genome-wide GC → use bedtools nuc or computeGCBias (deepTools).
  • Protein domain detection → use InterProScan or pyhmmer.

Prerequisites

  • biopython>=1.83
  • For protein: Bio.SeqUtils.ProtParam
  • For DNA/RNA: Bio.SeqUtils (nt utilities)

Core workflow

  1. Identify the molecule type (DNA, RNA, protein).
  2. Pick the right utility module — ProtParam is for protein, the rest of Bio.SeqUtils for DNA/RNA.
  3. Compute the canonical properties for that type.
  4. Cite the formula in your methods section.

Code patterns

DNA / RNA: GC, MW, Tm

from Bio.Seq import Seq
from Bio.SeqUtils import gc_fraction
from Bio.SeqUtils.MolecularWeight import MolecularWeight
"
s = Seq("ATGCATGCATGCATGCATGC")
print(f"length: {len(s)}")
print(f"GC: {gc_fraction(s):.3f}")  # 0.5

mw_double = MolecularWeight(s)         # double-stranded MW
print(f"ds MW: {mw_double:.1f} Da")

DNA Tm (Wallace rule for short oligos)

For very short oligos (<14 nt), Tm is roughly 2 * (A+T) + 4 * (G+C):

def tm_wallace(seq: str) -> float:
    s = seq.upper()
    return 2 * (s.count("A") + s.count("T")) + 4 * (s.count("G") + s.count("C"))

DNA Tm (Marmur / nearest-neighbor for longer oligos)

Use primer3-py for production work — see the primer-design reference. The nearest-neighbor model (SantaLucia 1998) is the 2026 standard.

# In production: primer3-py
import primer3
tm = primer3.calc_tm("ATGCATGCATGCATGC")

Protein: MW, pI, instability, aromaticity, GRAVY

from Bio.Seq import Seq
from Bio.SeqUtils.ProtParam import ProteinAnalysis

pa = ProteinAnalysis(str(Seq("MGEKLPVRLNVMGYEEDILKQHKWLRNVQTLKDGIVFVD")))

print(f"length: {len(pa.sequence)}")
print(f"MW: {pa.molecular_weight():.1f} Da")
print(f"pI: {pa.isoelectric_point():.2f}")
print(f"instability_index: {pa.instability_index():.1f}")  # <40 stable
print(f"aromaticity: {pa.aromaticity():.3f}")
print(f"gravy: {pa.gravy():.3f}")  # Grand average of hydropathy

Amino acid percent composition

print(pa.get_amino_acids_percent())
# {'A': 0.07, 'C': 0.02, ...}

Secondary structure fraction (Chou-Fasman)

print(pa.secondary_structure_fraction())  # (helix, turn, sheet)

GC content by sliding window

from Bio.Seq import Seq
from Bio.SeqUtils import gc_fraction

def gc_window(seq: Seq, window: int = 100, step: int = 50):
    s = str(seq)
    out = []
    for i in range(0, len(s) - window + 1, step):
        out.append((i, gc_fraction(Seq(s[i:i+window]))))
    return out

CpG observed/expected

CpG O/E = (CpG count) / (C count × G count / N). Used in vertebrate methylation studies.

def cpg_oe(s: str) -> float:
    s = s.upper()
    c = s.count("C")
    g = s.count("G")
    cg = s.count("CG")
    n = c + g
    if c == 0 or g == 0 or n == 0:
        return 0.0
    return cg * n / (c * g)

DNA / RNA / protein ambiguity

gc_fraction excludes N automatically. If you need a denominator that includes Ns, normalize manually:

def gc_with_n(s: str) -> float:
    s = s.upper()
    denom = sum(1 for b in s if b in "ACGTNU")
    gc = sum(1 for b in s if b in "GC")
    return gc / denom if denom else 0.0

Common pitfalls

  • Bio.SeqUtils.GC vs gc_fraction. In 1.80+, the canonical function is gc_fraction(seq). Older code uses GC(seq). The new function returns a fraction; old returned a percentage.
  • Wallace Tm is wrong for oligos > 14 nt. Use nearest-neighbor (SantaLucia 1998) for production.
  • Tm calculation is salt-, oligo-concentration-, and Mg2+-dependent. A "Tm" without conditions is meaningless. primer3-py handles this.
  • Instability index is for in vitro stability of a purified protein, not cellular half-life. Don't conflate.
  • GRAVY negative = hydrophilic, positive = hydrophobic. The sign convention trips people up.

Validation

  • Length: len(seq) == len(str(seq)).
  • GC: 0 ≤ GC ≤ 1.
  • pI: amino acid distribution implies a pI; verify with the expected range for the protein class (e.g., basic proteins have pI > 7).
  • MW: protein MW = sum of residue masses + 18 (water). ProteinAnalysis accounts for this.

Open alternatives

NeedTool
Production primer Tmprimer3-py
Genome-wide GCbedtools nuc, deeptools computeGCBias
Protein domain + pI + GOInterProScan, UniProt
Codon usageBio.SeqUtils.CodonUsage (see codon-usage skill)

References

Changelog

  • 1.0.0 (2026-06-10): Initial adaptation by Pradyumna Jayaram from bio-sequence-properties (bioSkills-main/sequence-manipulation/sequence-properties).

Cross-references

Other skills in this category:

  • batch-processing
  • bowtie2-alignment
  • bwa-alignment
  • bwa-mem2-alignment
  • codon-usage
  • compressed-sequence-files
  • fastq-quality-scores
  • filter-sequences
  • format-conversion
  • hisat2-alignment
  • motif-search
  • paired-end-fastq
  • pysam-genomics
  • read-write-sequences
  • reverse-complement
  • sam-bam-basics
  • samtools-bam-processing
  • seq-objects
  • sequence-slicing
  • sequence-statistics
  • star-alignment
  • transcription-translation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.