dist.xyoStats: dist.xyoStats

Description Usage Arguments Author(s) See Also Examples

View source: R/dist.xyoStats.R

Description

This function calculates distIUPAC based distances comparing two populations (x: receiver; y: donor) with an ingroup population (i: ingroup). In a four-taxon scenario (((P1,P2),P3),O) with geneflow from P3>>P2, the populations should be defined for RND, Gmin and RNDmin statistics as follows [x:P2 y:P3 i:O]. Accordingly in the four-taxon scenario (((P1,P2),P3),O) with geneflow from P2>>P3, the populations should be defined for RND, Gmin and RNDmin statistics as follows [x:P3 y:P2 i:O].

Usage

1
2
dist.xyoStats(tmpSEQ, x.pos, y.pos, o.pos, x.name = "x", y.name = "y",
  o.name = "o", dist = "IUPAC", ncores = 1)

Arguments

tmpSEQ

DNAStringSet [mandatory]

x.pos

population X positions [mandatory]

y.pos

population Y positions [mandatory]

o.pos

population I positions [mandatory]

x.name

population X name [default: "x"]

y.name

population Y name [default: "y"]

o.name

population I name [default: "o"]

dist

distance to use [default: IUPAC] or choose one model as in dist.dna [default: "IUPAC"]

ncores

number of parallel cores to process pairwise distance calculation [default: 1] see rcpp_distIUPAC [default: 1]

Author(s)

Kristian K Ullrich

See Also

xyoStats, distIUPAC, rcpp_distIUPAC

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
##Use the 'xyoStats' function to handle population assignment automatically

##load sequence data
data("MySequences", package="distIUPAC")
CAS.pos<-5:34
AFG.pos<-82:87
SPRE.pos<-106:113

##Here, one needs to consider the changed x, y and o positions due
##to sub-sampling.
CAS.pos_<-seq_along(CAS.pos)
AFG.pos_<-seq(from=length(CAS.pos_)+1, to=length(c(CAS.pos, AFG.pos)))
SPRE.pos_<-seq(from=length(c(CAS.pos, AFG.pos))+1,
  to=length(c(CAS.pos, AFG.pos, SPRE.pos)))

##pairwise deletion
CAS_AFG_SPRE.pairwiseDeletion.dist<-distIUPAC(
  as.character(MySequences[c(CAS.pos,AFG.pos,SPRE.pos)]))
CAS_AFG_SPRE.pairwiseDeletion.xyoStats<-dist.xyoStats(
  CAS_AFG_SPRE.pairwiseDeletion.dist, 
  x.pos=CAS.pos_, y.pos=AFG.pos_, o.pos=SPRE.pos_,
  x.name="CAS", y.name="AFG", o.name="SPRE")

##global deletion
CAS_AFG_SPRE.globalDeletion.dist<-distIUPAC(
  as.character(globalDeletion(MySequences[c(CAS.pos,AFG.pos,SPRE.pos)])))
CAS_AFG_SPRE.globalDeletion.xyoStats<-dist.xyoStats(
  CAS_AFG_SPRE.globalDeletion.dist,
  x.pos=CAS.pos_, y.pos=AFG.pos_, o.pos=SPRE.pos_,
  x.name="CAS", y.name="AFG", o.name="SPRE")

##compare results
rbind(CAS_AFG_SPRE.pairwiseDeletion.xyoStats,
  CAS_AFG_SPRE.globalDeletion.xyoStats)

kullrich/distIUPAC documentation built on Jan. 9, 2020, 2:50 p.m.