Spaces:
Running
Running
Merge remote-tracking branch 'origin/main'
Browse files- .gitattributes +1 -0
- assets/saliency_example.png +3 -0
- tabs/home.html +36 -1
.gitattributes
CHANGED
|
@@ -44,3 +44,4 @@ notebooks_pipelines/bigwig_outputs/HepG2_DNAse.bw filter=lfs diff=lfs merge=lfs
|
|
| 44 |
notebooks_pipelines/bigwig_outputs/HepG2_H3k4me3.bw filter=lfs diff=lfs merge=lfs -text
|
| 45 |
notebooks_pipelines/bigwig_outputs/HepG2_RNA_seq.bw filter=lfs diff=lfs merge=lfs -text
|
| 46 |
notebooks_pipelines/bigwig_outputs/K562_CTCF.bw filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 44 |
notebooks_pipelines/bigwig_outputs/HepG2_H3k4me3.bw filter=lfs diff=lfs merge=lfs -text
|
| 45 |
notebooks_pipelines/bigwig_outputs/HepG2_RNA_seq.bw filter=lfs diff=lfs merge=lfs -text
|
| 46 |
notebooks_pipelines/bigwig_outputs/K562_CTCF.bw filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
assets/saliency_example.png filter=lfs diff=lfs merge=lfs -text
|
assets/saliency_example.png
ADDED
|
Git LFS Details
|
tabs/home.html
CHANGED
|
@@ -132,7 +132,42 @@ print(out.logits.shape) # (B, L, V = 11)
|
|
| 132 |
</code></pre></div>
|
| 133 |
<p>Model embeddings can be used for fine-tuning on downstream tasks.</p>
|
| 134 |
|
| 135 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
</div>
|
| 137 |
|
| 138 |
<div class="card">
|
|
|
|
| 132 |
</code></pre></div>
|
| 133 |
<p>Model embeddings can be used for fine-tuning on downstream tasks.</p>
|
| 134 |
|
| 135 |
+
<h2 style="margin-top: 40px;">🔍 Model interpretation</h2>
|
| 136 |
+
<p>Here is an example of how to use the interpretation pipeline for multi-scale analysis of DNA sequences:</p>
|
| 137 |
+
<div class="code"><pre><code class="language-python">from transformers import pipeline
|
| 138 |
+
import torch
|
| 139 |
+
import matplotlib.pyplot as plt
|
| 140 |
+
|
| 141 |
+
model_name = "InstaDeepAI/NTv3_650M_post"
|
| 142 |
+
|
| 143 |
+
# Build interpretation pipeline
|
| 144 |
+
ntv3_interpret = pipeline(
|
| 145 |
+
"ntv3-interpret",
|
| 146 |
+
model=model_name,
|
| 147 |
+
trust_remote_code=True,
|
| 148 |
+
device=0 if torch.cuda.is_available() else -1,
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
# Run interpretation on a given genomic region with tracks, annotations, attention, and saliency
|
| 152 |
+
result = ntv3_interpret(
|
| 153 |
+
{"chrom": "chr11", "start": 5_253_561, "end": 5_286_329, "species": "human"},
|
| 154 |
+
output_attention=True,
|
| 155 |
+
output_saliency=True,
|
| 156 |
+
saliency_track_id="ENCSR000EFT", # K562 GATA1 ChIP-seq
|
| 157 |
+
plot=True, # plot predictons on tracks and annotations
|
| 158 |
+
tracks_to_plot={"K562 RNA-seq": "ENCSR056HPM", "K562 GATA1": "ENCSR000EFT"},
|
| 159 |
+
elements_to_plot=["exon", "promoter_Tissue_specific"],
|
| 160 |
+
)
|
| 161 |
+
|
| 162 |
+
# Access attention map results
|
| 163 |
+
result.plot_attention() # attention map (last layer)
|
| 164 |
+
plt.show()
|
| 165 |
+
|
| 166 |
+
# Access saliency scores results
|
| 167 |
+
result.plot_saliency(window_size=128)
|
| 168 |
+
plt.show()
|
| 169 |
+
</code></pre></div>
|
| 170 |
+
<img src="assets/saliency_example.png" alt="Output tracks visualization" style="max-width: 100%; margin-top: 20px;" />
|
| 171 |
</div>
|
| 172 |
|
| 173 |
<div class="card">
|