Skip to contents

Retrieves the total number of observed unique bases. If ref is provided, reference base will be considered for counting, e.g.: At some site only base 'A' was observed but the reference was 'T'. base_count will be:

  • 1, when ref is NOT provided, or

  • 2, when ref is provided.

Usage

base_count(bases, ref = NULL)

Arguments

bases

vector of base calls or tibble of base call counts.

ref

vector of strings with reference bases

Value

numeric vector of total number of bases.

Examples

bc <- c("A", "AG", "C")
str(base_count(bc))
#>  int [1:3] 1 2 1

# use default observed base calls and condsider reference base
ref <- c("A", "A", "T")
str(base_count(bc, ref))
#>  int [1:3] 1 2 2