MCP HubMCP Hub
SKILL·AD3A5F

genomic-coordinates

K-Dense-AI
업데이트됨 28 days ago
5 조회
34,665
3,357
34,665
GitHub에서 보기
메타powerpointdesign

정보

이 스킬은 다양한 형식과 어셈블리 간의 유전체 좌표 변환 및 변이 정규화를 처리하여 일반적인 분석 오류를 방지합니다. 0-기반과 1-기반 인덱싱의 차이를 관리하고, 인델을 좌측 정렬하며, 어셈블리 불일치를 탐지합니다. 서로 다른 좌표 규약을 사용하는 도구를 통합하거나 "오프 바이 원" 또는 게놈 빌드 문제를 디버깅할 때 활용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add K-Dense-AI/claude-scientific-skills -a claude-code
플러그인 명령대체
/plugin add https://github.com/K-Dense-AI/claude-scientific-skills
Git 클론대체
git clone https://github.com/K-Dense-AI/claude-scientific-skills.git ~/.claude/skills/genomic-coordinates

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

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

The end coordinate never moves. If a conversion changed both numbers, it is wrong.

Which format is which

0-based, half-open1-based, inclusive
BED, bedGraph, bigWig, narrowPeakGFF3, GTF, VCF
BAM/CRAM (binary POS)SAM (text POS)
PSL, genePred, refFlatWIG, Picard interval_list
MAF (UCSC multiple alignment)MAF (TCGA mutation annotation)
PyRanges, pybedtoolsGRanges/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 rather than converted to end = start - 1. Exit code is 1 when any interval is degenerate or invalid.

Variants are not intervals

A VCF POS for an indel is the anchor base — the base before the event, itself unchanged. 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

Every record's REF is checked against the FASTA first. A MISMATCH means the variants and the reference are different assemblies — stop and run check_contigs.py rather than adjusting coordinates. Multi-allelic records must be split with --split before normalising, never after.

HGVS shifts indels the opposite way, 3'-most along the transcript. For a minus-strand gene that is the opposite genomic direction from VCF's left-alignment. Details and the full procedure: references/variant-representation.md.

Check the assembly before trusting a join

python3 check_contigs.py --identify unknown.fa.fai
python3 check_contigs.py variants.vcf annotation.gtf --genome GRCh38.fa.fai
file          kind    contigs  naming        assembly  detail
ref.fa.fai    sizes   25       plain         GRCh37    24/24 primary chromosome lengths match;
                                                       chrM is 16569 bp, i.e. GRCh37/38 (rCRS MT)

The script reads .fai, .chrom.sizes, VCF headers, SAM headers, FASTA, BED, and GTF/GFF, identifies the assembly from primary-chromosome lengths, and reports every reason a join between two files would go wrong: naming mismatch, length conflict, coordinates past a contig end, contigs present in one file only. Exit code 1 on any incompatibility.

GRCh37 and hg19 differ only in the mitochondrion — 16,569 bp (rCRS) versus 16,571 bp. Nuclear coordinates are identical, so a mixed pipeline runs fine and only the mtDNA results are wrong. check_contigs.py reports which one it found. Builds, naming schemes, ALT contigs, and liftover pitfalls: references/reference-builds.md.

Audit a file against its own format

python3 audit_intervals.py peaks.bed
python3 audit_intervals.py gencode.gtf --genome hg38.chrom.sizes
python3 audit_intervals.py cohort.vcf --genome GRCh38.fa.fai

Looks for the evidence that a coordinate mistake leaves behind:

FindingWhat it proves
start_below_one in GFF/GTF0-based data in a 1-based file; everything is one base left
many_zero_length in BED1-based single-base features written into a 0-based file
past_contig_endwrong assembly, or an off-by-one at the contig edge
mixed_contig_namingany join will silently match one subset
first_block_offsetBED12 blockStarts written as absolute coordinates
not_parsimoniousuntrimmed alleles; normalise before joining
bad_alt_alleleEnsembl/VEP - notation in a VCF, which has no anchor base

Exit code 1 on any fatal finding, so it works as a CI gate on a data directory.

Transcript, CDS, and protein positions

c.742 and chr17:7,674,220 are both "position", and neither converts to the other by arithmetic. Transcript coordinates count spliced bases in transcription order — decreasing genomic coordinate on the minus strand — and c.1 is the A of the initiator ATG, not the start of the transcript.

The rules that get mis-remembered: there is no c.0; 5' UTR positions are negative and 3' UTR positions take a *; GFF phase is the bases to remove to reach the next codon, not start % 3; and a c. description is meaningless without a versioned transcript accession, because the same variant numbers differently in each transcript. references/transcript-coordinates.md has the conversion procedure and the boundary cases.

Do the conversion with a tool that holds the transcript model — VEP, bcftools csq, Mutalyzer, the hgvs package — not by hand.

Reporting results

State the assembly next to the coordinates, every time. chr7:5,530,601-5,530,625 is not a location; chr7:5,530,601-5,530,625 (GRCh38) is. Say which convention a coordinate column is in, in the column header or the file's documentation. When a conversion produced a result, say which direction it went.

References

  • references/format-conventions.md — every format's convention, with per-format detail, BED12 block rules, region-string syntax, and tool behaviour.
  • references/variant-representation.md — VCF allele conventions, the normalisation algorithm, equivalence checking, multi-allelic splitting, and how HGVS disagrees with VCF.
  • references/reference-builds.md — build signatures, GRCh37 vs hg19, ALT contigs, naming schemes, and liftover failure modes.
  • references/transcript-coordinates.md — genomic ↔ transcript ↔ CDS ↔ protein, HGVS numbering, phase, and transcript choice.

GitHub 저장소

K-Dense-AI/claude-scientific-skills
경로: skills/genomic-coordinates
0
agent-skillsai-scientistbioinformaticschemoinformaticsclaudeclaude-skills
FAQ

자주 묻는 질문

genomic-coordinates Skill이란 무엇인가요?

genomic-coordinates은(는) K-Dense-AI이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 genomic-coordinates 관련 작업을 수행할 수 있게 합니다.

genomic-coordinates은(는) 어떻게 설치하나요?

이 페이지의 설치 명령을 사용하세요. genomic-coordinates을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.

genomic-coordinates은(는) 어떤 카테고리에 속하나요?

genomic-coordinates은(는) 메타 카테고리에 속합니다.

genomic-coordinates은(는) 무료로 사용할 수 있나요?

네. genomic-coordinates은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.

연관 스킬

content-collections
메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기
polymarket
메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기
creating-opencode-plugins
메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기
sglang
메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기