This function converts quantification results obtained from quantify_ions()
to a nested data frame, which provides data on abundances and extracted ion
currents (XIC) for each quantified ion.
# S3 method for quaxi as_tibble(x, abundance_col = "abundance_data", xic_col = "xic_data", ...)
x | A |
---|---|
abundance_col | Name of the column that will contain abundance data. If
|
xic_col | Name of the column that will contain XIC data. If |
... | Other arguments passed on to individual methods. |
The data frame stored in x$ions
without column ion_id
(i.e., a
data frame with one ion per row) and up to two nested columns containing
data on abundances and XICs, respectively.
The former column is labeled according to the value of abundance_col
and
contains the variables rt_min
, rt_max
, scan_min
, scan_max
, and
abundance
.
The latter column is labeled according to the value of xic_col
and
contains the variables scan
(scan index), rt
(corresponding retention
time), and int
(intensity).
library(tibble) ms_data <- mzR::openMSfile( system.file("extdata", "mzml", "mab1.mzML", package = "fragquaxi") ) proteins <- define_proteins( system.file("extdata", "mab_sequence.fasta", package = "fragquaxi"), .disulfides = 16 ) modcoms <- define_ptm_compositions(sample_modcoms) pfm_ions <- assemble_proteoforms(proteins, modcoms) %>% ionize(36L:40L) abundances <- quantify_ions(ms_data, pfm_ions, c(300, 350)) # by default, include data on abundances and XICs in the output as_tibble(abundances)#> # A tibble: 30 x 10 #> protein_name modcom_name formula mass z mz #> <int> <chr> <mol> <dbl> <int> <dbl> #> 1 1 G0F/G0 C6570 H10124 N1714 O2088 S44 147942. 36 4111. #> 2 1 G0F/G0 C6570 H10124 N1714 O2088 S44 147942. 37 3999. #> 3 1 G0F/G0 C6570 H10124 N1714 O2088 S44 147942. 38 3894. #> 4 1 G0F/G0 C6570 H10124 N1714 O2088 S44 147942. 39 3794. #> 5 1 G0F/G0 C6570 H10124 N1714 O2088 S44 147942. 40 3700. #> 6 1 G0F/G0F C6576 H10134 N1714 O2092 S44 148088. 36 4115. #> 7 1 G0F/G0F C6576 H10134 N1714 O2092 S44 148088. 37 4003. #> 8 1 G0F/G0F C6576 H10134 N1714 O2092 S44 148088. 38 3898. #> 9 1 G0F/G0F C6576 H10134 N1714 O2092 S44 148088. 39 3798. #> 10 1 G0F/G0F C6576 H10134 N1714 O2092 S44 148088. 40 3703. #> # … with 20 more rows, and 4 more variables: mz_min <dbl>, mz_max <dbl>, #> # abundance_data <list>, xic_data <list># rename the column containing abundance data # (and omit several columns for readability) as_tibble(abundances, abundance_col = "abundances") %>% dplyr::select(-formula, -mz_min, -mz_max)#> # A tibble: 30 x 7 #> protein_name modcom_name mass z mz abundances xic_data #> <int> <chr> <dbl> <int> <dbl> <list> <list> #> 1 1 G0F/G0 147942. 36 4111. <tibble [1 × 4… <tibble [352 × … #> 2 1 G0F/G0 147942. 37 3999. <tibble [1 × 4… <tibble [352 × … #> 3 1 G0F/G0 147942. 38 3894. <tibble [1 × 4… <tibble [352 × … #> 4 1 G0F/G0 147942. 39 3794. <tibble [1 × 4… <tibble [352 × … #> 5 1 G0F/G0 147942. 40 3700. <tibble [1 × 4… <tibble [352 × … #> 6 1 G0F/G0F 148088. 36 4115. <tibble [1 × 4… <tibble [352 × … #> 7 1 G0F/G0F 148088. 37 4003. <tibble [1 × 4… <tibble [352 × … #> 8 1 G0F/G0F 148088. 38 3898. <tibble [1 × 4… <tibble [352 × … #> 9 1 G0F/G0F 148088. 39 3798. <tibble [1 × 4… <tibble [352 × … #> 10 1 G0F/G0F 148088. 40 3703. <tibble [1 × 4… <tibble [352 × … #> # … with 20 more rows# omit XIC data in the output as_tibble(abundances, xic_col = NULL) %>% dplyr::select(-formula, -mz_min, -mz_max)#> # A tibble: 30 x 6 #> protein_name modcom_name mass z mz abundance_data #> <int> <chr> <dbl> <int> <dbl> <list> #> 1 1 G0F/G0 147942. 36 4111. <tibble [1 × 4]> #> 2 1 G0F/G0 147942. 37 3999. <tibble [1 × 4]> #> 3 1 G0F/G0 147942. 38 3894. <tibble [1 × 4]> #> 4 1 G0F/G0 147942. 39 3794. <tibble [1 × 4]> #> 5 1 G0F/G0 147942. 40 3700. <tibble [1 × 4]> #> 6 1 G0F/G0F 148088. 36 4115. <tibble [1 × 4]> #> 7 1 G0F/G0F 148088. 37 4003. <tibble [1 × 4]> #> 8 1 G0F/G0F 148088. 38 3898. <tibble [1 × 4]> #> 9 1 G0F/G0F 148088. 39 3798. <tibble [1 × 4]> #> 10 1 G0F/G0F 148088. 40 3703. <tibble [1 × 4]> #> # … with 20 more rows