nrel / evoprotgrad Goto Github PK
View Code? Open in Web Editor NEWDirected evolution of proteins in sequence space with gradients
Home Page: https://nrel.github.io/EvoProtGrad/
License: BSD 3-Clause "New" or "Revised" License
Directed evolution of proteins in sequence space with gradients
Home Page: https://nrel.github.io/EvoProtGrad/
License: BSD 3-Clause "New" or "Revised" License
When running the second cell:
# HuggingFace ESM2 8M model
esm2_expert = evo_prot_grad.get_expert('esm', temperature = 1.0, device = 'cuda')
# Supervised fluorescence regression model
gfp_expert = evo_prot_grad.get_expert(
'onehot_downstream_regression',
temperature = 1.0,
model = AutoModel.from_pretrained('NREL/avGFP-fluorescence-onehot-cnn',trust_remote_code=True),
device = 'cuda')
variants, scores = evo_prot_grad.DirectedEvolution(
wt_fasta = 'test/gfp.fasta',
output = 'all',
experts = [esm2_expert, gfp_expert],
parallel_chains = 16,
n_steps = 1000,
max_mutations = 15,
verbose = False
)()
I get the following error:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
File [~/vscode_projects/proteins/EvoProtGrad/evo_prot_grad/__init__.py:54](https://file+.vscode-resource.vscode-cdn.net/Users/amelieschreiber/vscode_projects/proteins/EvoProtGrad/~/vscode_projects/proteins/EvoProtGrad/evo_prot_grad/__init__.py:54), in get_expert(expert_name, temperature, model, tokenizer, device, use_without_wildtype)
53 expert_mod = importlib.import_module(f"evo_prot_grad.experts.{expert_name}_expert")
---> 54 return expert_mod.build(
55 temperature = temperature,
56 model = model,
57 tokenizer = tokenizer,
58 device = device,
59 use_without_wildtype = use_without_wildtype
60 )
61 except:
File [~/vscode_projects/proteins/EvoProtGrad/evo_prot_grad/experts/esm_expert.py:65](https://file+.vscode-resource.vscode-cdn.net/Users/amelieschreiber/vscode_projects/proteins/EvoProtGrad/~/vscode_projects/proteins/EvoProtGrad/evo_prot_grad/experts/esm_expert.py:65), in build(**kwargs)
64 """Builds a Esm2Expert."""
---> 65 return EsmExpert(**kwargs)
File [~/vscode_projects/proteins/EvoProtGrad/evo_prot_grad/experts/esm_expert.py:38](https://file+.vscode-resource.vscode-cdn.net/Users/amelieschreiber/vscode_projects/proteins/EvoProtGrad/~/vscode_projects/proteins/EvoProtGrad/evo_prot_grad/experts/esm_expert.py:38), in EsmExpert.__init__(self, temperature, model, tokenizer, device, use_without_wildtype)
37 raise ValueError("EsmExpert requires both `model` and `tokenizer` to be specified.")
---> 38 super().__init__(
39 temperature,
40 model,
41 tokenizer.get_vocab(),
42 device,
43 use_without_wildtype)
...
60 )
61 except:
---> 62 raise ValueError(f"Expert {expert_name} not found in evo_prot_grad.experts.")
ValueError: Expert esm not found in evo_prot_grad.experts.
I was just wondering is it possible to get the importance score of the protein sequence using EvoProtGrad model? For instance, in https://huggingface.co/datasets/waylandy/phosformer_curated data there are kinase enzymes. Now I want to rank the kinase enzymes based on importance scores.
Furthermore, I found in (https://colab.research.google.com/drive/1e8WjYEbWiikRQg3g4YHQJJcpvTIWVAjp?usp=sharing) that the scores are generated for different variants of a protein sequence. But what is the score of the original protein sequence ? If the score of original sequence can be measured then it can be compared with other variants?
In the paper Language models enable zero-shot prediction of the effects of mutations on protein function the ESM folks introduce the "Masked Marginal Scoring" method to compute effects of mutations on function and show that it performs significantly better than the Log Likelihood Ratio (LLR) method. If I am not mistaken, LLR is used for EvoProtGrad currently. Could the code from the ESM github (where they use ESM-1v) be adapted to ESM-2 and used in EvoProtGrad as a scoring method? In particular, could the masked marginal scoring method found here be modified to work with ESM-2 and used in EvoProtGrad as the scoring method? The masked marginal score is defined as
in the paper above, in Appendix A at the bottom of page 18, where
Hi,
Is it possible to get the weight of a protein sequence using EvoProtGrad?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.