diff --git a/docs/source/nucleus/pip_package/setup.md b/docs/source/nucleus/pip_package/setup.md index 42040aa..424e8e4 100644 --- a/docs/source/nucleus/pip_package/setup.md +++ b/docs/source/nucleus/pip_package/setup.md @@ -1,44 +1,37 @@ # nucleus.pip_package.setup -- Fake setup.py module for installing Nucleus. - -**Source code:** -[nucleus/pip_package/setup.py](https://github.com/google/nucleus/tree/master/nucleus/pip_package/setup.py) +**Source code:** [nucleus/pip_package/setup.py](https://github.com/google/nucleus/tree/master/nucleus/pip_package/setup.py) **Documentation index:** [doc_index.md](../../doc_index.md) --------------------------------------------------------------------------------- - -Usually, setup.py is invoked twice: first, to build the pip package and second -to install it. +--- +Usually, setup.py is invoked twice: first, to build the pip package +and second to install it. -This setup.py is only used for installation; build_pip_package.sh is used to -create the package. We do it this way because we need our package to include -symbolic links, which normal setup.py doesn't support. +This setup.py is only used for installation; build_pip_package.sh is +used to create the package. We do it this way because we need our +package to include symbolic links, which normal setup.py doesn't +support. -For the same reason, this setup.py is not implemented using setuptools. Instead, -we directly implement the four commands run by pip install +For the same reason, this setup.py is not implemented using setuptools. +Instead, we directly implement the four commands run by pip install (https://pip.pypa.io/en/stable/reference/pip_install/#id46): - -* setup.py egg_info [--egg-base XXX] -* setup.py install --record XXX [--single-version-externally-managed] [--root - XXX] [--compile|--no-compile] [--install-headers XXX] -* setup.py bdist_wheel -d XXX -* setup.py clean + * setup.py egg_info [--egg-base XXX] + * setup.py install --record XXX [--single-version-externally-managed] + [--root XXX] [--compile|--no-compile] [--install-headers XXX] + * setup.py bdist_wheel -d XXX + * setup.py clean ## Functions overview - -Name | Description --------------------------------------------------- | ----------- -[`copy_egg_info`](#copy_egg_info)`(dest_dir)` | Copies the .egg-info directory to the specified location. +Name | Description +-----|------------ +[`copy_egg_info`](#copy_egg_info)`(dest_dir)` | Copies the .egg-info directory to the specified location. [`find_destination`](#find_destination)`(is_user)` | Returns the directory we are supposed to install into. -[`main`](#main)`()` | -[`touch`](#touch)`(fname)` | +[`main`](#main)`()` | +[`touch`](#touch)`(fname)` | ## Functions - - ### `copy_egg_info(dest_dir)` - ``` Copies the .egg-info directory to the specified location. @@ -50,17 +43,16 @@ Returns: ``` - ### `find_destination(is_user)` - ``` Returns the directory we are supposed to install into. ``` - ### `main()` - + ### `touch(fname)` + + diff --git a/docs/source/nucleus/testing/test_utils.md b/docs/source/nucleus/testing/test_utils.md index 402a1d2..6ea63c5 100644 --- a/docs/source/nucleus/testing/test_utils.md +++ b/docs/source/nucleus/testing/test_utils.md @@ -16,8 +16,8 @@ Name | Description [`genomics_testdata`](#genomics_testdata)`(path, datadir=DATADIR)` | Gets the path to a testdata file in genomics at relative path. [`iterable_len`](#iterable_len)`(iterable)` | Returns the length of a Python iterable, by advancing it. [`make_read`](#make_read)`(bases, start, quals=None, cigar=None, mapq=50, chrom='chr1', name=None)` | Makes a nucleus.genomics.v1.Read for testing. -[`make_variant`](#make_variant)`(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gt=None, gq=None, sample_name=None, gls=None, is_phased=None)` | Creates a new Variant proto from args. -[`make_variant_multiple_calls`](#make_variant_multiple_calls)`(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gts=None, gqs=None, sample_names=None, glss=None, is_phased=None)` | Creates a new Variant proto from args that contains multi-sample calls. +[`make_variant`](#make_variant)`(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gt=None, gq=None, sample_name=None, gls=None, is_phased=None, ad=None)` | Creates a new Variant proto from args. +[`make_variant_multiple_calls`](#make_variant_multiple_calls)`(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gts=None, gqs=None, sample_names=None, glss=None, is_phased=None, ad=None)` | Creates a new Variant proto from args that contains multi-sample calls. [`set_list_values`](#set_list_values)`(list_value, values)` | Sets a ListValue to have the values in values. [`test_tmpfile`](#test_tmpfile)`(name, contents=None)` | Returns a path to a tempfile named name in the test_tmpdir. @@ -126,7 +126,7 @@ Makes a nucleus.genomics.v1.Read for testing. ``` -### `make_variant(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gt=None, gq=None, sample_name=None, gls=None, is_phased=None)` +### `make_variant(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gt=None, gq=None, sample_name=None, gls=None, is_phased=None, ad=None)` ``` Creates a new Variant proto from args. @@ -154,13 +154,14 @@ Args: gls: array-list of float, or None. If not None and gt is not None, sets the genotype_likelihoods of our VariantCall to this value. is_phased: bool. Indicates whether a VariantCall should be phased. + ad: list of allelic depths. Returns: nucleus.genomics.v1.Variant proto. ``` -### `make_variant_multiple_calls(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gts=None, gqs=None, sample_names=None, glss=None, is_phased=None)` +### `make_variant_multiple_calls(chrom='chr1', start=10, alleles=None, end=None, filters=None, qual=None, gts=None, gqs=None, sample_names=None, glss=None, is_phased=None, ad=None)` ``` Creates a new Variant proto from args that contains multi-sample calls. @@ -188,6 +189,7 @@ Args: specified. Sets the genotype_likelihoods of the corresponding VariantCall. is_phased: list of bools. Must match the gts arg if specified. Indicates whether the corresponding VariantCall should be phased. + ad: list of allelic depths. These are added together to calculate DP. Returns: nucleus.genomics.v1.Variant proto. diff --git a/docs/source/nucleus/util/variantcall_utils.md b/docs/source/nucleus/util/variantcall_utils.md index e313fdc..1f66e47 100644 --- a/docs/source/nucleus/util/variantcall_utils.md +++ b/docs/source/nucleus/util/variantcall_utils.md @@ -1,50 +1,44 @@ # nucleus.util.variantcall_utils -- VariantCall utilities. - -**Source code:** -[nucleus/util/variantcall_utils.py](https://github.com/google/nucleus/tree/master/nucleus/util/variantcall_utils.py) +**Source code:** [nucleus/util/variantcall_utils.py](https://github.com/google/nucleus/tree/master/nucleus/util/variantcall_utils.py) **Documentation index:** [doc_index.md](../../doc_index.md) --------------------------------------------------------------------------------- +--- -## Functions overview -Name | Description -------------------------------------------------------------------------------- | ----------- -[`get_ad`](#get_ad)`(variant_call)` | Gets the allele depth of the VariantCall. -[`get_format`](#get_format)`(variant_call, field_name, vcf_object=None)` | Returns the value of the `field_name` FORMAT field. -[`get_gl`](#get_gl)`(variant_call)` | Returns the genotype likelihoods of the VariantCall. -[`get_gq`](#get_gq)`(variant_call)` | Gets the genotype quality of the VariantCall. -[`get_gt`](#get_gt)`(variant_call)` | Returns the genotypes of the VariantCall. -[`get_med_dp`](#get_med_dp)`(variant_call)` | Gets the 'MED_DP' field of the VariantCall. -[`get_min_dp`](#get_min_dp)`(variant_call)` | Gets the 'MIN_DP' field of the VariantCall. -[`has_full_genotypes`](#has_full_genotypes)`(variant_call)` | Returns True iff the VariantCall has only known genotypes. -[`has_genotypes`](#has_genotypes)`(variant_call)` | Returns True iff the VariantCall has one or more called genotypes. -[`has_variation`](#has_variation)`(variant_call)` | Returns True if and only if the call has a non-reference genotype. -[`is_heterozygous`](#is_heterozygous)`(variant_call)` | Returns True if and only if the call is heterozygous. -[`ploidy`](#ploidy)`(variant_call)` | Returns the ploidy of the VariantCall. -[`set_ad`](#set_ad)`(variant_call, ad)` | Sets the allele depth of the VariantCall. +## Functions overview +Name | Description +-----|------------ +[`get_ad`](#get_ad)`(variant_call)` | Gets the allele depth of the VariantCall. +[`get_format`](#get_format)`(variant_call, field_name, vcf_object=None)` | Returns the value of the `field_name` FORMAT field. +[`get_gl`](#get_gl)`(variant_call)` | Returns the genotype likelihoods of the VariantCall. +[`get_gq`](#get_gq)`(variant_call)` | Gets the genotype quality of the VariantCall. +[`get_gt`](#get_gt)`(variant_call)` | Returns the genotypes of the VariantCall. +[`get_med_dp`](#get_med_dp)`(variant_call)` | Gets the 'MED_DP' field of the VariantCall. +[`get_min_dp`](#get_min_dp)`(variant_call)` | Gets the 'MIN_DP' field of the VariantCall. +[`has_full_genotypes`](#has_full_genotypes)`(variant_call)` | Returns True iff the VariantCall has only known genotypes. +[`has_genotypes`](#has_genotypes)`(variant_call)` | Returns True iff the VariantCall has one or more called genotypes. +[`has_variation`](#has_variation)`(variant_call)` | Returns True if and only if the call has a non-reference genotype. +[`is_heterozygous`](#is_heterozygous)`(variant_call)` | Returns True if and only if the call is heterozygous. +[`ploidy`](#ploidy)`(variant_call)` | Returns the ploidy of the VariantCall. +[`set_ad`](#set_ad)`(variant_call, ad)` | Sets the allele depth of the VariantCall. +[`set_bam_fname`](#set_bam_fname)`(variant_call, bam_fname)` | Sets 'BAM_FNAME' field of the VariantCall. [`set_format`](#set_format)`(variant_call, field_name, value, vcf_object=None)` | Sets a field of the info map of the `VariantCall` to the given value(s). -[`set_gl`](#set_gl)`(variant_call, gl)` | Sets the genotype likelihoods of the VariantCall. -[`set_gq`](#set_gq)`(variant_call, gq)` | Sets the genotype quality of the VariantCall. -[`set_gt`](#set_gt)`(variant_call, gt)` | Sets the genotypes of the VariantCall. -[`set_med_dp`](#set_med_dp)`(variant_call, med_dp)` | Sets the 'MED_DP' field of the VariantCall. -[`set_min_dp`](#set_min_dp)`(variant_call, min_dp)` | Sets the 'MIN_DP' field of the VariantCall. +[`set_gl`](#set_gl)`(variant_call, gl)` | Sets the genotype likelihoods of the VariantCall. +[`set_gq`](#set_gq)`(variant_call, gq)` | Sets the genotype quality of the VariantCall. +[`set_gt`](#set_gt)`(variant_call, gt)` | Sets the genotypes of the VariantCall. +[`set_med_dp`](#set_med_dp)`(variant_call, med_dp)` | Sets the 'MED_DP' field of the VariantCall. +[`set_min_dp`](#set_min_dp)`(variant_call, min_dp)` | Sets the 'MIN_DP' field of the VariantCall. ## Functions - - ### `get_ad(variant_call)` - ``` Gets the allele depth of the VariantCall. ``` - ### `get_format(variant_call, field_name, vcf_object=None)` - ``` Returns the value of the `field_name` FORMAT field. @@ -62,9 +56,7 @@ Args: ``` - ### `get_gl(variant_call)` - ``` Returns the genotype likelihoods of the VariantCall. @@ -76,17 +68,13 @@ Returns: ``` - ### `get_gq(variant_call)` - ``` Gets the genotype quality of the VariantCall. ``` - ### `get_gt(variant_call)` - ``` Returns the genotypes of the VariantCall. @@ -98,25 +86,19 @@ Returns: ``` - ### `get_med_dp(variant_call)` - ``` Gets the 'MED_DP' field of the VariantCall. ``` - ### `get_min_dp(variant_call)` - ``` Gets the 'MIN_DP' field of the VariantCall. ``` - ### `has_full_genotypes(variant_call)` - ``` Returns True iff the VariantCall has only known genotypes. @@ -128,9 +110,7 @@ Returns: ``` - ### `has_genotypes(variant_call)` - ``` Returns True iff the VariantCall has one or more called genotypes. @@ -142,9 +122,7 @@ Returns: ``` - ### `has_variation(variant_call)` - ``` Returns True if and only if the call has a non-reference genotype. @@ -156,9 +134,7 @@ Returns: ``` - ### `is_heterozygous(variant_call)` - ``` Returns True if and only if the call is heterozygous. @@ -170,9 +146,7 @@ Returns: ``` - ### `ploidy(variant_call)` - ``` Returns the ploidy of the VariantCall. @@ -184,17 +158,19 @@ Returns: ``` - ### `set_ad(variant_call, ad)` - ``` Sets the allele depth of the VariantCall. ``` - + +### `set_bam_fname(variant_call, bam_fname)` +``` +Sets 'BAM_FNAME' field of the VariantCall. +``` + ### `set_format(variant_call, field_name, value, vcf_object=None)` - ``` Sets a field of the info map of the `VariantCall` to the given value(s). @@ -223,9 +199,7 @@ Args: ``` - ### `set_gl(variant_call, gl)` - ``` Sets the genotype likelihoods of the VariantCall. @@ -235,17 +209,13 @@ Args: ``` - ### `set_gq(variant_call, gq)` - ``` Sets the genotype quality of the VariantCall. ``` - ### `set_gt(variant_call, gt)` - ``` Sets the genotypes of the VariantCall. @@ -255,17 +225,14 @@ Args: ``` - ### `set_med_dp(variant_call, med_dp)` - ``` Sets the 'MED_DP' field of the VariantCall. ``` - ### `set_min_dp(variant_call, min_dp)` - ``` Sets the 'MIN_DP' field of the VariantCall. ``` + diff --git a/docs/source/nucleus/util/vis.md b/docs/source/nucleus/util/vis.md index 6ce498c..cbc31a3 100644 --- a/docs/source/nucleus/util/vis.md +++ b/docs/source/nucleus/util/vis.md @@ -1,75 +1,71 @@ # nucleus.util.vis -- Utility functions for visualization and inspection of pileup examples. - -**Source code:** -[nucleus/util/vis.py](https://github.com/google/nucleus/tree/master/nucleus/util/vis.py) +**Source code:** [nucleus/util/vis.py](https://github.com/google/nucleus/tree/master/nucleus/util/vis.py) **Documentation index:** [doc_index.md](../../doc_index.md) --------------------------------------------------------------------------------- - +--- Visualization and inspection utility functions enable showing image-like array data including those used in DeepVariant. ## Classes overview - -Name | Description ------------------------------------ | ----------- -[`BaseQuality`](#basequality) | -[`Diff`](#diff) | -[`MappingQuality`](#mappingquality) | -[`ReadSupport`](#readsupport) | -[`StrandBias`](#strandbias) | +Name | Description +-----|------------ +[`BaseQuality`](#basequality) | +[`Diff`](#diff) | +[`MappingQuality`](#mappingquality) | +[`ReadSupport`](#readsupport) | +[`StrandBias`](#strandbias) | ## Functions overview - -Name | Description ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- -[`add_header`](#add_header)`(img, labels, mark_midpoints=True, header_height=20)` | Adds labels to the image, evenly distributed across the top. -[`alt_allele_indices_from_example`](#alt_allele_indices_from_example)`(example)` | Extract indices of the particular alt allele(s) the example represents. -[`alt_bases_from_indices`](#alt_bases_from_indices)`(alt_allele_indices, alternate_bases)` | Get alt allele bases based on their indices. -[`alt_from_example`](#alt_from_example)`(example)` | Get alt allele(s) from a DeepVariant example. -[`analyze_diff_and_nearby_variants`](#analyze_diff_and_nearby_variants)`(channels)` | Analyzes which differences belong to nearby variants and which do not. -[`array_to_png`](#array_to_png)`(arr, path=None, show=True, vmin=None, vmax=None, scale=None, labels=None)` | Save an array as a PNG image with PIL and show it. -[`autoscale_colors_for_png`](#autoscale_colors_for_png)`(arr, vmin=None, vmax=None)` | Adjust an array to prepare it for saving to an image. -[`binomial_test`](#binomial_test)`(k, n)` | Calculates a two-tailed binomial test with p=0.5, without scipy. -[`channels_from_example`](#channels_from_example)`(example)` | Extract image from an Example and return the list of channels. -[`convert_6_channels_to_rgb`](#convert_6_channels_to_rgb)`(channels)` | Convert 6-channel image from DeepVariant to RGB for quick visualization. -[`curate_pileup`](#curate_pileup)`(channels)` | Runs all automated curation functions and outputs categorical tags. -[`describe_diff`](#describe_diff)`(channels, diff_fraction_threshold=0.01)` | Describes a pileup image by its diff channel, including nearby variants. -[`describe_read_support`](#describe_read_support)`(channels)` | Calculates read support and describes it categorically. +Name | Description +-----|------------ +[`add_header`](#add_header)`(img, labels, mark_midpoints=True, header_height=20)` | Adds labels to the image, evenly distributed across the top. +[`alt_allele_indices_from_example`](#alt_allele_indices_from_example)`(example)` | Extract indices of the particular alt allele(s) the example represents. +[`alt_bases_from_indices`](#alt_bases_from_indices)`(alt_allele_indices, alternate_bases)` | Get alt allele bases based on their indices. +[`alt_from_example`](#alt_from_example)`(example)` | Get alt allele(s) from a DeepVariant example. +[`analyze_diff_and_nearby_variants`](#analyze_diff_and_nearby_variants)`(channels)` | Analyzes which differences belong to nearby variants and which do not. +[`array_to_png`](#array_to_png)`(arr, path=None, show=True, vmin=None, vmax=None, scale=None, labels=None)` | Save an array as a PNG image with PIL and show it. +[`autoscale_colors_for_png`](#autoscale_colors_for_png)`(arr, vmin=None, vmax=None)` | Adjust an array to prepare it for saving to an image. +[`binomial_test`](#binomial_test)`(k, n)` | Calculates a two-tailed binomial test with p=0.5, without scipy. +[`channels_from_example`](#channels_from_example)`(example)` | Extract image from an Example and return the list of channels. +[`convert_6_channels_to_rgb`](#convert_6_channels_to_rgb)`(channels)` | Convert 6-channel image from DeepVariant to RGB for quick visualization. +[`curate_pileup`](#curate_pileup)`(channels)` | Runs all automated curation functions and outputs categorical tags. +[`describe_diff`](#describe_diff)`(channels, diff_fraction_threshold=0.01)` | Describes a pileup image by its diff channel, including nearby variants. +[`describe_read_support`](#describe_read_support)`(channels)` | Calculates read support and describes it categorically. [`draw_deepvariant_pileup`](#draw_deepvariant_pileup)`(example=None, channels=None, composite_type=None, annotated=True, labels=None, path=None, show=True, scale=None)` | Quick utility for showing a pileup example as channels or RGB. -[`fraction_low_base_quality`](#fraction_low_base_quality)`(channels, threshold=127)` | Gets fraction of bases that have low base quality scores in a pileup. -[`fraction_read_support`](#fraction_read_support)`(channels)` | Gets fraction of reads that support the variant. -[`fraction_reads_with_low_mapq`](#fraction_reads_with_low_mapq)`(channels, threshold=127)` | Gets fraction of reads that have low mapping quality scores in pileup. -[`get_image_array_from_example`](#get_image_array_from_example)`(example)` | Decode image/encoded and image/shape of an Example into a numpy array. -[`label_from_example`](#label_from_example)`(example)` | Get the "label" from an example. -[`locus_id_from_variant`](#locus_id_from_variant)`(variant)` | Create a locus ID of form "chr:pos_ref" from a Variant object. -[`locus_id_with_alt`](#locus_id_with_alt)`(example)` | Get complete locus ID from a DeepVariant example. -[`pvalue_for_strand_bias`](#pvalue_for_strand_bias)`(channels)` | Calculates a rough p-value for strand bias in pileup. -[`remove_ref_band`](#remove_ref_band)`(arr, num_top_rows_to_skip=5)` | Removes the reference rows at the top of a pileup image array. -[`save_to_png`](#save_to_png)`(arr, path=None, image_mode=None, show=True, labels=None, scale=None)` | Make a PNG and show it from a numpy array of dtype=np.uint8. -[`scale_colors_for_png`](#scale_colors_for_png)`(arr, vmin=0, vmax=255)` | Scale an array to integers between 0 and 255 to prep it for a PNG image. -[`split_3d_array_into_channels`](#split_3d_array_into_channels)`(arr)` | Split 3D array into a list of 2D arrays. -[`variant_from_example`](#variant_from_example)`(example)` | Extract Variant object from the 'variant/encoded' feature of an Example. +[`fraction_low_base_quality`](#fraction_low_base_quality)`(channels, threshold=127)` | Gets fraction of bases that have low base quality scores in a pileup. +[`fraction_read_support`](#fraction_read_support)`(channels)` | Gets fraction of reads that support the variant. +[`fraction_reads_with_low_mapq`](#fraction_reads_with_low_mapq)`(channels, threshold=127)` | Gets fraction of reads that have low mapping quality scores in pileup. +[`get_image_array_from_example`](#get_image_array_from_example)`(example)` | Decode image/encoded and image/shape of an Example into a numpy array. +[`label_from_example`](#label_from_example)`(example)` | Get the "label" from an example. +[`locus_id_from_variant`](#locus_id_from_variant)`(variant)` | Create a locus ID of form "chr:pos_ref" from a Variant object. +[`locus_id_with_alt`](#locus_id_with_alt)`(example)` | Get complete locus ID from a DeepVariant example. +[`pvalue_for_strand_bias`](#pvalue_for_strand_bias)`(channels)` | Calculates a rough p-value for strand bias in pileup. +[`remove_ref_band`](#remove_ref_band)`(arr, num_top_rows_to_skip=5)` | Removes the reference rows at the top of a pileup image array. +[`save_to_png`](#save_to_png)`(arr, path=None, image_mode=None, show=True, labels=None, scale=None)` | Make a PNG and show it from a numpy array of dtype=np.uint8. +[`scale_colors_for_png`](#scale_colors_for_png)`(arr, vmin=0, vmax=255)` | Scale an array to integers between 0 and 255 to prep it for a PNG image. +[`split_3d_array_into_channels`](#split_3d_array_into_channels)`(arr)` | Split 3D array into a list of 2D arrays. +[`variant_from_example`](#variant_from_example)`(example)` | Extract Variant object from the 'variant/encoded' feature of an Example. ## Classes - ### BaseQuality + ### Diff + ### MappingQuality + ### ReadSupport + ### StrandBias -## Functions +## Functions - ### `add_header(img, labels, mark_midpoints=True, header_height=20)` - ``` Adds labels to the image, evenly distributed across the top. @@ -87,9 +83,7 @@ Returns: ``` - ### `alt_allele_indices_from_example(example)` - ``` Extract indices of the particular alt allele(s) the example represents. @@ -101,9 +95,7 @@ Returns: ``` - ### `alt_bases_from_indices(alt_allele_indices, alternate_bases)` - ``` Get alt allele bases based on their indices. @@ -120,9 +112,7 @@ Returns: ``` - ### `alt_from_example(example)` - ``` Get alt allele(s) from a DeepVariant example. @@ -134,9 +124,7 @@ Returns: ``` - ### `analyze_diff_and_nearby_variants(channels)` - ``` Analyzes which differences belong to nearby variants and which do not. @@ -153,9 +141,7 @@ Returns: ``` - ### `array_to_png(arr, path=None, show=True, vmin=None, vmax=None, scale=None, labels=None)` - ``` Save an array as a PNG image with PIL and show it. @@ -187,9 +173,7 @@ Returns: ``` - ### `autoscale_colors_for_png(arr, vmin=None, vmax=None)` - ``` Adjust an array to prepare it for saving to an image. @@ -211,9 +195,7 @@ Returns: ``` - ### `binomial_test(k, n)` - ``` Calculates a two-tailed binomial test with p=0.5, without scipy. @@ -231,9 +213,7 @@ Returns: ``` - ### `channels_from_example(example)` - ``` Extract image from an Example and return the list of channels. @@ -246,9 +226,7 @@ Returns: ``` - ### `convert_6_channels_to_rgb(channels)` - ``` Convert 6-channel image from DeepVariant to RGB for quick visualization. @@ -263,9 +241,7 @@ Returns: ``` - ### `curate_pileup(channels)` - ``` Runs all automated curation functions and outputs categorical tags. @@ -287,9 +263,7 @@ Returns: ``` - ### `describe_diff(channels, diff_fraction_threshold=0.01)` - ``` Describes a pileup image by its diff channel, including nearby variants. @@ -314,9 +288,7 @@ Returns: ``` - ### `describe_read_support(channels)` - ``` Calculates read support and describes it categorically. @@ -333,9 +305,7 @@ Returns: ``` - ### `draw_deepvariant_pileup(example=None, channels=None, composite_type=None, annotated=True, labels=None, path=None, show=True, scale=None)` - ``` Quick utility for showing a pileup example as channels or RGB. @@ -361,9 +331,7 @@ Returns: ``` - ### `fraction_low_base_quality(channels, threshold=127)` - ``` Gets fraction of bases that have low base quality scores in a pileup. @@ -378,9 +346,7 @@ Returns: ``` - ### `fraction_read_support(channels)` - ``` Gets fraction of reads that support the variant. @@ -393,9 +359,7 @@ Returns: ``` - ### `fraction_reads_with_low_mapq(channels, threshold=127)` - ``` Gets fraction of reads that have low mapping quality scores in pileup. @@ -409,9 +373,7 @@ Returns: ``` - ### `get_image_array_from_example(example)` - ``` Decode image/encoded and image/shape of an Example into a numpy array. @@ -427,9 +389,7 @@ Returns: ``` - ### `label_from_example(example)` - ``` Get the "label" from an example. @@ -442,9 +402,7 @@ Returns: ``` - ### `locus_id_from_variant(variant)` - ``` Create a locus ID of form "chr:pos_ref" from a Variant object. @@ -456,9 +414,7 @@ Returns: ``` - ### `locus_id_with_alt(example)` - ``` Get complete locus ID from a DeepVariant example. @@ -470,9 +426,7 @@ Returns: ``` - ### `pvalue_for_strand_bias(channels)` - ``` Calculates a rough p-value for strand bias in pileup. @@ -489,17 +443,13 @@ Returns: ``` - ### `remove_ref_band(arr, num_top_rows_to_skip=5)` - ``` Removes the reference rows at the top of a pileup image array. ``` - ### `save_to_png(arr, path=None, image_mode=None, show=True, labels=None, scale=None)` - ``` Make a PNG and show it from a numpy array of dtype=np.uint8. @@ -527,9 +477,7 @@ Returns: ``` - ### `scale_colors_for_png(arr, vmin=0, vmax=255)` - ``` Scale an array to integers between 0 and 255 to prep it for a PNG image. @@ -545,9 +493,7 @@ Returns: ``` - ### `split_3d_array_into_channels(arr)` - ``` Split 3D array into a list of 2D arrays. @@ -562,9 +508,7 @@ Returns: ``` - ### `variant_from_example(example)` - ``` Extract Variant object from the 'variant/encoded' feature of an Example. @@ -574,3 +518,4 @@ Args: Returns: A Nucleus Variant. ``` +