Learn R Programming

strataG (version 2.0.2)

trimNs: Trim N's From Sequences

Description

Removes N's from beginning and end of sequences.

Usage

trimNs(x)

Arguments

x

a DNAbin object or list or matrix that can be coerced into one.

Value

sequences with beginning and trailing N's removed.

Examples

Run this code
# NOT RUN {
 test.seqs <- list(
   A = c(rep("n", 5), "a", "c", "g", "t", rep("n", 3)),
   B = c(rep("n", 3), "a", "c", "g", "t", rep("n", 5)),
   C = c("a", "c", "g", "t", rep("n", 8))
 )

test.seqs
trimmed <- trimNs(test.seqs)  
as.character(trimmed)
 
# }

Run the code above in your browser using DataLab