vcfart 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ ## 1.0.1 — 2026-11-13
4
+ - First release on PyPI: `python -m pip install vcfart` (published from GitHub Actions, trusted publishing).
5
+ - README images and links use absolute URLs so they render on PyPI; sdist now ships the test fixtures
6
+ and examples; SPDX license metadata; Python ≥ 3.9.
7
+
8
+ ## 1.0.0 — 2026-11-13
9
+ First stable public release.
10
+ - `vcfart generate`: SNV / deletion / insertion / codon (DMS) saturation from HGVS c./n./g. ranges,
11
+ exon/intron/cds shortcuts, `--exonic-only`, left-normalized de-duplicated VCF 4.2, TSV with HGVS c./p.
12
+ + SO consequences, optional oligo-library FASTA with adapters.
13
+ - `vcfart info`: exon/intron table in c. and genomic coordinates + build sanity checks.
14
+ - `vcfart fetch-annotation`: UCSC refGene / ncbiRefSeq download into `~/.vcfart`.
15
+ - MultiQC-style coloured log with a consequence bar chart (`--no-color`, `NO_COLOR`).
16
+ - Reads UCSC genePred (incl. ANNOVAR `humandb/*_refGene.txt`) and GTF; no third-party dependencies.
17
+ - Validated on hg38: reproduces the original in-house MAVE scripts (1,332 SNVs) and matches ANNOVAR
18
+ refGene c./p. for all 6,669 CDS SNVs of DRC1 (`examples/compare_annovar.py`).
19
+ - Korean README (`README.ko.md`) and a homepage (`docs/`, GitHub Pages).
@@ -0,0 +1,18 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use VCFART, please cite it as below."
3
+ title: "VCFART: VCF ARTificial - saturation-mutagenesis VCF generator for MAVE, SGE and DMS"
4
+ version: 1.0.1
5
+ date-released: 2026-11-13
6
+ license: MIT
7
+ repository-code: "https://github.com/CleanCham-lab/VCFART"
8
+ authors:
9
+ - family-names: Chae
10
+ given-names: Seung Won
11
+ affiliation: "Department of Laboratory Medicine, Seoul National University Hospital"
12
+ keywords:
13
+ - MAVE
14
+ - saturation mutagenesis
15
+ - saturation genome editing
16
+ - deep mutational scanning
17
+ - VCF
18
+ - HGVS
vcfart-1.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Seung Won Chae
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ include LICENSE README.md README.ko.md CHANGELOG.md CITATION.cff
2
+ recursive-include tests *.py
3
+ recursive-include examples *.fa *.txt *.sh *.py
vcfart-1.0.1/PKG-INFO ADDED
@@ -0,0 +1,235 @@
1
+ Metadata-Version: 2.4
2
+ Name: vcfart
3
+ Version: 1.0.1
4
+ Summary: VCF ARTificial: generate saturation-mutagenesis VCFs (all SNVs / indels / codon swaps) from a transcript + HGVS range, for MAVE, SGE, DMS and SpliceAI scans
5
+ Author: Seung Won Chae
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://cleancham-lab.github.io/VCFART/
8
+ Project-URL: Repository, https://github.com/CleanCham-lab/VCFART
9
+ Project-URL: Documentation, https://github.com/CleanCham-lab/VCFART#readme
10
+ Project-URL: Changelog, https://github.com/CleanCham-lab/VCFART/blob/main/CHANGELOG.md
11
+ Project-URL: Issues, https://github.com/CleanCham-lab/VCFART/issues
12
+ Keywords: VCF,MAVE,saturation mutagenesis,SGE,DMS,HGVS,SpliceAI,variant library
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Environment :: Console
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
18
+ Classifier: Intended Audience :: Science/Research
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Provides-Extra: gz
23
+ Requires-Dist: pysam; extra == "gz"
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest; extra == "test"
26
+ Dynamic: license-file
27
+
28
+ <p align="center">
29
+ <picture>
30
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/CleanCham-lab/VCFART/main/logo/logo_dark.png">
31
+ <img src="https://raw.githubusercontent.com/CleanCham-lab/VCFART/main/logo/logo.png" alt="VCFART" width="640">
32
+ </picture>
33
+ </p>
34
+
35
+ <p align="center">
36
+ <b>VCF ARTificial</b> — blow out every possible variant of a transcript region as a ready-to-annotate VCF.<br>
37
+ <i>뿌뿡 (ppu-ppung) 💨 — for MAVE, saturation genome editing (SGE), deep mutational scanning (DMS) and SpliceAI scans.</i>
38
+ </p>
39
+
40
+ <p align="center">
41
+ <img src="https://img.shields.io/badge/python-3.9%2B-blue" alt="python">
42
+ <img src="https://img.shields.io/badge/dependencies-none-brightgreen" alt="no dependencies">
43
+ <img src="https://img.shields.io/badge/license-MIT-lightgrey" alt="MIT">
44
+ <a href="https://cleancham-lab.github.io/VCFART/"><img src="https://img.shields.io/badge/homepage-%F0%9F%92%A8%20vcfart-523f85" alt="homepage"></a>
45
+ </p>
46
+
47
+ **English** | [한국어](https://github.com/CleanCham-lab/VCFART/blob/main/README.ko.md) | [Homepage](https://cleancham-lab.github.io/VCFART/)
48
+
49
+ ---
50
+
51
+ ## 💨 What it does
52
+
53
+ Give VCFART a reference genome (hg19 / hg38), a transcript (`NM_007294.4`) and a range written the way
54
+ you already think about it (`c.5075-100_c.5152+100`, `exon17:100`, `chr17:43063774-43064051`).
55
+ It writes:
56
+
57
+ | file | content |
58
+ |---|---|
59
+ | `PREFIX.vcf` | every variant, VCF 4.2, sorted, left-normalized, de-duplicated, REF checked against your FASTA |
60
+ | `PREFIX.tsv` | one row per variant: HGVS c., HGVS p., consequence, exon/intron, generator, region label |
61
+ | `PREFIX.oligos.fa` | *(optional, `--oligo`)* mutant sequences in transcript orientation, with your adapters — an oligo-pool order sheet |
62
+
63
+ The VCF goes straight into **SpliceAI, ANNOVAR, VEP, CADD, AlphaMissense lookups, bcftools** …
64
+ so you can score a whole MAVE library *in silico* before (or after) the wet lab.
65
+
66
+ <p align="center"><img src="https://raw.githubusercontent.com/CleanCham-lab/VCFART/main/docs/terminal.png" alt="VCFART run in a terminal" width="760"></p>
67
+
68
+ ### ✨ Features
69
+
70
+ - **Transcript-aware coordinates** — full HGVS c./n. numbering: CDS, 5′/3′ UTR (`c.-30`, `c.*12`),
71
+ intronic offsets (`c.5075-1`, `c.-30+5`), positions beyond the transcript; minus-strand genes handled
72
+ (no more manual complementing of bases).
73
+ - **Mutation generators**
74
+ - `snv` — all 3 alternative bases at every position (default)
75
+ - `del` — deletions of any lengths (`--del-sizes 1,2,3`)
76
+ - `ins` — insertions of every k-mer between every pair of bases (`--ins-sizes 1`)
77
+ - `codon` — DMS-style codon swaps: one codon per amino acid + Ter + a synonymous control
78
+ (`--codon-set aa`), all 63 codons (`all`) or NNK (`nnk`); codon choice by human usage or fewest
79
+ nucleotide edits (`--codon-pick min-edit`)
80
+ - **Correct indel bookkeeping** — VCF records are left-normalized with an anchor base; equivalent edits
81
+ (e.g. deleting any C of `CCCCCC`) collapse into one record; HGVS follows the 3′ rule
82
+ (`c.24del`, `c.13_15dup`).
83
+ - **Annotation per variant** — HGVS c., predicted HGVS p. (`p.Trp6Ter`, `p.Glu5del`,
84
+ `p.Glu3LysfsTer?`, `p.Ter9GlnextTer5`, `p.Met1?`), Sequence Ontology consequences
85
+ (splice donor/acceptor, donor 5th base, polypyrimidine tract, splice region, missense, …) and region
86
+ (`intron8`, `exon9`).
87
+ - **Oligo library output** — mutant window sequence per variant (+ WT), optional padding and 5′/3′ adapters.
88
+ - **Uses what you already have** — ANNOVAR `humandb/hg38_refGene.txt` works as-is; UCSC
89
+ `refGene` / `ncbiRefSeq` tables; RefSeq or GENCODE GTF (ENST IDs). `chr16` vs `16` naming is matched automatically.
90
+ - **Safety checks** — warns when the CDS does not start with ATG / end with a stop or when introns lack
91
+ GT-AG motifs (= genome build and annotation do not match).
92
+ - **Zero dependencies** — pure Python ≥ 3.9 standard library; reads/creates the `.fai` index itself.
93
+ - **Readable runs** — MultiQC-style coloured log with a consequence bar chart; colour turns off when
94
+ piped, with `--no-color` or `NO_COLOR=1`.
95
+
96
+ ---
97
+
98
+ ## 📦 Install
99
+
100
+ ```bash
101
+ python -m pip install vcfart
102
+ vcfart --version
103
+
104
+ # development version
105
+ python -m pip install git+https://github.com/CleanCham-lab/VCFART.git
106
+ ```
107
+
108
+ ## 🚀 Quick start (10 seconds, bundled demo genome)
109
+
110
+ ```bash
111
+ git clone https://github.com/CleanCham-lab/VCFART.git && cd VCFART/examples
112
+ ./run_demo.sh # writes examples/out/*.vcf / *.tsv / *.oligos.fa
113
+ ```
114
+
115
+ ## 🧬 Real data
116
+
117
+ ```bash
118
+ # 1. transcript table — reuse ANNOVAR's, or download once from UCSC
119
+ vcfart fetch-annotation -b hg38 # -> ~/.vcfart/hg38.ncbiRefSeq.txt.gz
120
+ # (behind an SSL-inspecting proxy: add --insecure, or wget the URL it prints)
121
+
122
+ # 2. look at the exon/intron map in c. and genomic coordinates
123
+ vcfart info -b hg38 -t NM_007294.4 -f hg38.fa
124
+
125
+ # 3. generate: BRCA1 exon 17 (c.5075-c.5152) with 100 bp of each flanking intron
126
+ vcfart generate -f hg38.fa -b hg38 -t NM_007294.4 \
127
+ -r int16=c.5075-100_c.5075-1 \
128
+ -r ex17=c.5075_c.5152 \
129
+ -r int17=c.5152+1_c.5152+100 \
130
+ -o BRCA1_ex17
131
+
132
+ # same region, short form (exon numbers follow your transcript model -- check with `vcfart info`)
133
+ vcfart generate -f hg38.fa -a humandb/hg38_refGene.txt -t NM_007294 -r exon17:100 -o BRCA1_ex17
134
+ ```
135
+
136
+ ### 🎯 Region syntax (`-r`, repeatable, optional `LABEL=` prefix)
137
+
138
+ | form | meaning |
139
+ |---|---|
140
+ | `c.5075-100_c.5075-1` or `c.5075-100_5075-1` | HGVS c. range (intronic offsets, `c.-N`, `c.*N` allowed) |
141
+ | `c.5075` | a single position |
142
+ | `n.10_n.250` | non-coding transcripts (NR_ / lncRNA) |
143
+ | `g.43063774_43064051` or `chr17:43,063,774-43,064,051` | genomic, 1-based inclusive |
144
+ | `exon17`, `exon17:100`, `exon17:100:50` | exon (transcript order), + flank on both sides, + 5′ and 3′ flank |
145
+ | `intron16` | whole intron |
146
+ | `cds` | c.1 … end of the stop codon (use with `--exonic-only` for a CDS-only scan) |
147
+
148
+ A range is a contiguous stretch of the genome, so `c.1_c.600` across several exons includes the introns in
149
+ between (VCFART tells you). Add `--exonic-only` for cDNA-style saturation of exonic bases only.
150
+
151
+ ### ⚙️ Main options (`vcfart generate -h` for all)
152
+
153
+ | option | default | |
154
+ |---|---|---|
155
+ | `-m snv,del,ins,codon` | `snv` | mutation generators to run |
156
+ | `--del-sizes` / `--ins-sizes` | `1` | indel lengths (comma-separated) |
157
+ | `--codon-set aa\|all\|nnk` · `--codon-pick usage\|min-edit` | `aa` · `usage` | codon mode |
158
+ | `--exonic-only` | off | keep only exonic positions (cDNA / CDS saturation) |
159
+ | `--sites-only` | off | drop the dummy `FORMAT/GT` sample column (default writes `GT=0/1`, ANNOVAR-friendly) |
160
+ | `--id hgvs\|index\|none` | `hgvs` | VCF ID column (`c.5075-1G>C` by default) |
161
+ | `--oligo --oligo-pad N --adapter5 SEQ --adapter3 SEQ` | off | oligo library FASTA |
162
+ | `--oligo-strand transcript\|plus` | `transcript` | oligo orientation |
163
+ | `--chrom` | — | choose the locus if a transcript maps to several (PAR, alt contigs) |
164
+
165
+ ### 🏷️ VCF INFO fields
166
+
167
+ `VA_TX`, `VA_GENE`, `VA_HGVSc`, `VA_HGVSp` (`=` written as `%3D`, as VEP does), `VA_CSQ`,
168
+ `VA_REGION`, `VA_TYPE` (SNV/MNV/DEL/INS/DELINS), `VA_ORIGIN` (generator), `VA_SET` (region label).
169
+
170
+ ### 🔗 Downstream examples
171
+
172
+ ```bash
173
+ spliceai -I BRCA1_ex17.vcf -O BRCA1_ex17.spliceai.vcf -R hg38.fa -A grch38
174
+ perl table_annovar.pl BRCA1_ex17.vcf humandb/ -buildver hg38 -out BRCA1_ex17 \
175
+ -protocol refGene -operation g -vcfinput -remove -nastring .
176
+ vep -i BRCA1_ex17.vcf --fasta hg38.fa --cache --hgvs --everything -o BRCA1_ex17.vep.txt
177
+ ```
178
+
179
+ ---
180
+
181
+ ## 📏 Conventions (read once)
182
+
183
+ - **VCF** records are left-aligned (bcftools-norm style) with the preceding base as anchor for indels.
184
+ Variants that are identical at the sequence level are written once; `VA_SET`/`VA_ORIGIN` list every
185
+ region/generator that produced them.
186
+ - **HGVS c.** is described on the genomic sequence with the 3′ rule applied along the transcript,
187
+ including across exon/intron borders (an insertion generated in the intron next to an exon can be
188
+ reported with exonic coordinates when the resulting sequence is identical). The TSV keeps the region
189
+ label it was generated from.
190
+ - **HGVS p.** is a prediction from the reference CDS (no splicing effect is modelled — that is what
191
+ SpliceAI is for). Variants that change a splice site or cross an exon/intron border get `p.?`.
192
+ - **Codon mode** skips codons split by an intron (reported in the log).
193
+ - Positions with `N` in the reference are skipped.
194
+ - Use the same genome build for FASTA and annotation — VCFART warns loudly if they disagree.
195
+
196
+ ## ✅ Validation
197
+
198
+ - Reproduces the authors' original in-house MAVE scripts base-for-base: on a 444-bp intron–exon–intron
199
+ target of a minus-strand gene (hg38), all 1,332 SNVs have identical POS/REF/ALT and c. labels. The same
200
+ loop logic runs in the test suite on a synthetic block (`tests/test_prototype_regression.py`).
201
+ - Real hg38 run (`hg38.fa` + ANNOVAR `hg38_refGene.txt`): all 6,669 CDS SNVs of DRC1 (NM_145038,
202
+ plus strand) agree with ANNOVAR refGene c./p. annotation, including 9 start-loss and 8 stop-loss
203
+ variants (`examples/compare_annovar.py`).
204
+ - Every CDS SNV of synthetic plus- and minus-strand genes is checked against an independent translation
205
+ (missense / synonymous / nonsense / stop-loss extension / start-loss).
206
+ - Random indels: raw, left-normalized and HGVS-shifted representations produce the identical genome.
207
+
208
+ ```bash
209
+ python -m pip install pytest && python -m pytest
210
+
211
+ # cross-check your own output against ANNOVAR
212
+ perl table_annovar.pl X.vcf humandb/ -buildver hg38 -out X_annovar -remove \
213
+ -protocol refGene -operation g -nastring . -vcfinput
214
+ python examples/compare_annovar.py X.tsv X_annovar.hg38_multianno.txt
215
+ ```
216
+
217
+ ## 🧰 Related tools
218
+
219
+ VCFART is deliberately small and CLI-first. If you need a full SGE oligo-design pipeline with PAM/protection
220
+ edits, have a look at [VaLiAnT](https://academic.oup.com/bioinformatics/article/38/4/892/6429268) (Wellcome Sanger); for R/Bioconductor-based
221
+ all-SNV simulation across MANE transcripts see `rvarsim`; for MAVE read-level variant calling see
222
+ [satmut_utils](https://pypi.org/project/satmut-utils/).
223
+
224
+ ## 📖 Citation
225
+
226
+ If VCFART helps your work, please cite the repository (see `CITATION.cff`).
227
+
228
+ ## 📄 License
229
+
230
+ MIT © 2026 Seung Won Chae
231
+
232
+ ## 👤 Author
233
+
234
+ **Seung Won Chae** — Molecular Diagnostics Laboratory, Department of Laboratory Medicine,
235
+ Seoul National University Hospital · Seoul National University Cancer Research Institute
@@ -0,0 +1,200 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/CleanCham-lab/VCFART/main/logo/logo_dark.png">
4
+ <img src="https://raw.githubusercontent.com/CleanCham-lab/VCFART/main/logo/logo.png" alt="VCFART" width="640">
5
+ </picture>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <b>VCF ARTificial</b> — 뿌아아아아앙~, 전사체의 지정 구간에서 만들 수 있는 모든 변이를, 바로 annotation 가능한 VCF로 뿜어냅니다.<br>
10
+ <i>뿌뿡 💨 — MAVE, saturation genome editing(SGE), deep mutational scanning(DMS), SpliceAI 스캔용.</i>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <img src="https://img.shields.io/badge/python-3.9%2B-blue" alt="python">
15
+ <img src="https://img.shields.io/badge/dependencies-none-brightgreen" alt="no dependencies">
16
+ <img src="https://img.shields.io/badge/license-MIT-lightgrey" alt="MIT">
17
+ <a href="https://cleancham-lab.github.io/VCFART/"><img src="https://img.shields.io/badge/homepage-%F0%9F%92%A8%20vcfart-523f85" alt="homepage"></a>
18
+ </p>
19
+
20
+ [English](https://github.com/CleanCham-lab/VCFART/blob/main/README.md) | **한국어** | [홈페이지](https://cleancham-lab.github.io/VCFART/)
21
+
22
+ ---
23
+
24
+ ## 💨 무엇을 하나요 뿌뿡
25
+
26
+ reference genome(hg19 / hg38), 전사체(`NM_007294.4`), 그리고 평소 쓰던 방식 그대로의 구간
27
+ (`c.5075-100_c.5152+100`, `exon17:100`, `chr17:43063774-43064051`)만 주면 아래 파일을 만듭니다.
28
+
29
+ | 파일 | 내용 |
30
+ |---|---|
31
+ | `PREFIX.vcf` | 모든 변이. VCF 4.2, 좌표 정렬, left-normalization, 중복 제거, REF는 입력 FASTA로 확인 |
32
+ | `PREFIX.tsv` | 변이 한 줄씩: HGVS c., HGVS p., consequence, exon/intron 위치, 생성 방식, 구간 라벨 |
33
+ | `PREFIX.oligos.fa` | *(선택, `--oligo`)* 변이가 들어간 서열(transcript 방향) + 어댑터 — oligo pool 주문용 |
34
+
35
+ VCF는 **SpliceAI, ANNOVAR, VEP, CADD, AlphaMissense 조회, bcftools**에 그대로 들어가므로,
36
+ MAVE 라이브러리 전체를 실험 전(또는 후)에 *in silico*로 점수 매길 수 있습니다.
37
+
38
+ <p align="center"><img src="https://raw.githubusercontent.com/CleanCham-lab/VCFART/main/docs/terminal.png" alt="터미널에서 VCFART 실행 화면" width="760"></p>
39
+
40
+ ### ✨ 기능 뿡
41
+
42
+ - **전사체 기준 좌표** — HGVS c./n. 번호 체계 전체 지원: CDS, 5′/3′ UTR(`c.-30`, `c.*12`),
43
+ 인트론 offset(`c.5075-1`, `c.-30+5`), 전사체 바깥 위치까지. minus strand 유전자도 자동 처리
44
+ (염기 상보 변환을 손으로 할 필요 없음).
45
+ - **변이 생성기**
46
+ - `snv` — 모든 위치에서 나머지 3개 염기로 치환 (기본값)
47
+ - `del` — 원하는 길이의 결실 (`--del-sizes 1,2,3`)
48
+ - `ins` — 모든 염기 사이에 가능한 모든 k-mer 삽입 (`--ins-sizes 1`)
49
+ - `codon` — DMS 방식 코돈 치환: 아미노산마다 코돈 하나 + Ter + 동의 코돈 대조군(`--codon-set aa`),
50
+ 63개 코돈 전부(`all`), NNK(`nnk`). 코돈은 인간 codon usage 또는 최소 염기 변경(`--codon-pick min-edit`)으로 선택
51
+ - **정확한 indel 처리** — VCF는 anchor 염기를 붙여 left-normalization. 서열상 같은 변이
52
+ (예: `CCCCCC` 중 아무 C나 하나 결실)는 한 줄로 합침. HGVS는 3′ rule 적용(`c.24del`, `c.13_15dup`).
53
+ - **변이별 annotation** — HGVS c., 예측 HGVS p.(`p.Trp6Ter`, `p.Glu5del`, `p.Glu3LysfsTer?`,
54
+ `p.Ter9GlnextTer5`, `p.Met1?`), Sequence Ontology consequence(splice donor/acceptor, donor 5번째 염기,
55
+ polypyrimidine tract, splice region, missense 등), 위치(`intron16`, `exon17`).
56
+ - **oligo 라이브러리 출력** — 변이별 mutant 서열(+ WT), 양쪽 padding과 5′/3′ 어댑터 옵션.
57
+ - **이미 가진 파일 그대로 사용** — ANNOVAR `humandb/hg38_refGene.txt`를 그대로 읽음. UCSC
58
+ `refGene` / `ncbiRefSeq` 테이블, RefSeq·GENCODE GTF(ENST)도 지원. `chr16`과 `16` 같은 이름 차이는 자동 매칭.
59
+ - **안전장치** — CDS가 ATG로 시작/stop codon으로 끝나지 않거나 인트론이 GT-AG가 아니면 경고
60
+ (= genome build와 annotation이 서로 다를 가능성).
61
+ - **의존성 없음** — 순수 Python ≥ 3.9 표준 라이브러리만 사용. `.fai` 인덱스도 직접 읽고 만듦.
62
+ - **보기 좋은 실행 로그** — MultiQC 스타일 컬러 로그 + consequence 막대그래프. 파이프로 넘기거나
63
+ `--no-color` / `NO_COLOR=1`이면 색이 꺼짐.
64
+
65
+ ---
66
+
67
+ ## 설치 뿌뿡
68
+
69
+ ```bash
70
+ python -m pip install vcfart
71
+ vcfart --version
72
+
73
+ # 개발 버전
74
+ python -m pip install git+https://github.com/CleanCham-lab/VCFART.git
75
+ ```
76
+
77
+ ## 🚀 바로 해보기 (10초, 내장 demo genome)
78
+
79
+ ```bash
80
+ git clone https://github.com/CleanCham-lab/VCFART.git && cd VCFART/examples
81
+ ./run_demo.sh # examples/out/ 에 *.vcf / *.tsv / *.oligos.fa 생성
82
+ ```
83
+
84
+ ## 🧬 실제 데이터 뿌뿌뿡
85
+
86
+ ```bash
87
+ # 1. 전사체 테이블 — ANNOVAR 것을 그대로 쓰거나, UCSC에서 한 번 내려받기
88
+ vcfart fetch-annotation -b hg38 # -> ~/.vcfart/hg38.ncbiRefSeq.txt.gz
89
+ # (SSL 검사 프록시 환경이면 --insecure, 또는 출력되는 URL을 wget으로 받기)
90
+
91
+ # 2. 엑손/인트론 지도를 c. 좌표와 genomic 좌표로 확인
92
+ vcfart info -b hg38 -t NM_007294.4 -f hg38.fa
93
+
94
+ # 3. 생성: BRCA1 엑손 17(c.5075-c.5152) + 양쪽 인트론 100 bp
95
+ vcfart generate -f hg38.fa -b hg38 -t NM_007294.4 \
96
+ -r int16=c.5075-100_c.5075-1 \
97
+ -r ex17=c.5075_c.5152 \
98
+ -r int17=c.5152+1_c.5152+100 \
99
+ -o BRCA1_ex17
100
+
101
+ # 같은 구간 짧게 (엑손 번호는 annotation의 전사체 기준 — `vcfart info`로 확인)
102
+ vcfart generate -f hg38.fa -a humandb/hg38_refGene.txt -t NM_007294 -r exon17:100 -o BRCA1_ex17
103
+ ```
104
+
105
+ ### 🎯 구간 문법 (`-r`, 여러 번 사용 가능, `LABEL=` 접두어 선택)
106
+
107
+ | 형식 | 의미 |
108
+ |---|---|
109
+ | `c.5075-100_c.5075-1` 또는 `c.5075-100_5075-1` | HGVS c. 구간 (인트론 offset, `c.-N`, `c.*N` 가능) |
110
+ | `c.5075` | 한 위치 |
111
+ | `n.10_n.250` | non-coding 전사체 (NR_ / lncRNA) |
112
+ | `g.43063774_43064051` 또는 `chr17:43,063,774-43,064,051` | genomic 좌표, 1-based, 양끝 포함 |
113
+ | `exon17`, `exon17:100`, `exon17:100:50` | 엑손(전사체 순서), + 양쪽 flank, + 5′·3′ flank 따로 |
114
+ | `intron16` | 인트론 전체 |
115
+ | `cds` | c.1부터 stop codon 끝까지 (`--exonic-only`와 함께 쓰면 CDS만) |
116
+
117
+ 구간은 genome 상의 연속 구간이므로, 여러 엑손에 걸친 `c.1_c.600`은 사이 인트론까지 포함합니다(실행 로그에 표시).
118
+ 엑손 염기만 원하면 `--exonic-only`를 붙이세요.
119
+
120
+ ### ⚙️ 주요 옵션 (전체는 `vcfart generate -h`)
121
+
122
+ | 옵션 | 기본값 | |
123
+ |---|---|---|
124
+ | `-m snv,del,ins,codon` | `snv` | 실행할 변이 생성기 |
125
+ | `--del-sizes` / `--ins-sizes` | `1` | indel 길이 (쉼표로 구분) |
126
+ | `--codon-set aa\|all\|nnk` / `--codon-pick usage\|min-edit` | `aa` / `usage` | 코돈 모드 |
127
+ | `--exonic-only` | 꺼짐 | 엑손 위치만 (cDNA / CDS saturation) |
128
+ | `--sites-only` | 꺼짐 | 더미 `FORMAT/GT` 샘플 열 생략 (기본은 ANNOVAR 호환용 `GT=0/1`) |
129
+ | `--id hgvs\|index\|none` | `hgvs` | VCF ID 열 (기본 `c.5075-1G>C` 형태) |
130
+ | `--oligo --oligo-pad N --adapter5 SEQ --adapter3 SEQ` | 꺼짐 | oligo 라이브러리 FASTA |
131
+ | `--oligo-strand transcript\|plus` | `transcript` | oligo 서열 방향 |
132
+ | `--chrom` | — | 전사체가 여러 위치에 매핑될 때(PAR, alt contig) 위치 선택 |
133
+
134
+ ### 🏷️ VCF INFO 필드
135
+
136
+ `VA_TX`, `VA_GENE`, `VA_HGVSc`, `VA_HGVSp`(`=`는 VEP처럼 `%3D`로 기록), `VA_CSQ`,
137
+ `VA_REGION`, `VA_TYPE`(SNV/MNV/DEL/INS/DELINS), `VA_ORIGIN`(생성기), `VA_SET`(구간 라벨).
138
+
139
+ ### 🔗 후속 분석 예시
140
+
141
+ ```bash
142
+ spliceai -I BRCA1_ex17.vcf -O BRCA1_ex17.spliceai.vcf -R hg38.fa -A grch38
143
+ perl table_annovar.pl BRCA1_ex17.vcf humandb/ -buildver hg38 -out BRCA1_ex17 \
144
+ -protocol refGene -operation g -vcfinput -remove -nastring .
145
+ vep -i BRCA1_ex17.vcf --fasta hg38.fa --cache --hgvs --everything -o BRCA1_ex17.vep.txt
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 📏 표기 규칙 (한 번만 읽어두세요)
151
+
152
+ - **VCF**는 bcftools norm 방식으로 left-align하고, indel에는 바로 앞 염기를 anchor로 붙입니다.
153
+ 서열상 같은 변이는 한 번만 쓰며, 그 변이를 만든 구간/생성기는 `VA_SET`/`VA_ORIGIN`에 모두 기록됩니다.
154
+ - **HGVS c.**는 genomic 서열 위에서 전사체 방향 3′ rule을 적용하며, 엑손/인트론 경계도 넘어갑니다
155
+ (인트론에서 만든 삽입이 결과 서열이 같으면 엑손 좌표로 표기될 수 있음). TSV에는 원래 생성된 구간 라벨이 남습니다.
156
+ - **HGVS p.**는 reference CDS 기준 예측값입니다(splicing 영향은 계산하지 않음 — 그건 SpliceAI의 몫).
157
+ splice site를 바꾸거나 엑손/인트론 경계에 걸친 변이는 `p.?`.
158
+ - **코돈 모드**는 인트론으로 나뉜 코돈을 건너뜁니다(로그에 개수 표시).
159
+ - reference가 `N`인 위치는 건너뜁니다.
160
+ - FASTA와 annotation은 같은 genome build를 쓰세요 — 다르면 VCFART가 경고합니다.
161
+
162
+ ## ✅ 검증
163
+
164
+ - 저자들이 쓰던 기존 in-house MAVE 스크립트 결과를 그대로 재현: minus strand 유전자의 444 bp
165
+ 인트론–엑손–인트론 구간(hg38)에서 SNV 1,332개의 POS/REF/ALT와 c. 표기가 모두 동일. 같은 루프 로직을
166
+ 합성 서열로 테스트에 포함(`tests/test_prototype_regression.py`).
167
+ - 실제 hg38 실행(`hg38.fa` + ANNOVAR `hg38_refGene.txt`): DRC1(NM_145038, plus strand) CDS의 SNV
168
+ 6,669개 전부가 ANNOVAR refGene의 c./p. annotation과 일치 (start-loss 9개, stop-loss 8개 포함,
169
+ `examples/compare_annovar.py`).
170
+ - 합성 plus/minus strand 유전자의 모든 CDS SNV를 독립적인 번역 결과와 대조
171
+ (missense / synonymous / nonsense / stop-loss 연장 / start-loss).
172
+ - 무작위 indel: 원래 표현, left-normalized 표현, HGVS 3′-shift 표현이 모두 같은 genome을 만드는지 확인.
173
+
174
+ ```bash
175
+ python -m pip install pytest && python -m pytest
176
+
177
+ # 내 결과를 ANNOVAR와 대조
178
+ perl table_annovar.pl X.vcf humandb/ -buildver hg38 -out X_annovar -remove \
179
+ -protocol refGene -operation g -nastring . -vcfinput
180
+ python examples/compare_annovar.py X.tsv X_annovar.hg38_multianno.txt
181
+ ```
182
+
183
+ ## 🧰 관련 도구
184
+
185
+ VCFART는 일부러 작고 CLI 중심으로 만들었습니다. PAM/protection edit까지 포함한 SGE oligo 설계
186
+ 파이프라인이 필요하면 [VaLiAnT](https://academic.oup.com/bioinformatics/article/38/4/892/6429268)(Wellcome Sanger),
187
+ R/Bioconductor 기반으로 MANE 전사체 전체의 SNV를 시뮬레이션하려면 `rvarsim`, MAVE read 수준의 variant calling은
188
+ [satmut_utils](https://pypi.org/project/satmut-utils/)를 참고하세요.
189
+
190
+ ## 📖 인용
191
+
192
+ VCFART가 도움이 되었다면 저장소를 인용해 주세요 뿌ㅇㅇㅇ우우웅 (`CITATION.cff` 참고).
193
+
194
+ ## 📄 라이선스
195
+
196
+ MIT © 2026 Seung Won Chae
197
+
198
+ ## 👤 만든 사람
199
+
200
+ **채승원 (Seung Won Chae)** — 서울대학교병원 진단검사의학과 분자진단검사실 · 서울대학교 암연구소