tests/testthat/test_map.R

test_that('mapDiseaseToPhecode output', {

  diseaseHpoMapTest = data.table(
    disease_id = 1, hpo_term_id = c('HP:1', 'HP:2', 'HP:3'))
  hpoPhecodeMapTest = data.table(
    hpo_term_id = c('HP:1', 'HP:2', 'HP:3'), phecode = c('001', '002', '003'))
  mapObs = mapDiseaseToPhecode(
    diseaseHpoMap = diseaseHpoMapTest, hpoPhecodeMap = hpoPhecodeMapTest)
  setkey(mapObs)
  mapExp = diseasePhecodeMapTest

  expect_equal(mapObs, mapExp)
})

Try the phers package in your browser

Any scripts or data that you put into this service are public.

phers documentation built on March 31, 2023, 5:43 p.m.