Learn R Programming

haplotypes (version 1.0)

Dna-class: Class "Dna" in the Package haplotypes

Description

S4 class to hold DNA sequence data.

Arguments

Objects from the Class

Objects can be created by calls of the form new("Dna", sequence, seqlengths, seqnames), however reading fasta file using read.fas function or coerce matrix, data.frame or list objects to a Dna object using as.dna methods is preferable.

Slots

sequence:

Object of class "matrix" containing DNA sequence data, rows represent sequences and columns represent sites. See also ‘Note’.

seqlengths:

Object of class "numeric" containing the length of each DNA sequence.

seqnames:

Object of class "character" containing the name of each DNA sequence.

Methods

[

signature(x = "Dna", i = "ANY", j = "ANY"): extracts part of a DNA sequence as an object of class matrix.

[<-

signature(x = "Dna", i = "ANY", j = "ANY", value = "ANY"): replaces part of a Dna sequence with an object of class "matrix", "numeric" or "character".

as.data.frame

signature(x = "Dna"): coerces an object of class Dna to a data.frame.

as.list

signature(x = "Dna"): coerces an object of class Dna to a list; elements of the list are character vectors that contains the DNA sequences of length equal to corresponding value in the slot seqlengths.

as.matrix

signature(x = "Dna"): coerces an object of class Dna to a matrix.

as.numeric

signature(x = "Dna"): coerces an object of class Dna to a numeric matrix.

distance

signature(x = "Dna"): computes and returns an absolute pairwise character difference matrix from DNA sequences.

haplotype

signature(x = "Dna"): infers haplotypes from DNA sequences.

indelcoder

signature(x = "Dna"): supports simple indel coding method.

length

signature(x = "Dna"): returns the longest sequence length.

append

signature(x = "Dna", value = "ANY"): combines two Dna objects.

names

signature(x = "Dna"): gets the names of an object Dna.

names<-

signature(x = "Dna"): sets the names of an object Dna.

ncol

signature(x = "Dna"): returns the longest sequence length.

nrow

signature(x = "Dna"): returns the total sequence number.

pairnei

signature(x = "Dna"): calculates Nei's average number of differences between populations.

parsimnet

signature(x = "Dna"): estimates genealogies using statistical parsimony.

polymorp

signature(x = "Dna"): displays information about DNA polymorphisms of two sequences; indels and base substitutions, respectively.

show

signature(object = "Dna"): displays Dna object briefly.

subs

signature(x = "Dna"): displays information about base substitutions.