hapVsPheno: hapVsPheno

View source: R/phenos.R

hapVsPhenoR Documentation

hapVsPheno

Description

hapVsPheno

Usage

hapVsPheno(hap,
pheno,
phenoName,hapPrefix = "H",
geneID = "test1G0387",
mergeFigs = TRUE,
minAcc = 5,
...)

Arguments

hap

hap

pheno

pheno

phenoName

pheno name

hapPrefix

hap prefix

geneID

gene ID for plot title

mergeFigs

merge heatmap and box plot or not

minAcc

If observations numberof a Hap less than this number will not be compared with others or ploted

...

options will pass to ggpubr

Value

list. A list contains a character vector with Haps were applied student test, a mattrix contains p-value of each compare of Haps and a ggplot2 object named as figs if mergeFigs set as TRUE, or two ggplot2 objects names as fig_pvalue and fig_Violin

Examples


data("quickHap_test")
hap <- get_hap(vcf,hyb_remove = TRUE, na.drop = TRUE)
# plot the figs direactively
hapVsPheno(hap = hap,pheno = phenos,phenoName = "GrainWeight.2021",minAcc = 3)

#do not merge the files
results <- hapVsPheno(hap = hap,
                      pheno = phenos,
                      phenoName = "GrainWeight.2021",
                      minAcc = 3,
                      mergeFigs = FALSE)
plot(results$fig_pvalue)
plot(results$fig_Violin)

## Not run: 
# plot multi figs in a 'for' work folw
pheno$GrainWeight.2022 = pheno$GrainWeight.2021 + c(1:nrow(pheno))
for(i in colnames(pheno)){
    results <- hapVsPheno(hap = hap,pheno = phenos,phenoName = i,minAcc = 3)
    png(paste0(i,".png"))
    plot(results$figs)
dev.off()
}

## End(Not run)

ZhangRenL/quickHapR documentation built on June 17, 2022, 12:04 a.m.