public final class AlleleSubsettingUtils extends Object
VariantContext and GenotypesContext objects to a
reduced set of alleles, as well as for choosing the best set of alleles to keep and for cleaning up annotations and
genotypes after subsetting.| Constructor | Description |
|---|---|
AlleleSubsettingUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static htsjdk.variant.variantcontext.GenotypesContext |
subsetAlleles(htsjdk.variant.variantcontext.GenotypesContext originalGs,
List<htsjdk.variant.variantcontext.Allele> originalAlleles,
List<htsjdk.variant.variantcontext.Allele> allelesToKeep) |
Create the new GenotypesContext with the subsetted PLs and ADs
Expects allelesToKeep to be in the same order
in which they are in originalAlleles.
|
static htsjdk.variant.variantcontext.VariantContext |
subsetAlleles(htsjdk.variant.variantcontext.VariantContext originalVc,
List<htsjdk.variant.variantcontext.Allele> allelesToKeep) |
|
static int[] |
subsettedPLIndices(List<htsjdk.variant.variantcontext.Allele> originalAlleles,
List<htsjdk.variant.variantcontext.Allele> newAlleles) |
Given a list of original alleles and a subset of new alleles to retain, find the array of old PL indices that correspond
to new PL indices i.e.
|
static htsjdk.variant.variantcontext.VariantContext |
subsetVCToMatchSnp(htsjdk.variant.variantcontext.VariantContext ctx,
Snp snp) |
Method to subset the alleles in the VariantContext to those in the input snp.
|
static htsjdk.variant.variantcontext.VariantContext |
swapAlleles(htsjdk.variant.variantcontext.VariantContext originalVc,
htsjdk.variant.variantcontext.Allele oldAllele,
htsjdk.variant.variantcontext.Allele newAllele) |
Swaps one of the alleles in a VC (and its genotypes) with another.
|
public static htsjdk.variant.variantcontext.VariantContext subsetVCToMatchSnp(htsjdk.variant.variantcontext.VariantContext ctx,
Snp snp)
returns null if it is not possible to subset ctx to the alleles in snp.
ctx - The VariantContext to subset.snp - Snp whose alleles are used for subsetting ctx.public static htsjdk.variant.variantcontext.VariantContext subsetAlleles(htsjdk.variant.variantcontext.VariantContext originalVc,
List<htsjdk.variant.variantcontext.Allele> allelesToKeep)
public static htsjdk.variant.variantcontext.VariantContext swapAlleles(htsjdk.variant.variantcontext.VariantContext originalVc,
htsjdk.variant.variantcontext.Allele oldAllele,
htsjdk.variant.variantcontext.Allele newAllele)
throws IllegalArgumentException
originalVc - The VariantContext whose oldAllele will be swapped for newAllele.oldAllele - The Allele in originalVc that needs to be replaced.newAllele - The new Allele to use instead of oldAllele.VariantContext with newAllele swapped in for oldAllele.IllegalArgumentException - if originalVc doesn't contain oldAllele.public static htsjdk.variant.variantcontext.GenotypesContext subsetAlleles(htsjdk.variant.variantcontext.GenotypesContext originalGs,
List<htsjdk.variant.variantcontext.Allele> originalAlleles,
List<htsjdk.variant.variantcontext.Allele> allelesToKeep)
originalGs - the original GenotypesContextoriginalAlleles - the original allelesallelesToKeep - the subset of alleles to use with the new Genotypespublic static int[] subsettedPLIndices(List<htsjdk.variant.variantcontext.Allele> originalAlleles, List<htsjdk.variant.variantcontext.Allele> newAlleles)
This method is written in terms f indices rather than subsetting PLs directly in order to produce output that can be recycled from sample to sample, provided that the ploidy is the same.
originalAlleles - List of original allelesnewAlleles - New alleles -- must be a subset of originalAlleles