-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #865 from Kincekara/update-phytreeviz
update phytreeviz
- Loading branch information
Showing
3 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
FROM python:3.9.17-slim as app | ||
|
||
# List all software versions are ARGs near the top of the dockerfile | ||
# 'ARG' sets environment variables during the build stage | ||
# ARG variables are ONLY available during image build, they do not persist in the final image | ||
ARG PHYTREEVIZ_VER="0.2.0" | ||
|
||
# 'LABEL' instructions tag the image with metadata that might be important to the user | ||
LABEL base.image="python:3.9.17-slim" | ||
LABEL dockerfile.version="1" | ||
LABEL software="phyTreeViz" | ||
LABEL software.version="${PHYTREEVIZ_VER}" | ||
LABEL description="Visualizing phylogenetic trees" | ||
LABEL website="https://github.com/moshi4/phyTreeViz/" | ||
LABEL license="https://github.com/moshi4/phyTreeViz/blob/main/LICENSE" | ||
LABEL maintainer="Erin Young" | ||
LABEL maintainer.email="[email protected]" | ||
|
||
# 'RUN' executes code during the build | ||
# Install dependencies via apt-get or yum if using a centos or fedora base | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
procps \ | ||
ca-certificates && \ | ||
apt-get autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install and/or setup more things. Make /data for use as a working dir | ||
# For readability, limit one install per 'RUN' statement. | ||
RUN pip install --no-cache phytreeviz==${PHYTREEVIZ_VER} | ||
|
||
ENV PATH="$PATH" \ | ||
LC_ALL=C | ||
|
||
# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.' | ||
CMD phytreeviz --help | ||
|
||
# 'WORKDIR' sets working directory | ||
WORKDIR /data | ||
|
||
##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### | ||
##### Step 2. Set up the testing stage. ##### | ||
##### The docker image is built to the 'test' stage before merging, but ##### | ||
##### the test stage (or any stage after 'app') will be lost. ##### | ||
##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### | ||
|
||
# A second FROM insruction creates a new stage | ||
FROM app as test | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends wget unzip | ||
|
||
# set working directory so that all test inputs & outputs are kept in /test | ||
WORKDIR /test | ||
|
||
# print help and version info; check dependencies (not all software has these options available) | ||
# Mostly this ensures the tool of choice is in path and is executable | ||
RUN phytreeviz --help && \ | ||
phytreeviz --version | ||
|
||
# Demonstrate that the program is successfully installed - which is highly dependant on what the tool is. | ||
|
||
# Run the program's internal tests if available, for example with SPAdes: | ||
RUN wget -q https://github.com/moshi4/phyTreeViz/raw/main/example/example.zip && \ | ||
unzip example.zip && \ | ||
phytreeviz -i ./example/small_example.nwk -o cli_example_small.png --show_branch_length --show_confidence && \ | ||
phytreeviz -i ./example/medium_example.nwk -o cli_example_med.png --fig_height 0.3 --align_leaf_label && \ | ||
ls cli_example_med.png cli_example_small.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# phyTreeViz container | ||
|
||
Main tool: [phyTreeViz](https://github.com/moshi4/phyTreeViz) | ||
|
||
Code repository: https://github.com/moshi4/phyTreeViz | ||
|
||
Basic information on how to use this tool: | ||
- executable: phytreeviz | ||
- help: --help | ||
- version: --version | ||
- description: Visualizing phylogenetic trees | ||
|
||
Additional information: | ||
|
||
> phyTreeViz is a simple and minimal phylogenetic tree visualization python package implemented based on matplotlib. This package was developed to enhance phylogenetic tree visualization functionality of BioPython. | ||
This is contains a python library as well as a command line executable. | ||
|
||
Full documentation: | ||
- CLI Docs : https://moshi4.github.io/phyTreeViz/cli-docs/phytreeviz/ | ||
- API Docs : https://moshi4.github.io/phyTreeViz/api-docs/treeviz/ | ||
|
||
## Example Usage | ||
|
||
CLI example | ||
```bash | ||
phytreeviz -i input.nwk -o output.png | ||
``` | ||
|
||
API example | ||
```python | ||
from phytreeviz import TreeViz, load_example_tree_file | ||
|
||
tree_file = load_example_tree_file("small_example.nwk") | ||
|
||
tv = TreeViz(tree_file) | ||
tv.show_branch_length(color="red") | ||
tv.show_confidence(color="blue") | ||
tv.show_scale_bar() | ||
|
||
tv.savefig("api_example01.png", dpi=300) | ||
``` |