Views
No views yet
pip install git+https://github.com/goodarzilab/cdsFM.gitAutoEnCodon and AutoDeCodon classes which serve as wrappers around the pre-trained models. Here are some examples on how to use them:1from cdsFM import AutoEnCodon
2
3# Load your dataframe containing sequences
4seqs = ...
5
6# Load a pre-trained EnCodon model
7model = AutoEnCodon.from_pretrained("goodarzilab/encodon-620M")
8
9# Extract embeddings
10embeddings = model.get_embeddings(seqs, batch_size=32)1from cdsFM import AutoDeCodon
2
3# Load a pre-trained DeCodon model
4model = AutoDeCodon.from_pretrained("goodarzilab/DeCodon-200M")
5
6# Generate!
7gen_seqs = model.generate(
8 taxid=9606, # NCBI Taxonomy ID for Homo sapiens
9 num_return_sequences=32, # Number of sequences to return
10 max_length=1024, # Maximum length of the generated sequence
11 batch_size=8, # Batch size for generation
12)
13| Model | name | num. params | description | weights |
|---|---|---|---|---|
| EnCodon | encodon-80M | 80M | Pre-trained checkpoint | 🤗 |
| EnCodon | encodon-80M-euk | 80M | Eukaryotic-expert | 🤗 |
| EnCodon | encodon-620M | 620M | Pre-trained checkpoint | 🤗 |
| EnCodon | encodon-620M-euk | 620M | Eukaryotic-expert | 🤗 |
| DeCodon | decodon-200M | 200M | Pre-trained checkpoint | 🤗 |
| DeCodon | decodon-200M-euk | 200M | Eukaryotic-expert | 🤗 |
1@article{Naghipourfar2024,
2 title = {A Suite of Foundation Models Captures the Contextual Interplay Between Codons},
3 url = {http://dx.doi.org/10.1101/2024.10.10.617568},
4 DOI = {10.1101/2024.10.10.617568},
5 publisher = {Cold Spring Harbor Laboratory},
6 author = {Naghipourfar, Mohsen and Chen, Siyu and Howard, Mathew and Macdonald, Christian and Saberi, Ali and Hagen, Timo and Mofrad, Mohammad and Coyote-Maestas, Willow and Goodarzi, Hani},
7 year = {2024},
8 month = oct
9}