Skip to content

Commit

Permalink
Merge pull request #865 from Kincekara/update-phytreeviz
Browse files Browse the repository at this point in the history
update phytreeviz
  • Loading branch information
erinyoung authored Feb 6, 2024
2 parents bdc1785 + a788def commit e263d65
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [Pavian](https://hub.docker.com/r/staphb/pavian) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/pavian)](https://hub.docker.com/r/staphb/pavian) | <ul><li>[1.2.1](pavian/1.2.1/)</li></ul> | https://github.com/fbreitwieser/pavian |
| [pbptyper](https://hub.docker.com/r/staphb/pbptyper) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/pbptyper)](https://hub.docker.com/r/staphb/pbptyper) | <ul><li>1.0.0</li><li>1.0.1</li><li>1.0.4</li></ul> | https://github.com/rpetit3/pbptyper |
| [Phyml](https://hub.docker.com/r/staphb/phyml) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/phyml)](https://hub.docker.com/r/staphb/phyml) | <ul><li>3.3.20220408</li></ul> | https://github.com/stephaneguindon/phyml |
| [phyTreeViz](https://hub.docker.com/r/staphb/phytreeviz) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/phytreeviz)](https://hub.docker.com/r/staphb/phytreeviz) | <ul><li>[0.1.0](phytreeviz/0.1.0/)</li></ul> | https://github.com/moshi4/phyTreeViz/ |
| [phyTreeViz](https://hub.docker.com/r/staphb/phytreeviz) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/phytreeviz)](https://hub.docker.com/r/staphb/phytreeviz) | <ul><li>[0.1.0](./phytreeviz/0.1.0/)</li><li>[0.2.0](./phytreeviz/0.2.0/)</li></ul> | https://github.com/moshi4/phyTreeViz/ |
| [Piggy](https://hub.docker.com/r/staphb/piggy) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/piggy)](https://hub.docker.com/r/staphb/piggy) | <ul><li>1.5</li></ul> | https://github.com/harry-thorpe/piggy |
| [Pilon](https://hub.docker.com/r/staphb/pilon) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/pilon)](https://hub.docker.com/r/staphb/pilon) | <ul><li>1.23.0</li><li>1.24</li></ul> | https://github.com/broadinstitute/pilon |
| [Piranha](https://hub.docker.com/r/staphb/piranha) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/piranha)](https://hub.docker.com/r/staphb/piranha) | <ul><li>1.0.4</li></ul> | https://github.com/polio-nanopore/piranha |
Expand Down
65 changes: 65 additions & 0 deletions phytreeviz/0.2.0/Dockerfile
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
42 changes: 42 additions & 0 deletions phytreeviz/0.2.0/README.md
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)
```

0 comments on commit e263d65

Please sign in to comment.