Learn R Programming

haplotypes (version 1.1.3.1)

remove.gaps-methods: Removing gaps from Dna object

Description

Removing gaps("-") from Dna object

Usage

# S4 method for Dna
remove.gaps(x,entire.col=FALSE)

Value

an object of class Dna.

Arguments

x

an object of class Dna.

entire.col

boolean; entire columns with gaps are removed if this is TRUE. See also ‘Details’.

Methods

signature(x = "Dna")

Author

Caner Aktas, caktas.aca@gmail.com

Details

If entire.col==TRUE, alignment is preserved. If it is FALSE, end gaps are introduced to sequence matrix.

Examples

Run this code

data("dna.obj")

## original data
x<-dna.obj 
range(x)
x@seqlengths

## Only gaps '-' are removed from sequences.
x<-remove.gaps(dna.obj, entire.col=FALSE)
range(x)
x@seqlengths

## entire columns with gaps are removed.
x<-remove.gaps(dna.obj, entire.col=TRUE)
range(x)
x@seqlengths


Run the code above in your browser using DataLab