MiCo (Microbial Community) Class
class-MiCo.Rmd
MiCo
The MiCo
class serves as the standard way to save and
work with data on the metabolism, the function, of a microbial
community.
Creation from data
To create an object of type MiCo
, the user must input
the data listed below. This data can either be contained in a single
tibble or data frame, saved in a CSV file, or input as separate
vectors.
-
species
: A character vector specifying the species present in the community. -
metabolites
: A character vector specifying the metabolites present in the community. -
fluxes
: A numeric vector specifying the fluxes of each metabolite in the community. -
name
: Character string giving the name of the community.
s <- c("RQR9693L", "RQR9693L", "RQR9693L", "RQR9693L", "MEV1152G", "MEV1152G", "MEV1152G", "XIQ2234Q", "XIQ2234Q", "XIQ2234Q")
m <- c("met3", "met1", "met4", "met4", "met3", "met2", "met2", "met3", "met4", "met1")
f <- c(-0.3023640, 0.5344641, -2.2337716, 3.3063823, 2.5520278, 0.3388498, -1.8460633, -1.3043675, -0.4788769, 0.6027292)
newMiCo(species = s, metabolites = m, fluxes = f, name = "example_MiCo")
#> example_MiCo: MiCo (MicrobialCommunity) Object
#> - Unique microorganisms (MO): 3
#> - Unique metabolites (met): 4
fsmc
provides the function syn_community()
to generate random MiCo
objects based on user
parameters.
makeSynMiCo(n_species = 8, max_met = 10, name = "example_syn_MiCo")
#> example_syn_MiCo: MiCo (MicrobialCommunity) Object
#> - Unique microorganisms (MO): 8
#> - Unique metabolites (met): 10
Create a MiCo Object from a tibble
fsmc
contains a set of example data that can be used for
the analysis of microbial communities. For this example, we will use
data created by MiSoS(oup). Two example
communities are provided in the package ac_A1R12_1
and
cit_A1R12_1
.
The MiCo
function can take either a path to a .csv file
or a data frame/tibble as input.
Contents
Upon the creation of a MiCo
class based on a three
column input, additional information is calculated:
- species
- metabolites
- fluxes
- edges
- binary matrix
- flux matrix
- name
- flux_consumption
- flux_production
- effective_flux_consumption
- effective_flux_production
Each of these slots is described in the MiCo-class()
class documentation.
Methods
-
getCo()
: Returns the community in tibble format. -
getSpecies()
: Retrieves the species from a community. -
getMet()
: Retrieves metabolites from a community. -
getFlux()
: Retrieves the fluxes from a community. -
getEdges()
: Retrieves the edges from a community.