Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-08 Thread Jacob Berv
AFAIK almost any modern browser can render SVG natively - this is not the case 
for PDF, which will often require a plug-in from adobe.
I don’t think I’ve seen this before, but you could probably generate 
web-friendly vector tree figures using SVG - there are options to explore this 
in adobe illustrator if you have it. 

Jake


> On Mar 8, 2015, at 12:06 PM, Jonas Eberle  wrote:
> 
> Hi Eike,
> 
> I didn't intend to print the tree. I think a pdf is the most convenient
> format for publishing since nearly everybody can easily open it on every
> operating system and it always looks the same. I've never tried to open a
> large tree in an svg in a browser. Maybe that's fine, too.
> 
> All the best,
> Jonas
> 
>   [[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/

Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology

___
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] multipage pdf of a huge tree

2015-03-08 Thread Jonas Eberle
Hi Eike,

I didn't intend to print the tree. I think a pdf is the most convenient
format for publishing since nearly everybody can easily open it on every
operating system and it always looks the same. I've never tried to open a
large tree in an svg in a browser. Maybe that's fine, too.

All the best,
Jonas

[[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/


Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-06 Thread Eike Mayland-Quellhorst

Hi Jonas,

I am still curious, why you are trying to print your tree. For me the 
best useful praxis to look at huge (not as huge as yours) phylogenies is 
with an svg file --> this is viewable (and scalable) in any Webbrowser 
and you can manipulate easily with inkscape. To export it just use 
'RSvgDevice' or 'cairoDevice'.


Best
Eike Mayland-Quellhorst

--
__
 Eike Mayland-Quellhorst
  AG Biodiversität und Evolution der Pflanzen
  Fakultät V - IBU
  Carl von Ossietzky Universität Oldenburg

  Carl-von-Ossietzky Str. 9-11
  26111 Oldenburg
  Germany

  Tel. 0049-441-798-3386

Am 06.03.2015 um 12:00 schrieb r-sig-phylo-requ...@r-project.org:

Send R-sig-phylo mailing list submissions to
r-sig-phylo@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
or, via email, send a message with subject or body 'help' to
r-sig-phylo-requ...@r-project.org

You can reach the person managing the list at
r-sig-phylo-ow...@r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-sig-phylo digest..."


Today's Topics:

1. Re: multipage pdf of a huge tree (Joe Felsenstein)
2. Re: multipage pdf of a huge tree (Jonas Eberle)
3. Re: multipage pdf of a huge tree (Joe Felsenstein)
4. Re: multipage pdf of a huge tree (Bret Larget)
5. Re: Stuck with Phylomatic tree! (Alexandre F. Souza)
6. Re: multipage pdf of a huge tree (Liam J. Revell)
7. Re: multipage pdf of a huge tree (Jonas Eberle)
8. Re: multipage pdf of a huge tree (Jacob Berv)
9. Re: multipage pdf of a huge tree (Liam J. Revell)
   10. Re: multipage pdf of a huge tree (Jacob Berv)
   11. Re: multipage pdf of a huge tree (Jacob Berv)
   12. Node Ages Without Phylocom (Alexandre F. Souza)
   13. determine multistate characters in nexus data matrix (Paolo Piras)
   14. Re: Node Ages Without Phylocom (Marcelino de la Cruz)


--

Message: 1
Date: Thu, 5 Mar 2015 03:41:38 -0800
From: Joe Felsenstein 
To: Jonas Eberle 
Cc: "r-sig-phylo@r-project.org" 
Subject: Re: [R-sig-phylo] multipage pdf of a huge tree
Message-ID:

Content-Type: text/plain; charset="UTF-8"

Jonas Eberle wrote:


> thanks a lot! I didn't knew splitplotTree yet. Great function!
However, my
> tree has several thousands of tips (yes, it's a bit crazy but
unfortunately
> necessary...) and I guess it's only possible to split it on two
pages with
> splitplotTree. Or am I missing something?
>

It's not in R (unless available through Liam Revell's "phytools" package),
but in PHYLIP the tree-drawing programs Drawgram and Drawtree have the
capability of splitting a plot into a rectangular array of plots, and
putting these out onto separate files (not PDFs, but Postscript is
possible).

This was intended to help people make large posters using printers
that can
only do a single page.

However ...

I do not see why this is necessary.  Most tree-drawing programs should be
able to write a file that has the large tree plotted on it.  If you don't
want to print the resulting tree on paper, it would then be possible to
view the tree in an application such as Adobe Acrobat Reader and zoom
in on
it and see the tiny branches and their labels.  Making multiple plots for
one tree would probably confuse the matter.

Or is there something I am missing here?

J.F.

Joe Felsenstein j...@gs.washington.edu
  Department of Genome Sciences and Department of Biology,
  University of Washington, Box 355065, Seattle, WA 98195-5065 USA

[[alternative HTML version deleted]]



--

Message: 2
Date: Thu, 5 Mar 2015 13:24:35 +0100
From: Jonas Eberle 
To: Joe Felsenstein 
Cc: "r-sig-phylo@r-project.org" 
Subject: Re: [R-sig-phylo] multipage pdf of a huge tree
Message-ID:

Content-Type: text/plain; charset="UTF-8"

Dear Joe,

thank you for your answer! Actually, I used to make large size pdfs with a
tiny font size in these cases. It is then even possible to print this
single-page-pdf on multiple pages in Acrobat Reader. The problem was that
my current tree is really huge - with about 23000 tips. This took me
to the
limits of this approach, since pdf size is limited to 200 inch by
Adobe and
there also seems to be a lower limit for font size in pdfs (at least
during
export form R?).

I didn't knew that Drawtree is able to split the tree over multiple pages.
I guess this is an option in the command line version? I will check that
out. In the mean time I found a way to do the job in R (see my post
before)
that seems to produce reasonable results.

Thank you very much again for your efforts!

Regards,
Jonas

--
Jonas Eberle
PhD student


2015-03-05 12:41 GMT+01:00 Joe Felsenstein :


Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-05 Thread Jacob Berv
OK - Actually I spoke too soon. That does work for nodelabels() and axis(), but 
it does not work for the axisGeo function in phyloch - this only appears at the 
bottom of the second half of the split plot when I split my tree in 1/2. Is 
there an easy fix to get it to appear on both 1/2s? 


>> axisGeo(GTS = strat2012, unit = c("epoch", "period"), cex = 0.7, col = 
>> c("grey80", "white"), texcol = "black", gridty = 2, gridcol = "red", 
>> ages=TRUE)


Jake


> On Mar 5, 2015, at 2:55 PM, Liam J. Revell  wrote:
> 
> Hi Jacob.
> 
> This is surprising easy. Check out the solution here: 
> http://blog.phytools.org/2015/03/splitting-tree-across-multiple-pages.html.
> 
> You may find that, as in this example, some things like node & edge labels 
> are split across pages - in which case you can fiddle with the split 
> positions & replot the tree until it is the way you want it.
> 
> All the best, 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 3/5/2015 2:24 PM, Jacob Berv wrote:
>> Hi Liam,
>> 
>> Would there be a way to modify this so that annotations like node labels and 
>> axes could be applied to both 1/2s of a split tree at the same time? I’ve 
>> been struggling with a similar problem using plot.phylo() and we can get our 
>> tree to look like what we want on one page, but splitting it up while 
>> keeping node and branch annotations etc is problematic.
>> 
>> For example, I am trying to plot a tree and annotate with the following 
>> function calls.
>> 
>> #from ape
>> plot.phylo(timetree, cex=0.315, label.offset=0.35, edge.width=1.25, 
>> edge.color=color)
>> 
>> #from phyloch - adds a geologic time scale
>> axisGeo(GTS = strat2012, unit = c("epoch", "period"), cex = 0.7, col = 
>> c("grey80", "white"), texcol = "black", gridty = 2, gridcol = "red", 
>> ages=TRUE)
>> 
>> #then additional annotations with:
>> nodelabels()
>> axis()
>> 
>> I want to cut my tree in 1/2 and plot each 1/2 on a separate page, but 
>> maintain the axes and annotations. Splitting a tree is great but it’s not 
>> super useful unless you can call other functions on the pieces. It would be 
>> great to be able to generate axes for each piece of a split tree 
>> independently and then annotate each one as if they were a separate plot.
>> 
>> Jake
>> 
>> 
>> 
>>> On Mar 5, 2015, at 11:46 AM, Jonas Eberle  wrote:
>>> 
>>> Hi Liam,
>>> 
>>> perfect! Your right, I didn't realize that some species were duplicated.
>>> Great to have the option in phytools!
>>> 
>>> All the best,
>>> Jonas
>>> 
>>> 
>>> 2015-03-05 17:16 GMT+01:00 Liam J. Revell :
>>> 
 Hi Jonas.
 
 I thought of the same thing. Unfortunately, one thing that I discovered is
 that because R automatically adds 4% or so to the plotting range, you will
 find that species & edges near the bottom of one page will also appear at
 the top of the next page. If you test your code & look for species or edges
 near the bottom or top of each page, you may find what I did.
 
 I have posted a solution to this here: http://blog.phytools.org/2015/
 03/splitting-tree-over-mutiple-plotting.html. It uses plotTree from
 phytools internally, but it could fairly easily be modified to use other
 tree plotters such as plot.phylo or plotSimmap.
 
 All the best, 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 3/5/2015 5:19 AM, Jonas Eberle wrote:
 
> MultipagePhyloPlot <- function (tree, npages = 5) {
>   ntips <- length(tree$tip.label)
>   tips.per.page <- ntips / npages
>   y1 <- ntips - tips.per.page
>   y2 <- ntips
>   for (i in 1:npages) {
> plot.phylo(tree, y.lim = c(y1, y2))
> y1 <- y1 - tips.per.page
> y2 <- y2 - tips.per.page
>   }
> }
> 
 
>>> 
>>> [[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/
>> 
>> Jacob Berv
>> 
>> Ph.D. Student
>> Lovette Lab
>> Cornell Laboratory of Ornithology
>> 

___
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] multipage pdf of a huge tree

2015-03-05 Thread Jacob Berv
Mind=Blown. 

Amazing. Thank you. 

Jake

> On Mar 5, 2015, at 2:55 PM, Liam J. Revell  wrote:
> 
> Hi Jacob.
> 
> This is surprising easy. Check out the solution here: 
> http://blog.phytools.org/2015/03/splitting-tree-across-multiple-pages.html.
> 
> You may find that, as in this example, some things like node & edge labels 
> are split across pages - in which case you can fiddle with the split 
> positions & replot the tree until it is the way you want it.
> 
> All the best, 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 3/5/2015 2:24 PM, Jacob Berv wrote:
>> Hi Liam,
>> 
>> Would there be a way to modify this so that annotations like node labels and 
>> axes could be applied to both 1/2s of a split tree at the same time? I’ve 
>> been struggling with a similar problem using plot.phylo() and we can get our 
>> tree to look like what we want on one page, but splitting it up while 
>> keeping node and branch annotations etc is problematic.
>> 
>> For example, I am trying to plot a tree and annotate with the following 
>> function calls.
>> 
>> #from ape
>> plot.phylo(timetree, cex=0.315, label.offset=0.35, edge.width=1.25, 
>> edge.color=color)
>> 
>> #from phyloch - adds a geologic time scale
>> axisGeo(GTS = strat2012, unit = c("epoch", "period"), cex = 0.7, col = 
>> c("grey80", "white"), texcol = "black", gridty = 2, gridcol = "red", 
>> ages=TRUE)
>> 
>> #then additional annotations with:
>> nodelabels()
>> axis()
>> 
>> I want to cut my tree in 1/2 and plot each 1/2 on a separate page, but 
>> maintain the axes and annotations. Splitting a tree is great but it’s not 
>> super useful unless you can call other functions on the pieces. It would be 
>> great to be able to generate axes for each piece of a split tree 
>> independently and then annotate each one as if they were a separate plot.
>> 
>> Jake
>> 
>> 
>> 
>>> On Mar 5, 2015, at 11:46 AM, Jonas Eberle  wrote:
>>> 
>>> Hi Liam,
>>> 
>>> perfect! Your right, I didn't realize that some species were duplicated.
>>> Great to have the option in phytools!
>>> 
>>> All the best,
>>> Jonas
>>> 
>>> 
>>> 2015-03-05 17:16 GMT+01:00 Liam J. Revell :
>>> 
 Hi Jonas.
 
 I thought of the same thing. Unfortunately, one thing that I discovered is
 that because R automatically adds 4% or so to the plotting range, you will
 find that species & edges near the bottom of one page will also appear at
 the top of the next page. If you test your code & look for species or edges
 near the bottom or top of each page, you may find what I did.
 
 I have posted a solution to this here: http://blog.phytools.org/2015/
 03/splitting-tree-over-mutiple-plotting.html. It uses plotTree from
 phytools internally, but it could fairly easily be modified to use other
 tree plotters such as plot.phylo or plotSimmap.
 
 All the best, 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 3/5/2015 5:19 AM, Jonas Eberle wrote:
 
> MultipagePhyloPlot <- function (tree, npages = 5) {
>   ntips <- length(tree$tip.label)
>   tips.per.page <- ntips / npages
>   y1 <- ntips - tips.per.page
>   y2 <- ntips
>   for (i in 1:npages) {
> plot.phylo(tree, y.lim = c(y1, y2))
> y1 <- y1 - tips.per.page
> y2 <- y2 - tips.per.page
>   }
> }
> 
 
>>> 
>>> [[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/
>> 
>> Jacob Berv
>> 
>> Ph.D. Student
>> Lovette Lab
>> Cornell Laboratory of Ornithology
>> 

Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology

___
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] multipage pdf of a huge tree

2015-03-05 Thread Liam J. Revell

Hi Jacob.

This is surprising easy. Check out the solution here: 
http://blog.phytools.org/2015/03/splitting-tree-across-multiple-pages.html.


You may find that, as in this example, some things like node & edge 
labels are split across pages - in which case you can fiddle with the 
split positions & replot the tree until it is the way you want it.


All the best, 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 3/5/2015 2:24 PM, Jacob Berv wrote:

Hi Liam,

Would there be a way to modify this so that annotations like node labels and 
axes could be applied to both 1/2s of a split tree at the same time? I’ve been 
struggling with a similar problem using plot.phylo() and we can get our tree to 
look like what we want on one page, but splitting it up while keeping node and 
branch annotations etc is problematic.

For example, I am trying to plot a tree and annotate with the following 
function calls.

#from ape
plot.phylo(timetree, cex=0.315, label.offset=0.35, edge.width=1.25, 
edge.color=color)

#from phyloch - adds a geologic time scale
axisGeo(GTS = strat2012, unit = c("epoch", "period"), cex = 0.7, col = c("grey80", "white"), texcol 
= "black", gridty = 2, gridcol = "red", ages=TRUE)

#then additional annotations with:
nodelabels()
axis()

I want to cut my tree in 1/2 and plot each 1/2 on a separate page, but maintain 
the axes and annotations. Splitting a tree is great but it’s not super useful 
unless you can call other functions on the pieces. It would be great to be able 
to generate axes for each piece of a split tree independently and then annotate 
each one as if they were a separate plot.

Jake




On Mar 5, 2015, at 11:46 AM, Jonas Eberle  wrote:

Hi Liam,

perfect! Your right, I didn't realize that some species were duplicated.
Great to have the option in phytools!

All the best,
Jonas


2015-03-05 17:16 GMT+01:00 Liam J. Revell :


Hi Jonas.

I thought of the same thing. Unfortunately, one thing that I discovered is
that because R automatically adds 4% or so to the plotting range, you will
find that species & edges near the bottom of one page will also appear at
the top of the next page. If you test your code & look for species or edges
near the bottom or top of each page, you may find what I did.

I have posted a solution to this here: http://blog.phytools.org/2015/
03/splitting-tree-over-mutiple-plotting.html. It uses plotTree from
phytools internally, but it could fairly easily be modified to use other
tree plotters such as plot.phylo or plotSimmap.

All the best, 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 3/5/2015 5:19 AM, Jonas Eberle wrote:


MultipagePhyloPlot <- function (tree, npages = 5) {
   ntips <- length(tree$tip.label)
   tips.per.page <- ntips / npages
   y1 <- ntips - tips.per.page
   y2 <- ntips
   for (i in 1:npages) {
 plot.phylo(tree, y.lim = c(y1, y2))
 y1 <- y1 - tips.per.page
 y2 <- y2 - tips.per.page
   }
}





[[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/


Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology



___
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] multipage pdf of a huge tree

2015-03-05 Thread Jacob Berv
Hi Liam,

Would there be a way to modify this so that annotations like node labels and 
axes could be applied to both 1/2s of a split tree at the same time? I’ve been 
struggling with a similar problem using plot.phylo() and we can get our tree to 
look like what we want on one page, but splitting it up while keeping node and 
branch annotations etc is problematic.

For example, I am trying to plot a tree and annotate with the following 
function calls. 

#from ape
plot.phylo(timetree, cex=0.315, label.offset=0.35, edge.width=1.25, 
edge.color=color)

#from phyloch - adds a geologic time scale
axisGeo(GTS = strat2012, unit = c("epoch", "period"), cex = 0.7, col = 
c("grey80", "white"), texcol = "black", gridty = 2, gridcol = "red", ages=TRUE)

#then additional annotations with:
nodelabels()
axis()

I want to cut my tree in 1/2 and plot each 1/2 on a separate page, but maintain 
the axes and annotations. Splitting a tree is great but it’s not super useful 
unless you can call other functions on the pieces. It would be great to be able 
to generate axes for each piece of a split tree independently and then annotate 
each one as if they were a separate plot.

Jake



> On Mar 5, 2015, at 11:46 AM, Jonas Eberle  wrote:
> 
> Hi Liam,
> 
> perfect! Your right, I didn't realize that some species were duplicated.
> Great to have the option in phytools!
> 
> All the best,
> Jonas
> 
> 
> 2015-03-05 17:16 GMT+01:00 Liam J. Revell :
> 
>> Hi Jonas.
>> 
>> I thought of the same thing. Unfortunately, one thing that I discovered is
>> that because R automatically adds 4% or so to the plotting range, you will
>> find that species & edges near the bottom of one page will also appear at
>> the top of the next page. If you test your code & look for species or edges
>> near the bottom or top of each page, you may find what I did.
>> 
>> I have posted a solution to this here: http://blog.phytools.org/2015/
>> 03/splitting-tree-over-mutiple-plotting.html. It uses plotTree from
>> phytools internally, but it could fairly easily be modified to use other
>> tree plotters such as plot.phylo or plotSimmap.
>> 
>> All the best, 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 3/5/2015 5:19 AM, Jonas Eberle wrote:
>> 
>>> MultipagePhyloPlot <- function (tree, npages = 5) {
>>>   ntips <- length(tree$tip.label)
>>>   tips.per.page <- ntips / npages
>>>   y1 <- ntips - tips.per.page
>>>   y2 <- ntips
>>>   for (i in 1:npages) {
>>> plot.phylo(tree, y.lim = c(y1, y2))
>>> y1 <- y1 - tips.per.page
>>> y2 <- y2 - tips.per.page
>>>   }
>>> }
>>> 
>> 
> 
>   [[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/

Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology

___
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] multipage pdf of a huge tree

2015-03-05 Thread Jonas Eberle
Hi Liam,

perfect! Your right, I didn't realize that some species were duplicated.
Great to have the option in phytools!

All the best,
Jonas


2015-03-05 17:16 GMT+01:00 Liam J. Revell :

> Hi Jonas.
>
> I thought of the same thing. Unfortunately, one thing that I discovered is
> that because R automatically adds 4% or so to the plotting range, you will
> find that species & edges near the bottom of one page will also appear at
> the top of the next page. If you test your code & look for species or edges
> near the bottom or top of each page, you may find what I did.
>
> I have posted a solution to this here: http://blog.phytools.org/2015/
> 03/splitting-tree-over-mutiple-plotting.html. It uses plotTree from
> phytools internally, but it could fairly easily be modified to use other
> tree plotters such as plot.phylo or plotSimmap.
>
> All the best, 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 3/5/2015 5:19 AM, Jonas Eberle wrote:
>
>> MultipagePhyloPlot <- function (tree, npages = 5) {
>>ntips <- length(tree$tip.label)
>>tips.per.page <- ntips / npages
>>y1 <- ntips - tips.per.page
>>y2 <- ntips
>>for (i in 1:npages) {
>>  plot.phylo(tree, y.lim = c(y1, y2))
>>  y1 <- y1 - tips.per.page
>>  y2 <- y2 - tips.per.page
>>}
>> }
>>
>

[[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/


Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-05 Thread Liam J. Revell

Hi Jonas.

I thought of the same thing. Unfortunately, one thing that I discovered 
is that because R automatically adds 4% or so to the plotting range, you 
will find that species & edges near the bottom of one page will also 
appear at the top of the next page. If you test your code & look for 
species or edges near the bottom or top of each page, you may find what 
I did.


I have posted a solution to this here: 
http://blog.phytools.org/2015/03/splitting-tree-over-mutiple-plotting.html. 
It uses plotTree from phytools internally, but it could fairly easily be 
modified to use other tree plotters such as plot.phylo or plotSimmap.


All the best, 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 3/5/2015 5:19 AM, Jonas Eberle wrote:

MultipagePhyloPlot <- function (tree, npages = 5) {
   ntips <- length(tree$tip.label)
   tips.per.page <- ntips / npages
   y1 <- ntips - tips.per.page
   y2 <- ntips
   for (i in 1:npages) {
 plot.phylo(tree, y.lim = c(y1, y2))
 y1 <- y1 - tips.per.page
 y2 <- y2 - tips.per.page
   }
}


___
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] multipage pdf of a huge tree

2015-03-05 Thread Bret Larget

One way to print a tree on multiple pages:

In R, use the pdf() function and set the height of the page to be very 
large (say 110 inches if you want to print your tree on ten pages). 
Print the tree to the pdf file. Call dev.off() to close the pdf file. 
Then, when you print the tree with whatever you use, the printing 
program will print on multiple pages. Open the tree first before 
printing to preview to see if you have adequate space between taxa and 
adjust the height as needed. The page breaks may not be great and each 
page will have top and bottom margins, but will a scissors and tape, you 
can get an okay large single picture.


I imagine, however, that a better way to visualize such a large tree 
would be to employ some hierarchy. The first page could show the root 
and enough of the tree to show a reasonable number of clades that can 
seen easily on a single page. Then each clade could be represented by 
its own rooted tree; if any single one is too big for a single page, 
then recurse.


-Bret Larget

___
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] multipage pdf of a huge tree

2015-03-05 Thread Joe Felsenstein
Jonas Eberle --


> thank you for your answer! Actually, I used to make large size pdfs with a
> tiny font size in these cases. It is then even possible to print this
> single-page-pdf on multiple pages in Acrobat Reader. The problem was that
> my current tree is really huge - with about 23000 tips. This took me to the
> limits of this approach, since pdf size is limited to 200 inch by Adobe and
> there also seems to be a lower limit for font size in pdfs (at least during
> export form R?).
>
> I didn't knew that Drawtree is able to split the tree over multiple pages.
> I guess this is an option in the command line version? I will check that
> out. In the mean time I found a way to do the job in R (see my post before)
> that seems to produce reasonable results.
>
>
PHYLIP programs do not enter settings on the command-line.  They have a
menu.  The Drawgram and Drawtree programs have a choice that gives a
submenu in which multiple pages can be selected. This submenu is not
available in the GUI (Java front end) version of those programs, but is
available in the character-mode menu that appears if the program is run
from the command line.  It is the selection made by typing the character
 "#".

J.F.

Joe Felsenstein j...@gs.washington.edu
 Department of Genome Sciences and Department of Biology,
 University of Washington, Box 355065, Seattle, WA 98195-5065 USA

[[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/


Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-05 Thread Jonas Eberle
Dear Joe,

thank you for your answer! Actually, I used to make large size pdfs with a
tiny font size in these cases. It is then even possible to print this
single-page-pdf on multiple pages in Acrobat Reader. The problem was that
my current tree is really huge - with about 23000 tips. This took me to the
limits of this approach, since pdf size is limited to 200 inch by Adobe and
there also seems to be a lower limit for font size in pdfs (at least during
export form R?).

I didn't knew that Drawtree is able to split the tree over multiple pages.
I guess this is an option in the command line version? I will check that
out. In the mean time I found a way to do the job in R (see my post before)
that seems to produce reasonable results.

Thank you very much again for your efforts!

Regards,
Jonas

--
Jonas Eberle
PhD student


2015-03-05 12:41 GMT+01:00 Joe Felsenstein :

>
> Jonas Eberle wrote:
>
>
>> thanks a lot! I didn't knew splitplotTree yet. Great function! However, my
>> tree has several thousands of tips (yes, it's a bit crazy but
>> unfortunately
>> necessary...) and I guess it's only possible to split it on two pages with
>> splitplotTree. Or am I missing something?
>>
>
> It's not in R (unless available through Liam Revell's "phytools" package),
> but in PHYLIP the tree-drawing programs Drawgram and Drawtree have the
> capability of splitting a plot into a rectangular array of plots, and
> putting these out onto separate files (not PDFs, but Postscript is
> possible).
>
> This was intended to help people make large posters using printers that
> can only do a single page.
>
> However ...
>
> I do not see why this is necessary.  Most tree-drawing programs should be
> able to write a file that has the large tree plotted on it.  If you don't
> want to print the resulting tree on paper, it would then be possible to
> view the tree in an application such as Adobe Acrobat Reader and zoom in on
> it and see the tiny branches and their labels.  Making multiple plots for
> one tree would probably confuse the matter.
>
> Or is there something I am missing here?
>
> J.F.
> 
> Joe Felsenstein j...@gs.washington.edu
>  Department of Genome Sciences and Department of Biology,
>  University of Washington, Box 355065, Seattle, WA 98195-5065 USA
>

[[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/


Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-05 Thread Joe Felsenstein
Jonas Eberle wrote:


> thanks a lot! I didn't knew splitplotTree yet. Great function! However, my
> tree has several thousands of tips (yes, it's a bit crazy but unfortunately
> necessary...) and I guess it's only possible to split it on two pages with
> splitplotTree. Or am I missing something?
>

It's not in R (unless available through Liam Revell's "phytools" package),
but in PHYLIP the tree-drawing programs Drawgram and Drawtree have the
capability of splitting a plot into a rectangular array of plots, and
putting these out onto separate files (not PDFs, but Postscript is
possible).

This was intended to help people make large posters using printers that can
only do a single page.

However ...

I do not see why this is necessary.  Most tree-drawing programs should be
able to write a file that has the large tree plotted on it.  If you don't
want to print the resulting tree on paper, it would then be possible to
view the tree in an application such as Adobe Acrobat Reader and zoom in on
it and see the tiny branches and their labels.  Making multiple plots for
one tree would probably confuse the matter.

Or is there something I am missing here?

J.F.

Joe Felsenstein j...@gs.washington.edu
 Department of Genome Sciences and Department of Biology,
 University of Washington, Box 355065, Seattle, WA 98195-5065 USA

[[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/


Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-05 Thread Jonas Eberle
Hi all,

I found the ylim option in plot.phylo(). With a simple loop we can
distribute the tree on multiple pages:

MultipagePhyloPlot <- function (tree, npages = 5) {
  ntips <- length(tree$tip.label)
  tips.per.page <- ntips / npages
  y1 <- ntips - tips.per.page
  y2 <- ntips
  for (i in 1:npages) {
plot.phylo(tree, y.lim = c(y1, y2))
y1 <- y1 - tips.per.page
y2 <- y2 - tips.per.page
  }
}

It's saved to a pdf with something like:

pdf("multipageplot.pdf", paper="a4", onefile=T)
MultipagePhyloPlot(tree, npages=5)
dev.off()

Thanks again for helping! R is great!

All the best,
Jonas

--
Jonas Eberle
PhD student



2015-03-05 10:06 GMT+01:00 Jonas Eberle :

> Hi Liam,
>
> thanks a lot! I didn't knew splitplotTree yet. Great function! However, my
> tree has several thousands of tips (yes, it's a bit crazy but unfortunately
> necessary...) and I guess it's only possible to split it on two pages with
> splitplotTree. Or am I missing something?
>
> Thanks again!
>
> All the best,
> Jonas
>
> --
> Jonas Eberle
> PhD student
>
> 2015-03-04 18:31 GMT+01:00 Liam Revell :
>
>>   Hi Jonas.
>>
>> One option is to use the function splitPlotTree in phytools. By default
>> it plots the split tree in two columns, but there is an option to split it
>> into two windows. Then each plotted tree could be saved as a PDF.
>>
>> I will also investigate this to see if there is a better possibility.
>>
>> All the best,
>>
>> 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
>> ---
>> Sent from my Windows Phone
>>  --
>> From: Jonas Eberle 
>> Sent: ‎3/‎4/‎2015 12:14 PM
>> To: r-sig-phylo@r-project.org
>> Subject: [R-sig-phylo] multipage pdf of a huge tree
>>
>>   Dear all,
>>
>> I'm searching for a way to plot a huge phylogenetic tree to multiple pages
>> in one searchable pdf file from R.
>> I thought of something like:
>> 1. opening a pdf file
>> 2. plotting a 'clipped' part of the tree (e.g. tips 1-100) as the first
>> figure on page one
>> 3. plotting the next part of the tree (tips 101-200) as the second figure
>> on page two and so on...
>> 4. closing the pdf file.
>>
>> However, clip() seems not to work with plot.phylo() from ape. I tried:
>>
>> library(phytools)
>> tree <- tree<-pbtree(n=100,scale=1)
>> plot.new()
>> clip(x1=0, x2=1, y1=1, y2=50)
>> par(new = TRUE)
>> plot.phylo(tree)
>> axis(side=1); axis(side=2)
>>
>> Does anybody know if this is possible and an effective way of doing this?
>> Depending on the method of clipping (if there is more than one available),
>> is the whole tree plotted internally in each step or even worse hiddenly
>> embedded in the pdf?
>>
>> Thank you very much for your help!
>>
>> Jonas
>>
>> --
>> Jonas Eberle
>> PhD student
>>
>> [[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/
>>
>
>

[[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/

Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-05 Thread Jonas Eberle
Hi Liam,

thanks a lot! I didn't knew splitplotTree yet. Great function! However, my
tree has several thousands of tips (yes, it's a bit crazy but unfortunately
necessary...) and I guess it's only possible to split it on two pages with
splitplotTree. Or am I missing something?

Thanks again!

All the best,
Jonas

--
Jonas Eberle
PhD student

2015-03-04 18:31 GMT+01:00 Liam Revell :

>   Hi Jonas.
>
> One option is to use the function splitPlotTree in phytools. By default it
> plots the split tree in two columns, but there is an option to split it
> into two windows. Then each plotted tree could be saved as a PDF.
>
> I will also investigate this to see if there is a better possibility.
>
> All the best,
>
> 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
> ---
> Sent from my Windows Phone
>  --
> From: Jonas Eberle 
> Sent: ‎3/‎4/‎2015 12:14 PM
> To: r-sig-phylo@r-project.org
> Subject: [R-sig-phylo] multipage pdf of a huge tree
>
>   Dear all,
>
> I'm searching for a way to plot a huge phylogenetic tree to multiple pages
> in one searchable pdf file from R.
> I thought of something like:
> 1. opening a pdf file
> 2. plotting a 'clipped' part of the tree (e.g. tips 1-100) as the first
> figure on page one
> 3. plotting the next part of the tree (tips 101-200) as the second figure
> on page two and so on...
> 4. closing the pdf file.
>
> However, clip() seems not to work with plot.phylo() from ape. I tried:
>
> library(phytools)
> tree <- tree<-pbtree(n=100,scale=1)
> plot.new()
> clip(x1=0, x2=1, y1=1, y2=50)
> par(new = TRUE)
> plot.phylo(tree)
> axis(side=1); axis(side=2)
>
> Does anybody know if this is possible and an effective way of doing this?
> Depending on the method of clipping (if there is more than one available),
> is the whole tree plotted internally in each step or even worse hiddenly
> embedded in the pdf?
>
> Thank you very much for your help!
>
> Jonas
>
> --
> Jonas Eberle
> PhD student
>
> [[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/
>

[[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/

Re: [R-sig-phylo] multipage pdf of a huge tree

2015-03-04 Thread Liam Revell
Hi Jonas.

One option is to use the function splitPlotTree in phytools. By default it 
plots the split tree in two columns, but there is an option to split it into 
two windows. Then each plotted tree could be saved as a PDF.

I will also investigate this to see if there is a better possibility.

All the best,

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
---
Sent from my Windows Phone

From: Jonas Eberle<mailto:eberle.jo...@gmail.com>
Sent: �3/�4/�2015 12:14 PM
To: r-sig-phylo@r-project.org<mailto:r-sig-phylo@r-project.org>
Subject: [R-sig-phylo] multipage pdf of a huge tree

Dear all,

I'm searching for a way to plot a huge phylogenetic tree to multiple pages
in one searchable pdf file from R.
I thought of something like:
1. opening a pdf file
2. plotting a 'clipped' part of the tree (e.g. tips 1-100) as the first
figure on page one
3. plotting the next part of the tree (tips 101-200) as the second figure
on page two and so on...
4. closing the pdf file.

However, clip() seems not to work with plot.phylo() from ape. I tried:

library(phytools)
tree <- tree<-pbtree(n=100,scale=1)
plot.new()
clip(x1=0, x2=1, y1=1, y2=50)
par(new = TRUE)
plot.phylo(tree)
axis(side=1); axis(side=2)

Does anybody know if this is possible and an effective way of doing this?
Depending on the method of clipping (if there is more than one available),
is the whole tree plotted internally in each step or even worse hiddenly
embedded in the pdf?

Thank you very much for your help!

Jonas

--
Jonas Eberle
PhD student

[[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/

[[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/

[R-sig-phylo] multipage pdf of a huge tree

2015-03-04 Thread Jonas Eberle
Dear all,

I'm searching for a way to plot a huge phylogenetic tree to multiple pages
in one searchable pdf file from R.
I thought of something like:
1. opening a pdf file
2. plotting a 'clipped' part of the tree (e.g. tips 1-100) as the first
figure on page one
3. plotting the next part of the tree (tips 101-200) as the second figure
on page two and so on...
4. closing the pdf file.

However, clip() seems not to work with plot.phylo() from ape. I tried:

library(phytools)
tree <- tree<-pbtree(n=100,scale=1)
plot.new()
clip(x1=0, x2=1, y1=1, y2=50)
par(new = TRUE)
plot.phylo(tree)
axis(side=1); axis(side=2)

Does anybody know if this is possible and an effective way of doing this?
Depending on the method of clipping (if there is more than one available),
is the whole tree plotted internally in each step or even worse hiddenly
embedded in the pdf?

Thank you very much for your help!

Jonas

--
Jonas Eberle
PhD student

[[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/