Pure-Python port of the R/CRAN package tigger — novel immunoglobulin V-allele discovery and subject-specific V genotype inference from AIRR-Seq / Rep-Seq data.
Project description
pytigger
Pure-Python port of the R/CRAN package tigger
— Tools for Immunoglobulin Genotype Elucidation via Rep-seq.
tigger is part of the Immcantation
framework (Kleinstein Lab, Yale). It discovers novel immunoglobulin V
alleles from adaptive immune receptor repertoire sequencing data
(AIRR-Seq / Rep-Seq), infers a subject's V genotype, and corrects
V-allele calls accordingly.
pytigger is a faithful, dependency-light re-implementation of tigger
1.1.3 in pure Python (numpy / scipy / pandas / matplotlib,
no rpy2). Numerical parity with the R package is the design priority:
on the bundled example data the novel-allele table, genotype membership and
reassigned calls match R exactly, and the Bayesian likelihood numbers
agree to a relative difference below 1e-13.
Installation
pip install pytigger
From source:
git clone https://github.com/omicverse/py-tigger
cd py-tigger
pip install -e .
The TIgGER trifecta
import pytigger as tg
# Bundled example data (the datasets shipped with R tigger)
data = tg.load_airrdb() # 17,559 AIRR-seq sequences
germ = tg.load_sample_germline_ighv() # 344 IGHV germline alleles
# 1. Discover novel V alleles
novel = tg.find_novel_alleles(data, germ)
tg.select_novel(novel)[["germline_call", "polymorphism_call", "note"]]
# germline_call polymorphism_call note
# IGHV1-8*02 IGHV1-8*02_G234T Novel allele found!
# 2. Infer the subject's V genotype
geno = tg.infer_genotype(data, germline_db=germ, novel=novel,
find_unmutated=True)
# ... or the full Bayesian model
geno_b = tg.infer_genotype_bayesian(data, germline_db=germ, novel=novel)
# 3. Correct the V-call assignments
gdb = tg.genotype_fasta(geno, germ, novel)
out = tg.reassign_alleles(data, gdb) # adds 'v_call_genotyped'
# Evidence table for the inferred novel alleles
ev = tg.generate_evidence(out, novel, geno, gdb, germ)
Visualisation
fig1 = tg.plot_novel(data, tg.select_novel(novel).iloc[[0]]) # evidence plot
fig2 = tg.plot_genotype(tg.load_sample_genotype()) # genotype grid
API
The trifecta + core
| function | R equivalent |
|---|---|
find_novel_alleles |
findNovelAlleles |
select_novel |
selectNovel |
infer_genotype |
inferGenotype |
infer_genotype_bayesian |
inferGenotypeBayesian |
reassign_alleles |
reassignAlleles |
genotype_fasta |
genotypeFasta |
generate_evidence |
generateEvidence |
get_popular_mutation_count |
getPopularMutationCount |
Sequence / IO utilities
read_ig_fasta, write_fasta, clean_seqs, update_allele_names,
sort_alleles, get_mutated_positions, get_mut_count,
find_unmutated_calls, insert_polymorphisms, super_substring.
Segment parsing (alakazam port)
get_gene, get_allele, get_family, translate_dna.
Plotting
plot_novel, plot_genotype.
Built-in data
load_airrdb, load_sample_germline_ighv, load_sample_novel,
load_sample_genotype.
R-parity
pytigger is validated against tigger 1.1.3 (installed alongside
alakazam 1.4.3). Running the trifecta on the bundled AIRRDb /
SampleGermlineIGHV example data:
find_novel_alleles— all 30 output columns match R for all 12 rows; the single novel alleleIGHV1-8*02_G234Tis detected identically.infer_genotype— gene/allele/count membership and the "Cannot distinguish" notes match R exactly.infer_genotype_bayesian— discrete genotype matches R; thekh,kd,kt,kq,k_difflog-likelihoods agree to rel-diff< 1e-13.reassign_alleles— thev_call_genotypedcolumn matches R on 100% of 17,559 sequences.generate_evidence— the evidence metrics match R exactly.
See tests/test_r_parity.py (skipped automatically when no R is available).
Citation
If you use pytigger, please cite the original tigger papers:
Gadala-Maria D, Yaari G, Uduman M, Kleinstein SH (2015). Automated analysis of high-throughput B-cell sequencing data reveals a high frequency of novel immunoglobulin V gene segment alleles. PNAS 112(8):E862-70.
Gadala-Maria D, Gidoni M, Marquez S, et al. (2019). Identification of Subject-Specific Immunoglobulin Alleles from Expressed Repertoire Sequencing Data. Front. Immunol. 10:129.
License
AGPL-3, retained from the original tigger package. See LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytigger-0.1.0.tar.gz.
File metadata
- Download URL: pytigger-0.1.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c041d7d0dddf6bbff829e794c7ff6ddcd728eb0e04e4f31d6dad1705415fbc5
|
|
| MD5 |
3fd53a430295becbc5b24335603ddd83
|
|
| BLAKE2b-256 |
fd0b572a85a4b2b4793ba364104d3ff7f87797862f399c8d1f2474ecbc000d29
|
Provenance
The following attestation bundles were made for pytigger-0.1.0.tar.gz:
Publisher:
publish.yml on omicverse/py-tigger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytigger-0.1.0.tar.gz -
Subject digest:
8c041d7d0dddf6bbff829e794c7ff6ddcd728eb0e04e4f31d6dad1705415fbc5 - Sigstore transparency entry: 1591004338
- Sigstore integration time:
-
Permalink:
omicverse/py-tigger@f63b58ba92a15f8a3e368cf4a2dff9e65c476668 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/omicverse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f63b58ba92a15f8a3e368cf4a2dff9e65c476668 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pytigger-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytigger-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5570c5a0d0b8c4d6c0d3fdb3a5d3fed7e8a1b2e9da200cd5ebbdf6e72033df90
|
|
| MD5 |
6a7ba776311abd6d2cb3e3adbf9c387a
|
|
| BLAKE2b-256 |
06286fd20f4a09e7f4ed0ab85754b4ffd64382d1f53d9a2a40720d4570761948
|
Provenance
The following attestation bundles were made for pytigger-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on omicverse/py-tigger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytigger-0.1.0-py3-none-any.whl -
Subject digest:
5570c5a0d0b8c4d6c0d3fdb3a5d3fed7e8a1b2e9da200cd5ebbdf6e72033df90 - Sigstore transparency entry: 1591004343
- Sigstore integration time:
-
Permalink:
omicverse/py-tigger@f63b58ba92a15f8a3e368cf4a2dff9e65c476668 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/omicverse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f63b58ba92a15f8a3e368cf4a2dff9e65c476668 -
Trigger Event:
workflow_dispatch
-
Statement type: