RemoveGaps {DECIPHER} | R Documentation

## Remove Gap Characters in Sequences

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

    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

    dna <- DNAStringSet(c("ACT-G-", "AC--G-"))
    dna
    RemoveGaps(dna, "all")
    RemoveGaps(dna, "common")

[Package DECIPHER version 2.20.0 Index]