├── .gitmodules
├── AUTHORS
├── LICENSE
├── MANIFEST.in
├── NOTICE
├── README.md
├── evo2.jpg
├── evo2
├── __init__.py
├── configs
│ ├── evo2-1b-8k.yml
│ ├── evo2-40b-1m.yml
│ ├── evo2-40b-8k.yml
│ ├── evo2-7b-1m.yml
│ └── evo2-7b-8k.yml
├── models.py
├── scoring.py
├── utils.py
└── version.py
├── notebooks
├── brca1
│ ├── 41586_2018_461_MOESM3_ESM.xlsx
│ ├── GRCh37.p13_chr17.fna.gz
│ └── brca1_zero_shot_vep.ipynb
└── generation
│ └── generation_notebook.ipynb
├── requirements.txt
├── setup.py
└── test
├── test_evo2.py
└── test_evo2_generation.py
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "vortex"]
2 | path = vortex
3 | url = https://github.com/Zymrael/vortex.git
4 |
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | Garyk Brixi
2 | Matthew G. Durrant
3 | Jerome Ku
4 | Michael Poli
5 | Greg Brockman
6 | Daniel Chang
7 | Gabriel A. Gonzalez
8 | Samuel H. King
9 | David B. Li
10 | Aditi T. Merchant
11 | Mohsen Naghipourfar
12 | Eric Nguyen
13 | Chiara Ricci-Tam
14 | David W. Romero
15 | Gwanggyu Sun
16 | Ali Taghibakshi
17 | Anton Vorontsov
18 | Brandon Yang
19 | Myra Deng
20 | Liv Gorton
21 | Nam Nguyen
22 | Nicholas K. Wang
23 | Etowah Adams
24 | Stephen A. Baccus
25 | Steven Dillmann
26 | Stefano Ermon
27 | Daniel Guo
28 | Rajesh Ilango
29 | Ken Janik
30 | Amy X. Lu
31 | Reshma Mehta
32 | Mohammad R.K. Mofrad
33 | Madelena Y. Ng
34 | Jaspreet Pannu
35 | Christopher Ré
36 | Jonathan C. Schmok
37 | John St. John
38 | Jeremy Sullivan
39 | Kevin Zhu
40 | Greg Zynda
41 | Daniel Balsam
42 | Patrick Collison
43 | Anthony B. Costa
44 | Tina Hernandez-Boussard
45 | Eric Ho
46 | Ming-Yu Liu
47 | Thomas McGrath
48 | Kimberly Powell
49 | Dave P. Burke
50 | Hani Goodarzi
51 | Patrick D. Hsu
52 | Brian L. Hie
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 | --
204 |
205 | This repository also contains code from Hugging Face Inc., Google Research,
206 | and Facebook (from their Fairseq project). Files from these
207 | organizations have notices at the top of each file. Below are licenses
208 | used in those files, as indicated.
209 |
210 |
211 | ------------- LICENSE FOR NVIDIA code --------------
212 |
213 |
214 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
215 | #
216 | # Redistribution and use in source and binary forms, with or without
217 | # modification, are permitted provided that the following conditions
218 | # are met:
219 | # * Redistributions of source code must retain the above copyright
220 | # notice, this list of conditions and the following disclaimer.
221 | # * Redistributions in binary form must reproduce the above copyright
222 | # notice, this list of conditions and the following disclaimer in the
223 | # documentation and/or other materials provided with the distribution.
224 | # * Neither the name of NVIDIA CORPORATION nor the names of its
225 | # contributors may be used to endorse or promote products derived
226 | # from this software without specific prior written permission.
227 | #
228 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
229 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
230 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
231 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
232 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
233 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
234 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
235 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
236 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
237 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
238 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
239 |
240 | ------------- LICENSE FOR huggingface and Google Research code --------------
241 |
242 |
243 | Apache License
244 | Version 2.0, January 2004
245 | http://www.apache.org/licenses/
246 |
247 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
248 |
249 | 1. Definitions.
250 |
251 | "License" shall mean the terms and conditions for use, reproduction,
252 | and distribution as defined by Sections 1 through 9 of this document.
253 |
254 | "Licensor" shall mean the copyright owner or entity authorized by
255 | the copyright owner that is granting the License.
256 |
257 | "Legal Entity" shall mean the union of the acting entity and all
258 | other entities that control, are controlled by, or are under common
259 | control with that entity. For the purposes of this definition,
260 | "control" means (i) the power, direct or indirect, to cause the
261 | direction or management of such entity, whether by contract or
262 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
263 | outstanding shares, or (iii) beneficial ownership of such entity.
264 |
265 | "You" (or "Your") shall mean an individual or Legal Entity
266 | exercising permissions granted by this License.
267 |
268 | "Source" form shall mean the preferred form for making modifications,
269 | including but not limited to software source code, documentation
270 | source, and configuration files.
271 |
272 | "Object" form shall mean any form resulting from mechanical
273 | transformation or translation of a Source form, including but
274 | not limited to compiled object code, generated documentation,
275 | and conversions to other media types.
276 |
277 | "Work" shall mean the work of authorship, whether in Source or
278 | Object form, made available under the License, as indicated by a
279 | copyright notice that is included in or attached to the work
280 | (an example is provided in the Appendix below).
281 |
282 | "Derivative Works" shall mean any work, whether in Source or Object
283 | form, that is based on (or derived from) the Work and for which the
284 | editorial revisions, annotations, elaborations, or other modifications
285 | represent, as a whole, an original work of authorship. For the purposes
286 | of this License, Derivative Works shall not include works that remain
287 | separable from, or merely link (or bind by name) to the interfaces of,
288 | the Work and Derivative Works thereof.
289 |
290 | "Contribution" shall mean any work of authorship, including
291 | the original version of the Work and any modifications or additions
292 | to that Work or Derivative Works thereof, that is intentionally
293 | submitted to Licensor for inclusion in the Work by the copyright owner
294 | or by an individual or Legal Entity authorized to submit on behalf of
295 | the copyright owner. For the purposes of this definition, "submitted"
296 | means any form of electronic, verbal, or written communication sent
297 | to the Licensor or its representatives, including but not limited to
298 | communication on electronic mailing lists, source code control systems,
299 | and issue tracking systems that are managed by, or on behalf of, the
300 | Licensor for the purpose of discussing and improving the Work, but
301 | excluding communication that is conspicuously marked or otherwise
302 | designated in writing by the copyright owner as "Not a Contribution."
303 |
304 | "Contributor" shall mean Licensor and any individual or Legal Entity
305 | on behalf of whom a Contribution has been received by Licensor and
306 | subsequently incorporated within the Work.
307 |
308 | 2. Grant of Copyright License. Subject to the terms and conditions of
309 | this License, each Contributor hereby grants to You a perpetual,
310 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
311 | copyright license to reproduce, prepare Derivative Works of,
312 | publicly display, publicly perform, sublicense, and distribute the
313 | Work and such Derivative Works in Source or Object form.
314 |
315 | 3. Grant of Patent License. Subject to the terms and conditions of
316 | this License, each Contributor hereby grants to You a perpetual,
317 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
318 | (except as stated in this section) patent license to make, have made,
319 | use, offer to sell, sell, import, and otherwise transfer the Work,
320 | where such license applies only to those patent claims licensable
321 | by such Contributor that are necessarily infringed by their
322 | Contribution(s) alone or by combination of their Contribution(s)
323 | with the Work to which such Contribution(s) was submitted. If You
324 | institute patent litigation against any entity (including a
325 | cross-claim or counterclaim in a lawsuit) alleging that the Work
326 | or a Contribution incorporated within the Work constitutes direct
327 | or contributory patent infringement, then any patent licenses
328 | granted to You under this License for that Work shall terminate
329 | as of the date such litigation is filed.
330 |
331 | 4. Redistribution. You may reproduce and distribute copies of the
332 | Work or Derivative Works thereof in any medium, with or without
333 | modifications, and in Source or Object form, provided that You
334 | meet the following conditions:
335 |
336 | (a) You must give any other recipients of the Work or
337 | Derivative Works a copy of this License; and
338 |
339 | (b) You must cause any modified files to carry prominent notices
340 | stating that You changed the files; and
341 |
342 | (c) You must retain, in the Source form of any Derivative Works
343 | that You distribute, all copyright, patent, trademark, and
344 | attribution notices from the Source form of the Work,
345 | excluding those notices that do not pertain to any part of
346 | the Derivative Works; and
347 |
348 | (d) If the Work includes a "NOTICE" text file as part of its
349 | distribution, then any Derivative Works that You distribute must
350 | include a readable copy of the attribution notices contained
351 | within such NOTICE file, excluding those notices that do not
352 | pertain to any part of the Derivative Works, in at least one
353 | of the following places: within a NOTICE text file distributed
354 | as part of the Derivative Works; within the Source form or
355 | documentation, if provided along with the Derivative Works; or,
356 | within a display generated by the Derivative Works, if and
357 | wherever such third-party notices normally appear. The contents
358 | of the NOTICE file are for informational purposes only and
359 | do not modify the License. You may add Your own attribution
360 | notices within Derivative Works that You distribute, alongside
361 | or as an addendum to the NOTICE text from the Work, provided
362 | that such additional attribution notices cannot be construed
363 | as modifying the License.
364 |
365 | You may add Your own copyright statement to Your modifications and
366 | may provide additional or different license terms and conditions
367 | for use, reproduction, or distribution of Your modifications, or
368 | for any such Derivative Works as a whole, provided Your use,
369 | reproduction, and distribution of the Work otherwise complies with
370 | the conditions stated in this License.
371 |
372 | 5. Submission of Contributions. Unless You explicitly state otherwise,
373 | any Contribution intentionally submitted for inclusion in the Work
374 | by You to the Licensor shall be under the terms and conditions of
375 | this License, without any additional terms or conditions.
376 | Notwithstanding the above, nothing herein shall supersede or modify
377 | the terms of any separate license agreement you may have executed
378 | with Licensor regarding such Contributions.
379 |
380 | 6. Trademarks. This License does not grant permission to use the trade
381 | names, trademarks, service marks, or product names of the Licensor,
382 | except as required for reasonable and customary use in describing the
383 | origin of the Work and reproducing the content of the NOTICE file.
384 |
385 | 7. Disclaimer of Warranty. Unless required by applicable law or
386 | agreed to in writing, Licensor provides the Work (and each
387 | Contributor provides its Contributions) on an "AS IS" BASIS,
388 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
389 | implied, including, without limitation, any warranties or conditions
390 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
391 | PARTICULAR PURPOSE. You are solely responsible for determining the
392 | appropriateness of using or redistributing the Work and assume any
393 | risks associated with Your exercise of permissions under this License.
394 |
395 | 8. Limitation of Liability. In no event and under no legal theory,
396 | whether in tort (including negligence), contract, or otherwise,
397 | unless required by applicable law (such as deliberate and grossly
398 | negligent acts) or agreed to in writing, shall any Contributor be
399 | liable to You for damages, including any direct, indirect, special,
400 | incidental, or consequential damages of any character arising as a
401 | result of this License or out of the use or inability to use the
402 | Work (including but not limited to damages for loss of goodwill,
403 | work stoppage, computer failure or malfunction, or any and all
404 | other commercial damages or losses), even if such Contributor
405 | has been advised of the possibility of such damages.
406 |
407 | 9. Accepting Warranty or Additional Liability. While redistributing
408 | the Work or Derivative Works thereof, You may choose to offer,
409 | and charge a fee for, acceptance of support, warranty, indemnity,
410 | or other liability obligations and/or rights consistent with this
411 | License. However, in accepting such obligations, You may act only
412 | on Your own behalf and on Your sole responsibility, not on behalf
413 | of any other Contributor, and only if You agree to indemnify,
414 | defend, and hold each Contributor harmless for any liability
415 | incurred by, or claims asserted against, such Contributor by reason
416 | of your accepting any such warranty or additional liability.
417 |
418 | END OF TERMS AND CONDITIONS
419 |
420 | APPENDIX: How to apply the Apache License to your work.
421 |
422 | To apply the Apache License to your work, attach the following
423 | boilerplate notice, with the fields enclosed by brackets "[]"
424 | replaced with your own identifying information. (Don't include
425 | the brackets!) The text should be enclosed in the appropriate
426 | comment syntax for the file format. We also recommend that a
427 | file or class name and description of purpose be included on the
428 | same "printed page" as the copyright notice for easier
429 | identification within third-party archives.
430 |
431 | Copyright [yyyy] [name of copyright owner]
432 |
433 | Licensed under the Apache License, Version 2.0 (the "License");
434 | you may not use this file except in compliance with the License.
435 | You may obtain a copy of the License at
436 |
437 | http://www.apache.org/licenses/LICENSE-2.0
438 |
439 | Unless required by applicable law or agreed to in writing, software
440 | distributed under the License is distributed on an "AS IS" BASIS,
441 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
442 | See the License for the specific language governing permissions and
443 | limitations under the License.
444 |
445 | ------------- LICENSE FOR Facebook Fairseq code --------------
446 |
447 | MIT License
448 |
449 | Copyright (c) Facebook, Inc. and its affiliates.
450 |
451 | Permission is hereby granted, free of charge, to any person obtaining a copy
452 | of this software and associated documentation files (the "Software"), to deal
453 | in the Software without restriction, including without limitation the rights
454 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
455 | copies of the Software, and to permit persons to whom the Software is
456 | furnished to do so, subject to the following conditions:
457 |
458 | The above copyright notice and this permission notice shall be included in all
459 | copies or substantial portions of the Software.
460 |
461 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
462 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
463 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
464 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
465 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
466 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
467 | SOFTWARE.
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include LICENSE
2 | include NOTICE
3 | include README.md
4 | include requirements.txt
5 | include pyproject.toml
6 | recursive-include evo2/configs *.yml
7 | recursive-include vortex/vortex *
8 | recursive-exclude vortex/vortex *.pyc
9 | recursive-exclude vortex/vortex/__pycache__ *
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Copyright 2024 Arc Institute. All rights reserved
2 | Copyright 2024 Michael Poli. All rights reserved
3 | Copyright 2024 Stanford University. All rights reserved
4 |
5 | This project incorporates and modifies the components below:
6 |
7 |
8 | - Added training and inference support for Hyena2
9 | - Scaled model training (up to 40B) and context windows (up to 1M)
10 | - Biological/genomic inference and generation evals/tasks
11 |
12 | See AUTHORS file for list of contributing authors.
13 |
14 | See LICENSE file for software license. This software is licensed under the Apache License, Version 2.0.
15 | ======================================================================
16 |
17 | StripedHyena
18 | Copyright 2023-2024 Together
19 | Project URL: https://github.com/togethercomputer/stripedhyena
20 |
21 | This project includes software developed at Together for deep signal processing, hybrid architecture composed of rotary (grouped) attention and gated convolutions arranged in Hyena blocks, with improved scaling over decoder-only Transformers.
22 |
23 | ======================================================================
24 |
25 | GPT-NeoX
26 | Copyright 2021-2024 EleutherAI and contributors
27 | Project URL: https://github.com/EleutherAI/gpt-neox
28 |
29 | This project includes software developed at EleutherAI for large-scale language model training and inference.
30 |
31 | ======================================================================
32 |
33 | Megatron-LM
34 | Copyright 2019-2024 NVIDIA Corporation
35 | Project URL: https://github.com/NVIDIA/Megatron-LM
36 |
37 | This project includes software developed at NVIDIA Corporation for large-scale transformer model training.
38 |
39 | ======================================================================
40 |
41 | DeepSpeed
42 | Copyright 2020-2024 Microsoft Corporation
43 | Project URL: https://github.com/microsoft/DeepSpeed
44 |
45 | This project includes software developed at Microsoft Corporation as part of the DeepSpeed deep learning optimization library.
46 |
47 | ======================================================================
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Evo 2: Genome modeling and design across all domains of life
2 |
3 | 
4 |
5 | Evo 2 is a state of the art DNA language model for long context modeling and design. Evo 2 models DNA sequences at single-nucleotide resolution at up to 1 million base pair context length using the [StripedHyena 2](https://github.com/Zymrael/savanna/blob/main/paper.pdf) architecture. Evo 2 was pretrained using [Savanna](https://github.com/Zymrael/savanna). Evo 2 was trained autoregressively on [OpenGenome2](https://huggingface.co/datasets/arcinstitute/opengenome2), a dataset containing 8.8 trillion tokens from all domains of life.
6 |
7 | We describe Evo 2 in the preprint:
8 | ["Genome modeling and design across all domains of life with Evo 2"](https://www.biorxiv.org/content/10.1101/2025.02.18.638918v1).
9 |
10 | ## Contents
11 |
12 | - [Setup](#setup)
13 | - [Requirements](#requirements)
14 | - [Installation](#installation)
15 | - [Checkpoints](#checkpoints)
16 | - [Usage](#usage)
17 | - [Forward](#forward)
18 | - [Embeddings](#embeddings)
19 | - [Generation](#generation)
20 | - [Notebooks](#notebooks)
21 | - [Nvidia NIM](#nvidia-nim)
22 | - [Dataset](#dataset)
23 | - [Training and Finetuning](#training-and-finetuning)
24 | - [Citation](#citation)
25 |
26 | ## Setup
27 |
28 | This repo is for running Evo 2 locally for inference or generation, using our [Vortex](https://github.com/Zymrael/vortex) inference code. For training and finetuning, see the section [here](#training-and-finetuning).
29 | You can run Evo 2 without any installation using the [Nvidia Hosted API](https://build.nvidia.com/arc/evo2-40b).
30 | You can also self-host an instance using Nvidia NIM. See the [Nvidia NIM](#nvidia-nim) section for more
31 | information.
32 |
33 | ### Requirements
34 |
35 | Evo 2 is based on [StripedHyena 2](https://github.com/Zymrael/vortex) which requires python>=3.11. Evo 2 uses [Transformer Engine](https://github.com/NVIDIA/TransformerEngine) FP8 for some layers which requires an H100 (or other GPU with compute capability ≥8.9). We are actively investigating ways to avoid this requirement.
36 |
37 | ### Installation
38 |
39 | To install Evo 2 for inference or generation, please clone and install from GitHub. We recommend using a new conda environment with python>=3.11.
40 |
41 | ```bash
42 | git clone --recurse-submodules git@github.com:ArcInstitute/evo2.git
43 | cd evo2
44 | pip install .
45 | ```
46 |
47 | If this did not work for whatever reason, you can also install from [Vortex](https://github.com/Zymrael/vortex) and follow the instructions there. PyPi support coming soon!
48 |
49 | You can check that the installation was correct by running a test.
50 |
51 | ```
52 | python ./test/test_evo2.py --model_name evo2_7b
53 | ```
54 |
55 | ## Checkpoints
56 |
57 | We provide the following model checkpoints, hosted on [HuggingFace](https://huggingface.co/arcinstitute):
58 | | Checkpoint Name | Description |
59 | |----------------------------------------|-------------|
60 | | `evo2_40b` | A model pretrained with 1 million context obtained through context extension of `evo2_40b_base`.|
61 | | `evo2_7b` | A model pretrained with 1 million context obtained through context extension of `evo2_7b_base`.|
62 | | `evo2_40b_base` | A model pretrained with 8192 context length.|
63 | | `evo2_7b_base` | A model pretrained with 8192 context length.|
64 | | `evo2_1b_base` | A smaller model pretrained with 8192 context length.|
65 |
66 | To use Evo 2 40B, you will need multiple GPUs. Vortex automatically handles device placement, splitting the model across available cuda devices.
67 |
68 | ## Usage
69 |
70 | Below are simple examples of how to download Evo 2 and use it locally in Python.
71 |
72 | ### Forward
73 |
74 | Evo 2 can be used to score the likelihoods across a DNA sequence.
75 |
76 | ```python
77 | import torch
78 | from evo2 import Evo2
79 |
80 | evo2_model = Evo2('evo2_7b')
81 |
82 | sequence = 'ACGT'
83 | input_ids = torch.tensor(
84 | evo2_model.tokenizer.tokenize(sequence),
85 | dtype=torch.int,
86 | ).unsqueeze(0).to('cuda:0')
87 |
88 | outputs, _ = evo2_model(input_ids)
89 | logits = outputs[0]
90 |
91 | print('Logits: ', logits)
92 | print('Shape (batch, length, vocab): ', logits.shape)
93 | ```
94 |
95 | ### Embeddings
96 |
97 | Evo 2 embeddings can be saved for use downstream. We find that intermediate embeddings work better than final embeddings, see our paper for details.
98 |
99 | ```python
100 | import torch
101 | from evo2 import Evo2
102 |
103 | evo2_model = Evo2('evo2_7b')
104 |
105 | sequence = 'ACGT'
106 | input_ids = torch.tensor(
107 | evo2_model.tokenizer.tokenize(sequence),
108 | dtype=torch.int,
109 | ).unsqueeze(0).to('cuda:0')
110 |
111 | layer_name = 'blocks.28.mlp.l3'
112 |
113 | outputs, embeddings = evo2_model(input_ids, return_embeddings=True, layer_names=[layer_name])
114 |
115 | print('Embeddings shape: ', embeddings[layer_name].shape)
116 | ```
117 |
118 | ### Generation
119 |
120 | Evo 2 can generate DNA sequences based on prompts.
121 |
122 | ```python
123 | from evo2 import Evo2
124 |
125 | evo2_model = Evo2('evo2_7b')
126 |
127 | output = evo2_model.generate(prompt_seqs=["ACGT"], n_tokens=400, temperature=1.0, top_k=4)
128 |
129 | print(output.sequences[0])
130 | ```
131 |
132 | ### Notebooks
133 |
134 | We provide example notebooks.
135 |
136 | The [BRCA1 notebook](https://github.com/ArcInstitute/evo2/blob/main/notebooks/brca1/brca1_zero_shot_vep.ipynb) shows zero-shot *BRCA1* variant effect prediction. This example includes a walkthrough of:
137 | - Performing zero-shot *BRCA1* variant effect predictions using Evo 2
138 | - Reference vs alternative allele normalization
139 |
140 | The [generation notebook](https://github.com/ArcInstitute/evo2/blob/main/notebooks/generation/generation_notebook.ipynb) shows DNA sequence completion with Evo 2. This example shows:
141 | - DNA prompt based generation and 'DNA autocompletion'
142 | - How to get and prompt using phylogenetic species tags for generation
143 |
144 | ### Nvidia NIM
145 |
146 | Evo 2 is available on [Nvidia NIM](https://catalog.ngc.nvidia.com/containers?filters=&orderBy=scoreDESC&query=evo2&page=&pageSize=) and [hosted API](https://build.nvidia.com/arc/evo2-40b).
147 |
148 | - [Documentation](https://docs.nvidia.com/nim/bionemo/evo2/latest/overview.html)
149 | - [Quickstart](https://docs.nvidia.com/nim/bionemo/evo2/latest/quickstart-guide.html)
150 |
151 | The quickstart guides users through running Evo 2 on the NVIDIA NIM using a python or shell client after starting NIM. An example python client script is shown below. This is the same way you would interact with the [Nvidia hosted API](https://build.nvidia.com/arc/evo2-40b?snippet_tab=Python).
152 |
153 | ```python
154 | #!/usr/bin/env python3
155 | import requests
156 | import os
157 | import json
158 | from pathlib import Path
159 |
160 | key = os.getenv("NVCF_RUN_KEY") or input("Paste the Run Key: ")
161 |
162 | r = requests.post(
163 | url=os.getenv("URL", "https://health.api.nvidia.com/v1/biology/arc/evo2-40b/generate"),
164 | headers={"Authorization": f"Bearer {key}"},
165 | json={
166 | "sequence": "ACTGACTGACTGACTG",
167 | "num_tokens": 8,
168 | "top_k": 1,
169 | "enable_sampled_probs": True,
170 | },
171 | )
172 |
173 | if "application/json" in r.headers.get("Content-Type", ""):
174 | print(r, "Saving to output.json:\n", r.text[:200], "...")
175 | Path("output.json").write_text(r.text)
176 | elif "application/zip" in r.headers.get("Content-Type", ""):
177 | print(r, "Saving large response to data.zip")
178 | Path("data.zip").write_bytes(r.content)
179 | else:
180 | print(r, r.headers, r.content)
181 | ```
182 |
183 |
184 | ### Very long sequences
185 |
186 | We are actively working on optimizing performance for long sequence processing in Vortex. Vortex can currently compute over very long sequences via teacher prompting. However please note that forward pass on long sequences may currently be slow. You can instead use [Savanna](https://github.com/Zymrael/savanna) or [Nvidia BioNemo](https://github.com/NVIDIA/bionemo-framework) for embedding long sequences.
187 |
188 | ### Dataset
189 |
190 | The OpenGenome2 dataset used for pretraining Evo2 is available on [HuggingFace ](https://huggingface.co/datasets/arcinstitute/opengenome2). Data is available either as raw fastas or as JSONL files which include preprocessing and data augmentation.
191 |
192 | ### Training and Finetuning
193 |
194 | Evo 2 was trained using [Savanna](https://github.com/Zymrael/savanna), an open source framework for training alternative architectures.
195 |
196 | To train or finetune Evo 2, you can use [Savanna](https://github.com/Zymrael/savanna) or [Nvidia BioNemo](https://github.com/NVIDIA/bionemo-framework) which provides a [Evo 2 finetuning tutorial here](https://github.com/NVIDIA/bionemo-framework/blob/ca16c2acf9bf813d020b6d1e2d4e1240cfef6a69/docs/docs/user-guide/examples/bionemo-evo2/fine-tuning-tutorial.ipynb).
197 |
198 | ## Citation
199 |
200 | If you find these models useful for your research, please cite the relevant papers
201 |
202 | ```
203 | @article {Brixi2025.02.18.638918,
204 | author = {Brixi, Garyk and Durrant, Matthew G and Ku, Jerome and Poli, Michael and Brockman, Greg and Chang, Daniel and Gonzalez, Gabriel A and King, Samuel H and Li, David B and Merchant, Aditi T and Naghipourfar, Mohsen and Nguyen, Eric and Ricci-Tam, Chiara and Romero, David W and Sun, Gwanggyu and Taghibakshi, Ali and Vorontsov, Anton and Yang, Brandon and Deng, Myra and Gorton, Liv and Nguyen, Nam and Wang, Nicholas K and Adams, Etowah and Baccus, Stephen A and Dillmann, Steven and Ermon, Stefano and Guo, Daniel and Ilango, Rajesh and Janik, Ken and Lu, Amy X and Mehta, Reshma and Mofrad, Mohammad R.K. and Ng, Madelena Y and Pannu, Jaspreet and Re, Christopher and Schmok, Jonathan C and St. John, John and Sullivan, Jeremy and Zhu, Kevin and Zynda, Greg and Balsam, Daniel and Collison, Patrick and Costa, Anthony B. and Hernandez-Boussard, Tina and Ho, Eric and Liu, Ming-Yu and McGrath, Tom and Powell, Kimberly and Burke, Dave P. and Goodarzi, Hani and Hsu, Patrick D and Hie, Brian},
205 | title = {Genome modeling and design across all domains of life with Evo 2},
206 | elocation-id = {2025.02.18.638918},
207 | year = {2025},
208 | doi = {10.1101/2025.02.18.638918},
209 | publisher = {Cold Spring Harbor Laboratory},
210 | URL = {https://www.biorxiv.org/content/early/2025/02/21/2025.02.18.638918},
211 | eprint = {https://www.biorxiv.org/content/early/2025/02/21/2025.02.18.638918.full.pdf},
212 | journal = {bioRxiv}
213 | }
214 | ```
215 |
--------------------------------------------------------------------------------
/evo2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArcInstitute/evo2/a796302818055b9710a6a2c4d7882a6243363fdd/evo2.jpg
--------------------------------------------------------------------------------
/evo2/__init__.py:
--------------------------------------------------------------------------------
1 | from .models import Evo2
--------------------------------------------------------------------------------
/evo2/configs/evo2-1b-8k.yml:
--------------------------------------------------------------------------------
1 | model_name: shc-evo2-1b-8k-2T-v2
2 |
3 | vocab_size: 512
4 | hidden_size: 1920
5 | # Number of independent filters in Hyena-LI
6 | num_filters: 1920
7 | attn_layer_idxs: [3,10,17,24]
8 | hcl_layer_idxs: [2,6,9,13,16,20,23]
9 | hcm_layer_idxs: [1,5,8,12,15,19,22]
10 | hcs_layer_idxs: [0,4,7,11,14,18,21]
11 |
12 | hcm_filter_length: 128
13 | hcl_filter_groups: 1920
14 | hcm_filter_groups: 128
15 | hcs_filter_groups: 128
16 | hcs_filter_length: 7
17 | num_layers: 25
18 |
19 | # Length of the short, depthwise FIR applied to input projections
20 | short_filter_length: 3
21 | num_attention_heads: 15
22 | short_filter_bias: false # add bias to FIR
23 | mlp_init_method: torch.nn.init.zeros_
24 | mlp_output_init_method: torch.nn.init.zeros_
25 | eps: 0.000001
26 | state_size: 16
27 | rotary_emb_base: 10000
28 | make_vocab_size_divisible_by: 8
29 | inner_size_multiple_of: 16 # force GLU inner_size to be a multiple of
30 | inner_mlp_size: 5120
31 | log_intermediate_values: False
32 | # Number of groups in GQA
33 | proj_groups: 1
34 | # Number of groups in grouped
35 | hyena_filter_groups: 1
36 | # Split strategy for channels
37 | column_split_hyena: False
38 | column_split: True
39 | interleave: True
40 | # Layer > 0 nn.identity activation
41 | evo2_style_activations: True
42 |
43 | # Legacy options for MP / PP inference
44 | model_parallel_size: 1
45 | pipe_parallel_size: 1
46 | tie_embeddings: True
47 | mha_out_proj_bias: True
48 | hyena_out_proj_bias: True
49 | hyena_flip_x1x2: False
50 | qkv_proj_bias: False
51 | use_fp8_input_projections: True
52 | max_seqlen: 8192
53 | max_batch_size: 1
54 | final_norm: True
55 | use_flash_attn: True
56 | use_flash_rmsnorm: False
57 | use_flash_depthwise: False
58 | use_flashfft: False
59 | use_laughing_hyena: False
60 | inference_mode: True
61 | tokenizer_type: CharLevelTokenizer
62 | prefill_style: fft
63 | mlp_activation: gelu
64 | print_activations: False
65 |
--------------------------------------------------------------------------------
/evo2/configs/evo2-40b-1m.yml:
--------------------------------------------------------------------------------
1 | model_name: shc-evo2-40b-8k-11T-v2
2 |
3 | vocab_size: 512
4 | hidden_size: 8192
5 | # Number of independent filters in Hyena-LI
6 | num_filters: 8192
7 | hcl_layer_idxs: [2,6,9,13,16,20,23,27,30,34,38,41,45,48]
8 | hcm_layer_idxs: [1,5,8,12,15,19,22,26,29,33,37,40,44,47]
9 | hcs_layer_idxs: [0,4,7,11,14,18,21,25,28,32,36,39,43,46]
10 | attn_layer_idxs: [3,10,17,24,31,35,42,49]
11 | hcm_filter_length: 128
12 | hcl_filter_groups: 8192
13 | hcm_filter_groups: 512
14 | hcs_filter_groups: 512
15 | hcs_filter_length: 7
16 | num_layers: 50
17 |
18 | # Length of the short, depthwise FIR applied to input projections
19 | short_filter_length: 3
20 | num_attention_heads: 64
21 | short_filter_bias: false # add bias to FIR
22 | mlp_init_method: torch.nn.init.zeros_
23 | mlp_output_init_method: torch.nn.init.zeros_
24 | eps: 0.000001
25 | state_size: 16
26 | rotary_emb_base: 100000000000
27 | rotary_emb_scaling_factor: 128
28 | use_interpolated_rotary_pos_emb: True
29 | make_vocab_size_divisible_by: 8
30 | inner_size_multiple_of: 128 # force GLU inner_size to be a multiple of
31 | inner_mlp_size: 22528
32 | log_intermediate_values: False
33 | # Number of groups in GQA
34 | proj_groups: 1
35 | # Number of groups in grouped
36 | hyena_filter_groups: 1
37 | # Split strategy for channels
38 | column_split_hyena: False
39 | column_split: True
40 | interleave: True
41 | # Layer > 0 nn.identity activation
42 | evo2_style_activations: True
43 |
44 | use_fp8_input_projections: True
45 |
46 | # Legacy options for MP / PP inference
47 | model_parallel_size: 1
48 | pipe_parallel_size: 1
49 | tie_embeddings: True
50 | mha_out_proj_bias: True
51 | hyena_out_proj_bias: True
52 | hyena_flip_x1x2: False
53 | qkv_proj_bias: False
54 | max_seqlen: 1048576
55 | max_batch_size: 1
56 | final_norm: True
57 | use_flash_attn: True
58 | use_flash_rmsnorm: False
59 | use_flash_depthwise: False
60 | use_flashfft: False
61 | use_laughing_hyena: False
62 | inference_mode: True
63 | tokenizer_type: CharLevelTokenizer
64 | prefill_style: fft
65 | mlp_activation: gelu
66 | print_activations: False
67 |
--------------------------------------------------------------------------------
/evo2/configs/evo2-40b-8k.yml:
--------------------------------------------------------------------------------
1 | model_name: shc-evo2-40b-8k-11T-v2
2 |
3 | vocab_size: 512
4 | hidden_size: 8192
5 | num_filters: 8192
6 | hcl_layer_idxs: [2,6,9,13,16,20,23,27,30,34,38,41,45,48]
7 | hcm_layer_idxs: [1,5,8,12,15,19,22,26,29,33,37,40,44,47]
8 | hcs_layer_idxs: [0,4,7,11,14,18,21,25,28,32,36,39,43,46]
9 | attn_layer_idxs: [3,10,17,24,31,35,42,49]
10 | hcm_filter_length: 128
11 | hcl_filter_groups: 8192
12 | hcm_filter_groups: 512
13 | hcs_filter_groups: 512
14 | hcs_filter_length: 7
15 | num_layers: 50
16 |
17 | # Length of the short, depthwise FIR applied to input projections
18 | short_filter_length: 3
19 | num_attention_heads: 64
20 | short_filter_bias: false # add bias to FIR
21 | mlp_init_method: torch.nn.init.zeros_
22 | mlp_output_init_method: torch.nn.init.zeros_
23 | eps: 0.000001
24 | state_size: 16
25 | rotary_emb_base: 1000000
26 | make_vocab_size_divisible_by: 8
27 | inner_size_multiple_of: 128 # force GLU inner_size to be a multiple of
28 | inner_mlp_size: 21888
29 | log_intermediate_values: False
30 | # Number of groups in GQA
31 | proj_groups: 1
32 | # Number of groups in grouped
33 | hyena_filter_groups: 1
34 | # Split strategy for channels
35 | column_split_hyena: False
36 | column_split: True
37 | interleave: True
38 | # Layer > 0 nn.identity activation
39 | evo2_style_activations: True
40 |
41 | use_fp8_input_projections: True
42 |
43 | # Legacy options for MP / PP inference
44 | model_parallel_size: 1
45 | pipe_parallel_size: 1
46 | tie_embeddings: True
47 | mha_out_proj_bias: True
48 | hyena_out_proj_bias: True
49 | hyena_flip_x1x2: False
50 | qkv_proj_bias: False
51 | max_seqlen: 8192
52 | max_batch_size: 1
53 | final_norm: True
54 | use_flash_attn: True
55 | use_flash_rmsnorm: False
56 | use_flash_depthwise: False
57 | use_flashfft: False
58 | use_laughing_hyena: False
59 | inference_mode: True
60 | tokenizer_type: CharLevelTokenizer
61 | prefill_style: fft
62 | mlp_activation: gelu
63 | print_activations: False
64 |
--------------------------------------------------------------------------------
/evo2/configs/evo2-7b-1m.yml:
--------------------------------------------------------------------------------
1 | model_name: shc-evo2-7b-8k-2T-v2
2 |
3 | vocab_size: 512
4 | hidden_size: 4096
5 | # Number of long convolution filters in each hyena block. Can be smaller than `hidden_size`
6 | num_filters: 4096
7 | hcl_layer_idxs: [2,6,9,13,16,20,23,27,30]
8 | hcm_layer_idxs: [1,5,8,12,15,19,22,26,29]
9 | hcs_layer_idxs: [0,4,7,11,14,18,21,25,28]
10 | attn_layer_idxs: [3,10,17,24,31]
11 |
12 | hcm_filter_length: 128
13 | hcl_filter_groups: 4096
14 | hcm_filter_groups: 256
15 | hcs_filter_groups: 256
16 | hcs_filter_length: 7
17 | num_layers: 32
18 |
19 | # Length of the short, depthwise FIR applied to input projections
20 | short_filter_length: 3
21 | num_attention_heads: 32
22 | short_filter_bias: false # add bias to FIR
23 | mlp_init_method: torch.nn.init.zeros_
24 | mlp_output_init_method: torch.nn.init.zeros_
25 | eps: 0.000001
26 | state_size: 16
27 | rotary_emb_base: 100000000000
28 | rotary_emb_scaling_factor: 128
29 | use_interpolated_rotary_pos_emb: True
30 | make_vocab_size_divisible_by: 8
31 | inner_size_multiple_of: 16 # force GLU inner_size to be a multiple of
32 | inner_mlp_size: 11264
33 | log_intermediate_values: False
34 | # Number of groups in GQA
35 | proj_groups: 1
36 | # Number of groups in grouped
37 | hyena_filter_groups: 1
38 | # Split strategy for channels
39 | column_split_hyena: False
40 | column_split: True
41 | interleave: True
42 | # Layer > 0 nn.identity activation
43 | evo2_style_activations: True
44 | # Legacy options for MP / PP inference
45 | model_parallel_size: 1
46 | pipe_parallel_size: 1
47 | tie_embeddings: True
48 | mha_out_proj_bias: True
49 | hyena_out_proj_bias: True
50 | hyena_flip_x1x2: False
51 | qkv_proj_bias: False
52 | use_fp8_input_projections: True
53 | max_seqlen: 1048576
54 | max_batch_size: 1
55 | final_norm: True
56 | use_flash_attn: True
57 | use_flash_rmsnorm: False
58 | use_flash_depthwise: False
59 | use_flashfft: False
60 | use_laughing_hyena: False
61 | inference_mode: True
62 | tokenizer_type: CharLevelTokenizer
63 | prefill_style: fft
64 | mlp_activation: gelu
65 | print_activations: False
66 |
--------------------------------------------------------------------------------
/evo2/configs/evo2-7b-8k.yml:
--------------------------------------------------------------------------------
1 | model_name: shc-evo2-7b-8k-2T-v2
2 |
3 | vocab_size: 512
4 | hidden_size: 4096
5 | num_filters: 4096
6 | hcl_layer_idxs: [2,6,9,13,16,20,23,27,30]
7 | hcm_layer_idxs: [1,5,8,12,15,19,22,26,29]
8 | hcs_layer_idxs: [0,4,7,11,14,18,21,25,28]
9 | attn_layer_idxs: [3,10,17,24,31]
10 |
11 | # Number of unique convolution filters in each hyena block. Can be smaller than `hidden_size`
12 | hcm_filter_length: 128
13 | hcl_filter_groups: 4096
14 | hcm_filter_groups: 256
15 | hcs_filter_groups: 256
16 | hcs_filter_length: 7
17 | num_layers: 32
18 |
19 | # Length of the short, depthwise FIR applied to input projections
20 | short_filter_length: 3
21 | num_attention_heads: 32
22 | short_filter_bias: false # add bias to FIR
23 | mlp_init_method: torch.nn.init.zeros_
24 | mlp_output_init_method: torch.nn.init.zeros_
25 | eps: 0.000001
26 | state_size: 16
27 | rotary_emb_base: 10000
28 | make_vocab_size_divisible_by: 8
29 | inner_size_multiple_of: 16 # force GLU inner_size to be a multiple of
30 | inner_mlp_size: 11008
31 | log_intermediate_values: False
32 | # Number of groups in GQA
33 | proj_groups: 1
34 | # Number of groups in grouped
35 | hyena_filter_groups: 1
36 | # Split strategy for channels
37 | column_split_hyena: False
38 | column_split: True
39 | interleave: True
40 | # Layer > 0 nn.identity activation
41 | evo2_style_activations: True
42 | # Legacy options for MP / PP inference
43 | model_parallel_size: 1
44 | pipe_parallel_size: 1
45 | tie_embeddings: True
46 | mha_out_proj_bias: True
47 | hyena_out_proj_bias: True
48 | hyena_flip_x1x2: False
49 | qkv_proj_bias: False
50 | use_fp8_input_projections: False
51 | max_seqlen: 32768
52 | max_batch_size: 1
53 | final_norm: True
54 | use_flash_attn: True
55 | use_flash_rmsnorm: False
56 | use_flash_depthwise: False
57 | use_flashfft: False
58 | use_laughing_hyena: False
59 | inference_mode: True
60 | tokenizer_type: CharLevelTokenizer
61 | prefill_style: fft
62 | mlp_activation: gelu
63 | print_activations: False
64 |
--------------------------------------------------------------------------------
/evo2/models.py:
--------------------------------------------------------------------------------
1 | from functools import partial
2 | import huggingface_hub
3 | from huggingface_hub import snapshot_download, constants, hf_hub_download
4 | import os
5 | import pkgutil
6 | import torch
7 | from typing import List, Tuple, Dict, Union
8 | import yaml
9 |
10 |
11 | from vortex.model.generation import generate as vortex_generate
12 | from vortex.model.model import StripedHyena
13 | from vortex.model.tokenizer import CharLevelTokenizer
14 | from vortex.model.utils import dotdict, print_rank_0, load_checkpoint
15 |
16 | from evo2.scoring import score_sequences, score_sequences_rc
17 | from evo2.utils import MODEL_NAMES, HF_MODEL_NAME_MAP, CONFIG_MAP
18 |
19 | class Evo2:
20 | def __init__(self, model_name: str = MODEL_NAMES[1], local_path: str = None):
21 | """
22 | Load an Evo 2 checkpoint.
23 |
24 | Uses local_path if specified, otherwise checks if in local HuggingFace ~cache.
25 | Automatically downloads checkpoint from HuggingFace if it does not exist locally.
26 |
27 | Vortex automatically handles device placement on CUDA, and splits model across
28 | multiple GPUs if available.
29 | For models split across multiple GPUs, you can specify which GPUs to use with
30 | CUDA_VISIBLE_DEVICES. If using multi-gpu, do not use .to(device) manually.
31 |
32 | Notes:
33 | Evo 2 40b is too large to fit on a single H100 GPU, so needs multiple GPUs.
34 | You can change where HuggingFace downloads to by setting the HF_HOME environment
35 | variable.
36 | """
37 | if model_name not in MODEL_NAMES:
38 | raise ValueError(
39 | f'Invalid model name {model_name}. Should be one of: '
40 | f'{", ".join(MODEL_NAMES)}.'
41 | )
42 |
43 | config_path = CONFIG_MAP[model_name]
44 |
45 | if local_path is not None:
46 | self.model = self.load_evo2_model(None, config_path, local_path)
47 | else:
48 | self.model = self.load_evo2_model(model_name, config_path)
49 |
50 | self.tokenizer = CharLevelTokenizer(512)
51 |
52 | def forward(
53 | self,
54 | input_ids: torch.Tensor,
55 | return_embeddings: bool = False,
56 | layer_names=None,
57 | ) -> Tuple[torch.Tensor, Dict[str, torch.Tensor]]:
58 | """
59 | Forward pass with optional embedding extraction.
60 |
61 | Args:
62 | input_ids: Input token IDs
63 | return_embeddings: If True, returns embeddings from specified layers
64 | layer_names: List of layer names to extract embeddings from. Required if
65 | return_embeddings=True
66 |
67 | Returns:
68 | Tuple of (logits, embeddings_dict) if return_embeddings=True
69 | Tuple of (logits, None) otherwise
70 | """
71 | embeddings = {}
72 | handles = []
73 |
74 | if return_embeddings:
75 | if layer_names is None:
76 | raise ValueError(
77 | "layer_names must be specified when return_embeddings=True. Look at "
78 | "evo2_model.model.state_dict().keys() to see available layers."
79 | )
80 |
81 | def hook_fn(layer_name):
82 | def hook(_, __, output):
83 | if isinstance(output, tuple):
84 | output = output[0]
85 | embeddings[layer_name] = output.detach()
86 | return hook
87 |
88 | # Register hooks for requested layers
89 | for name in layer_names:
90 | layer = self.model.get_submodule(name)
91 | handles.append(layer.register_forward_hook(hook_fn(name)))
92 |
93 | try:
94 | # Original forward pass
95 | with torch.no_grad():
96 | logits = self.model.forward(input_ids)
97 |
98 | if return_embeddings:
99 | return logits, embeddings
100 | return logits, None
101 |
102 | finally:
103 | for handle in handles:
104 | handle.remove()
105 |
106 | def __call__(self, input_ids, return_embeddings=False, layer_names=None):
107 | return self.forward(input_ids, return_embeddings, layer_names)
108 |
109 | def score_sequences(
110 | self,
111 | seqs: List[str],
112 | batch_size: int = 1,
113 | prepend_bos: bool = False,
114 | reduce_method: str = 'mean',
115 | average_reverse_complement: bool = False,
116 | ) -> List[float]:
117 | scoring_func = partial(
118 | score_sequences_rc if average_reverse_complement else score_sequences,
119 | model=self.model,
120 | tokenizer=self.tokenizer,
121 | batch_size=batch_size,
122 | prepend_bos=prepend_bos,
123 | reduce_method=reduce_method,
124 | )
125 |
126 | with torch.no_grad():
127 | try:
128 | scores = scoring_func(seqs)
129 | except Exception as e:
130 | raise RuntimeError(f"Error during sequence scoring: {str(e)}") from e
131 |
132 | return scores
133 |
134 | def generate(
135 | self,
136 | prompt_seqs: List[str],
137 | n_tokens: int = 500,
138 | temperature: float = 1.0,
139 | top_k: int = 4,
140 | top_p: float = 1.0,
141 | batched: bool = True,
142 | cached_generation: bool = True,
143 | verbose: int = 1,
144 | force_prompt_threshold: int = None,
145 | ) -> Tuple[List[str], List[float]]:
146 | """
147 | Generate sequences from a list of prompts.
148 |
149 | force_prompt_threshold: If specified, avoids OOM errors through teacher forcing if the prompt is longer than this threshold.
150 |
151 | If force_prompt_threshold is none, sets default assuming 1xH100 (evo2_7b) and 2xH100 (evo2_40b) to help avoid OOM errors.
152 | """
153 |
154 | with torch.no_grad():
155 | output = vortex_generate(
156 | prompt_seqs=prompt_seqs,
157 | model=self.model,
158 | tokenizer=self.tokenizer,
159 | n_tokens=n_tokens,
160 | temperature=temperature,
161 | top_k=top_k,
162 | top_p=top_p,
163 | batched=batched,
164 | cached_generation=cached_generation,
165 | verbose=verbose,
166 | force_prompt_threshold=force_prompt_threshold,
167 | )
168 | return output
169 |
170 |
171 | def load_evo2_model(
172 | self,
173 | model_name: str = MODEL_NAMES[1],
174 | config_path: str = None,
175 | local_path: str = None,
176 | remove_shards: bool = True,
177 | ):
178 | """
179 | Load HuggingFace checkpoint using StripedHyena 2.
180 |
181 | If local_path is specified, loads from local_path.
182 | Otherwise, downloads from HuggingFace.
183 | If remove_shards is True, removes HF checkpoint shards after merging to .pt file.
184 | """
185 | if local_path is not None:
186 | print(f"Loading model from {local_path}...")
187 | print(f"Loading config from {config_path}...")
188 | config = dotdict(yaml.load(open(config_path), Loader=yaml.FullLoader))
189 | model = StripedHyena(config)
190 | load_checkpoint(model, local_path)
191 | return model
192 |
193 | hf_model_name = HF_MODEL_NAME_MAP[model_name]
194 | filename = f"{model_name}.pt"
195 |
196 | final_weights_path = os.path.join(os.path.dirname(constants.HF_HUB_CACHE), filename)
197 | if os.path.exists(final_weights_path):
198 | print(f"Found existing merged file: {final_weights_path}")
199 | weights_path = final_weights_path
200 |
201 | hf_hub_download(
202 | repo_id=hf_model_name,
203 | filename="config.json"
204 | )
205 | else:
206 | repo_dir = snapshot_download(
207 | repo_id=hf_model_name,
208 | )
209 |
210 | # Check if the complete file already exists in the repo
211 | repo_weights_path = os.path.join(repo_dir, filename)
212 | if os.path.exists(repo_weights_path):
213 | print(f"Found complete file in repo: {filename}")
214 | weights_path = repo_weights_path
215 | else:
216 | print(f"Looking for checkpoint shards for {filename}")
217 | parts = []
218 | part_num = 0
219 |
220 | while True:
221 | part_path = os.path.join(repo_dir, f"{filename}.part{part_num}")
222 | if os.path.exists(part_path):
223 | parts.append(part_path)
224 | part_num += 1
225 | else:
226 | break
227 |
228 | if parts:
229 | print(f"Found {len(parts)} shards, merging them...")
230 | with open(final_weights_path, 'wb') as outfile:
231 | for part in parts:
232 | print(f"Merging shard: {os.path.basename(part)}")
233 | with open(part, 'rb') as infile:
234 | while True:
235 | chunk = infile.read(8192*1024)
236 | if not chunk:
237 | break
238 | outfile.write(chunk)
239 |
240 | print(f"Successfully merged all shards into {final_weights_path}")
241 | weights_path = final_weights_path
242 | if remove_shards and os.path.exists(final_weights_path):
243 | for part in parts:
244 | real_path = os.path.realpath(part)
245 | if os.path.exists(real_path):
246 | os.remove(real_path)
247 | if os.path.exists(part):
248 | os.remove(part)
249 | else:
250 | raise FileNotFoundError(f"Could not find {filename} or any of its shards in {repo_dir}")
251 |
252 | config = yaml.safe_load(pkgutil.get_data(__name__, config_path))
253 | global_config = dotdict(config, Loader=yaml.FullLoader)
254 |
255 | model = StripedHyena(global_config)
256 | load_checkpoint(model, weights_path)
257 |
258 | return model
259 |
--------------------------------------------------------------------------------
/evo2/scoring.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from typing import List, Tuple, Union
3 | from Bio.Seq import Seq
4 | from tqdm import tqdm
5 |
6 | import torch
7 | from vortex.model.model import StripedHyena
8 |
9 |
10 | def prepare_batch(
11 | seqs: List[str],
12 | tokenizer: object,
13 | prepend_bos: bool = False,
14 | device: str = 'cuda:0'
15 | ) -> Tuple[torch.Tensor, List[int]]:
16 | """
17 | Takes in a list of sequences, tokenizes them, and puts them in a tensor batch.
18 | If the sequences have differing lengths, then pad up to the maximum sequence length.
19 | """
20 | seq_lengths = [ len(seq) for seq in seqs ]
21 | max_seq_length = max(seq_lengths)
22 |
23 | input_ids = []
24 | for seq in seqs:
25 | padding = [tokenizer.pad_id] * (max_seq_length - len(seq))
26 | input_ids.append(
27 | torch.tensor(
28 | ([tokenizer.eod_id] * int(prepend_bos)) + tokenizer.tokenize(seq) + padding,
29 | dtype=torch.long,
30 | ).to(device).unsqueeze(0)
31 | )
32 | input_ids = torch.cat(input_ids, dim=0)
33 |
34 | return input_ids, seq_lengths
35 |
36 |
37 | def logits_to_logprobs(
38 | logits: torch.Tensor,
39 | input_ids: torch.Tensor,
40 | ) -> torch.Tensor:
41 | """
42 | Takes in a tensor of logits of dimension (batch, length, vocab).
43 | Computes the log-likelihoods using a softmax along the vocab dimension.
44 | Uses the `input_ids` to index into the log-likelihoods and returns the likelihood
45 | of the provided sequence at each position with dimension (batch, length).
46 | """
47 | softmax_logprobs = torch.log_softmax(logits, dim=-1)
48 | softmax_logprobs = softmax_logprobs[:, :-1]
49 | input_ids = input_ids[:, 1:]
50 | assert softmax_logprobs.shape[1] == input_ids.shape[1]
51 |
52 | logprobs = torch.gather(
53 | softmax_logprobs, # Gather likelihoods...
54 | 2, # along the vocab dimension...
55 | input_ids.unsqueeze(-1) # using the token ids to index.
56 | ).squeeze(-1)
57 |
58 | return logprobs
59 |
60 |
61 | def _score_sequences(
62 | seqs: List[str],
63 | model: StripedHyena,
64 | tokenizer: object,
65 | prepend_bos: bool = False,
66 | reduce_method: str = 'mean',
67 | device: str = 'cuda:0',
68 | ) -> List[float]:
69 | """Helper function to score a list of sequences based on their logprobs."""
70 | input_ids, seq_lengths = prepare_batch(seqs, tokenizer, device=device, prepend_bos=prepend_bos)
71 | assert len(seq_lengths) == input_ids.shape[0]
72 |
73 | with torch.inference_mode():
74 | logits, _ = model(input_ids) # (batch, length, vocab)
75 |
76 | logprobs = logits_to_logprobs(logits, input_ids)
77 | logprobs = logprobs.float().cpu().numpy()
78 |
79 | if reduce_method == 'sum': # PLL
80 | reduce_func = np.sum
81 | elif reduce_method == 'mean': # mean PLL
82 | reduce_func = np.mean
83 | else:
84 | raise ValueError(f'Invalid reduce_method {reduce_method}')
85 |
86 | return [
87 | reduce_func(logprobs[idx][:seq_lengths[idx]])
88 | for idx in range(len(seq_lengths))
89 | ]
90 |
91 |
92 | def score_sequences(
93 | seqs: List[str],
94 | model: StripedHyena,
95 | tokenizer: object,
96 | batch_size: int = None,
97 | prepend_bos: bool = False,
98 | reduce_method: str = 'mean',
99 | device: str = 'cuda:0',
100 | ) -> List[float]:
101 | """
102 | Computes the model log-likelihood scores for sequences in `seqs`.
103 | Uses `reduce_method` to take the mean or sum across the likelihoods at each
104 | position (default: `'mean'`).
105 |
106 | Returns a list of scalar scores corresponding to the reduced log-likelihoods for
107 | each sequence.
108 | """
109 | if batch_size is None:
110 | batch_size = len(seqs)
111 |
112 | scores = []
113 | for i in tqdm(range(0, len(seqs), batch_size)):
114 | batch_seqs = seqs[i:i + batch_size]
115 | batch_scores = _score_sequences(
116 | batch_seqs,
117 | model,
118 | tokenizer,
119 | prepend_bos=prepend_bos,
120 | reduce_method=reduce_method,
121 | device=device,
122 | )
123 | scores.extend(batch_scores)
124 | return scores
125 |
126 |
127 | def score_sequences_rc(
128 | seqs: List[str],
129 | model: StripedHyena,
130 | tokenizer: object,
131 | batch_size: int,
132 | prepend_bos: bool = False,
133 | reduce_method: str = 'mean',
134 | device: str = 'cuda:0',
135 | ) -> List[float]:
136 | """
137 | Computes the model log-likelihood scores for sequences in `seqs` and for their
138 | reverse complements.
139 | Takes the mean score for the forward and reverse-complemented sequence.
140 | Uses `reduce_method` to take the mean or sum across the likelihoods at each
141 | position (default: `'mean'`).
142 |
143 | Returns a list of scalar scores corresponding to the reduced log-likelihoods for
144 | each sequence.
145 | """
146 | scores = []
147 | for i in tqdm(range(0, len(seqs), batch_size)):
148 | batch_seqs = seqs[i:i + batch_size]
149 | batch_seqs_rc = [ str(Seq(seq).reverse_complement()) for seq in batch_seqs ]
150 |
151 | batch_scores = _score_sequences(
152 | batch_seqs,
153 | model,
154 | tokenizer,
155 | prepend_bos=prepend_bos,
156 | reduce_method=reduce_method,
157 | device=device,
158 | )
159 | batch_scores_rc = _score_sequences(
160 | batch_seqs_rc,
161 | model,
162 | tokenizer,
163 | prepend_bos=prepend_bos,
164 | reduce_method=reduce_method,
165 | device=device,
166 | )
167 | batch_scores = (np.array(batch_scores) + np.array(batch_scores_rc)) * 0.5
168 |
169 | scores.extend(list(batch_scores))
170 | return scores
171 |
172 |
173 | def positional_entropies(
174 | seqs: List[str],
175 | model: StripedHyena,
176 | tokenizer: object,
177 | prepend_bos: bool = False,
178 | device: str = 'cuda:0',
179 | ) -> List[np.array]:
180 | """
181 | Computes the positional entropies for sequences in `seqs`.
182 |
183 | Returns a list of arrays, where each array is the same length as the
184 | corresponding sequence length. Each array contains the per-position entropy
185 | across the vocab dimension.
186 | """
187 | input_ids, seq_lengths = prepare_batch(seqs, tokenizer, device=device, prepend_bos=prepend_bos)
188 | assert len(seq_lengths) == input_ids.shape[0]
189 |
190 | with torch.inference_mode():
191 | logits, _ = model(input_ids) # (batch, length, vocab)
192 |
193 | softmax_logprobs = torch.log_softmax(logits, dim=-1)
194 | if prepend_bos:
195 | softmax_logprobs = softmax_logprobs[:, 1:, :] # Remove BOS entropy.
196 |
197 | entropies = -torch.sum(torch.exp(softmax_logprobs) * softmax_logprobs, dim=-1)
198 | entropies = entropies.float().cpu().numpy()
199 |
200 | sequence_entropies = [
201 | entropies[idx][:seq_lengths[idx]] for idx in range(len(seq_lengths))
202 | ]
203 | assert all(
204 | len(seq) == len(entropy) for seq, entropy in zip(seqs, sequence_entropies)
205 | )
206 |
207 | return sequence_entropies
208 |
209 |
210 | def score_perplexity_along_sequence(
211 | model: StripedHyena,
212 | seq: str,
213 | reverse_complement: bool = True,
214 | entropy: bool = False
215 | ) -> np.array:
216 | '''
217 | Get forward and reverse RC of dna sequence, pass both through model, and return average entropy or perplexity.
218 | '''
219 | seq_rc = str(Seq(seq).reverse_complement())
220 |
221 | entropy_forward = positional_entropies([seq], model.model, model.tokenizer)[0]
222 |
223 | if reverse_complement:
224 | entropy_reverse = positional_entropies([seq_rc], model.model, model.tokenizer)[0]
225 | entropy_reverse = entropy_reverse[::-1]
226 |
227 | average_entropy = (entropy_forward + entropy_reverse) / 2
228 | else:
229 | average_entropy = entropy_forward
230 |
231 | if entropy:
232 | return average_entropy
233 | else:
234 | return np.exp(average_entropy)
--------------------------------------------------------------------------------
/evo2/utils.py:
--------------------------------------------------------------------------------
1 | MODEL_NAMES = [
2 | 'evo2_40b',
3 | 'evo2_7b',
4 | 'evo2_40b_base',
5 | 'evo2_7b_base',
6 | 'evo2_1b_base',
7 | ]
8 |
9 | HF_MODEL_NAME_MAP = {
10 | 'evo2_40b': 'arcinstitute/evo2_40b',
11 | 'evo2_7b': 'arcinstitute/evo2_7b',
12 | 'evo2_40b_base': 'arcinstitute/evo2_40b_base',
13 | 'evo2_7b_base': 'arcinstitute/evo2_7b_base',
14 | 'evo2_1b_base': 'arcinstitute/evo2_1b_base',
15 | }
16 |
17 | CONFIG_MAP = {
18 | 'evo2_7b': 'configs/evo2-7b-1m.yml',
19 | 'evo2_40b': 'configs/evo2-40b-1m.yml',
20 | 'evo2_7b_base': 'configs/evo2-7b-8k.yml',
21 | 'evo2_40b_base': 'configs/evo2-40b-8k.yml',
22 | 'evo2_1b_base': 'configs/evo2-1b-8k.yml',
23 | }
24 |
25 |
26 | def make_phylotag_from_gbif(
27 | species_name: str,
28 | ) -> dict:
29 | """
30 | Returns phylogenetic tags for a given species, to get new tags not in the metadata
31 | """
32 |
33 | import requests
34 | def get_taxonomy_from_gbif(species_name):
35 | url = f"https://api.gbif.org/v1/species/match?name={species_name}"
36 | response = requests.get(url)
37 | if response.status_code == 200:
38 | data = response.json()
39 | return {
40 | "kingdom": data.get("kingdom"),
41 | "phylum": data.get("phylum"),
42 | "class": data.get("class"),
43 | "order": data.get("order"),
44 | "family": data.get("family"),
45 | "genus": data.get("genus"),
46 | "species": data.get("species")
47 | }
48 | else:
49 | print(f"Could not find taxonomy for {species_name}")
50 |
51 | taxonomy = get_taxonomy_from_gbif(species_name)
52 | if taxonomy:
53 | phylo_tag = (
54 | f'd__{taxonomy["kingdom"]};'
55 | f'p__{taxonomy["phylum"]};'
56 | f'c__{taxonomy["class"]};'
57 | f'o__{taxonomy["order"]};'
58 | f'f__{taxonomy["family"]};'
59 | f'g__{taxonomy["genus"]};'
60 | f's__{taxonomy["species"]}'
61 | ).upper()
62 | phylo_tag = '|'+phylo_tag+'|'
63 | else:
64 | print(f"Could not find taxonomy for {species_name}")
65 |
66 | return phylo_tag.upper()
67 |
68 |
--------------------------------------------------------------------------------
/evo2/version.py:
--------------------------------------------------------------------------------
1 | version = '0.1.0'
2 |
--------------------------------------------------------------------------------
/notebooks/brca1/41586_2018_461_MOESM3_ESM.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArcInstitute/evo2/a796302818055b9710a6a2c4d7882a6243363fdd/notebooks/brca1/41586_2018_461_MOESM3_ESM.xlsx
--------------------------------------------------------------------------------
/notebooks/brca1/GRCh37.p13_chr17.fna.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArcInstitute/evo2/a796302818055b9710a6a2c4d7882a6243363fdd/notebooks/brca1/GRCh37.p13_chr17.fna.gz
--------------------------------------------------------------------------------
/notebooks/brca1/brca1_zero_shot_vep.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "id": "17440de8",
6 | "metadata": {},
7 | "source": [
8 | "## Zero-shot prediction of *BRCA1* variant effects with Evo 2\n",
9 | "\n",
10 | "The human *BRCA1* gene encodes for a protein that repairs damaged DNA ([Moynahan et al., 1999](https://www.cell.com/molecular-cell/fulltext/S1097-2765%2800%2980202-6)). Certain variants of this gene have been associated with an increased risk of breast and ovarian cancers ([Miki et al., 1994](https://www.science.org/doi/10.1126/science.7545954?url_ver=Z39.88-2003&rfr_id=ori:rid:crossref.org&rfr_dat=cr_pub%20%200pubmed)). Using Evo 2, we can predict whether a particular single nucleotide variant (SNV) of the *BRCA1* gene is likely to be harmful to the protein's function, and thus potentially increase the risk of cancer for the patient with the genetic variant.\n",
11 | "\n",
12 | "We start by loading a dataset from [Findlay et al. (2018)](https://www.nature.com/articles/s41586-018-0461-z), which contains experimentally measured function scores of 3,893 *BRCA1* SNVs. These function scores reflect the extent by which the genetic variant has disrupted the protein's function, with lower scores indicating greater disruption. In this dataset, the SNVs are classified into three categories based on their function scores: `LOF` (loss-of-function), `INT` (intermediate), and `FUNC` (functional). We start by reading in this dataset."
13 | ]
14 | },
15 | {
16 | "cell_type": "code",
17 | "execution_count": 1,
18 | "id": "f090aadb",
19 | "metadata": {},
20 | "outputs": [
21 | {
22 | "name": "stdout",
23 | "output_type": "stream",
24 | "text": [
25 | "/bin/bash: /home/ggsun/miniconda/envs/evo2-release/lib/libtinfo.so.6: no version information available (required by /bin/bash)\n",
26 | "Requirement already satisfied: matplotlib in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (3.10.0)\n",
27 | "Requirement already satisfied: pandas in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (2.2.3)\n",
28 | "Requirement already satisfied: seaborn in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (0.13.2)\n",
29 | "Requirement already satisfied: scikit-learn in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (1.6.1)\n",
30 | "Requirement already satisfied: openpyxl in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (3.1.5)\n",
31 | "Requirement already satisfied: contourpy>=1.0.1 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (1.3.1)\n",
32 | "Requirement already satisfied: cycler>=0.10 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (0.12.1)\n",
33 | "Requirement already satisfied: fonttools>=4.22.0 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (4.56.0)\n",
34 | "Requirement already satisfied: kiwisolver>=1.3.1 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (1.4.8)\n",
35 | "Requirement already satisfied: numpy>=1.23 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (2.2.3)\n",
36 | "Requirement already satisfied: packaging>=20.0 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (24.2)\n",
37 | "Requirement already satisfied: pillow>=8 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (11.1.0)\n",
38 | "Requirement already satisfied: pyparsing>=2.3.1 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (3.2.1)\n",
39 | "Requirement already satisfied: python-dateutil>=2.7 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from matplotlib) (2.9.0.post0)\n",
40 | "Requirement already satisfied: pytz>=2020.1 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from pandas) (2025.1)\n",
41 | "Requirement already satisfied: tzdata>=2022.7 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from pandas) (2025.1)\n",
42 | "Requirement already satisfied: scipy>=1.6.0 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from scikit-learn) (1.15.2)\n",
43 | "Requirement already satisfied: joblib>=1.2.0 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from scikit-learn) (1.4.2)\n",
44 | "Requirement already satisfied: threadpoolctl>=3.1.0 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from scikit-learn) (3.5.0)\n",
45 | "Requirement already satisfied: et-xmlfile in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from openpyxl) (2.0.0)\n",
46 | "Requirement already satisfied: six>=1.5 in /home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)\n"
47 | ]
48 | }
49 | ],
50 | "source": [
51 | "# Install dependencies\n",
52 | "!pip install matplotlib pandas seaborn scikit-learn openpyxl\n",
53 | "\n",
54 | "# Required imports\n",
55 | "from Bio import SeqIO\n",
56 | "import gzip\n",
57 | "import matplotlib.pyplot as plt\n",
58 | "import numpy as np\n",
59 | "import pandas as pd\n",
60 | "import os\n",
61 | "import seaborn as sns\n",
62 | "from sklearn.metrics import roc_auc_score\n",
63 | "\n",
64 | "# Set root path\n",
65 | "os.chdir('../..')"
66 | ]
67 | },
68 | {
69 | "cell_type": "code",
70 | "execution_count": 2,
71 | "id": "1e26f1bf",
72 | "metadata": {},
73 | "outputs": [
74 | {
75 | "data": {
76 | "text/html": [
77 | "
\n",
78 | "\n",
91 | "
\n",
92 | " \n",
93 | "
\n",
94 | "
\n",
95 | "
chromosome
\n",
96 | "
position (hg19)
\n",
97 | "
reference
\n",
98 | "
alt
\n",
99 | "
function.score.mean
\n",
100 | "
func.class
\n",
101 | "
\n",
102 | " \n",
103 | " \n",
104 | "
\n",
105 | "
0
\n",
106 | "
17
\n",
107 | "
41276135
\n",
108 | "
T
\n",
109 | "
G
\n",
110 | "
-0.372611
\n",
111 | "
FUNC
\n",
112 | "
\n",
113 | "
\n",
114 | "
1
\n",
115 | "
17
\n",
116 | "
41276135
\n",
117 | "
T
\n",
118 | "
C
\n",
119 | "
-0.045313
\n",
120 | "
FUNC
\n",
121 | "
\n",
122 | "
\n",
123 | "
2
\n",
124 | "
17
\n",
125 | "
41276135
\n",
126 | "
T
\n",
127 | "
A
\n",
128 | "
-0.108254
\n",
129 | "
FUNC
\n",
130 | "
\n",
131 | "
\n",
132 | "
3
\n",
133 | "
17
\n",
134 | "
41276134
\n",
135 | "
T
\n",
136 | "
G
\n",
137 | "
-0.277963
\n",
138 | "
FUNC
\n",
139 | "
\n",
140 | "
\n",
141 | "
4
\n",
142 | "
17
\n",
143 | "
41276134
\n",
144 | "
T
\n",
145 | "
C
\n",
146 | "
-0.388414
\n",
147 | "
FUNC
\n",
148 | "
\n",
149 | "
\n",
150 | "
5
\n",
151 | "
17
\n",
152 | "
41276134
\n",
153 | "
T
\n",
154 | "
A
\n",
155 | "
-0.280973
\n",
156 | "
FUNC
\n",
157 | "
\n",
158 | "
\n",
159 | "
6
\n",
160 | "
17
\n",
161 | "
41276133
\n",
162 | "
C
\n",
163 | "
T
\n",
164 | "
-0.973683
\n",
165 | "
INT
\n",
166 | "
\n",
167 | "
\n",
168 | "
7
\n",
169 | "
17
\n",
170 | "
41276133
\n",
171 | "
C
\n",
172 | "
G
\n",
173 | "
-0.373489
\n",
174 | "
FUNC
\n",
175 | "
\n",
176 | "
\n",
177 | "
8
\n",
178 | "
17
\n",
179 | "
41276133
\n",
180 | "
C
\n",
181 | "
A
\n",
182 | "
0.006314
\n",
183 | "
FUNC
\n",
184 | "
\n",
185 | "
\n",
186 | "
9
\n",
187 | "
17
\n",
188 | "
41276132
\n",
189 | "
A
\n",
190 | "
T
\n",
191 | "
-0.207552
\n",
192 | "
FUNC
\n",
193 | "
\n",
194 | " \n",
195 | "
\n",
196 | "
"
197 | ],
198 | "text/plain": [
199 | " chromosome position (hg19) reference alt function.score.mean func.class\n",
200 | "0 17 41276135 T G -0.372611 FUNC\n",
201 | "1 17 41276135 T C -0.045313 FUNC\n",
202 | "2 17 41276135 T A -0.108254 FUNC\n",
203 | "3 17 41276134 T G -0.277963 FUNC\n",
204 | "4 17 41276134 T C -0.388414 FUNC\n",
205 | "5 17 41276134 T A -0.280973 FUNC\n",
206 | "6 17 41276133 C T -0.973683 INT\n",
207 | "7 17 41276133 C G -0.373489 FUNC\n",
208 | "8 17 41276133 C A 0.006314 FUNC\n",
209 | "9 17 41276132 A T -0.207552 FUNC"
210 | ]
211 | },
212 | "execution_count": 2,
213 | "metadata": {},
214 | "output_type": "execute_result"
215 | }
216 | ],
217 | "source": [
218 | "brca1_df = pd.read_excel(\n",
219 | " os.path.join('notebooks', 'brca1', '41586_2018_461_MOESM3_ESM.xlsx'),\n",
220 | " header=2,\n",
221 | ")\n",
222 | "brca1_df = brca1_df[[\n",
223 | " 'chromosome', 'position (hg19)', 'reference', 'alt', 'function.score.mean', 'func.class',\n",
224 | "]]\n",
225 | "\n",
226 | "brca1_df.head(10)"
227 | ]
228 | },
229 | {
230 | "cell_type": "markdown",
231 | "id": "13e0c7d5",
232 | "metadata": {},
233 | "source": [
234 | "We then group the `FUNC` and `INT` classes of SNVs together into a single category (`FUNC/INT`)."
235 | ]
236 | },
237 | {
238 | "cell_type": "code",
239 | "execution_count": 3,
240 | "id": "ce7df7cc",
241 | "metadata": {},
242 | "outputs": [
243 | {
244 | "data": {
245 | "text/html": [
246 | "
\n",
247 | "\n",
260 | "
\n",
261 | " \n",
262 | "
\n",
263 | "
\n",
264 | "
chrom
\n",
265 | "
pos
\n",
266 | "
ref
\n",
267 | "
alt
\n",
268 | "
score
\n",
269 | "
class
\n",
270 | "
\n",
271 | " \n",
272 | " \n",
273 | "
\n",
274 | "
0
\n",
275 | "
17
\n",
276 | "
41276135
\n",
277 | "
T
\n",
278 | "
G
\n",
279 | "
-0.372611
\n",
280 | "
FUNC/INT
\n",
281 | "
\n",
282 | "
\n",
283 | "
1
\n",
284 | "
17
\n",
285 | "
41276135
\n",
286 | "
T
\n",
287 | "
C
\n",
288 | "
-0.045313
\n",
289 | "
FUNC/INT
\n",
290 | "
\n",
291 | "
\n",
292 | "
2
\n",
293 | "
17
\n",
294 | "
41276135
\n",
295 | "
T
\n",
296 | "
A
\n",
297 | "
-0.108254
\n",
298 | "
FUNC/INT
\n",
299 | "
\n",
300 | "
\n",
301 | "
3
\n",
302 | "
17
\n",
303 | "
41276134
\n",
304 | "
T
\n",
305 | "
G
\n",
306 | "
-0.277963
\n",
307 | "
FUNC/INT
\n",
308 | "
\n",
309 | "
\n",
310 | "
4
\n",
311 | "
17
\n",
312 | "
41276134
\n",
313 | "
T
\n",
314 | "
C
\n",
315 | "
-0.388414
\n",
316 | "
FUNC/INT
\n",
317 | "
\n",
318 | "
\n",
319 | "
5
\n",
320 | "
17
\n",
321 | "
41276134
\n",
322 | "
T
\n",
323 | "
A
\n",
324 | "
-0.280973
\n",
325 | "
FUNC/INT
\n",
326 | "
\n",
327 | "
\n",
328 | "
6
\n",
329 | "
17
\n",
330 | "
41276133
\n",
331 | "
C
\n",
332 | "
T
\n",
333 | "
-0.973683
\n",
334 | "
FUNC/INT
\n",
335 | "
\n",
336 | "
\n",
337 | "
7
\n",
338 | "
17
\n",
339 | "
41276133
\n",
340 | "
C
\n",
341 | "
G
\n",
342 | "
-0.373489
\n",
343 | "
FUNC/INT
\n",
344 | "
\n",
345 | "
\n",
346 | "
8
\n",
347 | "
17
\n",
348 | "
41276133
\n",
349 | "
C
\n",
350 | "
A
\n",
351 | "
0.006314
\n",
352 | "
FUNC/INT
\n",
353 | "
\n",
354 | "
\n",
355 | "
9
\n",
356 | "
17
\n",
357 | "
41276132
\n",
358 | "
A
\n",
359 | "
T
\n",
360 | "
-0.207552
\n",
361 | "
FUNC/INT
\n",
362 | "
\n",
363 | " \n",
364 | "
\n",
365 | "
"
366 | ],
367 | "text/plain": [
368 | " chrom pos ref alt score class\n",
369 | "0 17 41276135 T G -0.372611 FUNC/INT\n",
370 | "1 17 41276135 T C -0.045313 FUNC/INT\n",
371 | "2 17 41276135 T A -0.108254 FUNC/INT\n",
372 | "3 17 41276134 T G -0.277963 FUNC/INT\n",
373 | "4 17 41276134 T C -0.388414 FUNC/INT\n",
374 | "5 17 41276134 T A -0.280973 FUNC/INT\n",
375 | "6 17 41276133 C T -0.973683 FUNC/INT\n",
376 | "7 17 41276133 C G -0.373489 FUNC/INT\n",
377 | "8 17 41276133 C A 0.006314 FUNC/INT\n",
378 | "9 17 41276132 A T -0.207552 FUNC/INT"
379 | ]
380 | },
381 | "execution_count": 3,
382 | "metadata": {},
383 | "output_type": "execute_result"
384 | }
385 | ],
386 | "source": [
387 | "# Rename columns\n",
388 | "brca1_df.rename(columns={\n",
389 | " 'chromosome': 'chrom',\n",
390 | " 'position (hg19)': 'pos',\n",
391 | " 'reference': 'ref',\n",
392 | " 'alt': 'alt',\n",
393 | " 'function.score.mean': 'score',\n",
394 | " 'func.class': 'class',\n",
395 | "}, inplace=True)\n",
396 | "\n",
397 | "# Convert to two-class system\n",
398 | "brca1_df['class'] = brca1_df['class'].replace(['FUNC', 'INT'], 'FUNC/INT')\n",
399 | "\n",
400 | "brca1_df.head(10)"
401 | ]
402 | },
403 | {
404 | "cell_type": "markdown",
405 | "id": "8ef6f10c",
406 | "metadata": {},
407 | "source": [
408 | "We build a function to parse the reference and variant sequences of a 8,192-bp window around the genomic position of each SNV, using the reference sequence of human chromosome 17 where *BRCA1* is located."
409 | ]
410 | },
411 | {
412 | "cell_type": "code",
413 | "execution_count": 4,
414 | "id": "4be1bb8e",
415 | "metadata": {
416 | "lines_to_next_cell": 2,
417 | "scrolled": true
418 | },
419 | "outputs": [
420 | {
421 | "name": "stdout",
422 | "output_type": "stream",
423 | "text": [
424 | "chrom 17\n",
425 | "pos 41276135\n",
426 | "ref T\n",
427 | "alt G\n",
428 | "score -0.372611\n",
429 | "class FUNC/INT\n",
430 | "Name: 0, dtype: object\n",
431 | "--\n",
432 | "Reference, SNV 0: ...TGTTCCAATGAACTTTAACACATTAGAAAA...\n",
433 | "Variant, SNV 0: ...TGTTCCAATGAACTGTAACACATTAGAAAA...\n"
434 | ]
435 | }
436 | ],
437 | "source": [
438 | "WINDOW_SIZE = 8192\n",
439 | "\n",
440 | "# Read the reference genome sequence of chromosome 17\n",
441 | "with gzip.open(os.path.join('notebooks', 'brca1', 'GRCh37.p13_chr17.fna.gz'), \"rt\") as handle:\n",
442 | " for record in SeqIO.parse(handle, \"fasta\"):\n",
443 | " seq_chr17 = str(record.seq)\n",
444 | " break\n",
445 | "\n",
446 | "def parse_sequences(pos, ref, alt):\n",
447 | " \"\"\"\n",
448 | " Parse reference and variant sequences from the reference genome sequence.\n",
449 | " \"\"\"\n",
450 | " p = pos - 1 # Convert to 0-indexed position\n",
451 | " full_seq = seq_chr17\n",
452 | "\n",
453 | " ref_seq_start = max(0, p - WINDOW_SIZE//2)\n",
454 | " ref_seq_end = min(len(full_seq), p + WINDOW_SIZE//2)\n",
455 | " ref_seq = seq_chr17[ref_seq_start:ref_seq_end]\n",
456 | " snv_pos_in_ref = min(WINDOW_SIZE//2, p)\n",
457 | " var_seq = ref_seq[:snv_pos_in_ref] + alt + ref_seq[snv_pos_in_ref+1:]\n",
458 | "\n",
459 | " # Sanity checks\n",
460 | " assert len(var_seq) == len(ref_seq)\n",
461 | " assert ref_seq[snv_pos_in_ref] == ref\n",
462 | " assert var_seq[snv_pos_in_ref] == alt\n",
463 | "\n",
464 | " return ref_seq, var_seq\n",
465 | "\n",
466 | "# Parse sequences for the first variant\n",
467 | "row = brca1_df.iloc[0]\n",
468 | "ref_seq, var_seq = parse_sequences(row['pos'], row['ref'], row['alt'])\n",
469 | "\n",
470 | "print(row)\n",
471 | "print('--')\n",
472 | "print(f'Reference, SNV 0: ...{ref_seq[4082:4112]}...')\n",
473 | "print(f'Variant, SNV 0: ...{var_seq[4082:4112]}...')"
474 | ]
475 | },
476 | {
477 | "cell_type": "markdown",
478 | "id": "5acd3e9a-0b33-44c4-a95a-9be49ef61a76",
479 | "metadata": {},
480 | "source": [
481 | "Then, we load Evo 2 1B and score the likelihoods of the reference and variant sequences of each SNV. (Note: we use the smaller Evo 2 1B base model here as a quick demonstration, but we strongly recommend using the larger Evo 2 7B and 40B models for more accurate predictions.)"
482 | ]
483 | },
484 | {
485 | "cell_type": "code",
486 | "execution_count": 5,
487 | "id": "362d5a24",
488 | "metadata": {},
489 | "outputs": [
490 | {
491 | "name": "stdout",
492 | "output_type": "stream",
493 | "text": [
494 | "tokenizers not found, unable to use HFAutoTokenizer\n"
495 | ]
496 | },
497 | {
498 | "name": "stderr",
499 | "output_type": "stream",
500 | "text": [
501 | "100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 25/25 [00:00<00:00, 220.42it/s]\n"
502 | ]
503 | },
504 | {
505 | "name": "stdout",
506 | "output_type": "stream",
507 | "text": [
508 | "Extra keys in state_dict: {'blocks.3.mixer.dense._extra_state', 'blocks.24.mixer.dense._extra_state', 'unembed.weight', 'blocks.10.mixer.dense._extra_state', 'blocks.17.mixer.dense._extra_state'}\n"
509 | ]
510 | },
511 | {
512 | "name": "stderr",
513 | "output_type": "stream",
514 | "text": [
515 | "/home/ggsun/miniconda/envs/evo2-release/lib/python3.12/site-packages/transformer_engine/pytorch/module/base.py:630: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
516 | " state = torch.load(state, map_location=\"cuda\")\n"
517 | ]
518 | },
519 | {
520 | "name": "stdout",
521 | "output_type": "stream",
522 | "text": [
523 | "Loaded model evo2_1b_base from /home/ggsun/.cache/huggingface/hub/models--arcinstitute--evo2_1b_base/snapshots/6915b21845659a78b55e59a1eb603039fc81c49f/evo2_1b_base.pt!\n"
524 | ]
525 | },
526 | {
527 | "name": "stderr",
528 | "output_type": "stream",
529 | "text": [
530 | "/home/ggsun/evo2/vortex/vortex/model/utils.py:153: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
531 | " return torch_load(state, map_location=device)\n"
532 | ]
533 | }
534 | ],
535 | "source": [
536 | "from evo2.models import Evo2\n",
537 | "\n",
538 | "# Load model\n",
539 | "model = Evo2('evo2_1b_base')"
540 | ]
541 | },
542 | {
543 | "cell_type": "code",
544 | "execution_count": 6,
545 | "id": "135bffe8",
546 | "metadata": {},
547 | "outputs": [
548 | {
549 | "name": "stdout",
550 | "output_type": "stream",
551 | "text": [
552 | "Scoring likelihoods of 1326 reference sequences with Evo 2...\n"
553 | ]
554 | },
555 | {
556 | "name": "stderr",
557 | "output_type": "stream",
558 | "text": [
559 | "100%|███████████████████████████████████████████████████████████████████████████████████████████████| 1326/1326 [02:20<00:00, 9.45it/s]\n"
560 | ]
561 | },
562 | {
563 | "name": "stdout",
564 | "output_type": "stream",
565 | "text": [
566 | "Scoring likelihoods of 3893 variant sequences with Evo 2...\n"
567 | ]
568 | },
569 | {
570 | "name": "stderr",
571 | "output_type": "stream",
572 | "text": [
573 | "100%|███████████████████████████████████████████████████████████████████████████████████████████████| 3893/3893 [06:49<00:00, 9.51it/s]\n"
574 | ]
575 | }
576 | ],
577 | "source": [
578 | "# Build mappings of unique reference sequences\n",
579 | "ref_seqs = []\n",
580 | "ref_seq_to_index = {}\n",
581 | "\n",
582 | "# Parse sequences and store indexes\n",
583 | "ref_seq_indexes = []\n",
584 | "var_seqs = []\n",
585 | "\n",
586 | "for _, row in brca1_df.iterrows():\n",
587 | " ref_seq, var_seq = parse_sequences(row['pos'], row['ref'], row['alt'])\n",
588 | "\n",
589 | " # Get or create index for reference sequence\n",
590 | " if ref_seq not in ref_seq_to_index:\n",
591 | " ref_seq_to_index[ref_seq] = len(ref_seqs)\n",
592 | " ref_seqs.append(ref_seq)\n",
593 | " \n",
594 | " ref_seq_indexes.append(ref_seq_to_index[ref_seq])\n",
595 | " var_seqs.append(var_seq)\n",
596 | "\n",
597 | "ref_seq_indexes = np.array(ref_seq_indexes)\n",
598 | "\n",
599 | "print(f'Scoring likelihoods of {len(ref_seqs)} reference sequences with Evo 2...')\n",
600 | "ref_scores = model.score_sequences(ref_seqs)\n",
601 | "\n",
602 | "print(f'Scoring likelihoods of {len(var_seqs)} variant sequences with Evo 2...')\n",
603 | "var_scores = model.score_sequences(var_seqs)"
604 | ]
605 | },
606 | {
607 | "cell_type": "markdown",
608 | "id": "cbf2de1e-17b1-4f0d-9004-1eb917ed83ac",
609 | "metadata": {},
610 | "source": [
611 | "We calculate the change in likelihoods for each variant relative to the likelihood of their respective wild-type sequence."
612 | ]
613 | },
614 | {
615 | "cell_type": "code",
616 | "execution_count": 7,
617 | "id": "a49d5859-87ed-49c9-8e3d-18629f073022",
618 | "metadata": {
619 | "scrolled": true
620 | },
621 | "outputs": [
622 | {
623 | "data": {
624 | "text/html": [
625 | "
\n",
626 | "\n",
639 | "
\n",
640 | " \n",
641 | "
\n",
642 | "
\n",
643 | "
chrom
\n",
644 | "
pos
\n",
645 | "
ref
\n",
646 | "
alt
\n",
647 | "
score
\n",
648 | "
class
\n",
649 | "
evo2_delta_score
\n",
650 | "
\n",
651 | " \n",
652 | " \n",
653 | "
\n",
654 | "
0
\n",
655 | "
17
\n",
656 | "
41276135
\n",
657 | "
T
\n",
658 | "
G
\n",
659 | "
-0.372611
\n",
660 | "
FUNC/INT
\n",
661 | "
-0.000054
\n",
662 | "
\n",
663 | "
\n",
664 | "
1
\n",
665 | "
17
\n",
666 | "
41276135
\n",
667 | "
T
\n",
668 | "
C
\n",
669 | "
-0.045313
\n",
670 | "
FUNC/INT
\n",
671 | "
0.000140
\n",
672 | "
\n",
673 | "
\n",
674 | "
2
\n",
675 | "
17
\n",
676 | "
41276135
\n",
677 | "
T
\n",
678 | "
A
\n",
679 | "
-0.108254
\n",
680 | "
FUNC/INT
\n",
681 | "
0.000074
\n",
682 | "
\n",
683 | "
\n",
684 | "
3
\n",
685 | "
17
\n",
686 | "
41276134
\n",
687 | "
T
\n",
688 | "
G
\n",
689 | "
-0.277963
\n",
690 | "
FUNC/INT
\n",
691 | "
-0.000146
\n",
692 | "
\n",
693 | "
\n",
694 | "
4
\n",
695 | "
17
\n",
696 | "
41276134
\n",
697 | "
T
\n",
698 | "
C
\n",
699 | "
-0.388414
\n",
700 | "
FUNC/INT
\n",
701 | "
-0.000104
\n",
702 | "
\n",
703 | "
\n",
704 | "
5
\n",
705 | "
17
\n",
706 | "
41276134
\n",
707 | "
T
\n",
708 | "
A
\n",
709 | "
-0.280973
\n",
710 | "
FUNC/INT
\n",
711 | "
0.000084
\n",
712 | "
\n",
713 | "
\n",
714 | "
6
\n",
715 | "
17
\n",
716 | "
41276133
\n",
717 | "
C
\n",
718 | "
T
\n",
719 | "
-0.973683
\n",
720 | "
FUNC/INT
\n",
721 | "
0.000299
\n",
722 | "
\n",
723 | "
\n",
724 | "
7
\n",
725 | "
17
\n",
726 | "
41276133
\n",
727 | "
C
\n",
728 | "
G
\n",
729 | "
-0.373489
\n",
730 | "
FUNC/INT
\n",
731 | "
0.000077
\n",
732 | "
\n",
733 | "
\n",
734 | "
8
\n",
735 | "
17
\n",
736 | "
41276133
\n",
737 | "
C
\n",
738 | "
A
\n",
739 | "
0.006314
\n",
740 | "
FUNC/INT
\n",
741 | "
0.000352
\n",
742 | "
\n",
743 | "
\n",
744 | "
9
\n",
745 | "
17
\n",
746 | "
41276132
\n",
747 | "
A
\n",
748 | "
T
\n",
749 | "
-0.207552
\n",
750 | "
FUNC/INT
\n",
751 | "
-0.000300
\n",
752 | "
\n",
753 | " \n",
754 | "
\n",
755 | "
"
756 | ],
757 | "text/plain": [
758 | " chrom pos ref alt score class evo2_delta_score\n",
759 | "0 17 41276135 T G -0.372611 FUNC/INT -0.000054\n",
760 | "1 17 41276135 T C -0.045313 FUNC/INT 0.000140\n",
761 | "2 17 41276135 T A -0.108254 FUNC/INT 0.000074\n",
762 | "3 17 41276134 T G -0.277963 FUNC/INT -0.000146\n",
763 | "4 17 41276134 T C -0.388414 FUNC/INT -0.000104\n",
764 | "5 17 41276134 T A -0.280973 FUNC/INT 0.000084\n",
765 | "6 17 41276133 C T -0.973683 FUNC/INT 0.000299\n",
766 | "7 17 41276133 C G -0.373489 FUNC/INT 0.000077\n",
767 | "8 17 41276133 C A 0.006314 FUNC/INT 0.000352\n",
768 | "9 17 41276132 A T -0.207552 FUNC/INT -0.000300"
769 | ]
770 | },
771 | "execution_count": 7,
772 | "metadata": {},
773 | "output_type": "execute_result"
774 | }
775 | ],
776 | "source": [
777 | "# Subtract score of corresponding reference sequences from scores of variant sequences\n",
778 | "delta_scores = np.array(var_scores) - np.array(ref_scores)[ref_seq_indexes]\n",
779 | "\n",
780 | "# Add delta scores to dataframe\n",
781 | "brca1_df[f'evo2_delta_score'] = delta_scores\n",
782 | "\n",
783 | "brca1_df.head(10)"
784 | ]
785 | },
786 | {
787 | "cell_type": "markdown",
788 | "id": "20aea762-ef7f-4687-88ca-56d9042e7a0d",
789 | "metadata": {},
790 | "source": [
791 | "This delta likelihood should be predictive of how disruptive the SNV is to the protein's function: the lower the delta, the more likely that the SNV is disruptive. We can show this by comparing the distributions of delta likelihoods for the two classes of SNVs (functional/intermediate vs loss-of-function)."
792 | ]
793 | },
794 | {
795 | "cell_type": "code",
796 | "execution_count": 8,
797 | "id": "0c27729e-927e-42ec-b311-1e3d901eb29e",
798 | "metadata": {},
799 | "outputs": [
800 | {
801 | "data": {
802 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAC+CAYAAADeHMOvAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAfcdJREFUeJztnWd0VEUbgJ/tKZveAyGE0HvvKggoRaQoSBNQOgoqCoJ8CmIBK1hQUBEE6UiXJlWk9xJ6CKT3spu29X4/Nrlm00ggCOJ9zsmBvWXuzM1m3pm3ygRBEJCQkJCQkCiA/EF3QEJCQkLi4UMSDhISEhISRZCEg4SEhIREESThICEhISFRBEk4SEhISEgUQRIOEhISEhJFkISDhISEhEQRJOEgISEhIVEE5YPugETpWK1WYmNjcXFxQSaTPejuSEhIPOQIgoBerycwMBC5/O7X/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D8Shwxz9IiY6wAAAABJRU5ErkJggg==",
803 | "text/plain": [
804 | ""
805 | ]
806 | },
807 | "metadata": {},
808 | "output_type": "display_data"
809 | }
810 | ],
811 | "source": [
812 | "plt.figure(figsize=(4, 2))\n",
813 | "\n",
814 | "# Plot stripplot of distributions\n",
815 | "p = sns.stripplot(\n",
816 | " data=brca1_df,\n",
817 | " x='evo2_delta_score',\n",
818 | " y='class',\n",
819 | " hue='class',\n",
820 | " order=['FUNC/INT', 'LOF'],\n",
821 | " palette=['#777777', 'C3'],\n",
822 | " size=2,\n",
823 | " jitter=0.3,\n",
824 | ")\n",
825 | "\n",
826 | "# Mark medians from each distribution\n",
827 | "sns.boxplot(showmeans=True,\n",
828 | " meanline=True,\n",
829 | " meanprops={'visible': False},\n",
830 | " medianprops={'color': 'k', 'ls': '-', 'lw': 2},\n",
831 | " whiskerprops={'visible': False},\n",
832 | " zorder=10,\n",
833 | " x=\"evo2_delta_score\",\n",
834 | " y=\"class\",\n",
835 | " data=brca1_df,\n",
836 | " showfliers=False,\n",
837 | " showbox=False,\n",
838 | " showcaps=False,\n",
839 | " ax=p)\n",
840 | "plt.xlabel('Delta likelihood score, Evo 2')\n",
841 | "plt.ylabel('BRCA1 SNV class')\n",
842 | "plt.tight_layout()\n",
843 | "plt.show()"
844 | ]
845 | },
846 | {
847 | "cell_type": "markdown",
848 | "id": "f3974e39-6c50-4503-9bab-829b1ac1b14a",
849 | "metadata": {},
850 | "source": [
851 | "We can also calculate the area under the receiver operating characteristic curve (AUROC) of this zero-shot prediction method."
852 | ]
853 | },
854 | {
855 | "cell_type": "code",
856 | "execution_count": 9,
857 | "id": "f9e6cc5e-9c98-4010-8210-b38f570e1290",
858 | "metadata": {},
859 | "outputs": [
860 | {
861 | "name": "stdout",
862 | "output_type": "stream",
863 | "text": [
864 | "Zero-shot prediction AUROC: 0.73\n"
865 | ]
866 | }
867 | ],
868 | "source": [
869 | "# Calculate AUROC of zero-shot predictions\n",
870 | "y_true = (brca1_df['class'] == 'LOF')\n",
871 | "auroc = roc_auc_score(y_true, -brca1_df['evo2_delta_score'])\n",
872 | "\n",
873 | "print(f'Zero-shot prediction AUROC: {auroc:.2}')"
874 | ]
875 | }
876 | ],
877 | "metadata": {
878 | "jupytext": {
879 | "cell_metadata_filter": "-all",
880 | "main_language": "python",
881 | "notebook_metadata_filter": "-all"
882 | },
883 | "kernelspec": {
884 | "display_name": "evo2-release",
885 | "language": "python",
886 | "name": "evo2-release"
887 | },
888 | "language_info": {
889 | "codemirror_mode": {
890 | "name": "ipython",
891 | "version": 3
892 | },
893 | "file_extension": ".py",
894 | "mimetype": "text/x-python",
895 | "name": "python",
896 | "nbconvert_exporter": "python",
897 | "pygments_lexer": "ipython3",
898 | "version": "3.12.9"
899 | }
900 | },
901 | "nbformat": 4,
902 | "nbformat_minor": 5
903 | }
904 |
--------------------------------------------------------------------------------
/notebooks/generation/generation_notebook.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Sequence Generation and Alignment Analysis with Evo2\n",
8 | "This notebook demonstrates how to generate biological sequences using the Evo2 model and analyze them using Biopython alignments.\n",
9 | "\n",
10 | "## Setup and Dependencies\n",
11 | "\n",
12 | "First, let's import our required libraries and set up our environment. Note you need Jupyter to run notebooks.\n"
13 | ]
14 | },
15 | {
16 | "cell_type": "code",
17 | "execution_count": 4,
18 | "metadata": {},
19 | "outputs": [],
20 | "source": [
21 | "import os\n",
22 | "import argparse\n",
23 | "import csv\n",
24 | "from pathlib import Path\n",
25 | "from typing import List, Optional, Tuple\n",
26 | "import numpy as np\n",
27 | "import torch\n",
28 | "import torch.nn.functional as F\n",
29 | "from Bio import pairwise2\n",
30 | "from Bio.pairwise2 import format_alignment\n",
31 | "from Bio.Seq import Seq\n",
32 | "\n",
33 | "from evo2 import Evo2\n",
34 | "\n",
35 | "# Set random seeds for reproducibility\n",
36 | "torch.manual_seed(42)\n",
37 | "torch.cuda.manual_seed(42)\n",
38 | "\n"
39 | ]
40 | },
41 | {
42 | "cell_type": "markdown",
43 | "metadata": {},
44 | "source": [
45 | "## Model Initialization\n",
46 | "Let's initialize our Evo2 model. We'll use the 7B parameter version as a default."
47 | ]
48 | },
49 | {
50 | "cell_type": "code",
51 | "execution_count": 5,
52 | "metadata": {},
53 | "outputs": [
54 | {
55 | "name": "stderr",
56 | "output_type": "stream",
57 | "text": [
58 | "Fetching 4 files: 100%|██████████| 4/4 [00:00<00:00, 32263.88it/s]"
59 | ]
60 | },
61 | {
62 | "name": "stderr",
63 | "output_type": "stream",
64 | "text": [
65 | "\n"
66 | ]
67 | },
68 | {
69 | "name": "stdout",
70 | "output_type": "stream",
71 | "text": [
72 | "Found complete file in repo: evo2_7b.pt\n"
73 | ]
74 | },
75 | {
76 | "name": "stderr",
77 | "output_type": "stream",
78 | "text": [
79 | "100%|██████████| 32/32 [00:00<00:00, 180.96it/s]\n"
80 | ]
81 | },
82 | {
83 | "name": "stdout",
84 | "output_type": "stream",
85 | "text": [
86 | "Extra keys in state_dict: {'blocks.2.mixer.mixer.filter.t', 'blocks.16.mixer.mixer.filter.t', 'blocks.20.mixer.mixer.filter.t', 'blocks.9.mixer.mixer.filter.t', 'blocks.27.mixer.mixer.filter.t', 'blocks.17.mixer.dense._extra_state', 'blocks.31.mixer.attn._extra_state', 'blocks.24.mixer.dense._extra_state', 'blocks.17.mixer.attn._extra_state', 'blocks.13.mixer.mixer.filter.t', 'blocks.10.mixer.attn._extra_state', 'blocks.10.mixer.dense._extra_state', 'blocks.30.mixer.mixer.filter.t', 'blocks.31.mixer.dense._extra_state', 'blocks.24.mixer.attn._extra_state', 'blocks.3.mixer.dense._extra_state', 'blocks.3.mixer.attn._extra_state', 'unembed.weight', 'blocks.6.mixer.mixer.filter.t', 'blocks.23.mixer.mixer.filter.t'}\n"
87 | ]
88 | },
89 | {
90 | "name": "stderr",
91 | "output_type": "stream",
92 | "text": [
93 | "/home/gbrixi/miniconda/envs/hf_tracking_test/lib/python3.11/site-packages/transformer_engine/pytorch/module/base.py:630: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
94 | " state = torch.load(state, map_location=\"cuda\")\n",
95 | "/home/gbrixi/evo2/vortex/vortex/model/utils.py:153: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
96 | " return torch_load(state, map_location=device)\n"
97 | ]
98 | }
99 | ],
100 | "source": [
101 | "model_name = 'evo2_7b'\n",
102 | "\n",
103 | "model = Evo2(model_name)"
104 | ]
105 | },
106 | {
107 | "cell_type": "markdown",
108 | "metadata": {},
109 | "source": [
110 | "## Data Loading\n",
111 | "Next we'll create functions to load our example sequences\n"
112 | ]
113 | },
114 | {
115 | "cell_type": "code",
116 | "execution_count": 23,
117 | "metadata": {},
118 | "outputs": [
119 | {
120 | "name": "stdout",
121 | "output_type": "stream",
122 | "text": [
123 | "Loaded 4 sequence pairs\n"
124 | ]
125 | }
126 | ],
127 | "source": [
128 | "def read_sequences(input_file: Path) -> Tuple[List[str], List[str]]:\n",
129 | " \"\"\"\n",
130 | " Read input and target sequences from CSV file.\n",
131 | " \n",
132 | " Expected CSV format:\n",
133 | " input_sequence,target_sequence\n",
134 | " ACGTACGT,ACGTACGTAA\n",
135 | " ...\n",
136 | " \"\"\"\n",
137 | " input_seqs: List[str] = []\n",
138 | " names: List[str] = []\n",
139 | " \n",
140 | " with open(input_file, encoding='utf-8-sig', newline='') as csvfile:\n",
141 | " reader = csv.reader(csvfile)\n",
142 | " next(reader) # Skip header\n",
143 | " for row in reader:\n",
144 | " input_seqs.append(row[0])\n",
145 | " if len(row) > 1:\n",
146 | " names.append(row[1])\n",
147 | " \n",
148 | " return input_seqs, names\n",
149 | "\n",
150 | "# Load example data\n",
151 | "\n",
152 | "sequences, names = read_sequences('../../vortex/test/data/prompts.csv')\n",
153 | "\n",
154 | "# For 'autocomplete', we split the data into input and target sequences\n",
155 | "\n",
156 | "input_seqs = [seq[:500] for seq in sequences]\n",
157 | "target_seqs = [seq[500:1000] for seq in sequences]\n",
158 | "\n",
159 | "print(f\"Loaded {len(sequences)} sequence pairs\")"
160 | ]
161 | },
162 | {
163 | "cell_type": "markdown",
164 | "metadata": {},
165 | "source": [
166 | "### Now it's time to generate!"
167 | ]
168 | },
169 | {
170 | "cell_type": "code",
171 | "execution_count": 24,
172 | "metadata": {},
173 | "outputs": [
174 | {
175 | "name": "stdout",
176 | "output_type": "stream",
177 | "text": [
178 | "Initializing inference params with max_seqlen=1000\n",
179 | "Prompt: \"GAATAGGAACAGCTCCGGTCTACAGCTCCCAGCGTGAGCGACGCAGAAGACGGTGATTTCTGCATTTCCATCTGAGGTACCGGGTTCATCTCACTAGGGAGTGCCAGACAGTGGGCGCAGGCCAGTGTGTGTGCGCACCGTGCGCGAGCCGAAGCAGGGCGAGGCATTGCCTCACCTGGGAAGCGCAAGGGGTCAGGGAGTTCCCTTTCCGAGTCAAAGAAAGGGGTGATGGACGCACCTGGAAAATCGGGTCACTCCCACCCGAATATTGCGCTTTTCAGACCGGCTTAAGAAACGGCGCACCACGAGACTATATCCCACACCTGGCTCAGAGGGTCCTACGCCCACGGAATCTCGCTGATTGCTAGCACAGCAGTCTGAGATCAAACTGCAAGGCGGCAACGAGGCTGGGGGAGGGGCGCCCGCCATTGCCCAGGCTTGCTTAGGTAAACAAAGCAGCCGGGAAGCTCGAACTGGGTGGAGCCCACCACAGCTCAAGG\",\tOutput: \"AGGCCTGCCTGCCTCTGTAGGCTCCACCTCCGGGGGAAGGGCACAGCCCAACAAAAGGCGGCAGACACCTCTGCAGACTTAAATGTCCCTGTCTGACAGCTTTGAAGAGAGCAGTGGTTCTCCTAGCACGCAGCTGGAGATCTGAGAACGGGCAGACTGCCTCCTCAAGTGGGTCCCTGACCCCTGACCCCCGAGCAGCCTAACTGGGAGGCACCCCCCAGCAGGGGCACACTGACACCTCACACGGCAGGGTATTCCAACAGACCTGCAGCTGAGGATCCTGTCTGCAAGACAGCTTAGGCCCTACAACAGTCTTGCAGCCACCTCTACTGATGTAGGAAAGCCTGCCTGCCTCTGTAGGCTCCACCTCTGGGAGCAGGGCATAGACAAACAAAAAGAGGCAGCAGCAGCCTCAGCAGACAGAAACCATACCGCCTGGCAGCTTTGAAGAGAGCAGTGGATCTCCCAACACGGAGGTTGAGATCTGAGAACGGACAGAC\",\tScore: -0.26270025968551636\n",
180 | "Prompt: \"GACACCATCGAATGGCGCAAAACCTTTCGCGGTATGGCATGATAGCGCCCGGAAGAGAGTCAATTCAGGGTGGTGAATGTGAAACCAGTAACGTTATACGATGTCGCAGAGTATGCCGGTGTCTCTTATCAGACCGTTTCCCGCGTGGTGAACCAGGCCAGCCACGTTTCTGCGAAAACGCGGGAAAAAGTGGAAGCGGCGATGGCGGAGCTGAATTACATTCCCAACCGCGTGGCACAACAACTGGCGGGCAAACAGTCGTTGCTGATTGGCGTTGCCACCTCCAGTCTGGCCCTGCACGCGCCGTCGCAAATTGTCGCGGCGATTAAATCTCGCGCCGATCAACTGGGTGCCAGCGTGGTGGTGTCGATGGTAGAACGAAGCGGCGTCGAAGCCTGTAAAGCGGCGGTGCACAATCTTCTCGCGCAACGCGTCAGTGGGCTGATCATTAACTATCCGCTGGATGACCAGGATGCCATTGCTGTGGAAGCTGCCTGCAC\",\tOutput: \"TAATGTTCCGGCGTTGTTTCTTGATGTCTCTGACCAGACTTCCGTTAACAGTATTATTTTCTCCCATGAAGACGGTACGCGACTGGGCGTGGAACATCTGATCGCATTAGGTCACCAGCAAATCGCGCTGTTAGCGGGGCCATTAAGTTCTGTCTCGGCGCGTCTGAGGCTGGCGGGCTGGCATAAATATCTCACTCGCAACCATATCCAGCCGATAGCGGTACGGGAAGGCGACTGGAGTGCCATGTCCGGTTATCAACAAACGATGGAAATGCTGAATAACGGCATCGTACCGTCGGCGATGCTGGTTGCCAACGATCAGATGGCGCTGGGCGCAATGCGCGCACTGGAAGAACATAAACTTTCGGTACCGGAAGATATCTCGGTGATTGGTTATGACGATACCGAAGACAGCTCGTGTTTTATTCCGCCGTTGACCACTATCAAGCAGGATTTTCGTCTGCTGGGGCAGACAGCTGTGGACCGCCTGCTGCAACTGA\",\tScore: -0.15721526741981506\n",
181 | "Prompt: \"GTTAATGTAGCTTAAAACAAAAGCAAGGTACTGAAAATACCTAGACGAGTATATCCAACTCCATAAACAACAAAGGTTTGGTCCCGGCCTTCTTATTGGTTACTAGGAAACTTATACATGCAAGTATCCGCCCGCCAGTGAATACGCCTTCTAAATCATCACTGATCAAAGAGAGCTGGCATCAAGCACACACCCCAAGTGTAGCTCATGACGTCTCGCCTAGCCACACCCCCACGGGAAACAGCAGTAGTAAATATTTAGCAATTAACAAAAGTTAGACTAAGTTATCCTAATAAAGGACTGGTCAATTTCGTGCCAGCAACCGCGGCCATACGATTAGTCCAAATTAATAAGCATACGGCGTAAAGCGTATTAGAAGAATTAAAAAAATAAAGTTAAATCTTATACTAGCTGTTTAAAGCTCAAGATAAGACATAAATAGCCTACGAAAGTGACTTTAATAATCCTAAACATACGATAGCTAGGGTACAAACTGAGAT\",\tOutput: \"TAGATACCTCACTATGCTTAGCCATAAACCTAGGCAGAGTATAACCAATCTGCCAGCCAGAGTACTACTAGCAATAGCTTAAAACTCAAAGGACTTGGCGGTGCTTTATATCCACCTAGAGGAGCCTGTTCTATAATCGATAAACCCCGATAAACCTTACCACTTTTTGCTAATACAGTCTATATACCGCCATCTTCAGCAAACCCTTAAAAGGAATCACAGTAAGCAAAAACTTAGCACATAGGAACGTTAGGTCAAGGTGTAACCTATAAAGTGGTAAGAAATGGGCTACATTTTTTTAATTAAAAACACATTCTATACTAAACCTATGAAAATATTAAGCCTAAGGTGGATTTAGTAGTAAATTAAGAATAGAGAGCTTAATTGAATGAGAAAATTGGGCGCACACAATGCCCGTCACCCTCCTCAAATAATTATTACACAGTATAAAATACCATTAAAACAAAATCAACCAAAAAGGAGAAAAGTCGTAACAAGGT\",\tScore: -0.48031729459762573\n",
182 | "Prompt: \"GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTATGCACGCGATAGCATTGCGAGACGCTGGAGCCGGAGCACCCTATGTCGCAGTATCTGTCTTTGATTCCTGCCTCATCCTATTATTTATCGCACCTACGTTCAATATTACAGGCGAACATACTTACTAAAGTGTGTTAATTAATTAATGCTTGTAGGACATAATAATAACAATTGAATGTCTGCACAGCCACTTTCCACACAGACATCATAACAAAAAATTTCCACCAAACCCCCCCTCCCCCGCTTCTGGCCACAGCACTTAAACACATCTCTGCCAAACCCCAAAAACAAAGAACCCTAACACCAGCCTAACCAGATTTCAAATTTTATCTTTTGGCGGTATGCACTTTTAACAGTCACCCCCCAACTAACACATTATTTTCCCCTCCCACTCCCATACTACTAATCTCATCAATACAACCCCCGC\",\tOutput: \"GTATCTGATATGGATACGGTGAATAGTGGCTTCTTCAGTGTGCATCGTATTCATAGAAGAAACGATTTTTTTCGATACTGATTTCATTAGTGACTACGCTATCGGGCCTGCACTCTTTAAGGGATACAGATTCGTCGACTGTATTGGCCATTTGGCCACAGTGTGACCACATGACCATAATCTACATAGGTCTACATCATCGATAGGATTGCATCGGGGAGACGATACGGGGACAGGTATGTATTCATGAGCGTTGATGTCGCCACGGATGCGTTAAGCATATCCGCTCCGGATCCTCGCTGGATGGGGTATTACTGTTTATGAATGTCTTGTCTGCTCAAAGGCCGCGCTGCAGCAAAATACCCAAATGTCCAAAATGTGGGACATTTGCACATTGGGTGACAGTTGTTCGCAAAAGGCGCGCCCGAAAGGCATAATTCGGCCAACCCCAAATTCACAACTGCAAAACAGTAGTATAGTGATCGACTATATTTGCATTA\",\tScore: -1.3735215663909912\n",
183 | "['AGGCCTGCCTGCCTCTGTAGGCTCCACCTCCGGGGGAAGGGCACAGCCCAACAAAAGGCGGCAGACACCTCTGCAGACTTAAATGTCCCTGTCTGACAGCTTTGAAGAGAGCAGTGGTTCTCCTAGCACGCAGCTGGAGATCTGAGAACGGGCAGACTGCCTCCTCAAGTGGGTCCCTGACCCCTGACCCCCGAGCAGCCTAACTGGGAGGCACCCCCCAGCAGGGGCACACTGACACCTCACACGGCAGGGTATTCCAACAGACCTGCAGCTGAGGATCCTGTCTGCAAGACAGCTTAGGCCCTACAACAGTCTTGCAGCCACCTCTACTGATGTAGGAAAGCCTGCCTGCCTCTGTAGGCTCCACCTCTGGGAGCAGGGCATAGACAAACAAAAAGAGGCAGCAGCAGCCTCAGCAGACAGAAACCATACCGCCTGGCAGCTTTGAAGAGAGCAGTGGATCTCCCAACACGGAGGTTGAGATCTGAGAACGGACAGAC', 'TAATGTTCCGGCGTTGTTTCTTGATGTCTCTGACCAGACTTCCGTTAACAGTATTATTTTCTCCCATGAAGACGGTACGCGACTGGGCGTGGAACATCTGATCGCATTAGGTCACCAGCAAATCGCGCTGTTAGCGGGGCCATTAAGTTCTGTCTCGGCGCGTCTGAGGCTGGCGGGCTGGCATAAATATCTCACTCGCAACCATATCCAGCCGATAGCGGTACGGGAAGGCGACTGGAGTGCCATGTCCGGTTATCAACAAACGATGGAAATGCTGAATAACGGCATCGTACCGTCGGCGATGCTGGTTGCCAACGATCAGATGGCGCTGGGCGCAATGCGCGCACTGGAAGAACATAAACTTTCGGTACCGGAAGATATCTCGGTGATTGGTTATGACGATACCGAAGACAGCTCGTGTTTTATTCCGCCGTTGACCACTATCAAGCAGGATTTTCGTCTGCTGGGGCAGACAGCTGTGGACCGCCTGCTGCAACTGA', 'TAGATACCTCACTATGCTTAGCCATAAACCTAGGCAGAGTATAACCAATCTGCCAGCCAGAGTACTACTAGCAATAGCTTAAAACTCAAAGGACTTGGCGGTGCTTTATATCCACCTAGAGGAGCCTGTTCTATAATCGATAAACCCCGATAAACCTTACCACTTTTTGCTAATACAGTCTATATACCGCCATCTTCAGCAAACCCTTAAAAGGAATCACAGTAAGCAAAAACTTAGCACATAGGAACGTTAGGTCAAGGTGTAACCTATAAAGTGGTAAGAAATGGGCTACATTTTTTTAATTAAAAACACATTCTATACTAAACCTATGAAAATATTAAGCCTAAGGTGGATTTAGTAGTAAATTAAGAATAGAGAGCTTAATTGAATGAGAAAATTGGGCGCACACAATGCCCGTCACCCTCCTCAAATAATTATTACACAGTATAAAATACCATTAAAACAAAATCAACCAAAAAGGAGAAAAGTCGTAACAAGGT', 'GTATCTGATATGGATACGGTGAATAGTGGCTTCTTCAGTGTGCATCGTATTCATAGAAGAAACGATTTTTTTCGATACTGATTTCATTAGTGACTACGCTATCGGGCCTGCACTCTTTAAGGGATACAGATTCGTCGACTGTATTGGCCATTTGGCCACAGTGTGACCACATGACCATAATCTACATAGGTCTACATCATCGATAGGATTGCATCGGGGAGACGATACGGGGACAGGTATGTATTCATGAGCGTTGATGTCGCCACGGATGCGTTAAGCATATCCGCTCCGGATCCTCGCTGGATGGGGTATTACTGTTTATGAATGTCTTGTCTGCTCAAAGGCCGCGCTGCAGCAAAATACCCAAATGTCCAAAATGTGGGACATTTGCACATTGGGTGACAGTTGTTCGCAAAAGGCGCGCCCGAAAGGCATAATTCGGCCAACCCCAAATTCACAACTGCAAAACAGTAGTATAGTGATCGACTATATTTGCATTA']\n"
184 | ]
185 | }
186 | ],
187 | "source": [
188 | "generations = model.generate(\n",
189 | " input_seqs,\n",
190 | " n_tokens=500,\n",
191 | " temperature=1.0,\n",
192 | ")\n",
193 | "\n",
194 | "generated_seqs = generations.sequences\n",
195 | "print(generated_seqs)"
196 | ]
197 | },
198 | {
199 | "cell_type": "markdown",
200 | "metadata": {},
201 | "source": [
202 | "## Alignment Analysis\n",
203 | "### Let's analyze our generated sequences using Biopython's alignment tools."
204 | ]
205 | },
206 | {
207 | "cell_type": "code",
208 | "execution_count": 28,
209 | "metadata": {},
210 | "outputs": [
211 | {
212 | "name": "stdout",
213 | "output_type": "stream",
214 | "text": [
215 | "\n",
216 | "Sequence Alignments:\n",
217 | "\n",
218 | "Alignment 1 (L1RE2):\n",
219 | "AGGCCTGCCTGCCTCTGTAGGCTCCACCTCC-GGGGGA-AGGGCACAGCC-CAA-CAAAA-GGCG-GCAG-ACACCTCTGCAGACTTAAA-TGTCCCTGTCTGACAGCTTTGAAGAGAGCAGTGGTTCTCCT-AGCACGCAGCTGGAGATCTGAGAACGGGCAGACTGCCTCCTCAAGTGGGTCCCTGACCCCTGACCCCCGAGCAGCCTAACTGGGAGGCACCCCCCAGCAGGGGCACACTGACACCTCACACGGCAGGGTATTCCAACAGACCTGCAGCTGAGGA-TCCTGTCTGCA--AGACAG-----CTTAGG-C--CCTAC-AACAGTCTTGCAGCCACCTCTACTGAT--GTAGGAAAGCCTGCCTGCC-TCTGTAGGC-TCCACC-TC-TGGG---AG-C----AGGGCATAG--ACAAACA-A-AAAGA-GGCAG-------CAGCAGCCTCAGCAGACA------GAAAC-C---ATACCGCCT-G-GCAGC-T-T--TG------AAGAGA--GCAGTGGATC-TC-C---CAACACGG-----AGGT-TGAGATCTGAGAACGGACA-GAC---\n",
220 | "||||||||||||||||||||||||||||| | ||||| ||||||||| ||| ||||| ||| |||| | |||||||||||||| || |||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||| ||| || | || | || | || || | | || ||||| | | | ||| | || |||||| | | |||| || | || | || ||| | |||| | ||||| || | ||| | | |||| | ||||| | | | ||| | || || | | | ||| || ||||| || || | ||||| | || || || || || || | || \n",
221 | "AGGCCTGCCTGCCTCTGTAGGCTCCACCT-CTGGGGG-CAGGGCACAG--ACAAACAAAAAGGC-AGCAGTA-ACCTCTGCAGACTT-AAGTGTCCCTGTCTGACAGCTTTGAAGAGAGCAGTGGTTCTCC-CAGCACGCAGCTGGAGATCTGAGAACGGGCAGACTGCCTCCTCAAGTGGGTCCCTGACCCCTGACCCCCGAGCAGCCTAACTGGGAGGCACCCCCCAGCAGGGGCACACTGACACCTCACACGGCAGGGTATTCCAACAGACCTGCAGCTGAGG-GTCCTGTCTG--TTAGA-AGGAAAAC-TA--ACAACC-A-GAA-AG----G-A--CA--TCTAC--A-CCG-A--AAA-C-------CCATCTGTA--CAT-CACCATCAT---CAAAGACCAAAAG----TAGATA-AAAC-CACAAAGATGG--GGAAAAAACAG-A-----A-CAGA-AAAACTGGAAACTCTAAA-A-CGC--AGAGC-GCCTCTCCT-CCTCCAAAG-GAACGCAGT---TCCTCACCAGCAACA--GAACAAAG--CTG-GA--TG-GA---GA-ATGA-TTT\n",
222 | " Score=772.4\n",
223 | "\n",
224 | "Sequence similarity: 82.80%\n",
225 | "Alignment score: 772.40\n",
226 | "\n",
227 | "Alignment 2 (ECOLAC):\n",
228 | "TAATGTTCCGGCGTTG-TTTCTTGATGTCTCTGACCAG--ACTTCCGT-T-AACAGTATTATTTTCTCCCATGAAGACGGTACGCGACTGGGCGTGGAA-CATCTGA-TCGCATTAGG-TCACCAGCAAATCGCGCTGTTAGCGGGGCC-ATTAAGTTCTGTCTCGGCGCGTCTGAG-G-CTGGCG-GGCTGGCATAAATATCTCACTCGCAAC-C--ATATCCAGCCGATAGCGGTA-CGGGAAGGCGACTGGAGTGCCATGTCCGGTTAT-CAACAAACG-ATGG-AAATGCTGAAT-AACGG-CATCGT----ACCGTCGGCGATGCTGGTTGCCAACGATCAGATGGCGCTGGGCGCAATGCGCGC----AC----T--GGAAGAACATAAA---C-TTTCGGTAC-CGGAAGATATCTCGGT-GATTGGTT-AT--GACGATACCGAAGACAGCTCG-TGTTTTAT-TCC-GCCGTTG--ACCACT-ATCAAG-CAGGATTTTCGTC-TGCTGGGGCAGA--CAGCTGTGGACCGCCT-GCTGCAA--CTGA\n",
229 | "||||||||||||||| ||||||||||||||||||||| || || | |||||||||||||||||||||||||||||||||||||||||||||| | |||||| ||||||| || |||||||||||||||||||||||| ||||| |||||||||||||||||||||||| | | ||||| |||||||||||||||||||||||||| | || | ||||||||||||| | ||||||||||||||||||||||||||||||| | |||||||| || | ||||||||||| | || |||||| || | ||||||||||||||||||||||||||||||||||||||||||||||| || | || | | | | || ||| || ||||||||||| | ||| || |||||||||||||||||||| || |||| ||| ||||| ||||| ||||| ||||||||||| | |||||||||| | |||| |||||||| || ||||||| || \n",
230 | "TAATGTTCCGGCGTT-ATTTCTTGATGTCTCTGACCAGACAC--CC--ATCAACAGTATTATTTTCTCCCATGAAGACGGTACGCGACTGGGCGTGG-AGCATCTG-GTCGCATT-GGGTCACCAGCAAATCGCGCTGTTAGC-GGGCCCATTAAGTTCTGTCTCGGCGCGTCT--GCGTCTGGC-TGGCTGGCATAAATATCTCACTCGCAA-TCAAAT-T-CAGCCGATAGCGG-AACGGGAAGGCGACTGGAGTGCCATGTCCGGTT-TTCAACAAAC-CAT-GCAAATGCTGAATGA--GGGCATCGTTCCCAC--T--GCGATGCTGGTTGCCAACGATCAGATGGCGCTGGGCGCAATGCGCGCCATTACCGAGTCCGG--G--C-T---GCGCGTT--GGT--GCG---GATATCTCGGTAG--TGG--GATACGACGATACCGAAGACAGCTC-ATG--TTATATCCCGCCGT--CAACCAC-CATCAA-ACAGGATTTTCG-CCTGCTGGGGCA-AACCAGC-GTGGACCG-CTTGCTGCAACTCT--\n",
231 | " Score=843.8\n",
232 | "\n",
233 | "Sequence similarity: 88.60%\n",
234 | "Alignment score: 843.80\n",
235 | "\n",
236 | "Alignment 3 (NC_007596.2Mammuthusprimigeniusmitochondrion):\n",
237 | "TAGATACCTCACTATGCT-TAGCCA-TAAACC--TAGGCAG-AG-TA----TAACCAA---TC-TGCCAGCCAGAGTA-CTACTAGC-AAT-AGCTTAAAACTC-AAAGGACTTGGCGGTGCTTTATATCCACCTAGAGG-AGCCTGT-TCTA-TAATC-GATA-AACCCCGATAA-ACCTTAC---CACTTTTTGCTAATA-CAGTCT-ATATACCG-CCATCTTCAGCAAACCC-TTAAA-AGG----AATCACAGTA-AGC--AA--A-AACTTAGCACAT---AGGAACGTTAGGTCA--AGGTGTAA--CCTATAAA-GT---GGT--AAGAAATGGGCTACATTTT-T-TTAATTA-AA-A-ACACATT-CT--ATACTAAAC-CTA-TGAAAATA------TTAAGCCTAAGGT-GGATTTAGTAGTAAAT-TAAGAATAGAGAGCTTAATTG---AATG---A-GAAAATTGGGCGC--ACACAAT--GCCCGTCACC-CTCCTCAA--A--T--A-ATT--ATTACA--CAGTATAAAATACCA---TTAAAACAAAATCAACCAAAA-AGGAGAA-AAGTCGTAACAAGGT\n",
238 | "||||||||||||||||| ||||| |||| | | | | || || || ||| | | || ||||||| | |||||||| | ||||||||||| |||||||||||||||||||||||||||||||| || ||||||| || ||| | ||| ||||||||| | ||||||| ||| |||||||| ||||| ||||||| ||||||||||||||||| | | ||| || | ||| ||| || | ||| | ||| | || |||||| | |||||| ||| | || ||| ||| |||||||||||||| | ||| || || | ||| | | |||| | || || |||| || | |||| ||||||||||||||| ||||||||||||||||||||| || | | ||| |||| ||||| |||||||| | |||||||| | | | | | | ||| || ||| || || || |||| |||| || || ||||| | |||||||||||||| \n",
239 | "TAGATACCTCACTATGC-CTAGCC-CTAAA-CTTT--G-A-TAGCTACCTTTA--CAAAGCT-AT-CC-GCCAGAG-AACTACTAGCCA--GAGCTTAAAACT-TAAAGGACTTGGCGGTGCTTTATATCCACCTAG-GGGAGCCTGTCTC--GTAA-CCGAT-GAACCCCGAT-ACACCTTACCGTCAC---TTGCTAAT-TCAGTC-CATATACC-ACCATCTTCAGCAAACCCCT---ATAGGGCACAA--A-AGT-GAGCTTAATCATAAC----C-CATGAAA--AA-GTTAGG-C-CGAGGTGT--CGCCT----ACGTGACGGTCAAAG--ATGGGCTACATTTTCTATTA--TAGAATAGACA-A--AC-GGATAC----CACT-CTG-AAAT-GGGTGGTT--G---AAGG-CGGATTTAGTAGTAAA-CTAAGAATAGAGAGCTTAATTGAACAA-GGCCATGAA------GCGCGTACACA--CCGCCCGTCA-CTCTCCTCAAGTACCTCCACA-TCAA--ACAATCA-TAT----TA-CAGATTT-AAAC-AAAT--AC---AAGAGGAG-ACAAGTCGTAACAAGG-\n",
240 | " Score=728.2\n",
241 | "\n",
242 | "Sequence similarity: 79.80%\n",
243 | "Alignment score: 728.20\n",
244 | "\n",
245 | "Alignment 4 (NC_012920.1_homosapiens_mitochondrion):\n",
246 | "GT--ATC-TGAT---ATGG-AT-ACGGTGA-AT-A--G-TGGCTT---CTTCAGTGTGCAT----CGTATT--CATAG--AAG-----AAACGATTTTTTTCGAT------ACTGA-TTTCAT-TAGTGACT-ACGCTATCGGGCCTGCACTCTTTAAGGG--ATACAGATTCGTCG--ACTGTATTGGCCATTT-GGCCACAGTGTGAC-CACATG-A--CCATAATCTAC--ATAGGT------CTA--CATCAT-CGATAGGATT-GCATCGGGG--AG--ACGAT-ACGGGGACAGGTATGTATTCATGAGCGTTGAT----GTCG-CCACG-GATGCGTTAAGCATATCCGCTCCGG---ATC-CTCG-CTGGAT-----GGGGTATTACTGTTTATGAATGTCTTGTCTGC-TCAAAGGC-CGC-GC--TGCAG--CAAAA----TA-C----CCA-AATGTCC--------AAA----ATGTGGGA-----CATTT-GCACATTGGGTG--AC---AGTTGTT--C---GC-A-A--AAGGCGCGCCCGAAAGG------CATAATT-CG-GCCA---ACC-C---CA-A--ATT---CACAACTG-CAA---AA-----CAGT--AGTA-TAGT----GATCGA----CT-----ATA----T-----T----TGCA--T-TA-------\n",
247 | " ||| | | | | | || | | | | | || | | | ||| || | || | || ||| || | | || | ||| || ||| || || || ||| || || | ||||| | | | | | || ||| | || | | | | ||||| | |||||| || |||||| ||| | | | | | ||| || || || | ||| || || ||| || ||| || || ||| | || ||| || || ||| ||| | | | ||| || | || || || |||| || ||| || ||||| ||||| || | ||| | || ||| | || || | ||| ||| || || ||| || | || | | || | ||| ||| | |||| || |||| ||| | || | ||| | ||| | ||| || | || || | | || |||| | || ||| | | || | | || \n",
248 | "--CCATCCT-A-CCCA--GCA-CAC----ACA-CACCGCT-GC-TAACC--C------CATACCCCG-A--ACCA-A-CCAA-ACCCCAAA-GA-------C-A-CCCCCCAC--AGTTT-ATGTAG---CTTAC-CT------CCT-CA------AA--GCAATACA----C-T-GAAA----A-TG----TTTAG---AC-G-G-G-CTCACAT-CACCCCATAA---ACAAATAGGTTTGGTCCTAGCC-T--TTC--T---ATTAGC-TC----TTAGTAA-GATTAC----AC----ATG----CA--AGC----ATCCCCGT--TCCA-GTGA---GTT---CA---CC-CTC---TAAATCAC-C-AC--GATCAAAAGG---A--AC--------AA----------GCATCAA--GCACGCAGCAATGCAGCTCAAAACGCTTAGCCTAGCCACA----CCCCCACGGGAAACAGCA-GT--GATTAACC-TTTAGCA-AT------AAACGAAAGT--TTAACTAAGCTATACTAA----C-CCC---AGGGTTGGTC--AATTTCGTGCCAGCCACCGCGGTCACACGATTAACC-CAA--GTCAATAGAAGCCGGC-GTAAAG-AGT-GTTTTAGATC-ACCCCCTCCCCAATAAAGCTAAAACTCACCTG-AGTTGTAAAAAACT\n",
249 | " Score=497.2\n",
250 | "\n",
251 | "Sequence similarity: 60.40%\n",
252 | "Alignment score: 497.20\n"
253 | ]
254 | }
255 | ],
256 | "source": [
257 | "def analyze_alignments(generated_seqs: List[str],\n",
258 | " target_seqs: List[str],\n",
259 | " names: Optional[List[str]] = None\n",
260 | " ) -> List[dict]:\n",
261 | " \"\"\"\n",
262 | " Analyze and visualize alignments between generated and target sequences.\n",
263 | " \n",
264 | " Args:\n",
265 | " generated_seqs: List of generated sequences\n",
266 | " target_seqs: List of target sequences\n",
267 | " names: Optional list of sequence names\n",
268 | " \n",
269 | " Returns:\n",
270 | " List of alignment metrics for each sequence pair\n",
271 | " \"\"\"\n",
272 | " metrics = []\n",
273 | " print(\"\\nSequence Alignments:\")\n",
274 | " \n",
275 | " for i, (gen_seq, target_seq) in enumerate(zip(generated_seqs, target_seqs)):\n",
276 | " if names and i < len(names):\n",
277 | " print(f\"\\nAlignment {i+1} ({names[i]}):\")\n",
278 | " else:\n",
279 | " print(f\"\\nAlignment {i+1}:\")\n",
280 | " \n",
281 | " gen_bio_seq = Seq(gen_seq)\n",
282 | " target_bio_seq = Seq(target_seq)\n",
283 | " \n",
284 | " # Get alignments\n",
285 | " alignments = pairwise2.align.globalms(\n",
286 | " gen_bio_seq, target_bio_seq,\n",
287 | " match=2,\n",
288 | " mismatch=-1,\n",
289 | " open=-0.5,\n",
290 | " extend=-0.1\n",
291 | " )\n",
292 | " \n",
293 | " best_alignment = alignments[0]\n",
294 | " print(format_alignment(*best_alignment))\n",
295 | " \n",
296 | " matches = sum(a == b for a, b in zip(best_alignment[0], best_alignment[1]) \n",
297 | " if a != '-' and b != '-')\n",
298 | " alignment_length = len(best_alignment[0].replace('-', ''))\n",
299 | " similarity = (matches / len(target_seq)) * 100\n",
300 | " \n",
301 | " seq_metrics = {\n",
302 | " 'similarity': similarity,\n",
303 | " 'score': best_alignment[2],\n",
304 | " 'length': len(target_seq),\n",
305 | " 'gaps': best_alignment[0].count('-') + best_alignment[1].count('-')\n",
306 | " }\n",
307 | " \n",
308 | " if names and i < len(names):\n",
309 | " seq_metrics['name'] = names[i]\n",
310 | " \n",
311 | " metrics.append(seq_metrics)\n",
312 | " \n",
313 | " print(f\"Sequence similarity: {similarity:.2f}%\")\n",
314 | " print(f\"Alignment score: {best_alignment[2]:.2f}\")\n",
315 | " \n",
316 | " return metrics\n",
317 | "\n",
318 | "# Analyze alignments\n",
319 | "alignment_metrics = analyze_alignments(generated_seqs, target_seqs, names)"
320 | ]
321 | },
322 | {
323 | "cell_type": "markdown",
324 | "metadata": {},
325 | "source": [
326 | "## Generate with species prompt"
327 | ]
328 | },
329 | {
330 | "cell_type": "code",
331 | "execution_count": 11,
332 | "metadata": {},
333 | "outputs": [
334 | {
335 | "name": "stdout",
336 | "output_type": "stream",
337 | "text": [
338 | "Species tag prompt: |D__ANIMALIA;P__CHORDATA;C__MAMMALIA;O__DIPROTODONTIA;F__PHASCOLARCTIDAE;G__PHASCOLARCTOS;S__PHASCOLARCTOS CINEREUS|\n",
339 | "Initializing inference params with max_seqlen=616\n",
340 | "Prompt: \"|D__ANIMALIA;P__CHORDATA;C__MAMMALIA;O__DIPROTODONTIA;F__PHASCOLARCTIDAE;G__PHASCOLARCTOS;S__PHASCOLARCTOS CINEREUS|\",\tOutput: \"TAGTACCCCGTCCAATATTCGGAAAACGAGAACTGGACGAACTGAACTTACTTCTTTGTTGATGCACGGGAAGGATCTTCAGCTTATCACCGTCGCGTCGATCAAGTTACTGACTCACAATTCTTCTTTCTCTTCGAGGTCCTTTTCTAGATTTGTAAAGTTACGTTAGGTATTAATATCTACCGCATGTTCCGTCCAAAGTAAACGCTCCCCCTAACTGCATTATATTAAGCCGAACCGAACGAAGTTGCGCAGAAACTATGAACGTTTCCGTATTTGCGGAAGATATCTCTCAACTCTCTGCAAACTGAAATAAGCCAGTGAATATAACAATGAACGTTTCCGTATTTGCGGAAGATATCTCTCAACTCTCTGCAAACTGAAATAAGCCAGTGAATATAACAATAGAAAACCTTCGCACCTTACATTCGCGTCCATTAGGTATGCAGGCAGTTCGGCCGGGCCGAAGAATAAGAAGCCACCCCAACTCTGCAAAAAAA\",\tScore: -1.2092068195343018\n",
341 | "Koala sequence:\n",
342 | "TAGTACCCCGTCCAATATTCGGAAAACGAGAACTGGACGAACTGAACTTACTTCTTTGTTGATGCACGGGAAGGATCTTCAGCTTATCACCGTCGCGTCGATCAAGTTACTGACTCACAATTCTTCTTTCTCTTCGAGGTCCTTTTCTAGATTTGTAAAGTTACGTTAGGTATTAATATCTACCGCATGTTCCGTCCAAAGTAAACGCTCCCCCTAACTGCATTATATTAAGCCGAACCGAACGAAGTTGCGCAGAAACTATGAACGTTTCCGTATTTGCGGAAGATATCTCTCAACTCTCTGCAAACTGAAATAAGCCAGTGAATATAACAATGAACGTTTCCGTATTTGCGGAAGATATCTCTCAACTCTCTGCAAACTGAAATAAGCCAGTGAATATAACAATAGAAAACCTTCGCACCTTACATTCGCGTCCATTAGGTATGCAGGCAGTTCGGCCGGGCCGAAGAATAAGAAGCCACCCCAACTCTGCAAAAAAA\n"
343 | ]
344 | }
345 | ],
346 | "source": [
347 | "from evo2.utils import make_phylotag_from_gbif\n",
348 | "\n",
349 | "species = 'Phascolarctos cinereus' # Koala bear\n",
350 | "\n",
351 | "species_tag_prompt = make_phylotag_from_gbif(species)\n",
352 | "\n",
353 | "print(f\"Species tag prompt: {species_tag_prompt}\") # Check if the GBIF API returned a valid species tag!\n",
354 | "\n",
355 | "# Generate species tag\n",
356 | "koala_sequence = model.generate(\n",
357 | " [species_tag_prompt],\n",
358 | " n_tokens=500,\n",
359 | " temperature=1.0,\n",
360 | ")\n",
361 | "\n",
362 | "print(f\"Koala sequence:\")\n",
363 | "print(koala_sequence.sequences[0])"
364 | ]
365 | }
366 | ],
367 | "metadata": {
368 | "kernelspec": {
369 | "display_name": "hf_tracking_test",
370 | "language": "python",
371 | "name": "python3"
372 | },
373 | "language_info": {
374 | "codemirror_mode": {
375 | "name": "ipython",
376 | "version": 3
377 | },
378 | "file_extension": ".py",
379 | "mimetype": "text/x-python",
380 | "name": "python",
381 | "nbconvert_exporter": "python",
382 | "pygments_lexer": "ipython3",
383 | "version": "3.11.11"
384 | }
385 | },
386 | "nbformat": 4,
387 | "nbformat_minor": 2
388 | }
389 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | biopython
2 | huggingface_hub
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | import os
2 | import subprocess
3 | import sys
4 | from setuptools import setup, find_packages
5 | from setuptools.command.build import build as _build # use the top-level build command
6 | from setuptools.command.develop import develop as _develop
7 | from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
8 |
9 |
10 | def update_submodules():
11 | base_dir = os.path.dirname(__file__)
12 | # Check if the .git folder exists
13 | if os.path.exists(os.path.join(base_dir, '.git')):
14 | print("Updating git submodules...")
15 | # Run submodule init and update for 'vortex'
16 | subprocess.check_call(['git', 'submodule', 'init', 'vortex'], cwd=base_dir)
17 | subprocess.check_call(['git', 'submodule', 'update', 'vortex'], cwd=base_dir)
18 | else:
19 | print("No .git directory found; skipping submodule update.")
20 |
21 | def run_make_setup_full():
22 | base_dir = os.path.dirname(__file__)
23 | vortex_dir = os.path.join(base_dir, 'vortex')
24 | original_dir = os.getcwd()
25 |
26 | # Ensure submodules are updated before running the Makefile
27 | update_submodules()
28 |
29 | # Ensure the Makefile uses the current Python interpreter
30 | env = os.environ.copy()
31 | env["PYTHON"] = sys.executable
32 | print(f"Running 'make setup-full' in {vortex_dir} with PYTHON={sys.executable} ...")
33 |
34 | try:
35 | os.chdir(vortex_dir)
36 | subprocess.check_call(['make', 'setup-full'], env=env)
37 | finally:
38 | os.chdir(original_dir)
39 |
40 | class CustomBuild(_build):
41 | def run(self):
42 | # Run egg_info to ensure metadata is available
43 | self.run_command('egg_info')
44 | # Update submodules and run the Makefile before building anything else
45 | run_make_setup_full()
46 | # Continue with the normal build process
47 | _build.run(self)
48 |
49 | class CustomDevelop(_develop):
50 | def run(self):
51 | update_submodules()
52 | run_make_setup_full()
53 | _develop.run(self)
54 |
55 | class CustomBDistWheel(_bdist_wheel):
56 | def run(self):
57 | self.run_command('egg_info')
58 | _bdist_wheel.run(self)
59 |
60 | def parse_requirements(filename):
61 | requirements = []
62 | with open(filename) as f:
63 | for line in f:
64 | line = line.strip()
65 | if line and not line.startswith('#'):
66 | requirements.append(line)
67 | return requirements
68 |
69 |
70 | with open('evo2/version.py') as infile:
71 | exec(infile.read())
72 |
73 | with open('README.md') as f:
74 | readme = f.read()
75 |
76 | requirements = parse_requirements("requirements.txt")
77 |
78 | setup(
79 | name='evo2',
80 | version=version,
81 | # Only include the evo2 package; the vortex submodule is used for build purposes.
82 | packages=find_packages(include=["evo2", "vortex/vortex"]),
83 | install_requires=requirements,
84 | cmdclass={
85 | 'build': CustomBuild,
86 | 'develop': CustomDevelop,
87 | 'bdist_wheel': CustomBDistWheel,
88 | },
89 | package_data={'evo2': ['evo2/configs/*.yml']},
90 | include_package_data=True,
91 | python_requires='>=3.11',
92 | license="Apache-2.0",
93 | description='Genome modeling across all domains of life',
94 | long_description=readme,
95 | long_description_content_type='text/markdown',
96 | author='Team Evo 2',
97 | url='https://github.com/arcinstitute/evo2',
98 | )
99 |
--------------------------------------------------------------------------------
/test/test_evo2.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | import csv
3 | from pathlib import Path
4 | from typing import List, Optional, Union
5 | import numpy as np
6 | import torch
7 | import torch.nn.functional as F
8 |
9 | from evo2 import Evo2
10 |
11 | def read_prompts(input_file: Path) -> Union[List[List[str]]]:
12 | """Read prompts from input file."""
13 | promptseqs: List[str] = []
14 |
15 | with open(input_file, encoding='utf-8-sig', newline='') as csvfile:
16 | reader = csv.reader(csvfile)
17 | next(reader) # Skip header
18 | for row in reader:
19 | promptseqs.append(row[0])
20 |
21 | return promptseqs
22 |
23 | def test_forward_pass(*, model, sequences):
24 | """Test model forward pass accuracy on sequences."""
25 | losses = []
26 | accuracies = []
27 |
28 | for seq in sequences:
29 | # Convert sequence to model input format
30 | input_ids = torch.tensor(model.tokenizer.tokenize(seq), dtype=int).to('cuda:0')
31 |
32 | with torch.inference_mode():
33 | # Forward pass
34 | logits, _ = model.model.forward(input_ids.unsqueeze(0))
35 |
36 | # Calculate loss and accuracy
37 | target_ids = input_ids[1:] # Shift right for next token prediction
38 | pred_logits = logits[0, :-1, :]
39 |
40 | # Cross entropy loss
41 | loss = F.cross_entropy(
42 | pred_logits,
43 | target_ids.long()
44 | )
45 |
46 | # Get predictions
47 | pred_tokens = torch.argmax(pred_logits, dim=-1)
48 |
49 | # Calculate accuracy
50 | accuracy = (target_ids == pred_tokens).float().mean().item()
51 |
52 | losses.append(loss.item())
53 | accuracies.append(accuracy)
54 |
55 | # Print sequence results
56 | print("\nSequence Results:")
57 | for i, (loss, acc) in enumerate(zip(losses, accuracies)):
58 | print(f"Sequence {i+1}: Loss = {loss:.3f}, Accuracy = {acc:.2%}")
59 | if acc < 0.5:
60 | print("WARNING: Forward pass accuracy is below 50% on test sequence. Model may be broken, trained models should have >80% accuracy.")
61 |
62 | return accuracies, losses
63 |
64 | def main():
65 | """
66 | Test sequence prediction accuracy using Evo2 models.
67 | Expected results for forward pass:
68 | - Evo 2 40B 1m: Loss ~0.216, Accuracy ~91.67%
69 | - Evo 2 7B 1m: Loss ~0.348, Accuracy ~86.35%
70 | - Evo 2 1B base: Loss ~0.502, Accuracy ~79.56%
71 | """
72 | parser = argparse.ArgumentParser(description="Test Evo2 Model Forward Pass")
73 | parser.add_argument("--model_name", choices=['evo2_7b', 'evo2_40b', 'evo2_7b_base', 'evo2_40b_base', 'evo2_1b_base'],
74 | default='evo2_7b',
75 | help="Model to test")
76 |
77 | args = parser.parse_args()
78 |
79 | # Set random seeds
80 | torch.manual_seed(1)
81 | torch.cuda.manual_seed(1)
82 |
83 | # Initialize model
84 | model = Evo2(args.model_name)
85 |
86 | # Read sequences
87 | sequences = read_prompts('vortex/test/data/prompts.csv')
88 |
89 | # Test forward pass
90 | accuracies, losses = test_forward_pass(
91 | model=model,
92 | sequences=sequences
93 | )
94 |
95 | # Calculate and validate results
96 | mean_loss = np.mean(losses)
97 | mean_accuracy = np.mean(accuracies) * 100
98 | print(f"\nMean Loss: {mean_loss:.3f}")
99 | print(f"Mean Accuracy: {mean_accuracy:.3f}%")
100 |
101 | # Validate against expected scores
102 | eps = 1e-3 # epsilon for float comparison
103 | expected_metrics = {
104 | 'evo2_40b': {'loss': 0.2159424, 'acc': 91.673},
105 | 'evo2_7b': {'loss': 0.3476563, 'acc': 86.346},
106 | 'evo2_40b_base': {'loss': 0.2149658, 'acc': 91.741},
107 | 'evo2_7b_base': {'loss': 0.3520508, 'acc': 85.921},
108 | 'evo2_1b_base': {'loss': 0.501953125, 'acc': 79.556}
109 | }
110 |
111 | expected = expected_metrics[args.model_name]
112 | if abs(mean_loss - expected['loss']) < eps:
113 | print(f"\nTest Passed! Loss matches expected {expected['loss']:.3f}")
114 | else:
115 | print(f"\nTest Failed: Expected loss {expected['loss']:.3f}, got {mean_loss:.3f}")
116 |
117 | if __name__ == "__main__":
118 | main()
--------------------------------------------------------------------------------
/test/test_evo2_generation.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | import csv
3 | from pathlib import Path
4 | from typing import List, Optional, Union
5 | import numpy as np
6 | import torch
7 |
8 | from evo2 import Evo2
9 |
10 | def read_prompts(input_file: Path) -> Union[List[List[str]]]:
11 | """Read prompts from input file."""
12 | promptseqs: List[str] = []
13 |
14 | with open(input_file, encoding='utf-8-sig', newline='') as csvfile:
15 | reader = csv.reader(csvfile)
16 | next(reader) # Skip header
17 | for row in reader:
18 | promptseqs.append(row[0])
19 |
20 | return promptseqs
21 |
22 | def mid_point_split(*, seq, num_tokens):
23 | """Split sequence at midpoint for prompt and target."""
24 | mid_point = 2*(len(seq)//4)
25 | prompt = seq[:mid_point]
26 | target = seq[mid_point:mid_point+num_tokens]
27 | return prompt, target
28 |
29 | def calculate_sequence_identity(seq1: str, seq2: str) -> Optional[float]:
30 | """Calculate sequence identity between two sequences through direct comparison."""
31 | if not seq1 or not seq2:
32 | return None
33 |
34 | min_length = min(len(seq1), len(seq2))
35 | matches = sum(a == b for a, b in zip(seq1[:min_length], seq2[:min_length]))
36 | return (matches / min_length) * 100
37 |
38 | def generate_and_score(*, sequences, model, generations_per_prompt=5, n_tokens=500,
39 | temperature=1.0, top_k=1, top_p=1.0):
40 | """Prompt with first half, generate and score on 2nd half."""
41 | scores = []
42 | prompts = []
43 | targets = []
44 |
45 | # Prepare all prompts and targets
46 | for seq in sequences:
47 | prompt, target = mid_point_split(seq=seq, num_tokens=n_tokens)
48 | prompts.extend([prompt] * generations_per_prompt)
49 | targets.extend([target] * generations_per_prompt)
50 |
51 | for i in range(len(prompts)):
52 | prompt = prompts[i]
53 | target = targets[i]
54 |
55 | with torch.inference_mode():
56 | generated = model.generate(
57 | prompt_seqs=[prompt],
58 | n_tokens=n_tokens,
59 | temperature=temperature,
60 | top_k=top_k,
61 | top_p=top_p,
62 | )
63 |
64 | decoded_seq = generated.sequences[0] # Assuming generate returns list of sequences
65 | score = calculate_sequence_identity(decoded_seq, target)
66 | scores.append(score)
67 |
68 | # Reshape scores to group by original sequence
69 | reshaped_scores = [scores[i:i + generations_per_prompt]
70 | for i in range(0, len(scores), generations_per_prompt)]
71 |
72 | return reshaped_scores
73 |
74 | def main():
75 | """
76 | Test sequence generation and scoring using the evo2 models
77 | Expected results (direct comparison w/o alignment):
78 | - Evo 2 40B 1m: 91.15%
79 | - Evo 2 7B 1m: 89.25%
80 | - Evo 2 1B base: 68.0%
81 | """
82 | parser = argparse.ArgumentParser(description="Test Evo2 Model Generation")
83 | parser.add_argument("--model_name", choices=['evo2_7b', 'evo2_40b', 'evo2_1b_base'], default='evo2_7b',
84 | help="Model to test (supports evo2_7b, evo2_40b, evo2_1b_base)")
85 |
86 | args = parser.parse_args()
87 |
88 | # Set random seeds
89 | torch.manual_seed(1)
90 | torch.cuda.manual_seed(1)
91 |
92 | model = Evo2(args.model_name)
93 |
94 | # Test parameters: greedy sampling of 500 tokens
95 | test_params = {
96 | 'n_tokens': 500,
97 | 'temperature': 1.0,
98 | 'top_k': 1,
99 | 'top_p': 1.0,
100 | 'generations_per_prompt': 1,
101 | }
102 |
103 | # Read and process sequences
104 | sequences = read_prompts('vortex/test/data/prompts.csv')
105 | scores = generate_and_score(
106 | sequences=sequences,
107 | model=model,
108 | **test_params
109 | )
110 |
111 | # Calculate and validate results
112 | mean_score = np.mean(scores)
113 | print("\nTest Results:")
114 | print("% Matching Nucleotides:", mean_score)
115 |
116 | # Validate against expected scores
117 | eps = 3 # large epsilon for direct comparison, since there are numeric differences by versions
118 | expected_scores = {
119 | 'evo2_40b': 91.15,
120 | 'evo2_7b': 89.25,
121 | 'evo2_1b_base': 68.0
122 | }
123 |
124 | expected_score = expected_scores[args.model_name]
125 | if abs(mean_score - expected_score) < eps:
126 | print(f"\nTest Passed! Score matches expected {expected_score}%")
127 | else:
128 | print(f"\nTest Failed: Expected {expected_score}%, got {mean_score}%")
129 |
130 | if __name__ == "__main__":
131 | main()
--------------------------------------------------------------------------------