| gson_union | R Documentation |
gson_union() merges GSON objects into one collection. Two objects are the
same source when they declare the same gsname, and – once every object
declares one – the same gsidtype; the gene sets of one source are joined by
ID, so a gene set that appears in two files of one collection becomes one set
holding every gene either file gives it. A gene set ID that two objects from
different sources both use is a conflict, because the merged membership table
would say that one ID names two sets of genes, and .conflict decides what
happens: "error" refuses, "prefix" qualifies every gene set ID with the
source it comes from (KEGG:hsa00010), and "rename" qualifies only the IDs
that actually collide, leaving the rest of the collection alone. Where two
objects name the same gene set or the same gene differently, the first object
that says something wins.
gson_union(x = NULL, y = NULL, ..., .conflict = c("error", "prefix", "rename"))
x, y |
A |
... |
More |
.conflict |
What to do about a gene set ID used by two different
sources: |
The metadata is merged by what the merged object can still honestly say:
species, keytype and schema_version have to agree or the call is an
error, because a membership table holds genes of one organism identified by
one identifier type, while gsname, gsidtype, version, accessed_date
and info are joined with " + " when the sources name themselves
differently. urlpattern is kept only when every object declares the same
one and no gene set ID was renamed – a pattern that resolves to a wrong page
for part of the collection is worse than no pattern, and gson_url() says so.
A GSON object holding every gene set of every input.
wpfile <- system.file('extdata', "wikipathways-20220310-gmt-Homo_sapiens.gmt", package='gson')
wp <- read.gmt.wp(wpfile, output = "GSON")
gson_union(wp[1:2], wp[3:4])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.