Contents

1 Installation

1.1 Required dependencies

inferCNV uses the R packages ape, BiocGenerics, binhf, caTools, coda, coin, dplyr, doparallel, edgeR, fastcluster, fitdistrplus, foreach, futile.logger, future, gplots, ggplot2, HiddenMarkov, reshape, rjags, RColorBrewer, SingleCellExperiment, SummarizedExperiment and imports functions from the archived GMD.

1.2 Installing

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("infercnv")

1.3 Optional extension

If you want to use the interactive heatmap visualization, please check the add-on packge R inferCNV_NGCHM after installing the packages tibble, tsvio and NGCHMR. To install optional packages, type the following in an R command window:

install.packages("tibble")

install.packages("devtools")
devtools::install_github("bmbroom/tsvio")
devtools::install_github("bmbroom/NGCHMR", ref="stable")
devtools::install_github("broadinstitute/inferCNV_NGCHM")

And download the NGCHM java application by typing the following in a regular shell:

wget http://tcga.ngchm.net/NGCHM/ShaidyMapGen.jar

2 Running InferCNV

2.1 Create the InferCNV Object

Reading in the raw counts matrix and meta data, populating the infercnv object

infercnv_obj = CreateInfercnvObject(
  raw_counts_matrix="../inst/extdata/oligodendroglioma_expression_downsampled.counts.matrix.gz",
  annotations_file="../inst/extdata/oligodendroglioma_annotations_downsampled.txt",
  delim="\t",
  gene_order_file="../inst/extdata/gencode_downsampled.EXAMPLE_ONLY_DONT_REUSE.txt",
  ref_group_names=c("Microglia/Macrophage","Oligodendrocytes (non-malignant)"))
## INFO [2020-04-27 23:28:00] Parsing matrix: ../inst/extdata/oligodendroglioma_expression_downsampled.counts.matrix.gz
## INFO [2020-04-27 23:28:02] Parsing gene order file: ../inst/extdata/gencode_downsampled.EXAMPLE_ONLY_DONT_REUSE.txt
## INFO [2020-04-27 23:28:02] Parsing cell annotations file: ../inst/extdata/oligodendroglioma_annotations_downsampled.txt
## INFO [2020-04-27 23:28:02] ::order_reduce:Start.
## INFO [2020-04-27 23:28:02] .order_reduce(): expr and order match.
## INFO [2020-04-27 23:28:03] ::process_data:order_reduce:Reduction from positional data, new dimensions (r,c) = 10338,184 Total=18322440.6799817 Min=0 Max=34215.
## INFO [2020-04-27 23:28:03] num genes removed taking into account provided gene ordering list: 399 = 3.8595473012188% removed.
## INFO [2020-04-27 23:28:03] validating infercnv_obj

2.2 Running the full default analysis

out_dir = tempfile()
infercnv_obj_default = infercnv::run(
    infercnv_obj,
    cutoff=1, # cutoff=1 works well for Smart-seq2, and cutoff=0.1 works well for 10x Genomics
    out_dir=out_dir,
    cluster_by_groups=TRUE, 
    plot_steps=FALSE,
    denoise=TRUE,
    HMM=FALSE,
    no_prelim_plot=TRUE,
    png_res=60
)

Basic ouput from running inferCNV.

3 Additional Information

3.1 Online Documentation

For additional explanations on files, usage, and a tutorial please visit the wiki.

3.2 TrinityCTAT

This tool is a part of the TrinityCTAT toolkit focused on leveraging the use of RNA-Seq to better understand cancer transcriptomes. To find out more please visit TrinityCTAT

4 Session info

## R version 4.0.0 RC (2020-04-19 r78255)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.4 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.12-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.12-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] infercnv_1.5.0   BiocStyle_2.17.0
## 
## loaded via a namespace (and not attached):
##   [1] nlme_3.1-147                bitops_1.0-6               
##   [3] matrixStats_0.56.0          doParallel_1.0.15          
##   [5] RColorBrewer_1.1-2          GenomeInfoDb_1.25.0        
##   [7] tools_4.0.0                 R6_2.4.1                   
##   [9] KernSmooth_2.23-17          BiocGenerics_0.35.0        
##  [11] colorspace_1.4-1            npsurv_0.4-0               
##  [13] gridExtra_2.3               tidyselect_1.0.0           
##  [15] compiler_4.0.0              argparse_2.0.1             
##  [17] Biobase_2.49.0              formatR_1.7                
##  [19] DelayedArray_0.15.0         sandwich_2.5-1             
##  [21] bookdown_0.18               caTools_1.18.0             
##  [23] scales_1.1.0                mvtnorm_1.1-0              
##  [25] stringr_1.4.0               digest_0.6.25              
##  [27] rmarkdown_2.1               XVector_0.29.0             
##  [29] pkgconfig_2.0.3             htmltools_0.4.0            
##  [31] limma_3.45.0                rlang_0.4.5                
##  [33] zoo_1.8-7                   jsonlite_1.6.1             
##  [35] gtools_3.8.2                dplyr_0.8.5                
##  [37] RCurl_1.98-1.2              magrittr_1.5               
##  [39] modeltools_0.2-23           GenomeInfoDbData_1.2.3     
##  [41] futile.logger_1.4.3         Matrix_1.2-18              
##  [43] Rcpp_1.0.4.6                munsell_0.5.0              
##  [45] S4Vectors_0.27.0            ape_5.3                    
##  [47] lifecycle_0.2.0             stringi_1.4.6              
##  [49] multcomp_1.4-13             yaml_2.2.1                 
##  [51] edgeR_3.31.0                MASS_7.3-51.6              
##  [53] SummarizedExperiment_1.19.0 zlibbioc_1.35.0            
##  [55] plyr_1.8.6                  gplots_3.0.3               
##  [57] grid_4.0.0                  gdata_2.18.0               
##  [59] parallel_4.0.0              listenv_0.8.0              
##  [61] crayon_1.3.4                lattice_0.20-41            
##  [63] splines_4.0.0               findpython_1.0.5           
##  [65] locfit_1.5-9.4              knitr_1.28                 
##  [67] pillar_1.4.3                fastcluster_1.1.25         
##  [69] GenomicRanges_1.41.0        codetools_0.2-16           
##  [71] stats4_4.0.0                futile.options_1.0.1       
##  [73] glue_1.4.0                  evaluate_0.14              
##  [75] lsei_1.2-0                  lambda.r_1.2.4             
##  [77] BiocManager_1.30.10         vctrs_0.2.4                
##  [79] foreach_1.5.0               tidyr_1.0.2                
##  [81] gtable_0.3.0                purrr_0.3.4                
##  [83] reshape_0.8.8               future_1.17.0              
##  [85] assertthat_0.2.1            ggplot2_3.3.0              
##  [87] xfun_0.13                   coin_1.3-1                 
##  [89] libcoin_1.0-5               coda_0.19-3                
##  [91] rjags_4-10                  survival_3.1-12            
##  [93] SingleCellExperiment_1.11.0 tibble_3.0.1               
##  [95] iterators_1.0.12            IRanges_2.23.0             
##  [97] globals_0.12.5              fitdistrplus_1.0-14        
##  [99] TH.data_1.0-10              ellipsis_0.3.0