PCoA.py

Create a series of 2D or 3D PCoA plots where the marker size varies by relative abundance of a particular OTU.

usage: PCoA.py [-h] -i COORD_FP -m MAP_FP -b COLORBY [-o OUT_FN] [-d {2,3}][-t TITLE] [--save] [-c MAP_CATEGORIES] [-s POINT_SIZE]

Required Arguments

-i COORD_FP, --coord_fp COORD_FP

Input principal coordinates filepath (i.e., resulting file from principal_coordinates.py).

-m MAP_FP, --map_fp MAP_FP

Input metadata mapping file-path.

-b COLORBY, --colorby COLORBY

Metadata categories (column headers) to color by in the plots.

Optional Arguments

-d {2,3}, --dimensions {2,3}

Choose whether to plot 2D or 3D.

-c COLORS, --colors COLORS

A file containing user defined colors in hex values or matplotlib named colors, each on separate line. If user color list is not sufficient or ont defined, program will use Qualitative Set1 scheme from brewer colors. More information on matplotlib named colors.

-s POINT_SIZE, --point_size POINT_SIZE

Specify the size of the circles representing each of the samples in the plot.

--pc_order PC_ORDER

Choose which Principle Coordinates are displayed and in which order, for example: 1,2 (Note the lack of any spaces around the comma).

--x_limits X_LIMITS X_LIMITS

Specify limits for the x-axis instead of automatic setting based on the data range. Should take the form: –x_limits -0.5 0.5

--y_limits Y_LIMITS Y_LIMITS

Specify limits for the y-axis instead of automatic setting based on the data range. Should take the form: –y_limits -0.5 0.5

--z_limits Z_LIMITS Z_LIMITS

Specify limits for the z-axis instead of automatic setting based on the data range. Should take the form: –z_limits -0.5 0.5

-t TITLE, --title TITLE

Title of the plot.

--dpi DPI

Set plot quality in Dots Per Inch (DPI). Larger DPI will result in larger file size.

-o OUT_FP, --out_fp OUT_FP

The path and file name to save the plot under. If specified, the figure will be saved directly instead of opening a window in which the plot can be viewed before saving.

-h, --help

Show the help message and exit.

Workflow for generating PCoA plots using PhyloToAST

Step 1 : Obtain unifrac principal coordinates file from QIIME’s beta_diversity_through_plots.py script.

Step 2 : Run PCoA.py script with -t Path to the tree file parameters.

Example plots

2D PCoA plot with 2 metadata categories - DiseaseState and SmokingStatus.

../_images/PCoA2.png

3D PCoA plot with 2 metadata categories - DiseaseState and SmokingStatus.

../_images/PCoA3.png