network_ps: Create an igraph network object of the co-occurrence from a...

View source: R/network_ps.R

network_psR Documentation

Create an igraph network object of the co-occurrence from a phyloseq object. Function from the phylosmith-package.

Description

Create an igraph network object of the co-occurrence from a phyloseq object. This can be input into the co_occurrence_network function, or used for other network creating scripts. The purpose is to be able to create reproducible and comparable graphics.

Usage

network_ps(phyloseq_obj,
treatment = NULL, subset = NULL, co_occurrence_table = NULL, rho = 0.6)

Arguments

phyloseq_obj

A phyloseq-class object. It must contain sample_data()) with information about each sample, and it must contain tax_table()) with information about each taxa/gene.

treatment

Column name as a string or number in the sample_data. This can be a vector of multiple columns and they will be combined into a new column.

subset

A factor within the treatment. This will remove any samples that to not contain this factor. This can be a vector of multiple factors to subset on.

co_occurrence_table

Table of the co-occurrence of taxa/genes in the phyloseq_obj, computed using co_occurrence. If no table is given, it will be computed with the phyloseq_obj, using the given treatment and p = 0.05.

rho

numeric The rho-value cutoff. All returned co-occurrences will have a rho-value less than or equal to rho or less than or equal to -rho.

Value

igraph network object

Examples

network_ps(soil_column, treatment = c('Matrix', 'Treatment'),
subset = 'Soil Amended')

schuyler-smith/phylosmith documentation built on Aug. 17, 2024, 10:19 a.m.