filter_tomic.Rd
Filter a tidy or triple omic to entries of interest.
filter_tomic(
tomic,
filter_type,
filter_table,
filter_value,
filter_variable = NULL
)
Either a tidy_omic
or triple_omic
object
filter filter_variable to categories specified in filter_value
filter filter_variable to using the range (i.e., lower and upper limit) provided in filter_value
a quosure as a filter_value
to a table of interest
table where the filter should be applied
values to filter based on
variable to apply the filter to
A tomic
object where a subset of features, samples or
measurmenets have been filtered.
filter_tomic(
brauer_2008_triple,
filter_type = "category",
filter_table = "features",
filter_variable = "BP",
filter_value = c("biological process unknown", "vacuolar acidification")
)
#> $features
#> # A tibble: 110 × 4
#> name BP MF systematic_name
#> <chr> <chr> <chr> <chr>
#> 1 YOL029C biological process unknown molecular function unknown YOL029C
#> 2 YHR036W biological process unknown molecular function unknown YHR036W
#> 3 YAL046C biological process unknown molecular function unknown YAL046C
#> 4 YHR151C biological process unknown molecular function unknown YHR151C
#> 5 YKL027W biological process unknown molecular function unknown YKL027W
#> 6 YBR220C biological process unknown molecular function unknown YBR220C
#> 7 YLR057W biological process unknown molecular function unknown YLR057W
#> 8 YDR239C biological process unknown molecular function unknown YDR239C
#> 9 KKQ8 biological process unknown protein kinase activity YKL168C
#> 10 UIP5 biological process unknown molecular function unknown YKR044W
#> # ℹ 100 more rows
#>
#> $samples
#> # A tibble: 36 × 3
#> sample nutrient DR
#> <chr> <chr> <dbl>
#> 1 G0.05 G 0.05
#> 2 G0.1 G 0.1
#> 3 G0.15 G 0.15
#> 4 G0.2 G 0.2
#> 5 G0.25 G 0.25
#> 6 G0.3 G 0.3
#> 7 N0.05 N 0.05
#> 8 N0.1 N 0.1
#> 9 N0.15 N 0.15
#> 10 N0.2 N 0.2
#> # ℹ 26 more rows
#>
#> $measurements
#> # A tibble: 3,960 × 3
#> name sample expression
#> <chr> <chr> <dbl>
#> 1 YOL029C G0.05 -0.22
#> 2 YHR036W G0.05 -0.91
#> 3 YAL046C G0.05 0.05
#> 4 YHR151C G0.05 -0.53
#> 5 YKL027W G0.05 -0.52
#> 6 YBR220C G0.05 -1.06
#> 7 YLR057W G0.05 -0.42
#> 8 YDR239C G0.05 -0.55
#> 9 KKQ8 G0.05 -0.6
#> 10 UIP5 G0.05 -0.56
#> # ℹ 3,950 more rows
#>
#> $design
#> $design$features
#> # A tibble: 4 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 systematic_name character
#> 3 BP character
#> 4 MF character
#>
#> $design$samples
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 sample sample_primary_key
#> 2 nutrient character
#> 3 DR numeric
#>
#> $design$measurements
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 sample sample_primary_key
#> 3 expression numeric
#>
#> $design$feature_pk
#> [1] "name"
#>
#> $design$sample_pk
#> [1] "sample"
#>
#>
#> attr(,"class")
#> [1] "triple_omic" "tomic" "general"
filter_tomic(
brauer_2008_triple,
filter_type = "category",
filter_table = "samples",
filter_variable = "DR",
filter_value = 0.05
)
#> $features
#> # A tibble: 500 × 4
#> name BP MF systematic_name
#> <chr> <chr> <chr> <chr>
#> 1 YOL029C biological process unknown mole… YOL029C
#> 2 SCW11 cytokinesis, completion of separation gluc… YGL028C
#> 3 YHR036W biological process unknown mole… YHR036W
#> 4 BGL2 cell wall organization and biogenesis gluc… YGR282C
#> 5 ACT1 cell wall organization and biogenesis* stru… YFL039C
#> 6 FKH1 pseudohyphal growth* tran… YIL131C
#> 7 HOC1 cell wall mannoprotein biosynthesis* tran… YJR075W
#> 8 CSN12 adaptation to pheromone during conjugation wit… mole… YJR084W
#> 9 YAL046C biological process unknown mole… YAL046C
#> 10 SLG1 cell wall organization and biogenesis* tran… YOR008C
#> # ℹ 490 more rows
#>
#> $samples
#> # A tibble: 6 × 3
#> sample nutrient DR
#> <chr> <chr> <dbl>
#> 1 G0.05 G 0.05
#> 2 N0.05 N 0.05
#> 3 P0.05 P 0.05
#> 4 S0.05 S 0.05
#> 5 L0.05 L 0.05
#> 6 U0.05 U 0.05
#>
#> $measurements
#> # A tibble: 3,000 × 3
#> name sample expression
#> <chr> <chr> <dbl>
#> 1 YOL029C G0.05 -0.22
#> 2 SCW11 G0.05 -0.67
#> 3 YHR036W G0.05 -0.91
#> 4 BGL2 G0.05 -0.08
#> 5 ACT1 G0.05 -0.04
#> 6 FKH1 G0.05 -0.57
#> 7 HOC1 G0.05 -0.42
#> 8 CSN12 G0.05 -0.49
#> 9 YAL046C G0.05 0.05
#> 10 SLG1 G0.05 -0.06
#> # ℹ 2,990 more rows
#>
#> $design
#> $design$features
#> # A tibble: 4 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 systematic_name character
#> 3 BP character
#> 4 MF character
#>
#> $design$samples
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 sample sample_primary_key
#> 2 nutrient character
#> 3 DR numeric
#>
#> $design$measurements
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 sample sample_primary_key
#> 3 expression numeric
#>
#> $design$feature_pk
#> [1] "name"
#>
#> $design$sample_pk
#> [1] "sample"
#>
#>
#> attr(,"class")
#> [1] "triple_omic" "tomic" "general"
filter_tomic(
brauer_2008_tidy,
filter_type = "range",
filter_table = "samples",
filter_variable = "DR",
filter_value = c(0, 0.2)
)
#> $data
#> # A tibble: 12,000 × 8
#> name BP MF systematic_name sample nutrient DR expression
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl>
#> 1 YOL029C biological pr… mole… YOL029C G0.05 G 0.05 -0.22
#> 2 YOL029C biological pr… mole… YOL029C G0.1 G 0.1 -0.18
#> 3 YOL029C biological pr… mole… YOL029C G0.15 G 0.15 0.27
#> 4 YOL029C biological pr… mole… YOL029C G0.2 G 0.2 0.18
#> 5 YOL029C biological pr… mole… YOL029C N0.05 N 0.05 0.26
#> 6 YOL029C biological pr… mole… YOL029C N0.1 N 0.1 0.15
#> 7 YOL029C biological pr… mole… YOL029C N0.15 N 0.15 0.04
#> 8 YOL029C biological pr… mole… YOL029C N0.2 N 0.2 -0.07
#> 9 YOL029C biological pr… mole… YOL029C P0.05 P 0.05 -0.55
#> 10 YOL029C biological pr… mole… YOL029C P0.1 P 0.1 -0.67
#> # ℹ 11,990 more rows
#>
#> $design
#> $design$features
#> # A tibble: 4 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 systematic_name character
#> 3 BP character
#> 4 MF character
#>
#> $design$samples
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 sample sample_primary_key
#> 2 nutrient character
#> 3 DR numeric
#>
#> $design$measurements
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 sample sample_primary_key
#> 3 expression numeric
#>
#> $design$feature_pk
#> [1] "name"
#>
#> $design$sample_pk
#> [1] "sample"
#>
#>
#> attr(,"class")
#> [1] "tidy_omic" "tomic" "general"
filter_tomic(
brauer_2008_triple,
filter_type = "quo",
filter_table = "features",
filter_value = rlang::quo(BP == "biological process unknown")
)
#> $features
#> # A tibble: 110 × 4
#> name BP MF systematic_name
#> <chr> <chr> <chr> <chr>
#> 1 YOL029C biological process unknown molecular function unknown YOL029C
#> 2 YHR036W biological process unknown molecular function unknown YHR036W
#> 3 YAL046C biological process unknown molecular function unknown YAL046C
#> 4 YHR151C biological process unknown molecular function unknown YHR151C
#> 5 YKL027W biological process unknown molecular function unknown YKL027W
#> 6 YBR220C biological process unknown molecular function unknown YBR220C
#> 7 YLR057W biological process unknown molecular function unknown YLR057W
#> 8 YDR239C biological process unknown molecular function unknown YDR239C
#> 9 KKQ8 biological process unknown protein kinase activity YKL168C
#> 10 UIP5 biological process unknown molecular function unknown YKR044W
#> # ℹ 100 more rows
#>
#> $samples
#> # A tibble: 36 × 3
#> sample nutrient DR
#> <chr> <chr> <dbl>
#> 1 G0.05 G 0.05
#> 2 G0.1 G 0.1
#> 3 G0.15 G 0.15
#> 4 G0.2 G 0.2
#> 5 G0.25 G 0.25
#> 6 G0.3 G 0.3
#> 7 N0.05 N 0.05
#> 8 N0.1 N 0.1
#> 9 N0.15 N 0.15
#> 10 N0.2 N 0.2
#> # ℹ 26 more rows
#>
#> $measurements
#> # A tibble: 3,960 × 3
#> name sample expression
#> <chr> <chr> <dbl>
#> 1 YOL029C G0.05 -0.22
#> 2 YHR036W G0.05 -0.91
#> 3 YAL046C G0.05 0.05
#> 4 YHR151C G0.05 -0.53
#> 5 YKL027W G0.05 -0.52
#> 6 YBR220C G0.05 -1.06
#> 7 YLR057W G0.05 -0.42
#> 8 YDR239C G0.05 -0.55
#> 9 KKQ8 G0.05 -0.6
#> 10 UIP5 G0.05 -0.56
#> # ℹ 3,950 more rows
#>
#> $design
#> $design$features
#> # A tibble: 4 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 systematic_name character
#> 3 BP character
#> 4 MF character
#>
#> $design$samples
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 sample sample_primary_key
#> 2 nutrient character
#> 3 DR numeric
#>
#> $design$measurements
#> # A tibble: 3 × 2
#> variable type
#> <chr> <chr>
#> 1 name feature_primary_key
#> 2 sample sample_primary_key
#> 3 expression numeric
#>
#> $design$feature_pk
#> [1] "name"
#>
#> $design$sample_pk
#> [1] "sample"
#>
#>
#> attr(,"class")
#> [1] "triple_omic" "tomic" "general"