Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 384742245
  • Loading branch information
gunjanbaid authored and copybara-github committed Jul 14, 2021
1 parent 3c8d938 commit 6c736da
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 197 deletions.
54 changes: 23 additions & 31 deletions docs/source/nucleus/pip_package/setup.md
Original file line number Diff line number Diff line change
@@ -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

<a name="copy_egg_info"></a>

### `copy_egg_info(dest_dir)`

```
Copies the .egg-info directory to the specified location.
Expand All @@ -50,17 +43,16 @@ Returns:
```

<a name="find_destination"></a>

### `find_destination(is_user)`

```
Returns the directory we are supposed to install into.
```

<a name="main"></a>

### `main()`

<a name="touch"></a>

<a name="touch"></a>
### `touch(fname)`


10 changes: 6 additions & 4 deletions docs/source/nucleus/testing/test_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -126,7 +126,7 @@ Makes a nucleus.genomics.v1.Read for testing.
```

<a name="make_variant"></a>
### `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.
Expand Down Expand Up @@ -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.
```

<a name="make_variant_multiple_calls"></a>
### `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.
Expand Down Expand Up @@ -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.
Expand Down
95 changes: 31 additions & 64 deletions docs/source/nucleus/util/variantcall_utils.md
Original file line number Diff line number Diff line change
@@ -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

<a name="get_ad"></a>

### `get_ad(variant_call)`

```
Gets the allele depth of the VariantCall.
```

<a name="get_format"></a>

### `get_format(variant_call, field_name, vcf_object=None)`

```
Returns the value of the `field_name` FORMAT field.
Expand All @@ -62,9 +56,7 @@ Args:
```

<a name="get_gl"></a>

### `get_gl(variant_call)`

```
Returns the genotype likelihoods of the VariantCall.
Expand All @@ -76,17 +68,13 @@ Returns:
```

<a name="get_gq"></a>

### `get_gq(variant_call)`

```
Gets the genotype quality of the VariantCall.
```

<a name="get_gt"></a>

### `get_gt(variant_call)`

```
Returns the genotypes of the VariantCall.
Expand All @@ -98,25 +86,19 @@ Returns:
```

<a name="get_med_dp"></a>

### `get_med_dp(variant_call)`

```
Gets the 'MED_DP' field of the VariantCall.
```

<a name="get_min_dp"></a>

### `get_min_dp(variant_call)`

```
Gets the 'MIN_DP' field of the VariantCall.
```

<a name="has_full_genotypes"></a>

### `has_full_genotypes(variant_call)`

```
Returns True iff the VariantCall has only known genotypes.
Expand All @@ -128,9 +110,7 @@ Returns:
```

<a name="has_genotypes"></a>

### `has_genotypes(variant_call)`

```
Returns True iff the VariantCall has one or more called genotypes.
Expand All @@ -142,9 +122,7 @@ Returns:
```

<a name="has_variation"></a>

### `has_variation(variant_call)`

```
Returns True if and only if the call has a non-reference genotype.
Expand All @@ -156,9 +134,7 @@ Returns:
```

<a name="is_heterozygous"></a>

### `is_heterozygous(variant_call)`

```
Returns True if and only if the call is heterozygous.
Expand All @@ -170,9 +146,7 @@ Returns:
```

<a name="ploidy"></a>

### `ploidy(variant_call)`

```
Returns the ploidy of the VariantCall.
Expand All @@ -184,17 +158,19 @@ Returns:
```

<a name="set_ad"></a>

### `set_ad(variant_call, ad)`

```
Sets the allele depth of the VariantCall.
```

<a name="set_format"></a>
<a name="set_bam_fname"></a>
### `set_bam_fname(variant_call, bam_fname)`
```
Sets 'BAM_FNAME' field of the VariantCall.
```

<a name="set_format"></a>
### `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).
Expand Down Expand Up @@ -223,9 +199,7 @@ Args:
```

<a name="set_gl"></a>

### `set_gl(variant_call, gl)`

```
Sets the genotype likelihoods of the VariantCall.
Expand All @@ -235,17 +209,13 @@ Args:
```

<a name="set_gq"></a>

### `set_gq(variant_call, gq)`

```
Sets the genotype quality of the VariantCall.
```

<a name="set_gt"></a>

### `set_gt(variant_call, gt)`

```
Sets the genotypes of the VariantCall.
Expand All @@ -255,17 +225,14 @@ Args:
```

<a name="set_med_dp"></a>

### `set_med_dp(variant_call, med_dp)`

```
Sets the 'MED_DP' field of the VariantCall.
```

<a name="set_min_dp"></a>

### `set_min_dp(variant_call, min_dp)`

```
Sets the 'MIN_DP' field of the VariantCall.
```

Loading

0 comments on commit 6c736da

Please sign in to comment.