neuralbioinfo/prokbert-mini-phage

Model

ProkBERT-mini-phage Model

1

8 commits

1 linked in READMEs

updated Jan 9, 2025

See the code

README

ProkBERT-mini-phage Model

This finetuned model is specifically designed for promoter identification and is based on the ProkBERT-mini model.

For more details, refer to the phage dataset description used for training and evaluating this model.

Example Usage

For practical examples on how to use this model, see the following Jupyter notebooks:

  • Training Notebook: A guide to fine-tuning the ProkBERT-mini model for promoter identification tasks.
  • Evaluation Notebook: Demonstrates how to evaluate the finetuned ProkBERT-mini-promoter model on test datasets.

Model Application

The model was trained for binary classification to distinguish between pahge and non-phage (bacteria) sequences. The non-phage sequences were sampled form the phage's host genome randomly.

Simple Usage Example

The following example demonstrates how to use the ProkBERT-mini-promoter model for processing a DNA sequence:

from prokbert.prokbert_tokenizer import ProkBERTTokenizer
from transformers import MegatronBertForSequenceClassification
finetuned_model = "neuralbioinfo/prokbert-mini-phage"
kmer = 6
shift= 1

tok_params = {'kmer' : kmer,
             'shift' : shift}
tokenizer = ProkBERTTokenizer(tokenization_params=tok_params)
model = MegatronBertForSequenceClassification.from_pretrained(finetuned_model)
sequence = 'CACCGCATGGAGATCGGCACCTACTTCGACAAGCTGGAGGCGCTGCTGAAGGAGTGGTACGAGGCGCGCGGGGGTGAGGCATGACGGACTGGCAAGAGGAGCAGCGTCAGCGC'
inputs = tokenizer(sequence, return_tensors="pt")
# Ensure that inputs have a batch dimension
inputs = {key: value.unsqueeze(0) for key, value in inputs.items()}
# Generate outputs from the model
outputs = model(**inputs)
print(outputs)

Model Details

Developed by: Neural Bioinformatics Research Group

Architecture:

... Tokenizer: The model uses a 6-mer tokenizer with a shift of 1 (k6s1), specifically designed to handle DNA sequences efficiently.

Parameters:

ParameterDescription
Model Size20.6 million parameters
Max. Context Size1024 bp
Training Data206.65 billion nucleotides
Layers6
Attention Heads6

Intended Use

Intended Use Cases: ProkBERT-mini-phage is intended for bioinformatics researchers and practitioners focusing on genomic sequence analysis, including:

  • sequence classification tasks
  • Exploration of genomic patterns and features

Installation of ProkBERT (if needed)

For setting up ProkBERT in your environment, you can install it using the following command (if not already installed):

try:
    import prokbert
    print("ProkBERT is already installed.")
except ImportError:
    !pip install prokbert
    print("Installed ProkBERT.")

Evaluation on phage recognition benchmark dataset

methodLauc_class1accf1mccrecallsensitivityspecificitytnfpfntpNpNneval_time
DeepVirFinder2560.7349140.6271630.4812130.3090490.3453170.3453170.909856454245032781729500749927580
DeepVirFinder5120.7914230.7080.6377170.4430650.5211920.5211920.889722451055923612570493150692637
DeepVirFinder10240.8262550.74240.7026780.5053330.6056510.6056510.880579438059419823044502649741294
DeepVirFinder20480.8530980.77170.7433390.5571770.66120.66120.8822441158916943306500050001351
INHERIT2560.759820.69430.670120.3931790.6200080.6200080.768833838115419033105500849922131
INHERIT5120.8163260.72280.6514080.4793230.5252480.5252480.914973463843123412590493150692920
INHERIT10240.8465470.72640.6594470.4959350.5270590.5270590.927825461535923772649502649743055
INHERIT20480.8641220.73650.6685950.5185410.53160.53160.9414470729323422658500050003225
MINI2560.8467450.77550.7664620.5528550.7356230.7356230.815505407192113243684500849926.68888
MINI5120.9249730.86570.8591210.7326960.830460.830460.89998456250783640954931506916.3681
MINI10240.9564320.91380.9111890.8296450.8798250.8798250.94813471625860444225026497451.3319
MINI-C2560.8276350.75120.72070.515380.6409740.6409740.861779430269017983210500849927.33697
MINI-C5120.9133780.84660.8348760.697250.7864530.7864530.9051094588481105338784931506917.6749
MINI-C10240.946440.89370.8915640.7884270.8694790.8694790.918175456740765643705026497454.204
MINI-LONG2560.7776970.714950.6862240.4377270.6224040.6224040.80779280651919378262341001699846.10304
MINI-LONG5120.8808310.814050.7980010.6328550.7448790.7448790.881338893512032516734698621013812.1307
MINI-LONG10240.94130.889250.8849170.7814650.8471950.8471950.93174592696791536851610052994830.5088
MINI-LONG20480.9645510.9290.9274550.858780.90770.90770.950395034979239077100001000094.404
Virsorter25120.6207820.62590.3949540.3648310.2476170.2476170.99388450383137101221493150692057
Virsorter210240.7198980.71780.6219190.510360.4617990.4617990.976478485711727052321502649743258
Virsorter220480.8161420.81030.7787240.6475320.66760.66760.953476523516623338500050005737

Column Descriptions

  • method: The algorithm or method used for prediction (e.g., DeepVirFinder, INHERIT).
  • L: Length of the genomic segment.
  • auc_class1: Area under the ROC curve for class 1, indicating the model's ability to distinguish between classes.
  • acc: Accuracy of the prediction, representing the proportion of true results (both true positives and true negatives) among the total number of cases examined.
  • f1: The F1 score, a measure of a test's accuracy that considers both the precision and the recall.
  • mcc: Matthews correlation coefficient, a quality measure for binary (two-class) classifications.
  • recall: The recall, or true positive rate, measures the proportion of actual positives that are correctly identified.
  • sensitivity: Sensitivity or true positive rate; identical to recall.
  • specificity: The specificity, or true negative rate, measures the proportion of actual negatives that are correctly identified.
  • fp: The number of false positives, indicating how many negative class samples were incorrectly identified as positive.
  • tp: The number of true positives, indicating how many positive class samples were correctly identified.
  • eval_time: The time taken to evaluate the model or method, usually in seconds.

Ethical Considerations and Limitations

Testing and evaluation have been conducted within specific genomic contexts, and the model's outputs in other scenarios are not guaranteed. Users should exercise caution and perform additional testing as necessary for their specific use cases.

Reporting Issues

Please report any issues with the model or its outputs to the Neural Bioinformatics Research Group through the following means:

Reference

If you use ProkBERT in your research, please cite the following paper:

@ARTICLE{10.3389/fmicb.2023.1331233,
    AUTHOR={Ligeti, Balázs and Szepesi-Nagy, István and Bodnár, Babett and Ligeti-Nagy, Noémi and Juhász, János},
    TITLE={ProkBERT family: genomic language models for microbiome applications},
    JOURNAL={Frontiers in Microbiology},
    VOLUME={14},
    YEAR={2024},
    URL={https://www.frontiersin.org/articles/10.3389/fmicb.2023.1331233},
    DOI={10.3389/fmicb.2023.1331233},
    ISSN={1664-302X},
    ABSTRACT={...}
}
bioinformatics
dna-sequence
endpoints_compatible
genomic language models
genomics
megatron-bert
nucleotide
phage
prokbert
promoter-prediction
pytorch
sequence embedding
text-classification
transformers

neuralbioinfo/prokbert-mini-phage

Model

ProkBERT-mini-phage Model

1

8 commits

1 linked in READMEs

updated Jan 9, 2025

See the code

README

ProkBERT-mini-phage Model

This finetuned model is specifically designed for promoter identification and is based on the ProkBERT-mini model.

For more details, refer to the phage dataset description used for training and evaluating this model.

Example Usage

For practical examples on how to use this model, see the following Jupyter notebooks:

  • Training Notebook: A guide to fine-tuning the ProkBERT-mini model for promoter identification tasks.
  • Evaluation Notebook: Demonstrates how to evaluate the finetuned ProkBERT-mini-promoter model on test datasets.

Model Application

The model was trained for binary classification to distinguish between pahge and non-phage (bacteria) sequences. The non-phage sequences were sampled form the phage's host genome randomly.

Simple Usage Example

The following example demonstrates how to use the ProkBERT-mini-promoter model for processing a DNA sequence:

from prokbert.prokbert_tokenizer import ProkBERTTokenizer
from transformers import MegatronBertForSequenceClassification
finetuned_model = "neuralbioinfo/prokbert-mini-phage"
kmer = 6
shift= 1

tok_params = {'kmer' : kmer,
             'shift' : shift}
tokenizer = ProkBERTTokenizer(tokenization_params=tok_params)
model = MegatronBertForSequenceClassification.from_pretrained(finetuned_model)
sequence = 'CACCGCATGGAGATCGGCACCTACTTCGACAAGCTGGAGGCGCTGCTGAAGGAGTGGTACGAGGCGCGCGGGGGTGAGGCATGACGGACTGGCAAGAGGAGCAGCGTCAGCGC'
inputs = tokenizer(sequence, return_tensors="pt")
# Ensure that inputs have a batch dimension
inputs = {key: value.unsqueeze(0) for key, value in inputs.items()}
# Generate outputs from the model
outputs = model(**inputs)
print(outputs)

Model Details

Developed by: Neural Bioinformatics Research Group

Architecture:

... Tokenizer: The model uses a 6-mer tokenizer with a shift of 1 (k6s1), specifically designed to handle DNA sequences efficiently.

Parameters:

ParameterDescription
Model Size20.6 million parameters
Max. Context Size1024 bp
Training Data206.65 billion nucleotides
Layers6
Attention Heads6

Intended Use

Intended Use Cases: ProkBERT-mini-phage is intended for bioinformatics researchers and practitioners focusing on genomic sequence analysis, including:

  • sequence classification tasks
  • Exploration of genomic patterns and features

Installation of ProkBERT (if needed)

For setting up ProkBERT in your environment, you can install it using the following command (if not already installed):

try:
    import prokbert
    print("ProkBERT is already installed.")
except ImportError:
    !pip install prokbert
    print("Installed ProkBERT.")

Evaluation on phage recognition benchmark dataset

methodLauc_class1accf1mccrecallsensitivityspecificitytnfpfntpNpNneval_time
DeepVirFinder2560.7349140.6271630.4812130.3090490.3453170.3453170.909856454245032781729500749927580
DeepVirFinder5120.7914230.7080.6377170.4430650.5211920.5211920.889722451055923612570493150692637
DeepVirFinder10240.8262550.74240.7026780.5053330.6056510.6056510.880579438059419823044502649741294
DeepVirFinder20480.8530980.77170.7433390.5571770.66120.66120.8822441158916943306500050001351
INHERIT2560.759820.69430.670120.3931790.6200080.6200080.768833838115419033105500849922131
INHERIT5120.8163260.72280.6514080.4793230.5252480.5252480.914973463843123412590493150692920
INHERIT10240.8465470.72640.6594470.4959350.5270590.5270590.927825461535923772649502649743055
INHERIT20480.8641220.73650.6685950.5185410.53160.53160.9414470729323422658500050003225
MINI2560.8467450.77550.7664620.5528550.7356230.7356230.815505407192113243684500849926.68888
MINI5120.9249730.86570.8591210.7326960.830460.830460.89998456250783640954931506916.3681
MINI10240.9564320.91380.9111890.8296450.8798250.8798250.94813471625860444225026497451.3319
MINI-C2560.8276350.75120.72070.515380.6409740.6409740.861779430269017983210500849927.33697
MINI-C5120.9133780.84660.8348760.697250.7864530.7864530.9051094588481105338784931506917.6749
MINI-C10240.946440.89370.8915640.7884270.8694790.8694790.918175456740765643705026497454.204
MINI-LONG2560.7776970.714950.6862240.4377270.6224040.6224040.80779280651919378262341001699846.10304
MINI-LONG5120.8808310.814050.7980010.6328550.7448790.7448790.881338893512032516734698621013812.1307
MINI-LONG10240.94130.889250.8849170.7814650.8471950.8471950.93174592696791536851610052994830.5088
MINI-LONG20480.9645510.9290.9274550.858780.90770.90770.950395034979239077100001000094.404
Virsorter25120.6207820.62590.3949540.3648310.2476170.2476170.99388450383137101221493150692057
Virsorter210240.7198980.71780.6219190.510360.4617990.4617990.976478485711727052321502649743258
Virsorter220480.8161420.81030.7787240.6475320.66760.66760.953476523516623338500050005737

Column Descriptions

  • method: The algorithm or method used for prediction (e.g., DeepVirFinder, INHERIT).
  • L: Length of the genomic segment.
  • auc_class1: Area under the ROC curve for class 1, indicating the model's ability to distinguish between classes.
  • acc: Accuracy of the prediction, representing the proportion of true results (both true positives and true negatives) among the total number of cases examined.
  • f1: The F1 score, a measure of a test's accuracy that considers both the precision and the recall.
  • mcc: Matthews correlation coefficient, a quality measure for binary (two-class) classifications.
  • recall: The recall, or true positive rate, measures the proportion of actual positives that are correctly identified.
  • sensitivity: Sensitivity or true positive rate; identical to recall.
  • specificity: The specificity, or true negative rate, measures the proportion of actual negatives that are correctly identified.
  • fp: The number of false positives, indicating how many negative class samples were incorrectly identified as positive.
  • tp: The number of true positives, indicating how many positive class samples were correctly identified.
  • eval_time: The time taken to evaluate the model or method, usually in seconds.

Ethical Considerations and Limitations

Testing and evaluation have been conducted within specific genomic contexts, and the model's outputs in other scenarios are not guaranteed. Users should exercise caution and perform additional testing as necessary for their specific use cases.

Reporting Issues

Please report any issues with the model or its outputs to the Neural Bioinformatics Research Group through the following means:

Reference

If you use ProkBERT in your research, please cite the following paper:

@ARTICLE{10.3389/fmicb.2023.1331233,
    AUTHOR={Ligeti, Balázs and Szepesi-Nagy, István and Bodnár, Babett and Ligeti-Nagy, Noémi and Juhász, János},
    TITLE={ProkBERT family: genomic language models for microbiome applications},
    JOURNAL={Frontiers in Microbiology},
    VOLUME={14},
    YEAR={2024},
    URL={https://www.frontiersin.org/articles/10.3389/fmicb.2023.1331233},
    DOI={10.3389/fmicb.2023.1331233},
    ISSN={1664-302X},
    ABSTRACT={...}
}
bioinformatics
dna-sequence
endpoints_compatible
genomic language models
genomics
megatron-bert
nucleotide
phage
prokbert
promoter-prediction
pytorch
sequence embedding
text-classification
transformers