controls: controls #' Fetch the same plate control samples applicable...

Description Usage Arguments Value Examples

Description

controls #' Fetch the same plate control samples applicable for given ids (distil_id). Expects that the specified ids have pert_type of trt_sh or trt_cp.

Usage

1
2
3
4
controls(x, ids, verbose = FALSE, cl = NULL)

## S4 method for signature 'Slinky'
controls(x, ids, verbose = FALSE, cl = NULL)

Arguments

x

A slinky object

ids

The distil_id(s) to lookup.

verbose

Do you want to know how things are going? Default is FALSE.

cl

Optional cluster object to parallelize this operation. If verbose is TRUE, use this pattern in order for progress bar to update: cl <- parallel::makeCluster(4, outfile=\"\")

Value

The name of the vehicle control for the queried perturbagen(s). \For a given set of distil_ids, this function finds the distil_ids for the corresponding control samples based on the the pert_type and (for trt_cp) the specified vehicle. The returned dataframe can be used, among other things, to create a control dataset for differential expression or other analysis. See also diffexp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# for build/demo only.  You MUST use your own key when using the slinky
# package.
user_key <- httr::content(httr::GET('https://api.clue.io/temp_api_key'),
                          as='parsed')$user_key
sl <- Slinky(user_key,
                 system.file('extdata', 'demo.gctx',
                      package='slinky'),
                 system.file('extdata', 'demo_inst_info.txt',
                     package = 'slinky'))
amox_gold <- clueInstances(sl, where_clause = list("pert_type" = "trt_cp",
   "pert_iname" = "amoxicillin",
   "cell_id" = "MCF7",
   "is_gold" = TRUE), 
   poscon = "omit")
colnames(sl[,1:5])
rownames(sl[1:5,1:5])
ids.ctrl <- controls(sl, ids = amox_gold)$distil_id

slinky documentation built on Nov. 8, 2020, 10:58 p.m.