Skip to contents

Read and tidy a SPECTRAmax file

Usage

read_spectramax(path, date = Sys.Date(), wavelengths = NULL)

Arguments

path

Path to the SPECTRAmax .txt file

date

Date of experiment. If not supplied, uses current date.

wavelengths

What wavelengths were read in this experiment?

Value

A list, with the following form:

data

a tibble that contains two columns - the type, and the (tidy) data itself in a list-column.

date

character. The date of the experiment

experiment_type

character. The type of experiment (currently only pq (Protein Quantification) and mtt supported)

tidy

logical. Should always return TRUE if read in using read_spectramax

Details

SPECTRAmax files cannot be read in easily without tidying them simultaneously, due to their non-rectangular structure. Therefore, tidying is required to be read in and is not an option supplied.

Examples

system.file("extdata", "spectramax.txt", package = "mop") |>
  read_spectramax()
#> <spectramax[4]>
#> [[1]]
#> [[1]]$data
#> 
#>                 12
#>    ________________________
#>   | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>   | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>   | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>   | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> 8 | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>   | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>   | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#>   | ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
#> 
#> 
#> Start corner: tl
#> Plate dimensions: 8 x 12
#> 
#> [[1]]$type
#> [1] "Plate"
#> 
#> [[1]]$wavelengths
#> [1] "450"
#> 
#> 
#> [[2]]
#> [[2]]$data
#> # A tibble: 32 × 8
#>    Sample Wells Values R     Result MeanResult Std.Dev. `CV%`
#>    <chr>  <chr>  <dbl> <chr> <chr>  <chr>      <chr>    <chr>
#>  1 Gr01   A3    -0.005 R     Error  Error      Error    Error
#>  2 NA     A4    -0.003 R     NA     NA         NA       NA   
#>  3 NA     A5     0.007 R     NA     NA         NA       NA   
#>  4 NA     A6     0.036 NA    NA     NA         NA       NA   
#>  5 NA     B3     0.001 R     NA     NA         NA       NA   
#>  6 NA     B4    -0.003 R     NA     NA         NA       NA   
#>  7 NA     B5     0.014 R     NA     NA         NA       NA   
#>  8 NA     B6     0.013 R     NA     NA         NA       NA   
#>  9 NA     C3     0.005 R     NA     NA         NA       NA   
#> 10 NA     C4     0.006 R     NA     NA         NA       NA   
#> # ℹ 22 more rows
#> 
#> [[2]]$type
#> [1] "Group"
#> 
#> [[2]]$wavelengths
#> NULL
#> 
#> 
#> [[3]]
#> [[3]]$data
#> # A tibble: 14 × 7
#>    Sample Concentration Wells Values MeanValue Std.Dev. `CV%`
#>    <chr>          <dbl> <chr>  <dbl>     <dbl>    <dbl> <dbl>
#>  1 Gr01           2     A1     1.39      1.43     0.057   4  
#>  2 NA            NA     A2     1.47     NA       NA      NA  
#>  3 Gr02           1     B1     0.628     0.615    0.018   2.9
#>  4 NA            NA     B2     0.603    NA       NA      NA  
#>  5 Gr03           0.5   C1     0.25      0.252    0.003   1.3
#>  6 NA            NA     C2     0.255    NA       NA      NA  
#>  7 Gr04           0.25  D1     0.151     0.119    0.045  37.8
#>  8 NA            NA     D2     0.088    NA       NA      NA  
#>  9 Gr05           0.125 E1     0.052     0.052    0.001   1.2
#> 10 NA            NA     E2     0.051    NA       NA      NA  
#> 11 Gr06           0.063 F1     0.026     0.022    0.005  23.6
#> 12 NA            NA     F2     0.019    NA       NA      NA  
#> 13 Gr07           0.031 G1     0.017     0.016    0.002   9.7
#> 14 NA            NA     G2     0.015    NA       NA      NA  
#> 
#> [[3]]$type
#> [1] "Group"
#> 
#> [[3]]$wavelengths
#> NULL
#> 
#> 
#> # Date: 2025-07-31