RemoveGaps: Remove Gap Characters in Sequences

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/RemoveGaps.R

Description

Removes gaps ("-" or "." characters) in a set of sequences, either deleting all gaps or only those shared by all sequences in the set.

Usage

1
2
3
RemoveGaps(myXStringSet,
           removeGaps = "all",
           processors = 1)

Arguments

myXStringSet

An AAStringSet, DNAStringSet, or RNAStringSet object containing sequences.

removeGaps

Determines how gaps ("-" or "." characters) are removed in the sequences. This should be (an unambiguous abbreviation of) one of "none", "all" or "common".

processors

The number of processors to use, or NULL to automatically detect and use all available processors.

Details

The removeGaps argument controls which gaps are removed in myXStringSet. Setting removeGaps to "all" will remove all gaps in the input sequences, whereas setting removeGaps to "common" will remove only gaps that exist in the same position in every sequence. Therefore, the latter method will leave gaps in place that are not shared by every sequence, requiring that the sequences in myXStringSet all be the same length (i.e., be aligned). Setting removeGaps to "none" will simply return myXStringSet unaltered.

Value

An XStringSet of the same type as myXStringSet.

Author(s)

Erik Wright eswright@pitt.edu

See Also

AlignSeqs

Examples

1
2
3
4
dna <- DNAStringSet(c("ACT-G-", "AC--G-"))
dna
RemoveGaps(dna, "all")
RemoveGaps(dna, "common")

Example output

Loading required package: Biostrings
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: IRanges
Loading required package: XVector

Attaching package:BiostringsThe following object is masked frompackage:base:

    strsplit

Loading required package: RSQLite
DNAStringSet object of length 2:
    width seq
[1]     6 ACT-G-
[2]     6 AC--G-
DNAStringSet object of length 2:
    width seq
[1]     4 ACTG
[2]     3 ACG
DNAStringSet object of length 2:
    width seq
[1]     4 ACTG
[2]     4 AC-G

DECIPHER documentation built on Nov. 8, 2020, 8:30 p.m.