Skip to contents

Given a DNA sequence, the function generates the reverse complement of the sequence and returns it.

Usage

reverse_complement(sequence)

Arguments

sequence

A character string containing the DNA sequence to be reversed and complemented

Value

A character string containing the reverse complement of the input DNA sequence

Examples

sequence <- "ATCGAGCTAGCTAGCTAGCTAGCT"
reverse_complement(sequence)
#> [1] "AGCTAGCTAGCTAGCTAGCTCGAT"
# [1] "AGCTAGCTAGCTAGCTAGCTCGAT"