Fast generation of TCR/BCR sequences with olga
Project description
olha
A package to generate TCR/BCR sequences fast, based on olga. Use the same syntax as olga but is up to 20x faster and can optionally generate non-functional sequences and include point-mutation "sequencing" errors. It also allows for selection of specific V/J pairs for generation.
Written in C++, interface with python3 via pybind11.
Installation
pip install olha
Example
import olga
import olga.sequence_generation
import olga.load_model
import olha
## olga model loading
params_file_name = f'{olga.__path__[0]}/default_models/human_T_beta/model_params.txt'
marginals_file_name = f'{olga.__path__[0]}/default_models/human_T_beta/model_marginals.txt'
V_anchor_pos_file =f'{olga.__path__[0]}/default_models/human_T_beta/V_gene_CDR3_anchors.csv'
J_anchor_pos_file = f'{olga.__path__[0]}/default_models/human_T_beta/J_gene_CDR3_anchors.csv'
genomic_data = olga.load_model.GenomicDataVDJ()
genomic_data.load_igor_genomic_data(params_file_name, V_anchor_pos_file, J_anchor_pos_file)
generative_model = olga.load_model.GenerativeModelVDJ()
generative_model.load_and_process_igor_model(marginals_file_name)
# sequence generation
olha_gen = olha.SequenceGeneration(genomic_data, generative_model, error_rate=0.1)
olha_gen.gen_rnd_prod_CDR3()
# ('TGCGCCAGCAGCTCCATGGACGGCTCCGAAAAACTGTTTTTT', 'CASSSMDGSEKLFF', 49, 3)
Comparison
import timeit
olha_gen = olha.SequenceGeneration(genomic_data, generative_model, error_rate=0.1)
olga_gen = olga.sequence_generation.SequenceGenerationVDJ(generative_model, genomic_data)
timeit.timeit(olha_gen.gen_rnd_prod_CDR3) # 3.31 μs
timeit.timeit(olga_gen.gen_rnd_prod_CDR3) # 103 μs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
olha-0.0.8.tar.gz
(14.5 kB
view details)
File details
Details for the file olha-0.0.8.tar.gz.
File metadata
- Download URL: olha-0.0.8.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.50.2 importlib-metadata/4.11.3 keyring/21.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df24453629b2ef43fe04ef2477c0d8e1ac1ecb8cf8b74a9b88d267f7982806b6
|
|
| MD5 |
9e56c0ee8c6496be0e65c91e668f8cce
|
|
| BLAKE2b-256 |
99480d3801380138369e40940774492a6fe1442b30faf5ebf5bc79649ff01ca2
|