genomic-coordinates
Skill này làm gì
Công cụ này đảm bảo thông tin vị trí gen trong bộ gen chính xác và nhất quán. Nó chuyển đổi định dạng, chuẩn hóa cách mô tả biến thể di truyền và kiểm tra tên nhiễm sắc thể hoặc chuỗi có khớp nhau không trước khi lỗi làm sai phân tích.
Khi nào nên dùng
- ✓Khi chuyển đổi giữa các định dạng tệp gen khác nhau (ví dụ từ BED sang GFF).
- ✓Khi dùng dữ liệu gen từ các phiên bản bộ gen khác nhau (ví dụ GRCh37 sang GRCh38).
- ✓Khi so sánh hoặc gộp thông tin di truyền từ các nguồn khác nhau.
Liên kết skill
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/genomic-coordinates/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
“Chuyển tọa độ gen chr7:5,530,601-5,530,625 từ định dạng UCSC sang BED.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ chuyển đổi tọa độ giữa các hệ đếm khác nhau (bắt đầu từ 0 hoặc 1) và các định dạng tệp. Nó cũng chuẩn hóa cách mô tả biến thể để có thể so sánh đúng, và kiểm tra tên các phần của bộ gen có khớp không.
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.
Genomic Coordinates
When to use
Any time a coordinate crosses a boundary: between two file formats, between two tools, between two assemblies, or between the genome and a transcript.
The rule
A coordinate is three facts, not one: the number, the convention it is written in, and the assembly it was measured against. Carry all three or the number is not interpretable.
Coordinate errors are the quietest class of bug in genomics. An off-by-one BED file parses, sorts, and intersects without complaint. A GRCh37 VCF joined against a GRCh38 annotation returns rows. A right-shifted indel simply fails to match its entry in ClinVar, and the result is a variant reported as novel. Nothing raises an error; the answer is just wrong, and it is wrong in a direction that looks plausible.
So: convert with the table, not from memory, and verify against the reference whenever a reference is available.
The two conversions
1-based inclusive -> 0-based half-open : start - 1, end
0-based half-open -> 1-based inclusive : start + 1, end
These formulas apply to nonempty spans on the same reference and strand. They do not encode insertions, circular wraparound, liftover, or transcript mapping.
Which format is which
| 0-based, half-open | 1-based, inclusive |
|---|---|
| BED, bedGraph, bigWig, narrowPeak | GFF3, GTF, VCF |
| BAM (binary POS), BCF (binary POS) | SAM text POS, CRAM absolute alignment start |
| PSL, genePred, refFlat | WIG, Picard interval_list |
| MAF (UCSC multiple alignment) | MAF (TCGA mutation annotation) |
| PyRanges, pybedtools | GRanges/IRanges, samtools & UCSC & Ensembl region strings |
Both "MAF" formats exist, they mean different things, and they disagree. UCSC
serves 0-based files through a 1-based browser box. references/format-conventions.md
has the full table with per-format detail.
cd skills/genomic-coordinates/scripts
python3 convert_coords.py --list # the table
python3 convert_coords.py --from bed --to gff chr1 999 1000
python3 convert_coords.py --from ucsc --to bed "chr7:5,530,601-5,530,625"
python3 convert_coords.py --from granges --to pyranges --input regions.tsv
contig input output length status detail
chr7 chr7:5530601-5530625 5530600-5530625 25 ok
Zero-length BED features (chromStart == chromEnd, a legal insertion point) are
reported as unrepresentable for an inclusive target because the converter lacks
feature semantics. GFF3 can encode insertion sites with equal endpoints and a
feature type; that is different from an ordinary single-base interval. Exit code
is 1 for invalid or unrepresentable output; valid zero-length half-open output
exits 0. Output is a diagnostic TSV/JSON table, not a rewritten GFF/VCF.
--input parses BED/bedGraph, GFF/GTF, literal-allele VCF REF spans, explicit
region strings, and three-column GRanges/PyRanges/Python TSVs. Other table rows
are conventions only: extract an interval with a native parser and pass a triple.
All bundled text readers expect uncompressed files.
Variants are not intervals
For a simple VCF indel, POS normally identifies the unchanged padding base
before the event. At contig position 1 the padding can follow the event. Complex
substitutions need not have an unchanged anchor. And the same change can be written many ways:
chr1:7:CAC:C, chr1:3:CAC:C and chr1:2:GCA:G are one deletion. Joining,
deduplicating, or looking up variants before normalising loses real matches
silently, and it loses them preferentially in repeats, where indels concentrate.
Normalise — trim to parsimony, then left-align against the reference — before any comparison:
python3 normalize_variant.py --fasta ref.fa chr1 7 CAC C
python3 normalize_variant.py --fasta ref.fa --split --input cohort.vcf
python3 normalize_variant.py --fasta ref.fa --compare chr1:7:CAC:C chr1:2:GCA:G
input normalized type pos_shift ref_check changed
chr1:7:CAC:C chr1:2:GCA:G deletion 5 ok yes
Literal alleles are checked against the FASTA using exact contig names. A
MISMATCH can indicate an assembly, sequence, strand, or coordinate error; stop
and investigate with check_contigs.py and sequence provenance. The helper
rejects unsplit ALT lists: use --split for independently normalized allele keys.
Its TSV discards genotypes and annotations; use bcftools norm for production
…
Câu hỏi thường gặp
“0-based half-open” và “1-based inclusive” nghĩa là gì?
Đây là hai cách mô tả vị trí của một chuỗi trong bộ gen. “1-based inclusive” đếm từ 1 và bao gồm cả điểm đầu lẫn điểm cuối. “0-based half-open” đếm từ 0, bao gồm điểm đầu nhưng không bao gồm điểm cuối.
Tại sao cần kiểm tra tên nhiễm sắc thể hoặc contig?
Các nghiên cứu hoặc cơ sở dữ liệu khác nhau có thể dùng tên hơi khác cho cùng một phần của bộ gen. Nếu tên không khớp, công cụ có thể tưởng đang phân tích một nhiễm sắc thể khác, dẫn đến kết quả sai.
Công cụ có sửa được lỗi trong tệp dữ liệu của tôi không?
Công cụ giúp phát hiện và chuyển đổi các chỗ không nhất quán, nhưng không chỉnh sửa tệp gốc của bạn. Nó tạo kết quả hiển thị các sửa đổi hoặc so sánh, để bạn dùng thông tin này sửa dữ liệu hoặc tiếp tục phân tích.
Chi tiết
Mô tả gốc của tác giả
Converts genomic intervals between coordinate conventions, normalises and compares variant representations, and detects assembly or contig-naming mismatches before they corrupt an analysis. Used whenever coordinates cross a format, tool, or assembly boundary - converting between BED, GFF/GTF, VCF, SAM/BAM, WIG, PSL, genePred, Picard interval_list, or region strings; reconciling 0-based half-open w
Độ phổ biến
- Sao GitHub
- 51k
- Vị trí xếp hạng
- #3467
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
13c-metabolic-flux
51kƯớc tính thông lượng chuyển hóa bằng dữ liệu theo dõi đồng vị carbon-13. Hữu ích để phân tích chuyển hóa tế bào và các con đường sinh hóa.
adaptyv
51kThiết kế thí nghiệm đặc trưng protein bằng Adaptyv API. Hỗ trợ ước tính chi phí, gửi trình tự và theo dõi kết quả phòng thí nghiệm.
aeon
51kThực hiện các tác vụ học máy trên dữ liệu chuỗi thời gian. Hữu ích để phân loại, dự báo, phát hiện bất thường và tìm mẫu trong dữ liệu tuần tự.
alphagenome
51kTra cứu các tác động di truyền đã được tính trước cho biến thể gen. Cung cấp điểm số và giải thích để hiểu ảnh hưởng của biến thể lên bộ gen.
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.