extract_gct: Exract elements from a GCT matrix

Description Usage Arguments Value Examples

View source: R/utils.R

Description

extract the elements from a GCT object where the values of row_field and col_field are the same. A concrete example is if g represents a matrix of signatures of genetic perturbations, and you wan to extract all the values of the targeted genes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
extract.gct(...)

extract_gct(
  g,
  row_field,
  col_field,
  rdesc = NULL,
  cdesc = NULL,
  row_keyfield = "id",
  col_keyfield = "id"
)

Arguments

...

arguments passed on to extract_gct

g

the GCT object

row_field

the column name in rdesc to search on

col_field

the column name in cdesc to search on

rdesc

a data.frame of row annotations

cdesc

a data.frame of column annotations

row_keyfield

the column name of rdesc to use for annotating the rows of g

col_keyfield

the column name of cdesc to use for annotating the rows of g

Value

a list of the following elements

mask

a logical matrix of the same dimensions as ds@mat indicating which matrix elements have been extracted

idx

an array index into ds@mat representing which elements have been extracted

vals

a vector of the extracted values

Examples

1
2
3
4
5
6
# get the values for all targeted genes from a 
# dataset of knockdown experiments 
res <- extract_gct(kd_gct, row_field="pr_gene_symbol",
  col_field="pert_mfc_desc")
str(res)
stats::quantile(res$vals)

cmap/cmapR documentation built on Oct. 14, 2021, 12:51 a.m.