Given a KG engine, returns a graph representing the diversity of node categories and edge predicates for browsing. The returned graph is guaranteed to contain at least one node of every category, and at least one edge of every predicate. No other guarantees are made: the example graph is not minimal to satisfy these criteria, it is not random or even pseudo-random, and it may not be connected.
example_graph(engine, ...)A tbl_kgx graph
# Using example KGX file packaged with monarchr
data(eds_marfan_kg)
# prints a readable summary and returns a list of dataframes
g <- eds_marfan_kg |> example_graph()
print(g)
#> # A tbl_graph: 12 nodes and 10 edges
#> #
#> # A directed acyclic multigraph with 3 components
#> #
#> # Node Data: 12 × 16 (active)
#> id pcategory name symbol in_taxon_label description synonym category
#> <chr> <chr> <chr> <chr> <chr> <chr> <list> <list>
#> 1 MONDO:000… biolink:… Marf… NA NA A disorder… <chr> <chr>
#> 2 MONDO:002… biolink:… Ehle… NA NA The Ehlers… <chr> <chr>
#> 3 MONDO:000… biolink:… Ehle… NA NA Ehlers-Dan… <chr> <chr>
#> 4 MONDO:001… biolink:… Ehle… NA NA A form of … <chr> <chr>
#> 5 ZFIN:ZDB-… biolink:… b3ga… NA Danio rerio NA <chr> <chr>
#> 6 HGNC:3603 biolink:… FBN1 FBN1 Homo sapiens NA <chr> <chr>
#> 7 HP:0000974 biolink:… Hype… NA NA A conditio… <chr> <chr>
#> 8 HP:0000007 biolink:… Auto… NA NA A mode of … <chr> <chr>
#> 9 MONDO:002… biolink:… rare NA NA A disease … <chr> <chr>
#> 10 CHEBI:508… biolink:… doxy… NA NA Tetracycli… <chr> <chr>
#> 11 CLINVAR:2… biolink:… NM_0… NA Homo sapiens NA <chr> <chr>
#> 12 CLINVAR:2… biolink:… NM_0… NA Homo sapiens NA <chr> <chr>
#> # ℹ 8 more variables: iri <chr>, xref <list>, namespace <chr>,
#> # provided_by <chr>, in_taxon <chr>, full_name <chr>, type <list>,
#> # has_gene <chr>
#> #
#> # Edge Data: 10 × 25
#> from to subject predicate object primary_knowledge_so…¹ agent_type
#> <int> <int> <chr> <chr> <chr> <chr> <chr>
#> 1 11 1 CLINVAR:200198 biolink:a… MONDO… infores:clingen manual_ag…
#> 2 6 1 HGNC:3603 biolink:c… MONDO… infores:omim manual_ag…
#> 3 6 1 HGNC:3603 biolink:g… MONDO… infores:orphanet manual_ag…
#> # ℹ 7 more rows
#> # ℹ abbreviated name: ¹primary_knowledge_source
#> # ℹ 18 more variables: knowledge_level <chr>, knowledge_source <chr>,
#> # aggregator_knowledge_source <chr>, provided_by <chr>, id <chr>,
#> # category <chr>, original_object <chr>, original_subject <chr>,
#> # frequency_qualifier <chr>, has_evidence <chr>, has_total <dbl>,
#> # has_quotient <dbl>, has_count <dbl>, has_percentage <dbl>, …
# prints a readable summary and returns a list of dataframes
g <- monarch_engine() |> example_graph()
#> Trying to connect to https://neo4j.monarchinitiative.org
#> Connected to https://neo4j.monarchinitiative.org
print(g)
#> # A tbl_graph: 119 nodes and 64 edges
#> #
#> # A rooted forest with 55 trees
#> #
#> # Node Data: 119 × 24 (active)
#> id category pcategory name description synonym iri xref file_source
#> <chr> <list> <chr> <chr> <chr> <list> <chr> <list> <chr>
#> 1 MONDO:… <chr> biolink:… Noon… A rare mul… <list> http… <list> phenio_nod…
#> 2 CHEBI:… <chr> biolink:… ever… A macrocyc… <list> http… <list> phenio_nod…
#> 3 FBDV:0… <chr> biolink:… embr… Life stage… <lgl> http… <lgl> phenio_nod…
#> 4 FBDV:0… <chr> biolink:… larv… The stage … <lgl> http… <lgl> phenio_nod…
#> 5 MGI:96… <chr> biolink:… Alad NA <list> NA <list> alliance_g…
#> 6 GO:000… <chr> biolink:… cyto… The part o… <lgl> http… <list> phenio_nod…
#> 7 MGI:24… <chr> biolink:… Rad5… NA <lgl> NA <lgl> alliance_g…
#> 8 MGI:23… <chr> biolink:… Rad5… NA <lgl> NA <lgl> alliance_a…
#> 9 CLINVA… <chr> biolink:… NC_0… NA <lgl> NA <list> clinvar_va…
#> 10 MONDO:… <chr> biolink:… here… The inheri… <list> http… <list> phenio_nod…
#> # ℹ 109 more rows
#> # ℹ 15 more variables: namespace <chr>, provided_by <chr>,
#> # exact_synonym <list>, related_synonym <list>, subsets <list>, symbol <chr>,
#> # in_taxon_label <chr>, in_taxon <chr>, type <chr>, full_name <chr>,
#> # has_gene <list>, broad_synonym <list>, narrow_synonym <list>,
#> # has_biological_sex <chr>, deprecated <chr>
#> #
#> # Edge Data: 64 × 27
#> from to subject predicate object primary_knowledge_so…¹ knowledge_level
#> <int> <int> <chr> <chr> <chr> <chr> <chr>
#> 1 2 1 CHEBI:684… biolink:… MONDO… infores:cureid knowledge_asse…
#> 2 3 4 FBDV:0000… biolink:… FBDV:… infores:fbdv not_provided
#> 3 5 6 MGI:96853 biolink:… GO:00… infores:go-central knowledge_asse…
#> # ℹ 61 more rows
#> # ℹ abbreviated name: ¹primary_knowledge_source
#> # ℹ 20 more variables: evidence_count <int>, file_source <chr>,
#> # grouping_key <chr>, agent_type <chr>, aggregator_knowledge_source <list>,
#> # provided_by <chr>, id <chr>, category <list>, original_predicate <chr>,
#> # negated <chr>, species_context_qualifier <chr>, has_evidence <list>,
#> # publications <list>, qualifier <chr>, qualifiers <list>, …