README.md

QuadraticAPI

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.

Getting Started

install.packages('xml2')
install.packages('devtools')
devtools::install_github('hiraethus/QuadraticAPI')
library('QuadraticAPI')

estrogen.sig <- read.table('data/Estrogen.tsv', stringsAsFactors=F)
result <- analyze(estrogen.sig)

Batch Processing Example

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)

References

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.



hiraethus/QuadraticAPI documentation built on May 29, 2019, 1:18 p.m.