Please note, this package is under development and the format of functions used here is not set in stone. Consequently, the way functions are called may break in future builds. For any queries, please email me at meicaljohnjones@gmail.com. Pull requests are welcome!
The aim of QuadraticAPI is to provide an R wrapper for Paul O'Reilly's QUADrATiC: scalable gene expression connectivity mapping for repurposing FDA-approved therapeutics. QUADrATiC exposes a web service interface which this package interacts with, making it easier to run batches of jobs against the server.
Manual.pdf
xml2
package installed by runninginstall.packages('xml2')
devtools
package and use it to install QuadraticAPI:install.packages('devtools')
devtools::install_github('hiraethus/QuadraticAPI')
tsv
, see the data folder in the R package archive.library('QuadraticAPI')
estrogen.sig <- read.table('data/Estrogen.tsv', stringsAsFactors=F)
result <- analyze(estrogen.sig)
result
will contain a data.frame and it should look something like this:
To perform a batch of connections using QuadraticAPI, you can do this quite easily using the lapply command:
files <- list.files(path='data/', pattern='*.tsv', full.names = T)
perform.quadratic <- function(file.name) {
sig.df <- read.table(file.name, stringsAsFactors = F)
connections <- analyze(sig.df)
result <- list(
file.name=file.name,
connections=connections
)
}
all.connections <- lapply(files, perform.quadratic)
which will return a list containing lists that have both the filename and connections in them. e.g. to access the first result, use the following notation:
all.connections[[1]]$file.name
all.connections[[1]]$connections
Note: If you have memory constraints, you may want to save results to separate files rather than collecting them all in memory:
files <- list.files(path='data/', pattern='*.tsv', full.names = T)
perform.quadratic <- function(file.name) {
sig.df <- read.table(file.name, stringsAsFactors = F)
connections <- analyze(sig.df)
write.table(connections, file=paste0(file.name, '.connections'))
}
lapply(files, perform.quadratic)
O’Reilly, Paul G., Qing Wen, Peter Bankhead, Philip D. Dunne, Darragh G. McArt, Suzanne McPherson, Peter W. Hamilton, Ken I. Mills, and Shu-Dong Zhang. "QUADrATiC: scalable gene expression connectivity mapping for repurposing FDA-approved therapeutics." BMC bioinformatics 17, no. 1 (2016): 198.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.