seqEqual: Test DNA sequences for equality.

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

seqEqual checks if two DNA sequences are identical.

Usage

1
seqEqual(seq1, seq2, ignore = as.character(c("N", "-", ".", "?")))

Arguments

seq1

character string containing a DNA sequence.

seq2

character string containing a DNA sequence.

ignore

vector of characters to ignore when testing for equality. Default is to ignore c("N",".","-","?")

Value

Returns TRUE if sequences are equal and FALSE if they are not. Sequences of unequal length will always return FALSE regardless of their character values.

See Also

Used by pairwiseEqual within collapseDuplicates. See seqDist for calculation Hamming distances between sequences.

Examples

1
2
3
4
5
6
7
8
9
# Ignore gaps
seqEqual("ATG-C", "AT--C")
seqEqual("ATGGC", "ATGGN")
seqEqual("AT--T", "ATGGC")

# Ignore only Ns
seqEqual("ATG-C", "AT--C", ignore="N")
seqEqual("ATGGC", "ATGGN", ignore="N")
seqEqual("AT--T", "ATGGC", ignore="N")

alakazam documentation built on June 20, 2017, 9:10 a.m.

Search within the alakazam package
Search all R packages, documentation and source code