maskSeqEnds - Masks ragged leading and trailing edges of aligned DNA sequences
maskSeqEnds takes a vector of DNA sequences, as character strings,
and replaces the leading and trailing characters with
"N" characters to create
a sequence vector with uniformly masked outer sequence segments.
maskSeqEnds(seq, max_mask = NULL, trim = FALSE)
- a character vector of DNA sequence strings.
- the maximum number of characters to mask. If set to 0 then
no masking will be performed. If set to
NULLthen the upper masking bound will be automatically determined from the maximum number of observed leading or trailing
"N"characters amongst all strings in
TRUEleading and trailing characters will be cut rather than masked with
seq vector with masked (or optionally trimmed) sequences.
# Default behavior uniformly masks ragged ends seq <- c("CCCCTGGG", "NAACTGGN", "NNNCTGNN") maskSeqEnds(seq)
 "NNNCTGNN" "NNNCTGNN" "NNNCTGNN"
# Does nothing maskSeqEnds(seq, max_mask=0)
 "CCCCTGGG" "NAACTGGN" "NNNCTGNN"
# Cut ragged sequence ends maskSeqEnds(seq, trim=TRUE)
 "CTG" "CTG" "CTG"
# Set max_mask to limit extent of masking and trimming maskSeqEnds(seq, max_mask=1)
 "NCCCTGGN" "NAACTGGN" "NNNCTGNN"
maskSeqEnds(seq, max_mask=1, trim=TRUE)
 "CCCTGG" "AACTGG" "NNCTGN"
See maskSeqGaps for masking internal gaps.