-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
123 lines (72 loc) · 2.14 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
title: "SPAT"
output:
github_document:
toc: true
df_print: kable
editor_options:
chunk_output_type: inline
---
```{r setup, include=FALSE}
rm(list = ls())
knitr::opts_chunk$set(echo = FALSE)
library(tidyverse)
library(scales)
source("../lib/vocabulary_reporting_fuctions.r")
# Document variables
N_TOPS <- 10
# output status
db_statuses <- tibble()
```
```{r load, message=FALSE, warning=FALSE}
spat_concept <- read_csv("./1_source_vocabulary/CONCEPT_SPAT.csv") %>%
filter(domain_id!="Metadata")
spat_mapsto <- read_csv("../ATC/2_mapping_to_standard/CONCEPT_RELATIONSHIP_ATC.csv") %>%
filter(FALSE) ## read an other table to keep same colums
spat_freqs <- read_csv("./3_freq_of_source_codes/freq_total.csv",
col_types = cols(
code = col_character(),
freq_finngen = col_double(),
freq_total = col_double()
)
)
```
# Intro
TODO:
# Formating source vocabulary to OMOP
```{r}
spat_concept %>% count(tmp_name_en_source, sort = T)
```
Source table with added translation has been formatted to be similar to OMOP in [1_source_vocabulary/spat_for_source_vocabulary.csv](1_source_vocabulary/spat_for_source_vocabulary.csv).
## Progess in number of codes
```{r}
n_codes <- spat_concept %>% nrow()
n_codes_accepted <- spat_mapsto %>% distinct(concept_id_1) %>% nrow()
```
From `r scales::number(n_codes)` codes `r scales::number(n_codes_accepted)` have been approved.
This makes `r scales::percent(n_codes_accepted/n_codes)` of codes approved.
```{r}
db_statuses <- bind_rows(
tibble(
status = "mapped",
n_codes = n_codes_accepted,
per_codes = percent(n_codes_accepted/!!n_codes),
n_events = as.double(NA),
per_events = as.character(NA),
db_name = "source"
),
tibble(
status = "not_mapped",
n_codes = !!n_codes-n_codes_accepted,
per_codes = percent((!!n_codes-n_codes_accepted)/!!n_codes),
n_events = as.double(NA),
per_events = as.character(NA),
db_name = "source"
)
)
```
# Assessing coverage of databases
```{r results='asis'}
#write_csv(db_statuses, "status_table.csv" )
database_coverage_md("SPAT", spat_concept, spat_mapsto, spat_freqs)
```