An R package for Standardized Summary, Annotation, Comparison, and Visualization of CNV, CNVR and ROH
Main functions and outputs form HandyCNV
This package was originally designed for the Post-analysis of CNV results inferred from PennCNV and CNVPartition (GenomeStudio). However, it has now been expanded to accept input files in standard formats for a wider range of applications. Our motivation is to provide a standard, reproducible and time-saving pipeline for the post-analysis of CNVs and ROHs detected from SNP genotyping data for the majority of diploid Species. The functions provided in this package can be categorised into five sections: Conversion, Summary, Annotation, Comparison and Visualization. The most useful features provided are: integrating summarized results, generating lists of CNVR, annotating the results with known gene positions, plotting CNVR distribution maps, and producing customised visualisations of CNVs and ROHs with gene and other related information on one plot. This package also supports a range of customisations, including the colour, size of high resolution figures, and output folder, avoiding conflict between the results of different runs. Running through all functions detailed in the vignette could help us to identify and explore the most interesting genomic regions more easily.
The details examples please visit our Github pages: https://jh-zhou.github.io/HandyCNV/
First, to run this package, we need to make sure that R (Version >= 3.5.2) is installed in your computer (R download link: https://www.r-project.org/). Once R is installed, the 'HandyCNV' package can be installed from Github repository by running the following script. If you rarely used R, it may take more time to install the 'HandyCNV' for the first time.
install.packages("remotes") # Run this code if you haven't install 'remotes' package before
remotes::install_github(repo = "JH-Zhou/HandyCNV@v1.1.7")
If the first method cannnot work well for some reasons, we can manually download the 'Source code (Zip)' from the newly released tag at here: Download Source Code
Then install the Source Code from the local path by following code:
install.packages("remotes") # Run this code if you haven't install 'remotes' package before
remotes::install_local(path = "C:/Users/HandyCNV-1.1.7.zip") # Repalce 'C:/Users/' to your local path where you downloaded the Source Code
Then, we need to load the 'HandyCNV' package in order to run the following examples. This can be done using the library
function as shown below.
```{r setup}
library(HandyCNV)
# What issues can this package solve?
Click the following link to browse the output in examples.
[1. How do we prepare the standard cnv input file for HandyCNV and get a quick summary?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#1-how-do-we-prepare-the-standard-cnv-input-file-for-handycnv-and-get-a-quick-summary-)
[2. How do we visualise CNVs?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#1-how-do-we-prepare-the-standard-cnv-input-file-for-handycnv-and-get-a-quick-summary-)
[3. What types of summary plots are available?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#3-what-types-of-summary-plots-are-available-)
[4. How do we generate CNVRs (CNV Regions) from CNV results?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#4-how-do-we-generate-cnvrs-cnv-regions-from-cnv-results-)
[5. How do we annotate genes for CNVRs and CNVs?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#5-how-do-we-annotate-genes-for-cnvrs-and-cnvs-)
[6. How to plot CNVR distribution map?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#6-how-to-plot-cnvr-distribution-map-)
[7. How can we plot all high frequency CNVRs at once?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#7-how-can-we-plot-all-high-frequency-cnvrs-at-once-)
[8. Can we compare CNVs between different result sets?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#8-can-we-compare-cnvs-between-different-result-sets-)
[9. What about CNVRs?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#9-what-about-cnvrs-)
[10. How do we find the consensus set of genes common to multiple CNV result sets?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#10-how-do-we-find-the-consensus-set-of-genes-common-to-multiple-cnv-result-sets-)
[11. How can we create the map file used in HandyCNV, to allow comparing CNVs between different reference genomes?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#11-how-can-we-create-the-map-file-used-in-handycnv-to-allow-comparing-cnvs-between-different-reference-genomes-)
[12. How can we integrate the CNVs and annotated genes with additional information, such as Log R ratio, B Allele Frequency, call rate, heterozygosity, missing value rate and Linkage Disequilibrium, and plot it as one figure?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#12-how-can-we-integrate-the-cnvs-and-annotated-genes-with-additional-information-such-as-log-r-ratio-b-allele-frequency-call-rate-heterozygosity-missing-value-rate-and-linkage-disequilibrium-and-plot-it-as-one-figure-)
[13. How can we make a plot to show the source of the CNVs?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#13-how-can-we-make-a-plot-to-show-the-source-of-the-cnvs-)
[14. How can we plot just the genes in a specific region, to save as a seperate figure?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#14-how-can-we-plot-just-the-genes-in-a-specific-region-to-save-as-a-seperate-figure-)
[15. How can we find regions with high frequencies of runs of homozygosity?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#15-how-can-we-find-regions-with-high-frequencies-of-runs-of-homozygosity-)
[16. How do we visualize ROHs?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#16-how-do-we-visualise-rohs-)
[17. How do we get haplotype for ROH region?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#17-how-do-we-get-haplotype-for-roh-region-)
[18. How do we convert coordinates for CNV, CNVR, ROH, or any other intervals?](https://jh-zhou.github.io/HandyCNV/articles/HandyCNV.html#18-how-do-we-convert-coordinates-for-cnv-cnvr-roh-or-any-other-intervals-)
# Feature request
If you have any special requirements for this package, please feel free to sumbit your demands via this link: [Submit Requirments](https://github.com/JH-Zhou/HandyCNV/issues/new?assignees=&labels=&template=feature-request.md), we are happy to add the new features to meet your needs.
# Bug report
If you find any errors while using this package, please tell us via this link: [Bug Report](https://github.com/JH-Zhou/HandyCNV/issues/new?assignees=&labels=&template=bug_report.md), we will fix it as soon as possible.
# Citation
If this tool is useful for your academic research, please cite our publication: [Browse publication](https://www.frontiersin.org/articles/10.3389/fgene.2021.731355/abstract)
Citation: Zhou J, Liu L, Lopdell TJ, Garrick DJ and Shi Y (2021). HandyCNV: Standardized Summary, Annotation, Comparison and Visualization of CNV, CNVR, and ROH. Front. Genet. 12:731355. doi: 10.3389/fgene.2021.731355
# Current release: HandyCNV v1.1.7 Release Date: 2021/09/24
# What's news
1. New feature to visualize the haplotype that generated from get_haplotype()
```{r}
haplo_visual(haplotype = haplotype_letter, xlab_text = "BMP7 Gene ")
Minor modifications, such as unifying input file formats and correcting spelling errors.

2. Revised CNVs status distribution plot in 'cnv_summary_plot' function, force to appear the boxplot and line on chromosome that has no CNVs.
# Previous release: HandyCNV v1.1.2 Release Date: 2021/04/18
# What's news
Corrected the version number.
# Released Version: HandyCNV v1.1.1 Release Date: 2021/04/14
# What's news
## 1. Update call_cnvr.R …
1. The CNV list could only be loaded from the local directory through a 'Path' before, now supports to read data from working environment by checking the type of input file;
2. Support to return the CNVR list to working environment.
## 2. Update cnv_clean.R …
1. Support to return Clean CNV List to working environment.
## 3. Update cnv_visualising.R …
1. Support to load CNV List from working environment.
## 4. Update compare_cnvr.R …
1. Add new function to generate the Unique and Mutual CNVRs by uniting the overlapped CNVRs between two results. There are two purposes of this work, one is to better understand the overlapping CNVRs, the other is to mark the common regions on CNVR distribution map in 'cnvr_plot' function;
## 5. Update 'cnvr_plot' …
1. Add 'overlap_cnvr' argument to support to mark overlapped region on CNVR distribution map;
2. Add 'label_prop' argument to show the proportion of CNVRs length to total length of relative chromosome on CNVR map;
3. Add 'chr_col' argument to customize the color of Chromosome;
4. Add 'overlap_col' argument to customize color of overlapped CNVRs
5. Reduce the margin of final CNVR distribution map.
### New feature demo
```{r}
# Demo code:
cnvr_plot(cnvr = "./cnvr_combine_part_penn_umd/cnvr.txt", assembly = "UMD",
sample_size = 388, common_cnv_threshold = 0.05,
overlap_cnvr = "./compare_cnvr_Penn_UMD_Vs_Part_UMD/common_cnvr.txt",
gain_col = "deeppink1", loss_col = "deepskyblue3", mixed_col = "springgreen3",
folder = "./cnvr_combine_part_penn_umd/cnvr_map_common")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.