clueInstances {slinky} | R Documentation

## clueInstances

### Description

Convenience wrapper to query function to retrieve instance ids meeting specified criteria.

### Usage

    clueInstances(x, where_clause = NULL, verbose = FALSE,
      poscon = c("omit", "keep"))

    ## S4 method for signature 'Slinky'
    clueInstances(x, where_clause = NULL,
      verbose = FALSE, poscon = c("omit", "keep"))

### Arguments

`x` | a Slinky Object
`where_clause` | Filter terms, as a list of terms, e.g. `list(pert_type='trt_cp', 'is_gold'=TRUE)`. Terms will be joined by AND logic.
`verbose` | Do you want to know how things are going? Default is false.
`poscon` | Instances of type `trt_poscon` are recoded as `trt_cp` in clue.io's `sigs` endpoint. This can lead to unexpected results downstream. To keep these instances, specify `poscon='keep'`

### Value

Vector of ids matching criteria. This is a convenience wrapper to the signature API which queries clue.io and unwraps response.

### Examples

    # 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_ids <- clueInstances(sl, where_clause = list("pert_iname" = "amoxicillin",
                                        "cell_id" = "MCF7",
                                        "is_gold" = TRUE))

[Package slinky version 1.8.0 Index]