Skip to contents

subset() is the main function for sub-setting quantitative data from a tidyproteomics data-object based on a regular expression and targeted annotation. This function will return a smaller tidyproteomics data-object.

Note: rm.mbr() is run as default, this is to remove MBR proteins that may no longer have the original "anchor" observation present.

Usage

# S3 method for tidyproteomics
subset(data = NULL, ..., rm.mbr = TRUE, .verbose = TRUE)

Arguments

data

tidyproteomics data object

...

a three part expression (eg. x == a)

rm.mbr

a boolean

.verbose

a boolean

Value

a tibble

Examples

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

# creates a subset of just Ribosomes, based on the string in the annotation
# protein_description
hela_proteins %>%
   subset(description %like% "Ribosome") %>%
   summary()
#> 
#>  Subsetting data: description %like% Ribosome
#>  Subsetting data: description %like% Ribosome ... done
#> 
#> 
#> ── Summary: global ──
#> 
#>  proteins peptides peptides_unique quantifiable  CVs
#>        18      224             224        0.986 0.24
#> 

# creates a subset without Ribosomes
hela_proteins %>%
   subset(!description %like% "Ribosome") %>%
   summary()
#> 
#>  Subsetting data: !description %like% Ribosome
#>  Subsetting data: !description %like% Ribosome ... done
#> 
#> 
#> ── Summary: global ──
#> 
#>  proteins peptides peptides_unique quantifiable  CVs
#>      7037    66105           58482        0.908 0.25
#>