query_drugs {ccmap} | R Documentation |
Determines the cosine similarity between the query and each drug signature.
query_drugs(query_genes, drug_info = c("cmap", "l1000"), sorted = TRUE, ngenes = 200, path = NULL)
query_genes |
Named numeric vector of differentual expression values for
query genes. Usually 'meta' slot of |
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 |
Character vector specifying KEGG pathway. Used to find drugs that most closely mimic or reverse query signature for specific pathway. |
Drugs with the largest positive and negative cosine similarity are predicted to, respectively, mimic and reverse the query signature. Values range from +1 to -1.
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).
Vector of cosine similarities between query and drug combination signatures.
query_combos
to get similarity between query and
predicted drug combination signatures. diff_path and path_meta
to perform pathway meta-analysis.
# 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), ]