clean_sequence: Clean DNA or RNA sequence

View source: R/clean_sequence.R

clean_sequenceR Documentation

Clean DNA or RNA sequence

Description

This function takes a DNA or RNA sequence as input and removes any characters that are not A, C, G, T (for DNA) or A, C, G, U (for RNA).

Usage

clean_sequence(sequence, type = "DNA")

Arguments

sequence

A character string containing the DNA or RNA sequence to be cleaned.

type

A character string indicating the type of sequence. The default is "DNA". If set to "RNA", the function will remove any characters that are not A, C, G, U.

Value

A character string containing the cleaned DNA or RNA sequence.

Examples

clean_sequence("atgcNnRYMK") # Returns "ATGC"
clean_sequence("auggcuuNnRYMK", type = "RNA") # Returns "AUGGCUU"

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