Learn R Programming

⚠️There's a newer version (1.2.7) of this package.Take me there.

NetRep

Fast permutation procedure for testing network module replication

An R package containing functions for assessing the replication/preservation of network topology for weighted gene coexpression network modules in one or more independent datasets through permutation testing.

A preprint is available on BioRxiv: A scalable permutation approach reveals replication and preservation patterns of gene coexpression modules

The main function for this package is modulePreservation. Other useful functions include networkProperties for calculating the topological properties of a module, and plotModule for visualising a gene coexpression network module.

Installation

The latest stable version of this package can be installed directly from this Github repository:

library(devtools)
install_github("InouyeLab/NetRep")

If you have rmarkdown installed, a package vignette (tutorial) is also available to install:

install_github("InouyeLab/NetRep", build_vignettes=TRUE)
vignette("NetRep")

But can otherwise be read online at vignettes/NetRep.md

Older versions of NetRep can be installed by specifying the version number in the ref argument:

install_github("InouyeLab/NetRep", ref="v0.61.0")

Testing the package installation

To ensure the package has installed correctly and will run on your system, run the following:

library(testthat)
test_package("NetRep")

Installation troubleshooting

NetRep and its dependencies require several third party libraries to be installed. If not found, installation of the package will fail.

  1. A compiler with C++11 support for the <thread> libary.
  2. A fortran compiler.
  3. BLAS and LAPACK libraries.

OSX

The necessary fortran and C++11 compilers are provided with the Xcode application and subsequent installation of Command line tools. The most recent version of OSX should prompt you to install these tools when installing the devtools package from RStudio. Those with older versions of OSX should be able to install these tools by typing the following command into their Terminal application: xcode-select --install.

Some users on OSX Mavericks have reported that even after this step they receive errors relating to -lgfortran or -lquadmath. This is reportedly solved by installing the version of gfortran used to compile the R binary for your system: gfortran-4.8.2, using the following commands in your Terminal application

curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /

Windows

NetRep can be installed on Windows in R version 3.3.0 or later. The necessary fortran and C++11 compilers are provided with the Rtools program. We recommend installation of NetRep through RStudio, which should prompt the user and install these tools when running devtools::install_github("InouyeLab/NetRep"). You may need to run this command again after Rtools finishes installing.

Linux

If installation fails when compiling NetRep at permutations.cpp with an error about namespace thread, you will need to install a newer version of your compiler that supports this C++11 feature. We have found that this works on versions of gcc as old as gcc-4.6.3.

If installation fails prior to this it is likely that you will need to install the necessary compilers and libraries, then reinstall R. For C++ and fortran compilers we recommend installing g++ and gfortran from the appropriate package manager for your operating system (e.g. apt-get for Ubuntu). BLAS and LAPACK libraries can be installed by installing libblas-dev and liblapack-dev. Note that these libraries must be installed prior to installation of R.

Copy Link

Version

Install

install.packages('NetRep')

Monthly Downloads

469

Version

1.0.2

License

GPL-2

Maintainer

Scott Ritchie

Last Published

July 29th, 2016

Functions in NetRep (1.0.2)

checkIsMatrix

Check whether an object is a 'matrix' or a 'disk.matrix'
combineAnalyses

Combine results of multiple permutation procedures
load.bigMatrix

Load a 'bigMatrix' (deprecated)
combineAnalysesInternal

Combine results of multiple permutation procedures
checkPlotArgs

Validate plot function arguments
any.disk.matrix

Check if any objects are a 'disk.matrix'
addGradientLegend

Plot a color palette legend
areColors

Check if a character vector of colors is valid
CheckFinite

Check whether there are any non-finite values in a matrix
common_params

Template parameters
correlation.palette

Color palette for correlation heatmaps
contingencyTable

Calculate a contigency table of module overlap between datasets
forceLim

Get the plot limits to set for the desired plot window
insert.nas

Insert NAs into a vector at specified positions
getColFromPalette

Map a variable to a color gradient
getModuleMidPoints

Get module mid-points on the x-axis
getModuleBreaks

Get module break points on the x-axis
IntermediateProperties

Calculate the intermediate network properties in the discovery dataset
filterInternalProps

Filter structure returned by 'netPropsInternal' to specified test datasets
emptyPlot

Create an empty plot window with the specified limits
NetPropsNoData

Calculate the network properties, data matrix not provided
NetRep

Fast permutation procedure for testing network module replication
IntermediatePropertiesNoData

Calculate the intermediate network properties in the discovery dataset
matchsub

Value Matching and Subsetting
networkProperties

Calculate the topological properties for a network module
network.palette

Color palette for network heatmaps
netPropsInternal

Internal function for calculating 'networkProperties'
NetProps

Calculate the network properties
modulePreservation

Replication and preservation of network modules across datasets
loadIntoRAM

Load a 'disk.matrix' into RAM
pkgReqCheck

Silently check and load a package into the namespace
nodeOrder

Order nodes in descending order of weighted degree and order modules by the similarity of their summary vectors.
orderAsNumeric

Order the module vector numerically
PermutationProcedureNoData

Multithreaded permutation procedure for module preservation statistics
PermutationProcedure

Multithreaded permutation procedure for module preservation statistics
nodeOrderInternal

Internal use function for calculating node order
orderModules_param

Template parameters
permutation

Permutation test P-values for module preservation statistics
permp

Exact permutation p-values wrapper
plot_params

Template parameters
processInput

Process, check, and format input
sampleOrder

Order samples within a network.
plotMultiBar

Plot multiple horizontal bar plots
plotSquareHeatmap

Plot a square heatmap
plotTopology

Plot a topological feature of network module
prettyPath

Convert an absolute file path to a relative one if possible
plotTriangleHeatmap

Plot a symmetric heatmap as a triangle
plotProps

Get the network properties and order for a plot
plotBar

Custom bar plot function
plotModule

Plot the topology of a network module
sortModuleNames

Get a sorted list of module names
sampleOrderInternal

Internal use function for calculating sample order
vCat

Verbose Concatenate and Print with Indentation
Scale

Scale data across all nodes
verifyDatasetOrder

Verify a 'list' input ordering
simplifyList

Remove unnecessary list structure
simplify_param

Template parameters