Skip to contents

explore_genomes provides an interactive, opinionated workflow for exploring genomic quality metrics and applying an initial sequence of filters. It is intended as a starting point, especially for users who are learning about their dataset and selecting filtering thresholds.

The workflow is not a universal filtering recipe. The appropriate filters, thresholds, and order depend on the organism, sequencing design, marker type, and study objectives. Experienced users should generally build a dataset-specific workflow from the individual filter_*() and detect_*() functions in radr.

Usage

explore_genomes(
  data,
  interactive.filter = TRUE,
  output = NULL,
  filename = NULL,
  verbose = TRUE,
  parallel.core = parallel::detectCores() - 1,
  ...
)

Arguments

data

A GDS filepath or an open SeqVarGDSClass object. Other genomic formats must first be imported with an appropriate genometranslator reader, such as genometranslator::read_vcf(), genometranslator::read_dart(), or genometranslator::read_plink().

interactive.filter

Logical. If TRUE, figures and questions guide the selection of filtering thresholds. If FALSE, thresholds are supplied through .... Default: interactive.filter = TRUE.

output

Optional output format passed to genometranslator::genome_translator(). If NULL, no additional genomic format is generated. Default: output = NULL.

filename

Optional prefix used for generated output files. Default: filename = NULL.

verbose

Logical. Display progress messages. Default: verbose = TRUE.

parallel.core

Number of processor cores available to compatible operations. Default: parallel.core = parallel::detectCores() - 1.

...

Filtering thresholds and advanced options passed to the individual radr filtering and detection functions.

Value

A named list containing:

gds

The filtered GDS object.

output

The object generated by genometranslator::genome_translator(), or "not selected" when no output format was requested.

Details

The standard workflow considers DArT reproducibility when available, monomorphic and common markers, individual quality, allele frequency, coverage, genotyping rate, SNP position and number, linkage disequilibrium, mixed and duplicate genomes, and Hardy-Weinberg equilibrium. Steps can be enabled, disabled, or configured through ....

The function creates a dated workflow folder containing the parameter log, diagnostic figures, blacklists and whitelists, final metadata, and summary statistics. Statistics are generated for these files and are not retained as a separate object in the returned value.

Interactive and tailored workflows

Interactive mode is designed to help users inspect diagnostic plots and understand the consequences of candidate thresholds. For reproducible batch analyses, use interactive.filter = FALSE and provide explicit thresholds. For mature analyses, call the relevant functions individually so their order and configuration reflect the dataset.

Author

Thierry Gosselin thierrygosselin@icloud.com

Examples

if (FALSE) { # \dontrun{
# Import a VCF with genometranslator, then explore it with radr
gds <- genometranslator::read_vcf(
  data = "shark.vcf",
  strata = "shark_strata.tsv"
)

shark <- radr::explore_genomes(data = gds)

# Experienced users can construct a tailored workflow instead
filtered <- gds |>
  radr::filter_genotyping(
    interactive.filter = FALSE,
    filter.genotyping = 0.20
  ) |>
  radr::filter_ma(
    interactive.filter = FALSE,
    filter.ma = 2
  )
} # }