This guide details the steps necessary for setting up the environment, training, and using the TnpB model for both training and inference.
We recommend using Conda to manage your Python environments. Follow these steps to set up a dedicated environment for this project:
- Create the Environment:
conda create --name Tnpb conda activate Tnpb conda install -c anaconda python=3.6 pip install -r requirements.txt
To train the TnpB model, follow these steps:
- Data Preparation
- Run
data_preprocess.ipynb
to process the data and save it in the/data/processed
directory.
- Run
- Model Training and Evaluation
- Execute
models_trainvaltest.ipynb
ormodels_trainvaltest.py
to train and evaluate the models. - Supported models include:
FFN
,RNN
,CNN
,Transformer
. - Trained models are saved in the
/output
directory.
- Execute
- Inference
- Use
models_inference.ipynb
ormodels_inference.py
for running inference with trained models.
- Use
- Sample Testing
- Execute
user_sample_inference.ipynb
to test the model on your data. Example test file:data/Endogenous_spacers_TnpB_list.csv
. - Predictions are saved in the
/output
directory.
- Execute
For running model inference:
- Setup
- Ensure the environment is set up using
requirements.txt
. - Place your Excel data file containing target sequences at
./data/Endogenous_spacers_TnpB_list.csv
.
- Ensure the environment is set up using
- Model Download
- Download the trained model from this Dropbox link and add it to the
/output
directory.
- Download the trained model from this Dropbox link and add it to the
- Run Inference
- Run
user_sample_inference.ipynb
to test your sample data. Predicted outputs are stored in the/output
directory. - You can also directly run
python user_sample_inference.py -data_name 'Endogenous_spacers_TnpB_list.csv'
- Run
- Access our web-based interface at tnpb.app to use the model directly without installing or running any Python code.
- By downloading or using the code, you are consenting to be and agree to be bound by all of the terms of this limited license described in license.txt file.