trimNs: Trim N's From Sequences

Description Usage Arguments Value Author(s) Examples

View source: R/trimNs.R

Description

Removes N's from beginning and end of sequences.

Usage

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

Author(s)

Eric Archer eric.archer@noaa.gov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 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)
 

strataG documentation built on Feb. 28, 2020, 9:07 a.m.