Reading Prism GraphPad Files into R

Yue Jiang

2018-09-17

Background

Prism GraphPad 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 Prism GraphPad format (.pzfx files) into R. 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 into data.frames in R. The pzfx package contains functions to list and load Prism tables into R, through parsing the XML by the package xml2.

Main functionality

There are only two main functions in the package. 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:

library(pzfx)
pzfx_tables(system.file("extdata/exponential_decay.pzfx", package="pzfx"))
#> [1] "Exponential decay"

Read one specific table into R by table name:

df <- read_pzfx(system.file("extdata/exponential_decay.pzfx", package="pzfx"), table="Exponential decay")
head(df)
#>   Minutes Control_1 Control_2 Control_3 Treated_1 Treated_2 Treated_3
#> 1       1      8887      7366      9612      6532      7905      7907
#> 2       2      8329        NA      8850      5352      5841      6277
#> 3       3      7907      8810      8669      5177      4082      3157
#> 4       4      7413      8481      6489      3608        NA      4226
#> 5       5      7081      7178      5716      2559      3697      2816
#> 6       6      6249      6492        NA      1671      3053      2891

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

df <- read_pzfx(system.file("extdata/exponential_decay.pzfx", package="pzfx"), table=1)
head(df)
#>   Minutes Control_1 Control_2 Control_3 Treated_1 Treated_2 Treated_3
#> 1       1      8887      7366      9612      6532      7905      7907
#> 2       2      8329        NA      8850      5352      5841      6277
#> 3       3      7907      8810      8669      5177      4082      3157
#> 4       4      7413      8481      6489      3608        NA      4226
#> 5       5      7081      7178      5716      2559      3697      2816
#> 6       6      6249      6492        NA      1671      3053      2891

Additional notes