Skip to contents

Phased genotypes (see phased in gen_tibble()) are recognised by the code256 of their file backed matrix, which is identical to code_phased.

Usage

is_phased(.x)

Arguments

.x

a gen_tibble, or its genotypes column.

Value

TRUE if the genotypes are phased, FALSE otherwise.

Examples

example_gt <- load_example_gt("gen_tbl")
is_phased(example_gt)
#> [1] FALSE

vcf_path <- system.file("extdata", "phased_example.vcf",
  package = "tidypopgen"
)
x <- gen_tibble(vcf_path,
  phased = TRUE,
  backingfile = tempfile("phased_"),
  quiet = TRUE
)
is_phased(x)
#> [1] TRUE