overviewPerIndividualQC depicts results of perIndividualQC as intersection plots (via upset) and returns dataframes indicating which QC checks individuals failed or passed.

overviewPerIndividualQC(results_perIndividualQC, interactive = FALSE)

Arguments

results_perIndividualQC

[list] Output of perIndividualQC i.e. named [list] with i) sample_missingness containing a [vector] with sample IIDs failing the selected missingness threshold imissTh, ii) highIBD containing a [vector] with sample IIDs failing the selected relatedness threshold highIBDTh, iii) outlying_heterozygosity containing a [vector] with sample IIDs failing selected the heterozygosity threshold hetTh, iv) mismatched_sex containing a [vector] with the sample IIDs failing the sexcheck based on SNPSEX and selected femaleTh/maleTh, v) ancestry containing a vector with sample IIDs failing the ancestry check based on the selected europeanTh and vi) p_sampleQC, a ggplot2-object 'containing' a sub-paneled plot with the QC-plots of check_sex, check_het_and_miss, check_relatedness and check_ancestry.

interactive

[logical] Should plots be shown interactively? When choosing this option, make sure you have X-forwarding/graphical interface available for interactive plotting. Alternatively, set interactive=FALSE and save the returned plot object (p_overview) via ggplot2::ggsave(p=p_overview, other_arguments) or pdf(outfile) print(p_overview) dev.off().

Value

Named [list] with i) nr_fail_samples: total number of samples [integer] failing perIndividualQC, ii) fail_QC containing a [data.frame] with samples that failed QC steps (excluding ancestry) with IID, FID, all QC steps applied by perIndividualQC (max=4), with entries=0 if passing the QC and entries=1 if failing that particular QC and iii) fail_QC_and_ancestry containing a [data.frame] with samples that failed ancestry and QC checks with IID, FID, QC_fail and Ancestry_fail, with entries=0 if passing and entries=1 if failing that check, iii) p_overview, a ggplot2-object 'containing' a sub-paneled plot with the QC-plots.

Examples

indir <- system.file("extdata", package="plinkQC") qcdir <- tempdir() name <- "data" if (FALSE) { fail_individuals <- perIndividualQC(qcdir=qcdir, indir=indir, name=name, refSamplesFile=paste(qcdir, "/HapMap_ID2Pop.txt",sep=""), refColorsFile=paste(qcdir, "/HapMap_PopColors.txt", sep=""), prefixMergedDataset="data.HapMapIII", interactive=FALSE, verbose=FALSE, do.run_check_het_and_miss=FALSE, do.run_check_relatedness=FALSE, do.run_check_sex=FALSE, do.run_check_ancestry=FALSE) overview <- overviewPerIndividualQC(fail_individuals) }