From 31804d5537e5d559146c08c432b0a8e9f5a69b57 Mon Sep 17 00:00:00 2001 From: marianattestad Date: Mon, 27 Apr 2020 12:40:34 -0700 Subject: [PATCH] Update documentation for variant_utils. PiperOrigin-RevId: 308677340 --- docs/source/nucleus/util/variant_utils.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/source/nucleus/util/variant_utils.md b/docs/source/nucleus/util/variant_utils.md index 1b2ad70..dcb6060 100644 --- a/docs/source/nucleus/util/variant_utils.md +++ b/docs/source/nucleus/util/variant_utils.md @@ -50,6 +50,7 @@ Name | Description [`only_call`](#only_call)`(variant)` | Ensures the Variant has exactly one VariantCall, and returns it. [`set_info`](#set_info)`(variant, field_name, value, vcf_object=None)` | Sets a field of the info map of the `Variant` to the given value(s). [`simplify_alleles`](#simplify_alleles)`(*alleles)` | Simplifies alleles by stripping off common postfix bases. +[`simplify_variant_alleles`](#simplify_variant_alleles)`(variant)` | Replaces the alleles in variants with their simplified versions. [`sorted_variants`](#sorted_variants)`(variants)` | Returns sorted(variants, key=variant_range_tuple). [`unphase_all_genotypes`](#unphase_all_genotypes)`(variant)` | Sorts genotype and removes phasing bit of all calls in variant. [`variant_is_deletion`](#variant_is_deletion)`(variant, exclude_alleles=None)` | Are all the variant's alt alleles deletions? @@ -613,6 +614,23 @@ Returns: bases stripped off. ``` + +### `simplify_variant_alleles(variant)` +``` +Replaces the alleles in variants with their simplified versions. + +This function takes a variant and replaces its ref and alt alleles with those +produced by a call to variant_utils.simplify_alleles() to remove common +postfix bases in the alleles that may be present due to pruning away alleles. + +Args: + variant: learning.genomics.genomics.Variant proto we want to simplify. + +Returns: + variant with its ref and alt alleles replaced with their simplified + equivalents. +``` + ### `sorted_variants(variants)` ```