Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa3ec66
commit b83f703
Showing
11 changed files
with
102 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
Package: netassoc | ||
Type: Package | ||
Title: Inference of Species Associations from Co-Occurrence Data | ||
Version: 0.6.0 | ||
Date: 2015-08-26 | ||
Version: 0.6.2 | ||
Date: 2015-11-23 | ||
Author: Benjamin Blonder, Naia Morueta-Holme | ||
Maintainer: Benjamin Blonder <bblonder@gmail.com> | ||
Description: Infers species associations from community matrices. Uses local and (optional) regional-scale co-occurrence data by comparing observed partial correlation coefficients between species to those estimated from regional species distributions. Extends Gaussian graphical models to a null modeling framework. Provides interface to a variety of inverse covariance matrix estimation methods. | ||
License: GPL-3 | ||
Depends: igraph | ||
Depends: igraph, infotheo | ||
Imports: rags2ridges, corpcor, huge, vegan | ||
NeedsCompilation: no | ||
Packaged: 2015-09-09 17:24:16 UTC; benjaminblonder | ||
Packaged: 2015-11-23 21:40:00 UTC; benjaminblonder | ||
Repository: CRAN | ||
Date/Publication: 2015-09-09 21:19:28 | ||
Date/Publication: 2015-11-24 07:46:52 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
82260df8240b082ada9f47a00c054317 *DESCRIPTION | ||
f2dc20ae5f05ced7d041f87c925f41b6 *NAMESPACE | ||
cb225004cdc2bce35851bc7b34149c24 *DESCRIPTION | ||
9f25089fefe79e2a8c12e30938a3fd6d *NAMESPACE | ||
c39460d085cf3ce914cf94344b1f47c3 *R/generate_nul_resample.R | ||
e7657f7b50c214b6f461f12decb9d62e *R/make_netassoc_network.R | ||
b09a0db03fbdd4cd99b9ac739ab71a0f *R/partial_correlation.R | ||
f604d7aef6e660454cae70cb17c8a9ee *R/plot.R | ||
960dff4b833ab53ac8f1adfd533d2257 *man/make_netassoc_network.Rd | ||
18f84bb3a4de3bea3605babafd4ffff5 *man/netassoc-package.Rd | ||
0da717e3c3000fa8d3c0549220db32c0 *R/make_netassoc_network.R | ||
7b95b8c6278534ba92d0d10d054c829e *R/pairwise_association.R | ||
19a162e0145463d76e3b70b479c5d452 *R/partial_correlation.R | ||
0ce37ad1bcd9a0de4ee01bb565d04f47 *R/plot.R | ||
e37052ada824878367e60059827bfc2f *man/make_netassoc_network.Rd | ||
8f11cf7649b395ffd95a9d9eb3afd309 *man/netassoc-package.Rd | ||
93226c98aac9dc52931e74d962f4fa5e *man/pairwise_association.Rd | ||
21095f107a35447ed412eb29de5e3bb3 *man/partial_correlation.Rd | ||
b533e6b2c50de93c38845bb5833d404e *man/plot_netassoc_matrix.Rd | ||
db0acf932b7487440e2ef9a22327c715 *man/plot_netassoc_network.Rd | ||
4f5ff85ce0e4f9ab4738fd8423da502c *man/plot_netassoc_network.Rd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
export(plot_netassoc_network, make_netassoc_network, partial_correlation, plot_netassoc_matrix) | ||
export(plot_netassoc_network, make_netassoc_network, partial_correlation, plot_netassoc_matrix, pairwise_association) | ||
import(igraph) | ||
importFrom(rags2ridges, optPenalty.aLOOCV) | ||
importFrom(rags2ridges, optPenalty.LOOCVauto) | ||
importFrom(corpcor, decompose.invcov) | ||
importFrom(corpcor, invcov.shrink) | ||
importFrom(vegan, permatfull) | ||
importFrom(huge, huge) | ||
importFrom(huge, huge.select) | ||
import(infotheo) | ||
importFrom("grDevices", "colorRampPalette", "gray", "rgb") | ||
importFrom("graphics", "box", "image", "plot", "title") | ||
importFrom("stats", "cor", "cov", "na.omit", "p.adjust", "sd") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pairwise_association <- function(mat, method="condentropy") | ||
{ | ||
nsp <- nrow(mat) | ||
m_spxsp <- outer(1:nsp, 1:nsp, FUN=Vectorize(function(i,j) { do.call(method, args=list(X=mat[i,], Y=mat[j,])) })) | ||
|
||
diag(m_spxsp) <- NA | ||
|
||
return(m_spxsp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
\name{pairwise_association} | ||
\alias{pairwise_association} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{ | ||
Pairwise associations | ||
} | ||
\description{ | ||
Computes pairwise associations between every row (species) in a species x site matrix. Note that usage of this function is advantageous when non-symmetric association metrics are desired, but the pairwise computation will prevent accounting for indirect effects between species. As such this function should be considered preliminary, and its use experimental. | ||
} | ||
\usage{ | ||
pairwise_association(mat, method = "condentropy") | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{mat}{ | ||
A m x n (species x site) matrix | ||
} | ||
\item{method}{ | ||
The name of a function to call to calculate an association score. Must take two vector arguments (X,Y) and return a single numeric value. Default argument uses conditional information entropy statistic, although other functions (e.g. Jaccard similarity) are possible. | ||
} | ||
} | ||
\value{ | ||
A n x n (species x species) matrix with NA diagonal values. May be non-symmetric depending on the method used. | ||
} | ||
\examples{ | ||
nsp <- 10 | ||
nsi <- 50 | ||
m_obs <- floor(matrix(rpois(nsp*nsi,lambda=5),ncol=nsi,nrow=nsp)) | ||
m_obs[1,1:(nsi/2)] <- rpois(n=nsi/2,lambda=20) | ||
|
||
spxsp <- pairwise_association(m_obs, method="condentropy") | ||
image(spxsp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters