Binary Pattern Sequence Recognition for biological sequences
Project description
Overview
BITSER (Binary Pattern Sequence Recognition) is a software tool built with the Python language that extracts features segments of each genetic sequence at a local level.
The method for feature extraction utilizes the concept of Local Binary Pattern (LBP), as well as adapted versions of the Texture Unit and Texture Unit Number from the field of computer vision, to obtain informative features from sequences organized in FASTA files.
A k-mer window (default size 9) slides over each genetic sequence, comparing the leftmost nucleotide or aminoacid in the window with the 8 other members.
This tool is targeted for usage by biologists, researchers and other professionals in the field of bioinformatics.
Installation
pip install bitser
After the installation, run bitser --help to see all the available commands.
CLI commands
BITSER offers the following commands:
| COMMAND | FUNCTION |
|---|---|
metadata |
Parse FASTA headers and create metadata.tsv with train/test splits |
train |
Extract features and train a classification model |
predict |
Load a trained model and predict classes on new sequences |
metadata command
This command must be run on your training dataset directory.
The dataset directory must contain a sequences/ subfolder with the FASTA files.
The command scans all .fasta files in the sequences/ subfolder, parses headers to extract class labels, and creates a metadata.tsv file, which is used for the train and predict commands.
Example structure:
dataset/
├── sequences/
│ ├── class_a.fasta
│ └── class_b.fasta
After executing the command:
dataset/
├── sequences/
│ ├── class_a.fasta
│ └── class_b.fasta
└──metadata.tsv
train command
This command initiates the feature extraction and model training workflow.
Training performs the following steps:
- Feature extraction using sliding windows;
- Construction of the training feature matrix;
- Model training using cross-validation;
- Saving the trained model.
Parameters
| Parameter | Description | Required | Default |
|---|---|---|---|
--input, -i |
Path to the dataset directory containing metadata.tsv and sequences/ |
✔ | |
--output, -o |
Path to save the trained model | model.pkl |
|
--classifier, -c |
Classifier algorithm | xgb |
|
--flank, -f |
Number of neighbors compared to the reference character in the sliding window | 8 |
|
--translate / --no-translate |
Translate nucleotide sequences to proteins before feature extraction | False |
|
--splits, -s |
Number of folds used for cross-validation | 10 |
|
--repeats, -r |
Number of cross-validation repetitions | 10 |
|
--seed |
Random seed for reproducibility | 7 |
Output
- Trained model file (
.pkl); - Training evaluation results stored in the
results/directory.
predict command
Uses a trained model to classify sequences from a testing dataset.
Feature extraction settings must match those used during training.
Parameters
| Parameter | Description | Required | Default |
|---|---|---|---|
--model, -m |
Path to the trained model file | ✔ | |
--data, -d |
Dataset directory containing metadata.tsv and sequences/ |
✔ | |
--flank, -f |
Number of neighbors compared to the reference character in the sliding window, must match value used during training | 8 |
|
--translate / --no-translate |
Must match the translation setting used during training | False |
Output
The prediction step generates:
- Classification results;
- Per-class performance metrics;
- Feature importance;
- Prediction report (CSV).
Acknowledgements
- This study was supported by national funds through the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES) - Finance Code 001, Fundação Araucária (Grant number 035/2019, 138/2021 and NAPI - Bioinformática), CNPq 440412/2022-6 and 408312/2023-8.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bitser-0.4.0.tar.gz.
File metadata
- Download URL: bitser-0.4.0.tar.gz
- Upload date:
- Size: 106.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56f71fa8d1d9d224ded353372685e6453f0802eb2030b06942f38e3510762d76
|
|
| MD5 |
d1a1cab7f21a52c49c5a1ad67cdb5380
|
|
| BLAKE2b-256 |
acfe6bf84b6b98ad90b74a172ca71c808cdfae26a00144f0957f796d5c3449d2
|
Provenance
The following attestation bundles were made for bitser-0.4.0.tar.gz:
Publisher:
publish.yml on LCostaF/BITSER
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bitser-0.4.0.tar.gz -
Subject digest:
56f71fa8d1d9d224ded353372685e6453f0802eb2030b06942f38e3510762d76 - Sigstore transparency entry: 1256115629
- Sigstore integration time:
-
Permalink:
LCostaF/BITSER@8a199e9ffcb325f4cff2ba8fcfccfba5f365e9d2 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/LCostaF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a199e9ffcb325f4cff2ba8fcfccfba5f365e9d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bitser-0.4.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: bitser-0.4.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 156.2 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77e654b16f33a1c0a9e437954f0be75057e5449b1caa547d323d57c2c4cb5cf4
|
|
| MD5 |
d446e40883210cee7336e241260f3d7e
|
|
| BLAKE2b-256 |
2b33a0ece12c503e44f5ab28c864c8a22ae97ff43cd63ccf95275378a045c9e5
|
Provenance
The following attestation bundles were made for bitser-0.4.0-cp313-cp313-win_amd64.whl:
Publisher:
publish.yml on LCostaF/BITSER
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bitser-0.4.0-cp313-cp313-win_amd64.whl -
Subject digest:
77e654b16f33a1c0a9e437954f0be75057e5449b1caa547d323d57c2c4cb5cf4 - Sigstore transparency entry: 1256115724
- Sigstore integration time:
-
Permalink:
LCostaF/BITSER@8a199e9ffcb325f4cff2ba8fcfccfba5f365e9d2 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/LCostaF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a199e9ffcb325f4cff2ba8fcfccfba5f365e9d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bitser-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: bitser-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 488.2 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9841737f0d4c8c0198b7dc88069a4fb4a5cebf8e0d11c0fa9fb4f7c87e09e991
|
|
| MD5 |
cabbf2e3b4b1fcf911bcd3fbd9bb160c
|
|
| BLAKE2b-256 |
cdca0b4c9c2cfdbb827d31b15fa597f3dba3df20d7d6b8ca9d871e0d33541099
|
Provenance
The following attestation bundles were made for bitser-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on LCostaF/BITSER
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bitser-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
9841737f0d4c8c0198b7dc88069a4fb4a5cebf8e0d11c0fa9fb4f7c87e09e991 - Sigstore transparency entry: 1256115851
- Sigstore integration time:
-
Permalink:
LCostaF/BITSER@8a199e9ffcb325f4cff2ba8fcfccfba5f365e9d2 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/LCostaF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a199e9ffcb325f4cff2ba8fcfccfba5f365e9d2 -
Trigger Event:
push
-
Statement type: