Functions to merge data resources.
link_monarch(
maps = list(c("variant", "disease"), c("variant", "phenotypic_feature"), c("variant",
"gene")),
queries = NULL,
node_filters = list(phenotype = NULL, subject_db = NULL, gene = NULL),
as_graph = TRUE,
domain = "https://data.monarchinitiative.org",
subdir = "monarch-kg/latest/tsv/all_associations/",
...
)
A list of paired to/from types to filter Monarch association
files by. For example, list(c("gene","disease"))
will return any
files that contains gene-disease associations.
Passes to get_monarch_files.
A list of free-form substring queries to filter files by
(using any column in the metadata).
For example, list("gene_disease","variant_disease")
will return any
files that contain either of the substrings
"gene_disease" or "variant_disease".
Passes to get_monarch_files.
A named list of filters to apply to the node data.
Names should be name of the metadata column, and values should be a vector of
valid options. For example, list("type" = c("gene","variant"))
will
return any rows where the "type" column contains either "gene" or "variant".
Return the object as a tbl_graph.
Web domain to search for Monarch files.
Subdirectory path to search for Monarch files within
domain
.
Not used at this time.
Merged data.
link_monarch()
: link_
Link Monarch
Construct a knowledge graph by iteratively linking together pairs of concepts across multiple Monarch datasets.
dat <- link_monarch(maps = list(c("causal_gene","disease"),
c("correlated_gene","disease")))
#> Filtering with `maps`.
#> Files found: 2
#> Constructing data: causal_gene <--> disease
#> Creating nodes.
#> Creating tbl_graph.
#> Constructing data: correlated_gene <--> disease
#> Creating nodes.
#> Creating tbl_graph.
#> Joining with `by = join_by(id, label, category, taxon, taxon_label, db)`
#> Removing isolated nodes.