mit einem Klick
biopython-bio
// "Bioinformatics operations via Biopython. Use when: user asks about DNA/protein sequences, BLAST, or PDB structures. NOT for: clinical genomics or variant calling pipelines."
// "Bioinformatics operations via Biopython. Use when: user asks about DNA/protein sequences, BLAST, or PDB structures. NOT for: clinical genomics or variant calling pipelines."
# Academic Literature Search — 学术文献检索与引用管理
Search arXiv for preprints in physics, math, CS, quantitative biology, quantitative finance, statistics, electrical engineering, economics. Use when: (1) finding preprints by topic, (2) searching by author, (3) browsing arXiv categories, (4) getting paper metadata/abstracts. NOT for: published journal articles (use crossref-search), biomedical (use pubmed-search).
Screen papers for systematic reviews using ASReview active learning. Use when: user has a large set of papers to screen for inclusion/exclusion, wants to prioritize relevant papers, or needs to reduce manual screening workload. NOT for: searching papers (use literature-search) or meta-analysis (use meta-analysis).
Analyzes astronomical observations and cosmological models including telescope data processing, celestial mechanics calculations, stellar evolution, galaxy classification, and cosmological parameter estimation; trigger when users discuss stars, galaxies, exoplanets, dark matter, or the universe's large-scale structure.
"Astronomical computations via Astropy. Use when: user asks about celestial coordinates, FITS files, or cosmological calculations. NOT for: telescope control or real-time observation planning."
Performs bioinformatics analyses including pathway enrichment, gene ontology analysis, protein-protein interaction networks, multi-omics integration, and biological sequence database querying; trigger when users discuss gene sets, biological pathways, functional annotation, or omics data integration.
| name | biopython-bio |
| 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. |
| metadata | {"openclaw":{"emoji":"🧬","requires":{"bins":["python3"]},"install":[{"id":"uv-biopython","kind":"uv","package":"biopython"}]}} |
Bioinformatics operations using Biopython.
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')
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')
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}")
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}")
from Bio.PDB import PDBParser, PDBList
structure = PDBParser(QUIET=True).get_structure('prot', 'structure.pdb')
for chain in structure[0]:
for res in chain:
if res.id[0] == ' ' and 'CA' in res:
print(f"{res.resname} {res.id[1]}: {res['CA'].coord}")
from Bio import Entrez, Phylo, AlignIO
from Bio.Phylo.TreeConstruction import DistanceCalculator, DistanceTreeConstructor
Entrez.email = 'your.email@example.com' # Required by NCBI
handle = Entrez.esearch(db='pubmed', term='CRISPR AND 2025[pdat]', retmax=5)
record = Entrez.read(handle)
# Phylogenetics from alignment
aln = AlignIO.read('aligned.fasta', 'fasta')
tree = DistanceTreeConstructor().nj(DistanceCalculator('identity').get_distance(aln))
Phylo.draw_ascii(tree)
python3 -c "
from Bio.Seq import Seq
dna = Seq('ATGAAAGCTTGA')
print(f'Protein: {dna.translate()}, RevComp: {dna.reverse_complement()}')
"
Entrez.email before NCBI queries.QUIET=True in PDB parser to suppress warnings.translate().