Reading and writing ‘GraphPad Prism’ files in R

Yue Jiang

2020-07-03

Background

GraphPad Prism is a software application for scientific graphing, curve fitting and statistical testing. It has been popular among scientists, especially experimental biologists. The pzfx R package provides an easy way to read data tables that are in GraphPad Prism format (.pzfx files) into R and vise versa. Since Prism5 (the current version as of mid 2018 is Prism7), Prism stores its data tables in XML format and is possible to be parsed in R. The pzfx package manipulates GraphPad Prism XML files through functions provided by xml2.

Main functionality

Reading

There are two main functions for reading. pzfx_tables lists the tables in a .pzfx file. read_pzfx reads one table into R from a .pzfx file.

We use a Prism example file exponential_decay.pzfx to show how these two functions work. Here is the screen shot of this file when opened in Prism. data

List tables from a .pzfx file:

Read one specific table into R by table name:

Read one specific table into R by table index (1-based):

Writing

There is a write_pzfx function for writing. It takes as input a data frame or a matrix, or a named list of data frames or matrices, and writes to a .pzfx file. To keep row names and use them as row titles in .pzfx, specify argument row_names=TRUE. To specify a column (column 1, “Col1” for example) to be used as the “X” column, specify argument x_col=1 or x_col="Col1".

Additional notes