FilipePintoReis / KARS_project

Apache License 2.0
0 stars 0 forks source link

MMP() - reviewed #8

Closed balima78 closed 2 years ago

balima78 commented 2 years ago

1 parent

Join files candid.csv with hlaA, hlaB.

[entre parenteses rectos é dado o tipo das variáveis]

NOTA só calcula se os valores: cA1, cA2 in (hlaA); cB1, cB2 in (hlaB); cDR1, cDR2 in (hlaA);
mmp(data = candidatos, [data frame] freqs = (PT, ET), [character] cPRA = 0 - 100 [numeric value] )

HLA frequencies from portuguese CEDACE donors (Lima, 2013)

hlaApt <- read.csv2("files/hlaA.csv") %>% [data.frame] mutate_at(vars(A),as.character) hlaBpt <- read.csv2("files/hlaB.csv") %>% [data.frame] mutate_at(vars(B),as.character) hlaDRpt <- read.csv2("files/hlaDR.csv") %>% [data.frame] mutate_at(vars(DR),as.character)

HLA frequencies from EuroTransplant (ETKAS and SP chapter 4 kidney)

hlaAet <- read.csv2("files/hlaAet.csv") %>% [data.frame] mutate_at(vars(A),as.character) hlaBet <- read.csv2("files/hlaBet.csv") %>% [data.frame] mutate_at(vars(B),as.character) hlaDRet <- read.csv2("files/hlaDRet.csv") %>% [data.frame] mutate_at(vars(DR),as.character)

ABO blood group frequencies from portuguese blood donors (Duran et al, 2007)

abo <- read.csv2("files/abo.csv") %>% [data.frame] mutate_at(vars(abo),as.character)

compute MMP from ETKAS

compute the sum of squared frequencies for each loci with PT frequencies

SallApt <-sum(hlaApt$freq^2) [numeric value] SallBpt <-sum(hlaBpt$freq^2) [numeric value] SallDRpt <-sum(hlaDRpt$freq^2) [numeric value]

compute the sum of squared frequencies for each loci with ET frequencies

SallAet <-sum((hlaAet %>% drop_na() %>% .$freq)^2) [numeric value] SallBet <-sum((hlaBet %>% drop_na() %>% .$freq)^2) [numeric value] SallDRet <-sum((hlaDRet %>% drop_na() %>% .$freq)^2) [numeric value]

balima78 commented 2 years ago

function et_mmp() on et.R

we can close this issue!