Description Usage Arguments Value Examples
View source: R/fc_graphic_output.R
Get properties (shape, color) for a feature (case-insensitive) from the graphical presets you've specified.
1 | fcgo_get_prop(feat, prop_cats, prop_quals)
|
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. |
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).
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"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.