Skip to content

Commit f172c5e

Browse files
author
Fernando Gelin
authored
Merge pull request #47 from compbiocore/develop
Fix Grouped Read Depth Heatmap color pallete / Fix genomic range filters / Update README / Clarify Docs
2 parents bd8e078 + d0d0607 commit f172c5e

11 files changed

+93
-197
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#### Visualization of Variants
44

55

6-
| MacOS / Linux | License | Test Coverage | Documentation | Lifecycle |
6+
| MacOS / Linux | Windows | License | Test Coverage | Documentation | Lifecycle |
77
| --- | ---- | ------ | ------ | ---- |
8-
|[![Travis](https://img.shields.io/travis/compbiocore/VariantVisualization.jl/master.svg?style=flat-square)](https://travis-ci.org/compbiocore/VariantVisualization.jl)| [![License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square)](https://github.com/compbiocore/VariantVisualization.jl/blob/clean-up/LICENSE.md)| [![Codecov](https://img.shields.io/codecov/c/github/compbiocore/VariantVisualization.jl.svg?style=flat-square)](https://codecov.io/gh/compbiocore/VariantVisualization.jl/branch/master) | [![Docs](https://img.shields.io/badge/docs-stable-blue.svg?style=flat-square)](https://compbiocore.github.io/VariantVisualization.jl/stable) [![Docs](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://compbiocore.github.io/VariantVisualization.jl/latest) | ![Lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg?style=flat-square) |
8+
|[![Travis](https://img.shields.io/travis/compbiocore/VariantVisualization.jl/master.svg?style=flat-square)](https://travis-ci.org/compbiocore/VariantVisualization.jl)|[![Build status](https://ci.appveyor.com/api/projects/status/67hyn6rckulwr2dj/branch/master?svg=true)](https://ci.appveyor.com/project/fernandogelin/variantvisualization-jl/branch/master)|[![License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square)](https://github.com/compbiocore/VariantVisualization.jl/blob/clean-up/LICENSE.md)|[![Coverage Status](https://coveralls.io/repos/github/compbiocore/VariantVisualization.jl/badge.svg?branch=master)](https://coveralls.io/github/compbiocore/VariantVisualization.jl?branch=master)|[![Docs](https://img.shields.io/badge/docs-stable-blue.svg?style=flat-square)](https://compbiocore.github.io/VariantVisualization.jl/stable) [![Docs](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://compbiocore.github.io/VariantVisualization.jl/latest) | ![Lifecycle](https://img.shields.io/badge/lifecycle-active-green.svg?style=flat-square) |
99

1010
## Overview
1111

@@ -15,7 +15,11 @@ VariantVisualization.jl is a package we built specifically to power the genetics
1515

1616
To use VIVA, you must download the Julia programming language version >=1.0 and install the VariantVisualization.jl Julia package as well as the VIVA script.
1717

18-
## Getting Started: *Installation*
18+
## Getting Started:
19+
20+
Note: Once you have set up VIVA, you can quickly run the command line tool [examples](https://compbiocore.github.io/VariantVisualization.jl/stable/examples/) found in the documentation.
21+
22+
*Installation*
1923

2024
### Supported Operating Systems:
2125

@@ -34,7 +38,7 @@ Windows 10, Windows 7
3438
b. run `Pkg.clone("https://github.com/compbiocore/VariantVisualization.jl")`
3539
c. run `Pkg.instantiate()`
3640
2. Download the [VIVA](https://github.com/compbiocore/VariantVisualization.jl/blob/master/viva) tool script and save it to a working directory for your analysis.
37-
3. Navigate to your working directory and follow the [VIVA manual](https://compbiocore.github.io/VariantVisualization.jl/latest/) to generate your plots.
41+
3. Navigate to your working directory and follow the [VIVA manual](https://compbiocore.github.io/VariantVisualization.jl/stable/) to generate your plots.
3842

3943
### Jupyter Notebook
4044

docs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ docs_dir: 'build'
2828
pages:
2929
- Home: index.md
3030
- VIVA Manual:
31+
- Installation and Setup: installation.md
3132
- Filtering Your VCF File: filtering_vcf.md
3233
- Making Plots: plotting.md
3334
- Examples: examples.md

docs/src/examples.md

Lines changed: 22 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,47 @@
1-
# Plotting
1+
# Examples
22

3-
##General notes: visualization options
3+
To run examples, download the five test files found [here](https://github.com/compbiocore/VariantVisualization.jl/tree/master/test/test_files) and put them into a working directory with the VIVA script.
44

5-
Here we describe VIVA options for plotting. All plots can be generated in a single command.
5+
Once Julia and VariantVisualization.jl are installed, you can run the following examples and should see the same outputs.
66

7-
VIVA orders all variants by chromosomal location for plotting.
7+
## Default Options
88

9-
VIVA graphics are generated with PlotlyJS.jl. Graphics can be saved in *HTML*, *PDF*, *SVG*, *PNG*, and *EPS* formats.
10-
11-
To create *interactive visualization* files, save VIVA's graphics in HTML format. These files are sharable and support cursor hoverlabels, zooming, panning, and PNG screen capture. Cursor hoverlabel displays genomic position, sample id, and data value for each data point in heatmap and scatter plot visualizations. We recommend saving graphics to HTML for data exploration.
12-
13-
To create *publication quality, scalable graphics* for presentations and publications, we recommend saving graphics as PDF.
14-
15-
## Genotype and read depth heatmaps
16-
17-
Plot a categorical heatmap of genotype values and a continuous value heatmap of read depth (coverage) values.
18-
19-
*flags*: `--heatmap`,`-m`
20-
21-
*arguments*: `genotype`, `read_depth`, or `genotype,read_depth`
22-
23-
default: `genotype,read_depth` (plots both)
24-
25-
```
26-
julia VIVA -f example.vcf -m genotype
27-
```
28-
29-
## Average read depth scatter plots
30-
31-
Generate scatter plots of average read depths across either samples or variants. Caps outlier read depth values at 100 to optimize resolution of visualization of values under 50.
32-
33-
34-
*flags*: `--avg_dp`
35-
36-
*arguments*: `samples`, `variants`, or `samples,variants`
37-
38-
default: `none`
39-
40-
```
41-
julia VIVA -f example.vcf --avg_dp variants
42-
```
43-
44-
## Save file format
45-
46-
Specify file format you wish to save all graphics as (eg. pdf, html, png). [REQUIRED]
47-
48-
*flags*: `--save_format`, `-s`
49-
50-
*arguments*: `html`, `pdf`, `svg`, `png`, `eps`
51-
52-
default: `html`
9+
Running VIVA with no options produces heatmaps of genotype and read depth values for all samples and variant positions in the VCF file with default options. You can read about VIVA's default settings [here](https://compbiocore.github.io/VariantVisualization.jl/stable/#default-options)
5310

5411
```
55-
julia VIVA -f example.vcf --avg_dp variants
56-
```
57-
58-
## Output directory
59-
60-
Specify output directory for saving all graphics. If directory doesn't exist, it creates the directory within the working directory. Defaults to "output."
61-
62-
Select directory to save output files. If path doesn't exist, creates new directory.
63-
64-
*flags*: `--output_directory`, `-o`
65-
66-
*arguments*: filepath
67-
68-
default: `output`
69-
70-
```
71-
julia VIVA -f example.vcf -o my_output_directory
72-
```
73-
74-
## Title
75-
76-
Specify title to display on heatmap and use as filename for saving heatmap files. Use underscores instead of spaces. Underscores will be replaced with spaces in the heatmap title.
77-
78-
*flags*: `--heatmap_title`, `-t`
79-
80-
*arguments*: title_text
81-
82-
default: original vcf filename
83-
12+
julia VIVA -f test_4X_191.vcf -t Default_Options
8413
```
85-
julia VIVA -f example.vcf -t your_heatmap_title
86-
```
87-
88-
## Y-axis label options
8914

90-
Choose an option for displaying y-axis ticklabels showing the genomic position of variants on heatmaps and scatter plots.
15+
![Default Genotype Heatmap](assets/Genotype_Default_Options.html)
9116

92-
*flags*: `--y_axis_labels`, `-y`
17+
![Default Read Depth Heatmap](assets/Read_Depth_Default_Options.html)
9318

94-
*arguments*: `chromosomes`, `positions`, `hoverlabels_only`
19+
## Grouping Samples by Metadata Traits and Generating all Four Plots
9520

96-
`chromosomes` separates chromosomes by adding chromosome label on the first variant of each new chromosome.
97-
`positions` labels every variant position (recommended only for visualizing a few variants e.g. <20)
98-
`hoverlabels_only` no genomic position labels
21+
Group samples by sequencing facility and generate heatmaps of genotype and read depth values as well as scatter plots of average read depth for both all selected samples and all selected variant positions.
9922

100-
default: `chromosomes`
23+
You can find grouping options [here]([options](https://compbiocore.github.io/VariantVisualization.jl/stable/filtering_vcf/#selecting-and-grouping-samples) to group samples by common traits.)
10124

10225
```
103-
julia VIVA -f example.vcf `-y` `hoverlabels_only`
26+
julia VIVA -f test_4X_191.vcf -t Grouped_by_Sequencing_Site -g sample_metadata_matrix.csv seq_site_1,seq_site_2 --avg_dp variant,sample
10427
```
10528

106-
## X-axis label options
29+
![Grouped Genotype Heatmap](assets/Read_Depth_Grouped_by_Sequencing_Site.html)
10730

108-
Choose an option for displaying x-axis ticklabels showing the sample id of samples included heatmaps and scatter plots.
31+
![Grouped Read Depth Heatmap](assets/Genotype_Grouped_by_Sequencing_Site.html)
10932

110-
*flags*: `--x_axis_labels`.`x`
33+
![Grouped Variant Average Read Depth Scatter Plot](assets/Average_Variant_Read_Depthtest_4X_191.vcf.html)
11134

112-
*arguments*: if `true`, displays samples names labels on x-axis. if `false`, does not display x-axis sample labels.
35+
![Grouped Sample Average Read Depth Scatter Plot](assets/Average_Sample_Read_Depth_test_4X_191.vcf.html)
36+
37+
##Genomic Range and Samples Selection - Genotype and Read Depth Heatmaps with Variant Position Labels
11338

114-
default: `true`
39+
Generate heatmaps of genotype and read depth values of variants selected within a genomic range, in this case, chromosome 4, nucleotides 200000-500000, with y-axis variant position labels.
11540

11641
```
117-
julia VIVA -f example.vcf `-x`
42+
julia VIVA -f test/test_files/test_4X_191.vcf -t Genomic_Range_Chr4:3076150-3076390 -r chr4:3076150-3076390 -y positions --select_samples select_samples_list.txt
11843
```
11944

120-
## Export heatmap data as numerical array
45+
![Genomic Range Genotype Heatmap](assets/Genotype_Genomic_Range_Chr4/3076150-3076390.html)
46+
![Genomic Range Read Depth Heatmap](assets/Read_Depth_Genomic_Range_Chr4/3076150-3076390.html)
12147

122-
Save input array to heatmap function with column and row labels.
123-
Specifically, saves numerical array of genotype or read depth values for selected variants and samples as a .csv table with genomic positions and sample names for row names and column names respectively.
124-
125-
*flags*: `--num_array`, `-n`
126-
127-
*arguments*: none, this is a positional argument.
128-
129-
```
130-
julia VIVA -f example.vcf `-n`
131-
```
132-
133-

docs/src/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Getting Started
44

5-
### *Command Line Tool and Jupyter Notebook*
5+
# *VIVA Command Line Tool and Jupyter Notebook*
66

77
## Description
88

@@ -82,7 +82,8 @@ Use the following steps to use the VIVA Jupyter Notebook utility:
8282

8383
## Continue reading for:
8484

85-
* [Variant and Sample Selection](https://github.com/compbiocore/VariantVisualization.jl/tree/master/docs/src/filtering_vcf.md)
85+
* [Variant and Sample Selection](https://compbiocore.github.io/VariantVisualization.jl/stable/filtering_vcf/)
86+
87+
* [Plotting Options](https://compbiocore.github.io/VariantVisualization.jl/stable/plotting/)
8688

87-
* [Plotting Options](https://github.com/compbiocore/VariantVisualization.jl/tree/master/docs/src/plotting.md)
8889

docs/src/installation.md

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,57 @@
11
#Installation
22

3-
##Install Julia v1.1.0
3+
### Install Julia v1.1.0
44
Download [Julia]("https://julialang.org/downloads/")
55

6-
##Install the VariantVisualization.jl
7-
Add `VariantVisualization.jl` at the package prompt in the Julia v1.1 REPL.
6+
### Supported Operating Systems:
87

9-
```
10-
julia
8+
#### macOS
119

12-
*press the ']' key to enter the package prompt*
10+
Sierra, High Sierra, and Mojave.
1311

14-
(v1.1) pkg> add VariantVisualization
12+
#### Windows
1513

16-
```
14+
Windows 10, Windows 7
1715

18-
If successful, `VariantVisualization.jl` will be installed in your Julia packages directory (.julia/packages/) and VIVA command line tool should install with this. Adding `VariantVisualization.jl` runs a script to create an alias for the command line tool script in the bash shell. This allows the user to call VIVA from any directory.
16+
### Command Line Tool
1917

18+
1. Add VariantVisualization.jl using Pkg in the Julia REPL:
19+
a. run `using Pkg`
20+
b. run `Pkg.clone("https://github.com/compbiocore/VariantVisualization.jl")`
21+
c. run `Pkg.instantiate()`
22+
2. Download the [VIVA](https://github.com/compbiocore/VariantVisualization.jl/blob/master/viva) tool script and save it to a working directory for your analysis.
23+
3. Navigate to your working directory and follow the [VIVA manual](https://compbiocore.github.io/VariantVisualization.jl/latest/) to generate your plots.
2024

21-
##Install the Jupyter Notebook
25+
### Jupyter Notebook
2226

23-
If you plan to use the Jupyter Notebook VIVA utility, install Jupyter then download the [VIVA Notebook]().
27+
1. [Install Jupyter](https://jupyter.org/install)
28+
2. Download the [VIVA Jupyter Notebook](https://github.com/compbiocore/VariantVisualization.jl/blob/master/VIVA.ipynb).
29+
3. Follow the in-notebook instructions to generate your plots.
2430

25-
If you already have Jupyter installed, update following [these instructions](https://jupyter.readthedocs.io/en/latest/projects/upgrade-notebook.html)
31+
### Latest Features
2632

33+
To stay up to date with cutting edge development features install VariantVisualization.jl from the Master branch.
2734

28-
##New Features
29-
To stay up to date with new features before official version release, please check out the master branch.
35+
Using git from the command line:
3036

3137
```
32-
julia
38+
git clone https://github.com/compbiocore/VariantVisualization.jl
39+
```
3340

41+
or from the Julia REPL (useful if using the PowerShell and don't have git installed):
42+
43+
```julia
3444
using Pkg
3545
Pkg.clone("https://github.com/compbiocore/VariantVisualization.jl")
3646
```
47+
48+
### *For Developers*
49+
50+
VIVA Jupyter notebook and the VIVA the command line tool are built with functions contained in our VariantVisualization.jl package.
51+
52+
Developers may contribute to these open source tools by using [functions contained within VariantVisualization.jl](https://github.com/compbiocore/VariantVisualization.jl/tree/master/src/) which are carefully documented with docstrings.
53+
54+
We have included in-line comments within the code for the [VIVA command line tool](https://github.com/compbiocore/VariantVisualization.jl/tree/master/viva).
55+
56+
The ***VIVA Jupyter notebook*** is powered by a [main function](https://github.com/compbiocore/VariantVisualization.jl/tree/master/src/new_notebook_utils.jl) which takes arguments defined by the user in the notebook. We welcome users to post in issues to request a new feature or bug fix.
57+

src/VariantVisualization.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export
4949
translate_genotype_to_num_array,
5050
translate_readdepth_strings_to_num_array,
5151
genotype_heatmap_with_groups,
52-
jupyter_main_new,
5352
returnXY_column1!,
5453
pass_genomic_range_siglist_filter,
5554
pass_genomic_range_filter,

src/batch_julia_runtimes.jl

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/open_jupyter_notebook.jl

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)