count_bases: Count the number of A's, C's, G's, and T's in a DNA sequence

View source: R/count_bases.R

count_basesR Documentation

Count the number of A's, C's, G's, and T's in a DNA sequence

Description

This function takes a single argument, a DNA sequence as a character string, and counts the number of A's, C's, G's, and T's in the sequence. The counts are returned as a named vector.

Usage

count_bases(sequence)

Arguments

sequence

a character string containing a DNA sequence

Value

a named integer vector containing the counts of A's, C's, G's, and T's

Examples

sequence <- "ATCGAGCTAGCTAGCTAGCTAGCT"
count_bases(sequence)
# A  C  G  T
# 6  6  6  6

ambu-vijayan/baseq documentation built on May 6, 2023, 10:31 p.m.