haplotype-methods: Methods for function 'haplotype' in the package 'haplotypes'

Description Usage Arguments Value Methods Author(s) Examples

Description

Collapses identical DNA sequences into haplotypes or infering haplotypes using user provided absolute pairwise character difference matrix.

Usage

1
2
3
4
5
6
## 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 Dna, dist, or matrix.

indels

the indel coding method to be used. This must be one of "sic", "5th" or "missing". Any unambiguous substring can be given. See distance for details.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	
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)  

haplotypes documentation built on Feb. 28, 2020, 5:08 p.m.