Skip to content

Reassign alleles and Genotype Inference improvement#48

Open
ayeletperes wants to merge 5 commits into
immcantation:masterfrom
ayeletperes:reassign-alleles
Open

Reassign alleles and Genotype Inference improvement#48
ayeletperes wants to merge 5 commits into
immcantation:masterfrom
ayeletperes:reassign-alleles

Conversation

@ayeletperes

Copy link
Copy Markdown
Contributor

Speeds up allele reassignment and moved genotype inference functions from enchantr

Changes

reassignAlleles

  1. Now uses the alakazam Rcpp 'hamming' distance function. The call is guarded by a
    runtime exists(..., envir = asNamespace("alakazam")) check and verified to
    reproduce the old result bit-for-bit, so it degrades gracefully to pure R if
    alakazam hasn't been updated yet.
  2. New flags strip_d and reassign_uncalled. These preserve the old function
    behavior, where it annotates empty cells and strips the D of duplicated genes
    (e.g. IGHV1-69D).

genotypeFasta

  1. New flag strip_d to avoid stripping the D of duplicated genes. Default preserves
    old function behavior.
  2. New flag include_unseen to include germline DB alleles for genes not present in
    the genotype. Default preserves old function behavior.

inferGenotypeBayesian

  1. New flag genotyped_alleles computes the alleles that passed the genotype and adds
    a new genotyped_alleles column (moved from enchantr).
  2. Added support for mixed (multi-chain) data, computing depth based on the locus
    column.

plotGenotypeConfidence

  1. New plot visualizing the k_diff column of the Bayesian inference, based on the old
    plot function.

plotGenotype

  1. New flag allele_col to plot the genotyped_alleles column from the Bayesian
    inference; previously hard-coded to alleles.

Notes

Please approve after the alakazam PR (add-mutation-count-rcpp) is approved. reassignAlleles relies on the Rcpp hamming-distance functions exported there for its speedup. It is functionally non-breaking without them (falls back to pure R), but the intended path needs alakazam in first.

…fidence plot in the genotype, added depth per loci for the genotype inference, update the genotypeFasta function to include genes that were not seen in the genotype inference, included the genotyped_alleles function for the bayesian inference
- Added `genotyped_alleles` parameter to `inferGenotypeBayesian` for including most likely alleles in the output.
- Implemented locus-specific checks in `inferGenotype` and `reassignAlleles` to handle mixed loci warnings.
- Updated `genotypeFasta` to support unseen alleles inclusion.
- Enhanced tests for genotype inference and reassignment functions to validate new features.
…ot function. Added a variable to choose the allele column to plot for the genotyped_alleles column in the bayesian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant