Skip to contents

export_analysis() returns the main quantitative data object as a tibble with identifier as the designation for the measured observation.

Usage

export_analysis(
  data = NULL,
  ...,
  .analysis = NULL,
  .term = NULL,
  .append = NULL,
  .file_name = NULL
)

Arguments

data

tidyproteomics data object

...

two sample comparison e.g. experimental/control

.analysis

a character string for the specific analysis to export. For example, the base analysis 'counts' always exists, it is the base analysis supporting plot_counts(). The other analysis are 'expression' and 'enrichment', which are only available when those analyses have been performed.

.term

a character string of the term from an enrichment analysis. Use the show_annotations() function to list the available terms.

.append

a character string of the term to append to the output. Use the show_annotations() function to list the available terms.

.file_name

a character string for file to write to, format implied from string ('.rds', '.xlsx', '.csv', '.tsv')

Value

a tibble

Examples

library(dplyr, warn.conflicts = FALSE)
library(tidyproteomics)
hela_proteins %>%
   expression(knockdown/control) %>%
   export_analysis(knockdown/control,
                   .analysis = "expression")
#>  .. expression::t_test testing knockdown / control
#>  .. expression::t_test testing knockdown / control [3.1s]
#> 
#> # A tibble: 5,187 × 25
#>    protein imputed     n average_expression proportional_expression foldchange
#>    <chr>     <dbl> <int>              <dbl>                   <dbl>      <dbl>
#>  1 Q5SVJ8    0.333     6            755886.              0.00000293      52.1 
#>  2 Q15011    0         6           4919332.              0.0000190       48.6 
#>  3 F6SA91    0.167     6            879218.              0.00000340      39.6 
#>  4 Q9NXV2    0         6           3103100.              0.0000120       19.6 
#>  5 Q13751    0         6           1072517.              0.00000415      11.9 
#>  6 O00308    0         6            733272.              0.00000284      10.1 
#>  7 Q9BY50    0         6           2049680.              0.00000793       9.75
#>  8 Q8TBM8    0.333     6           3374207.              0.0000131        8.72
#>  9 Q5JUW8    0         6           1745373.              0.00000676       7.98
#> 10 Q5T9L3    0.167     6            961926.              0.00000372       7.97
#> # ℹ 5,177 more rows
#> # ℹ 19 more variables: log2_foldchange <dbl>, p_value <dbl>, adj_p_value <dbl>,
#> #   normalization <chr>, abundance_control_1 <dbl>, abundance_control_2 <dbl>,
#> #   abundance_control_3 <dbl>, abundance_knockdown_1 <dbl>,
#> #   abundance_knockdown_2 <dbl>, abundance_knockdown_3 <dbl>,
#> #   description <chr>, biological_process <chr>, cellular_component <chr>,
#> #   molecular_function <chr>, gene_id_entrez <chr>, gene_name <chr>, …

hela_proteins %>%
   export_analysis(.analysis = "counts")
#> # A tibble: 12 × 8
#>    sample_id sample    replicate proteins peptides peptides_unique quantifiable
#>    <chr>     <chr>     <chr>        <int>    <dbl>           <dbl>        <dbl>
#>  1 6a21f7a9  control   3             6803    65477           58199      0.00908
#>  2 79a98e41  knockdown 2             6820    65644           58289      0.00909
#>  3 966be57f  knockdown 1             6809    65522           58260      0.00908
#>  4 9e6ed3ba  control   1             6776    65322           58100      0.00906
#>  5 9f804505  knockdown 3             6803    65597           58213      0.00906
#>  6 cc56fc1d  control   2             6805    65455           58154      0.00905
#>  7 6a21f7a9  control   3             7055    66329           58706      0.0091 
#>  8 79a98e41  knockdown 2             7055    66329           58706      0.0091 
#>  9 966be57f  knockdown 1             7055    66329           58706      0.00909
#> 10 9e6ed3ba  control   1             7055    66329           58706      0.00907
#> 11 9f804505  knockdown 3             7055    66329           58706      0.00907
#> 12 cc56fc1d  control   2             7055    66329           58706      0.00907
#> # ℹ 1 more variable: is_mbr <lgl>