install.packages("hlaR")
library(hlaR)
https://emory-larsenlab.shinyapps.io/hlar_shiny/
library(hlaR)
clean <- read.csv(system.file("extdata/example", "HLA_Clean_test.csv", package = "hlaR"))
clean1 <- CleanAllele(clean$recipient_a1, clean$recipient_a2)
clean2 <- CleanAllele(clean$donor_a1, clean$donor_a2)
dat <- read.csv(system.file("extdata/example", "HLA_Clean_test.csv", package = "hlaR"))
mm1 <- EvalAlleleMism(dat$donor_a1, dat$donor_a2, dat$recipient_a1, dat$recipient_a2)
mm1
mm2 <- EvalAlleleMism(dat$donor_b1, dat$donor_b2, dat$recipient_b1, dat$recipient_b2)
mm2
dat <- read.csv(system.file("extdata/example", "Haplotype_test.csv", package = "hlaR"))
re <- ImputeHaplo(dat_in = dat)
dat <- read.csv(system.file("extdata/example", "MHC_I_test.csv", package = "hlaR"), sep = ",", header = TRUE)
eplet_mm1_v2 <- CalEpletMHCI(dat, ver = 2)
single_detail <- eplet_mm1_v2$single_detail
overall_count <- eplet_mm1_v2$overall_count
eplet_mm1_v3 <- CalEpletMHCI(dat, ver = 3)
single_detail <- eplet_mm1_v3$single_detail
overall_count <- eplet_mm1_v3$overall_count
dat <- read.csv(system.file("extdata/example", "MHC_II_test.csv", package = "hlaR"), sep = ",", header = TRUE)
eplet_mm2_v2 <- CalEpletMHCII(dat, ver = 2)
single_detail <- eplet_mm2_v2$single_detail
risk <- eplet_mm2_v2$dqdr_risk
overall_count <- eplet_mm2_v2$overall_count
eplet_mm2_v3 <- CalEpletMHCII(dat, ver = 3)
single_detail <- eplet_mm2_v3$single_detail
overall_count <- eplet_mm2_v3$overall_count
risk <- eplet_mm2_v3$dqdr_risk
hla_mm_cnt <- read.csv(system.file("extdata/example", "HLA_MisMatch_count_test.csv", package = "hlaR"))
classI <- CountAlleleMism(hla_mm_cnt, c("mism_a", "mism_b"))
classII <- CountAlleleMism(hla_mm_cnt, c("mism_drb1", "mism_dqa", "mism_dqb"))
dat <- read.csv(system.file("extdata/example", "HLA_MisMatch_test.csv", package = "hlaR"))
don <- c("donor.a1", "donor.a2")
rcpt <- c("recipient.a1", "recipient.a2")
re <- CalAlleleTopN(dat_in = dat, nms_don = don, nms_rcpt = rcpt, top_n = 2)
re
dat <- read.csv(system.file("extdata/example", "HLA_MisMatch_test.csv", package = "hlaR"))
don <- c("donor.a1", "donor.a2")
rcpt <- c("recipient.a1", "recipient.a2")
re <- CalAlleleMismFreq(dat_in = dat, nms_don = don, nms_rcpt = rcpt)
re
- high risk if DQ > 15 instead of betwee(15,31)
- use regex for hal clean function