query_drugs: Get correlation between query and drug signatures. Determines...

Description Usage Arguments Value See Also Examples

View source: R/query_drugs.R

Description

The 230829 LINCS l1000 signatures (drugs & genetic over/under expression) can also be queried. In order to compare l1000 results to those obtained with cmap, only the same genes should be included (see second example).

Usage

1
2
query_drugs(query_genes, drug_info = c("cmap", "l1000"), sorted = TRUE,
  ngenes = 200, path = NULL)

Arguments

query_genes

Named numeric vector of differentual expression values for query genes. Usually 'meta' slot of get_dprimes result.

drug_info

Character vector specifying which dataset to query (either 'cmap' or 'l1000'). Can also provide a matrix of differential expression values for drugs or drug combinations (rows are genes, columns are drugs).

sorted

Would you like the results sorted by decreasing similarity? Default is TRUE.

ngenes

The number of top differentially-regulated (up and down) query genes to use if path is NULL. If path is not NULL, ngenes is the larger of 15 or the number of pathway genes with absolute dprimes > 2.

path

Character vector specifying KEGG pathway. Used to find drugs that most closely mimic or reverse query signature for specific pathway.

Value

Vector of pearson correlations between query and drug combination signatures.

See Also

query_combos to get similarity between query and predicted drug combination signatures. diff_path and path_meta to perform pathway meta-analysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Example 1 -----

library(crossmeta)
library(ccdata)
library(lydata)

data_dir <- system.file("extdata", package = "lydata")
data(cmap_es)

# gather GSE names
gse_names  <- c("GSE9601", "GSE15069", "GSE50841", "GSE34817", "GSE29689")

# load previous differential expression analysis
anals <- load_diff(gse_names, data_dir)

# run meta-analysis
es <- es_meta(anals)

# get meta-analysis effect size values
dprimes <- get_dprimes(es)

# most significant pathway (from path_meta)
path <- 'Amino sugar and nucleotide sugar metabolism'

# query using entire transcriptional profile
topd <- query_drugs(dprimes$all$meta, cmap_es)

# query restricted to transcriptional profile for above pathway
topd_path <- query_drugs(dprimes$all$meta, cmap_es, path=path)

# Example 2 -----

# create drug signatures
genes <- paste("GENE", 1:1000, sep = "_")
set.seed(0)

drug_info <- data.frame(row.names = genes,
                        drug1  = rnorm(1000, sd = 2),
                        drug2  = rnorm(1000, sd = 2),
                        drug3  = rnorm(1000, sd = 2))

# query signature is drug3
query_sig <- drug_info$drug3
names(query_sig) <- genes

res <- query_drugs(query_sig, as.matrix(drug_info))

# use only common genes for l1000 and cmap matrices
# library(ccdata)
# data(cmap_es)
# data(l1000_es)
# cmap_es <- cmap_es[row.names(l1000_es), ]

alexvpickering/ccmap documentation built on March 22, 2020, 6:08 p.m.