# Biopython Bio

Bioinformatics operations via Biopython.

- Repository: https://github.com/beita6969/ScienceClaw (1024 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add beita6969/ScienceClaw --skill biopython-bio -g -a claude-code -y`
Codex: `npx skills add beita6969/ScienceClaw --skill biopython-bio -g -a codex -y`
Cursor: `npx skills add beita6969/ScienceClaw --skill biopython-bio -g -a cursor -y`
Gemini CLI: `npx skills add beita6969/ScienceClaw --skill biopython-bio -g -a gemini-cli -y`

## Description

Bioinformatics operations via Biopython. Use when: user asks about DNA/protein sequences, BLAST, or PDB structures. NOT for: clinical genomics or variant calling pipelines.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Biopython Bio

Bioinformatics operations using Biopython.

## When to Use

- Reading/writing sequence files (FASTA, GenBank)
- Running BLAST searches (local or remote NCBI)
- Sequence alignment and manipulation
- Parsing PDB protein structures
- Phylogenetic tree construction
- Querying NCBI Entrez databases

## When NOT to Use

- Clinical genomics or variant calling (use GATK, bcftools)
- RNA-seq differential expression (use DESeq2, edgeR)
- Genome assembly (use SPAdes, Canu)
- Molecular dynamics simulations (use GROMACS, OpenMM)

## Sequence Reading and Writing

```python
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord

for record in SeqIO.parse('sequences.fasta', 'fasta'):
    print(f"{record.id}: {len(record.seq)} bp")

# Write FASTA
records = [SeqRecord(Seq('ATGCGATCGATCG'), id='seq1', description='example')]
SeqIO.write(records, 'output.fasta', 'fasta')
```

## Sequence Manipulation

```python
from Bio.Seq import Seq
from Bio.SeqUtils import gc_fraction, molecular_weight

dna = Seq('ATGCGATCGATCGATCG')
rev_comp = dna.reverse_complement()
protein = dna.translate()
gc = gc_fraction(dna)
mw = molecular_weight(dna, seq_type='DNA')
```

## BLAST Searches

```python
from Bio.Blast import NCBIWWW, NCBIXML

result_handle = NCBIWWW.qblast('blastn', 'nt', 'ATGCGATCGATCGATCG')
for record in NCBIXML.parse(result_handle):
    for aln in record.alignments:
        for hsp in aln.hsps:
            if hsp.expect < 1e-10:
                print(f"{aln.title[:60]}, E={hsp.expect}")
```

## Pairwise Alignment

```python
from Bio import Align

aligner = Align.PairwiseAligner()
aligner.mode = 'global'
aligner.match_score = 2
aligner.mismatch_score = -1
best = aligner.align('ATCGATCGATCG', 'ATCAATCAATCG')[0]
print(best, f"Score: {best.score}")
```

## PDB Structure Parsing

```python
from Bio.PDB import PDBParser, PDBList

The rest: https://github.com/beita6969/ScienceClaw/blob/HEAD/skills/biopython-bio/SKILL.md
