fcgo_get_prop: Get Properties For A Feature

Description Usage Arguments Value Examples

View source: R/fc_graphic_output.R

Description

Get properties (shape, color) for a feature (case-insensitive) from the graphical presets you've specified.

Usage

1
fcgo_get_prop(feat, prop_cats, prop_quals)

Arguments

feat

The feature string you want to get something for. Case-insensitive. Matching is determined by substrings, so if you want something to be separated out (say, IgG subclasses) while calling this multiple times, put the subclasses first.

prop_cats

The categories you have split features into.

prop_quals

The shape, color, etc. you are querying into.

Value

A singular value from prop_quals corresponding to which entry in prop_cats feat corresponds to. If no match is found, the last entry in prop_quals is returned (useful for an "other" category if you don't want colors, etc. for every single type of feature).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
gopts$reag_cats = c("IgG", "FcgRIIa", "FcgRIIb", "FcgRIIIa", "FcgRIIIb")
# orchid is for anything that's not in the above categories
gopts$reag_cols = c("black", "forestgreen", "purple", "gold", "orange", "orchid")
feats = c("IgG3.gp120", "FcgRIIa.gp41", "FcgRIIIa.gp70.V1.V2", "C1q.aHuIgG")
(colors = as.vector(sapply(feats, fcgo_get_prop, gopts$reag_cats, gopts$reag_cols)))
[1] "black" "forestgreen" "gold" "orchid"

# Subclasses
gopts$reag_cats = c("IgG1", "IgG2", "IgG3", "IgG4", "C1q", "IgG")
gopts$reag_cols = c("blue", "pink", "turquoise1", "saddlebrown", "green", "black", "orchid")
feats = c("IgG3.gp120", "IgG.gp41.MN", "Ig2.Vif", "FcgRIIa.gp41", "FcgRIIIa.gp70.V1.V2", "C1q.aHuIgG")
(colors = as.vector(sapply(feats, fcgo_get_prop, gopts$reag_cats, gopts$reag_cols)))
[1] "black" "turquoise1" "black" "pink" "orchid" "orchid" "green"

kmorrisongr/fcan documentation built on Sept. 9, 2020, 10:12 a.m.