Learn R Programming

strataG (version 1.0.5)

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
 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