Downloads · 30 days
6
3% of all-time downloads
jlomas/HyenaTransgenic-512L9A4-160M
HyenaTransgenic-512L9A4-160M is a feature extraction model from jlomas. Use it when you need embeddings to search or compare text. It is set up for transformers.
TransGenic is a transformer for DNA-to-annotation machine translation. Gene annotations specify the structure of a gene within a DNA sequence by providing the composition of each mRNA transcript based on the coordinat…
Downloads · 30 days
6
3% of all-time downloads
All-time downloads
195
Public
Repo size
1.5 GB
Likes
0
Public
Click a slice to open those files.
.bin743 MB · 100%
From the Hugging Face model README
TransGenic is a transformer for DNA-to-annotation machine translation. Gene annotations specify the structure of a gene within a DNA sequence by providing the composition of each mRNA transcript based on the coordinate locations of sub-genic features, including coding sequences (CDS), introns, and unstranslated regions (UTR). TransGenic uses a HyenaDNA encoder with the Longformer decoder to predict a text-based annotation format from raw DNA sequence. This model is a 160M parameter checkpoint with a hidden size of 512, 9 layers, and 4 attention heads.
This checkpoint was trained on 9 phylogenetically diverse plant species.
This model is intended to be used to generate de novo annotations for plant DNA sequences which contain a gene. The model can also be used to add alternatively spliced isoforms to known primary mRNA transcripts via prompt completion.
Example annotation of the AT1G58150.TAIR10 gene from Arabidopsis.
import torch
from transformers import AutoModel, AutoTokenizer
# Load the model and output tokenizer
model_name = "jlomas/HyenaTransgenic-512L9A4-160M"
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
gffTokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
# Load the HyenaDNA tokenizer
dnaTokenizer = AutoTokenizer.from_pretrained("LongSafari/hyenadna-large-1m-seqlen-hf", trust_remote_code=True)
# AT1G58150.TAIR10 gene sequence
seq = '''GCTTATGTTTATCTTTTGATCTGATCTATAAATATATATACAGGTTATCAAAAGGCCTCCACCAAAACCAACTCAACATCTCCGCCTCCATCTCCGCCTCCATCTCCGCCGCGAGTTCCAGACGCTCAAGAATTGGAGTACCTTAAATCCGACTCTTTTCCCGAACACGATGCGTAGAGTTGTCATTCGGACGGAGGTGTGCGTTCCGATAAAATTAGGCTACCGCCGCGGCTTTCAGACCTTCTAGAATTGGAGAAATTGTTTCCCGAACGCGAGGCGCTGAGTTGTCCTTTGGACGGAGATGAGGATTCCAATGAACTTAGGCTACGGCCGCTGGTTCCAGACGCTCAAGAATGGAAGTACCCTAAATCCAAGTTATTTCCCAGACACGCGGCGTGGAGTTGTCATTCGGGCGGAGGTGGAGGTGGAGGCGGTGGCCGTGTATTTACAAATAAAGTAAATGCGGTAGAAGAATTCAACTTAGGAGGACTGAAGGACAGCGAATCCGATTCCGATTCCGAGTAGGGAACTTTTAAAACAACTTTGATTATGGATTTCGATATCCAGAATAATTTTAATTCACTGCTGTTGGACTTGATTAATTTCCTATCACATAACGTTTTGGTTTAACTTTGTACGACCACCA'''
# Tokenize the input sequences and remove the [SEP] token
seqs = dnaTokenizer.batch_encode_plus(
[seq],
return_tensors="pt")["input_ids"][:, :-1]
model.eval()
if torch.cuda.is_available():
seqs = seqs.to("cuda")
model.to("cuda")
# Prediction
outputs = model.generate(
inputs=seqs,
num_return_sequences=1,
max_length=2048,
num_beams=2,
do_sample=True,
decoder_input_ids = None
)
# Convert to GSF
prediction = gffTokenizer.batch_decode(
outputs.detach().cpu().numpy(),
skip_special_tokens=True
)
print(prediction)
# Output: ['<s>301|CDS1|523|+|A>CDS1']
Training was performed with nine plant genomes, including:
Gene-containing genomic sequences were randomly padded with neighboring sequence to produce input sequence lengths that were multiples of 6,144nt less than 49,152nt. Training was performed with the following parameters:
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]