Simplify dataframe by keywords.
Usage
simplify_by_keywords(
df,
keywords = c("layer", "part", "stratum", "division", "leaflet", "Subgeniculate",
"island", "Islands", "Fields of Forel", "Cajal", "Darkschewitsch", "Precommissural"),
ontology = "allen",
dont_fold = c("Dorsal part of the lateral geniculate complex",
"Ventral posterolateral nucleus of the thalamus, parvicellular part",
"Ventral posteromedial nucleus of the thalamus, parvicellular part",
"Ventral posterolateral nucleus of the thalamus, parvicellular part",
"Ventral posteromedial nucleus of the thalamus, parvicellular part",
"Substantia nigra")
)
Arguments
- df
(tibble) Must contain columns "acronym" and "name"
- keywords
(vec, default = c("layer","part","stratum","division", "leaflet", "Subgeniculate", "island", "Islands", "Fields of Forel", "Cajal", "Darkschewitsch", "Precommissural")) a list of keywords to simplify based on region name.
- ontology
(str, default = "allen") Region ontology to use. options = "allen" or "unified"
- dont_fold
(vec, default = c("Dorsal part of the lateral geniculate complex", "Ventral posterolateral nucleus of the thalamus, parvicellular part", " Ventral posteromedial nucleus of the thalamus, parvicellular part","Ventral posterolateral nucleus of the thalamus, parvicellular part", "Ventral posteromedial nucleus of the thalamus, parvicellular part","Substantia nigra")) Regions that are exceptions to being folded into their parent regions.
Examples
df <- dplyr::tibble(acronym = c("LGd", "GU4", "dCA1so" ),
name = c("Dorsal part of the lateral geniculate complex",
"Gustatory areas, layer 4", "Field CA2, stratum oriens (dorsal)"))
simplify_by_keywords(df)
#> # A tibble: 3 x 2
#> acronym name
#> <chr> <chr>
#> 1 LGd Dorsal part of the lateral geniculate complex
#> 2 GU Gustatory areas
#> 3 dCA1 Field CA1 (dorsal)
df <- dplyr::tibble(acronym = c("LPBD", "MPBE", "CPre"),
name = c("Lateral parabrachial nucleus, dorsal part",
"Medial parabrachial nucleus, external part", "Caudoputamen- rostral extreme"))
simplify_by_keywords(df, keywords = c("dorsal part", "external part",
"Caudoputamen-"), ontology = "unified")
#> # A tibble: 3 x 2
#> acronym name
#> <chr> <chr>
#> 1 LPB Lateral parabrachial nucleus
#> 2 MPB Medial parabrachial nucleus
#> 3 CP Caudate Putamen