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.5.21.tar.gz (111.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.5.21-cp313-cp313-win_amd64.whl (162.0 kB view details)

Uploaded CPython 3.13Windows x86-64

bitser-0.5.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (475.9 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.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

Hashes for bitser-0.5.21.tar.gz
Algorithm Hash digest
SHA256 6363566af33ae13783d8f2ebdc4f1dd773eb3fad480018628241a78f2191cac9
MD5 a963406750f0f734eed6e2dbf951788a
BLAKE2b-256 97e6089a9c63708f52fa14ed59c6af6cf3befdb9db4740ec8e560d803e2ff19b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitser-0.5.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.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

Hashes for bitser-0.5.21-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 755d9e619d032ba87a8a7af07ec14dde05e7af2fdb3a0b0ddeb71b878d0889bc
MD5 d95512e69eadf2bdc58aed411d56f63b
BLAKE2b-256 7e9834cbc5dcc2038686639450a21b7d11fcffa687a280f3492125c112de7cec

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitser-0.5.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.5.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bitser-0.5.21-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dd94cff1963ddcd5f09959937ed6b93d0c1a4181645899abe68c115f57835ef8
MD5 933ef0a82fdaaaa3a8fba79df1c78494
BLAKE2b-256 350146b1cab539879ea023d5f58c15de27f2d13f198f812202859933dd5aceac

See more details on using hashes here.

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

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