Skip to main content

Binary Pattern Sequence Recognition for biological sequences

Project description

BITSER

BInary paTtern SequencE Recognition

image_info

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:

  1. metadata → generate metadata.tsv with train/test split
  2. train → extract features from train split and train model
  3. predict → 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.tsv file 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

bitser-0.4.21.tar.gz (105.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bitser-0.4.21-cp313-cp313-win_amd64.whl (156.2 kB view details)

Uploaded CPython 3.13Windows x86-64

bitser-0.4.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (469.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file bitser-0.4.21.tar.gz.

File metadata

  • Download URL: bitser-0.4.21.tar.gz
  • Upload date:
  • Size: 105.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bitser-0.4.21.tar.gz
Algorithm Hash digest
SHA256 df4fe1b42a85b7965baf87acfd8650de1883882d7923a37f781e75ac2a85d98d
MD5 8b75baf45cdc35a11250677515fd63fc
BLAKE2b-256 9ea2176606c99f36d68b273391188391aa697ff8a03ca1ba3682199e953cdc41

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitser-0.4.21.tar.gz:

Publisher: publish.yml on LCostaF/BITSER

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bitser-0.4.21-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: bitser-0.4.21-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

Hashes for bitser-0.4.21-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4ae277c0c944c10c92d31646ea77d4277156c3603992e00f07279dad8d98a77a
MD5 3e274ee84b3e6aee5f44d2e24d0be0ea
BLAKE2b-256 899f2facc440cfe71fdd3ae7544e5acd5c06d88106ae0c62be781b8246fb0491

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitser-0.4.21-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on LCostaF/BITSER

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bitser-0.4.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bitser-0.4.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c2a7faf6e0d62bf0251699196e4af4280c0ed4d270d21d44317f54644e38cbca
MD5 004c7ad35b558d691c320a57dd112435
BLAKE2b-256 dd0fd0f51367004501e8090cd88da91bcf0da78e14cb55935d64027a16aa7d53

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitser-0.4.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on LCostaF/BITSER

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page