Description Usage Arguments Author(s) See Also Examples
View source: R/dist.xyiStats.R
This function calculates distIUPAC
based distances
comparing two populations (x: receiver; y: donor) with an ingroup
population (i: ingroup).
In a four-taxin scenario (((P1,P2),P3),O) with geneflow from P3>>P2,
the populations should be defined for deltaMean and deltaMin statistics
as follows [x:P2 y:P3 i:P1].
Accordingly in the four-taxin scenario (((P1,P2),P3),O) with geneflow from
P2>>P3, the populations should be defined for deltaMean and deltaMin
statistics as follows [x:P3 y:P2 i:P1].
1 2 | dist.xyiStats(tmpSEQ, x.pos, y.pos, i.pos, x.name = "x", y.name = "y",
i.name = "i", dist = "IUPAC", ncores = 1)
|
tmpSEQ |
|
x.pos |
population X positions [mandatory] |
y.pos |
population Y positions [mandatory] |
i.pos |
population I positions [mandatory] |
x.name |
population X name [default: "x"] |
y.name |
population Y name [default: "y"] |
i.name |
population I name [default: "i"] |
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] |
Kristian K Ullrich
xyiStats
,
distIUPAC
, rcpp_distIUPAC
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 'xyiStats' function to handle population assignment automatically
##load sequence data
data("MySequences", package="distIUPAC")
CAS.pos<-5:34
AFG.pos<-82:87
IRA.pos<-71:78
##Here, one needs to consider the changed x, y and i 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)))
IRA.pos_<-seq(from=length(c(CAS.pos, AFG.pos))+1,
to=length(c(CAS.pos, AFG.pos, IRA.pos)))
##pairwise deletion
CAS_AFG_IRA.pairwiseDeletion.dist<-distIUPAC(
as.character(MySequences[c(CAS.pos,AFG.pos,IRA.pos)]))
CAS_AFG_IRA.pairwiseDeletion.xyiStats<-dist.xyiStats(
CAS_AFG_IRA.pairwiseDeletion.dist,
x.pos=CAS.pos_, y.pos=AFG.pos_, i.pos=IRA.pos_,
x.name="CAS", y.name="AFG", i.name="IRA")
##global deletion
CAS_AFG_IRA.globalDeletion.dist<-distIUPAC(
as.character(globalDeletion(MySequences[c(CAS.pos,AFG.pos,IRA.pos)])))
CAS_AFG_IRA.globalDeletion.xyiStats<-dist.xyiStats(
CAS_AFG_IRA.globalDeletion.dist,
x.pos=CAS.pos_, y.pos=AFG.pos_, i.pos=IRA.pos_,
x.name="CAS", y.name="AFG", i.name="IRA")
##compare results
rbind(CAS_AFG_IRA.pairwiseDeletion.xyiStats,
CAS_AFG_IRA.globalDeletion.xyiStats)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.