Skip to contents

origins() enables assigning or updating the sample_origin descriptive column in the experimental table. This column is used by functions like expression_me() (linear mixed-effects modeling) to designate biological replicate or subject origin across runs. If sample_origin does not already exist, it is initialized to sample_file.

Usage

origins(data = NULL, ..., .replace = NULL)

Arguments

data

a tidyproteomics data-object

...

a three part expression (eg. sample_file == "F1", sample == "control")

.replace

a character string

Value

a tidyproteomics data-object

Examples

library(dplyr, warn.conflicts = FALSE)
library(tidyproteomics)

# check the experiment table
hela_proteins %>% summary("experiment")
#> 
#> ── Summary: experiment ──
#> 
#>  sample_id                import_file sample_file    sample replicate
#>   9e6ed3ba p97KD_HCT116_proteins.xlsx          F1   control         1
#>   cc56fc1d p97KD_HCT116_proteins.xlsx          F4   control         2
#>   6a21f7a9 p97KD_HCT116_proteins.xlsx          F5   control         3
#>   966be57f p97KD_HCT116_proteins.xlsx          F2 knockdown         1
#>   79a98e41 p97KD_HCT116_proteins.xlsx          F3 knockdown         2
#>   9f804505 p97KD_HCT116_proteins.xlsx          F6 knockdown         3
#> 

# assign sample origin (e.g. mapping files/runs to patient or donor IDs)
hela_proteins %>%
   origins(sample_file == "F1", .replace = "donor_1") %>%
   origins(sample_file == "F4", .replace = "donor_2") %>%
   summary("experiment")
#> ℹ Setting origin for 1 run
#> ℹ Setting origin for 1 run
#> 
#> ── Summary: experiment ──
#> 
#>  sample_id                import_file sample_file    sample replicate
#>   9e6ed3ba p97KD_HCT116_proteins.xlsx          F1   control         1
#>   cc56fc1d p97KD_HCT116_proteins.xlsx          F4   control         2
#>   6a21f7a9 p97KD_HCT116_proteins.xlsx          F5   control         3
#>   966be57f p97KD_HCT116_proteins.xlsx          F2 knockdown         1
#>   79a98e41 p97KD_HCT116_proteins.xlsx          F3 knockdown         2
#>   9f804505 p97KD_HCT116_proteins.xlsx          F6 knockdown         3
#>  sample_origin
#>        donor_1
#>        donor_2
#>             F5
#>             F2
#>             F3
#>             F6
#>