Skip to contents

Removes repeat alleles and all NAs from allelic vectors with non-NA values. Removes repeat NAs from allelic vectors with only NA values.

Usage

prep_data(y)

Arguments

y

Observed data in the form of a list of lists. The outer list is a list of episodes in chronological order. The inner list is a list of named markers per episode. Episode names can be specified, but they are not used. Markers must be named. Each episode must list the same markers. If not all markers are typed per episode, data on untyped markers can be encoded as missing (see below). For each marker, one must specify an allelic vector: a set of distinct alleles detected at that marker. NAs encode missing per-marker data, i.e., when no alleles are observed for a given marker.

Examples


y <- list(list(m1 = c("A", "A", NA, "B"), m2 = c("A"), m3 = c("C")),
          list(m1 = c(NA, NA), m2 = c("B", "C"), m3 = c("A", "B", "C")))

prep_data(y)
#> Warning: Ignoring allele repeats at markers with observed data (or NA repeats at markers with missing data).
#> Warning: Ignoring NAs among alleles detected at markers with observed data.
#> [[1]]
#> [[1]]$m1
#> [1] "A" "B"
#> 
#> [[1]]$m2
#> [1] "A"
#> 
#> [[1]]$m3
#> [1] "C"
#> 
#> 
#> [[2]]
#> [[2]]$m1
#> [1] NA
#> 
#> [[2]]$m2
#> [1] "B" "C"
#> 
#> [[2]]$m3
#> [1] "A" "B" "C"
#> 
#>