@@ -12,6 +12,7 @@ Built around [gReLU](https://github.com/Genentech/gReLU) and designed for Borzoi
1212- ** Genomic intervals** — chromosome tiling, window centering, output bin mapping
1313- ** Splicing label generation** — hard/soft PSI labels from rMATS + StringTie, with priority-based disjoint segmentation
1414- ** Variant construction** — SNV generation and scoring for in silico mutagenesis
15+ - ** Visualization** — ISM heatmaps, prediction tracks, gene model and attribution plots (matplotlib, no grelu required)
1516- ** Custom losses** — PSI-aware, Bhattacharyya, masked MSE/Poisson for multitask training
1617- ** Multitask heads** — nonlinear, split-head, and cell-type conditional architectures
1718- ** LoRA fine-tuning** — lightweight low-rank adaptation for Conv1d and Linear layers with weight merging
@@ -37,7 +38,8 @@ seq_tools/ Core sequence utilities
3738├── intervals.py Genomic interval generation, centering, bin conversion
3839├── fasta.py FASTA reading, windowed iteration
3940├── labels.py Splicing label generation (rMATS + StringTie)
40- └── variant.py SNV generation and variant scoring
41+ ├── variant.py SNV generation and variant scoring
42+ └── visualization.py ISM heatmaps, prediction tracks, gene model and attribution plots
4143
4244training/ Model training infrastructure
4345├── losses.py PSI, Bhattacharyya, masked MSE/Poisson losses
@@ -100,6 +102,28 @@ cond_head = ConditionalHead(in_channels=1920, n_celltypes=5, out_channels=1)
100102pred = cond_head(trunk_features, cell_type_id = torch.tensor([2 ]))
101103```
102104
105+ ### Visualize ISM results and model predictions
106+
107+ ``` python
108+ from seq_tools.visualization import (
109+ plot_ism_heatmap,
110+ plot_prediction_track,
111+ plot_gene_model,
112+ multi_track_figure,
113+ )
114+ import matplotlib.pyplot as plt
115+
116+ # ISM heatmap from score_variants output — shape (4, L), ACGT rows
117+ fig, ax = plt.subplots(figsize = (15 , 2 ))
118+ plot_ism_heatmap(ism_matrix, genome_start = 10_500_000 , ax = ax, title = " log2FC" )
119+
120+ # Stacked multi-track figure with shared x-axis
121+ fig, axes = multi_track_figure(3 , height_ratios = [2 , 1.5 , 1 ])
122+ plot_prediction_track(predictions, ax = axes[0 ], ylabel = " PSI" )
123+ plot_ism_heatmap(ism_matrix, ax = axes[1 ])
124+ plot_gene_model(soft_label_df, ax = axes[2 ])
125+ ```
126+
103127### Generate splicing labels
104128
105129``` python
@@ -124,7 +148,7 @@ This toolkit extends [gReLU](https://github.com/Genentech/gReLU) rather than rep
124148
125149- Python ≥ 3.10
126150- PyTorch ≥ 2.0
127- - NumPy, Pandas
151+ - NumPy, Pandas, Matplotlib
128152
129153Optional:
130154- [ gReLU] ( https://github.com/Genentech/gReLU ) — model loading, attribution, ISM
0 commit comments