Binary Pattern Sequence Recognition for biological sequences
Project description
BITSER
BInary paTtern SequencE Recognition
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 of 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 follows a three-step workflow:
metadata→ generatemetadata.tsvwith train/test splittrain→ extract features from train split and train modelpredict→ evaluate model on test split and generate reports
| COMMAND | FUNCTION |
|---|---|
metadata |
Parse FASTA headers and create metadata.tsv with train/test splits |
train |
Extract features from training split and train classification model |
predict |
Load trained model, evaluate on test split, and generate reports |
metadata command
Generates metadata.tsv by parsing FASTA headers and splitting data into train/test sets.
The dataset directory must contain a sequences/ subfolder with FASTA files.
Parameters
| Parameter | Description | Required | Default |
|---|---|---|---|
--dataset, -d |
Dataset directory containing sequences/ |
✔ | |
--class-delim, -delim |
Delimiter used to extract class label from FASTA headers | ✔ | |
--train-count, -n |
Number of sequences per class used for training | ✔ | |
--class-which, -which |
Which occurrence of the delimiter to use (1 = first, -1 = last) | 1 |
|
--seed |
Random seed for reproducibility | 7 |
Output
metadata.tsvfile containing dataset splits
train command
Performs feature extraction and trains a classification model using the training split only.
Parameters
| Parameter | Description | Required | Default |
|---|---|---|---|
--input, -i |
Dataset directory containing metadata.tsv and sequences/ |
✔ | |
--output-dir, -dir |
Directory where outputs (model + logs) will be saved | ✔ | |
--output, -o |
Model filename (e.g., model.pkl) |
✔ | |
--classifier, -c |
Classifier: xgb, rf, svm, mlp, nb |
xgb |
|
--flank, -f |
Sliding window size for feature extraction | 8 |
|
--translate / --no-translate |
Translate nucleotide sequences to proteins | False |
|
--splits, -s |
Number of cross-validation folds | 10 |
|
--repeats, -r |
Number of cross-validation repetitions | 10 |
|
--seed |
Random seed for reproducibility | 7 |
Output
- Trained model (
.pkl) saved inside--output-dir - Training logs and evaluation results saved to
--output-dir
predict command
Loads a trained model and evaluates it on the test split, generating predictions and reports.
Parameters
| Parameter | Description | Required | Default |
|---|---|---|---|
--model, -m |
Path to trained model file | ✔ | |
--output-dir, -dir |
Directory where prediction outputs will be saved | ✔ | |
--data, -d |
Dataset directory containing metadata.tsv and sequences/ |
✔ | |
--flank, -f |
Sliding window size (must match training) | 8 |
|
--translate / --no-translate |
Must match training configuration | False |
Output
- Classification results
- Per-class performance metrics
- Confusion matrix (if applicable)
- Prediction report (CSV) saved to
--output-dir
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.5.21.tar.gz.
File metadata
- Download URL: bitser-0.5.21.tar.gz
- Upload date:
- Size: 111.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6363566af33ae13783d8f2ebdc4f1dd773eb3fad480018628241a78f2191cac9
|
|
| MD5 |
a963406750f0f734eed6e2dbf951788a
|
|
| BLAKE2b-256 |
97e6089a9c63708f52fa14ed59c6af6cf3befdb9db4740ec8e560d803e2ff19b
|
Provenance
The following attestation bundles were made for bitser-0.5.21.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.5.21.tar.gz -
Subject digest:
6363566af33ae13783d8f2ebdc4f1dd773eb3fad480018628241a78f2191cac9 - Sigstore transparency entry: 1839198353
- Sigstore integration time:
-
Permalink:
LCostaF/BITSER@717023168b005c12a6761556453f1fdb0dfe7fda -
Branch / Tag:
refs/tags/v0.5.21 - Owner: https://github.com/LCostaF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@717023168b005c12a6761556453f1fdb0dfe7fda -
Trigger Event:
push
-
Statement type:
File details
Details for the file bitser-0.5.21-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: bitser-0.5.21-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 162.0 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 |
755d9e619d032ba87a8a7af07ec14dde05e7af2fdb3a0b0ddeb71b878d0889bc
|
|
| MD5 |
d95512e69eadf2bdc58aed411d56f63b
|
|
| BLAKE2b-256 |
7e9834cbc5dcc2038686639450a21b7d11fcffa687a280f3492125c112de7cec
|
Provenance
The following attestation bundles were made for bitser-0.5.21-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.5.21-cp313-cp313-win_amd64.whl -
Subject digest:
755d9e619d032ba87a8a7af07ec14dde05e7af2fdb3a0b0ddeb71b878d0889bc - Sigstore transparency entry: 1839198384
- Sigstore integration time:
-
Permalink:
LCostaF/BITSER@717023168b005c12a6761556453f1fdb0dfe7fda -
Branch / Tag:
refs/tags/v0.5.21 - Owner: https://github.com/LCostaF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@717023168b005c12a6761556453f1fdb0dfe7fda -
Trigger Event:
push
-
Statement type:
File details
Details for the file bitser-0.5.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: bitser-0.5.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 475.9 kB
- Tags: CPython 3.13, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd94cff1963ddcd5f09959937ed6b93d0c1a4181645899abe68c115f57835ef8
|
|
| MD5 |
933ef0a82fdaaaa3a8fba79df1c78494
|
|
| BLAKE2b-256 |
350146b1cab539879ea023d5f58c15de27f2d13f198f812202859933dd5aceac
|
Provenance
The following attestation bundles were made for bitser-0.5.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_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.5.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
dd94cff1963ddcd5f09959937ed6b93d0c1a4181645899abe68c115f57835ef8 - Sigstore transparency entry: 1839198368
- Sigstore integration time:
-
Permalink:
LCostaF/BITSER@717023168b005c12a6761556453f1fdb0dfe7fda -
Branch / Tag:
refs/tags/v0.5.21 - Owner: https://github.com/LCostaF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@717023168b005c12a6761556453f1fdb0dfe7fda -
Trigger Event:
push
-
Statement type: