bioentity_id_type: Gets info of a 'type' from an 'id'

View source: R/monarchr.R

bioentity_id_typeR Documentation

Gets info of a 'type' from an 'id'

Description

WARNING: will return a result even if that result doesn't seem to match the type.

Usage

bioentity_id_type(id, type, rows = 100)

Arguments

id

A valid monarch initiative id.

type

A category to try for the id.

rows

Number of rows of results to fetch.

Details

This is a general method for when other appropriate API calls may not be available. Or you don't want to bother discovering the appropriate function name.

As a side effect of our Warning, in the event of an unsuccessful mapping, the info returned might still be useful for discovery of what categories your id maps to.

mimics https://api.monarchinitiative.org/api/bioentity/disease/MONDO

Types seem to map to Monarch Initiative 'categories' and are limited(?) to:

- gene - variant - disease - genotype - phenotype - goterm - pathway - anatomy - substance - individual

Value

A list of (list of info for the id, monarch_api S3 class).

Examples

disease <-"MONDO:0006486"
bioentity_id_type(disease, 'disease')
#' # Note in this example, the info returned includes 'categories': 'disease' and 'quality'
# This is a hint of which valid 'types' will be 'successful' for a particular 'id'.
# Warning: Trying other types returns same info, because the other categories
# were irrelevant for this id.
# bioentity_id_type(disease, 'gene') # Not run. Does not get 'gene'!

charlieccarey/monarchr documentation built on Dec. 12, 2023, 12:57 p.m.