SkyWhal3 commited on
Commit
86c721d
·
verified ·
1 Parent(s): eb55f86

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +218 -3
README.md CHANGED
@@ -1,3 +1,218 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: pddl
3
+ task_categories:
4
+ - text-classification
5
+ - question-answering
6
+ - text2text-generation
7
+ language:
8
+ - en
9
+ tags:
10
+ - stxbp1
11
+ - clinvar
12
+ - genomics
13
+ - biomedical
14
+ - variant
15
+ - rare-disease
16
+ - neurology
17
+ - epilepsy
18
+ - nlp
19
+ - llm
20
+ - question-answering
21
+ - text-classification
22
+ - bioinformatics
23
+ - snare
24
+ - gene-editing
25
+ - crispr
26
+ - cas9
27
+ - open-data
28
+ - instruction-tuning
29
+ pretty_name: STXBP1 ClinVar Pathogenic Variants (Curated)
30
+ size_categories:
31
+ - 100K<n<1M
32
+ ---
33
+
34
+ # stxbp1_clinvar_curated_pathogenic
35
+
36
+ _Curated set of **307,587 pathogenic and likely pathogenic** STXBP1 and related variants from ClinVar, ready for LLM, variant curation, and biomedical NLP applications._
37
+
38
+ **License:**
39
+ This dataset is licensed under the ODC Public Domain Dedication and License (PDDL).
40
+ To the extent possible under law, the author(s) have dedicated this data to the public domain worldwide by waiving all rights to the work under copyright law, including all related and neighboring rights, to the extent allowed by law.
41
+ NO WARRANTY is provided.
42
+ See [ODC-PDDL](https://opendatacommons.org/licenses/pddl/1-0/) for full legal text.
43
+
44
+ ---
45
+
46
+ ## Dataset Overview
47
+
48
+ A **hand-curated, LLM-friendly** dataset of STXBP1 and family variants from ClinVar, filtered for clinical significance (`Pathogenic`, `Likely_pathogenic`).
49
+ Ideal for medical language modeling, rare disease NLP, AI-powered variant curation, and biomedical Q&A.
50
+
51
+ **Formats included:**
52
+ - Structured JSONL (`.jsonl`, main split)
53
+ - Q/A pairs (`.txt`, for demo/fine-tuning)
54
+ - Parquet conversion recommended for large-scale use
55
+
56
+ ---
57
+
58
+ ## Curation Criteria
59
+
60
+ Variants included here are:
61
+ - Annotated as **Pathogenic** or **Likely_pathogenic** in ClinVar
62
+ - Matching gene family:
63
+ - STXBP1, MUNC18, STXBP2, STXBP3, STXBP4, STXBP5, STXBP6
64
+ - Related SNARE-complex/CRISPR/neurological disorder keywords
65
+
66
+ ---
67
+
68
+ ## Features
69
+
70
+ - **Natural language clinical summaries for each variant**
71
+ - **Structured JSONL** (parquet-compatible) for data science and NLP
72
+ - **Q/A pairs** for LLM training and evaluation
73
+ - Full coverage: variant, gene, disease, clinical significance, HGVS, database links, review status, and more
74
+
75
+ ---
76
+
77
+ ## Dataset Statistics
78
+
79
+ | Format | Size (bytes) | Number of Examples/Lines |
80
+ |-----------|-------------:|------------------------:|
81
+ | QA (.txt) | 159,728 | 615,174 |
82
+ | JSONL | 205,212 | 307,587 |
83
+
84
+ _Main split for Hugging Face: JSONL format (see above for statistics)._
85
+
86
+ ---
87
+
88
+ ## Schema
89
+
90
+ | Field | Description |
91
+ |------------------------|----------------------------------------------------------------|
92
+ | ID | ClinVar Variation ID |
93
+ | chrom | Chromosome |
94
+ | pos | Genomic position (GRCh38) |
95
+ | ref | Reference allele |
96
+ | alt | Alternate allele |
97
+ | gene | Gene symbol |
98
+ | disease | Disease/phenotype name |
99
+ | significance | Clinical significance (e.g., Pathogenic, Likely_pathogenic) |
100
+ | hgvs | HGVS variant description |
101
+ | review | ClinVar review status |
102
+ | molecular_consequence | Sequence Ontology + effect |
103
+ | variant_type | SNV, Insertion, Deletion, etc. |
104
+ | clndisdb | Disease database links (OMIM, MedGen, etc.) |
105
+ | clndnincl | Included variant disease name |
106
+ | clndisdbincl | Included variant disease database links |
107
+ | onc_fields | Dict of oncogenicity fields |
108
+ | sci_fields | Dict of somatic clinical impact fields |
109
+ | incl_fields | Dict of included fields (INCL) |
110
+
111
+ ---
112
+
113
+ ## Data Example
114
+
115
+ **JSON record:**
116
+ ```json
117
+ {
118
+ "ID": "3385321",
119
+ "chrom": "1",
120
+ "pos": "66926",
121
+ "ref": "AG",
122
+ "alt": "A",
123
+ "gene": "STXBP1",
124
+ "disease": "Developmental and epileptic encephalopathy, 4",
125
+ "significance": "Pathogenic",
126
+ "hgvs": "NC_000001.11:g.66927del",
127
+ "review": "criteria_provided, single_submitter",
128
+ "molecular_consequence": "SO:0001627: intron_variant",
129
+ "variant_type": "Deletion",
130
+ "clndisdb": "Human_Phenotype_Ontology:HP:0000547,MONDO:MONDO:0019200,MeSH:D012174,MedGen:C0035334,OMIM:268000",
131
+ "clndnincl": null,
132
+ "clndisdbincl": null,
133
+ "onc_fields": {},
134
+ "sci_fields": {},
135
+ "incl_fields": {}
136
+ }
137
+ ```
138
+
139
+
140
+ ===================================================================================================================
141
+ ## You can easily load this dataset using the 🤗 Datasets library.
142
+
143
+ The Hugging Face infrastructure will automatically use the efficient Parquet files by default, but you can also specify the JSONL if you prefer.
144
+
145
+ ### Install dependencies (if needed):
146
+
147
+ ```bash
148
+ pip install datasets
149
+ ```
150
+
151
+ ## Load the full dataset (JSONL, recommended)
152
+
153
+ ```from datasets import load_dataset
154
+
155
+ ds = load_dataset("SkyWhal3/ClinVar-STXBP1-NLP-Dataset", data_files="ClinVar-STXBP1-NLP-Dataset.jsonl", split="train")
156
+ print(ds[0])
157
+ ```
158
+
159
+ ## Parquet conversion (for large scale)
160
+
161
+ ```import pandas as pd
162
+
163
+ df = pd.read_json("ClinVar-STXBP1-NLP-Dataset.jsonl", lines=True)
164
+ df.to_parquet("ClinVar-STXBP1-NLP-Dataset.parquet")
165
+ ```
166
+
167
+ ## Other ways to use the data
168
+ Load all Parquet shards with pandas
169
+
170
+ ```import pandas as pd
171
+ import glob
172
+
173
+ # Load all Parquet shards in the train directory
174
+ parquet_files = glob.glob("default/train/*.parquet")
175
+ df = pd.concat([pd.read_parquet(pq) for pq in parquet_files], ignore_index=True)
176
+ print(df.shape)
177
+ print(df.head())
178
+ ```
179
+
180
+ ## Filter for a gene (e.g., STXBP1)
181
+
182
+ ```df = pd.read_parquet("default/train/0000.parquet")
183
+ stxbp1_df = df[df["gene"] == "STXBP1"]
184
+ print(stxbp1_df.head())
185
+ ```
186
+
187
+ ## Randomly sample a subset
188
+
189
+ ```sample = df.sample(n=5, random_state=42)
190
+ print(sample)
191
+ ```
192
+
193
+ ## Load with Polars (for high performance)
194
+
195
+ ```import polars as pl
196
+
197
+ df = pl.read_parquet("default/train/0000.parquet")
198
+ print(df.head())
199
+ ```
200
+
201
+ ## Query with DuckDB (SQL-style)
202
+
203
+ ```import duckdb
204
+
205
+ con = duckdb.connect()
206
+ df = con.execute("SELECT * FROM 'default/train/0000.parquet' WHERE gene='STXBP1' LIMIT 5").df()
207
+ print(df)
208
+ ```
209
+
210
+ ## Streaming mode with 🤗 Datasets
211
+
212
+ ```ds = load_dataset("YOURPATH/ClinVar-STXBP1-NLP-Dataset", split="train", streaming=True)
213
+ for record in ds.take(5):
214
+ print(record)
215
+ ```
216
+
217
+
218
+ Created by Adam Freygang, A.K.A. SkyWhal3