hoodini-viz 0.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pentamorfico
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.
package/README.md ADDED
@@ -0,0 +1,235 @@
1
+ <div align="center">
2
+
3
+ <img src="src/assets/hoodini-viz_logo_github.svg" alt="Hoodini Logo" width="450"/>
4
+
5
+ ### GPU-powered visualization for comparative genomics
6
+
7
+ [![npm version](https://img.shields.io/npm/v/hoodini-viz?color=blue&label=npm)](https://www.npmjs.com/package/hoodini-viz)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
10
+ [![React](https://img.shields.io/badge/React-19-61dafb?logo=react&logoColor=white)](https://react.dev/)
11
+
12
+ [**๐ŸŽฎ Live Demo**](https://storage.hoodini.bio/hoodini-demo.html) ยท [**๐Ÿ“ฆ npm**](https://www.npmjs.com/package/hoodini-viz) ยท [**๐Ÿ“– Docs**](#usage)
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## ๐Ÿงฌ What is this?
19
+
20
+ **Hoodini-viz** is a React library for interactive visualization of comparative genomics data at scale.
21
+
22
+ It displays **phylogenetic trees** alongside **aligned gene neighborhood tracks**, connecting homologous proteins across genomes with curved Bรฉzier links colored by cluster or identity. Syntenic regions are highlighted with nucleotide-level alignments rendered as translucent polygons between tracks.
23
+
24
+ Each gene is drawn as a directional arrow showing strand orientation, with **protein domains** overlaid as colored boxes. Click any gene to view its metadata, predict its **3D protein structure** on-demand, or explore **ncRNA secondary structures** with an embedded interactive viewer.
25
+
26
+ A **virtualized data table** lets you browse and filter millions of genes, domains, and links. All visual parameters (colors, dimensions, opacities, scales) are adjustable in real-time through the sidebar controls.
27
+
28
+ <br/>
29
+
30
+ <div align="center">
31
+
32
+ | ๐Ÿš€ **Scales** | โšก **Interactive** | ๐ŸŽจ **Customizable** | ๐Ÿ”ฌ **Structures** | ๐Ÿ“„ **Export** |
33
+ |:---:|:---:|:---:|:---:|:---:|
34
+ | 100k+ genes | Zoom, pan, click | 50+ palettes | ESMFold/Boltz2 | SVG ready |
35
+
36
+ </div>
37
+
38
+ <br/>
39
+
40
+ <div align="center">
41
+ <img src="src/assets/hoodini-viz-export - 2026-01-14T051133.869.svg" alt="Example visualization" width="85%"/>
42
+ </div>
43
+
44
+ <br/>
45
+
46
+ > [!TIP]
47
+ > **Looking to visualize your own genomes?** Use [**Hoodini**](https://github.com/pentamorfico/hoodini) โ€” the comparative genomics toolkit that fetches assemblies from NCBI, extracts gene neighborhoods, runs protein/nucleotide comparisons, annotates defense systems, builds trees, and generates ready-to-use visualizations. This library is the visualization engine that powers Hoodini's output.
48
+
49
+ ---
50
+
51
+ ## ๐Ÿ“ฆ Install
52
+
53
+ <table>
54
+ <tr>
55
+ <td width="50%">
56
+
57
+ **npm / yarn / pnpm**
58
+
59
+ ```bash
60
+ npm install hoodini-viz
61
+ ```
62
+
63
+ </td>
64
+ <td width="50%">
65
+
66
+ **CDN**
67
+
68
+ ```html
69
+ <script src="https://unpkg.com/hoodini-viz"></script>
70
+ <link href="https://unpkg.com/hoodini-viz/dist/hoodini-viz.css" rel="stylesheet">
71
+ ```
72
+
73
+ </td>
74
+ </tr>
75
+ </table>
76
+
77
+ ---
78
+
79
+ ## ๐Ÿš€ Usage
80
+
81
+ <details open>
82
+ <summary><strong>Full Dashboard</strong> โ€” includes sidebar, data loading, controls</summary>
83
+
84
+ <br/>
85
+
86
+ ```tsx
87
+ import { HoodiniDashboard } from 'hoodini-viz';
88
+ import 'hoodini-viz/style.css';
89
+
90
+ function App() {
91
+ return (
92
+ <HoodiniDashboard
93
+ dataPaths={{
94
+ gffParquet: '/data/genes.parquet',
95
+ hoodsParquet: '/data/hoods.parquet',
96
+ newick: '/data/tree.nwk',
97
+ proteinLinksParquet: '/data/links.parquet',
98
+ }}
99
+ />
100
+ );
101
+ }
102
+ ```
103
+
104
+ </details>
105
+
106
+ <details>
107
+ <summary><strong>Core Component</strong> โ€” bring your own UI and data loading</summary>
108
+
109
+ <br/>
110
+
111
+ ```tsx
112
+ import { HoodiniViz } from 'hoodini-viz';
113
+
114
+ <HoodiniViz
115
+ newickStr={newick}
116
+ gffFeatures={genes}
117
+ proteinLinks={links}
118
+ domainsByGene={domains}
119
+ hoods={hoods}
120
+ showTreeLayer={true}
121
+ showGeneLayer={true}
122
+ showProteinLinkLayer={true}
123
+ />
124
+ ```
125
+
126
+ </details>
127
+
128
+ ---
129
+
130
+ ## ๐Ÿ“ Data Formats
131
+
132
+ > [!NOTE]
133
+ > Parquet files load **3-10x faster** than TSV. Convert with `python scripts/convert_to_parquet.py`
134
+
135
+ | File | Format | Description |
136
+ |:-----|:------:|:------------|
137
+ | `genes` | `.parquet` `.tsv` | GFF3-style gene annotations |
138
+ | `hoods` | `.parquet` `.tsv` | Genomic windows to display |
139
+ | `tree` | `.nwk` | Newick phylogenetic tree |
140
+ | `links` | `.parquet` `.tsv` | Protein homology relationships |
141
+ | `domains` | `.parquet` `.tsv` | Protein domain annotations *(optional)* |
142
+
143
+ <details>
144
+ <summary>๐Ÿ“‹ <strong>View detailed format specifications</strong></summary>
145
+
146
+ <br/>
147
+
148
+ **genes** โ€” Standard GFF3 with `ID`, `Name`, `product` in attributes
149
+ **hoods** โ€” Columns: `hood_id`, `seqid`, `start`, `end`, `align_gene` (optional)
150
+ **links** โ€” Columns: `gene1`, `gene2`, `identity`
151
+ **domains** โ€” Columns: `gene_id`, `domain_name`, `start`, `end`, `source`
152
+
153
+ </details>
154
+
155
+ ---
156
+
157
+ ## โœจ Features
158
+
159
+ <table>
160
+ <tr>
161
+ <td width="33%" valign="top">
162
+
163
+ ### ๐ŸŽฏ Visualization
164
+ - WebGL/GPU rendering
165
+ - Phylogenetic tree display
166
+ - Gene neighborhood tracks
167
+ - Protein & nucleotide links
168
+ - Domain annotations
169
+ - ncRNA secondary structures
170
+
171
+ </td>
172
+ <td width="33%" valign="top">
173
+
174
+ ### ๐ŸŽ›๏ธ Interaction
175
+ - Smooth zoom & pan
176
+ - Click to select genes
177
+ - Flip track orientation
178
+ - Shift genomic windows
179
+ - Align by gene cluster
180
+ - Hover tooltips
181
+
182
+ </td>
183
+ <td width="33%" valign="top">
184
+
185
+ ### ๐Ÿ”ง Tools
186
+ - Virtualized data table
187
+ - 50+ color palettes
188
+ - Structure prediction
189
+ - Real-time customization
190
+ - SVG/PNG export
191
+
192
+ </td>
193
+ </tr>
194
+ </table>
195
+
196
+ <details>
197
+ <summary>๐Ÿ” <strong>Feature details</strong></summary>
198
+
199
+ <br/>
200
+
201
+ | Feature | Description |
202
+ |:--------|:------------|
203
+ | **Protein links** | Curved Bรฉzier connections showing homology between proteins across tracks |
204
+ | **Nucleotide links** | Polygonal overlays displaying synteny blocks between genomic regions |
205
+ | **ncRNA structures** | Interactive 2D secondary structure viewer for non-coding RNAs (NAView layout) |
206
+ | **Data table** | Virtualized grid browser for genes, domains, links, and metadata โ€” handles millions of rows |
207
+ | **3D structures** | On-demand protein structure prediction via ESMFold (โ‰ค400aa) or Boltz2 |
208
+
209
+ </details>
210
+
211
+ ---
212
+
213
+ ## ๐Ÿ› ๏ธ Development
214
+
215
+ ```bash
216
+ npm run dev # ๐Ÿ”ฅ Dev server at localhost:5173
217
+ npm run build # ๐Ÿ“ฆ Build library
218
+ npm run build:html # ๐Ÿ“„ Self-contained HTML
219
+ ```
220
+
221
+ ---
222
+
223
+ ## ๐Ÿ“œ License
224
+
225
+ [MIT](LICENSE) ยฉ 2026
226
+
227
+ ---
228
+
229
+ <div align="center">
230
+
231
+ **[โฌ† Back to top](#)**
232
+
233
+ Made with ๐Ÿฆ‰ by [pentamorfico](https://github.com/pentamorfico)
234
+
235
+ </div>