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

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.

Value

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

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

Examples

disease <-"MONDO:0006486" bioentity_id_type(disease, 'disease')
#> $info #> $info$taxon #> $info$taxon$label #> NULL #> #> $info$taxon$id #> NULL #> #> #> $info$xrefs #> NULL #> #> $info$synonyms #> val pred xrefs #> 1 uvea melanoma (disease) synonym NA #> 2 Melanoma of the Uvea synonym NA #> 3 Iris melanoma synonym NA #> 4 MELANOMA, UVEAL, MALIGNANT synonym NA #> 5 uveal melanoma synonym NA #> 6 Choroidal melanoma synonym NA #> 7 melanoma of Uvea synonym NA #> #> $info$types #> NULL #> #> $info$replaced_by #> NULL #> #> $info$description #> [1] "A melanoma derived from melanocytes of the uveal tract. It is the most common primary intraocular tumor in the United States and Western Europe. Similar to melanoma of the skin, it is rare in Africa and Asia. Diagnostic procedures include ophthalmoscopic exam, fluorescein angiography and ultrasound. Treatment includes: surgical excision of the eye, iridocyclectomy and tumor resection. Recent treatments also include radiotherapy or photo coagulation. Classification of uveal melanomas recognizes four cell types within these tumors: epithelioid, intermediate, mixed cell, and spindle cell types. The spindle cell type uveal melanomas are further sub-classified as spindle cell type A and spindle cell type B." #> #> $info$categories #> [1] "disease" "quality" #> #> $info$consider #> NULL #> #> $info$deprecated #> NULL #> #> $info$label #> [1] "uveal melanoma" #> #> $info$id #> [1] "MONDO:0006486" #> #> #> $response #> <monarch https://api.monarchinitiative.org/api/bioentity/disease/MONDO:0006486?rows=100&fetch_objects=true&format=json> #> <Showing parsed R objects from json response. 2 level(s) deep> #> List of 11 #> $ taxon :List of 2 #> ..$ label: NULL #> ..$ id : NULL #> $ xrefs : NULL #> $ synonyms :'data.frame': 7 obs. of 3 variables: #> ..$ val : chr [1:7] "uvea melanoma (disease)" "Melanoma of the Uvea" "Iris melanoma" "MELANOMA, UVEAL, MALIGNANT" ... #> ..$ pred : chr [1:7] "synonym" "synonym" "synonym" "synonym" ... #> ..$ xrefs: logi [1:7] NA NA NA NA NA NA ... #> $ types : NULL #> $ replaced_by: NULL #> $ description: chr "A melanoma derived from melanocytes of the uveal tract. It is the most common primary intraocular tumor in the "| __truncated__ #> $ categories : chr [1:2] "disease" "quality" #> $ consider : NULL #> $ deprecated : NULL #> $ label : chr "uveal melanoma" #> $ id : chr "MONDO:0006486" #>
#' # 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'!