Philip Fradkin
commited on
Commit
•
1da0529
1
Parent(s):
be652b1
feat: dashed lines
Browse files
README.md
CHANGED
@@ -132,29 +132,29 @@ chmod +x starter_build.sh
|
|
132 |
We can now generate six track encodings for any transcript!
|
133 |
```
|
134 |
# import Genome, Interval, instantiate Genome
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
# CTCTTATGCTCGGGTGATCC
|
139 |
|
140 |
# Load Orthrus 6 track
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
# Generate embedding
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
# torch.Size([1, 512])
|
159 |
```
|
160 |
|
|
|
132 |
We can now generate six track encodings for any transcript!
|
133 |
```
|
134 |
# import Genome, Interval, instantiate Genome
|
135 |
+
>>> genome = Genome("gencode.v29")
|
136 |
+
>>> interval = Interval("chr7", "+", 117120016, 117120201, genome)
|
137 |
+
>>> genome.dna(interval)
|
138 |
# CTCTTATGCTCGGGTGATCC
|
139 |
|
140 |
# Load Orthrus 6 track
|
141 |
+
>>> run_name="orthrus_large_6_track"
|
142 |
+
>>> checkpoint="epoch=22-step=20000.ckpt"
|
143 |
+
>>> model_repository="./models"
|
144 |
+
>>> model = load_model(f"{model_repository}{run_name}", checkpoint_name=checkpoint)
|
145 |
+
>>> model = model.to(torch.device('cuda'))
|
146 |
+
>>> print(model)
|
147 |
# Generate embedding
|
148 |
+
>>> transcripts = find_transcript_by_gene_name(genome, 'BCL2L1')
|
149 |
+
>>> print(transcripts)
|
150 |
+
>>> t = transcripts[0]
|
151 |
+
>>> sixt = create_six_track_encoding(t)
|
152 |
+
>>> sixt = torch.tensor(sixt, dtype=torch.float32)
|
153 |
+
>>> sixt = sixt.unsqueeze(0)
|
154 |
+
>>> sixt = sixt.to(device='cuda')
|
155 |
+
>>> lengths = torch.tensor([sixt.shape[2]]).to(device='cuda')
|
156 |
+
>>> embedding = model.representation(sixt, lengths)
|
157 |
+
>>> print(embedding.shape)
|
158 |
# torch.Size([1, 512])
|
159 |
```
|
160 |
|