[R-sig-phylo] kdetrees

2023-06-28 Thread Vojtěch Zeisek
Hello,
kdetrees <https://cran.r-project.org/package=kdetrees> was removed from CRAN 
in 2022 "as email to the maintainer is undeliverable". It's licensed under 
GPL-2, so I forked <https://github.com/grady/kdetrees> into my repository 
<https://github.com/V-Z/kdetrees> and so far corrected few minor issues. The 
Git doesn't contain sources for vignettes, and at least for now I'm not going 
to decompose PDFs from CRAN archive. If I would in the future re-upload it on 
CRAN, is it somehow special procedure regarding I'd be new maintainer of 
archived project? And when I started working on this little bit (rather 
maintenance fixes than "big" development), are there any general comments or 
requests about kdetrees?
Sincerely,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Parallelization in ape::dist.topo

2023-03-07 Thread Vojtěch Zeisek
Hello, Emmanuel,
I overlooked that repo, sorry. OK, so I opened
https://github.com/emmanuelparadis/ape/issues/72
and https://github.com/emmanuelparadis/ape/pull/71
Sincerely,
V.

Dne úterý 7. března 2023 12:13:49 CET, Emmanuel Paradis napsal(a):
> Hi Vojtěch,
> The GH repos for ape is:
> https://github.com/emmanuelparadis/ape
> I had a quick look at your code and these are interesting improvements.
> It seems also possible to improve the basic code of dist.topo() (e.g.,
> using bitsplits) so it is worth opening an issue.
> Cheers,
> Emmanuel
> 
> - Le 6 Mar 23, à 20:43, Vojtěch Zeisek a écrit :
> > Hello dear colleagues,
> > I use often ape::dist.topo (see here dist.topo.r), which is doing
> > the calculations sequentially, which is very slow for large data
> > sets. I'm sorry, I haven't found any relevant Git repository or so,
> > so I hope Emmanuel won't mind if I discuss it here.
> > I discussed various options with ChatGPT and dist.topo.par1.r is the
> > simplest solution, basically using mc.lapply instead of 2 for loops.
> > Good study material for how to do it in general. Little enhancements
> > are in dist.topo.par2.r, which should be slightly better in case some
> > pair of comparisons would return NA or so, but from my tests there
> > doesn't seem to be any difference.
> > And finally there is dist.topo.par3.r which doesn't load parallel
> > (and uses plain lapply) for cores==1, while parallel and doParallel
> > for multiple cores. It also contains some checks and error handling.
> > From my testing it works well. I'm not sure if tryCatch is really
> > needed there. In any case, improvements welcomed. :-)
> > So, what do You think? Is this usable improvement of ape::dist.topo?
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Parallelization in ape::dist.topo

2023-03-07 Thread Vojtěch Zeisek
Thank You, dear Martin,
I wasn't aware about TreeDist, going to explore. :-)
Yes, RF has some limits, e.g. single difference close to root...
Sincerely,
V.

Dne úterý 7. března 2023 12:23:07 CET, Martin R. Smith napsal(a):
> Dear Vojtěch,
> The performance of calculating Robinson-Foulds topological distances
> can be improved using the algorithm of Day (1985), which is implemented
> in the R package TreeDist:
> https://ms609.github.io/TreeDist/reference/Robinson-Foulds.html
> This will often be faster than dist.topo.
> (As noted there, the RF distance has certain issues which means that
> it is not always the most suitable measure of tree dissimilarity!)
> And you can find ape's GitHub repo https://github.com/emmanuelparadis/ape
> Martin
> > --
> > Message: 1
> > Date: Mon, 06 Mar 2023 14:43:04 +0100
> > From: =?utf-8?B?Vm9qdMSbY2g=?= Zeisek 
> > To: mailinglist R 
> > Subject: [R-sig-phylo] Parallelization in ape::dist.topo
> > Message-ID: <3551602.QO7bkq4lFn@veles>
> > Content-Type: text/plain; charset="utf-8"
> > 
> > Hello dear colleagues,
> > I use often ape::dist.topo (see here dist.topo.r), which is doing
> > the calculations sequentially, which is very slow for large data
> > sets. I'm sorry, I haven't found any relevant Git repository or
> > so, so I hope Emmanuel won't mind if I discuss it here.
> > I discussed various options with ChatGPT and dist.topo.par1.r is the
> > simplest solution, basically using mc.lapply instead of 2 for loops.
> > Good study material for how to do it in general. Little enhancements
> > are in dist.topo.par2.r, which should be slightly better in case
> > some pair of comparisons would return NA or so, but from my tests
> > there doesn't seem to be any difference.
> > And finally there is dist.topo.par3.r which doesn't load parallel
> > (and uses plain lapply) for cores==1, while parallel and doParallel
> > for multiple cores. It also contains some checks and error handling.
> > From my testing it works well. I'm not sure if tryCatch is really
> > needed there. In any case, improvements welcomed. :-)
> > So, what do You think? Is this usable improvement of ape::dist.topo?
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Parallelization in ape::dist.topo

2023-03-07 Thread Vojtěch Zeisek
Hello,
thank You for Your comments, dear Klaus.

Dne úterý 7. března 2023 13:01:07 CET, Klaus Schliep napsal(a):
> Dear Vojtěch,
> nice work. Just a few random comments:
> Parallelization is often not straightforward as it
> depends on the hardware and the operating system.

Yes. E.g. it typically relies on fork(), which is unavailable on Windows.

> My preference is using the future package for parallelization
> as it does some nice abstraction for the different R packages,
> so you can try different things and no need to write different
> versions of the code. chatGPT seems to have missed this.

I was looking at future.apply package, but it seemed unnecessarily complex to 
me. I'm bit biased as I hardly meet anyone with working parallelization 
(greetings to MPI) on Windows and on Linux "plan" mostly works well.

> Defaulting to "cores = detectCores()" is not a good idea. The CRAN
> Repository Policy (https://cran.r-project.org/web/packages/policies.html)
> states: "If running a package uses multiple threads/cores it must never
> use more than two simultaneously: the check farm is a shared resource
> and will typically be running many checks simultaneously." In short such
> a default can cause serious problems on a cluster and I got properly
> ripleyed for this years ago, but that's another story. So the default
> should be something like min(2L, detectCores()).

That's good point, thank You.

> So with great power comes great responsibility
> and users should read the man pages.
> Kind regards,
> Klaus
> 
> On Mon, Mar 6, 2023 at 2:43 PM Vojtěch Zeisek wrote:
> > Hello dear colleagues,
> > I use often ape::dist.topo (see here dist.topo.r), which is doing the
> > calculations sequentially, which is very slow for large data sets.
> 
> What is large? Large number of trees or large trees?

Let's say up to ~1000 trees with 100+ tips. Then dist.topo runs for hours.

> > I'm sorry, I haven't found any relevant Git repository or so, so
> > I hope Emmanuel won't mind if I discuss it here. I discussed
> > various options with ChatGPT and dist.topo.par1.r is the simplest
> > solution, basically using mc.lapply instead of 2 for loops. Good
> > study material for how to do it in general. Little enhancements
> > are in dist.topo.par2.r, which should be slightly better in case
> > some pair of comparisons would return NA or so, but from my tests
> > there doesn't seem to beany difference.
> 
> I think there is room for improvement with preprocessing trees. If
> you have e.g. bootstrap trees with short edges you might want to
> use di2multi() first to avoid spurious differences. Filtering out
> duplicated trees could also speed up things, if there are many.
> This will depend on the trees you want to compare and the methods.

Could be, but not every distance method works well with polytomies.

> > And finally there is dist.topo.par3.r which doesn't load parallel
> > (and uses plain lapply) for cores==1, while parallel and doParallel
> > for multiple cores. It also contains some checks and error handling.
> > From my testing it works well. I'm not sure if tryCatch is really
> > needed there.
> 
> I am not sure if it is necessary, but you
> don't want to have it in the inner loop ;)

It's not first time I see such construction, I already used it like that (also 
in different cases) and so far so good. :-)

> > In any case, improvements welcomed. :-)
> > So, what do You think? Is this usable improvement of ape::dist.topo?

Thank You,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[R-sig-phylo] Parallelization in ape::dist.topo

2023-03-06 Thread Vojtěch Zeisek
Hello dear colleagues,
I use often ape::dist.topo (see here dist.topo.r), which is doing the 
calculations sequentially, which is very slow for large data sets. I'm sorry, 
I haven't found any relevant Git repository or so, so I hope Emmanuel won't 
mind if I discuss it here.
I discussed various options with ChatGPT and dist.topo.par1.r is the simplest 
solution, basically using mc.lapply instead of 2 for loops. Good study 
material for how to do it in general. Little enhancements are in 
dist.topo.par2.r, which should be slightly better in case some pair of 
comparisons would return NA or so, but from my tests there doesn't seem to be 
any difference.
And finally there is dist.topo.par3.r which doesn't load parallel (and uses 
plain lapply) for cores==1, while parallel and doParallel for multiple cores. 
It also contains some checks and error handling. From my testing it works 
well. I'm not sure if tryCatch is really needed there. In any case, 
improvements welcomed. :-)
So, what do You think? Is this usable improvement of ape::dist.topo?
Sincerely,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start
function (x, y = NULL, method = "PH85") 
{
	method <- match.arg(method, c("PH85", "score"))
	if (!is.null(y)) x <- c(x, y)
	testroot <- any(is.rooted(x))
	n <- length(x)
	res <- numeric(n * (n - 1)/2)
	nms <- names(x)
	if (is.null(nms)) nms <- paste0("tree", 1:n)
	if (method == "PH85") {
			if (testroot) warning("Some trees were rooted: topological distances may be spurious.")
			x <- .compressTipLabel(x)
			ntip <- length(attr(x, "TipLabel"))
			nnode <- sapply(x, Nnode)
			foo <- function(phy, ntip) {
	phy <- reorder(phy, "postorder")
	pp <- bipartition2(phy$edge, ntip)
	attr(pp, "labels") <- phy$tip.label
	ans <- SHORTwise(pp)
	sapply(ans, paste, collapse = "\r")
			}
			x <- lapply(x, foo, ntip = ntip)
			k <- 0L
			for (i in 1:(n - 1)) {
	y <- x[[i]]
	m1 <- nnode[i]
	for (j in (i + 1):n) {
			z <- x[[j]]
			k <- k + 1L
			res[k] <- m1 + nnode[j] - 2 * sum(z %in% y)
	}
			}
	}
	else {
			k <- 0L
			for (i in 1:(n - 1)) {
	for (j in (i + 1):n) {
			k <- k + 1L
			res[k] <- .dist.topo.score(x[[i]], x[[j]])
	}
			}
	}
	attr(res, "Size") <- n
	attr(res, "Labels") <- nms
	attr(res, "Diag") <- attr(res, "Upper") <- FALSE
	attr(res, "method") <- method
	class(res) <- "dist"
	res
}
function (x, y = NULL, method = "PH85", cores = detectCores())
{
  method <- match.arg(method, c("PH85", "score"))
  if (!is.null(y)) x <- c(x, y)
  testroot <- any(is.rooted(x))
  n <- length(x)
  res <- numeric(n * (n - 1)/2)
  nms <- names(x)
  if (is.null(nms)) nms <- paste0("tree", 1:n)
  if (cores == 1) {
if (method == "PH85") {
  if (testroot) warning("Some trees were rooted: topological distances may be spurious.")
  x <- .compressTipLabel(x)
  ntip <- length(attr(x, "TipLabel"))
  nnode <- sapply(x, Nnode)
  foo <- function(phy, ntip) {
phy <- reorder(phy, "postorder")
pp <- bipartition2(phy$edge, ntip)
attr(pp, "labels") <- phy$tip.label
ans <- SHORTwise(pp)
sapply(ans, paste, collapse = "\r")
  }
  x <- lapply(x, foo, ntip = ntip)
  res_list <- lapply(1:(n - 1), function(i) {
y <- x[[i]]
m1 <- nnode[i]
res_sub <- numeric(n - i)
for (j in (i + 1):n) {
  z <- x[[j]]
  res_sub[j - i] <- m1 + nnode[j] - 2 * sum(z %in% y)
}
res_sub
  })
} else {
  res_list <- lapply(1:(n - 1), function(i) {
res_sub <- numeric(n - i)
for (j in (i + 1):n) {
  res_sub[j - i] <- .dist.topo.score(x[[i]], x[[j]])
}
res_sub
  })
}
  } else {
tryCatch({
  cl <- makeCluster(cores)
  registerDoParallel(cl)
  library(parallel)
  library(doParallel)
  cl <- makeCluster(cores)
  registerDoParallel(cl)
}, error = function(e) {
 message("Failed to initiate cluster: ", conditionMessage(e))
 stop(e)
 })
if (method == "PH85") {
  if (testroot) warning("Some trees were rooted: topological distances may be spurious.")
  x <- .compressTipLabel(x)
  nti

[R-sig-phylo] ape::muscle doesn't work with Muscle5

2022-01-23 Thread Vojtěch Zeisek
Hello,
ape::muscle() works well with MUSCLE 3.8.31 from 
<https://drive5.com/muscle/downloads_v3.htm>, but not with v. 5.1 
<https://github.com/rcedgar/muscle/releases> (released recently). I run it as 
'ape::muscle(x=gunnera.dna, exec="muscle", quiet=FALSE, 
original.ordering=TRUE)' and I get with old MUSCLE

MUSCLE v3.8.31 by Robert C. Edgar
http://www.drive5.com/muscle
This software is donated to the public domain.
Please cite: Edgar, R.C. Nucleic Acids Res 32(5), 1792-97.
muscle1a88744f8d6a 22 seqs, max length 770, avg  length 741

and with the new one

Invalid command line
Unknown option in
Error in file(con, "rb") : cannot open the connection
In addition: Warning message:
In file(con, "rb") :
  cannot open file '/tmp/RtmpufUSy4/muscle1a88eb531c7.fas': File or directory 
does not exist
Error in file(con, "rb") : cannot open the connection

So obviously there is change in command line parameters among MUSCLE versions 
3.8 and 5.1. I hope it would be an easy fix. :-)
Sincerely,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Trimming protein alignment

2021-11-03 Thread Vojtěch Zeisek
Yes! Thank You, Emmanuel!
This works perfectly. In same way I edited also del.rowgapsonly()
Sincerely,
V.

Dne úterý 2. listopadu 2021 15:12:47 CET, Emmanuel Paradis napsal(a):
> Ha! That's because gaps are coded with dashes in your files; I assumed
> it was X's (as returned by ape::trans). So this line 7 should be:
> foo <- function(x) sum(x == 0x58 | x == 0x2d)
> Or (probably easier to modify):
> foo <- function(x) sum(x == charToRaw("X") | x == charToRaw("-"))
> Cheers,
> Emmanuel
> 
> Le 2 Nov 21, à 19:23, Vojtěch Zeisek vo...@trapa.cz a écrit :
> > Thank You, Emmanuel,
> > I thought I must do something with line 7, but I had no idea what.
> > :-) Unfortunately it didn't work. I still get "All sequences of
> > the same length: 249" after running the edited function as 'aln.ng
> > <- del.colgapsonly(x=aln, threshold=0.25, freq.only=FALSE)'... :-(
> > I'm attaching one example (I have almost 1000 of them, so I'd like
> > to avoid to edit all of them manually:-).
> > Sincerely,
> > V.
> > 
> > Dne úterý 2. listopadu 2021 12:36:53 CET jste napsal(a):
> >> Hi Vojtěch,
> >> In addition to removing lines 3 and 4, replace line 7:
> >> foo <- function(x) sum(x == 4)
> >> by:
> >> foo <- function(x) sum(x == 0x58)
> >> That sh(c)ould do it.
> >> Best,
> >> Emmanuel
> >> 
> >> Le 2 Nov 21, à 17:37, Vojtěch Zeisek vo...@trapa.cz a écrit :
> >> > Hello,
> >> > I try to trim protein alignments in R. I see del.colgapsonly() and
> >> > del.rowgapsonly() from ape can trim only class DNAbin. As DNAbin as
> >> > basically same matrix as AAbin (Isn't it?), I thought it should be
> >> > easy. I commented out lines 3 and 4 in both del.colgapsonly() and
> >> > del.rowgapsonly(), but it didn't lead to success. I haven't found
> >> > any other way how to trim protein alignment in R similar to what
> >> > these two function do. Is there any way?
> >> > Sincerely,
> >> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/
https://botany.natur.cuni.cz/brassiploidy/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Vojtěch Zeisek
Thank You, Emmanuel,
I thought I must do something with line 7, but I had no idea what. :-) 
Unfortunately it didn't work. I still get "All sequences of the same length: 
249" after running the edited function as 'aln.ng <- del.colgapsonly(x=aln, 
threshold=0.25, freq.only=FALSE)'... :-( I'm attaching one example (I have 
almost 1000 of them, so I'd like to avoid to edit all of them manually:-).
Sincerely,
V.

Dne úterý 2. listopadu 2021 12:36:53 CET jste napsal(a):
> Hi Vojtěch,
> In addition to removing lines 3 and 4, replace line 7:
> foo <- function(x) sum(x == 4)
> by:
> foo <- function(x) sum(x == 0x58)
> That sh(c)ould do it.
> Best,
> Emmanuel
> 
> Le 2 Nov 21, à 17:37, Vojtěch Zeisek vo...@trapa.cz a écrit :
> > Hello,
> > I try to trim protein alignments in R. I see del.colgapsonly() and
> > del.rowgapsonly() from ape can trim only class DNAbin. As DNAbin as
> > basically same matrix as AAbin (Isn't it?), I thought it should be
> > easy. I commented out lines 3 and 4 in both del.colgapsonly() and
> > del.rowgapsonly(), but it didn't lead to success. I haven't found
> > any other way how to trim protein alignment in R similar to what
> > these two function do. Is there any way?
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start
>Musa
MFSSFSSSGDPSLHHPEFCSATSPQGLFPDANSAFPSSSPPCTSFSSESYLHTHSLPFHHHYIPDSLNQPLYSSSPCDYLDFNAGPVRRVLSTGNLQGGNGLHENSSQEGGVAGKVGRYSAEERKERIERYRSKRNQRNFHKKITYECRKTLADSRPRVRGRFARNGETETEAAVEMETGTDTGAAAVNCFDNYEQNQLGGNGSDCWRQLQAALAMDDEDEYSYDEEFLASFSDFYSMNTL
>C1
HPPYCDYLDFKAGPVRR
>C2
CDYLDFHAAPVR-
>C3
-YFDWSIGAHSRPLHHHIA--ELIYPTYSSSPCDYLDFNAEPVRR
>C4
-YFDGSISAHSRPLHHHVA--ELIYPTYSSSPCDYLDFNAEPVRR
>C5
CDYLDFHAAPVR-
>C6
-YFDGSISAHSRPLHHHVA--ELIYPTYSSSPCDYLDFNAEPVRR
>C7
CDYLDFHAAPVR-


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Vojtěch Zeisek
Hello,
thank You, but it seems that trimEnds() requires DNAbin. I checked also other 
functions from ips, and it seems to be the same...
Sincerely,
V.

Dne úterý 2. listopadu 2021 12:13:06 CET jste napsal(a):
> Dear Vojtech,
> Did you check this https://rdrr.io/cran/ips/man/trimEnds.html
> Franz
> 
> > On 2. Nov 2021, at 11:38, Vojtěch Zeisek wrote:
> > Hello,
> > I try to trim protein alignments in R. I see del.colgapsonly() and
> > del.rowgapsonly() from ape can trim only class DNAbin. As DNAbin as
> > basically same matrix as AAbin (Isn't it?), I thought it should be
> > easy. I commented out lines 3 and 4 in both del.colgapsonly() and
> > del.rowgapsonly(), but it didn't lead to success. I haven't found
> > any other way how to trim protein alignment in R similar to what
> > these two function do. Is there any way?
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Vojtěch Zeisek
Hello,
I try to trim protein alignments in R. I see del.colgapsonly() and 
del.rowgapsonly() from ape can trim only class DNAbin. As DNAbin as basically 
same matrix as AAbin (Isn't it?), I thought it should be easy. I commented out 
lines 3 and 4 in both del.colgapsonly() and del.rowgapsonly(), but it didn't 
lead to success. I haven't found any other way how to trim protein alignment 
in R similar to what these two function do. Is there any way?
Sincerely,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Branch lengths in phytools::plot.cophylo

2018-12-13 Thread Vojtěch Zeisek
Hello, Liam,
no, it's not complicated. I was just wondering if anyone has some more elegant 
solution or if I don't do anything wrong.
Thank You,
Vojtěch

Dne čtvrtek 13. prosince 2018 14:24:09 CET jste napsal(a):
> Hello Vojtěch.
> To me, it doesn't seem much more difficult for the user to specify:
> object <- cophylo(compute.brlen(phy1,power=0.5),
>   compute.brlen(phy2,power=0.7)) ## or what have you
> than:
> object <- cophylo(phy1,phy2,power=c(0.5, 0.7))
> and then have power passed internally to compute.brlen. Is that
> what you'd prefer?
> All the best, Liam
> 
> On 12/12/2018 6:29 PM, Vojtěch Zeisek wrote:
> > Hello,
> > the original question was
> > https://www.mail-archive.com/r-sig-phylo@r-project.org/msg05367.html
> > Playing with the 'power' parameter of the compute.brlen() function 
> > was the only I found working.
> > Thank You both,
> > V.
> > 
> > Dne středa 12. prosince 2018 20:31:11 CET jste napsal(a):
> >> I didn't see the email that this addresses, but I will add a couple
> >> of comments to Juan's suggestion:
> >> (1) phytools::cophylo does not require the input trees to have branch
> >> lengths. If they do not, arbitrary branch lengths for plotting are
> >> computed using ape::compute.brlen.
> >> (2) The code suggested by Juan does indeed assign branch lengths to
> >> the tree; however, it has effect of assigning different depths for
> >> equivalently nested relationships. If you don't like the spacing of
> >> compute.brlen, it is possible to change it using the argument 'power.'
> >> 0 >> in time & may look better than the default.
> >> All the best, Liam
> >>
> >> On 12/12/2018 12:07 PM, Juan Antonio Balbuena wrote:
> >>> You can try this:
> >>> tree<- compute.brtime(tree, tree$Nnode:1)
> >>> It will produce an ultrametric tree with its nodes well separated.
> >>> I hope it helps
> >>> All the best
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Branch lengths in phytools::plot.cophylo

2018-12-12 Thread Vojtěch Zeisek
Hello,
the original question was
https://www.mail-archive.com/r-sig-phylo@r-project.org/msg05367.html
Playing with the 'power' parameter of the compute.brlen() function was the 
only I found working.
Thank You both,
V.

Dne středa 12. prosince 2018 20:31:11 CET jste napsal(a):
> I didn't see the email that this addresses, but I will add a couple of 
> comments to Juan's suggestion:
> (1) phytools::cophylo does not require the input trees to have branch 
> lengths. If they do not, arbitrary branch lengths for plotting are 
> computed using ape::compute.brlen.
> (2) The code suggested by Juan does indeed assign branch lengths to the 
> tree; however, it has effect of assigning different depths for 
> equivalently nested relationships. If you don't like the spacing of 
> compute.brlen, it is possible to change it using the argument 'power.' 
> 0 time & may look better than the default.
> All the best, Liam
> 
> On 12/12/2018 12:07 PM, Juan Antonio Balbuena wrote:
> > You can try this:
> > tree<- compute.brtime(tree, tree$Nnode:1)
> > It will produce an ultrametric tree with its nodes well separated.
> > I hope it helps
> > All the best
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[R-sig-phylo] Branch lengths in phytools::plot.cophylo

2018-11-08 Thread Vojtěch Zeisek
Hello,
I plot two trees (they include branch lengths) like this:
cophylo.full <- phytools::cophylo(tr1=full[[1]], tr2=full[[3]], 
assoc=(cbind(sort(full[[1]]$tip.label), sort(full[[3]]$tip.label))), 
rotate=TRUE)
phytools::plot.cophylo(x=cophylo.full lwd=2, link.type="curved")
This generally looks very nice, the only problem is that in both trees (they 
have over 100 tips) I have some branch lengths close to root, which are 
relatively long and some crown groups, where the branch lengths are very short 
and the figure is hard to read. As I do not need branch lengths for this 
display, I tried to remove branch lengths (full[[1]]$branch.length <- NULL), 
which helped, but still not perfect. To my surprise, in some clades, branch 
lengths were still relatively short and clustered. Then I tried several 
iterations of scaling the branch lengths with compute.brlen(), playing with 
the 'power' parameter. I was able to get good output, but I wonder if there is 
some possibility to do this automatically. Might be something like 
use.edge.length=FALSE in ape::cophyloplot (about phytools::cophylo I like the 
automatic rotation and curved connecting lines).
Sincerely,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Removing columns containing "N" in DNA alignment

2017-10-30 Thread Vojtěch Zeisek
Thank You, dear Andreas,
yes, I should notice this myself, my fault. Indeed, the nearly empty sample 
was problematic, although, I wish to filter columns with N over certain 
proportion. After manual edition it works. I just still wonder if there was 
something related to the conversion from VCF...
Thank You all for Your help,
V.

Dne pondělí 30. října 2017 12:03:05 CET, Andreas Kolter napsal(a):
> Dear Vojtech,
> my code snippet works, and the other solutions were also correct. The
> problem is with your alignment. Your 3rd sequence only contains N's,
> therefore whatever approach you use, all coloumns are filtered out if
> you filter all coloumns containing N.
> Please open your alignment in a text editor or use
> image.DNAbin(youralignment) to visualise your alignment before you
> process it in any way.
> Best wishes,
> Andreas
> 
> Am 2017-10-30 11:26, schrieb Vojtěch Zeisek:
> > Thank You, Emmanuel,
> > sorry for late reaction, I forge to copy the data to another computer
> > before I
> > left at Friday... It is a nice trick, although it returns unchanged
> > alignment.
> > :-( It is same regardless which threshold value I choose. I created it
> > using vcfR::vcfR2DNAbin, but it looks like any other DNAbin object. With
> > indels ("-") this function worked well.
> > 
> > minua.dna
> > 117 DNA sequences in binary format stored in a matrix.
> > 
> > All sequences of same length: 11946
> > 
> > Labels:
> > M151_1_1
> > M151_2_4
> > M152_2_52
> > M153_1_109
> > M153_2_276
> > M153_2_294
> > ...
> > 
> > Base composition:
> > a c g t
> > 
> > 0.213 0.280 0.295 0.212
> > 
> > minua.dna.red <- del.colgapsonly.n(x=minua.dna, threshold=5,
> > freq.only=FALSE)
> > minua.dna.red
> > 117 DNA sequences in binary format stored in a matrix.
> > 
> > All sequences of same length: 11946
> > 
> > Labels:
> > M151_1_1
> > M151_2_4
> > M152_2_52
> > M153_1_109
> > M153_2_276
> > M153_2_294
> > ...
> > 
> > Base composition:
> > a c g t
> > 
> > 0.213 0.280 0.295 0.212
> > 
> > And yes, the alignment contains various bases...
> > base.freq(x=minua.dna, all=TRUE)
> > 
> >  a  c  g  t  r  m
> > 
> > w
> > 
> > s  k  y
> > 0.14505732 0.19109712 0.20145212 0.14439408 0.06586477 0.01543627
> > 0.01724498
> > 0.01034570 0.01635994 0.06292132
> > 
> >  v  h  d  b  n  -
> >
> >?
> > 
> > 0. 0. 0. 0. 0.12982638 0.
> > 0.
> > 
> > del.colgapsonly.n
> > function (x, threshold = 1, freq.only = FALSE)
> > {
> > if (!inherits(x, "DNAbin"))
> > x <- as.DNAbin(x)
> > if (!is.matrix(x))
> > stop("DNA sequences not in a matrix")
> > foo <- function(x) sum(x == 240)
> > g <- apply(x, 2, foo)
> > if (freq.only)
> > return(g)
> > i <- which(g/nrow(x) >= threshold)
> > if (length(i))
> > x <- x[, -i]
> > x
> > }
> > 
> > 
> > BTW, what about generalize the function like this:
> > 
> > del.colgapsonly.X <- function (x, threshold=1, freq.only=FALSE,
> > char="-")
> > {
> > if (!inherits(x, "DNAbin"))
> > x <- as.DNAbin(x)
> > if (!is.matrix(x))
> > stop("DNA sequences not in a matrix")
> > value <- as.integer(as.DNAbin(char))
> > foo <- function(x) sum(x == value)
> > g <- apply(x, 2, foo)
> > if (freq.only)
> > return(g)
> > i <- which(g/nrow(x) >= threshold)
> > if (length(i))
> > x <- x[, -i]
> > x
> > }
> > :-)
> > Sincerely,
> > V.
> > 
> > Dne pátek 27. října 2017 17:44:10 CET jste napsal(a):
> >> Hi Vojtěch,
> >> 
> >> Here's something you could do. First, make a copy of del.colgapsonly:
> >> 
> >> toto <- del.colgapsonly
> >> 
> >> Then, edit this copy (e.g., with fix(toto)), find this line:
> >>  foo <- function(x) sum(x == 4)
> >> 
> >> and replace 4 by 240. Save and close. Now you can use toto() in the
> >> same
> >> way than del.colgapsonly(); for instance, to get the number of N's 

Re: [R-sig-phylo] Removing columns containing "N" in DNA alignment

2017-10-30 Thread Vojtěch Zeisek
Thank You, Emmanuel,
sorry for late reaction, I forge to copy the data to another computer before I 
left at Friday... It is a nice trick, although it returns unchanged alignment. 
:-( It is same regardless which threshold value I choose. I created it using 
vcfR::vcfR2DNAbin, but it looks like any other DNAbin object. With indels 
("-") this function worked well.

minua.dna
117 DNA sequences in binary format stored in a matrix.

All sequences of same length: 11946 

Labels:
M151_1_1
M151_2_4
M152_2_52
M153_1_109
M153_2_276
M153_2_294
...

Base composition:
a c g t 
0.213 0.280 0.295 0.212 

minua.dna.red <- del.colgapsonly.n(x=minua.dna, threshold=5, freq.only=FALSE)
minua.dna.red
117 DNA sequences in binary format stored in a matrix.

All sequences of same length: 11946 

Labels:
M151_1_1
M151_2_4
M152_2_52
M153_1_109
M153_2_276
M153_2_294
...

Base composition:
a c g t 
0.213 0.280 0.295 0.212

And yes, the alignment contains various bases...
base.freq(x=minua.dna, all=TRUE)
 a  c  g  t  r  m  w
  
s  k  y 
0.14505732 0.19109712 0.20145212 0.14439408 0.06586477 0.01543627 0.01724498 
0.01034570 0.01635994 0.06292132 
 v  h  d  b  n  -  ? 
0. 0. 0. 0. 0.12982638 0. 0.

del.colgapsonly.n
function (x, threshold = 1, freq.only = FALSE) 
{
if (!inherits(x, "DNAbin")) 
x <- as.DNAbin(x)
if (!is.matrix(x)) 
stop("DNA sequences not in a matrix")
foo <- function(x) sum(x == 240)
g <- apply(x, 2, foo)
if (freq.only) 
return(g)
i <- which(g/nrow(x) >= threshold)
if (length(i)) 
x <- x[, -i]
x
}


BTW, what about generalize the function like this:

del.colgapsonly.X <- function (x, threshold=1, freq.only=FALSE, char="-") 
{
if (!inherits(x, "DNAbin")) 
x <- as.DNAbin(x)
if (!is.matrix(x)) 
stop("DNA sequences not in a matrix")
value <- as.integer(as.DNAbin(char))
foo <- function(x) sum(x == value)
g <- apply(x, 2, foo)
if (freq.only) 
return(g)
i <- which(g/nrow(x) >= threshold)
if (length(i)) 
x <- x[, -i]
x
}
:-)
Sincerely,
V.

Dne pátek 27. října 2017 17:44:10 CET jste napsal(a):
> Hi Vojtěch,
> 
> Here's something you could do. First, make a copy of del.colgapsonly:
> 
> toto <- del.colgapsonly
> 
> Then, edit this copy (e.g., with fix(toto)), find this line:
> 
>  foo <- function(x) sum(x == 4)
> 
> and replace 4 by 240. Save and close. Now you can use toto() in the same
> way than del.colgapsonly(); for instance, to get the number of N's in
> each site of the woodmouse data:
> 
> R> toto(woodmouse, freq.only = TRUE)
>[1]  3  2  2  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1
> 
> 
> If you wonder where the values 4 and 240 come from:
> 
> R> as.integer(as.DNAbin("-"))
> [1] 4
> R> as.integer(as.DNAbin("N"))
> [1] 240
> 
> This gives a lot of possibilities to hack the function. For instance, if
> you want to find the sites with R/Y, first, get the integer codes:
> 
> R> as.integer(as.DNAbin("R"))
> [1] 192
> R> as.integer(as.DNAbin("Y"))
> [1] 48
> 
> Then, change the above line for:
> 
>  foo <- function(x) sum(x == 192 | x == 48)
> 
> HTH
> 
> Best,
> 
> Emmanuel
> 
> Le 27/10/2017 à 17:02, Vojtěch Zeisek a écrit :
> > Hm, I tried a dirty hack: I exported the DNAbin object using
> > ape::write.dna
> > and replaced all occurrences of "n" in any sequence by "-" and imported
> > the
> > file back to R with ape::read.dna. Then I tried the mentioned functions.
> > They did nothing. When I exported the file to disk, the FASTA file did
> > not contain any "-", only "n". DO I do something wrong, or is there a bug
> > in ape as it seems to confuse "n" and "-"?
> > Sincerely,
> > V.
> > 
> > Dne pátek 27. října 2017 16:25:02 CEST jste napsal(a):
> >> Hello,
> >> I checked ape::del.colgapsonly, ips::deleteGaps and
> >> ips::deleteEmptyCells.
> >> They delete columns containing missing values, but I need also to delete
> >> columns containing base "N" (all columns with amount of Ns over certain
> >> threshold).
> >> Actually, ips::deleteEmptyCells has option nset=c("-", "n", "?"), so it
> >> is
> >> suppose to remove columns/rows containing only the given characters, but
> >> if
> >> I u

Re: [R-sig-phylo] Removing columns containing "N" in DNA alignment

2017-10-27 Thread Vojtěch Zeisek
Thank You,
Andreas, yes, I try to manipulate an alignment. This is nice trick, although 
it returns empty alignment regardless threshold value used (I do have some 
data in the alignment:-)...
Have a nice weekend,
V.

Dne pátek 27. října 2017 17:02:45 CEST jste napsal(a):
> Hello V.
> Because you speak of columns I assume you are handling an alignment,
> right? If you handle an alignment all sequences have the same length and
> you can do as.matrix
> 
> Like this?
> 
> library(magrittr)
> #maximum number of n's
> thresh <- 0.005  #0.5%
> seq <- as.matrix(seq)
> temp <- seq %>% sapply(.,grep,pattern="n") %>% unlist(.,use.names=F) %>%
> table
> seq[,-(names(temp)[which(temp/ncol(seq)>thresh)] %>% as.integer)]
> 
> Greetings,
> Andreas
> 
> Am 2017-10-27 16:25, schrieb Vojtěch Zeisek:
> > Hello,
> > I checked ape::del.colgapsonly, ips::deleteGaps and
> > ips::deleteEmptyCells.
> > They delete columns containing missing values, but I need also to
> > delete
> > columns containing base "N" (all columns with amount of Ns over certain
> > threshold).
> > Actually, ips::deleteEmptyCells has option nset=c("-", "n", "?"), so it
> > is suppose to remove columns/rows containing only the given characters,
> > but if I
> > use it and export data (ape::write.dna or ape::write.nexus.data), some
> > samples consist only of N characters...
> > The DNAbin object being processed was originally imported from VCF
> > using vcfR (read.vcfR(file="my.vcf") and converted: vcfR2DNAbin(x=myvcf,
> > consensus=TRUE,
> > extract.haps=FALSE, unphased_as_NA=FALSE)).
> > I checked source code of the above functions, but they seem to only
> > count NAs
> > and then drop respective columns. And as sequences in DNAbin are stored
> > in binary format, I'm bit struggled here... :(
> > Any idea how to remove columns with given portion of "N" in sequences?
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Removing columns containing "N" in DNA alignment

2017-10-27 Thread Vojtěch Zeisek
Hm, I tried a dirty hack: I exported the DNAbin object using ape::write.dna 
and replaced all occurrences of "n" in any sequence by "-" and imported the 
file back to R with ape::read.dna. Then I tried the mentioned functions. They 
did nothing. When I exported the file to disk, the FASTA file did not contain 
any "-", only "n". DO I do something wrong, or is there a bug in ape as it 
seems to confuse "n" and "-"?
Sincerely,
V.

Dne pátek 27. října 2017 16:25:02 CEST jste napsal(a):
> Hello,
> I checked ape::del.colgapsonly, ips::deleteGaps and ips::deleteEmptyCells.
> They delete columns containing missing values, but I need also to delete
> columns containing base "N" (all columns with amount of Ns over certain
> threshold).
> Actually, ips::deleteEmptyCells has option nset=c("-", "n", "?"), so it is
> suppose to remove columns/rows containing only the given characters, but if
> I use it and export data (ape::write.dna or ape::write.nexus.data), some
> samples consist only of N characters...
> The DNAbin object being processed was originally imported from VCF using
> vcfR (read.vcfR(file="my.vcf") and converted: vcfR2DNAbin(x=myvcf,
> consensus=TRUE, extract.haps=FALSE, unphased_as_NA=FALSE)).
> I checked source code of the above functions, but they seem to only count
> NAs and then drop respective columns. And as sequences in DNAbin are stored
> in binary format, I'm bit struggled here... :(
> Any idea how to remove columns with given portion of "N" in sequences?
> Sincerely,
> V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Removing columns containing "N" in DNA alignment

2017-10-27 Thread Vojtěch Zeisek
Hello,
I checked ape::del.colgapsonly, ips::deleteGaps and ips::deleteEmptyCells. 
They delete columns containing missing values, but I need also to delete 
columns containing base "N" (all columns with amount of Ns over certain 
threshold).
Actually, ips::deleteEmptyCells has option nset=c("-", "n", "?"), so it is 
suppose to remove columns/rows containing only the given characters, but if I 
use it and export data (ape::write.dna or ape::write.nexus.data), some samples 
consist only of N characters...
The DNAbin object being processed was originally imported from VCF using vcfR 
(read.vcfR(file="my.vcf") and converted: vcfR2DNAbin(x=myvcf, consensus=TRUE, 
extract.haps=FALSE, unphased_as_NA=FALSE)).
I checked source code of the above functions, but they seem to only count NAs 
and then drop respective columns. And as sequences in DNAbin are stored in 
binary format, I'm bit struggled here... :(
Any idea how to remove columns with given portion of "N" in sequences?
Sincerely,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Graphically comparing multiple trees

2017-04-27 Thread Vojtěch Zeisek
Thank You!
densityTree(trees, use.gradient=TRUE, fix.depth=TRUE, alpha=0.5, lwd=4)
is really nice. Could You finally point me how to add supports (nodelabels) 
for each tree in its respective color?
Sincerely,
V.

Dne středa 26. dubna 2017 22:10:27 CEST, Liam J. Revell napsal(a):
> I have now incorporated all of these methods into the phytools function
> densityTree which I have also completely re-written. More information
> can be seen on my blog here:
> http://blog.phytools.org/2017/04/complete-re-write-of-phytools.html.
> 
> The function is already in phytools which can be installed from GitHub
> using devtools.
> 
> - Liam
> 
> On 4/26/2017 12:18 PM, Vojtěch Zeisek wrote:
> > Yes, it helps and makes the tree in good scale. Just branches of one tree
> > do not reach the right edge like the others. And tip labels are still
> > missing. V.
> > 
> > Dne středa 26. dubna 2017 18:52:04 CEST jste napsal(a):
> >> Oops. ylim should be c(0,Ntip(trees[[1]])) rather than c(0,11) (that was
> >> specific to the 10 taxon case. Let me know if that helps.
> >> 
> >> On 4/26/2017 11:48 AM, Vojtěch Zeisek wrote:
> >>> Hello,
> >>> Liam, thank You very much! It is what I was looking for. Unfortunately,
> >>> I
> >>> have problem with Your solution 4 and onward (attached). Previous 3
> >>> solutions worked as expected. Some trees were unrooted, rooting did not
> >>> help. Branch lengths were variable, but all were ultrametric. Also I
> >>> don't see why tip labels are missing.
> >>> I'd also add one more information. Incongruent nodes use to have low
> >>> support among trees. I'd like to display support below e.g. 90 in color
> >>> of respective tree and some offset not to overlap.
> >>> print.phylo(x=hirta[[1]], details=TRUE) # Other trees are similar...
> >>> Phylogenetic tree with 28 tips and 27 internal nodes.
> >>> Tip labels:
> >>>   O._engleriana, O._odorata, O._versicolor, O._zeyheri, O._fibrosa,
> >>> O._ciliaris, ...
> >>> Node labels:
> >>>   , NA, 100.0, 100.0, 99.0, 100.0, ...
> >>> Rooted; includes branch lengths.
> >>> ## What I did:
> >>> # Vertical offset
> >>> hirta.ylim <- c(0, Ntip(hirta[[1]])+1)
> >>> # Get depths of the tree
> >>> hirta.h <- sapply(hirta, function(x) max(nodeHeights(x)))
> >>> # Test plot the longest tree to get the maximum x dimension
> >>> plotTree(hirta[[which(hirta.h==max(hirta.h))]], direction="leftwards")
> >>> hirta.xlim <- get("last_plot.phylo", envir=.PlotPhyloEnv)$x.lim
> >>> # Set tip order based on a majority rule consensus tree
> >>> hirta.tips <- setNames(1:Ntip(hirta[[1]]), untangle(consensus(hirta,
> >>> p=0.5), "read.tree")$tip.label)
> >>> # Set colors
> >>> hirta.colors <- rainbow(n=length(hirta))
> >>> # Plot our trees
> >>> for(i in 1:length(hirta)) {
> >>>   hirta.y.shift <- (i-median(1:length(hirta)))/length(hirta)/2
> >>>   plotTree(hirta[[i]], color=make.transparent(hirta.colors[i], 0.4),
> >>> tips=hirta.tips+hirta.y.shift, add=i>1, direction="leftwards",
> >>> xlim=hirta.xlim[2:1], mar=c(4.1, 1.1, 1.1, 1.1), nodes="inner",
> >>> ftype=if(i==median(1:length(hirta))) "i" else "off", ylim=c(0, 11))
> >>>   if(i==1) axis(1)
> >>>   }
> >>> Sincerely,
> >>> V.
> >>> 
> >>> Dne středa 26. dubna 2017 15:29:45 CEST jste napsal(a):
> >>>> Hi Vojtech.
> >>>> 
> >>>> I just posted a handful of different possible solutions using phytools
> >>>> on my blog:
> >>>> http://blog.phytools.org/2017/04/showing-multiple-conflicting.html. Let
> >>>> me know if any of them work for you.
> >>>> 
> >>>> All the best, Liam
> >>>> 
> >>>> On 4/25/2017 12:20 PM, Vojtěch Zeisek wrote:
> >>>>> Hello,
> >>>>> for comparison of two trees I can use very nice function cophyloplot
> >>>>> plotting two trees (left and right) and connecting respective nodes by
> >>>>> lines. Very nice and convenient to read. But only for two trees.
> >>>>> Displaying multiple trees in multiple comparisons is not very
> >>>>> convenient.
> >>>>> To display dozens to hundreds of trees there is densitree. Also nice,
&

Re: [R-sig-phylo] Graphically comparing multiple trees

2017-04-26 Thread Vojtěch Zeisek
Hi,
this looks like really great tool. The chapter about median trees at https://
thibautjombart.github.io/treespace/ is something different from what I need. 
But I will definitely use it, for little different task. :-)
Thank You,
V.

Dne úterý 25. dubna 2017 19:59:34 CEST jste napsal(a):
> Hi there,
> 
> treespace would be an alternative, but its usefulness for 5 trees will
> be quite limited. Just in case:
> https://github.com/thibautjombart/treescape
> 
> Cheers
> Thibaut
> 
> On 25 April 2017 at 18:20, Vojtěch Zeisek  wrote:
> > Hello,
> > for comparison of two trees I can use very nice function cophyloplot
> > plotting two trees (left and right) and connecting respective nodes by
> > lines. Very nice and convenient to read. But only for two trees.
> > Displaying multiple trees in multiple comparisons is not very convenient.
> > To display dozens to hundreds of trees there is densitree. Also nice, but
> > for this purpose I don't like its display.
> > I have several trees (~5) and I wish to compare their topologies, show
> > supports (at least for differing nodes) and highlight differences. I
> > thought about some overlay/parallel plotting (similar to the attached
> > image) where there would be complete topologies displayed and
> > incongruences would be easily visible. It would be probably doable by
> > plotting all separate trees by plot.phylo and then combining and tuning
> > the figure in some vector editor (like Inkscape). But I hope there is
> > some more automated way to do it. :-) Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Graphically comparing multiple trees

2017-04-26 Thread Vojtěch Zeisek
Yes, it helps and makes the tree in good scale. Just branches of one tree do 
not reach the right edge like the others. And tip labels are still missing.
V.

Dne středa 26. dubna 2017 18:52:04 CEST jste napsal(a):
> Oops. ylim should be c(0,Ntip(trees[[1]])) rather than c(0,11) (that was
> specific to the 10 taxon case. Let me know if that helps.
> 
> On 4/26/2017 11:48 AM, Vojtěch Zeisek wrote:
> > Hello,
> > Liam, thank You very much! It is what I was looking for. Unfortunately, I
> > have problem with Your solution 4 and onward (attached). Previous 3
> > solutions worked as expected. Some trees were unrooted, rooting did not
> > help. Branch lengths were variable, but all were ultrametric. Also I
> > don't see why tip labels are missing.
> > I'd also add one more information. Incongruent nodes use to have low
> > support among trees. I'd like to display support below e.g. 90 in color
> > of respective tree and some offset not to overlap.
> > 
> > print.phylo(x=hirta[[1]], details=TRUE) # Other trees are similar...
> > 
> > Phylogenetic tree with 28 tips and 27 internal nodes.
> > 
> > Tip labels:
> > O._engleriana, O._odorata, O._versicolor, O._zeyheri, O._fibrosa,
> > 
> > O._ciliaris, ...
> > 
> > Node labels:
> > , NA, 100.0, 100.0, 99.0, 100.0, ...
> > 
> > Rooted; includes branch lengths.
> > ## What I did:
> > # Vertical offset
> > hirta.ylim <- c(0, Ntip(hirta[[1]])+1)
> > # Get depths of the tree
> > hirta.h <- sapply(hirta, function(x) max(nodeHeights(x)))
> > # Test plot the longest tree to get the maximum x dimension
> > plotTree(hirta[[which(hirta.h==max(hirta.h))]], direction="leftwards")
> > hirta.xlim <- get("last_plot.phylo", envir=.PlotPhyloEnv)$x.lim
> > # Set tip order based on a majority rule consensus tree
> > hirta.tips <- setNames(1:Ntip(hirta[[1]]), untangle(consensus(hirta,
> > p=0.5), "read.tree")$tip.label)
> > # Set colors
> > hirta.colors <- rainbow(n=length(hirta))
> > # Plot our trees
> > for(i in 1:length(hirta)) {
> > 
> >   hirta.y.shift <- (i-median(1:length(hirta)))/length(hirta)/2
> >   plotTree(hirta[[i]], color=make.transparent(hirta.colors[i], 0.4),
> > 
> > tips=hirta.tips+hirta.y.shift, add=i>1, direction="leftwards",
> > xlim=hirta.xlim[2:1], mar=c(4.1, 1.1, 1.1, 1.1), nodes="inner",
> > ftype=if(i==median(1:length(hirta))) "i" else "off", ylim=c(0, 11))
> > 
> >   if(i==1) axis(1)
> >   }
> > 
> > Sincerely,
> > V.
> > 
> > Dne středa 26. dubna 2017 15:29:45 CEST jste napsal(a):
> >> Hi Vojtech.
> >> 
> >> I just posted a handful of different possible solutions using phytools
> >> on my blog:
> >> http://blog.phytools.org/2017/04/showing-multiple-conflicting.html. Let
> >> me know if any of them work for you.
> >> 
> >> All the best, Liam
> >> 
> >> On 4/25/2017 12:20 PM, Vojtěch Zeisek wrote:
> >>> Hello,
> >>> for comparison of two trees I can use very nice function cophyloplot
> >>> plotting two trees (left and right) and connecting respective nodes by
> >>> lines. Very nice and convenient to read. But only for two trees.
> >>> Displaying multiple trees in multiple comparisons is not very
> >>> convenient.
> >>> To display dozens to hundreds of trees there is densitree. Also nice,
> >>> but
> >>> for this purpose I don't like its display.
> >>> I have several trees (~5) and I wish to compare their topologies, show
> >>> supports (at least for differing nodes) and highlight differences. I
> >>> thought about some overlay/parallel plotting (similar to the attached
> >>> image) where there would be complete topologies displayed and
> >>> incongruences would be easily visible. It would be probably doable by
> >>> plotting all separate trees by plot.phylo and then combining and tuning
> >>> the figure in some vector editor (like Inkscape). But I hope there is
> >>> some more automated way to do it. :-) Sincerely,
> >>> V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Graphically comparing multiple trees

2017-04-26 Thread Vojtěch Zeisek
Hi,
thank You for the advice. I tried:
densiTree(x=hirta, type="phylogram", scaleX=TRUE, width=2, 
col=rainbow(length(hirta)), font=3, underscore=FALSE)
looks relatively nicely. I just wonder why last 2 options have no effect (i.e. 
I wish tip labels in italics and without underscore). I also didn't find how 
to add little vertical offset among trees to show identical lines in parallel. 
Without it, the display is very messy and unreadable... :-(
Sincerely,
V.

Dne úterý 25. dubna 2017 23:04:01 CEST jste napsal(a):
> Hi Vojtěch,
> you could try adopt densiTree() in phangorn to do this. It just plots each
> tree separate over each other. You probably want to of move each tree a bit
> up or down and add some more control for colors. It is based on the
> internal function of from plot.phylo().
> Cheers,
> Klaus
> 
> On Tue, Apr 25, 2017 at 2:25 PM, Liam J. Revell  wrote:
> > Hi Vojtěch.
> > 
> > This kind of plot is possible to make using plotTree in phytools via the
> > arguments tips (which sets the vertical coordinates of the tips,
> > regardless
> > of topology) & add (a logical value indicating whether to add the tree
> > tree
> > to an existing plot or to open a new plot). (All arguments for plotTree
> > are
> > documented in the man page for plotSimmap which plotTree uses internally.)
> > Unfortunately, there is some complication. For instance, unless we set
> > xlim
> > & ylim, then plotTree will reset these values for each new plotted tree.
> > 
> > Later this evening I will do my best to make an example & post it to my
> > blog.
> > 
> > - Liam
> > 
> > On 4/25/2017 12:20 PM, Vojtěch Zeisek wrote:
> >> Hello,
> >> for comparison of two trees I can use very nice function cophyloplot
> >> plotting
> >> two trees (left and right) and connecting respective nodes by lines. Very
> >> nice
> >> and convenient to read. But only for two trees. Displaying multiple trees
> >> in multiple comparisons is not very convenient.
> >> To display dozens to hundreds of trees there is densitree. Also nice, but
> >> for this purpose I don't like its display.
> >> I have several trees (~5) and I wish to compare their topologies, show
> >> supports (at least for differing nodes) and highlight differences. I
> >> thought
> >> about some overlay/parallel plotting (similar to the attached image)
> >> where
> >> there would be complete topologies displayed and incongruences would be
> >> easily
> >> visible. It would be probably doable by plotting all separate trees by
> >> plot.phylo and then combining and tuning the figure in some vector editor
> >> (like Inkscape). But I hope there is some more automated way to do it.
> >> :-)
> >> Sincerely,
> >> V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Graphically comparing multiple trees

2017-04-26 Thread Vojtěch Zeisek
Hello,
Liam, thank You very much! It is what I was looking for. Unfortunately, I have 
problem with Your solution 4 and onward (attached). Previous 3 solutions 
worked as expected. Some trees were unrooted, rooting did not help. Branch 
lengths were variable, but all were ultrametric. Also I don't see why tip 
labels are missing.
I'd also add one more information. Incongruent nodes use to have low support 
among trees. I'd like to display support below e.g. 90 in color of respective 
tree and some offset not to overlap.

print.phylo(x=hirta[[1]], details=TRUE) # Other trees are similar...

Phylogenetic tree with 28 tips and 27 internal nodes.

Tip labels:
O._engleriana, O._odorata, O._versicolor, O._zeyheri, O._fibrosa, 
O._ciliaris, ...
Node labels:
, NA, 100.0, 100.0, 99.0, 100.0, ...

Rooted; includes branch lengths.
## What I did:
# Vertical offset
hirta.ylim <- c(0, Ntip(hirta[[1]])+1)
# Get depths of the tree
hirta.h <- sapply(hirta, function(x) max(nodeHeights(x)))
# Test plot the longest tree to get the maximum x dimension
plotTree(hirta[[which(hirta.h==max(hirta.h))]], direction="leftwards")
hirta.xlim <- get("last_plot.phylo", envir=.PlotPhyloEnv)$x.lim
# Set tip order based on a majority rule consensus tree
hirta.tips <- setNames(1:Ntip(hirta[[1]]), untangle(consensus(hirta, p=0.5), 
"read.tree")$tip.label)
# Set colors
hirta.colors <- rainbow(n=length(hirta))
# Plot our trees
for(i in 1:length(hirta)) {
  hirta.y.shift <- (i-median(1:length(hirta)))/length(hirta)/2
  plotTree(hirta[[i]], color=make.transparent(hirta.colors[i], 0.4), 
tips=hirta.tips+hirta.y.shift, add=i>1, direction="leftwards", 
xlim=hirta.xlim[2:1], mar=c(4.1, 1.1, 1.1, 1.1), nodes="inner", 
ftype=if(i==median(1:length(hirta))) "i" else "off", ylim=c(0, 11))
  if(i==1) axis(1)
  }

Sincerely,
V.

Dne středa 26. dubna 2017 15:29:45 CEST jste napsal(a):
> Hi Vojtech.
> 
> I just posted a handful of different possible solutions using phytools
> on my blog:
> http://blog.phytools.org/2017/04/showing-multiple-conflicting.html. Let
> me know if any of them work for you.
> 
> All the best, Liam
> 
> On 4/25/2017 12:20 PM, Vojtěch Zeisek wrote:
> > Hello,
> > for comparison of two trees I can use very nice function cophyloplot
> > plotting two trees (left and right) and connecting respective nodes by
> > lines. Very nice and convenient to read. But only for two trees.
> > Displaying multiple trees in multiple comparisons is not very convenient.
> > To display dozens to hundreds of trees there is densitree. Also nice, but
> > for this purpose I don't like its display.
> > I have several trees (~5) and I wish to compare their topologies, show
> > supports (at least for differing nodes) and highlight differences. I
> > thought about some overlay/parallel plotting (similar to the attached
> > image) where there would be complete topologies displayed and
> > incongruences would be easily visible. It would be probably doable by
> > plotting all separate trees by plot.phylo and then combining and tuning
> > the figure in some vector editor (like Inkscape). But I hope there is
> > some more automated way to do it. :-) Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Graphically comparing multiple trees

2017-04-26 Thread Vojtěch Zeisek
Hi

Dne úterý 25. dubna 2017 19:57:16 CEST jste napsal(a):
> a simple solution might be par(new=TRUE):
> > library("ape")
> > A <- rtree(10)
> > B <- rtree(10)
> > plot(A)
> > par(new=TRUE)
> > plot(B,edge.col="blue")

Thank You for the hint. This is simple, but it doesn't align the tip labels. I 
need some optimization to align same labels as close together as possible. I 
see it like last instance if other options fail.
I'll explore rest of the options now. :-)

> On Tue, Apr 25, 2017 at 12:20 PM, Vojtěch Zeisek  wrote:
> > Hello,
> > for comparison of two trees I can use very nice function cophyloplot
> > plotting
> > two trees (left and right) and connecting respective nodes by lines. Very
> > nice
> > and convenient to read. But only for two trees. Displaying multiple trees
> > in
> > multiple comparisons is not very convenient.
> > To display dozens to hundreds of trees there is densitree. Also nice, but
> > for
> > this purpose I don't like its display.
> > I have several trees (~5) and I wish to compare their topologies, show
> > supports (at least for differing nodes) and highlight differences. I
> > thought
> > about some overlay/parallel plotting (similar to the attached image) where
> > there would be complete topologies displayed and incongruences would be
> > easily
> > visible. It would be probably doable by plotting all separate trees by
> > plot.phylo and then combining and tuning the figure in some vector editor
> > (like Inkscape). But I hope there is some more automated way to do it. :-)
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Graphically comparing multiple trees

2017-04-25 Thread Vojtěch Zeisek
Hello,
for comparison of two trees I can use very nice function cophyloplot plotting 
two trees (left and right) and connecting respective nodes by lines. Very nice 
and convenient to read. But only for two trees. Displaying multiple trees in 
multiple comparisons is not very convenient.
To display dozens to hundreds of trees there is densitree. Also nice, but for 
this purpose I don't like its display.
I have several trees (~5) and I wish to compare their topologies, show 
supports (at least for differing nodes) and highlight differences. I thought 
about some overlay/parallel plotting (similar to the attached image) where 
there would be complete topologies displayed and incongruences would be easily 
visible. It would be probably doable by plotting all separate trees by 
plot.phylo and then combining and tuning the figure in some vector editor 
(like Inkscape). But I hope there is some more automated way to do it. :-)
Sincerely,
V.

-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] error when using function read.GenBank in ape

2016-11-22 Thread Vojtěch Zeisek
Ah, OK, it makes sense then. Thank You for this key point. :-) Yours, V.

Dne pondělí 21. listopadu 2016 19:03:03 CET jste napsal(a):
> Maybe I can clarify this point... The testing versions of ape are not
> intended to be on CRAN. That's why they have version numbers with four
> parts, so that they are always larger than the current version number on
> CRAN but less than the upcoming one. Thus, the update mechanism of R
> should work properly if you installed a testing version.
> 
> Best,
> 
> Emmanuel
> 
> Le 21/11/2016 à 17:59, Vojtěch Zeisek a écrit :
> > Hello,
> > Emmanuel, the problem was/is, that CRAN has version 3.5 (further
> > subversion
> > not specified) and there read.GenBank is broken. Installation from Your
> > web
> > went fine. i was wondering if 3.5.10 or above is/should be in CRAN. The
> > fix() is nice trick, thank You. Anyway, I'm looking forward 4.0.
> > Sincerely,
> > V.
> > 
> > Dne pondělí 21. listopadu 2016 13:25:12 CET jste napsal(a):
> >> Hi Vojtěch,
> >> 
> >> ape 4.0 is not yet on CRAN. We are running more tests.
> >> 
> >> You could use the testing version: there won't be substantial changes
> >> once it is on CRAN.
> >> 
> >> If you cannot install the testing version from ape-package.ird.fr (maybe
> >> mostly for users of MacOS with no compiling tools), a simple fix to this
> >> issue is to run:
> >> 
> >> fix(read.GenBank)
> >> 
> >> and replace "http:" by "https:", save and close.
> >> 
> >> Best,
> >> 
> >> Emmanuel
> >> 
> >> Le 19/11/2016 à 09:48, Vojtěch Zeisek a écrit :
> >>> Hello,
> >>> is it already in CRAN? read.GenBank for me failed with newest version
> >>> from
> >>> CRAN, I had to update directly from Ape's website...
> >>> Sincerely,
> >>> V.
> >>> 
> >>> Dne sobota 12. listopadu 2016 13:16:47 CET, Eduardo Ascarrunz napsal(a):
> >>>> Hi Emmanuel,
> >>>> 
> >>>> Right! Sorry I misspoke.
> >>>> 
> >>>> Best,
> >>>> 
> >>>> Eduardo
> >>>> 
> >>>> 2016-11-11 23:32 GMT+01:00 Emmanuel Paradis :
> >>>>> Hi Eduardo & Ting-Wen,
> >>>>> 
> >>>>> ape 4.0 is not yet released. The available version is 3.5-0.10 and,
> >>>>> you
> >>>>> are right Eduardo, it fixes this issue. The instructions to install
> >>>>> this
> >>>>> new version of ape is here:
> >>>>> 
> >>>>> http://ape-package.ird.fr/ape_installation.html#versions
> >>>>> 
> >>>>> The issue (not really a bug, strictly speaking) is because NCBI
> >>>>> servers
> >>>>> do
> >>>>> not accept HTTP requests anymore like many web services. The new
> >>>>> version
> >>>>> of
> >>>>> read.GenBank() uses HTTPS in place of HTTP. The relevant information
> >>>>> from
> >>>>> NCBI can be found there:
> >>>>> 
> >>>>> https://www.ncbi.nlm.nih.gov/news/06-10-2016-ncbi-https/
> >>>>> 
> >>>>> Best,
> >>>>> 
> >>>>> Emmanuel
> >>>>> 
> >>>>> Le 11/11/2016 à 09:22, Eduardo Ascarrunz a écrit :
> >>>>>> Hi Ting-Wen.
> >>>>>> 
> >>>>>> Are you using the latest version of ape? Emmanuel released ape v.4.0
> >>>>>> yesterday with a bug fix for that function.
> >>>>>> 
> >>>>>> Best,
> >>>>>> 
> >>>>>> Eduardo
> >>>>>> 
> >>>>>> 2016-11-11 0:35 GMT+01:00 Chen, Ting-Wen <
> >>>>>> ting-wen.c...@biologie.uni-goettingen.de>:
> >>>>>> 
> >>>>>> Dear all,
> >>>>>> 
> >>>>>>> recently I got an error when downloading sequences in R using MacOS
> >>>>>>> 10.12
> >>>>>>> (but no problem when using WIndows 7). I was using the function
> >>>>>>> read.GenBank in package ape and pretty sure my laptop was connecting
> >>>>>>> to
> >>>>>>> the
> >>>>>>> internet. Following is how the error looks like:
> >>>>>>> 
> >>>>>>> R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
> >>>>>>> Copyright (C) 2016 The R Foundation for Statistical Computing
> >>>>>>> Platform: x86_64-apple-darwin13.4.0 (64-bit)
> >>>>>>> ...
> >>>>>>> [R.app GUI 1.68 (7288) x86_64-apple-darwin13.4.0]
> >>>>>>> 
> >>>>>>> library(ape)
> >>>>>>> 
> >>>>>>>> read.GenBank("U15717")
> >>>>>>> 
> >>>>>>> Error in file(file, "r") : cannot open the connection
> >>>>>>> 
> >>>>>>> Does anybody know how to solve this problem?
> >>>>>>> 
> >>>>>>> All the best
> >>>>>>> Ting-Wen
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany
Faculty of Science, Charles University
Benátská 433/2, Prague, 12801, CZ
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Academy of Sciences
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] error when using function read.GenBank in ape

2016-11-21 Thread Vojtěch Zeisek
Hello,
Emmanuel, the problem was/is, that CRAN has version 3.5 (further subversion 
not specified) and there read.GenBank is broken. Installation from Your web 
went fine. i was wondering if 3.5.10 or above is/should be in CRAN. The fix() 
is nice trick, thank You. Anyway, I'm looking forward 4.0.
Sincerely,
V.

Dne pondělí 21. listopadu 2016 13:25:12 CET jste napsal(a):
> Hi Vojtěch,
> 
> ape 4.0 is not yet on CRAN. We are running more tests.
> 
> You could use the testing version: there won't be substantial changes
> once it is on CRAN.
> 
> If you cannot install the testing version from ape-package.ird.fr (maybe
> mostly for users of MacOS with no compiling tools), a simple fix to this
> issue is to run:
> 
> fix(read.GenBank)
> 
> and replace "http:" by "https:", save and close.
> 
> Best,
> 
> Emmanuel
> 
> Le 19/11/2016 à 09:48, Vojtěch Zeisek a écrit :
> > Hello,
> > is it already in CRAN? read.GenBank for me failed with newest version from
> > CRAN, I had to update directly from Ape's website...
> > Sincerely,
> > V.
> > 
> > Dne sobota 12. listopadu 2016 13:16:47 CET, Eduardo Ascarrunz napsal(a):
> >> Hi Emmanuel,
> >> 
> >> Right! Sorry I misspoke.
> >> 
> >> Best,
> >> 
> >> Eduardo
> >> 
> >> 2016-11-11 23:32 GMT+01:00 Emmanuel Paradis :
> >>> Hi Eduardo & Ting-Wen,
> >>> 
> >>> ape 4.0 is not yet released. The available version is 3.5-0.10 and, you
> >>> are right Eduardo, it fixes this issue. The instructions to install this
> >>> new version of ape is here:
> >>> 
> >>> http://ape-package.ird.fr/ape_installation.html#versions
> >>> 
> >>> The issue (not really a bug, strictly speaking) is because NCBI servers
> >>> do
> >>> not accept HTTP requests anymore like many web services. The new version
> >>> of
> >>> read.GenBank() uses HTTPS in place of HTTP. The relevant information
> >>> from
> >>> NCBI can be found there:
> >>> 
> >>> https://www.ncbi.nlm.nih.gov/news/06-10-2016-ncbi-https/
> >>> 
> >>> Best,
> >>> 
> >>> Emmanuel
> >>> 
> >>> Le 11/11/2016 à 09:22, Eduardo Ascarrunz a écrit :
> >>>> Hi Ting-Wen.
> >>>> 
> >>>> Are you using the latest version of ape? Emmanuel released ape v.4.0
> >>>> yesterday with a bug fix for that function.
> >>>> 
> >>>> Best,
> >>>> 
> >>>> Eduardo
> >>>> 
> >>>> 2016-11-11 0:35 GMT+01:00 Chen, Ting-Wen <
> >>>> ting-wen.c...@biologie.uni-goettingen.de>:
> >>>> 
> >>>> Dear all,
> >>>> 
> >>>>> recently I got an error when downloading sequences in R using MacOS
> >>>>> 10.12
> >>>>> (but no problem when using WIndows 7). I was using the function
> >>>>> read.GenBank in package ape and pretty sure my laptop was connecting
> >>>>> to
> >>>>> the
> >>>>> internet. Following is how the error looks like:
> >>>>> 
> >>>>> R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
> >>>>> Copyright (C) 2016 The R Foundation for Statistical Computing
> >>>>> Platform: x86_64-apple-darwin13.4.0 (64-bit)
> >>>>> ...
> >>>>> [R.app GUI 1.68 (7288) x86_64-apple-darwin13.4.0]
> >>>>> 
> >>>>> library(ape)
> >>>>> 
> >>>>>> read.GenBank("U15717")
> >>>>> 
> >>>>> Error in file(file, "r") : cannot open the connection
> >>>>> 
> >>>>> Does anybody know how to solve this problem?
> >>>>> 
> >>>>> All the best
> >>>>> Ting-Wen
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany
Faculty of Science, Charles University
Benátská 433/2, Prague, 12801, CZ
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Academy of Sciences
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] error when using function read.GenBank in ape

2016-11-19 Thread Vojtěch Zeisek
Hello,
is it already in CRAN? read.GenBank for me failed with newest version from 
CRAN, I had to update directly from Ape's website...
Sincerely,
V.

Dne sobota 12. listopadu 2016 13:16:47 CET, Eduardo Ascarrunz napsal(a):
> Hi Emmanuel,
> 
> Right! Sorry I misspoke.
> 
> Best,
> 
> Eduardo
> 
> 2016-11-11 23:32 GMT+01:00 Emmanuel Paradis :
> > Hi Eduardo & Ting-Wen,
> > 
> > ape 4.0 is not yet released. The available version is 3.5-0.10 and, you
> > are right Eduardo, it fixes this issue. The instructions to install this
> > new version of ape is here:
> > 
> > http://ape-package.ird.fr/ape_installation.html#versions
> > 
> > The issue (not really a bug, strictly speaking) is because NCBI servers do
> > not accept HTTP requests anymore like many web services. The new version
> > of
> > read.GenBank() uses HTTPS in place of HTTP. The relevant information from
> > NCBI can be found there:
> > 
> > https://www.ncbi.nlm.nih.gov/news/06-10-2016-ncbi-https/
> > 
> > Best,
> > 
> > Emmanuel
> > 
> > Le 11/11/2016 à 09:22, Eduardo Ascarrunz a écrit :
> >> Hi Ting-Wen.
> >> 
> >> Are you using the latest version of ape? Emmanuel released ape v.4.0
> >> yesterday with a bug fix for that function.
> >> 
> >> Best,
> >> 
> >> Eduardo
> >> 
> >> 2016-11-11 0:35 GMT+01:00 Chen, Ting-Wen <
> >> ting-wen.c...@biologie.uni-goettingen.de>:
> >> 
> >> Dear all,
> >> 
> >>> recently I got an error when downloading sequences in R using MacOS
> >>> 10.12
> >>> (but no problem when using WIndows 7). I was using the function
> >>> read.GenBank in package ape and pretty sure my laptop was connecting to
> >>> the
> >>> internet. Following is how the error looks like:
> >>> 
> >>> R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
> >>> Copyright (C) 2016 The R Foundation for Statistical Computing
> >>> Platform: x86_64-apple-darwin13.4.0 (64-bit)
> >>> ...
> >>> [R.app GUI 1.68 (7288) x86_64-apple-darwin13.4.0]
> >>> 
> >>> library(ape)
> >>> 
> >>>> read.GenBank("U15717")
> >>> 
> >>> Error in file(file, "r") : cannot open the connection
> >>> 
> >>> Does anybody know how to solve this problem?
> >>> 
> >>> All the best
> >>> Ting-Wen
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany
Faculty of Science, Charles University
Benátská 433/2, Prague, 12801, CZ
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Academy of Sciences
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Query about Phylogenetics in R

2016-09-01 Thread Vojtěch Zeisek
Hello,
I don't have personal experience with that function, but have look at
?ape::zoom It is designed to solve problems as You have.
HTH,
V.

Dne čtvrtek 1. září 2016 12:30:08 CEST, Bhuller, Ravneet napsal(a):
> Hello,
> 
> I have used the following command to create a tree of 220 bacterial
> strains:
 
> pdf(file="AwesomeTree.pdf", width=10, height=10)
> plotTree(tre,lwd=1,type="fan",color="blue",fsize=0.4,cex=.2)
> dev.off()
> 
> Attached is the tree. But how can I clearly label the strains clustered at
> the bottom of the tree? I have tried to change the height and width but
> it’s not working.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 433/2, Prague, 12801, CZ
https://www.natur.cuni.cz/biology/botany/
https://erasmusclub.natur.cuni.cz/

Institute of Botany, Academy of Sciences
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Query about Phylogenetics in R

2016-08-31 Thread Vojtěch Zeisek
Hello,
if onlythe readibility of the labels is the issue, what about using svg() 
function? It produces a SVG file which You can open in almost any vector editor 
(like Inkscape) andmove the labels around. Chech ?svg for possible settings and 
play with them little bit. They vary among operating systems. So You can do 
something like
svg(...) # Any parameters inside, at least output file name
# All the tree ploting commands...
dev.off() # To save the SVG file to the disc
Check also parameters of function tip.labels() - You can specify font size or 
replace the text with some symbol.
(Sorry for being so brief, I don't have exact examples handy)
Yours,
V.


31. srpna 2016 11:11:33 CEST, "Bhuller, Ravneet" 
 napsal:
>Dear All,
>
>I am trying to construct a phylogenetic tree (neighbour joining) using
>either APE or PHANGORN in R. But, since I have got 220 strains of
>bacteria in my data, the resulted tree is not very clear. The branch
>labels are so much overlapping that they cannot be read at all. Is
>there any way, I can get a neat tree with clearly read labels? Any
>guidance will be very much appreciated.
>
>Regards,
>
>Rav
-- 
Vojtěch Zeisek
http://trapa.cz/cs

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] continued maintenance of the R-Phylo wiki

2016-06-07 Thread Vojtěch Zeisek
Ah, sorry, I was bit confused by Hilmar's direct answer to an old thread... 
Anyway, if there'd still be need for hosting or so, I could help.
Sincerely,
Vojtěch

Dne úterý 7. června 2016 9:50:03 CEST jste napsal(a):
> Vogtěch and others,
> 
> Apologies if the context was lost from the original thread, which is from
> about a year ago. Here it is for your reference:
> http://www.mail-archive.com/r-sig-phylo@r-project.org/msg03877.html
> 
>   -hilmar
> 
> > On Jun 7, 2016, at 8:12 AM, Vojtěch Zeisek  wrote:
> > 
> > Hello,
> > does this discussion last since yesterday? If not, I missed it and I'm
> > sorry. Anyway, I'm able to offer hosting of the wiki on the server where
> > I rent space for some of my projects. I can provide all needed background
> > to run MediaWiki, although I'm not Wiki expert. Well, I do not like Wiki
> > as piece of software, but otherwise it is good tool. :-) I'd be able to
> > host it, maintain it, upgrade the system etc. But someone else would have
> > to take care about the content. I wouldn't be able to really work on the
> > content (except needed administration). If this would be acceptable, we
> > can discuss more details. Sincerely,
> > Vojtěch
> > 
> > Dne úterý 7. června 2016 8:00:02 CEST, Hilmar Lapp napsal(a):
> >> As an FYI for this community, I have reconstituted the R-phylo wiki from
> >> its archive [1], and it is now live again at the same URL it used to be:
> >> http://www.r-phylo.org
> >> 
> >> The complete history of the pages is preserved, but user accounts need to
> >> be created from scratch (through Google Login). Have away at it.
> >> 
> >> That notwithstanding, I still think that Jonathan’s suggestion of moving
> >> material to Wikipedia or Wikibooks is a good one, though I’m not sure
> >> much
> >> has happened in that regard.
> >> 
> >>  -hilmar
> >> 
> >> [1] http://dx.doi.org/10.5281/zenodo.19004
> >> 
> >>> On May 6, 2015, at 5:22 PM, Jonathan Chang 
> >>> wrote:
> >>> 
> >>> Hi all,
> >>> 
> >>> I think the best solution would be to transfer the how-to material to
> >>> Wikibooks, which is run by the same people that run Wikipedia. The
> >>> current Phylogenetics "book" is pretty sparse. I'd be willing to take
> >>> some time to organize and transfer the text.
> >>> 
> >>> http://en.wikibooks.org/wiki/Phylogenetics
> >>> 
> >>> Jonathan
> >>> 
> >>> On Wed, May 6, 2015 at 2:11 PM, Hilmar Lapp  wrote:
> >>>> On 5/6/15, 4:56 PM, Hilmar Lapp wrote:
> >>>>> If we do not hear expressions of interest in transfer of hosting
> >>>>> before
> >>>>> May 22 2015, then the wiki will have to be taken offline when NESCent
> >>>>> closes. An XML dump of the wiki contents will be placed in the NESCent
> >>>>> digital archive with Duke Libraries, but will not be publicly
> >>>>> accessible.
> >>>> 
> >>>> Actually let me correct myself. The XML dump would be placed in a
> >>>> publicly accessible archive (because this is one of our public wikis),
> >>>> likely in a NESCent collection we are putting together on Zenodo (see
> >>>> https://zenodo.org/collection/user-nescent). The XML dump will allow
> >>>> re-instating the wiki from it, but accounts and edit history would be
> >>>> lost.
> >>>> 
> >>>> -hilmar
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 433/2, Prague, 12801, CZ
https://www.natur.cuni.cz/biology/botany/
https://erasmusclub.natur.cuni.cz/

Institute of Botany, Academy of Sciences
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] continued maintenance of the R-Phylo wiki

2016-06-07 Thread Vojtěch Zeisek
Hello,
does this discussion last since yesterday? If not, I missed it and I'm sorry. 
Anyway, I'm able to offer hosting of the wiki on the server where I rent space 
for some of my projects. I can provide all needed background to run MediaWiki, 
although I'm not Wiki expert. Well, I do not like Wiki as piece of software, 
but otherwise it is good tool. :-) I'd be able to host it, maintain it, 
upgrade the system etc. But someone else would have to take care about the 
content. I wouldn't be able to really work on the content (except needed 
administration). If this would be acceptable, we can discuss more details.
Sincerely,
Vojtěch

Dne úterý 7. června 2016 8:00:02 CEST, Hilmar Lapp napsal(a):
> As an FYI for this community, I have reconstituted the R-phylo wiki from its
> archive [1], and it is now live again at the same URL it used to be:
> http://www.r-phylo.org
> 
> The complete history of the pages is preserved, but user accounts need to be
> created from scratch (through Google Login). Have away at it.
> 
> That notwithstanding, I still think that Jonathan’s suggestion of moving
> material to Wikipedia or Wikibooks is a good one, though I’m not sure much
> has happened in that regard.
> 
>   -hilmar
> 
> [1] http://dx.doi.org/10.5281/zenodo.19004
> 
> > On May 6, 2015, at 5:22 PM, Jonathan Chang 
> > wrote:
> > 
> > Hi all,
> > 
> > I think the best solution would be to transfer the how-to material to
> > Wikibooks, which is run by the same people that run Wikipedia. The
> > current Phylogenetics "book" is pretty sparse. I'd be willing to take
> > some time to organize and transfer the text.
> > 
> > http://en.wikibooks.org/wiki/Phylogenetics
> > 
> > Jonathan
> > 
> > On Wed, May 6, 2015 at 2:11 PM, Hilmar Lapp  wrote:
> >> On 5/6/15, 4:56 PM, Hilmar Lapp wrote:
> >>> If we do not hear expressions of interest in transfer of hosting before
> >>> May 22 2015, then the wiki will have to be taken offline when NESCent
> >>> closes. An XML dump of the wiki contents will be placed in the NESCent
> >>> digital archive with Duke Libraries, but will not be publicly
> >>> accessible.
> >> 
> >> Actually let me correct myself. The XML dump would be placed in a
> >> publicly accessible archive (because this is one of our public wikis),
> >> likely in a NESCent collection we are putting together on Zenodo (see
> >> https://zenodo.org/collection/user-nescent). The XML dump will allow
> >> re-instating the wiki from it, but accounts and edit history would be
> >> lost.
> >> 
> >>  -hilmar
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 433/2, Prague, 12801, CZ
https://www.natur.cuni.cz/biology/botany/
https://erasmusclub.natur.cuni.cz/

Institute of Botany, Academy of Sciences
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Problem with bootstraping microstallite NJ tree

2016-01-22 Thread Vojtěch Zeisek
Hello,
thank You very much, Emmanuel, this worked perfectly. Silly me I've overlooked 
that. Yes, for microsatellites would be probably better use poppr's bruvo dist 
or ade4's dist.genet.
Sincerely,
Vojtěch
PS: Later yesterday I have received spam answering my original post. Spammer 
is obviously subscribed and harvesting mails passing through the conference 
and then mailing users off-list. I've notified admins, but it's hard to resist 
such... ehm...

Dne Čt 21. ledna 2016 17:15:48 jste napsal(a):
> Hi Vojtěch,
> 
> The trouble comes from boot.phylo() which resamples the columns of the
> data matrix with replacement: this may result in a bootstrap sample
> without population column and loci2genind() doesn't like it. The trick
> is to delete this column from the original "loci" object, and then
> reassign it within the estimation process so that loci2genind() works.
> 
> pop <- LOCI$population
> LOCI$population <- NULL
> 
> foo <- function(X) {
>  X$population <- pop
>  nj(dist(loci2genind(X)))
> }
> 
> Then the following should work:
> 
> NJ <- foo(LOCI)
> BOOT <- boot.phylo(phy=NJ, x=LOCI, FUN=foo, B=1000)
> 
> BTW, I don't know if using dist() on a "genind" object is something
> really meaningful. Maybe you want to use another distance function from
> adegenet or another packae (eg, poppr). Anyway, the above trick will be
> useful in all cases since nj() only needs a distance matrix.
> 
> Best,
> 
> Emmanuel
> 
> Le 21/01/2016 14:30, Vojtěch Zeisek a écrit :
> > Hello,
> > I have probably very simple problem, but I can't find the solution... :-(
> > I
> > wish to make bootstraped tree of attached microsatellite diploid data. It
> > works fine with DNA sequences and I was using same code last year and it
> > was working. :-)
> > 
> > library(pegas)
> > library(ape)
> > LOCI <- read.loci("ssrs.txt", header=TRUE, loci.sep="\t", allele.sep="/",
> > col.pop=2, col.loci=3:14, row.names=1)
> > # Looks OK
> > GENIND <- loci2genind(LOCI)
> > DIST <- dist(x=GENIND, method="euclidean", diag=TRUE, upper=TRUE)
> > NJ <- nj(DIST)
> > BOOT <- boot.phylo(phy=NJ, x=LOCI, FUN=function(X)
> > nj(dist(loci2genind(X))), B=1000)
> > 
> >|=
> >|
> > |   1%Error in df2genind(as.matrix(x[, attr(x, "locicol")]), sep =
> > |   "[/\\|]",
> >
> >length of factor pop differs from nrow(X)
> > 
> > Any idea what could went wrong?
> > Thank You,
> > Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Problem with bootstraping microstallite NJ tree

2016-01-21 Thread Vojtěch Zeisek
Hello,
I have probably very simple problem, but I can't find the solution... :-( I
wish to make bootstraped tree of attached microsatellite diploid data. It
works fine with DNA sequences and I was using same code last year and it was
working. :-)

library(pegas)
library(ape)
LOCI <- read.loci("ssrs.txt", header=TRUE, loci.sep="\t", allele.sep="/",
col.pop=2, col.loci=3:14, row.names=1)
# Looks OK
GENIND <- loci2genind(LOCI)
DIST <- dist(x=GENIND, method="euclidean", diag=TRUE, upper=TRUE)
NJ <- nj(DIST)
BOOT <- boot.phylo(phy=NJ, x=LOCI, FUN=function(X) nj(dist(loci2genind(X))),
B00)
  ||   1%Error in df2genind(as.matrix(x[, attr(x, "locicol")]), sep = "[/\\|]",
:
  length of factor pop differs from nrow(X)

Any idea what could went wrong?
Thank You,
Vojtěch

--
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic
pop L01 L02 L03 L04 L05 L06 L07 L08 
L09 L10 L11 L12
I01 A   269/269 198/198 221/223 419/419 197/197 196/196 237/251 163/163 
211/233 132/136 279/291 150/152
I02 A   275/283 198/198 221/223 419/419 193/193 168/190 243/251 163/163 
211/215 128/136 293/293 150/152
I03 A   275/299 198/198 221/223 419/419 193/197 190/196 237/243 163/163 
215/233 132/136 279/293 150/152
I04 A   275/275 198/198 221/221 419/419 193/193 168/196 243/251 163/163 
215/215 128/136 279/293 150/152
I05 A   275/275 198/198 221/221 419/419 193/193 168/196 243/251 163/163 
215/215 128/136 279/293 150/152
I06 A   275/293 198/198 221/223 419/421 193/193 190/196 243/243 163/195 
215/215 128/130 283/291 150/152
I07 A   275/299 198/198 211/211 419/419 197/197 168/196 243/251 163/163 
211/215 128/136 279/291 150/150
I08 A   275/275 198/180 211/211 419/419 193/193 168/190 237/243 163/163 
215/215 130/136 277/291 150/150
I09 A   283/283 198/180 211/221 399/419 193/193 190/196 237/243 163/163 
219/227 132/136 279/291 152/152
I10 A   275/275 198/180 221/223 419/419 193/193 168/190 237/243 163/163 
215/215 130/136 277/293 150/150
I11 A   275/299 198/198 211/221 419/419 193/197 190/196 237/243 163/163 
215/233 132/136 279/293 150/152
I12 A   275/299 198/198 221/223 419/419 193/197 190/196 237/243 163/163 
215/233 132/136 279/293 150/152
I13 A   275/283 198/198 221/223 419/419 193/193 168/190 243/251 163/163 
209/215 128/136 293/293 150/152
I14 B   227/227 198/198 221/231 397/415 193/195 182/182 237/237 195/187 
201/201 122/128 293/293 152/192
I15 B   299/327 198/180 221/223 399/419 193/195 168/190 237/247 163/163 
209/213 126/128 263/277 150/152
I16 B   299/327 198/180 221/223 399/419 193/195 168/190 237/247 163/163 
211/213 126/128 263/277 150/152
I17 B   273/307 198/180 211/211 397/405 185/195 166/192 251/251 163/163 
215/219 130/146 279/281 150/150
I18 B   273/309 198/180 209/209 397/419 195/207 168/168 253/253 163/163 
207/219 136/142 287/295 150/150
I19 B   273/309 198/180 211/211 397/419 195/207 168/168 253/253 163/163 
207/219 136/142 289/297 150/150
I20 B   271/271 198/180 221/223 397/397 185/209 190/192 249/249 163/163 
215/215 130/134 279/281 150/152
I21 B   337/339 198/198 211/211 403/407 209/209 168/190 243/243 163/181 
215/219 126/126 261/261 152/152
I22 B   273/309 198/198 209/209 397/401 185/205 190/180 243/249 163/163 
207/207 130/130 253/253 148/150
I23 B   273/309 198/198 211/211 397/401 185/205 190/180 243/249 163/163 
207/207 130/130 253/297 148/150
I24 B   337/339 198/198 211/211 403/407 187/187 168/190 261/261 163/181 
215/219 126/126 261/261 152/152
I25 B   273/309 198/180 221/221 397/407 185/195 166/192 251/251 165/165 
219/221 130/146 279/281 150/150
I26 B   273/311 198/180 211/211 397/419 195/207 168/168 253/253 165/165 
209/219 136/142 289/297 150/150
I27 B   273/311 198/180 221/221 397/407 195/207 168/168 253/253 165/165 
209/219 136/142 287/295 150/150
I28 B   271/273 198/180 221/221 397/397 185/195 166/180 249/249 165/165 
209/219 128/130 253/253 150/152
I29 B   273/311 198/198 221/221 397/397 185/205 166/180 249/251 165/165 
209/219 130/134 253/281 150/150
I30 B   271/271 198/198 221/221 397/419 193/195 166/168 241/253 165/165 
219/219 126/136 253/289 150/150
I31 C   269/315 198/198 211/211 399/399 193/193 198/198 255/255 163/163 
213/215 128/134 257/305 150/150
I32 C   269/297 198/198 211/211 403/419 201/201 190/192 251/251 163/163 
213/213 136/138 279/293 150/152
I33 D   273/273 180/180 221/221 397/419 199/199 168/192 261/261 165/181 
219/221 136/138 263/295 150/152
I34 D   273/273 

Re: [R-sig-phylo] Package phytools load failed

2016-01-09 Thread Vojtěch Zeisek
Dne So 9. ledna 2016 13:29:46, Donald Miles napsal(a):
> Dear All,
> 
> I receive the same error as Gabriela when I try to load phytools in R or R
> Studio.
> 
> Here is the text:
> 
> library("phytools",
> lib.loc="/Library/Frameworks/R.framework/Versions/3.2/Resources/library")
> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck
> = vI[[j]]) :
>   there is no package called ‘Biostrings’
> Error: package or namespace load failed for ‘phytools’

Did You recently (I mean prior past usage of phytools/Biostrings) update to R 
3.2.X from R 3.1.X or earlier version? If yes, You have to reinstall packages 
(well, some do not require so, but it seems to be safer to do it). This may be 
bit painful procedure and it is little bit silly. Well, at least I, as using 
source packages, must to it.
I usually do something like

packages <- installed.packages()[,"Package"]
install.packages(pkgs=packages, repos=c("http://cran.at.r-project.org";, 
"http://cran.at.r-project.org";, "http://R-Forge.R-project.org";, 
"http://cran.rstudio.com/";, "http://www.rforge.net/";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/bioc";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/data/annotation";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/data/experiment";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/extra";, 
"http://www.stats.ox.ac.uk/pub/RWin";, "http://www.omegahat.org/R";, 
"http://rkward.sf.net/R/";, "http://files.kde.org/rkward/R/";), lib="~/R/x86_64-
suse-linux-gnu-library/3.2", dependencies="Enhances", clean=TRUE)
update.packages(lib.loc="~/R/x86_64-suse-linux-gnu-library/3.2/", 
repos=c("http://cran.at.r-project.org";, "http://cran.at.r-project.org";, 
"http://R-Forge.R-project.org";, "http://cran.rstudio.com/";, 
"http://www.rforge.net/";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/bioc";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/data/annotation";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/data/experiment";, 
"http://bioconductor.statistik.tu-dortmund.de/packages/3.2/extra";, 
"http://www.stats.ox.ac.uk/pub/RWin";, 
"http://www.omegahat.org/R";, "http://rkward.sf.net/R/";, 
"http://files.kde.org/rkward/R/";), instlib="~/R/x86_64-suse-linux-gnu-
library/3.2/", ask=FALSE, dependencies=“Enhances“)

Note I have little bit long list of repositories including R-Forge, 
Bioconductor etc. You can shorten it of course. :-) And You'd need to modify 
instlib according to Your placement.

> I am running R v 3.2.3 and phytools v 0.5-10.

$ R --version
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
> packageVersion("phytools")
[1] ‘0.5.10’
> packageVersion("Biostrings")
[1] ‘2.38.3’
And I do not see any dependency for Biostrings in phytools...

> If I try to load Biostrings I receive an error message that Biostrings is
> not compatible with R 3.2.3.
> 
> Cheers,
> 
> Don Miles
> Ohio University

Vojtěch

> On Sat, Jan 9, 2016 at 12:50 PM, Vojtěch Zeisek  wrote:
> > Hello
> > 
> > Dne So 9. ledna 2016 13:11:45, Gabriela Wofkova napsal(a):
> > > ​Hello,
> > > 
> > > I have an problem with loading package "phytools". I have the newest
> > > version of R studio​ and it cannot load package "Biostrings" which is
> > > reqired to package "phytools". Also it not works in R program, too. Can
> > 
> > you
> > 
> > > have any idea, how to evade this?
> > > 
> > > I need to use "read.newick" and load phylogenetic tree.
> > 
> > What exactly are You doing? phytools does not require Biostrings and
> > Biostrings does not require phytools. :-)
> > Which operating system are You running? Which error did You get? Errors
> > are
> > keys to solutions... Do You have newest versions of the packages (I'd try
> > to
> > reinstall them first to see if they weren't corrupted)?
> > 
> > Both load fine for me (on Linux):
> > > library(phytools)
> > 
> > Loading required package: ape
> > Loading required package: maps
> > 
> >  # ATTENTION: maps v3.0 has an updated 'world' map.#
> >  # Many country borders and names have changed since 1990. #
> >  # Type '?world' or 'news(package="maps")'. See README_v3. #
> >  
> > > library(Biostrings)
> > 
&g

Re: [R-sig-phylo] Package phytools load failed

2016-01-09 Thread Vojtěch Zeisek
Hello

Dne So 9. ledna 2016 13:11:45, Gabriela Wofkova napsal(a):
> ​Hello,
> 
> I have an problem with loading package "phytools". I have the newest
> version of R studio​ and it cannot load package "Biostrings" which is
> reqired to package "phytools". Also it not works in R program, too. Can you
> have any idea, how to evade this?
> 
> I need to use "read.newick" and load phylogenetic tree.

What exactly are You doing? phytools does not require Biostrings and 
Biostrings does not require phytools. :-)
Which operating system are You running? Which error did You get? Errors are 
keys to solutions... Do You have newest versions of the packages (I'd try to 
reinstall them first to see if they weren't corrupted)?
Both load fine for me (on Linux):

> library(phytools)
Loading required package: ape
Loading required package: maps

 # ATTENTION: maps v3.0 has an updated 'world' map.#
 # Many country borders and names have changed since 1990. #
 # Type '?world' or 'news(package="maps")'. See README_v3. #

> library(Biostrings)
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, 
clusterMap, parApply, parCapply, parLapply, parLapplyLB,
parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

IQR, mad, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, do.call, 
duplicated, eval, evalq, Filter, Find, get, grep, grepl,
intersect, is.unsorted, lapply, lengths, Map, mapply, match, mget, order, 
paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply, union, 
unique, unlist, unsplit

Loading required package: S4Vectors
Loading required package: stats4
Loading required package: IRanges
Loading required package: XVector

You do not need Biostrings to use read.newick.
Note there is also read.tree in ape package reading trees in Newick format.

> ​Thanks a lot for any useful answer!​
> 
> Gabriela, Charles University in Prague​

Sincerely,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Help-forcing monophyly of outgroups and PP values of consensus

2015-08-26 Thread Vojtěch Zeisek
OK, then, please, write also commands You used. It helps to help... Generally, 
for first question I'm not sure, but for the second, write.tree() writes all 
data presented in respective phylo object. So yes. And, please, if I may ask 
You, 1) answer to the list (not personally) and 2) usage of tons of exclmation 
marks doesn't help anyhow.
Sincerely,
Vojtěch


26. srpna 2015 16:33:29 CEST, Felipe Rossetto  
napsal:
>I'm creating a consensus tree "IN R" from the trees file generate in
>MrBayes!!
>
>Felipe Rossetto
>Herbário FUEL
>Departamento de Biologia Animal e Vegetal
>Universidade Estadual de Londrina
>Rodovia Celso Garcia Cid, PR 445 Km 380, Campus Universitário
>Caixa postal 10.011
>CEP: 86057-970
>Londrina, Paraná, Brasil
>CV:
>http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4211230P7
>
>
>2015-08-26 11:31 GMT-03:00 Vojtěch Zeisek :
>
>> Hello,
>> I might be missing some point, but this forum is about R & phylogeny.
>If
>> You have problems with MrBayes, it'd probably be better to ask
>somewhere
>> else. Seqanswers.com and/or MrBayes' homepage could be good point in
>this
>> case...
>> Sincerely,
>> Vojtěch
>>
>>
>> 26. srpna 2015 16:16:14 CEST, Felipe Rossetto
>
>> napsal:
>> >Hi there,
>> >I'm using R for creating a consensus tree of non discarded burn-in
>> >trees,
>> >and I used the MrBayes .t file for it. But The consensus is
>unrooted,
>> >and I
>> >have 3 species as outgroup, and I'm not having sucess in root the
>tree
>> >with
>> >these 3 outgroups (species from the same genus), and when I root it
>> >with
>> >only one species, the outgroup is paraphyletic and it is not true.
>So
>> >my
>> >questions are: (1) Is here a command for forcing a monophyly of the
>> >outgroup? (2) Is there a command for exporting this consesus tree
>with
>> >the
>> >PP values?
>> >
>> >Many thanks in advance
>> >
>> >Felipe Rossetto
>> >Herbário FUEL
>> >Departamento de Biologia Animal e Vegetal
>> >Universidade Estadual de Londrina
>> >Rodovia Celso Garcia Cid, PR 445 Km 380, Campus Universitário
>> >Caixa postal 10.011
>> >CEP: 86057-970
>> >Londrina, Paraná, Brasil
>> >CV:
>>
>>http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4211230P7
>> >
>> >   [[alternative HTML version deleted]]
>> >
>> >___
>> >R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> >https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> >Searchable archive at
>> >http://www.mail-archive.com/r-sig-phylo@r-project.org/
>>
>> --
>> Vojtěch Zeisek
>> http://trapa.cz/cs
>>
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at
>> http://www.mail-archive.com/r-sig-phylo@r-project.org/

-- 
Vojtěch Zeisek
http://trapa.cz/cs

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Help-forcing monophyly of outgroups and PP values of consensus

2015-08-26 Thread Vojtěch Zeisek
Hello,
I might be missing some point, but this forum is about R & phylogeny. If You 
have problems with MrBayes, it'd probably be better to ask somewhere else. 
Seqanswers.com and/or MrBayes' homepage could be good point in this case...
Sincerely,
Vojtěch


26. srpna 2015 16:16:14 CEST, Felipe Rossetto  
napsal:
>Hi there,
>I'm using R for creating a consensus tree of non discarded burn-in
>trees,
>and I used the MrBayes .t file for it. But The consensus is unrooted,
>and I
>have 3 species as outgroup, and I'm not having sucess in root the tree
>with
>these 3 outgroups (species from the same genus), and when I root it
>with
>only one species, the outgroup is paraphyletic and it is not true. So
>my
>questions are: (1) Is here a command for forcing a monophyly of the
>outgroup? (2) Is there a command for exporting this consesus tree with
>the
>PP values?
>
>Many thanks in advance
>
>Felipe Rossetto
>Herbário FUEL
>Departamento de Biologia Animal e Vegetal
>Universidade Estadual de Londrina
>Rodovia Celso Garcia Cid, PR 445 Km 380, Campus Universitário
>Caixa postal 10.011
>CEP: 86057-970
>Londrina, Paraná, Brasil
>CV:
>http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4211230P7
>
>   [[alternative HTML version deleted]]
>
>___
>R-sig-phylo mailing list - R-sig-phylo@r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>Searchable archive at
>http://www.mail-archive.com/r-sig-phylo@r-project.org/

-- 
Vojtěch Zeisek
http://trapa.cz/cs

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Phylogenetic PCA

2015-06-04 Thread Vojtěch Zeisek
Hello

Dne Čt 4. června 2015 11:26:10, Sergio Ferreira Cardoso napsal(a):
> Dear all,
> 
> I'm wondering if there is a package in R with which I can run a
> phylogenetic PCA. Please, if you know something or if you you know another
> software useful to use this technique, let me know.

Function ppca from package adephylo.

> Thanks in advance.
> 
> Best regards,
> Sérgio.

Regards,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Failing chronos - how to find problem?

2014-11-24 Thread Vojtěch Zeisek
Hello,
sorry, I forgot to refer where the problem was. On the beginning, I didn't 
check all over thousand trees manually. I found trees on which it was failing 
by simple for loop (could be simpler and more straightforward, I know):
Y <- trees.rooted.nexus
class(Y) <- "multiPhylo"
X <- list()
trees.ultra.nexus <- list()
for (i in 1:length(Y)) {
  trees.ultra.nexus[[i]] <- chronos(Y[[i]])
  X[i] <- i
  }
length(X)
length(trees.ultra.nexus)
Last tree there was the last „good“ one. I then checked to following one and 
it was just one big polytomy without any structure. No surprise it failed. :-) 
After removing several useless „trees“ like that (in several similar steps) 
chronos() worked fine as usual. So if anyone would have similar problem...
Sincerely,
Vojtěch

Dne Ne 9. listopadu 2014 17:43:00 jste napsal(a):
> Hello,
> I have multiPhylo list with consensus trees from MrBayes (*.con.tre). When I
> try to get ultrametric trees by trees.ultra.nexus <-
> lapply(X=trees.rooted.nexus, FUN=chronos, model=“relaxed“) it start running
> and finally it crashes:
> 
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>  Penalised log-lik = -9.32736
> Optimising rates... dates... -9.32736
> Optimising rates... dates... -7.513123
> Done.
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>  Penalised log-lik = -10.31663
> Optimising rates... dates... -10.31663
> Optimising rates... dates... -8.40787
> Done.
> ...
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>  Penalised log-lik = -9.084298
> Optimising rates... dates... -9.084298
> Optimising rates... dates... -3.934602
> Optimising rates... dates... -3.931579
> Done.
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>  Penalised log-lik = -10.27628
> Optimising rates... dates... -10.27628
> Optimising rates... dates... -7.097138
> Done.
> Setting initial dates...
> Fitting in progress... get a first set of estimates
> Error in sapply(A_ki, function(x) sum(tmp[x])) - tmp2 :
>   non-numeric argument to binary operator
> Calls: lapply ... FUN -> nlminb -> gradient -> gradient -> gradient.poisson
> In addition: There were 50 or more warnings (use warnings() to see the first
> 50)
> Error in sapply(A_ki, function(x) sum(tmp[x])) - tmp2 :
>   non-numeric argument to binary operator
> Calls: lapply ... FUN -> nlminb -> gradient -> gradient -> gradient.poisson
> I tried to change parameters, no change... When I display warnings, I see:
> Warning messages:
> 1: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
>   NAs introduced by coercion
> 2: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
>   NAs introduced by coercion
> 3: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
> ...
> When I tried with trees from *.trprobs files, it worked perfectly. Any idea
> what could be wrong?
> Sincerely,
> Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Failing chronos - how to find problem?

2014-11-09 Thread Vojtěch Zeisek
Hello,
I have multiPhylo list with consensus trees from MrBayes (*.con.tre). When I 
try to get ultrametric trees by trees.ultra.nexus <- 
lapply(X=trees.rooted.nexus, FUN=chronos, model=“relaxed“) it start running 
and finally it crashes:

Setting initial dates...
Fitting in progress... get a first set of estimates
 Penalised log-lik = -9.32736 
Optimising rates... dates... -9.32736 
Optimising rates... dates... -7.513123 
Done.
Setting initial dates...
Fitting in progress... get a first set of estimates
 Penalised log-lik = -10.31663 
Optimising rates... dates... -10.31663 
Optimising rates... dates... -8.40787 
Done.
...
Setting initial dates...
Fitting in progress... get a first set of estimates
 Penalised log-lik = -9.084298 
Optimising rates... dates... -9.084298 
Optimising rates... dates... -3.934602 
Optimising rates... dates... -3.931579 
Done.
Setting initial dates...
Fitting in progress... get a first set of estimates
 Penalised log-lik = -10.27628 
Optimising rates... dates... -10.27628 
Optimising rates... dates... -7.097138 
Done.
Setting initial dates...
Fitting in progress... get a first set of estimates
Error in sapply(A_ki, function(x) sum(tmp[x])) - tmp2 : 
  non-numeric argument to binary operator
Calls: lapply ... FUN -> nlminb -> gradient -> gradient -> gradient.poisson
In addition: There were 50 or more warnings (use warnings() to see the first 
50)
Error in sapply(A_ki, function(x) sum(tmp[x])) - tmp2 : 
  non-numeric argument to binary operator
Calls: lapply ... FUN -> nlminb -> gradient -> gradient -> gradient.poisson
I tried to change parameters, no change... When I display warnings, I see:
Warning messages:
1: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
  NAs introduced by coercion
2: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
  NAs introduced by coercion
3: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
...
When I tried with trees from *.trprobs files, it worked perfectly. Any idea 
what could be wrong?
Sincerely,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Replacement of Phybase - species tree from gene trees

2014-11-06 Thread Vojtěch Zeisek
Hello

Dne St 5. listopadu 2014 15:08:27 jste napsal(a):
> I checked and I have phybase 1.3 installed but I don't remember if
> installed another version and THEN updated to 1.3 (maybe that could work).
> I am running phybase 1.3 and it works fine.

It seems it depends on the version of R You are running...

> *I GUESS I DID THIS TRICK TO INSTALL IT* (I installed this package in March
> along a lot of other stuff so I don't recall how did I fix it)
> http://stackoverflow.com/questions/17196225/error-a-namespace-file-is-requir
> ed or just google "missing namespace file R Ubuntu"

Thank You, I'm again learning some new tricks. :-) For now I'll try the 
version posted by Prof. Revell from his web.

> Here's mp-est (It gave me an error so I moved on with phybase then)
> http://code.google.com/p/mp-est/

Ah, OK, yes, well, I'm looking for something like this in R...

> best

All the best,
Vojtěch

> 2014-11-05 13:48 GMT-02:00 Vojtěch Zeisek :
> > Dne St 5. listopadu 2014 13:39:49 jste napsal(a):
> > > Hi I installed and used 1.3 recently (under Ubuntu 14.04). I am no
> > > expert
> > > and I can help you further but I wanted to assure you the package is
> > > working fine. I am currently using RStudio and this interface sometimes
> > > makes installing packages easier.
> > 
> > Interesting. Which version was it? I've got more general error, I'd say,
> > it
> > seems like some problem with original archive...
> > 
> > > I couldn't compile mp-est which is another option for spp trees.
> > 
> > I didn't find package of that name (BioC, CRAN, R-Forge), do You, please,
> > have
> > some reference?
> > 
> > > best
> > > 
> > > Andrés
> > 
> > Thank You,
> > Vojtěch
> > 
> > > 2014-11-05 13:03 GMT-02:00 Vojtěch Zeisek :
> > > > Hello,
> > > > I'm looking for approaches how to get a species tree from set of gene
> > > > trees. I
> > > > was looking at Phybase package https://code.google.com/p/phybase/ but
> > 
> > it
> > 
> > > > seems
> > > > to be abandoned and when I tried to install it, I ended up with error:
> > > > install.packages("~/stazene/phybase_1.3.tar.gz", repos=NULL,
> > > > type="source")
> > > > Installing package into
> > 
> > ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1’
> > 
> > > > (as ‘lib’ is unspecified)
> > > > * installing *source* package ‘phybase’ ...
> > > > ERROR: a 'NAMESPACE' file is required
> > > > * removing ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1/phybase’
> > > > 
> > > > Warning in install.packages :
> > > >   installation of package ‘/home/vojta/stazene/phybase_1.3.tar.gz’ had
> > > >   non-
> > > > 
> > > > zero exit status
> > > > I'm working on Linux. Well, I have gene trees (in multiPhylo object).
> > > > I
> > > > tried
> > > > superTree, densiTree and speciesTree from phangorn. Those are looking
> > 
> > very
> > 
> > > > well, but I'd like to try some coalescence based approach. I was
> > 
> > looking
> > 
> > > > at
> > > > coalSpeciesTree from phangorn, but I don't know how to supply that X
> > > > phyDat
> > > > object - my gene trees have all same tips and species are same in all
> > > > trees.
> > > > How to define it? Or is there any other better approach how to get
> > 
> > species
> > 
> > > > tree out of gene trees?
> > > > Sincerely,
> > > > Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Replacement of Phybase - species tree from gene trees

2014-11-06 Thread Vojtěch Zeisek
Hi,
this could be the way, it is good idea, but for longer time, I'd rather find 
replacement function...
Yours,
Vojtěch

Dne St 5. listopadu 2014 08:49:11, Daniel Fulop napsal(a):
> Hi,
> 
> Just a quick suggestion. You could install the archived version of
> phybase in order to look at the R code for your function(s) of interest
> and then reuse that code directly in your own R scripts (or put them in
> separate scripts and "source" them). You can also then further taylor
> those functions to suit your needs. This gets around the issue of using
> an old package version, but the minor "downside" that maintaining the
> functions' code is then up to you.
> 
> HTH,
> Dan.

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Replacement of Phybase - species tree from gene trees

2014-11-05 Thread Vojtěch Zeisek
Thank You for information and clarification. I wonder about an alternative 
functions, but I don't know good function fitting my needs. But I still hope 
there is at least one. :-)
Sincerely,
Vojtěch

Dne St 5. listopadu 2014 11:40:08, François Michonneau napsal(a):
> phybase 1.2 and 1.3 are both missing a NAMESPACE file which is required for
> R versions above 3.0.0 and therefore can't be installed.
> 
> The latest archived version of phybase on CRAN (1.1) can however be
> installed: http://cran.r-project.org/src/contrib/Archive/phybase/
> 
> Personally I would advise against using archived packages, in particular if
> alternatives are available, as it reduces significantly the chances of
> making your analyses reproducible in the near future.
> 
> It might also be worth contacting the author of the package to see if he
> has plans to restart the development of his package.
> 
>   Cheers,
>   -- François
> 
> On Wed, Nov 5, 2014 at 10:48 AM, Vojtěch Zeisek  wrote:
> > Dne St 5. listopadu 2014 13:39:49 jste napsal(a):
> > > Hi I installed and used 1.3 recently (under Ubuntu 14.04). I am no
> > > expert
> > > and I can help you further but I wanted to assure you the package is
> > > working fine. I am currently using RStudio and this interface sometimes
> > > makes installing packages easier.
> > 
> > Interesting. Which version was it? I've got more general error, I'd say,
> > it
> > seems like some problem with original archive...
> > 
> > > I couldn't compile mp-est which is another option for spp trees.
> > 
> > I didn't find package of that name (BioC, CRAN, R-Forge), do You, please,
> > have
> > some reference?
> > 
> > > best
> > > 
> > > Andrés
> > 
> > Thank You,
> > Vojtěch
> > 
> > > 2014-11-05 13:03 GMT-02:00 Vojtěch Zeisek :
> > > > Hello,
> > > > I'm looking for approaches how to get a species tree from set of gene
> > > > trees. I
> > > > was looking at Phybase package https://code.google.com/p/phybase/ but
> > 
> > it
> > 
> > > > seems
> > > > to be abandoned and when I tried to install it, I ended up with error:
> > > > install.packages("~/stazene/phybase_1.3.tar.gz", repos=NULL,
> > > > type="source")
> > > > Installing package into
> > 
> > ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1’
> > 
> > > > (as ‘lib’ is unspecified)
> > > > * installing *source* package ‘phybase’ ...
> > > > ERROR: a 'NAMESPACE' file is required
> > > > * removing ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1/phybase’
> > > > 
> > > > Warning in install.packages :
> > > >   installation of package ‘/home/vojta/stazene/phybase_1.3.tar.gz’ had
> > > >   non-
> > > > 
> > > > zero exit status
> > > > I'm working on Linux. Well, I have gene trees (in multiPhylo object).
> > > > I
> > > > tried
> > > > superTree, densiTree and speciesTree from phangorn. Those are looking
> > 
> > very
> > 
> > > > well, but I'd like to try some coalescence based approach. I was
> > 
> > looking
> > 
> > > > at
> > > > coalSpeciesTree from phangorn, but I don't know how to supply that X
> > > > phyDat
> > > > object - my gene trees have all same tips and species are same in all
> > > > trees.
> > > > How to define it? Or is there any other better approach how to get
> > 
> > species
> > 
> > > > tree out of gene trees?
> > > > Sincerely,
> > > > Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Replacement of Phybase - species tree from gene trees

2014-11-05 Thread Vojtěch Zeisek
Dne St 5. listopadu 2014 13:39:49 jste napsal(a):
> Hi I installed and used 1.3 recently (under Ubuntu 14.04). I am no expert
> and I can help you further but I wanted to assure you the package is
> working fine. I am currently using RStudio and this interface sometimes
> makes installing packages easier.

Interesting. Which version was it? I've got more general error, I'd say, it 
seems like some problem with original archive...

> I couldn't compile mp-est which is another option for spp trees.

I didn't find package of that name (BioC, CRAN, R-Forge), do You, please, have 
some reference?

> best
> 
> Andrés

Thank You,
Vojtěch

> 2014-11-05 13:03 GMT-02:00 Vojtěch Zeisek :
> > Hello,
> > I'm looking for approaches how to get a species tree from set of gene
> > trees. I
> > was looking at Phybase package https://code.google.com/p/phybase/ but it
> > seems
> > to be abandoned and when I tried to install it, I ended up with error:
> > install.packages("~/stazene/phybase_1.3.tar.gz", repos=NULL,
> > type="source")
> > Installing package into ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1’
> > (as ‘lib’ is unspecified)
> > * installing *source* package ‘phybase’ ...
> > ERROR: a 'NAMESPACE' file is required
> > * removing ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1/phybase’
> > Warning in install.packages :
> >   installation of package ‘/home/vojta/stazene/phybase_1.3.tar.gz’ had
> >   non-
> > zero exit status
> > I'm working on Linux. Well, I have gene trees (in multiPhylo object). I
> > tried
> > superTree, densiTree and speciesTree from phangorn. Those are looking very
> > well, but I'd like to try some coalescence based approach. I was looking
> > at
> > coalSpeciesTree from phangorn, but I don't know how to supply that X
> > phyDat
> > object - my gene trees have all same tips and species are same in all
> > trees.
> > How to define it? Or is there any other better approach how to get species
> > tree out of gene trees?
> > Sincerely,
> > Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Replacement of Phybase - species tree from gene trees

2014-11-05 Thread Vojtěch Zeisek
Hello,
I'm looking for approaches how to get a species tree from set of gene trees. I 
was looking at Phybase package https://code.google.com/p/phybase/ but it seems 
to be abandoned and when I tried to install it, I ended up with error:
install.packages("~/stazene/phybase_1.3.tar.gz", repos=NULL, type="source")
Installing package into ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package ‘phybase’ ...
ERROR: a 'NAMESPACE' file is required
* removing ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1/phybase’
Warning in install.packages :
  installation of package ‘/home/vojta/stazene/phybase_1.3.tar.gz’ had non-
zero exit status
I'm working on Linux. Well, I have gene trees (in multiPhylo object). I tried 
superTree, densiTree and speciesTree from phangorn. Those are looking very 
well, but I'd like to try some coalescence based approach. I was looking at 
coalSpeciesTree from phangorn, but I don't know how to supply that X phyDat 
object - my gene trees have all same tips and species are same in all trees. 
How to define it? Or is there any other better approach how to get species 
tree out of gene trees?
Sincerely,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Network from gene trees

2014-11-03 Thread Vojtěch Zeisek
Hello,
thank You, I overlooked that function. Yes, that is what I'm looking for.
Sincerely,
Vojtěch

Dne Po 3. listopadu 2014 10:23:32 jste napsal(a):
> Hello Vojtěch,
> 
> have you looked into consensusNet in phangorn?
> 
> Regards,
> Klaus
> 
> Am 03.11.2014 03:10 schrieb "Vojtěch Zeisek" :
> > Hello,
> > let's say I have many gene trees (all have same labels) in one multiPhylo
> > object. The trees are not fully congruent. One of the reasons can be
> > hybridizations among taxa. I wonder if I can make from those trees a
> > network
> > looking, for example, like those from SplitsTree. I looked at functions in
> > ape
> > and phangorn, but they seem to work on only one phylogenetic tree or on
> > distance matrix. I want to get a species tree, but with (possible)
> > reticulations. Can I do this?
> > Sincerely,
> > Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Network from gene trees

2014-11-03 Thread Vojtěch Zeisek
Hello,
let's say I have many gene trees (all have same labels) in one multiPhylo 
object. The trees are not fully congruent. One of the reasons can be 
hybridizations among taxa. I wonder if I can make from those trees a network 
looking, for example, like those from SplitsTree. I looked at functions in ape 
and phangorn, but they seem to work on only one phylogenetic tree or on 
distance matrix. I want to get a species tree, but with (possible) 
reticulations. Can I do this?
Sincerely,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Antw: Re: [adegenet-forum] Isolation by distance (Mantel test)

2014-10-12 Thread Vojtěch Zeisek
Hello

Dne Ne 12. října 2014 15:47:58 jste napsal(a):
> Dear Vojtěch,
> 
> thank you for answering. I tried but didn't get ahead.
> 
> > data2<-read.table("shoreline1.txt",header=F,sep="\t")
> > Dgeo <- data2
> > Dgeo
> 
>V1V2   V3   V4   V5   V6
> 1Da   KH   Li  Lit   RD
> 2  KH 139.2
> 3  Li 146.7  7.5
> 4 Lit 151.5 12.3  4.8
> 5  RD 171.9 32.7 25.2 20.4
> 6  WW 155.3 16.1  8.6  3.8 16.6

You must convert Dgeo object to dist class. I'd try function as.dist. 
Something like Dgeo <- as.dist(Dgeo) You can verify it with is.dist.

> > ibd <- mantel.randtest(Dgen,Dgeo)
> 
> Error in mantel.randtest(Dgen, Dgeo) : Object of class 'dist' expected

Function mantel.randtest requires dist class object. See ?mantel.randtest and 
?dist

> Maybe you can give me a hint.
> 
> Regards,
> Isabelle

Sincerely,
Vojtěch

> >>> VojtěchZeisek  12.10.14 12.28 Uhr >>>
> 
> Hello
> 
> Dne Ne 12. října 2014 10:47:23, Isabelle Gemmer napsal(a):
> > Hello,
> > 
> > I installed coordinates for the Mantel test.
> > 
> >  > data1$other$xy<-dataxy
> >  > Dgeo <- dist(data1$other$xy)
> >  > ibd <- mantel.randtest(Dgen,Dgeo)
> > 
> > It worked well. But in reality, the examined organisms can not swim
> > through a lake, they can only migrate along a shoreline. Thus, I
> > measured the distances and provide an own matrix of geographic
> 
> distances.
> 
> > My question is: Can I also install own measured geographic distances
> > instead of coordinates?
> 
> Sure, just as Dgeo use matrix o distances along shoreline, so You
> wouldn't use
> dist function, but computed then for example in GIS and then imported
> into R.
> 
> > Regards,
> > Isabelle
> 
> Sincerely,
> Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] [adegenet-forum] Not working Monmonier

2014-07-14 Thread Vojtěch Zeisek
Ah, right, yes. Then, the only solution would be to calculate with populations 
instead of individuals, but it also has a lot of drawbacks...
Thank You for all the information,
Vojtěch

Dne Po 14. července 2014 10:23:08, Jombart, Thibaut napsal(a):
> Should not in principle, but technically will. Monmonier relies on a
> tesselation, and this tesselation will differ each time you jitter your
> coordinates. Cheers
> Thibaut
> 
> From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org]
> on behalf of Vojtěch Zeisek [vo...@trapa.cz] Sent: 14 July 2014 11:19
> To: mailinglist R
> Subject: Re: [R-sig-phylo] [adegenet-forum] Not working Monmonier
> 
> Hi,
> thank You for clarification. I tried sPCA, it looks very good. But it was
> also complaining about identical coordinates. One of my questions is about
> amount of migrants among areas, so that sPCA is not the best tool here, I
> think... For Monmonier, I think when I have localities from scale of almost
> 400 km, jitter them to make uncertainty few meters shouldn't matter at all,
> right? Sincerely,
> Vojtěch
> 
> Dne Po 14. července 2014 09:54:47 jste napsal(a):
> > Hi Vojtěch
> > 
> > Monmonier is not designed for spatial distribution with duplicate
> > locations. Problem is, if you jitter the data, you'll get a different
> > boundary every time you run the analysis.
> > 
> > If you're looking for spatial structures, sPCA may be more useful there.
> > 
> > Cheers
> > Thibaut
> > 
> > 
> > ____________
> > From: adegenet-forum-boun...@lists.r-forge.r-project.org
> > [adegenet-forum-boun...@lists.r-forge.r-project.org] on behalf of Vojtěch
> > Zeisek [vo...@trapa.cz] Sent: 13 July 2014 21:18
> > To: Adegenet R-Forum
> > Subject: [adegenet-forum] Not working Monmonier
> > 
> > Hello,
> > I tried Monmonier analysis as described in Adegent tutorial. I'm not
> > familiar with that method (for similar question I used IMa2 last time), so
> > I was curious what it does. :-) I tried with relatively relatively large
> > dataset.
> > 
> > Individuals from one locality usually have same coordinates. The code:
> > > monmonier <- monmonier(xy=genind$other$xy, dist=dist(genind$tab),
> > 
> > cn=chooseCN(genind$other$xy, ask=FALSE, type=5, d1=0, d2=2.5,
> > plot.nb=FALSE, edit.nb=FALSE), nrun=1)
> > Indicate the threshold ('d' for default): d
> > 
> > > coords.monmonier(monmonier)
> > 
> > Error in output[[runname]]$dir1[i, ] <- halfway[which(eval.x == TRUE &  :
> >   number of items to replace is not a multiple of replacement length
> > 
> > Calls: coords.monmonier
> > 
> > > plot(monmonier)
> > 
> > Warning messages:
> > 1: In arrows(obj$dir1$path[1:(nrow(obj$dir1$path) - 1), 1],
> > obj$dir1$path[1:> 
> > (nrow(obj$dir1$path) -  :
> >   zero-length arrow is of indeterminate angle and so skipped
> > 
> > 2: In arrows(obj$dir1$path[1:(nrow(obj$dir1$path) - 1), 1],
> > obj$dir1$path[1:> 
> > (nrow(obj$dir1$path) -  :
> >   zero-length arrow is of indeterminate angle and so skipped
> > 
> > 3: In arrows(obj$dir2$path[1:(nrow(obj$dir2$path) - 1), 1],
> > obj$dir2$path[1:> 
> > (nrow(obj$dir2$path) -  :
> >   zero-length arrow is of indeterminate angle and so skipped
> > 
> > 4: In arrows(obj$dir2$path[1:(nrow(obj$dir2$path) - 1), 1],
> > obj$dir2$path[1:> 
> > (nrow(obj$dir2$path) -  :
> >   zero-length arrow is of indeterminate angle and so skipped
> > 
> > genind$other$xy contains geographical coordinates in WGS 84 (from GPS).
> > The
> > only problem coming to my mind are those repetitive coordinates (for
> > individuals from one locality) - because of that, chooseCN practically
> > allows only methods 5 and 6. Might be, I could try it with populations,
> > but
> > then I'm afraid to get little bit different information... Or might be I
> > could add some little uncertainty to the coordinates...? I was also
> > thinking if it could be because of missing data, but when I tried with
> > genind object corrected for missing data, I ended up with same errors. Any
> > ideas?
> > Sincerely,
> > Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] [adegenet-forum] Not working Monmonier

2014-07-14 Thread Vojtěch Zeisek
Hi,
thank You for clarification. I tried sPCA, it looks very good. But it was also 
complaining about identical coordinates. One of my questions is about amount 
of migrants among areas, so that sPCA is not the best tool here, I think... 
For Monmonier, I think when I have localities from scale of almost 400 km, 
jitter them to make uncertainty few meters shouldn't matter at all, right?
Sincerely,
Vojtěch

Dne Po 14. července 2014 09:54:47 jste napsal(a):
> Hi Vojtěch
> 
> Monmonier is not designed for spatial distribution with duplicate locations.
> Problem is, if you jitter the data, you'll get a different boundary every
> time you run the analysis.
> 
> If you're looking for spatial structures, sPCA may be more useful there.
> 
> Cheers
> Thibaut
> 
> 
> 
> From: adegenet-forum-boun...@lists.r-forge.r-project.org
> [adegenet-forum-boun...@lists.r-forge.r-project.org] on behalf of Vojtěch
> Zeisek [vo...@trapa.cz] Sent: 13 July 2014 21:18
> To: Adegenet R-Forum
> Subject: [adegenet-forum] Not working Monmonier
> 
> Hello,
> I tried Monmonier analysis as described in Adegent tutorial. I'm not
> familiar with that method (for similar question I used IMa2 last time), so
> I was curious what it does. :-) I tried with relatively relatively large
> dataset.
> Individuals from one locality usually have same coordinates. The code:
> > monmonier <- monmonier(xy=genind$other$xy, dist=dist(genind$tab),
> cn=chooseCN(genind$other$xy, ask=FALSE, type=5, d1=0, d2=2.5, plot.nb=FALSE,
> edit.nb=FALSE), nrun=1)
> Indicate the threshold ('d' for default): d
> > coords.monmonier(monmonier)
> Error in output[[runname]]$dir1[i, ] <- halfway[which(eval.x == TRUE &  :
>   number of items to replace is not a multiple of replacement length
> Calls: coords.monmonier
> > plot(monmonier)
> Warning messages:
> 1: In arrows(obj$dir1$path[1:(nrow(obj$dir1$path) - 1), 1], obj$dir1$path[1:
> (nrow(obj$dir1$path) -  :
>   zero-length arrow is of indeterminate angle and so skipped
> 2: In arrows(obj$dir1$path[1:(nrow(obj$dir1$path) - 1), 1], obj$dir1$path[1:
> (nrow(obj$dir1$path) -  :
>   zero-length arrow is of indeterminate angle and so skipped
> 3: In arrows(obj$dir2$path[1:(nrow(obj$dir2$path) - 1), 1], obj$dir2$path[1:
> (nrow(obj$dir2$path) -  :
>   zero-length arrow is of indeterminate angle and so skipped
> 4: In arrows(obj$dir2$path[1:(nrow(obj$dir2$path) - 1), 1], obj$dir2$path[1:
> (nrow(obj$dir2$path) -  :
>   zero-length arrow is of indeterminate angle and so skipped
> genind$other$xy contains geographical coordinates in WGS 84 (from GPS). The
> only problem coming to my mind are those repetitive coordinates (for
> individuals from one locality) - because of that, chooseCN practically
> allows only methods 5 and 6. Might be, I could try it with populations, but
> then I'm afraid to get little bit different information... Or might be I
> could add some little uncertainty to the coordinates...? I was also
> thinking if it could be because of missing data, but when I tried with
> genind object corrected for missing data, I ended up with same errors. Any
> ideas?
> Sincerely,
> Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic

signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Pegas Tajimas Test

2014-06-25 Thread Vojtěch Zeisek
Hi

Dne St 25. června 2014 10:17:44, Peters, Stuart napsal(a):
> Hi,
> 
> I am trying to run the Tajimas.test function from the r package 'Pegas' on a
> small sample of 3 DNA sequences and I get this error:
> 
> Error in if (p < 0.5) 2 * p else 2 * (1 - p) :  missing value where
> TRUE/FALSE needed ?
> 
> Any ideas?

What was the original command? It looks to me like You forget to use some 
required parameter.

> Kind regards,
> 
> Stuart

All the best,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Triploid microsatellites?

2014-06-10 Thread Vojtěch Zeisek
Hi,
if anyone else (especially Linux users) would have similar problem with GIT 
and/or zipped package, this is the issue 
https://github.com/hadley/devtools/issues/406 It also contains useful link how 
to solve it. Basically, set unzip command in appropriate R option or download 
zip, unzip it at package as tar.gz and install manually. Linarius looks like 
very interesting package, but unfortunately only for dominant data...
All the best,
V.

Dne Po 9. června 2014 16:19:09 jste napsal(a):
> Hi,
> it isn't in cran yet, right? I'm not able to install it from the zip (master
> branch from git):
> install.packages(file.choose(), repos=NULL, lib.loc="~/R/x86_64-suse-linux-
> gnu-library/3.1/", instlib="~/R/x86_64-suse-linux-gnu-library/3.1/")
> Installing package into ‘/home/vojta/R’
> (as ‘lib’ is unspecified)
> Error in rawToChar(block[seq_len(ns)]) :
>   embedded nul in string:
> 'PK\003\004\n\0\0\0\0\0m\x94\x8bD\0\0\0\0\0\0\0\0\0\0\0\0\020\0\t\0Linarius-
> master/UT\005\0\001_\x98HSPK\003\004\n\0\0\0\b\0m\x94\x8bD\x8ewq\xa1\030\0\
> 0\0\034\0\0\0\035\0\t\0Linarius- master'
> Warning message:
> In install.packages(file.choose(), repos = NULL, lib.loc = "~/R/x86_64-suse-
> linux-gnu-library/3.1/",  :
>   installation of package ‘/home/vojta/plocha/Linarius-master.zip’ had non-
> zero exit status
> I'm using Linux if it matters. Honestly, I have no idea, what this error
> means...
> All the best,
> Vojtěch
> 
> Dne Pá 30. května 2014 13:39:14 jste napsal(a):
> >  Hi,
> > 
> > I'm also curently developinga R package:
> > https://github.com/giby/Linarius that can be used for triploid… actually
> > it
> > is designed for mixed ploidy levels. But right now, I focus on AFLP. As I
> > told you there is much more thing availlable for microsatelites. Benjamin
> > 
> > Le Vendredi 30 Mai 2014 09:17 GMT, Vojtěch Zeisek  a 
écrit:
> > > Hello,
> > > thank You both. poppr looks interesting, I need to explore it more.
> > > Adegenet is famous package. I didn't know it can also handle triploid
> > > data. I found problem when importing data to it. Functions of
> > > import2genind group (read.genetix, read.structure, read.fstat and
> > > read.genepop) are only for diploid data. So I used read.loci. The input
> > > file was easy: first line with names of markers etc, first row with
> > > names
> > > of samples, second row with populations and from third row alleles. I
> > > coded alleles in this way 123/234/345, so that each individual has 3
> > > alleles. Missing alleles are just NA.
> > > ssrs3n.loci <- read.loci("ssrs3n.txt", header=TRUE, loci.sep="\t",
> > > allele.sep="/", col.pop=2, col.loci=3:10, row.names=1) ssrs3n.loci
> > > Allelic data frame: 130 individuals
> > > 
> > > 8 loci
> > > 1 additional variable
> > > 
> > > ssrs3n.genind <- loci2genind(ssrs3n.loci)
> > > ssrs3n.genind
> > > 
> > >#
> > >### Genind object ###
> > >#
> > > 
> > > - genotypes of individuals -
> > > 
> > > S4 class:  genind
> > > @call: df2genind(X = as.matrix(x[, attr(x, "locicol")]), sep = "/",
> > > 
> > > pop = pop)
> > > 
> > > @tab:  130 x 115 matrix of genotypes
> > > 
> > > @ind.names: vector of  130 individual names
> > > @loc.names: vector of  8 locus names
> > > @loc.nall: number of alleles per locus
> > > @loc.fac: locus factor for the  115 columns of @tab
> > > @all.names: list of  8 components yielding allele names for each locus
> > > @ploidy:  2
> > > @type:  codom
> > > 
> > > Optional contents:
> > > @pop:  factor giving the population of each individual
> > > @pop.names:  factor giving the population of each individual
> > > 
> > > @other: - empty -
> > > 
> > > As You can see, it was imported as diploid and I haven't found way how
> > > import it as triploid data. Imported data matrix seems to be wrong. When
> > > I used input file formatted in the same way for diploids, it works
> > > perfectly... Any ideas how to fix that?
> > > Thank You in advance,
> > > Vojtěch Zeisek
> > > 
> > > Dne Pá 30. května 2014 03:34:49 jste napsal(a):
> > > > Hi there,
> > > > 
> > > > yes, adegenet handles any (constant) ploidy for most purposes. For
> >

Re: [R-sig-phylo] Triploid microsatellites?

2014-06-10 Thread Vojtěch Zeisek
Hi,
if anyone else would have problem with non-diploids and poppr, install 
developmental version from the GIThub repository. Many thanks to authors for 
pointing me right direction and writing this nice package. :-)
All the best,
Vojtěch

Dne Po 9. června 2014 14:36:23 jste napsal(a):
> Hi,
> I like the poppr package very much. And I like microstallites and don't like
> AFLP. ;-) I found a problem with some tree constructing.
> When I run bruvo.boot, it crashes at some random point:
> 
> ssrs3n.nj.bruvo <- bruvo.boot(pop=ssrs3n.missingno, replen=rep(2, 8),
> sample=100, tree="upgma", showtree=TRUE, cutoff=33, quiet=FALSE)
> 
> Bootstrapping...
> (note: calculation of node labels can take a while even after the progress
> bar is full)
> 
>   |==|
> 
> 37%Error in hclust(DD, method = method, ...) :
>   NA/NaN/Inf in foreign function call (arg 11)
> Calls: bruvo.boot -> poppr.boot.phylo -> FUN -> newfunk -> hclust
> 
> If I choose NJ, it crashes very quickly:
> 
> ssrs3n.nj.bruvo <- bruvo.boot(pop=ssrs3n.missingno, replen=rep(2, 8),
> sample=100, tree="nj", showtree=TRUE, cutoff=33, quiet=FALSE)
> 
> Warning in bruvo.boot(pop = ssrs3n.missingno, replen = rep(2, 8), sample =
> 100,  :
>   Some branch lengths of the tree are negative. Normalizing branches
> according to Kuhner and Felsenstein (1994)
> 
> Bootstrapping...
> (note: calculation of node labels can take a while even after the progress
> bar is full)
> 
>   |= |
> 
> 1%Error in newfunk(bruvos_distance(x)) :
>   missing values are not allowed in the distance matrix
> Consider using njs()
> Calls: bruvo.boot -> poppr.boot.phylo -> FUN -> newfunk
> 
> The genind object doesn't contain missing data. I checked all point and I
> don't see any problem... :-( Any idea how to fix it?
> BTW, poppr's manual speak about parameter B for number of bootstraps for
> bruvo.boot() function, but its manual speaks about parameter sample, which
> is the correct one. ;-)
> Sincerely,
> Vojtěch Zeisek
> 
> Dne Čt 29. května 2014 16:12:31 jste napsal(a):
> >  Hi,
> > 
> > Yes it is possible in R, there is a package created for related purposes:
> > poppr or something like that… The dev version on github should be
> > preferred. I have seen several R work with polyploids and microsatelites,
> > unfortunately… I work with ALFP  :p Benjamin
> > 
> > Le Jeudi 29 Mai 2014 13:40 GMT, Vojtěch Zeisek  a écrit:
> > > Hello,
> > > I wonder if it is possible to handle triploid microsatellite (yes, all
> > > individuals are regular 3n) data in adegenet and another R packages. And
> > > if so, how to enter the data. Any experiences and/or Ideas are very
> > > welcomed. :-) Structure and BAPS are working well.
> > > Yours sincerely,
> > > Vojtěch Zeisek

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Triploid microsatellites?

2014-06-09 Thread Vojtěch Zeisek
Hi,
it isn't in cran yet, right? I'm not able to install it from the zip (master 
branch from git):
install.packages(file.choose(), repos=NULL, lib.loc="~/R/x86_64-suse-linux-
gnu-library/3.1/", instlib="~/R/x86_64-suse-linux-gnu-library/3.1/")
Installing package into ‘/home/vojta/R’
(as ‘lib’ is unspecified)
Error in rawToChar(block[seq_len(ns)]) : 
  embedded nul in string: 
'PK\003\004\n\0\0\0\0\0m\x94\x8bD\0\0\0\0\0\0\0\0\0\0\0\0\020\0\t\0Linarius-
master/UT\005\0\001_\x98HSPK\003\004\n\0\0\0\b\0m\x94\x8bD\x8ewq\xa1\030\0\0\0\034\0\0\0\035\0\t\0Linarius-
master'
Warning message:
In install.packages(file.choose(), repos = NULL, lib.loc = "~/R/x86_64-suse-
linux-gnu-library/3.1/",  :
  installation of package ‘/home/vojta/plocha/Linarius-master.zip’ had non-
zero exit status
I'm using Linux if it matters. Honestly, I have no idea, what this error 
means...
All the best,
Vojtěch

Dne Pá 30. května 2014 13:39:14 jste napsal(a):
>  Hi,
> 
> I'm also curently developinga R package:
> https://github.com/giby/Linarius that can be used for triploid… actually it
> is designed for mixed ploidy levels. But right now, I focus on AFLP. As I
> told you there is much more thing availlable for microsatelites. Benjamin
> 
> Le Vendredi 30 Mai 2014 09:17 GMT, Vojtěch Zeisek  a écrit:
> > Hello,
> > thank You both. poppr looks interesting, I need to explore it more.
> > Adegenet is famous package. I didn't know it can also handle triploid
> > data. I found problem when importing data to it. Functions of
> > import2genind group (read.genetix, read.structure, read.fstat and
> > read.genepop) are only for diploid data. So I used read.loci. The input
> > file was easy: first line with names of markers etc, first row with names
> > of samples, second row with populations and from third row alleles. I
> > coded alleles in this way 123/234/345, so that each individual has 3
> > alleles. Missing alleles are just NA.
> > ssrs3n.loci <- read.loci("ssrs3n.txt", header=TRUE, loci.sep="\t",
> > allele.sep="/", col.pop=2, col.loci=3:10, row.names=1) ssrs3n.loci
> > Allelic data frame: 130 individuals
> > 
> > 8 loci
> > 1 additional variable
> > 
> > ssrs3n.genind <- loci2genind(ssrs3n.loci)
> > ssrs3n.genind
> > 
> >#
> >### Genind object ###
> >#
> > 
> > - genotypes of individuals -
> > 
> > S4 class:  genind
> > @call: df2genind(X = as.matrix(x[, attr(x, "locicol")]), sep = "/",
> > 
> > pop = pop)
> > 
> > @tab:  130 x 115 matrix of genotypes
> > 
> > @ind.names: vector of  130 individual names
> > @loc.names: vector of  8 locus names
> > @loc.nall: number of alleles per locus
> > @loc.fac: locus factor for the  115 columns of @tab
> > @all.names: list of  8 components yielding allele names for each locus
> > @ploidy:  2
> > @type:  codom
> > 
> > Optional contents:
> > @pop:  factor giving the population of each individual
> > @pop.names:  factor giving the population of each individual
> > 
> > @other: - empty -
> > 
> > As You can see, it was imported as diploid and I haven't found way how
> > import it as triploid data. Imported data matrix seems to be wrong. When
> > I used input file formatted in the same way for diploids, it works
> > perfectly... Any ideas how to fix that?
> > Thank You in advance,
> > Vojtěch Zeisek
> > 
> > Dne Pá 30. května 2014 03:34:49 jste napsal(a):
> > > Hi there,
> > > 
> > > yes, adegenet handles any (constant) ploidy for most purposes. For input
> > > formats etc. please see the tutorial on basics, section 'documents' on:
> > > http://adegenet.r-forge.r-project.org/
> > > 
> > > Please feel free to use the adegenet forum for adegenet-related
> > > questions.
> > > Cheers
> > > Thibaut
> > > 
> > > 
> > > From: r-sig-phylo-boun...@r-project.org
> > > [r-sig-phylo-boun...@r-project.org]
> > > on behalf of Gilles Benjamin Leduc [g...@hi.is] Sent: 29 May 2014 17:12
> > > To: Vojtěch Zeisek
> > > Cc: mailinglist R
> > > Subject: Re: [R-sig-phylo] Triploid microsatellites?
> > > 
> > >  Hi,
> > > 
> > > Yes it is possible in R, there is a package created for related
> > > purposes:
> > > poppr or something like that… The dev version on github should be
> &g

Re: [R-sig-phylo] Triploid microsatellites?

2014-06-09 Thread Vojtěch Zeisek
Hi,
yes, thank You, adegenet uses some functions from pegas. I thought it is 
mainly for DNA data. I have problems with AMOVA and HW test.

amova(ssrs3n.dist~ssrs3n.pops, data=NULL, nperm=1000, is.squared=TRUE)

Analysis of Molecular Variance

Call: amova(formula = ssrs3n.dist ~ ssrs3n.pops, data = NULL, nperm = 1000, 
is.squared = TRUE)

SSD MSD  df
ssrs3n.pops  NA  NA   8
ErrorNA  NA 121
TotalNA  NA 129

Variance components:
sigma2 P.value
ssrs3n.pops   
Error 

Variance coefficients:
   a 
14.23846 

I don't get, why I have NAs everywhere.

ssrs3n.hwe.test <- hw.test(ssrs3n.loci, B=10)

Error in expand.genotype(Nall, ploidy = ploidy, matrix = TRUE) : 
  object 'ans' not found
Calls: hw.test -> lapply -> FUN -> expand.genotype

When I run it with diploid microsatellites, it works fine. But I think those 
two procedures should work with any ploidy level. I tried to set B=0 for 
hw.test, but it is the same... Do I miss some basic point?
Sincerely,
Vojtěch

Dne Pá 30. května 2014 11:31:31 jste napsal(a):
> Hi Vojtěch,
> 
> You can also have a look at pegas: it includes a vignette detailing how
> to read allelic/genotypic data files and converting from/to adegenet:
> 
> library(pegas)
> vignette("ReadingFiles")
> 
> Most functions in pegas will accept any level of ploidy.
> 
> HTH
> 
> Emmanuel
> 
> Le 30/05/2014 05:34, Jombart, Thibaut a écrit :
> > Hi there,
> > 
> > yes, adegenet handles any (constant) ploidy for most purposes. For input
> > formats etc. please see the tutorial on basics, section 'documents' on:
> > http://adegenet.r-forge.r-project.org/
> > 
> > Please feel free to use the adegenet forum for adegenet-related questions.
> > Cheers
> > Thibaut
> > 
> > 
> > 
> > From: r-sig-phylo-boun...@r-project.org
> > [r-sig-phylo-boun...@r-project.org] on behalf of Gilles Benjamin Leduc
> > [g...@hi.is] Sent: 29 May 2014 17:12
> > To: Vojtěch Zeisek
> > Cc: mailinglist R
> > Subject: Re: [R-sig-phylo] Triploid microsatellites?
> > 
> >   Hi,
> > 
> > Yes it is possible in R, there is a package created for related purposes: 
> > poppr or something like that… The dev version on github should be
> > preferred. I have seen several R work with polyploids and microsatelites,
> > unfortunately… I work with ALFP  :p Benjamin
> > 
> > Le Jeudi 29 Mai 2014 13:40 GMT, Vojtěch Zeisek  a écrit:
> >> Hello,
> >> I wonder if it is possible to handle triploid microsatellite (yes, all
> >> individuals are regular 3n) data in adegenet and another R packages. And
> >> if so, how to enter the data. Any experiences and/or Ideas are very
> >> welcomed. :-) Structure and BAPS are working well.
> >> Yours sincerely,
> >> Vojtěch Zeisek

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Triploid microsatellites?

2014-06-09 Thread Vojtěch Zeisek
Hi,
I like the poppr package very much. And I like microstallites and don't like 
AFLP. ;-) I found a problem with some tree constructing.
When I run bruvo.boot, it crashes at some random point:

ssrs3n.nj.bruvo <- bruvo.boot(pop=ssrs3n.missingno, replen=rep(2, 8), 
sample=100, tree="upgma", showtree=TRUE, cutoff=33, quiet=FALSE)

Bootstrapping...
(note: calculation of node labels can take a while even after the progress bar 
is full)

  |==|  
37%Error in hclust(DD, method = method, ...) : 
  NA/NaN/Inf in foreign function call (arg 11)
Calls: bruvo.boot -> poppr.boot.phylo -> FUN -> newfunk -> hclust

If I choose NJ, it crashes very quickly:

ssrs3n.nj.bruvo <- bruvo.boot(pop=ssrs3n.missingno, replen=rep(2, 8), 
sample=100, tree="nj", showtree=TRUE, cutoff=33, quiet=FALSE)

Warning in bruvo.boot(pop = ssrs3n.missingno, replen = rep(2, 8), sample = 
100,  :
  Some branch lengths of the tree are negative. Normalizing branches according 
to Kuhner and Felsenstein (1994)

Bootstrapping...
(note: calculation of node labels can take a while even after the progress bar 
is full)

  |= |   
1%Error in newfunk(bruvos_distance(x)) : 
  missing values are not allowed in the distance matrix
Consider using njs()
Calls: bruvo.boot -> poppr.boot.phylo -> FUN -> newfunk

The genind object doesn't contain missing data. I checked all point and I 
don't see any problem... :-( Any idea how to fix it?
BTW, poppr's manual speak about parameter B for number of bootstraps for 
bruvo.boot() function, but its manual speaks about parameter sample, which is 
the correct one. ;-)
Sincerely,
Vojtěch Zeisek

Dne Čt 29. května 2014 16:12:31 jste napsal(a):
>  Hi,
> 
> Yes it is possible in R, there is a package created for related purposes: 
> poppr or something like that… The dev version on github should be
> preferred. I have seen several R work with polyploids and microsatelites,
> unfortunately… I work with ALFP  :p Benjamin
> 
> Le Jeudi 29 Mai 2014 13:40 GMT, Vojtěch Zeisek  a écrit:
> > Hello,
> > I wonder if it is possible to handle triploid microsatellite (yes, all
> > individuals are regular 3n) data in adegenet and another R packages. And
> > if so, how to enter the data. Any experiences and/or Ideas are very
> > welcomed. :-) Structure and BAPS are working well.
> > Yours sincerely,
> > Vojtěch Zeisek

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Triploid microsatellites?

2014-06-02 Thread Vojtěch Zeisek
Hi,
thank You, it is very nice package, I really like it. Together with APE, 
Adegenet, Pegas, etc it is very powerful combination.
Best,
Vojtěch

Dne Pá 30. května 2014 08:43:01 jste napsal(a):
> Hi Vojtěch,
> 
> The stable development version of the poppr package available on github
> (https://github.com/grunwaldlab/poppr/tree/devel) can handle polyploid SSR
> data based on Bruvo's distance. Download instructions are available here:
> https://github.com/grunwaldlab/poppr/tree/devel#for-the-bleeding-edge-devel
> opment-version.
> 
> Best,
> Nik and Zhian
> 
> On May 30, 2014, at 6:39 AM, Gilles Benjamin Leduc  wrote:
> > Hi,
> > 
> > I'm also curently developinga R package:
> > https://github.com/giby/Linarius that can be used for triploid… actually
> > it is designed for mixed ploidy levels. But right now, I focus on AFLP.
> > As I told you there is much more thing availlable for microsatelites.
> > Benjamin
> > 
> > Le Vendredi 30 Mai 2014 09:17 GMT, Vojtěch Zeisek  a 
écrit:
> >> Hello,
> >> thank You both. poppr looks interesting, I need to explore it more.
> >> Adegenet is famous package. I didn't know it can also handle triploid
> >> data. I found problem when importing data to it. Functions of
> >> import2genind group (read.genetix, read.structure, read.fstat and
> >> read.genepop) are only for diploid data. So I used read.loci. The input
> >> file was easy: first line with names of markers etc, first row with
> >> names of samples, second row with populations and from third row
> >> alleles. I coded alleles in this way
> >> 
> >> 123/234/345, so that each individual has 3 alleles. Missing alleles are
> >> just NA.
> >> ssrs3n.loci <- read.loci("ssrs3n.txt", header=TRUE, loci.sep="\t",
> >> allele.sep="/", col.pop=2, col.loci=3:10, row.names=1) ssrs3n.loci
> >> Allelic data frame: 130 individuals
> >> 
> >>8 loci
> >>1 additional variable
> >> 
> >> ssrs3n.genind <- loci2genind(ssrs3n.loci)
> >> ssrs3n.genind
> >> 
> >>   #
> >>   ### Genind object ###
> >>   #
> >> 
> >> - genotypes of individuals -
> >> 
> >> S4 class:  genind
> >> @call: df2genind(X = as.matrix(x[, attr(x, "locicol")]), sep = "/",
> >> 
> >>pop = pop)
> >> 
> >> @tab:  130 x 115 matrix of genotypes
> >> 
> >> @ind.names: vector of  130 individual names
> >> @loc.names: vector of  8 locus names
> >> @loc.nall: number of alleles per locus
> >> @loc.fac: locus factor for the  115 columns of @tab
> >> @all.names: list of  8 components yielding allele names for each locus
> >> @ploidy:  2
> >> @type:  codom
> >> 
> >> Optional contents:
> >> @pop:  factor giving the population of each individual
> >> @pop.names:  factor giving the population of each individual
> >> 
> >> @other: - empty -
> >> 
> >> As You can see, it was imported as diploid and I haven't found way how
> >> import it as triploid data. Imported data matrix seems to be wrong. When
> >> I used input file formatted in the same way for diploids, it works
> >> perfectly... Any ideas how to fix that?
> >> Thank You in advance,
> >> Vojtěch Zeisek
> >> 
> >> Dne Pá 30. května 2014 03:34:49 jste napsal(a):
> >>> Hi there,
> >>> 
> >>> yes, adegenet handles any (constant) ploidy for most purposes. For input
> >>> formats etc. please see the tutorial on basics, section 'documents' on:
> >>> http://adegenet.r-forge.r-project.org/
> >>> 
> >>> Please feel free to use the adegenet forum for adegenet-related
> >>> questions.
> >>> Cheers
> >>> Thibaut
> >>> 
> >>> 
> >>> From: r-sig-phylo-boun...@r-project.org
> >>> [r-sig-phylo-boun...@r-project.org]
> >>> on behalf of Gilles Benjamin Leduc [g...@hi.is] Sent: 29 May 2014 17:12
> >>> To: Vojtěch Zeisek
> >>> Cc: mailinglist R
> >>> Subject: Re: [R-sig-phylo] Triploid microsatellites?
> >>> 
> >>> Hi,
> >>> 
> >>> Yes it is possible in R, there is a package created for related
> >>> purposes:
> >>> poppr or something like that… The dev version

Re: [R-sig-phylo] Triploid microsatellites?

2014-06-02 Thread Vojtěch Zeisek
Yes, it was easy, thank You for pointing me in the good direction.

ssrs3n.table <- read.table("ssrs3n.txt", header=TRUE, sep="\t", quote=" ", 
dec=".", row.names=1)
ssrs3n.populations <- read.table("populations.txt", header=TRUE)
ssrs3n.pops <- ssrs3n.populations[,1]
ssrs3n.genind <- df2genind(ssrs3n.table, sep="/", ncode=3, pop=ssrs3n.pops, 
missing=NA, ploidy=3, type=“codom“)

That trick with populations is not probably the most elegant one, but it is 
easy and working fine. :-)
Sincerely,
Vojtěch

Dne Pá 30. května 2014 10:13:27 jste napsal(a):
> Hi there,
> 
> yes, the formats you mention are not designed for triploid data, but reading
> your data in should be easy. Just use read.table or read.csv to read your
> file in, then use df2genind to convert your data into a genind object, with
> sep="/" and ploidy=3.
> 
> Cheers
> Thibaut
> ________
> From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org]
> on behalf of Vojtěch Zeisek [vo...@trapa.cz] Sent: 30 May 2014 10:17
> To: mailinglist R
> Subject: Re: [R-sig-phylo] Triploid microsatellites?
> 
> Hello,
> thank You both. poppr looks interesting, I need to explore it more.
> Adegenet is famous package. I didn't know it can also handle triploid data.
> I found problem when importing data to it. Functions of import2genind group
> (read.genetix, read.structure, read.fstat and read.genepop) are only for
> diploid data. So I used read.loci. The input file was easy: first line with
> names of markers etc, first row with names of samples, second row with
> populations and from third row alleles. I coded alleles in this way
> 123/234/345, so that each individual has 3 alleles. Missing alleles are
> just NA.
> ssrs3n.loci <- read.loci("ssrs3n.txt", header=TRUE, loci.sep="\t",
> allele.sep="/", col.pop=2, col.loci=3:10, row.names=1)
> ssrs3n.loci
> Allelic data frame: 130 individuals
> 8 loci
> 1 additional variable
> ssrs3n.genind <- loci2genind(ssrs3n.loci)
> ssrs3n.genind
> 
>#
>### Genind object ###
>#
> - genotypes of individuals -
> 
> S4 class:  genind
> @call: df2genind(X = as.matrix(x[, attr(x, "locicol")]), sep = "/",
> pop = pop)
> 
> @tab:  130 x 115 matrix of genotypes
> 
> @ind.names: vector of  130 individual names
> @loc.names: vector of  8 locus names
> @loc.nall: number of alleles per locus
> @loc.fac: locus factor for the  115 columns of @tab
> @all.names: list of  8 components yielding allele names for each locus
> @ploidy:  2
> @type:  codom
> 
> Optional contents:
> @pop:  factor giving the population of each individual
> @pop.names:  factor giving the population of each individual
> 
> @other: - empty -
> 
> As You can see, it was imported as diploid and I haven't found way how
> import it as triploid data. Imported data matrix seems to be wrong. When I
> used input file formatted in the same way for diploids, it works
> perfectly... Any ideas how to fix that?
> Thank You in advance,
> Vojtěch Zeisek
> 
> Dne Pá 30. května 2014 03:34:49 jste napsal(a):
> > Hi there,
> > 
> > yes, adegenet handles any (constant) ploidy for most purposes. For input
> > formats etc. please see the tutorial on basics, section 'documents' on:
> > http://adegenet.r-forge.r-project.org/
> > 
> > Please feel free to use the adegenet forum for adegenet-related questions.
> > Cheers
> > Thibaut
> > 
> > 
> > From: r-sig-phylo-boun...@r-project.org
> > [r-sig-phylo-boun...@r-project.org]
> > on behalf of Gilles Benjamin Leduc [g...@hi.is] Sent: 29 May 2014 17:12
> > To: Vojtěch Zeisek
> > Cc: mailinglist R
> > Subject: Re: [R-sig-phylo] Triploid microsatellites?
> > 
> >  Hi,
> > 
> > Yes it is possible in R, there is a package created for related purposes:
> > poppr or something like that… The dev version on github should be
> > preferred. I have seen several R work with polyploids and microsatelites,
> > unfortunately… I work with ALFP  :p Benjamin
> > 
> > Le Jeudi 29 Mai 2014 13:40 GMT, Vojtěch Zeisek  a écrit:
> > > Hello,
> > > I wonder if it is possible to handle triploid microsatellite (yes, all
> > > individuals are regular 3n) data in adegenet and another R packages. And
> > > if so, how to enter the data. Any experiences and/or Ideas are very
> > > welcomed. :-) Structure and BAPS are working well.
> > > Yo

Re: [R-sig-phylo] Triploid microsatellites?

2014-05-30 Thread Vojtěch Zeisek
Hello,
thank You both. poppr looks interesting, I need to explore it more.
Adegenet is famous package. I didn't know it can also handle triploid data. I 
found problem when importing data to it. Functions of import2genind group 
(read.genetix, read.structure, read.fstat and read.genepop) are only for 
diploid data. So I used read.loci. The input file was easy: first line with 
names of markers etc, first row with names of samples, second row with 
populations and from third row alleles. I coded alleles in this way 
123/234/345, so that each individual has 3 alleles. Missing alleles are just 
NA.
ssrs3n.loci <- read.loci("ssrs3n.txt", header=TRUE, loci.sep="\t", 
allele.sep="/", col.pop=2, col.loci=3:10, row.names=1)
ssrs3n.loci
Allelic data frame: 130 individuals
8 loci
1 additional variable
ssrs3n.genind <- loci2genind(ssrs3n.loci)
ssrs3n.genind

   #
   ### Genind object ### 
   #
- genotypes of individuals - 

S4 class:  genind
@call: df2genind(X = as.matrix(x[, attr(x, "locicol")]), sep = "/", 
pop = pop)

@tab:  130 x 115 matrix of genotypes

@ind.names: vector of  130 individual names
@loc.names: vector of  8 locus names
@loc.nall: number of alleles per locus
@loc.fac: locus factor for the  115 columns of @tab
@all.names: list of  8 components yielding allele names for each locus
@ploidy:  2
@type:  codom

Optional contents: 
@pop:  factor giving the population of each individual
@pop.names:  factor giving the population of each individual

@other: - empty -

As You can see, it was imported as diploid and I haven't found way how import 
it as triploid data. Imported data matrix seems to be wrong. When I used input 
file formatted in the same way for diploids, it works perfectly...
Any ideas how to fix that?
Thank You in advance,
Vojtěch Zeisek

Dne Pá 30. května 2014 03:34:49 jste napsal(a):
> Hi there,
> 
> yes, adegenet handles any (constant) ploidy for most purposes. For input
> formats etc. please see the tutorial on basics, section 'documents' on:
> http://adegenet.r-forge.r-project.org/
> 
> Please feel free to use the adegenet forum for adegenet-related questions.
> Cheers
> Thibaut
> 
> 
> From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org]
> on behalf of Gilles Benjamin Leduc [g...@hi.is] Sent: 29 May 2014 17:12
> To: Vojtěch Zeisek
> Cc: mailinglist R
> Subject: Re: [R-sig-phylo] Triploid microsatellites?
> 
>  Hi,
> 
> Yes it is possible in R, there is a package created for related purposes: 
> poppr or something like that… The dev version on github should be
> preferred. I have seen several R work with polyploids and microsatelites,
> unfortunately… I work with ALFP  :p Benjamin
> 
> Le Jeudi 29 Mai 2014 13:40 GMT, Vojtěch Zeisek  a écrit:
> > Hello,
> > I wonder if it is possible to handle triploid microsatellite (yes, all
> > individuals are regular 3n) data in adegenet and another R packages. And
> > if so, how to enter the data. Any experiences and/or Ideas are very
> > welcomed. :-) Structure and BAPS are working well.
> > Yours sincerely,
> > Vojtěch Zeisek
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic

signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Triploid microsatellites?

2014-05-29 Thread Vojtěch Zeisek
Hello,
I wonder if it is possible to handle triploid microsatellite (yes, all 
individuals are regular 3n) data in adegenet and another R packages. And if 
so, how to enter the data. Any experiences and/or Ideas are very welcomed. :-) 
Structure and BAPS are working well.
Yours sincerely,
Vojtěch Zeisek

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Problems with bootstraps of NJ tree from SSRs data

2014-01-31 Thread Vojtěch Zeisek
Hello,
some time ago I was wondering how to bootstrap NJ tree of populations based on 
microsatellite data. When the problem became really urgent, I asked for help 
one my friend, who is much better R programmer, than me and we (mostly he;-) 
have written a function doing this job. If it'd be interesting for someone 
else, here it is:

## Bootstrap of NJ tree of populations. As input takes bootstrapped tree, 
source data in geneind format and number of permutations.

boot.phylo.nj.pop <- function(origtree, genindata, nperm) {

# Custom variant of function sample to correct its behavior when number of 
individuals within respective population is 1.
  mysample <- function(x){
if (length(x) == 1) {out <- x}
  else {out <- sample(x, replace=TRUE)}
  return(out)
}

# Construction of NJ tree from bootstrapped dataset for further comparison 
with original tree.
## Here it is possible to adjust type and/or parameters of distance matrix 
and/or tree constructing.
  treemaker <- function (ind, listgenpopobj) {
nj(dist.genpop(listgenpopobj[[ind]], method=1, diag=TRUE, upper=TRUE))
}

# Extraction of needed information from original data and preparation of 
temporal variables.
  genindata2 <- genindata
  data <- genindata@tab
  pop <- genindata@pop
  indiv <- 1:nrow(genindata@tab)
  res <- vector(mode="list", length=nperm)

# In every step (from 1 to number of permutations) sample within respective 
populations of source data and write it into list of geneind objects.
  for (index in 1:nperm) {
struct <- unlist(tapply(indiv, pop, mysample))
new.tab <- data[struct,]
genindata2@tab <- new.tab
# For correct writing of modified data to the list.
res[[index]] <- genindata2
}

# Conversion of all genind objects in the list to genpop objects.
  population <- lapply(res, genind2genpop)
# Construction of trees and saving of them into the list of trees.
  trees <- vector("list", nperm)
  trees <- lapply(1:nperm, treemaker, population)
# Compare every bootstrapped tree with original one and return vector of 
bootstrap support values.
  for (i in 1:nperm) storage.mode(trees[[i]]$Nnode) <- "integer"
  storage.mode(origtree$Nnode) <- "integer"
  pp <- prop.part(trees)
  pp <- postprocess.prop.part(pp)
  ans <- prop.clades(origtree, part=pp, rooted=FALSE)
  return(ans)

  }

It shouldn't be difficult to modify it for little bit different data and/or 
use. 
Of course, if You find a bug, I'd be very glad to know about it. ;-)
All the best,
Vojtěch

Dne St 16. října 2013 14:39:28, Emmanuel Paradis napsal(a):
> Le 16/10/2013 00:20, Vojtěch Zeisek a écrit :
> > Hi, Emmanuel, thank You very much!
> > 
> > Dne Út 15. října 2013 21:45:12, Emmanuel Paradis napsal(a):
> >> Hi Vojtěch,
> >> 
> >> Le 14/10/2013 23:14, Vojtěch Zeisek a écrit :
> >>> Hello,
> >>> I know this is FAQ, but I still haven't found solution, which would work
> >>> for me... :-( I'd like to get unrooted bootstraped NJ tree. I was
> >>> looking
> >>> through discussions (incl. on this list), but proposed solutions seem
> >>> very complicated or not suitable for my data/method. Function
> >>> boot.phylo() from ape package looks promising, but it causes R to
> >>> crash...
> >>> This is my workflow:
> >>> # Read data
> >>> mydata.loci <- read.loci("mydata.txt", header=TRUE, loci.sep="\t",
> >>> allele.sep="/", col.pop=2, col.loci=4:17, row.names=1)
> >>> # Convert to genind object
> >>> mydata.genind <- loci2genind(mydata.loci)
> >>> # Compute genetic distances
> >>> mydata.dist <- dist(mydata.genind, method="euclidean", diag=TRUE,
> >>> upper=TRUE) # Do the NJ - the last command, which works
> >>> mydata.nj <- nj(mydata.dist)
> >>> # Bootstrap the tree - I see progress bar running towards 100% and when
> >>> it
> >>> reaches that value, R session crashes...
> >>> mydata.boot <- boot.phylo(mydata.nj, mydata.genind$tab, function(xx)
> >>> nj(dist(xx)), B=100)
> >> 
> >> With this command, you resample the columns of the matrix of alleles. I
> >> am not sure this is the best thing to do. I'd rather resample the matrix
> >> of loci, like this:
> >> 
> >> mydata.boot <- boot.phylo(mydata.nj, mydata.loci, function(xx)
> >> 
> >> nj(dist(loci2genind(xx))), B = 100)
> > 
> > Perfect, it works!
> 
> I suppose the problem with your previous implementation (resampling the
> matrix of alleles) is that most all

Re: [R-sig-phylo] Probably silly question about maps

2014-01-20 Thread Vojtěch Zeisek
Yes, thank You. If anyone else is interested, this works fine:
souradnice_pop is a list containing various information about populations - 
coordinates, symbol and color to plot and so on.
# Draw a map
plot(x=getMap(resolution="high"), xlim=c(0,60), ylim=c(35,50), asp=1, lwd=1.5)
# Draw a box around it
box()
# Plot map points
points(souradnice_pop$X.lon, souradnice_pop$X.lat, 
pch=souradnice_pop[["symbol"]], col=souradnice_pop$col, cex=2)
# Function text() doesn't allow to plot shaded background. Function 
boxed.labels() can do that, but it is not possible to move the text aside the 
point not to overlap it. So I tried shadowtest() It works fine, but it is 
necessary to play little bit wit the parameters.
shadowtext(souradnice_pop$X.lon, souradnice_pop$X.lat, 
labels=souradnice_pop[["pop"]], col="black", bg="grey", theta=seq(pi/4,2*pi, 
length.out=8), r=0.2, pos=souradnice_pop[["offset"]], cex=1.1)
# Plot a legend
legend(x="topright", inset=1/50, legend=c("T. pyrrhopappum", "T. 
haussknechtii", "T. serotinum"), border="black", pch=c(15, 17, 19), pt.cex=2, 
bty="o", bg="lightgrey", box.lwd=2, cex=1.2, title="Species of Taraxacum sect. 
Dioszegia“)
All the best,
Vojtěch

Dne So 18. ledna 2014 16:58:15, Liam J. Revell napsal(a):
> You might try investigating text to add labels to the plot and and
> legend for a legend. Good luck! - Liam
> 
> Liam J. Revell, Assistant Professor of Biology
> University of Massachusetts Boston
> web: http://faculty.umb.edu/liam.revell/
> email: liam.rev...@umb.edu
> blog: http://blog.phytools.org
> 
> On 1/13/2014 12:14 PM, Vojtěch Zeisek wrote:
> > Hello,
> > I have probably very silly question about maps of samples, but I'm not
> > able to figure it out. :-( I wish to generate simple map showing sampling
> > localities of sampled populations, with various symbols and colors for
> > species and other characteristics. And with labels for the point showing
> > population abbreviation and map legend explaining used symbols.
> > To generate map I use
> > plot(x=getMap(resolution="high"), xlim=c(0,60), ylim=c(35,50), asp=1,
> > lwd=2) and to plot localities
> > points(souradnice2$X.lon, souradnice2$X.lat, pch=souradnice2$symbol,
> > col=souradnice2$col, cex=2)
> > Variable „souradnice2“ contains details about localities:
> > souradnice2
> > 
> >  X.lon.  X.lat. sizecol char symbol
> > 
> > "D001"  2.9000 42.9167  bigred   Fe 15
> > [...]
> > „D007“ 21. 41.1000  big   blue   He 17
> > [...]
> > "D027" 20.8000 41.1333  big   blue   Oh 17
> > [...]
> > "D053" 21.5167 41.9167  big   blue   Sk 17
> > "D054" 21.2833 41.9500  big   blue   Ma 17
> > "D055" 21.3667 41.9667  big   blue   So 17
> > "D056" 16.9832 48.9374  big yellow   Ce 19
> > "D057" 16.9832 48.9374  big yellow   Ce 19
> > [...]
> > "D087" 16.6324 48.8380  big yellow   Ba 19
> > "D088" 16.6324 48.8380  big yellow   Ba 19
> > "D089" 16.9500 48.1250  big yellow   Ha 19
> > "D090" 16.9500 48.1250  big yellow   Ha 19
> > [...]
> > "D109" 42.7167 49.9500  big yellow   Po 19
> > "D110" 55.8917 37.3167  big yellow   Ka 19
> > [...]
> > I wasn't able to find how to plot also names of populations along the
> > point and some legend summarizing symbols used to label populations.
> > Could someone, please, point me to right way how to do it?
> > All the best,
> > Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Probably silly question about maps

2014-01-13 Thread Vojtěch Zeisek
Hi, Ekaphan,
yes, this is one half of what I was missing. Thank You very much! I just will 
have to tweak little bit positions of labels not to overlap the symbols. But 
it is very good hint, thank You.
All the best,
Vojtěch

Dne Po 13. ledna 2014 11:13:25 jste napsal(a):
> Hi Vojtěch,
> 
> Have you tried the function text()? I assumed that the column "char" is your
> population names.
> > plot(x=getMap(resolution="high"), xlim=c(0,60), ylim=c(35,50), asp=1,
> > lwd=2) and to plot localities
> > points(souradnice2$X.lon, souradnice2$X.lat, pch=souradnice2$symbol,
> > col=souradnice2$col, cex=2)
> 
> text(souradnice2$X.lon, souradnice2$X.lat, labels = souradnice2$char)
> 
> 
> More info here:
> 
> http://stat.ethz.ch/R-manual/R-devel/library/graphics/html/text.html
> 
> Hope this helps,
> 
> Bier
> 
> On Jan 13, 2014, at 10:14 AM, Vojtěch Zeisek  wrote:
> > Hello,
> > I have probably very silly question about maps of samples, but I'm not
> > able to figure it out. :-( I wish to generate simple map showing sampling
> > localities of sampled populations, with various symbols and colors for
> > species and other characteristics. And with labels for the point showing
> > population abbreviation and map legend explaining used symbols.
> > To generate map I use
> > plot(x=getMap(resolution="high"), xlim=c(0,60), ylim=c(35,50), asp=1,
> > lwd=2) and to plot localities
> > points(souradnice2$X.lon, souradnice2$X.lat, pch=souradnice2$symbol,
> > col=souradnice2$col, cex=2)
> > Variable „souradnice2“ contains details about localities:
> > souradnice2
> > 
> >X.lon.  X.lat. sizecol char symbol
> > 
> > "D001"  2.9000 42.9167  bigred   Fe 15
> > [...]
> > „D007“ 21. 41.1000  big   blue   He 17
> > [...]
> > "D027" 20.8000 41.1333  big   blue   Oh 17
> > [...]
> > "D053" 21.5167 41.9167  big   blue   Sk 17
> > "D054" 21.2833 41.9500  big   blue   Ma 17
> > "D055" 21.3667 41.9667  big   blue   So 17
> > "D056" 16.9832 48.9374  big yellow   Ce 19
> > "D057" 16.9832 48.9374  big yellow   Ce 19
> > [...]
> > "D087" 16.6324 48.8380  big yellow   Ba 19
> > "D088" 16.6324 48.8380  big yellow   Ba 19
> > "D089" 16.9500 48.1250  big yellow   Ha 19
> > "D090" 16.9500 48.1250  big yellow   Ha 19
> > [...]
> > "D109" 42.7167 49.9500  big yellow   Po 19
> > "D110" 55.8917 37.3167  big yellow   Ka 19
> > [...]
> > I wasn't able to find how to plot also names of populations along the
> > point and some legend summarizing symbols used to label populations.
> > Could someone, please, point me to right way how to do it?
> > All the best,
> > Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Probably silly question about maps

2014-01-13 Thread Vojtěch Zeisek
Hello,
I have probably very silly question about maps of samples, but I'm not able to 
figure it out. :-( I wish to generate simple map showing sampling localities of 
sampled populations, with various symbols and colors for species and other 
characteristics. And with labels for the point showing population abbreviation 
and map legend explaining used symbols.
To generate map I use
plot(x=getMap(resolution="high"), xlim=c(0,60), ylim=c(35,50), asp=1, lwd=2)
and to plot localities
points(souradnice2$X.lon, souradnice2$X.lat, pch=souradnice2$symbol, 
col=souradnice2$col, cex=2)
Variable „souradnice2“ contains details about localities:
souradnice2
X.lon.  X.lat. sizecol char symbol
"D001"  2.9000 42.9167  bigred   Fe 15
[...]
„D007“ 21. 41.1000  big   blue   He 17
[...]
"D027" 20.8000 41.1333  big   blue   Oh 17
[...]
"D053" 21.5167 41.9167  big   blue   Sk 17
"D054" 21.2833 41.9500  big   blue   Ma 17
"D055" 21.3667 41.9667  big   blue   So 17
"D056" 16.9832 48.9374  big yellow   Ce 19
"D057" 16.9832 48.9374  big yellow   Ce 19
[...]
"D087" 16.6324 48.8380  big yellow   Ba 19
"D088" 16.6324 48.8380  big yellow   Ba 19
"D089" 16.9500 48.1250  big yellow   Ha 19
"D090" 16.9500 48.1250  big yellow   Ha 19
[...]
"D109" 42.7167 49.9500  big yellow   Po 19
"D110" 55.8917 37.3167  big yellow   Ka 19
[...]
I wasn't able to find how to plot also names of populations along the point and 
some legend summarizing symbols used to label populations.
Could someone, please, point me to right way how to do it?
All the best,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Problems with bootstraps of NJ tree from SSRs data

2013-10-16 Thread Vojtěch Zeisek
Yes, that's it, thank You very much, Emmanuel! Sincerely, Vojtěch

Dne St 16. října 2013 14:39:28, Emmanuel Paradis napsal(a):
> Le 16/10/2013 00:20, Vojtěch Zeisek a écrit :
> > Hi, Emmanuel, thank You very much!
> > 
> > Dne Út 15. října 2013 21:45:12, Emmanuel Paradis napsal(a):
> >> Hi Vojtěch,
> >> 
> >> Le 14/10/2013 23:14, Vojtěch Zeisek a écrit :
> >>> Hello,
> >>> I know this is FAQ, but I still haven't found solution, which would work
> >>> for me... :-( I'd like to get unrooted bootstraped NJ tree. I was
> >>> looking
> >>> through discussions (incl. on this list), but proposed solutions seem
> >>> very complicated or not suitable for my data/method. Function
> >>> boot.phylo() from ape package looks promising, but it causes R to
> >>> crash...
> >>> This is my workflow:
> >>> # Read data
> >>> mydata.loci <- read.loci("mydata.txt", header=TRUE, loci.sep="\t",
> >>> allele.sep="/", col.pop=2, col.loci=4:17, row.names=1)
> >>> # Convert to genind object
> >>> mydata.genind <- loci2genind(mydata.loci)
> >>> # Compute genetic distances
> >>> mydata.dist <- dist(mydata.genind, method="euclidean", diag=TRUE,
> >>> upper=TRUE) # Do the NJ - the last command, which works
> >>> mydata.nj <- nj(mydata.dist)
> >>> # Bootstrap the tree - I see progress bar running towards 100% and when
> >>> it
> >>> reaches that value, R session crashes...
> >>> mydata.boot <- boot.phylo(mydata.nj, mydata.genind$tab, function(xx)
> >>> nj(dist(xx)), B=100)
> >> 
> >> With this command, you resample the columns of the matrix of alleles. I
> >> am not sure this is the best thing to do. I'd rather resample the matrix
> >> of loci, like this:
> >> 
> >> mydata.boot <- boot.phylo(mydata.nj, mydata.loci, function(xx)
> >> 
> >> nj(dist(loci2genind(xx))), B = 100)
> > 
> > Perfect, it works!
> 
> I suppose the problem with your previous implementation (resampling the
> matrix of alleles) is that most alleles are at low frequencies (as
> common with micro-sat data), so most bootstrap samples were not meaningful.
> 
> > And what if I'd like to make the bootstrap of population
> > tree? I then can't use mydata.loci, as the matrix has different size.  Or
> > if I'd like to bootstrap tree based on another method like UPGMA? If I
> > make tree by hclust, the object is of class hclust, not phylo (which is
> > required by boot.phylo).
> 
> For the latter, it's easy: you have to incorporate as.phylo in the
> estimation procedure. The recommended way is to build a function that
> makes the "phylo" object from the original data, something like:
> 
> f <- function(x) as.phylo(hclust(dist(loci2genind(x
> 
> Then build the tree directly using f:
> 
> mytree <- f(mydata.loci)
> 
> and do the bootstrap:
> 
> myboot <- boot.phylo(mytree, mydata.loci, f)
> 
> This way, you can modifiy f() as you want and rerun the bootstrap
> accordingly.
> 
> Best,
> 
> Emmanuel
> 
> >> Note that if you have many individuals, computing the bootstrap values
> >> may take some time (I'm working on a new code that will be faster).
> >> 
> >> HTH.
> >> 
> >> Emmanuel
> > 
> > Thank You & have a nice day!
> > Vojtěch
> > 
> >>> # Plot the tree (this works, of course)
> >>> plot(mydata.nj)
> >>> # Add bootstrap values (mydata.boot doesn't exist)
> >>> nodelabels(mydata.boot)
> >>> What do I do wrong? Is there any better way, how to calculate bootstraps
> >>> for microsatellite data?
> >>> Sincerely,
> >>> Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Problems with bootstraps of NJ tree from SSRs data

2013-10-15 Thread Vojtěch Zeisek
Hi, Emmanuel, thank You very much!

Dne Út 15. října 2013 21:45:12, Emmanuel Paradis napsal(a):
> Hi Vojtěch,
> 
> Le 14/10/2013 23:14, Vojtěch Zeisek a écrit :
> > Hello,
> > I know this is FAQ, but I still haven't found solution, which would work
> > for me... :-( I'd like to get unrooted bootstraped NJ tree. I was looking
> > through discussions (incl. on this list), but proposed solutions seem
> > very complicated or not suitable for my data/method. Function
> > boot.phylo() from ape package looks promising, but it causes R to
> > crash...
> > This is my workflow:
> > # Read data
> > mydata.loci <- read.loci("mydata.txt", header=TRUE, loci.sep="\t",
> > allele.sep="/", col.pop=2, col.loci=4:17, row.names=1)
> > # Convert to genind object
> > mydata.genind <- loci2genind(mydata.loci)
> > # Compute genetic distances
> > mydata.dist <- dist(mydata.genind, method="euclidean", diag=TRUE,
> > upper=TRUE) # Do the NJ - the last command, which works
> > mydata.nj <- nj(mydata.dist)
> > # Bootstrap the tree - I see progress bar running towards 100% and when it
> > reaches that value, R session crashes...
> > mydata.boot <- boot.phylo(mydata.nj, mydata.genind$tab, function(xx)
> > nj(dist(xx)), B=100)
> 
> With this command, you resample the columns of the matrix of alleles. I
> am not sure this is the best thing to do. I'd rather resample the matrix
> of loci, like this:
> 
> mydata.boot <- boot.phylo(mydata.nj, mydata.loci, function(xx)
>nj(dist(loci2genind(xx))), B = 100)

Perfect, it works! And what if I'd like to make the bootstrap of population 
tree? I then can't use mydata.loci, as the matrix has different size. Or if I'd 
like to bootstrap tree based on another method like UPGMA? If I make tree by 
hclust, the object is of class hclust, not phylo (which is required by 
boot.phylo).

> Note that if you have many individuals, computing the bootstrap values
> may take some time (I'm working on a new code that will be faster).
> 
> HTH.
> 
> Emmanuel

Thank You & have a nice day!
Vojtěch

> > # Plot the tree (this works, of course)
> > plot(mydata.nj)
> > # Add bootstrap values (mydata.boot doesn't exist)
> > nodelabels(mydata.boot)
> > What do I do wrong? Is there any better way, how to calculate bootstraps
> > for microsatellite data?
> > Sincerely,
> > Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Problems with bootstraps of NJ tree from SSRs data

2013-10-15 Thread Vojtěch Zeisek
Dne Po 14. října 2013 19:59:55 jste napsal(a):
> Hi,
> Why don't you use PHYLIP? There you get an unrooted tree as default and
> bootstrapping is super simple. Adam

Hi,
I do most of my analysis in R. I can also do there many trees. And the 
bootstrapping is supposed to work... Anyway, if I don't fix it, PHYLIP is next 
choice...
All the best,
Vojtěch

> On Oct 14, 2013, at 9:14 AM, Vojtěch Zeisek wrote:
> > Hello,
> > I know this is FAQ, but I still haven't found solution, which would work
> > for me... :-( I'd like to get unrooted bootstraped NJ tree. I was looking
> > through discussions (incl. on this list), but proposed solutions seem
> > very complicated or not suitable for my data/method. Function
> > boot.phylo() from ape package looks promising, but it causes R to
> > crash...
> > This is my workflow:
> > # Read data
> > mydata.loci <- read.loci("mydata.txt", header=TRUE, loci.sep="\t",
> > allele.sep="/", col.pop=2, col.loci=4:17, row.names=1)
> > # Convert to genind object
> > mydata.genind <- loci2genind(mydata.loci)
> > # Compute genetic distances
> > mydata.dist <- dist(mydata.genind, method="euclidean", diag=TRUE,
> > upper=TRUE) # Do the NJ - the last command, which works
> > mydata.nj <- nj(mydata.dist)
> > # Bootstrap the tree - I see progress bar running towards 100% and when it
> > reaches that value, R session crashes...
> > mydata.boot <- boot.phylo(mydata.nj, mydata.genind$tab, function(xx)
> > nj(dist(xx)), B=100)
> > # Plot the tree (this works, of course)
> > plot(mydata.nj)
> > # Add bootstrap values (mydata.boot doesn't exist)
> > nodelabels(mydata.boot)
> > What do I do wrong? Is there any better way, how to calculate bootstraps
> > for microsatellite data?
> > Sincerely,
> > Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Problems with bootstraps of NJ tree from SSRs data

2013-10-14 Thread Vojtěch Zeisek
Hello,
I know this is FAQ, but I still haven't found solution, which would work for 
me... :-( I'd like to get unrooted bootstraped NJ tree. I was looking through 
discussions (incl. on this list), but proposed solutions seem very complicated 
or not suitable for my data/method. Function boot.phylo() from ape package 
looks promising, but it causes R to crash...
This is my workflow:
# Read data
mydata.loci <- read.loci("mydata.txt", header=TRUE, loci.sep="\t", 
allele.sep="/", col.pop=2, col.loci=4:17, row.names=1)
# Convert to genind object
mydata.genind <- loci2genind(mydata.loci)
# Compute genetic distances
mydata.dist <- dist(mydata.genind, method="euclidean", diag=TRUE, upper=TRUE)
# Do the NJ - the last command, which works
mydata.nj <- nj(mydata.dist)
# Bootstrap the tree - I see progress bar running towards 100% and when it 
reaches that value, R session crashes...
mydata.boot <- boot.phylo(mydata.nj, mydata.genind$tab, function(xx) 
nj(dist(xx)), B=100)
# Plot the tree (this works, of course)
plot(mydata.nj)
# Add bootstrap values (mydata.boot doesn't exist)
nodelabels(mydata.boot)
What do I do wrong? Is there any better way, how to calculate bootstraps for 
microsatellite data?
Sincerely,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] PCoA with custom distance matrix

2013-06-10 Thread Vojtěch Zeisek
Hello

Dne Po 10. června 2013 14:26:41 jste napsal(a):
> Hello, 
> 
> dist.genpop is a re-implementation of dist.genet - all material for genetics
> in ade4 should be deprecated by now, as it has been transfered into
> adegenet or adephylo a few years ago already.

OK, I see. So can I use dist.genpop() also for genind objects?

> I do not know about a package implementing Goldstein's distance. 
> 
> As for your question, you are right: adding a constant to a set of distances
> to make them Euclidean alters the geometry of the cloud of points, and is
> thus not very satisfying. This said, especially when it comes to individual
> microsatellite data, I have yet to see a fancy distance do more than the
> basic Euclidean distance in a PCoA, which in this case is also a PCA. The
> advantage of PCA is that it will also give you allele loadings which can be
> biologically meaningful. Not to say you should stick to it, but it is
> probably a good start to look at your data.

PCA and PCoA using distance generated by dist() give me more or less same 
results. I really wonder how this problem was solved in old Syntax (Podani, 
2000), which was calculating PCA/PCoA from any distance. ;-)
For now I don't see any enough good solution, but I at least understand it 
more. :-)

> Cheers
> Thibaut

Have a nice day,
Vojtěch

> 
> From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org]
> on behalf of Vojtěch Zeisek [vojtech.zei...@opensuse.org]
> Sent: 10 June
> 2013 14:59
> To: r-sig-phylo@r-project.org
> Subject: Re: [R-sig-phylo] PCoA with custom distance matrix
> 
> Hello,
> thank You very much for Your reply. I'm sftill little confused.
> 
> Dne Pá 7. června 2013 16:03:13 jste napsal(a):
> 
> > Hello there,
> >
> >
> >
> > you could have done the PCoA on Chord's distance using adegenet, it would
> > have probably been simpler (see the vignette adegenet-basics, section 6
> > "Multivariate Analysis“).
> 
> 
> Function dist.genpop() contains Nei's distance, but man pages says it is
> only for genpop objects (I wish to analyse individuals, not populations).
> I imported the data using read.loci() and converted it to genind using
> loci2genind(). I found also function dist.genet() from ade4 package, but it
> requires genet object. So far I didn't find straightforward way to convert
> my data to it. And I haven't find any function providing the Goldstein's
> distance. 
> 
> > 'dist' is the canonical Euclidean distance, but dudi.pco will accept any
> > Euclidean distance. You can use "cailliez" in ade4 to make your distance
> > Euclidean before the PCoA.
> 
> 
> I'm not mathematician, so I don't understand one point. Let's say I have
> non-Euclidean distance matrix and some individuals (e.g. from same
> population) have zero distance (they are identical). When I use cailliez(),
> I have two possibilities (parameter cor.zero):
> 1) to add the constant also to zero-length distances, so that the shift is
> everywhere same. But as the result, the distance between originally
> identical objects is positive, so they will be treated as different in
> ongoing analysis, right?; or
> 2) keep zero-length distances, so that those objects stay identical, but
> their distances from another objects change, so the further analysis are
> biased again, right?
> Is there any solution? Or am I wrong?
> 
> 
> > Cheers
> > Thibaut
> 
> 
> Sincerely,
> Vojtěch
> 
> 
> > --
> > ##
> > Dr Thibaut JOMBART
> > MRC Centre for Outbreak Analysis and Modelling
> > Department of Infectious Disease Epidemiology
> > Imperial College - School of Public Health
> > St Mary’s Campus
> > Norfolk Place
> > London W2 1PG
> > United Kingdom
> > Tel. : 0044 (0)20 7594 3658
> > t.jomb...@imperial.ac.uk
> > http://sites.google.com/site/thibautjombart/
> > http://adegenet.r-forge.r-project.org/
> > 
> > From: r-sig-phylo-boun...@r-project.org
> > [r-sig-phylo-boun...@r-project.org]
> > on behalf of Vojtěch Zeisek
> > [vojtech.zei...@opensuse.org]
> > Sent: 07 June
> > 2013 15:46
> > To: mailinglist R
> > Subject: [R-sig-phylo] PCoA with custom distance matrix
> >
> >
> >
> > Hello,
> > I have microsatellite data and I would like to analyze them using PCoA in
> > R. I would like to use following genetic distance: Goldstein's (1995)
> > (dμ)2 and Nei's chord distance (1983). I calculated those distances in
&

Re: [R-sig-phylo] PCoA with custom distance matrix

2013-06-10 Thread Vojtěch Zeisek
Hello,
thank You very much for Your reply. I'm still little confused.

Dne Pá 7. června 2013 16:03:13 jste napsal(a):
> Hello there, 
> 
> you could have done the PCoA on Chord's distance using adegenet, it would
> have probably been simpler (see the vignette adegenet-basics, section 6
> "Multivariate Analysis“).

Function dist.genpop() contains Nei's distance, but man pages says it is only 
for genpop objects (I wish to analyse individuals, not populations). I 
imported the data using read.loci() and converted it to genind using 
loci2genind(). I found also function dist.genet() from ade4 package, but it 
requires genet object. So far I didn't find straightforward way to convert my 
data to it. And I haven't find any function providing the Goldstein's distance.

> 'dist' is the canonical Euclidean distance, but dudi.pco will accept any
> Euclidean distance. You can use "cailliez" in ade4 to make your distance
> Euclidean before the PCoA.

I'm not mathematician, so I don't understand one point. Let's say I have non-
Euclidean distance matrix and some individuals (e.g. from same population) 
have zero distance (they are identical). When I use cailliez(), I have two 
possibilities (parameter cor.zero):
1) to add the constant also to zero-length distances, so that the shift is 
everywhere same. But as the result, the distance between originally identical 
objects is positive, so they will be treated as different in ongoing analysis, 
right?; or
2) keep zero-length distances, so that those objects stay identical, but their 
distances from another objects change, so the further analysis are biased 
again, right?
Is there any solution? Or am I wrong?

> Cheers
> Thibaut

Sincerely,
Vojtěch

> --
> ##
> Dr Thibaut JOMBART
> MRC Centre for Outbreak Analysis and Modelling
> Department of Infectious Disease Epidemiology
> Imperial College - School of Public Health
> St Mary’s Campus
> Norfolk Place
> London W2 1PG
> United Kingdom
> Tel. : 0044 (0)20 7594 3658
> t.jomb...@imperial.ac.uk
> http://sites.google.com/site/thibautjombart/
> http://adegenet.r-forge.r-project.org/
> ____
> From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org]
> on behalf of Vojtěch Zeisek [vojtech.zei...@opensuse.org]
> Sent: 07 June
> 2013 15:46
> To: mailinglist R
> Subject: [R-sig-phylo] PCoA with custom distance matrix
> 
> Hello,
> I have microsatellite data and I would like to analyze them using PCoA in R.
> I would like to use following genetic distance: Goldstein's (1995) (dμ)2
> and Nei's chord distance (1983). I calculated those distances in MSA
> (Dieringer and Schlötterer 2003), because I didn't find any possibility to
> calculate them in R. I imported the distances like that:
> dist.dms <- read.csv("dms_ind.txt", header=TRUE, sep="\t", dec=".",
> row.names=1)
> dioszegia.dist.dms <- as.dist(dioszegia.dist.dms)
> class(dioszegia.dist.dms)
> [1] "dist“
> dms_ind.txt is ordinary square matrix with diagonal.
> But using of dudi.pco() from ade4 package fails:
> pcoa <- dudi.pco(dist.dms, scannf=FALSE, nf=3)
> Warning message:
> In dudi.pco(dioszegia.dist.dms, scannf = FALSE, nf = 3) :
>   Non euclidean distance
> When using Euclidean distance (function dist()), it works fine. It produces
> some results despite the above error, but the results are very far from
> those I get using dist() function. And the results don't look realistic.
> What do I do wrong? :-)
> Have a nice day!
> Vojtěch
-- 
Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux

http://www.opensuse.org/
http://trapa.cz/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Problems with Bioconductor

2013-06-07 Thread Vojtěch Zeisek
Hello,
I use Rkward, http://rkward.sourceforge.net/ great R GUI. It allows me to set 
under Settings | R packages various sources of packages. I set CRAN (mirror in 
Austria), http://rkward.sf.net/R/ and http://www.rforge.net/ I also use 
Bioconductor, http://www.bioconductor.org/ Instead of use of its function 
biocLite() it would be more comfortable to add is as another source for 
Rkward, so I could manage all packages from various sources on one place. So I 
added mirror http://bioconductor.statistik.tu-dortmund.de/, but when I open 
Rkward package manager, I get error
Warning: unable to access index for repository 
http://bioconductor.statistik.tu-dortmund.de/src/contrib
and installation fails. Same error I get with bioconductor.org
Any idea how to set it correctly?
Have a nice day!
Vojtěch

-- 
Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux

http://www.opensuse.org/
http://trapa.cz/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] PCoA with custom distance matrix

2013-06-07 Thread Vojtěch Zeisek
Hello,
I have microsatellite data and I would like to analyze them using PCoA in R. I 
would like to use following genetic distance: Goldstein's (1995) (dμ)2 and 
Nei's chord distance (1983). I calculated those distances in MSA (Dieringer 
and Schlötterer 2003), because I didn't find any possibility to calculate them 
in R. I imported the distances like that:
dist.dms <- read.csv("dms_ind.txt", header=TRUE, sep="\t", dec=".", 
row.names=1)
dioszegia.dist.dms <- as.dist(dioszegia.dist.dms)
class(dioszegia.dist.dms)
[1] "dist“
dms_ind.txt is ordinary square matrix with diagonal.
But using of dudi.pco() from ade4 package fails:
pcoa <- dudi.pco(dist.dms, scannf=FALSE, nf=3)
Warning message:
In dudi.pco(dioszegia.dist.dms, scannf = FALSE, nf = 3) :
  Non euclidean distance
When using Euclidean distance (function dist()), it works fine. It produces 
some results despite the above error, but the results are very far from those 
I get using dist() function. And the results don't look realistic.
What do I do wrong? :-)
Have a nice day!
Vojtěch

-- 
Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux

http://www.opensuse.org/
http://trapa.cz/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] R & Arlequin (little OT?)

2013-03-18 Thread Vojtěch Zeisek
Hello,
I hope this is not too much off-topic for this list. I'm using Arlequin 3.5
http://cmpg.unibe.ch/software/arlequin35/ (actually, Linux version of
Arlecore) and I'd like to parse Arelquin's output through R as described in
the manual, but I get error about missing function
xmlTreeParse, so nothing is computed:

source("/home/vojta/bin/arlecore_linux/Rfunctions/rParsingSettings.r")
Error in library(XML, lib.loc = paste(substr(sourcePath, 0, nchar(sourcePath)
-  :
  no library trees found in 'lib.loc'
Error in library(XML, lib.loc = paste(substr(sourcePath, 0, nchar(sourcePath)
-  :
  no library trees found in 'lib.loc'
Error in parseArlequin(infile, outfiles, sourcePath) :
  could not find function "xmlTreeParse"

So it seems the xmlTreeParse is missing. Or am I doing something very wrong?
Does anyone have any experience with this? :-)
All the best,
Vojtěch

--
Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux

http://www.opensuse.org/
http://trapa.cz/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Microsatellites

2012-11-07 Thread Vojtěch Zeisek
Dne St 7. listopadu 2012 16:38:03 jste napsal(a):
> ps: I forgot to mention documentation; for adegenet, see the adegenet
> website: http://adegenet.r-forge.r-project.org/

Thank You very much!
All the best!
Vojtěch

> 
> From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org]
> on behalf of Vojtěch Zeisek [vojtech.zei...@opensuse.org] Sent: 07 November
> 2012 15:37
> To: mailinglist R
> Subject: [R-sig-phylo] Microsatellites
>
> Hello,
> could someone, please, point me to some manual, where I can learn how to
> work with microsatellite data in R. I have big matrix of individuals and
> lengths of respective alleles and I'd like to count genetic distances among
> individuals, AMOVA, visualize data using PCoA, perform Bayesian clustering,
> count correlation of genetic and geographical distance and so on.
> Thank You in advance!
> All the best,
> Vojtěch
--
Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux

http://www.opensuse.org/
http://trapa.cz/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] Microsatellites

2012-11-07 Thread Vojtěch Zeisek
Hello,
could someone, please, point me to some manual, where I can learn how to work
with microsatellite data in R. I have big matrix of individuals and lengths of
respective alleles and I'd like to count genetic distances among individuals,
AMOVA, visualize data using PCoA, perform Bayesian clustering, count
correlation of genetic and geographical distance and so on.
Thank You in advance!
All the best,
Vojtěch

--
Vojtěch Zeisek

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux

http://www.opensuse.org/
http://trapa.cz/


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo