translate_ATC_codes: Translate given vector of ATC codes to text

Description Usage Arguments Details Value Examples

View source: R/translate_ATC_codes.R

Description

Translate given vector of ATC codes to text

Usage

1
translate_ATC_codes(ATC_codes, level_depth = 5, api_key)

Arguments

ATC_codes

character vector - ATC codes

level_depth

integer (1-5) - 1 is the shortest (length 1 char), 5 the longest (length 7 chars) code

api_key

character - create an account at https://bioportal.bioontology.org/ and it will come with an api key

Details

Validity of an ID is only judged based on its length after level depth based truncation. Thus, IDs can never be too long, only too short. IDs which are not part of the ATC database, will not return results from the bioportal API and are translated to NA.

References: https://en.wikipedia.org/wiki/Anatomical_Therapeutic_Chemical_Classification_System https://www.ncbi.nlm.nih.gov/pubmed/21672956 https://www.bioontology.org/wiki/BioPortal_Help#Programming_with_the_BioPortal_API

Value

Returns a data.frame with the valid input ATC codes in the first column (code) and the textual names in the second column (name)

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
ATC_vect <- c("A02BC02", "C03BA08", "A02BC02", "A02BC02", "A07DA03", "A07DA03",
              "A02BC02", "A02BC02", "A02BC02", "A02BC02", "C10AA05", "C10AA05",
              "C10AA05", "N05BA06", "N05BA06", "N05BA06", "N06AX11", "N06AX11")
# you will need to create an account at https://bioportal.bioontology.org/
# to receive an api_key
translate_ATC_codes(ATC_vect, level_depth = 3, api_key = api_key)

## End(Not run)

PatrickRWright/ATCapiR documentation built on Jan. 27, 2021, 3:30 a.m.