Skip to contents

Calculates the percentage of nucleotides in a DNA sequence that are either guanine (G) or cytosine (C).

Usage

gc_content(sequence)

Arguments

sequence

A character string containing the DNA sequence.

Value

A numeric value representing the percentage of nucleotides in the sequence that are G or C.

Examples

sequence <- "ATCGAGCTAGCTAGCTAGCTAGCT"
gc_content(sequence)
#> [1] 50
50
#> [1] 50