Downloads · 30 days
49
0% of all-time downloads
Genereux-akotenou/BacteriaTIS-DNABERT-K6-89M
BacteriaTIS-DNABERT-K6-89M is a text classification model from Genereux-akotenou. Use it when you need a label for a piece of text. It is set up for transformers.
This model, BacteriaTIS-DNABERT-K6-89M, is a DNA sequence classifier based on DNABERT trained for Translation Initiation Site (TIS) classification in bacterial genomes. It operates on 6-mer tokenized sequences derived…
Downloads · 30 days
49
0% of all-time downloads
All-time downloads
18.3K
Public
Repo size
1.4 GB
Likes
1
Public
Click a slice to open those files.
.pt714 MB · 67%
From the Hugging Face model README
This model, BacteriaTIS-DNABERT-K6-89M, is a DNA sequence classifier based on DNABERT trained for Translation Initiation Site (TIS) classification in bacterial genomes. It operates on 6-mer tokenized sequences derived from a 60 bp window (30 bp upstream + 30 bp downstream) around the TIS. The model was fine-tuned using 89M trainable parameters.
Ensure you have transformers and torch installed:
pip install torch transformers
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
# Load Model
model_checkpoint = "Genereux-akotenou/BacteriaTIS-DNABERT-K6-89M"
model = AutoModelForSequenceClassification.from_pretrained(model_checkpoint)
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
To classify a TIS, extract a 60 bp sequence window (30 bp upstream + 30 bp downstream) of the TIS codon site and convert it to 6-mers:
def generate_kmer(sequence: str, k: int, overlap: int = 1):
"""Generate k-mer encoding from DNA sequence."""
return " ".join([sequence[j:j+k] for j in range(0, len(sequence) - k + 1, overlap)])
# Example TIS-centered sequence (60 bp window)
sequence = "AGAACCAGCCGGAGACCTCCTGCTCGTACATGAAAGGCTCGAGCAGCCGGGCGAGGGCGG"
seq_kmer = generate_kmer(sequence, k=6)
# Tokenize input
inputs = tokenizer(
seq_kmer,
return_tensors="pt",
max_length=tokenizer.model_max_length,
padding="max_length",
truncation=True
)
# Run inference
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=-1).item()
<!-- ### **Citation**
If you use this model in your research, please cite:
```tex
@article{paper title,
title={DNABERT for Bacterial Translation Initiation Site Classification},
author={Genereux Akotenou, et al.},
journal={Hugging Face Model Hub},
year={2024}
}
``` -->