Git Product home page Git Product logo

cnvscope's Introduction

CNVScope

James Dalgleish

January 24, 2021 Certificate updated today! Message me if any have trouble accessing the server.

CNVScope is a visualization toolkit for seeing copy number data in a relationship fashion, both utilizing tools that find regions of interest (much like domains in Hi-C terminology), visualize the relationships in vibrant color (blue for negative association, red for positive), and integrates several different relevant types of data (RNASeq, sample information, Cancer Gene Census data, and structural variants). Structural variants like rearrangements can be thought of as interactions between genomic regions, which is why it makes sense to build GenomicInteractions objects and from this, interaction matrices that can be easily visualized.

Installation

The package is intended for users with experience in the R programming language. Non-R users should use the public site: http://cnvscope.nci.nih.gov

The program should install using the following code:

install.packages("CNVScope")

To install the development version (may have more features), please use:

remotes::install_github("jamesdalg/CNVScope")
CNVScope::runCNVScopeLocal()

For those having difficulty, we provide more detailed instructions below:

Installation works best if base R and R tools are up to date.

  1. install R directly from the Comprehensive R Archive Network (CRAN): https://cran.r-project.org/index.html Windows:https://cran.r-project.org/bin/windows/base/ Macintosh: https://cran.r-project.org/bin/macosx/
  2. Install RStudio. If running macintosh, install Xcode when prompted.
  3. Install the appropriate compilation tools for your operating system: a. For windows, please download & install the latest version of RTools: https://cran.r-project.org/bin/windows/Rtools/ b. For macintosh, be sure to install the latest version of gfortran and clang (make sure these install AFTER Xcode, so that it overwrites the existing clang installation): https://cran.r-project.org/bin/macosx/tools/
  4. Install Bioconductor Dependencies, set allowed repositories, and install the package: Run the following on the R command line:
install.packages("BiocManager")
BiocManager::install(c("DNAcopy","GenomeInfoDb","BSgenome.Hsapiens.UCSC.hg19"))
setRepositories(ind=c(1:2))
install.packages("CNVScope")

The package is now installed and should contain the vignettes, functions, and help files.

  1. To install the app data (several GB), use the following lines:
install.packages("remotes")
CNVScope::runCNVScopeLocal()

Please wait for the package to finish downloading. It is a large package that contains all of the Neuroblastoma Data and may take some time. In the meantime, feel free to browse our public server: https://cnvscope.nci.nih.gov

App

The app includes several components and starts with a customizable control panel. As an example, we’ll search for TERT and TP53. tert-tp53 control panel example

Doing it this way creates a zoomed in plot of the copy number relationships between the chromosomes containing TERT (chromosome 5) and TP53 (chromosome 17), zoomed into the specific region for those particular genes (as denoted in the search box). For many regions, we can rely on the tooltip for genes, but this region is particularly gene dense and it’s best to simply click on the region of interest. The row and column genes are searchable here and will aid us to understand that we’re in the right place. tert-tp53 zoomed with click

Clicking on the cancer gene census tab will lead us to the genes that are found within the cancer gene census, (a curated list of cancer genes)[https://cancer.sanger.ac.uk/census]. Corresponding info suggests what cancers associated with the gene, mechanism of action (if known), and tissue types.

The sample level information will lead us to a series of plots (histogram, scatter, a colored linear regression plot) that will get at the underlying data behind the negative log p-value, and help us detect outliers, look at clusterings of samples, and see if the regression p-value is driven by a variety of points from different cancer types rather than just an outlier or a group of outliers. All the plots are zoomable and a slider for opacity has been provided for the histogram to more clearly see distributions that might tightly overlap.

Expression data is provided for neuroblastoma, sorting the most variable genes to the top for the specific set of chromosomal regions for the clicked point.

Finally, a whole genome view is provided to give the viewer a sense of the complexity and domains of the neuroblastoma interactome and to encourage further exploration of subpoints. The slider allows the user to select the saturation limit and thereby see domains that otherwise would be invisible due to the high values on the diagonal.

tert-tp53 walkthrough

Package

The package focuses on methods of analyzing these matrices and constructing components for app use. See the following vignettes for more information (also available on command line):

Creating the Input matrix from public data

Linear Regression/Postprocess

Video Tutorial

For a complete video tutorial (16 minutes in length), click here.

Additional Examples

Feel free to look at the additional examples vignette. We have several GDC datasets that demonstrate that our package is a versatile toolkit that is useful for NBL, as well as SKCM (Skin Cancer), BLCA (bladder cancer), AML (Acute Myleoid Leukemia), and PRAD (Prostate Cancer). We also demonstrate our copy number relationship weighting function as well as contour and 3D representations. The final example, of BLCA chr17, is shown below. Click here to download an interactive HTML version.

3D BLCA, chromosome 17, interactive BLCA, chromosome 17, with contours BLCA, chromosome 17, probdist nonlinear-linear relationship differences

cnvscope's People

Contributors

jamesdalg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cnvscope's Issues

namespace locked

CNVScope::runCNVScopeShiny(baseurl = "~", basefn = "")
Error in registerNames(names, package, ".global", add) :
The namespace for package "CNVScope" is locked; no changes in the global variables list may be made.

BiocGenerics, S4Vectors, Genomic Ranges version dependencies.

https://support.bioconductor.org/p/125313/#125317

This is an issue with upstream dependencies for those that get a S4Vectors version requirement they can't fulfill. I have posted a workaround until Bioconductor fixes it.
remotes::install_github("Bioconductor/BiocGenerics")
remotes::install_github("Bioconductor/S4Vectors")
remotes::install_github("Bioconductor/IRanges")
remotes::install_github("Bioconductor/GenomicRanges")
From this point, the user should not have issues installing CNVScope because of packages that had required dependencies that are not yet available.

<simpleError in is_string(expr): argument "expr" is missing, with no default>

This originates to a change in tidyr::unite() found on four lines. Simply changing this:
TCGA_low_pass_sample_info$pos<- tidyr::unite(TCGA_low_pass_sample_info,pos,bins.seqnames,bins.start,bins.end)$pos
to this:
TCGA_low_pass_sample_info$pos<-tidyr::unite(TCGA_low_pass_sample_info[,c(1:3)])
solves the issue.

odd segfault with HiCseg; help needed to replicate

  • using log directory ‘/Users/ripley/R/packages/tests/CNVScope.Rcheck’
  • using R version 4.0.0 alpha (2020-04-05 r78150)
  • using platform: x86_64-apple-darwin17.0 (64-bit)
  • using session charset: UTF-8
  • using option ‘--no-stop-on-test-error’
  • checking for file ‘CNVScope/DESCRIPTION’ ... OK
  • checking extension type ... Package
  • this is package ‘CNVScope’ version ‘2.9.4’
  • checking package namespace information ... OK
  • checking package dependencies ... OK
  • checking if this is a source package ... OK
  • checking if there is a namespace ... OK
  • checking for executable files ... OK
  • checking for hidden files and directories ... OK
  • checking for portable file names ... OK
  • checking for sufficient/correct file permissions ... OK
  • checking whether package ‘CNVScope’ can be installed ... [52s/53s] OK
  • checking installed package size ... OK
  • checking package directory ... OK
  • checking ‘build’ directory ... OK
  • checking DESCRIPTION meta-information ... OK
  • checking top-level files ... OK
  • checking for left-over files ... OK
  • checking index information ... OK
  • checking package subdirectories ... OK
  • checking R files for non-ASCII characters ... OK
  • checking R files for syntax errors ... OK
  • checking whether the package can be loaded ... OK
  • checking whether the package can be loaded with stated dependencies ... OK
  • checking whether the package can be unloaded cleanly ... OK
  • checking whether the namespace can be loaded with stated dependencies ... OK
  • checking whether the namespace can be unloaded cleanly ... OK
  • checking loading without being on the library search path ... OK
  • checking use of S3 registration ... OK
  • checking dependencies in R code ... OK
  • checking S3 generic/method consistency ... OK
  • checking replacement functions ... OK
  • checking foreign function calls ... OK
  • checking R code for possible problems ... [41s/41s] OK
  • checking Rd files ... OK
  • checking Rd metadata ... OK
  • checking Rd cross-references ... OK
  • checking for missing documentation entries ... OK
  • checking for code/documentation mismatches ... OK
  • checking Rd \usage sections ... OK
  • checking Rd contents ... OK
  • checking for unstated dependencies in examples ... OK
  • checking contents of ‘data’ directory ... OK
  • checking data for non-ASCII characters ... OK
  • checking data for ASCII and uncompressed saves ... OK
  • checking installed files from ‘inst/doc’ ... OK
  • checking files in ‘vignettes’ ... OK
  • checking examples ...sh: line 1: 14901 Segmentation fault: 11 LANGUAGE=en R_CHECK_INTERNALS2=1 R_LIBS=/var/folders/gv/f60jb6tn7fxb9sz1yfr7d_vm0000gp/T//RtmpWyM07D/RLIBS_2a8511bb7178 R_ENVIRON_USER='' R_LIBS_USER='' R_LIBS_SITE='no_such_dir' '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla > 'CNVScope-Ex.Rout' 2>&1 < 'CNVScope-Ex.R'
    ERROR
    Running examples in ‘CNVScope-Ex.R’ failed
    The error most likely occurred in:

Name: getAsymmetricBlockIndices

Title: Get Block Indices from an asymmetric (or symmetric) matrix.

Aliases: getAsymmetricBlockIndices

Keywords: CNV Hi-C HiCseg MI breakpoints imputation jointseg multiple

** Examples

load(system.file("extdata","nbl_result_matrix_sign_small.rda",package = "CNVScope"))
submatrix_tiny<-nbl_result_matrix_sign_small
tiny_test<-getAsymmetricBlockIndices(submatrix_tiny)

*** caught segfault ***
address 0x7ff819767260, cause 'memory not mapped'

Traceback:
1: HiCseg::HiCseg_linkC_R(size_mat = dim(genomicmatrix)[1], nb_change_max = nb_change_max, distrib = distrib, mat_data = as.matrix(genomicmatrix), model = model)
2: getAsymmetricBlockIndices(submatrix_tiny)
An irrecoverable exception occurred. R is aborting now ...

  • checking for unstated dependencies in vignettes ... OK
  • checking package vignettes in ‘inst/doc’ ... OK
  • checking re-building of vignette outputs ... [54s/55s] OK
  • checking PDF version of manual ... OK
  • checking for detritus in the temp directory ... OK
  • DONE

Status: 1 ERROR
See
‘/Users/ripley/R/packages/tests/CNVScope.Rcheck/00check.log’
for details.

  373.67 real       345.46 user        20.93 sys

Issues regarding jointseg

A user contacted our group, having trouble installing the package on OSX, and has issues when a dependency (jointseg) is installed from source.
We would suggest the following for this and similar dependency issues on OSX:

  1. install R.3.6.1 so that we can replicate your issue. Unlike windows distributions, older versions between 3.6.1 and 3.3.3 are not available for download.
  2. So that any dependencies that try to install from source work correctly: Install the most current version of clang & gfortran (https://cran.r-project.org/bin/macosx/tools/). From the R for mac OS faq(https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html):
    " In order to compile packages you must install a Clang compiler with OpenMP support, we provide one in the tools section on CRAN: https://cran.r-project.org/bin/macosx/tools/."
  3. Ensure the path for clang is correctly set.
  4. Install dependencies manually that do not install automatically as they should, especially bioconductor packages, using their provided install scripts on their webpages.
    a. For example, the jointseg package depends on the DNAcopy package from bioconductor(https://www.bioconductor.org/packages/release/bioc/html/DNAcopy.html). One can install DNAcopy directly by doing the following:
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("DNAcopy")

Any other bioconductor package follows the same logic. For instance, the following command will install BSgenome for the human genome, version 19:
BiocManager::install("BSgenome.Hsapiens.UCSC.hg19")
The command below will install GenomeInfoDbData and InteractionSet:
BiocManager::install(c("GenomeInfoDbData","InteractionSet"))

b. CRAN dependencies that are not working well can be installed manually as well:
install.packages("jointseg")
One could also download the binary package if it is available for your operating system and install it within Rstudio under tools->install packages. These binaries are found on the CRAN webpages for the individual packages.
For example, installing the data.table from an OSX binary is possible by downloading the tgz file associated with r-release. https://cran.r-project.org/web/packages/data.table/index.html
5. If a windows machine is available, we find that there tend to be more binary packages available for the current version of R (which don't require compilation from source). If you attempt this, be sure to use the most current version of R and RTools.

.Rbuildignore keeps large files in the archive.

Fixed. CRAN only counts the files post install and the current build of the package does not exceed 5MB now. No remaining notes as of version 2.1.4, 3:06PM EST. As of now, we can resubmit to CRAN.

coordinate names don't match expected ("promises::is.promising")

CNVScope::runCNVScopeShiny(basefn="",baseurl ="")

Listening on http://127.0.0.1:3710
Warning: Error in [.data.frame: undefined columns selected
105: h
104: .handleSimpleError
103: stop
102: [.data.frame
101: [ [C:/Users/dalgleishjl/Documents/CNVScope/R/CNVScopeserver.R#305]
100: promises::is.promising [C:/Users/dalgleishjl/Documents/CNVScope/R/CNVScopeserver.R#305]

The fix for this was to set scipen to 999, as implemented in 230c95f.

New issue with reverse dependency logging for the package version of the app.

CNVScope::runCNVScopeShiny()
Loading required package: shiny

Listening on http://127.0.0.1:3049
Warning: Error in sprintf: 'fmt' length exceeds maximal format length 8192
103: h
102: .handleSimpleError
101: sprintf
100: do.call
99: logger$log
98: .levellog
97: logging::logerror
96: handle [C:/Users/dalgleishjl/Documents/CNVScope/R/runCNVScopeShiny.R#65]
95:
94: stop
93:
92: stop
91: value[[3L]]
90: tryCatchOne
89: tryCatchList
88: tryCatch
87: do
86: hybrid_chain
85: origRenderFunc
84: output$plotlyChromosomalHeatmap
83: ..stacktraceon..
82: orig
81: func
80: withCallingHandlers
79: globals$domain$wrapSync
78: promises::with_promise_domain
77: captureStackTraces
76: withCallingHandlers
75: shinyCallingHandlers
74: force
73: globals$domain$wrapSync
72: promises::with_promise_domain
71: private$withCurrentOutput
70: force
69: withVisible
68: withCallingHandlers
67: globals$domain$wrapSync
66: promises::with_promise_domain
65: captureStackTraces
64: doTryCatch
63: tryCatchOne
62: tryCatchList
61: tryCatch
60: do
59: hybrid_chain
58: force
57: withVisible
56: withCallingHandlers
55: globals$domain$wrapSync
54: promises::with_promise_domain
53: captureStackTraces
52: doTryCatch
51: tryCatchOne
50: tryCatchList
49: tryCatch
48: do
47: hybrid_chain
46: observer:output$plotlyChromosomalHeatmap
45: contextFunc
44: env$runWith
43: force
42: globals$domain$wrapSync
41: promises::with_promise_domain
40: withReactiveDomain
39: globals$domain$wrapSync
38: promises::with_promise_domain
37: ctx$run
36: run
35: withCallingHandlers
34: globals$domain$wrapSync
33: promises::with_promise_domain
32: captureStackTraces
31: withCallingHandlers
30: shinyCallingHandlers
29: force
28: withVisible
27: withCallingHandlers
26: globals$domain$wrapSync
25: promises::with_promise_domain
24: captureStackTraces
23: doTryCatch
22: tryCatchOne
21: tryCatchList
20: tryCatch
19: do
18: hybrid_chain
17: flushCallback
16: FUN
15: lapply
14: ctx$executeFlushCallbacks
13: .getReactiveEnvironment()$flush
12: flushReact
11: serviceApp
10: ..stacktracefloor..
9: withCallingHandlers
8: globals$domain$wrapSync
7: promises::with_promise_domain
6: captureStackTraces
5: ..stacktraceoff..
4: runApp
3: do.call
2: print.shiny.appobj
1:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.