---
# System prepended metadata

title: Class 9/17/20

---

# Class 9/17/20 

Variant Visualization.jl: https://github.com/compbiocore/VariantVisualization.jl
Examples we'll work through below: https://github.com/compbiocore/VariantVisualization.jl/blob/master/docs/src/examples.md
On CRC: 
-copy files from CRC folder: 
```
cp /tmp/ND_ICG_SEP_17/* .
module load julia/1.4
julia
]
add VariantVisualization
# On CRC, permissions prevent symlink from building (trying to install to root directories that not all users have access to on the CRC), so this will produce an error
ctrl+c
cd ~/.julia/packages/VariantVisualization/1yoNl
./viva #needs to be added to PATH to work outside of this directory
export PATH=""$PATH:./julia/packages/VariantVisualization/1yoNl
#This adds directory to path temporarily(i.e., for this session only), to add permanantly, need to edit PATH, see external links below for more information on this, but here's one way to do it. Modify so the directory path includes your netid
    ln -s afs/crc.nd.edu/user/c/crivaldi/.julia/packages/VariantVisualization/1yoNl ./local/bin
    #this adds a softlink to your /bin/ directory, which is already in your path
viva
viva -f test_4X_191.vcf -t Default_Options -s png
```
If viva is not in your path, use absolute path to execute Viva, example below: 
```
/afs/crc.nd.edu/user/c/crivaldi/.julia/packages/VariantVisualization/1yoNl/viva -f test_4X_191.vcf -t Default_Options -s png

```
### Log into FastX
:::info
Reminder - logging into FastX requires you to open a browser from your local machine, and entering ```crcfe01.crc.nd.edu``` in the address bar. You'll then be prompted to enter your username and password, and then start a new session. Choose 'gnome', and you'll see a display of a desktop.
:::
Under activites, you can open the files and navigate to your output folder, then click on a png as you would on your local machine. 
If your viva command completed successfully, look at newly created png image (screenshot showing output from fastx session below)
![](https://i.imgur.com/WwDLGvj.png)

You'll notice that in class, we showed html files being produced with this command, but they're not produced when you run from the terminal you used to ssh into the CRC. This has to do with the way the CRC displays visual data, so to workaround, we'll try this command from a FastX session. 

You can also open a terminal from the Activities menu and continue work in Viva to produce the html files seen in class. These are interactive and allow you to hover over points in the figure to see more information about the variation seen. 

From terminal in FastX session: 
```
module load julia/1.4
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 -s png

```
### finished here 9/17/20
---




:::info
Note on installation and final project - look at [build.jl](https://github.com/compbiocore/VariantVisualization.jl/blob/master/deps/build.jl) in VariantVisualization.jl, see how it is being installed. Watch lecture for walkthrough of this file and how it differs from what you will want to do for your package, particularly as it relates to installing on CRC. 


:::

## External Links
[Adding to path in Linux](https://linuxize.com/post/how-to-add-directory-to-path-in-linux/)