Learn R Programming

baseq (version 0.1.4)

clean_sequence: 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")

Value

A character string containing the cleaned DNA or RNA sequence.

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.

Examples

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

Run the code above in your browser using DataLab