biology-biopython
Skill này làm gì
Skill đưa ra quy tắc làm việc với chuỗi sinh học và cơ sở dữ liệu trong Python. Dành cho nhà nghiên cứu và sinh viên xử lý file chuỗi hoặc dữ liệu di truyền.
Khi nào nên dùng
- ✓Khi bạn làm việc với chuỗi DNA, RNA hoặc protein trong Python.
- ✓Khi bạn cần đọc hoặc chuyển đổi file FASTA hoặc GenBank.
- ✓Khi bạn muốn chạy tìm kiếm BLAST hoặc lấy bản ghi từ cơ sở dữ liệu NCBI.
Liên kết skill
https://github.com/aiming-lab/AutoResearchClaw/blob/main/.claude/skills/biology-biopython/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Đọc file FASTA này, dịch mỗi chuỗi DNA sang protein và báo cáo hàm lượng GC.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent dùng thư viện Biopython để đọc file chuỗi, tính các giá trị như hàm lượng GC, dịch DNA, và tìm trong cơ sở dữ liệu NCBI. Nó tuân theo các quy tắc như đặt địa chỉ email trước khi truy cập NCBI.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Biopython Bioinformatics Best Practice
Sequence Manipulation
- Create sequences:
from Bio.Seq import Seq; seq = Seq("ATGCGA") - Complement:
seq.complement(); Reverse complement:seq.reverse_complement() - Transcription:
seq.transcribe()(DNA to RNA) - Translation:
seq.translate()(DNA/RNA to protein) - GC content:
from Bio.SeqUtils import gc_fraction; gc_fraction(seq) - Molecular weight:
from Bio.SeqUtils import molecular_weight
File Parsing (SeqIO)
- Read FASTA:
for rec in SeqIO.parse("file.fasta", "fasta"): ... - Read GenBank:
for rec in SeqIO.parse("file.gb", "genbank"): ... - Read single record:
rec = SeqIO.read("file.fasta", "fasta") - Write sequences:
SeqIO.write(records, "output.fasta", "fasta") - Convert formats:
SeqIO.convert("input.gb", "genbank", "output.fasta", "fasta") - Index large files:
idx = SeqIO.index("large.fasta", "fasta")for random access
BLAST Operations
- Online BLAST:
from Bio.Blast import NCBIWWW; result = NCBIWWW.qblast("blastn", "nt", seq) - Parse results:
from Bio.Blast import NCBIXML; records = NCBIXML.parse(result) - Local BLAST: run via subprocess, parse XML output with NCBIXML
- Always set
Entrez.emailbefore any NCBI access - Filter results by e-value (typically < 1e-5) and coverage
NCBI Database Access (Entrez)
- Always set email:
Entrez.email = "your@email.com" - Search:
handle = Entrez.esearch(db="pubmed", term="query") - Fetch records:
handle = Entrez.efetch(db="nucleotide", id="ID", rettype="fasta") - Use API key for higher rate limits (10 req/s vs 3 req/s)
- Respect NCBI rate limits; add delays between batch requests
Phylogenetics (Bio.Phylo)
- Read trees:
from Bio import Phylo; tree = Phylo.read("tree.nwk", "newick") - Draw trees:
Phylo.draw(tree)orPhylo.draw_ascii(tree) - Supported formats: newick, nexus, phyloxml
- Traverse clades:
for clade in tree.find_clades(): ... - Calculate distances:
tree.distance(clade1, clade2)
Structure Analysis (Bio.PDB)
- Parse PDB:
parser = PDBParser(); structure = parser.get_structure("id", "file.pdb") - Hierarchy: Structure > Model > Chain > Residue > Atom
- Get atoms: iterate through
structure.get_atoms() - Calculate distances: use atom coordinate vectors
- For mmCIF files: use
MMCIFParser()instead ofPDBParser()
Common Pitfalls
- Always handle
SeqIO.parseas an iterator — it exhausts after one pass - Check sequence alphabet compatibility before operations
- Large files: use
SeqIO.index()notSeqIO.to_dict()to avoid memory issues - Set proper timeout for remote BLAST queries (can take minutes)
- Validate parsed data — missing annotations are common in public databases
Câu hỏi thường gặp
Tôi có cần đặt gì trước khi dùng NCBI không?
Có. Skill nói phải đặt địa chỉ email của bạn trước khi truy cập cơ sở dữ liệu NCBI.
Nó có xử lý được file lớn không?
Có. Nó có thể lập chỉ mục file FASTA lớn để truy cập ngẫu nhiên.
Nó có chạy BLAST cục bộ được không?
Có. Nó có thể chạy BLAST qua lệnh cục bộ và phân tích đầu ra XML, hoặc tìm kiếm trực tuyến.
Chi tiết
Mô tả gốc của tác giả
Bioinformatics with Biopython for sequence manipulation, file parsing, BLAST, and phylogenetics. Use when working with DNA/RNA/protein sequences or biological databases.
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #11045
- Giấy phép
- MIT
- Cập nhật
- 19/8/2026
Bình luận
- …
Thêm skill từ kho mã này
a-evolve
15kGiúp agent cải thiện qua nhiều lần chạy bằng cách chẩn đoán lỗi, tạo skill nhắm đúng từ các mẫu lỗi và ghi lại bài học để dùng sau.
chemistry-rdkit
15kGiúp agent phân tích phân tử viết dưới dạng chuỗi SMILES bằng RDKit, bao gồm descriptor, fingerprint, độ tương đồng và tìm kiếm cấu trúc con.
hypothesis-formulation
15kGiúp agent biến một quan sát thành các giả thuyết có thể kiểm tra, kèm các lời giải thích cạnh tranh và dự đoán rõ ràng có thể bác bỏ chúng.
literature-search
15kGiúp agent lên kế hoạch và chạy tìm kiếm tài liệu có hệ thống, với chuỗi tìm kiếm, tiêu chí đưa vào, bước sàng lọc và số đếm kiểu PRISMA.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.