Viewing and annotation of a huge phylogenetic tree, especially with hundreds or even thousamds taxa, is always a problem. This post provides a method to split a phylogenetic tree into multiple pages of a PDF file by pdfposter.
1. Install pdfposter
There are several ways to install this utility.
1.1 Install via OS package manager
1 | sudo apt-get install pdfposter |
1.2 Install via pip
Note: It depends Pythonn 3.x
Install for all users:
1
sudo pip install pdftools.pdfposter
For user without root previlege, or for current user only:
1
pip install --user pdftools.pdfposter
2. Export PDF file for phylogenetic tree
Open phylogenetic tree file by FigTree and make annotations if necessary. Then export the tree in PDF file format. It could be viewed by Linux Document Viewer and presented as a “long“ PDF file.
- Note: It recommended to export the PDF file under Linux system, since FigTree may not work well for huge tree in Windows system.
3. Split the “long” PDF file into multi-pages
Run pdfposter as:
1 | # Split *in.pdf* to several pages, with 1 A4-portrait width, |
Now the “long” PDF file in.pdf have been splitted into multi-pages in out.pdf.
For more commands and details, please refer pdfposter document.
Reference
- pdfposter github page: https://gitlab.com/pdftools/pdfposter
- pdfposter document: https://pdfposter.readthedocs.io/en/stable/