Constructor for ConsortiumMetabolismAlignment Objects
Source: R/AllClasses.R, R/ConsortiumMetabolismAlignment.R
ConsortiumMetabolismAlignment.RdBuilds a valid
ConsortiumMetabolismAlignment by setting CMA-specific
slots with sensible defaults.
Exports alignment results to a plain
data.frame suitable for downstream analysis.
For "pairwise" alignments the three pathway sets
(SharedPathways, UniqueQuery,
UniqueReference) are row-bound with a
pathway_type column added.
For "multiple" alignments ConsensusPathways
is returned. For all other types (or empty objects)
Pathways is returned, falling back to an empty
data.frame().
Usage
ConsortiumMetabolismAlignment(...)
# S4 method for class 'ConsortiumMetabolismAlignment'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)Value
A validated
ConsortiumMetabolismAlignment object.
A data.frame. For pairwise alignments the
result contains at minimum consumed, produced,
and pathway_type columns.
Slots
Namecharacter. Display name for the alignment.
Descriptioncharacter. Optional short description.
Typecharacter. One of
"pairwise","multiple", or"search".Metriccharacter. Similarity metric used (e.g.,
"FOS").Paramslist. Additional parameters passed to the alignment method.
QueryNamecharacter. Name of the query consortium (pairwise).
ReferenceNamecharacter. Name of the reference consortium (pairwise).
Scoreslist. Named list of all computed score components.
PrimaryScorenumeric. Primary similarity score, between 0 and 1.
Pvaluenumeric. Permutation p-value, between 0 and 1.
SharedPathwaysdata.frame. Pathways present in both query and reference.
UniqueQuerydata.frame. Pathways unique to the query.
UniqueReferencedata.frame. Pathways unique to the reference.
SimilarityMatrixmatrix. Pairwise similarity matrix (multiple alignment).
ConsensusPathwaysdata.frame. Consensus network pathways (multiple alignment).
Prevalencedata.frame. Pathway prevalence across consortia (multiple alignment).
Dendrogramlist. Hierarchical clustering dendrogram (multiple alignment).
Pathwaysdata.frame. Combined pathway list.
Graphslist. List of igraph objects.
Metabolitesdata.frame. Metabolite mapping table.
Examples
# Empty alignment
cma <- ConsortiumMetabolismAlignment()
# Pairwise alignment via align()
cm1 <- synCM("comm_1", n_species = 3, max_met = 5)
cm2 <- synCM("comm_2", n_species = 4, max_met = 6)
cma <- align(cm1, cm2)
cma
#>
#> ── ConsortiumMetabolismAlignment
#> Name: "comm_1 vs comm_2"
#> Type: "pairwise"
#> Metric: "FOS"
#> Score: 0
#> Query: "comm_1", Reference: "comm_2"
#> Coverage: query 0, reference 0
#> Pathways: 0 shared, 3 query-only, 12 reference-only.
cm1 <- synCM("comm_1", n_species = 3, max_met = 5)
cm2 <- synCM("comm_2", n_species = 4, max_met = 6)
cma <- align(cm1, cm2)
df <- as.data.frame(cma)
head(df)
#> consumed produced querySpecies referenceSpecies pathway_type
#> 1 met5 met4 TFL8958R.... JGE334P,.... shared
#> 2 met1 met5 DOR2356X.... JYF8221A.... shared
#> 3 media met5 unique_query
#> 4 met4 met5 unique_query
#> 5 met5 met1 unique_reference
#> 6 met6 met1 unique_reference