Last data update: 2014.03.03

R: Choosing a threshold based on the...
selectRhoR Documentation

Choosing a threshold based on the Scale-Free-Topology-Criterion

Description

Determine the threshold parameter which will result in a network with optimal scale-free fitness.

Usage

selectRho(simMat, rhovec = NULL)

Arguments

simMat

The GO-similairty matrix. Missing and negative entries are not allowed. The gene names should be assigned to the row and column names.

rhovec

a vector of candidate thresholds, or if NULL, a set of thresholds chosen according to the range of the similarity matrix.

Details

The scale-free fitness measure is based on linear-regression-based R-squared goodness-of-fit measure.

Value

A list, with elements:

criterion

a summary table of the candidate thresholds' resulting fits.

bestrho

The candidate threshold with the highest R-squared.

Note

Note that certain GO-similarity measures are unbounded (e.g. the Resnik similarity). This code will not normalize the similarity matrix, and rhovec, if supplied, should be chosen according to the range of the GO-similarity values inside simMat.

Author(s)

Billy Chang

References

Chang, B., Kustra, R. and Tian, WD (2012) Functional-Network-based Gene Set Analysis using Gene Ontology. Submitted.

Zhang, B. and Horvath, S. (2005) A General Framework for Weighted Gene Co-Expression Network Analysis. Statistical Applications in Genetics and Molecular Biology. 4:1:A17.

See Also

getGNET

Examples

#Not to Run
data("simMatSmall",package="GOGANPA")
fit <- selectRho(simMatSmall)
plot(fit$criterion[,1],fit$criterion[,2])
abline(v=fit$bestrho,col=2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GOGANPA)
Loading required package: GANPA
Loading required package: GANPAdata
Loading required package: WGCNA
Loading required package: dynamicTreeCut
Loading required package: fastcluster

Attaching package: 'fastcluster'

The following object is masked from 'package:stats':

    hclust


==========================================================================
*
*  Package WGCNA 1.51 loaded.
*
*    Important note: It appears that your system supports multi-threading,
*    but it is not enabled within WGCNA in R. 
*    To allow multi-threading within WGCNA with all available cores, use 
*
*          allowWGCNAThreads()
*
*    within R. Use disableWGCNAThreads() to disable threading if necessary.
*    Alternatively, set the following environment variable on your system:
*
*          ALLOW_WGCNA_THREADS=<number_of_processors>
*
*    for example 
*
*          ALLOW_WGCNA_THREADS=4
*
*    To set the environment variable in linux bash shell, type 
*
*           export ALLOW_WGCNA_THREADS=4
*
*     before running R. Other operating systems or shells will
*     have a similar command to achieve the same aim.
*
==========================================================================



Attaching package: 'WGCNA'

The following object is masked from 'package:stats':

    cor

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GOGANPA/selectRho.Rd_%03d_medium.png", width=480, height=480)
> ### Name: selectRho
> ### Title: Choosing a threshold based on the Scale-Free-Topology-Criterion
> ### Aliases: selectRho
> 
> ### ** Examples
> 
> #Not to Run
> data("simMatSmall",package="GOGANPA")
> fit <- selectRho(simMatSmall)
GOGANPA ignore self-links, diagonal entries of simMat set to 0. 
checking rho = 0.09387405 Rsq = 0.6696135 Slope = 1.060966 
checking rho = 0.1773177 Rsq = 0.05382235 Slope = 0.1207134 
checking rho = 0.2607613 Rsq = 0.4896685 Slope = -0.9844767 
checking rho = 0.3442049 Rsq = 0.7280682 Slope = -1.574424 
checking rho = 0.4276485 Rsq = 0.8367218 Slope = -1.950643 
checking rho = 0.5110921 Rsq = 0.3930266 Slope = -3.338275 
checking rho = 0.5945357 Rsq = 0.4001954 Slope = -3.203212 
checking rho = 0.6779793 Rsq = 0.9350007 Slope = -1.832853 
checking rho = 0.7614229 Rsq = 0.3902284 Slope = -3.682924 
checking rho = 0.8448665 Rsq = 0.1593309 Slope = -3.856526 
> plot(fit$criterion[,1],fit$criterion[,2])
> abline(v=fit$bestrho,col=2)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>