Skip to content

Commit 16d1d2f

Browse files
author
Fernando Gelin
authored
Merge pull request #53 from compbiocore/develop
Fix sample labels when select columns, docs fixes
2 parents 2f355e9 + 45db974 commit 16d1d2f

11 files changed

+40
-35
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
| 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)|[![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) |
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/master/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

@@ -23,17 +23,11 @@ Note: Once you have set up VIVA, you can quickly run the command line tool [EXAM
2323

2424
### Supported Operating Systems:
2525

26-
#### macOS
26+
macOS ( Sierra, High Sierra, and Mojave ), Windows, and Linux.
2727

28-
Sierra, High Sierra, and Mojave.
28+
Expected Time for Installation: Installation time depends on your network bandwidth, but should take less than 10 minutes for VIVA installation to install all dependency packages. Installing and using Julia packages for the first time takes longer than when using them in subsequent sessions.
2929

30-
#### Windows
31-
32-
Windows 10, Windows 7
33-
34-
#### Linux
35-
36-
*Note*: When installing VariantVisualization.jl and running VIVA on Linux systems on remote compute clusters, you may need to load the OpenGl module in addition to loading the Julia module.
30+
*Note*: When installing VariantVisualization.jl and running VIVA remote compute clusters, you may need to load the OpenGl module in addition to loading the Julia module.
3731

3832
### Command Line Tool
3933

43.1 KB
Loading
Binary file not shown.
42.4 KB
Loading
Binary file not shown.

docs/src/examples.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Examples
22

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.
3+
To run examples:
44

5-
Once Julia and VariantVisualization.jl are installed, you can run the following examples and should see the same outputs.
5+
1. Install Julia and the VariantVisualization.jl package
6+
2. 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.
7+
3. Open the command line (Terminal or Powershell), copy the provided commands into the command line prompt, and press enter.
8+
4. Your first VIVA run will take longer than usual (several minutes) because of the way Julia compiles packages. All subsequent runs will be much faster. Each example should take 30-50 seconds to run and you should see the same outputs as those below each demo.
9+
10+
We encourage you to also run these examples without the flag `-s png` to save and view interactive HTML graphics with cursor hovertext, zooming, panning, and screen capture features. View HTML graphics in your browser by opening the HTML file.
611

712
## Default Options
813

@@ -11,7 +16,6 @@ Running VIVA with no options produces heatmaps of genotype and read depth values
1116
```
1217
julia VIVA -f test_4X_191.vcf -t Default_Options -s png
1318
```
14-
![VIVA Logo](assets/VIVA_logo.png)
1519
![Default Genotype Heatmap](assets/Genotype_Default_Options.png)
1620

1721
![Default Read Depth Heatmap](assets/Read_Depth_Default_Options.png)
@@ -39,9 +43,9 @@ julia VIVA -f test_4X_191.vcf -t Grouped_by_Sequencing_Site -g sample_metadata_m
3943
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.
4044

4145
```
42-
julia VIVA -f test_4X_191.vcf -t Genomic_Range_Chr4:3076150-3076390 -r chr4:3076150-3076390 -y positions --select_samples select_samples_list.txt -s png
46+
julia VIVA -f test_4X_191.vcf -t Genomic_Range -r chr4:3076150-3076390 -y positions --select_samples select_samples_list.txt -s png
4347
```
44-
45-
![Genomic Range Genotype Heatmap](assets/Genotype_Genomic_Range_Chr4:3076150-3076390.png)
46-
![Genomic Range Read Depth Heatmap](assets/Read_Depth_Genomic_Range_Chr4:3076150-3076390.png)
48+
docs/src/assets/Read_Depth_Genomic_Range.png
49+
![Genomic Range Genotype Heatmap](assets/Genotype_Genomic_Range.png)
50+
![Genomic Range Read Depth Heatmap](assets/Read_Depth_Genomic_Range.png)
4751

src/init.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ function alias()
77
end
88

99
dir = split(@__DIR__, "/src")[1]
10-
exe = joinpath(dir, "VIVA")
10+
exe = joinpath(dir, "viva")
1111

1212
open(joinpath(homedir(), rcfile), "a+") do io
13-
write(io, "\n # VIVA Alias \nalias VIVA=\"$exe\"")
13+
write(io, "\n # viva Alias \nalias viva=\"$exe\"")
1414
end
1515
chmod(exe, 333)
1616
end

src/plot_utils.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function genotype_heatmap2(input,title,chrom_label_info,sample_names,chr_pos_tup
3636
layout = Layout(
3737
title = "$title_no_underscores",
3838
xaxis=attr(title="Sample ID", showgrid=false, zeroline=false, tickvals=sample_name_indices,
39-
ticktext=sample_names, tickfont_size=5, tickangle=45,showticklabels=true),
39+
ticktext=sample_names, tickangle=45,showticklabels=true),
4040
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chrom_label_indices,
4141
ticktext=chrom_labels,tickfont_size=font_size,hovermode=true,automargin=true)
4242
)
@@ -49,7 +49,7 @@ function genotype_heatmap2(input,title,chrom_label_info,sample_names,chr_pos_tup
4949
layout = Layout(
5050
title = "$title_no_underscores",
5151
xaxis=attr(title="Sample ID", showgrid=false, zeroline=false, tickvals=sample_name_indices,
52-
ticktext=sample_names, tickfont_size=5, tickangle=45, showticklabels=x_axis_label_option),
52+
ticktext=sample_names, tickangle=45, showticklabels=x_axis_label_option),
5353
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chr_pos_tuple_indices,
5454
ticktext=chr_pos_tuple_list,tickfont_size=font_size,hovermode=true,automargin=true)
5555
)
@@ -62,7 +62,7 @@ function genotype_heatmap2(input,title,chrom_label_info,sample_names,chr_pos_tup
6262
layout = Layout(
6363
title = "$title_no_underscores",
6464
xaxis=attr(title="Sample ID", showgrid=false, zeroline=false, tickvals=sample_name_indices,
65-
ticktext=sample_names, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
65+
ticktext=sample_names, tickangle=45,showticklabels=x_axis_label_option),
6666
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chr_pos_tuple_indices,
6767
ticktext=chr_pos_tuple_list,tickfont_size=font_size,hovermode=true,automargin=true,showticklabels=false)
6868
)
@@ -192,7 +192,7 @@ h_line_index_list = generate_hline_indices(number_rows,input)
192192
title = "$title_no_underscores",
193193

194194
xaxis=attr(title="Sample ID (Grouped by $(group1_label) | $(group2_label))", showgrid=false, zeroline=false, tickvals=sample_name_indices,
195-
ticktext=id_list, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
195+
ticktext=id_list, tickangle=45,showticklabels=x_axis_label_option),
196196

197197
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chrom_label_indices,
198198
ticktext=chrom_labels,tickfont_size=font_size,hovermode=true,automargin=true),
@@ -208,7 +208,7 @@ h_line_index_list = generate_hline_indices(number_rows,input)
208208
title = "$title_no_underscores",
209209

210210
xaxis=attr(title="Sample ID (Grouped by $(group1_label) | $(group2_label))", showgrid=false, zeroline=false, tickvals=sample_name_indices,
211-
ticktext=id_list, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
211+
ticktext=id_list, tickangle=45,showticklabels=x_axis_label_option),
212212

213213
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chr_pos_tuple_indices,
214214
ticktext=chr_pos_tuple_list,tickfont_size=font_size,hovermode=true,automargin=true),
@@ -224,7 +224,7 @@ h_line_index_list = generate_hline_indices(number_rows,input)
224224
layout = Layout(
225225
title = "$title_no_underscores",
226226
xaxis=attr(title="Sample ID (Grouped by $(group1_label) | $(group2_label))", showgrid=false, zeroline=false, tickvals=sample_name_indices,
227-
ticktext=id_list, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
227+
ticktext=id_list, tickangle=45,showticklabels=x_axis_label_option),
228228

229229
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chr_pos_tuple_indices,
230230
ticktext=chr_pos_tuple_list,tickfont_size=font_size,hovermode=true,automargin=true,showticklabels=false),
@@ -281,7 +281,7 @@ function dp_heatmap2(input, title, chrom_label_info, sample_names,chr_pos_tuple_
281281
layout = Layout(
282282
title = "$title_no_underscores",
283283
xaxis=attr(title="Sample ID", showgrid=false, zeroline=false, tickvals=sample_name_indices,
284-
ticktext=sample_names, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
284+
ticktext=sample_names, tickangle=45,showticklabels=x_axis_label_option),
285285
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chrom_label_indices,
286286
ticktext=chrom_labels,tickfont_size=font_size,hovermode=true,automargin=true)
287287
)
@@ -294,7 +294,7 @@ function dp_heatmap2(input, title, chrom_label_info, sample_names,chr_pos_tuple_
294294
layout = Layout(
295295
title = "$title_no_underscores",
296296
xaxis=attr(title="Sample ID", showgrid=false, zeroline=false, tickvals=sample_name_indices,
297-
ticktext=sample_names, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
297+
ticktext=sample_names, tickangle=45,showticklabels=x_axis_label_option),
298298
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chr_pos_tuple_indices,
299299
ticktext=chr_pos_tuple_list,tickfont_size=font_size,hovermode=true,automargin=true)
300300
)
@@ -307,7 +307,7 @@ function dp_heatmap2(input, title, chrom_label_info, sample_names,chr_pos_tuple_
307307
layout = Layout(
308308
title = "$title_no_underscores",
309309
xaxis=attr(title="Sample ID", showgrid=false, zeroline=false, tickvals=sample_name_indices,
310-
ticktext=sample_names, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
310+
ticktext=sample_names, tickangle=45,showticklabels=x_axis_label_option),
311311
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chr_pos_tuple_indices,
312312
ticktext=chr_pos_tuple_list,tickfont_size=font_size,hovermode=true,automargin=true,showticklabels=false)
313313
)
@@ -383,7 +383,7 @@ if y_axis_label_option == "chromosomes"
383383

384384
xaxis=attr(title="Sample ID (Grouped by $(group1_label) | $(group2_label))",
385385
showgrid=false, zeroline=false, tickvals=sample_name_indices,
386-
ticktext=id_list, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
386+
ticktext=id_list, tickangle=45,showticklabels=x_axis_label_option),
387387

388388
yaxis=attr(title="Genomic Location", zeroline=false,
389389
tickvals=chrom_label_indices,ticktext=chrom_labels,
@@ -402,7 +402,7 @@ elseif y_axis_label_option == "positions"
402402

403403
xaxis=attr(title="Sample ID (Grouped by $(group1_label) | $(group2_label))",
404404
showgrid=false, zeroline=false, tickvals=sample_name_indices,
405-
ticktext=id_list, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
405+
ticktext=id_list, tickangle=45,showticklabels=x_axis_label_option),
406406

407407
yaxis=attr(title="Genomic Location", zeroline=false,
408408
tickvals=chr_pos_tuple_indices,
@@ -421,7 +421,7 @@ elseif y_axis_label_option == "hover_positions"
421421
layout = Layout(
422422
title = "$title_no_underscores",
423423
xaxis=attr(title="Sample ID (Grouped by $(group1_label) | $(group2_label))", showgrid=false, zeroline=false, tickvals=sample_name_indices,
424-
ticktext=id_list, tickfont_size=5, tickangle=45,showticklabels=x_axis_label_option),
424+
ticktext=id_list, tickangle=45,showticklabels=x_axis_label_option),
425425

426426
yaxis=attr(title="Genomic Location", zeroline=false, tickvals=chr_pos_tuple_indices,
427427
ticktext=chr_pos_tuple_list,tickfont_size=font_size,hovermode=true,automargin=true,showticklabels=false),

src/vcf_utils_complete.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,9 @@ function select_columns(filename_sample_list::AbstractString, num_array::Array{I
839839

840840
selected_samples_num_array = Matrix(df_selected_samples_num_array)
841841

842-
return selected_samples_num_array,col_selectedcolumns
842+
sample_names=permutedims(col_selectedcolumns)
843+
844+
return selected_samples_num_array,sample_names
843845
end
844846

845847

test/new_vcf_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ dp_num_array,dp_chromosome_labels=combined_all_read_depth_array_functions(sub)
248248
dp_num_array=select_columns("test_files/select_samples_list.txt", dp_num_array, sample_names)
249249
#println("select_columns dp_num_array type is $(typeof(dp_num_array))")
250250
#println("select_columns dp_num_array size is $(size(dp_num_array,1))")
251-
@test typeof(dp_num_array) == Tuple{Array{Int64,2},Array{Any,1}}
251+
@test typeof(dp_num_array) == Tuple{Array{Int64,2},Array{Any,2}}
252252
@test size(dp_num_array,1) == 2
253253
end
254254

viva

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ if parsed_args["heatmap"] == "genotype"
273273
sample_names)
274274
sample_names = col_selectedcolumns
275275

276+
277+
276278
elseif parsed_args["select_samples"] != nothing && length(parsed_args["group_samples"]) == 2
277279
println("Can not select samples with phenotype matrix provided. Please include same sample ids in phenotype matrix as in list of sample names to select.")
278280

@@ -342,6 +344,8 @@ if parsed_args["heatmap"] == "read_depth"
342344
println("Selecting samples listed in $(parsed_args["select_samples"])")
343345
dp_num_array,col_selectedcolumns = select_columns(parsed_args["select_samples"], dp_num_array, sample_names)
344346
sample_names=col_selectedcolumns
347+
348+
345349
elseif parsed_args["select_samples"] != nothing && length(parsed_args["group_samples"]) == 2
346350
println("Can not select samples with phenotype matrix provided. Please include same sample ids in phenotype matrix as in list of sample names to select.")
347351
end
@@ -369,6 +373,8 @@ if parsed_args["heatmap"] == "read_depth"
369373
println("Selecting samples listed in $(parsed_args["select_samples"])")
370374

371375
dp_num_array,col_selectedcolumns = select_columns(parsed_args["select_samples"], dp_num_array, sample_names)
376+
sample_names=col_selectedcolumns
377+
372378

373379
elseif parsed_args["select_samples"] != nothing && length(parsed_args["group_samples"]) == 2
374380
println("Can not select samples with phenotype matrix provided. Please include same sample ids in phenotype matrix as in list of sample names to select.")
@@ -444,8 +450,7 @@ if parsed_args["heatmap"] == "genotype,read_depth" || parsed_args["heatmap"] ==
444450
println("Can not select samples with phenotype matrix provided. Please include same sample ids in phenotype matrix as in list of sample names to select.")
445451

446452
end
447-
448-
graphic = VariantVisualization.genotype_heatmap2(gt_num_array,title,chrom_label_info,sample_names,chr_pos_tuple_list,y_axis_label_option,x_axis_label_option)
453+
graphic = VariantVisualization.genotype_heatmap2(gt_num_array,title,chrom_label_info,sample_names,chr_pos_tuple_list,y_axis_label_option,x_axis_label_option)
449454
end
450455

451456
println("Saving genotype heatmap")

0 commit comments

Comments
 (0)