as.edgelist.interaction_table: Creates an 'igraph' object from 'interaction_table'

View source: R/data_refinement.R

as.edgelist.interaction_tableR Documentation

Creates an igraph object from interaction_table

Description

Converts an interaction table to a two column character matrix where each row represent an edge between the OTUs. The entities in the each row are the name of the two interacting OTUs.

Usage

## S3 method for class 'interaction_table'
as.edgelist(x, ...)

Arguments

x

An interaction_table

...

Ignored

Value

The result of this function can be fed directly into graph_from_edgelist for making interacting network

Examples

library(micInt)
library(igraph)
sim.scores <- similarity_measures(subset= c("spearman","pearson"))
res <- runAnalysis(OTU_table = seawater,sim.scores = sim.scores, iterations = 100,parallel = FALSE)
int_table <- res$similarity_measures_significance$spearman
edgelist <- as.edgelist(int_table)
graph_from_data_frame(edgelist)

AlmaasLab/micInt documentation built on April 1, 2022, 10:37 a.m.