get_graph_wo_unk: Create igraph object without MDM nodes at each rank

Description Usage Arguments Value Examples

Description

For each taxonomic rank, all taxa designated as MDM are removed from the original network (igraph) using names of the MDM found by the met_wo_unk function. A new network (igraph) for each rank is produced, where only taxa with known taxonomic classification are present.

Usage

1

Arguments

orig_graph

Network (graph) of all taxa, including MDM

met_wo_unk

List of 7 otu tables, produced from met_wo_unk function, each corresponding to the taxa with known classification at that rank. Each OTU table shows the taxa ids and counts for these known taxa.

Value

Returns List of 7 igraph objects.

wo_unk_graph1

Network (igraph) of taxa with known Kingdom classification

wo_unk_graph2

Network (igraph) of taxa with known Phylum classification

wo_unk_graph3

Network (igraph) of taxa with known Class classification

wo_unk_graph4

Network (igraph) of taxa with known Order classification'

wo_unk_graph5

Network (igraph) of taxa with known Family classification

wo_unk_graph6

Network (igraph) of taxa with known Genus classification

wo_unk_graph7

Network (igraph) of taxa with known Species classification

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (orig_graph, met_wo_unk)
{
    wo_unk_graph_l = list()
    for (name in names(met_wo_unk)) {
        print(name)
        tax_level = name
        wo_unk_graph <- igraph::delete_vertices(orig_graph, which(!names(V(orig_graph)) %in%
            rownames(met_wo_unk[[tax_level]])))
        print(wo_unk_graph)
        wo_unk_graph_l[[name]] = wo_unk_graph
    }
    return(wo_unk_graph_l)
  }

ConesaLab/MDM documentation built on Aug. 1, 2020, 11:47 a.m.