| haplotype-methods {haplotypes} | R Documentation | 
Methods for function haplotype in the package haplotypes
Description
Collapses identical DNA sequences into haplotypes or infering haplotypes using user provided absolute pairwise character difference matrix.
Usage
## S4 method for signature 'Dna'
haplotype(x,indels="sic")
## S4 method for signature 'dist'
haplotype(x)
## S4 method for signature 'matrix'
haplotype(x)
Arguments
x | 
 an object of class   | 
indels | 
 the indel coding method to be used. This must be one of "sic", "5th" or "missing". Any unambiguous substring can be given.  See   | 
Value
haplotype returns an object of class Haplotype, as.list-methods can be used to coerce the object to a list.
Methods
signature(x = "Dna")- 
Inferring haplotypes from DNA sequences.
 signature(x = "dist")- 
Inferring haplotypes using an absolute pairwise character difference matrix (dist object).
 signature(x = "matrix")- 
Inferring haplotypes using an absolute pairwise character difference matrix.
 
Author(s)
Caner Aktas, caktas.aca@gmail.com
Examples
	
data("dna.obj")
x<-dna.obj[1:6,,as.matrix=FALSE]
##Inferring haplotypes using 'Dna' object.
# coding gaps using simple indel coding method
h<-haplotype(x,indels="sic")
h
# giving DNA sequences of haplotypes
as.dna(h) 
## Not run: 
	
## Slots of an object Haplotype	
h@haplist  #haplotype list (names)
h@hapind  #haplotype list (index)
h@uniquehapind  #getting index of the first occurrence of haplotypes
h@sequence  #DNA sequences of haplotypes
h@d  #distance matrix of haplotypes
h@freq  #haplotype frequencies
h@nhap  #total number of haplotypes
## End(Not run)
## Inferring haplotypes using dist object. 
d<-distance(x)
h<-haplotype(d) 
h
## Not run: 
# returns an error message 
as.dna(h)
## End(Not run) 
## Inferring haplotypes using distance matrix.
d<-as.matrix(distance(x))
h<-haplotype(d) 
h
## Not run: 
# returns an error message
as.dna(h)
## End(Not run)  
[Package haplotypes version 1.1.3.1 Index]