| convertToASC | R Documentation |
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",
...
)
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).
# requires the Suggested 'piglet' package
if (requireNamespace("piglet", quietly = TRUE)) {
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.