[adegenet-commits] r390 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jun 10 13:28:41 CEST 2009
Author: jombart
Date: 2009-06-10 13:28:41 +0200 (Wed, 10 Jun 2009)
New Revision: 390
Modified:
pkg/R/haploSim.R
pkg/R/seqTrack.R
Log:
renaming proxMat -> prox.mat
Modified: pkg/R/haploSim.R
===================================================================
--- pkg/R/haploSim.R 2009-06-10 10:59:13 UTC (rev 389)
+++ pkg/R/haploSim.R 2009-06-10 11:28:41 UTC (rev 390)
@@ -363,7 +363,7 @@
#####################
## seqTrack.haploSim
#####################
-seqTrack.haploSim <- function(x, optim=c("min","max"), proxMat=NULL, ...){
+seqTrack.haploSim <- function(x, optim=c("min","max"), prox.mat=NULL, ...){
myX <- dist.dna(x$seq, model="raw")
seq.names <- labels(x)
seq.dates <- as.POSIXct(x)
@@ -374,7 +374,7 @@
} else {
mu0 <- eval(prevCall$mu)
}
- res <- seqTrack(myX, seq.names=seq.names, seq.dates=seq.dates, optim=optim, proxMat=proxMat,...)
+ res <- seqTrack(myX, seq.names=seq.names, seq.dates=seq.dates, optim=optim, prox.mat=prox.mat,...)
return(res)
}
Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R 2009-06-10 10:59:13 UTC (rev 389)
+++ pkg/R/seqTrack.R 2009-06-10 11:28:41 UTC (rev 390)
@@ -16,7 +16,7 @@
## seqTrack
#############
seqTrack.default <- function(x, seq.names, seq.dates, optim=c("min","max"),
- proxMat=NULL, ...){
+ prox.mat=NULL, ...){
## CHECKS ##
optim <- match.arg(optim)
@@ -41,8 +41,8 @@
x <- as.matrix(x)
- if(!is.null(proxMat) && !identical(dim(proxMat),dim(x))) {
- stop("proxMat is provided but its dimensions are inconsistent with that of x")
+ if(!is.null(prox.mat) && !identical(dim(prox.mat),dim(x))) {
+ stop("prox.mat is provided but its dimensions are inconsistent with that of x")
}
N <- length(seq.names)
@@ -53,8 +53,8 @@
x <- as.matrix(x)
## rename dimensions using id
colnames(x) <- rownames(x) <- id
- if(!is.null(proxMat)){
- colnames(proxMat) <- rownames(proxMat) <- id
+ if(!is.null(prox.mat)){
+ colnames(prox.mat) <- rownames(prox.mat) <- id
}
if(length(seq.names) != nrow(x)){
@@ -79,9 +79,9 @@
## select among different possible ancestors
selAmongAncestors <- function(idx,ances){
- ## Choose the most otherwise connected ancestor, given proxMat
- if(!is.null(proxMat)){ # if we've got no other info
- toKeep <- test.equal(max(proxMat[idx,ances]), proxMat[idx,ances])
+ ## Choose the most otherwise connected ancestor, given prox.mat
+ if(!is.null(prox.mat)){ # if we've got no other info
+ toKeep <- test.equal(max(prox.mat[idx,ances]), prox.mat[idx,ances])
ances <- ances[toKeep]
}
More information about the adegenet-commits
mailing list