Bio Dataset Manager: easily encode biological sequences into tensors
Authors:
- Fabio Bove | fabio.bove.dr@gmail.com
- Eugenio Bertolini |
What is it?
Bio Data Manager is a Python project designed for managing and processing bio-sequence data, including DNA, proteins, and SMILES strings. This tool facilitates the encoding of these sequences into tensors, which can then be used for AI computations and complex model implementations.
Project Structure
bio_data_manager/: Contains core modules for bioinformatics sequence processing and management.bio_sequences/: Handles various operations related to biological sequences such as DNA and protein.
Installation
- Install it as a library
- Using
CPU:pip install bio-dataset-manager
- Using
CUDA:pip install bio-dataset-manager[cuda] -f https://download.pytorch.org/whl/torch_stable.html
- Using
Usage
Examples of the code can be found in the examples folder.
- import the modules
import torch
from bio_dataset_manager.bio_dataloader import BioDataloader
from bio_dataset_manager.bio_dataset import BioDataset
from bio_sequences.dna_sequence import DnaSequence
- create the dataset and dataloader
dataset = BioDataset(
dataset_folder="path/to/dataset",
sequences_limit=10,
randomize_choice=True,
pad_same_len=False,
window_size=1,
sequence_info=DnaSequence(),
sequences=None,
)
dataloader = BioDataloader(
dataset=dataset,
batch_size=5,
shuffle=True,
collate_fn=dataset.collate_fn,
split_ratio=0.5,
use_gpu=True if torch.cuda.is_available() else False
)
- training loop example
epochs = 5
for epoch in range(epochs):
with tqdm(total=len(dataloader.training_dataloader), desc=f"Epoch {epoch + 1}/{epochs}", unit="batch") as pbar:
for batch in dataloader.training_dataloader:
y_real, lengths = dataloader.process_batch(batch)
time.sleep(0.1)
pbar.update(1)
pbar.set_postfix(
loss_gen=f"0.0",
loss_dis=f"0.0"
)
pbar.refresh()
Contributing
Feel free to submit issues or pull requests if you'd like to contribute to this project.
License
Metadata
Release files for bio-dataset-manager 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bio_dataset_manager-0.1.4.tar.gz | 47.7 kB | Without provenance | Details for bio_dataset_manager-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bio_dataset_manager-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for bio_dataset_manager-0.1.4-py3-none-any.whl |
Total release size: 84.3 kB
Release files / bio_dataset_manager-0.1.4.tar.gz
| Download URL | bio_dataset_manager-0.1.4.tar.gz |
|---|---|
| Size | 47.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ba4a1dcc8627c7dfd15b87dcb31f1f4254564ca70e748959c6f9ebb3510e50e
|
|
BLAKE2b-256 checksum How to use checksums |
5d98489800ee38cd48c401eb3d0a8d7c25669b7d5308ff256fd7ba585c20fa04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / bio_dataset_manager-0.1.4-py3-none-any.whl
| Download URL | bio_dataset_manager-0.1.4-py3-none-any.whl |
|---|---|
| Size | 36.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
152e85a87926038b62baca0b7fcd8b9d902b0b39b13b9c5b11d84c7d79027cbd
|
|
BLAKE2b-256 checksum How to use checksums |
90c6f35905b28b243a9bb607e569b4d51b0fb9f0aa6c34e7af2302c608f6738c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for bio-dataset-manager 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.