Learn R Programming

tidypopgen (version 0.4.3)

qc_report_loci: Create a Quality Control report for loci

Description

Return QC information to assess loci (MAF, missingness and HWE test). For pseudohaploid data, HWE test is not calculated.

Usage

qc_report_loci(.x, ...)

# S3 method for tbl_df qc_report_loci(.x, ...)

# S3 method for grouped_df qc_report_loci(.x, ...)

Value

either a tibble with 3 elements (maf, missingness and hwe_p). For pseudohaploid data, a tibble with 2 elements (maf and missingness).

Arguments

.x

a gen_tibble object.

...

currently unused

Examples

Run this code
# Create a gen_tibble of lobster genotypes
bed_file <-
  system.file("extdata", "lobster", "lobster.bed", package = "tidypopgen")
example_gt <- gen_tibble(bed_file,
  backingfile = tempfile("lobsters"),
  quiet = TRUE
)

# Get a QC report for the loci
example_gt %>% qc_report_loci()

# Group by population to calculate HWE within populations
example_gt <- example_gt %>% group_by(population)
example_gt %>% qc_report_loci()

Run the code above in your browser using DataLab