retrieveMatrix: Download data from magma that is stored as a matrix

Description Usage Arguments Value Examples

View source: R/retrieveMatrix.R

Description

Download data from magma that is stored as a matrix

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
retrieveMatrix(
  target,
  projectName,
  modelName,
  recordNames = "all",
  attributeNames,
  filter = "",
  page = NULL,
  pageSize = 10,
  ...
)

Arguments

target

A list, which can be created using magmaRset, containing your authorization 'token' (a string), a 'url' of magma to target (a string), and optional 'opts' for specifying additions parameters for curl requests (a named list).

projectName

Single string. The name of the project you would like to interact with. For options, see retrieveProjects.

modelName

Single string. The name of the subset data structure within the project, which are referred to as 'model's in magma, to interact with. For options, see retrieveModels or https://timur.ucsf.edu/<projectName>/map.

recordNames

Single string or string vector indicating which particular sample/tube/etc. records to target. Options are "all" or any combination of individual record names. To retrieve individual options, see retrieveIds.

attributeNames

Single string or string vector indicating which features of the data to target. Options are "all" or any combination of individual attribute names. To retrieve individual options, see retrieveAttributes.

filter

String. Potential filter(s) of the data. Example: "<targetAttributeName>~GYN" to filter to records where <targetAttributeName> contains "GYN".

Refer to https://mountetna.github.io/magma.html#retrieve for more details about options and format.

page

Integer. For retrieving just a portion of the data, sets which slice to get.

pageSize

Integer. For retrieving just a portion of the data, sets slice/page size, which is equivalent to the a number of rows.

...

Additional parameters passed along to the internal '.retrieve()', '.query()', or '.update()' functions, for troubleshooting or advanced-user purposes only:

  • request.only (Logical) & json.params.only (Logical) which 1) stop the function before its main curl request to magma and 2) returns the values that would have been sent to magma in either of two formats.

  • verbose (Logical) sets whether to report the status of the curl request after it is performed.

Value

a matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
if (interactive()) {
    # First, we use magmaRset to create an object which will tell other magmaR
    #  functions our authentication token (as well as some other optional bits).
    # When run in this way, it will ask you to give your token.
    magma <- magmaRset()
    
    retrieveMatrix(
        target = magma,
        projectName = "example",
        modelName = "rna_seq",
        recordNames = "all",
        attributeNames = "gene_counts")
}

magmaR documentation built on Oct. 2, 2021, 5:08 p.m.