Extracts simplified content from response.

extract_be_content(df)

Arguments

df

a data.frame obtained by flattening the json response's content.

Value

a tibble with just the core information of interest.

Examples

gene <-"NCBIGene:8314" gene <- utils::URLencode(gene, reserved = TRUE) query <- list(rows=100, fetch_objects="true") url <- build_monarch_url(path = list("/api/bioentity/gene", gene, "diseases/"), query = query) resp <- monarch_api(url) resp <- jsonlite::flatten(resp$content$associations, recursive=TRUE) extract_be_content(resp)
#> # A tibble: 25 x 10 #> subject.taxon subject.id subject relation object object.id object.taxon #> * <chr> <chr> <chr> <chr> <chr> <chr> <lgl> #> 1 Homo sapiens HGNC:950 BAP1 is marke… lipoma MONDO:00… NA #> 2 Homo sapiens HGNC:950 BAP1 is marke… leukemia … MONDO:00… NA #> 3 Homo sapiens HGNC:950 BAP1 is marke… bone canc… MONDO:00… NA #> 4 Homo sapiens HGNC:950 BAP1 is marke… epithelio… MONDO:00… NA #> 5 Homo sapiens HGNC:950 BAP1 is marke… testicula… MONDO:00… NA #> 6 Homo sapiens HGNC:950 BAP1 is marke… meningiom… MONDO:00… NA #> 7 Homo sapiens HGNC:950 BAP1 has phen… uveal mel… MONDO:00… NA #> 8 Homo sapiens HGNC:950 BAP1 is marke… malignant… MONDO:00… NA #> 9 Homo sapiens HGNC:950 BAP1 is marke… neuroendo… MONDO:00… NA #> 10 Homo sapiens HGNC:950 BAP1 is marke… lung aden… MONDO:00… NA #> # ... with 15 more rows, and 3 more variables: evidence <fct>, #> # publications <fct>, provided_by <fct>