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 (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:

  1. Feature extraction using sliding windows;
  2. Construction of the training feature matrix;
  3. Model training using cross-validation;
  4. 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

bitser-0.3.96.tar.gz (104.6 kB view details)

Uploaded Source

Built Distribution

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

bitser-0.3.96-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (486.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for bitser-0.3.96.tar.gz
Algorithm Hash digest
SHA256 e997516a212907f0b69f02eb75aab23570fa10343b10ce3697e81faa6210d05d
MD5 7ff2fc0948ca656b411c3c02984c119c
BLAKE2b-256 b54ec33b15acca84fa1be6a22eba6750eff9218e713d513e21b188329ea8ee50

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitser-0.3.96.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.3.96-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bitser-0.3.96-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1eb716311c0a992009abf44c78ce0891c9bfaafe0d3bc1683dc150f4879eedfd
MD5 f9abce33db67856370e811ac0cda3455
BLAKE2b-256 c080c4cf9b3dcda5e508c3ce47a7d2b121016087cc6981a445a1872449af81e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitser-0.3.96-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_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