
Export the quantitative data from an tidyproteomics data-object
Source:R/data_export.R
export_analysis.Rdexport_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')
Examples
library(dplyr, warn.conflicts = FALSE)
library(tidyproteomics)
# subset for fast execution
hela_proteins <- hela_proteins %>% subset(description %like% "Ribosome")
#>
#> ℹ Subsetting data: description %like% Ribosome
#> ✔ Subsetting data: description %like% Ribosome ... done
#>
hela_proteins %>%
expression(knockdown/control) %>%
export_analysis(knockdown/control,
.analysis = "expression")
#> ℹ .. expression::t_test testing knockdown / control
#> ✔ .. expression::t_test testing knockdown / control [65ms]
#>
#> # A tibble: 17 × 27
#> protein imputed n imputed_control imputed_knockdown average_expression
#> <chr> <dbl> <int> <dbl> <dbl> <dbl>
#> 1 Q14146 0 6 0 0 667074.
#> 2 A0A087X020 0 6 0 0 27099436.
#> 3 Q969S9 0 6 0 0 1258238.
#> 4 Q9H7B2 0 6 0 0 17138597.
#> 5 Q15050 0 6 0 0 28765397.
#> 6 Q9Y221 0 6 0 0 9874377.
#> 7 O95478 0 6 0 0 10279868.
#> 8 Q14692 0 6 0 0 28455673.
#> 9 Q14137 0 6 0 0 41697675.
#> 10 Q8TDN6 0 6 0 0 35703697.
#> 11 Q9GZL7 0 6 0 0 46122319.
#> 12 Q9P2E9 0 6 0 0 146794734.
#> 13 Q9UHA3 0 6 0 0 2301616.
#> 14 Q96E11 0 6 0 0 11410697.
#> 15 Q9H9Y2 0 6 0 0 5643157.
#> 16 Q8N0V3 0.167 6 0.333 0 385672.
#> 17 Q9NZM5 0 6 0 0 2312164.
#> # ℹ 21 more variables: proportional_expression <dbl>, foldchange <dbl>,
#> # 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 × 10
#> sample_id sample replicate proteins peptides peptides_unique quantifiable
#> <chr> <chr> <chr> <int> <dbl> <dbl> <dbl>
#> 1 6a21f7a9 control 3 17 224 224 0.00996
#> 2 79a98e41 knockdown 2 17 224 224 0.00996
#> 3 966be57f knockdown 1 17 224 224 0.00996
#> 4 9e6ed3ba control 1 16 224 224 0.00982
#> 5 9f804505 knockdown 3 17 224 224 0.00996
#> 6 cc56fc1d control 2 15 221 221 0.0095
#> 7 6a21f7a9 control 3 17 224 224 0.00996
#> 8 79a98e41 knockdown 2 17 224 224 0.00996
#> 9 966be57f knockdown 1 17 224 224 0.00996
#> 10 9e6ed3ba control 1 16 224 224 0.00982
#> 11 9f804505 knockdown 3 17 224 224 0.00996
#> 12 cc56fc1d control 2 16 224 224 0.00951
#> # ℹ 3 more variables: PC1 <dbl>, PC2 <dbl>, is_mbr <lgl>