| Title: | Inference Tool for Antibody Haplotype |
|---|---|
| Description: | Infers V-D-J haplotypes and gene deletions from AIRR-seq data for Ig and TR chains, based on J, D, or V genes as anchor, by adapting a Bayesian framework. It also calculates a Bayes factor, a number that indicates the certainty level of the inference, for each haplotyped gene. Citation: Gidoni, et al (2019) <doi:10.1038/s41467-019-08489-3>. Peres and Gidoni, et al (2019) <doi:10.1093/bioinformatics/btz481>. |
| Authors: | Ayelet Peres [aut, cre], Moriah Gidoni [aut], Gur Yaari [aut, cph] |
| Maintainer: | Ayelet Peres <[email protected]> |
| License: | CC BY-SA 4.0 |
| Version: | 0.4.0 |
| Built: | 2026-09-23 08:33:31 UTC |
| Source: | https://github.com/ayeletperes/rabhit |
.onAttach start message
.onAttach(libname, pkgname).onAttach(libname, pkgname)
libname |
defunct |
pkgname |
defunct |
invisible()
convertToASC converts IMGT-named V alleles to PIgLET Allele Similarity
Cluster (ASC) names and returns the pieces needed to run createFullHaplotype
on the clustered data. ASCs collapse near-identical and duplicated IGHV alleles
(for example IGHV1-69 / IGHV1-69D) that are otherwise difficult to
assign unambiguously, and provide a naming scheme compatible with OGRDB reference
sets. It is a thin wrapper around the piglet package.
convertToASC( clip_db, germline, chain = c("IGH", "IGK", "IGL", "TRB"), allele_cluster_table = NULL, v_call = "v_call", ... )convertToASC( clip_db, germline, chain = c("IGH", "IGK", "IGL", "TRB"), allele_cluster_table = NULL, v_call = "v_call", ... )
clip_db |
AIRR-seq repertoire |
germline |
named vector of IMGT-gapped germline sequences for the
V genes (e.g. |
chain |
the chain. One of |
allele_cluster_table |
optional precomputed ASC table (a |
v_call |
the column holding the V allele calls to convert. Default |
... |
further arguments passed to |
The returned objects feed directly into the standard workflow:
asc <- convertToASC(clip_db, HVGERM, chain = "IGH")
hap <- createFullHaplotype(asc$clip_db, toHap_col = "v_call",
hapBy_col = "j_call", hapBy = "IGHJ6",
toHap_GERM = asc$germline, chain = "IGH")
plotHaplotype(hap, genes_order = asc$genes_order)
Allele similarity clustering is applied to the V genes only; D and J calls are left unchanged.
a list with:
clip_db - the input data with v_call converted to ASC names.
germline - the ASC-named germline vector to pass as toHap_GERM.
genes_order - an ASC gene order (derived from the chromosomal order in
GENE.loc) to pass to the plotting functions.
allele_cluster_table - the ASC table that was used.
createFullHaplotype; the piglet package for the underlying
clustering (inferAlleleClusters, assignAlleleClusters, germlineASC).
## Not run: data(samples_db, HVGERM) clip_db <- samples_db[samples_db$subject == "I5", ] asc <- convertToASC(clip_db, HVGERM, chain = "IGH") hap <- createFullHaplotype(asc$clip_db, toHap_col = "v_call", hapBy_col = "j_call", hapBy = "IGHJ6", toHap_GERM = asc$germline, chain = "IGH") plotHaplotype(hap, genes_order = asc$genes_order) ## End(Not run)## Not run: data(samples_db, HVGERM) clip_db <- samples_db[samples_db$subject == "I5", ] asc <- convertToASC(clip_db, HVGERM, chain = "IGH") hap <- createFullHaplotype(asc$clip_db, toHap_col = "v_call", hapBy_col = "j_call", hapBy = "IGHJ6", toHap_GERM = asc$germline, chain = "IGH") plotHaplotype(hap, genes_order = asc$genes_order) ## End(Not run)
The createFullHaplotype functions infers haplotype based on an anchor gene.
createFullHaplotype( clip_db, toHap_col = c("v_call", "d_call"), hapBy_col = "j_call", hapBy = "IGHJ6", toHap_GERM = NULL, relative_freq_priors = TRUE, kThreshDel = 3, rmPseudo = TRUE, deleted_genes = c(), nonReliable_Vgenes = c(), min_minor_fraction = 0.3, single_gene = TRUE, chain = c("IGH", "IGK", "IGL", "TRB") )createFullHaplotype( clip_db, toHap_col = c("v_call", "d_call"), hapBy_col = "j_call", hapBy = "IGHJ6", toHap_GERM = NULL, relative_freq_priors = TRUE, kThreshDel = 3, rmPseudo = TRUE, deleted_genes = c(), nonReliable_Vgenes = c(), min_minor_fraction = 0.3, single_gene = TRUE, chain = c("IGH", "IGK", "IGL", "TRB") )
clip_db |
a |
toHap_col |
a vector of column names for which a haplotype should be inferred. Default is v_call and d_call |
hapBy_col |
column name of the anchor gene. Default is j_call |
hapBy |
a string of the anchor gene name. Default is IGHJ6. |
toHap_GERM |
a vector of named nucleotide germline sequences matching the allele calls in |
relative_freq_priors |
if TRUE, the priors for Bayesian inference are estimated from the relative frequencies in clip_db. Else, priors are set to |
kThreshDel |
the minimum lK (log10 of the Bayes factor) to call a deletion. Default is 3. |
rmPseudo |
if TRUE non-functional and pseudo genes are removed. Default is TRUE. |
deleted_genes |
double chromosome deletion summary table. A |
nonReliable_Vgenes |
a list of known non reliable gene assignments. A |
min_minor_fraction |
the minimum minor allele fraction to be used as an anchor gene. Default is 0.3 |
single_gene |
if to only consider genes from single assignment. If true then calls where genes appear with others are discarded. If false then the calls are seperated an counted for all genes that appeared. Default is True. |
chain |
the IG/TR chain: IGH,IGK,IGL,TRB. Default is IGH. |
Function accepts a data.frame in AIRR format (https://changeo.readthedocs.io/en/stable/standard.html) containing the following columns:
'subject': The subject name
'v_call': V allele call(s) (in an IMGT format)
'd_call': D allele call(s) (in an IMGT format, only for heavy chains)
'j_call': J allele call(s) (in an IMGT format)
A data.frame, in which each row is the haplotype inference summary of a gene from the column selected in toHap_col.
The output containes the following columns:
subject: the subject name.
gene: the gene name.
Anchor gene allele 1: the haplotype inference for chromosome one. The column name is the anchor gene with the first allele.
Anchor gene allele 2: the haplotype inference for chromosome two. The column name is the anchor gene with the second allele.
alleles: allele calls for the gene.
proirs_row: priors based on relative allele usage of the anchor gene.
proirs_col: priors based on relative allele usage of the inferred gene.
counts1: the appereance count on each chromosome of the first allele from alleles, the counts are seperated by a comma.
k1: the Bayesian factor value for the first allele (from alleles) inference.
counts2: the appereance count on each chromosome of the second allele from alleles, the counts are seperated by a comma.
k2: the Bayesian factor value for the second allele (from alleles) inference.
counts3: the appereance count on each chromosome of the third allele from alleles, the counts are seperated by a comma.
k3: the Bayesian factor value for the third allele (from alleles) inference.
counts4: the appereance count on each chromosome of the fourth allele from alleles, the counts are seperated by a comma.
k4: the Bayesian factor value for the fourth allele (from alleles) inference.
# Load example data and germlines data(samples_db, HVGERM, HDGERM) # Selecting a single individual clip_db = samples_db[samples_db$subject=='I5', ] # Infering haplotype haplo_db = createFullHaplotype(clip_db,toHap_col=c('v_call','d_call'), hapBy_col='j_call',hapBy='IGHJ6',toHap_GERM=c(HVGERM,HDGERM))# Load example data and germlines data(samples_db, HVGERM, HDGERM) # Selecting a single individual clip_db = samples_db[samples_db$subject=='I5', ] # Infering haplotype haplo_db = createFullHaplotype(clip_db,toHap_col=c('v_call','d_call'), hapBy_col='j_call',hapBy='IGHJ6',toHap_GERM=c(HVGERM,HDGERM))
createHaplotypeTable Haplotype of a specific gene
createHaplotypeTable( df, HapByPriors = c(0.5, 0.5), toHapByCol = TRUE, toHapPriors = c(0.5, 0.5) )createHaplotypeTable( df, HapByPriors = c(0.5, 0.5), toHapByCol = TRUE, toHapPriors = c(0.5, 0.5) )
df |
table of counts |
HapByPriors |
vector of frequencies of each of the anchor gene alleles |
toHapByCol |
logical, haplotype each chromosome separetly to imrove the aligner assignmnet |
toHapPriors |
vector of frequencies of the haplotyped gene alleles |
data frame with chromosomal associasions of alleles of a specific gene
The deletionHeatmap function generates a graphical output of the single chromosome deletions in multiple samples.
deletionHeatmap( hap_table, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), kThreshDel = 3, genes_order = NULL, html_output = FALSE )deletionHeatmap( hap_table, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), kThreshDel = 3, genes_order = NULL, html_output = FALSE )
hap_table |
haplotype summary table. See details. |
chain |
the IG chain: IGH,IGK,IGL. Default is IGH. |
kThreshDel |
the minimum lK (log10 of the Bayes factor) used in |
genes_order |
A vector of the genes by the desired order. Default is by GENE.loc |
html_output |
If TRUE, a html5 interactive graph is outputed insteaed of the normal plot. Default is FALSE |
A data.frame created by createFullHaplotype.
A single chromosome deletion visualization.
# Plotting single choromosme deletion from haplotype inference deletionHeatmap(samplesHaplotype)# Plotting single choromosme deletion from haplotype inference deletionHeatmap(samplesHaplotype)
The deletionsByBinom function inferes double chromosome deletion events by relative gene usage.
deletionsByBinom( clip_db, chain = c("IGH", "IGK", "IGL"), nonReliable_Vgenes = c(), genes_order = NULL )deletionsByBinom( clip_db, chain = c("IGH", "IGK", "IGL"), nonReliable_Vgenes = c(), genes_order = NULL )
clip_db |
a |
chain |
the IG/TR chain: IGH,IGK,IGL,TRB. Default is IGH. |
nonReliable_Vgenes |
a list of known non reliable gene assignments. A |
genes_order |
A vector of the genes by the desired order. Default is by GENE.loc |
The function accepts a data.frame in AIRR format (https://changeo.readthedocs.io/en/stable/standard.html) containing the following columns:
'subject': The subject name
'v_call': V allele call(s) (in an IMGT format)
'd_call': D allele call(s) (in an IMGT format, only for heavy chains)
'j_call': J allele call(s) (in an IMGT format)
A data.frame, in which each row is the double chomosome deletion inference of a gene.
The output containes the following columns:
subject: the subject name.
gene: the gene call
frac: the relative gene usage of the gene
cutoff: the the cutoff of for the binomial test
pval: the p-value of the binomial test
deletion: if a double chromosome deletion event of a gene occured.
# Load example data and germlines data(samples_db) # Selecting a single individual clip_db = samples_db[samples_db$subject=='I5', ] # Infering haplotype del_binom_df = deletionsByBinom(clip_db) head(del_binom_df)# Load example data and germlines data(samples_db) # Selecting a single individual clip_db = samples_db[samples_db$subject=='I5', ] # Infering haplotype del_binom_df = deletionsByBinom(clip_db) head(del_binom_df)
The deletionsByVpooled function inferes single chromosomal deletion for D and J gene .
deletionsByVpooled( clip_db, chain = c("IGH", "IGK", "IGL"), deletion_col = c("d_call", "j_call"), count_thresh = 50, deleted_genes = "", min_minor_fraction = 0.3, kThreshDel = 3, nonReliable_Vgenes = c() )deletionsByVpooled( clip_db, chain = c("IGH", "IGK", "IGL"), deletion_col = c("d_call", "j_call"), count_thresh = 50, deleted_genes = "", min_minor_fraction = 0.3, kThreshDel = 3, nonReliable_Vgenes = c() )
clip_db |
a |
chain |
the IG chain: IGH,IGK,IGL. Default is IGH. |
deletion_col |
a vector of column names for which single chromosome deletions should be inferred. Default is j_call and d_call. |
count_thresh |
integer, the minimun number of sequences mapped to a specific V gene to be included in the V pooled inference. |
deleted_genes |
double chromosome deletion summary table. A |
min_minor_fraction |
the minimum minor allele fraction to be used as an anchor gene. Default is 0.3 |
kThreshDel |
the minimum lK (log10 of the Bayes factor) to call a deletion. Default is 3. |
nonReliable_Vgenes |
a list of known non reliable gene assignments. A |
The function accepts a data.frame in AIRR format (https://changeo.readthedocs.io/en/stable/standard.html) containing the following columns:
'subject': The subject name
'v_call': V allele call(s) (in an IMGT format)
'd_call': D allele call(s) (in an IMGT format, only for heavy chains)
'j_call': J allele call(s) (in an IMGT format)
A data.frame, in which each row is the single chomosome deletion inference of a gene.
The output containes the following columns:
subject: the subject name.
gene: the gene call
deletion: chromosome deletions inferred. Encoded 1 for deletion and 0 for no deletion.
k: the Bayesian factor value for the deletion inference.
counts: the appereance count of the gene on each chromosome, the counts are seperated by a comma.
data(samples_db) # Infering V pooled deletions del_db <- deletionsByVpooled(samples_db) head(del_db)data(samples_db) # Infering V pooled deletions del_db <- deletionsByVpooled(samples_db) head(del_db)
A list of the chains genes order by their location on the chromosomes
GENE.locGENE.loc
A nested list with three enteries, each a vector of the IG chains (IGH, IGL, and IGK) genes ordered by location.
The geneUsage function calculates the relative gene usage.
geneUsage( clip_db, chain = c("IGH", "IGK", "IGL", "TRB"), genes_order = NULL, rmPseudo = TRUE )geneUsage( clip_db, chain = c("IGH", "IGK", "IGL", "TRB"), genes_order = NULL, rmPseudo = TRUE )
clip_db |
a |
chain |
the IG/TR chain: IGH,IGK,IGL,TRB. Default is IGH. |
genes_order |
A vector of the genes by the desired order. Default is by GENE.loc |
rmPseudo |
if TRUE non-functional and pseudo genes are removed. Default is TRUE. |
The function accepts a data.frame in AIRR format (https://changeo.readthedocs.io/en/stable/standard.html) containing the following columns:
'subject': The subject name
'v_call': V allele call(s) (in an IMGT format)
'd_call': D allele call(s) (in an IMGT format, only for heavy chains)
'j_call': J allele call(s) (in an IMGT format)
A data.frame, in which each row is the relative gene usage value per individual.
The output containes the following columns:
subject: the subject name.
gene: the gene call
frac: the relative gene usage of the gene
A list of the germline genes from the human immunoglobulin loci
GERMGERM
Values correspond to IMGT-gaped nuceltoide sequences (with nucleotides capitalized and gaps represented by '.').
The hapDendo function generates a graphical output of an hierarchical clustering based on the Jaccard distance between multiple samples' haplotypes.
hapDendo( hap_table, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), genes_order = NULL, removeIGH = TRUE, mark_low_lk = TRUE, lk_cutoff = 1 )hapDendo( hap_table, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), genes_order = NULL, removeIGH = TRUE, mark_low_lk = TRUE, lk_cutoff = 1 )
hap_table |
haplotype summary table. See details. |
chain |
the IG/TR chain: IGH,IGK,IGL,TRB. Default is IGH. |
genes_order |
A vector of the genes by the desired order. Default is by GENE.loc |
removeIGH |
if TRUE, 'IGH'\'IGK'\'IGL' prefix is removed from gene names. Default is TRUE. |
mark_low_lk |
if TRUE, a texture is add for low lK values. Default is TRUE. |
lk_cutoff |
the lK cutoff value to be considerd low for texture layer. Default is lK<1. |
A data.frame created by createFullHaplotype.
A multitple samples visualization of the distances between haplotypes.
# Plotting haplotype hierarchical clustering based on the Jaccard distance hapDendo(samplesHaplotype)# Plotting haplotype hierarchical clustering based on the Jaccard distance hapDendo(samplesHaplotype)
The hapHeatmap function generates a graphical output of the alleles per gene in multiple samples.
hapHeatmap( hap_table, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), genes_order = NULL, removeIGH = TRUE, lk_cutoff = 1, mark_low_lk = TRUE, size_annot = 1.5, color_y = NULL, order_subject = NULL, file = NULL, size_text = NULL, ylabel_size = 1 )hapHeatmap( hap_table, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), genes_order = NULL, removeIGH = TRUE, lk_cutoff = 1, mark_low_lk = TRUE, size_annot = 1.5, color_y = NULL, order_subject = NULL, file = NULL, size_text = NULL, ylabel_size = 1 )
hap_table |
haplotype summary table. See details. |
chain |
the IG chain: IGH,IGK,IGL. Default is IGH. |
genes_order |
A vector of the genes by the desired order. Default is by GENE.loc |
removeIGH |
if TRUE, 'IGH'\'IGK'\'IGL'\'TRB' prefix is removed from gene names. |
lk_cutoff |
the lK cutoff value to be considered low for texture layer. Default is lK<1. |
mark_low_lk |
if TRUE, a texture is add for low lK values. Default is TRUE. |
size_annot |
size of bottom annotation text. Default is 1.5 . |
color_y |
named list of the colors for y axis labels. |
order_subject |
order subject by a vector. |
file |
file path for rendering the plot to pdf. If non is supplied than the plot is returned as object. Default is NULL. |
size_text |
text size for annotations. |
ylabel_size |
text size for y axis labels. |
A data.frame created by createFullHaplotype.
A list with the following:
'p': heat-map visualization of the haplotype inference for multiple samples.
'width': Optimal width value for rendering plot.
'height': Optimal width value for rendering plot.
When a file is supplied the graph is also rendered to pdf.
# Plotting haplotpe heatmap p <- hapHeatmap(samplesHaplotype) p$p# Plotting haplotpe heatmap p <- hapHeatmap(samplesHaplotype) p$p
A character vector of all 37 human IGHD germline gene segment alleles
in IMGT Gene-db release 2018-12-4.
HDGERMHDGERM
Values correspond to IMGT nuceltoide sequences.
Xochelli et al. (2014) Immunoglobulin heavy variable (IGHV) genes and alleles: new entities, new names and implications for research and prognostication in chronic lymphocytic leukaemia. Immunogenetics. 67(1):61-6.
A character vector of all 13 human IGHJ germline gene segment alleles
in IMGT Gene-db release 2018-12-4.
HJGERMHJGERM
Values correspond to IMGT nuceltoide sequences.
Xochelli et al. (2014) Immunoglobulin heavy variable (IGHV) genes and alleles: new entities, new names and implications for research and prognostication in chronic lymphocytic leukaemia. Immunogenetics. 67(1):61-6.
A character vector of all 342 human IGHV germline gene segment alleles
in IMGT Gene-db release 2018-12-4.
HVGERMHVGERM
Values correspond to IMGT-gaped nuceltoide sequences (with nucleotides capitalized and gaps represented by '.').
Xochelli et al. (2014) Immunoglobulin heavy variable (IGHV) genes and alleles: new entities, new names and implications for research and prognostication in chronic lymphocytic leukaemia. Immunogenetics. 67(1):61-6.
A character vector of all 342 human IGKJ germline gene segment alleles
in IMGT Gene-db release 2019-11-18.
KJGERMKJGERM
Values correspond to IMGT-gaped nuceltoide sequences (with nucleotides capitalized and gaps represented by '.').
A character vector of all 342 human IGKV germline gene segment alleles
in IMGT Gene-db release 2019-11-18.
A character vector of all 342 human IGLV germline gene segment alleles
in IMGT Gene-db release 2019-11-18.
KVGERM LVGERMKVGERM LVGERM
Values correspond to IMGT-gaped nuceltoide sequences (with nucleotides capitalized and gaps represented by '.').
Values correspond to IMGT-gaped nuceltoide sequences (with nucleotides capitalized and gaps represented by '.').
A character vector of all 342 human IGLJ germline gene segment alleles
in IMGT Gene-db release 2019-11-18.
LJGERMLJGERM
Values correspond to IMGT-gaped nuceltoide sequences (with nucleotides capitalized and gaps represented by '.').
nonReliableVGenes Takes a data.frame in AIRR format and detect non reliable IGHV genes. A non reliable gene is
when the ratio of the multiple assignments with a gene is below the threshold.
nonReliableVGenes(clip_db, thresh = 0.9, appearance = 0.01)nonReliableVGenes(clip_db, thresh = 0.9, appearance = 0.01)
clip_db |
a |
thresh |
the threshold to consider non reliable gene. Default is 0.9 |
appearance |
the minimum fraction of gene appearance to be considered for reliability check. Default is 0.01. |
The function accepts a data.frame in AIRR format (https://changeo.readthedocs.io/en/stable/standard.html) containing the following columns:
'subject': subject names
'v_call': V allele call(s) (in an IMGT format)
a nested list of non reliable genes for all subject.
# Example IGHV call data frame clip_db <- data.frame(subject=rep('S1',6), v_call=c('IGHV1-69*01','IGHV1-69*01','IGHV1-69*01,IGHV1-69*02', 'IGHV4-59*01,IGHV4-61*01','IGHV4-59*01,IGHV4-31*02','IGHV4-59*01')) # Detect non reliable genes nonReliableVGenes(clip_db)# Example IGHV call data frame clip_db <- data.frame(subject=rep('S1',6), v_call=c('IGHV1-69*01','IGHV1-69*01','IGHV1-69*01,IGHV1-69*02', 'IGHV4-59*01,IGHV4-61*01','IGHV4-59*01,IGHV4-31*02','IGHV4-59*01')) # Detect non reliable genes nonReliableVGenes(clip_db)
The plotDeletionsByBinom function generates a graphical output of the double chromosome deletions in multiple samples.
plotDeletionsByBinom( GENE.usage.df, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), genes.low.cer = c("IGHV3-43", "IGHV3-20"), genes.dup = c("IGHD4-11", "IGHD5-18"), genes_order = NULL )plotDeletionsByBinom( GENE.usage.df, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), genes.low.cer = c("IGHV3-43", "IGHV3-20"), genes.dup = c("IGHD4-11", "IGHD5-18"), genes_order = NULL )
GENE.usage.df |
double chromosome deletion summary table. See details. |
chain |
the IG chain: IGH,IGK,IGL. Default is IGH. |
genes.low.cer |
a vector of IGH genes known to be with low certantiny in the binomial test. Default is IGHV3-43 and IGHV3-20 |
genes.dup |
a vector of IGH genes known to have a duplicated gene. Default is IGHD4-11 that his duplicate is IGHD4-4 and IGHD5-18 that his duplicate is IGHD5-5 |
genes_order |
A vector of the genes by the desired order. Default is by GENE.loc |
A data.frame created by binom_test_deletion.
A double chromosome deletion visualization.
# Load example data and germlines data(samples_db) # Infering haplotype deletions_db = deletionsByBinom(samples_db); plotDeletionsByBinom(deletions_db)# Load example data and germlines data(samples_db) # Infering haplotype deletions_db = deletionsByBinom(samples_db); plotDeletionsByBinom(deletions_db)
The plotDeletionsByVpooled function generates a graphical output for single chromosome D or J gene deletions (for heavy chain only).
plotDeletionsByVpooled( del.df, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), K_ranges = c(3, 7) )plotDeletionsByVpooled( del.df, chain = c("IGH", "IGK", "IGL", "TRB", "TRA"), K_ranges = c(3, 7) )
del.df |
a |
chain |
the IG chain: IGH,IGK,IGL. Default is IGH.. |
K_ranges |
vector of one or two integers for log(K) certainty level thresholds |
A data.frame created by deletionsByVpooled.
A single chromosome deletion visualization.
# Load example data and germlines data(samples_db) del_db <- deletionsByVpooled(samples_db) plotDeletionsByVpooled(del_db)# Load example data and germlines data(samples_db) del_db <- deletionsByVpooled(samples_db) plotDeletionsByVpooled(del_db)
The plotHaplotype functions visualizes an inferred haplotype.
plotHaplotype( hap_table, html_output = FALSE, genes_order = NULL, text_size = 14, removeIGH = TRUE, plotYaxis = TRUE, chain = c("IGH", "IGK", "IGL", "TRB"), dir, width = 15, height = 20 )plotHaplotype( hap_table, html_output = FALSE, genes_order = NULL, text_size = 14, removeIGH = TRUE, plotYaxis = TRUE, chain = c("IGH", "IGK", "IGL", "TRB"), dir, width = 15, height = 20 )
hap_table |
haplotype summary table. See details. |
html_output |
if TRUE, a html5 interactive graph is outputed. Default is FALSE. |
genes_order |
A vector of the genes by the desired order. Default is by GENE.loc |
text_size |
the size of graph labels. Default is 14 (pts). |
removeIGH |
if TRUE, 'IGH'\'IGK'\'IGL'\'TRB' prefix is removed from gene names. |
plotYaxis |
if TRUE, Y axis labels (gene names) are plotted on the middle and right plots. Default is TRUE. |
chain |
the Ig/TR chain: IGH,IGK,IGL,TRB. Default is IGH. |
dir |
The output folder for saving the haplotype map for multiple individuals. |
width |
width (in inches) of the multi-subject pdf output. Default is 15. |
height |
height (in inches) of the multi-subject pdf output. Default is 20. |
A data.frame in a haplotype format created by createFullHaplotype function.
A haplotype map visualization. If more than one subject is visualized, a pdf is created. If html_output is TRUE, a folder named html_output is created with individual graphs.
# Selecting a single individual from the haplotype samples data haplo_db = samplesHaplotype[samplesHaplotype$subject=='I5', ] # plot haplotype plotHaplotype(haplo_db)# Selecting a single individual from the haplotype samples data haplo_db = samplesHaplotype[samplesHaplotype$subject=='I5', ] # plot haplotype plotHaplotype(haplo_db)
The rabhit package provides a robust novel method for determining
antibody heavy and light chain haplotypes by adapting a Bayesian framework.
The key functions in rabhit, broken down by topic, are
described below.
rabhit provides tools to infer haplotypes based on given anchor genes,
deletion detection based on relative gene usage, pooling v genes, and a single anchor gene.
createFullHaplotype: Haplotypes inference and single chromosome deletions based on an anchor gene.
deletionsByVpooled: Single chromosomal deletion detection by pooling V genes.
deletionsByBinom: Double chromosomal deletion detection by relative gene usage.
geneUsage: Relative gene usage.
nonReliableVGenes: Non reliable gene assignment detection.
Functions for visualization of the inferred haplotypes and deletions
plotHaplotype: Haplotype inference map.
deletionHeatmap: Single chromosome deletions heatmap.
hapHeatmap: Chromosome comparison of multiple samples.
hapDendo: Hierarchical clustering of multiple haplotypes based on Jaccard distance.
plotDeletionsByVpooled: V pooled based single chromosome deletions heatmap.
plotDeletionsByBinom: Double chromosome deletions heatmap.
Gidoni, M., Snir, O., Peres, A., Polak, P., Lindeman, I., Mikocziova, I., . . . Yaari, G. (2019). Mosaic deletion patterns of the human antibody heavy chain gene locus shown by Bayesian haplotyping. Nature Communications, 10(1). doi:10.1038/s41467-019-08489-3
readHaplotypeDb reads a tab-delimited haplotype file created by a createFullHaplotype
into a data.frame. Based on readChangeoDb function from alakazam.
readHaplotypeDb(file)readHaplotypeDb(file)
file |
tab-delimited database file output by a Change-O tool. |
A data.frame of the haplotype file. Columns will be imported as is, except for the following columns which will be explicitly converted into character values:
alleles
subject
A data.frame of example IGH human naive b-cell repertiore data from five
individuals (see references). Overall, the data set includes 6 samples.
A single individual has two samples (Individual I5),
one is short read sequences from BIOMED-2 protocol primers for framework 2 region (The sample is annotated I5_FR2).
samples_dbsamples_db
A data.frame in Change-O format (https://changeo.readthedocs.io/en/stable/standard.html) containing the following columns:
'SUBJECT': subject names
'V_CALL': V allele call(s) (in an IMGT format)
'D_CALL': D allele call(s) (in an IMGT format, only for heavy chains)
'J_CALL': J allele call(s) (in an IMGT format)
Gidoni, Moriah, et al. Mosaic deletion patterns of the human antibody heavy chain gene locus shown by Bayesian haplotyping. Nature Communications. 10.1 (2019): 628.
A data.frame of example haplotype infrence results from createFullHaplotype after double chromosome deletion inference via deletionsByBinom and non reliable V genes detection via nonReliableVGenes.
Source data is a colletion of IGH human naive b-cell repertiore data from five
individuals (see references). Overall, the data set includes 6 samples.
A single individual has two samples (Individual I5),
one is short read sequences from BIOMED-2 protocol primers for framework 2 region (The sample is annotated I5_FR2).
samplesHaplotypesamplesHaplotype
A data.frame, in which each row is the haplotype inference summary of a gene of an individual, from the column selected to prefrom the haplptype infrence on.
Gidoni, Moriah, et al. Mosaic deletion patterns of the human antibody heavy chain gene locus shown by Bayesian haplotyping. Nature Communications. 10.1 (2019): 628.
See createFullHaplotype for detailed column descriptions.