Last data update: 2014.03.03

R: rawQuery
rawQueryR Documentation

rawQuery

Description

For exploratory situations, or by personal preference, one can bypass the interactions API (which we expect will be used by most people most of the time). The rawQuery method allows you to craft your own MIQL (molecular interaction query language) query but without needing to obtain per-provider URLs. The sixteen columns of data are returned in a data.frame without column titles.

Usage

## S4 method for signature 'PSICQUIC'
rawQuery(object, provider, rawArgs)

Arguments

object

a PSICQUIC object.

provider

a character object, one of the approximately two dozen PSCIQUIC-compliant services.

rawArgs

A character string which follows MIQL syntax, which is defined here:

http://code.google.com/p/psicquic/wiki/MiqlReference27

The encoding of special characters (spaces and parentheses in particular) is handled by this method, so there is no need to replace, for instance, spaces or parens with their url-safe hex codes.

Value

A data.frame with 15 columns, and one row for every interaction, described as an annotated A/B relationship, with self-describing column names.

Author(s)

Paul Shannon

See Also

providers, interactions, addGeneInfo, IDMapper, interactionTypes, detectionMethods, speciesIDs

Examples

    psicquic <- PSICQUIC()
    providers <- providers(psicquic)

       # query BioGrid for all known ALK interactions

    if("BioGrid" %in% providers){
        tbl.1 <- rawQuery(psicquic, providers[1], "identifier:ALK AND species:9606")
          # what publications?
        table(tbl.1$V8)
        }

      # query the iRefIndex provider for interactions between
      # two specified ids.  then further contrain by publication.

    if("iRefIndex" %in% providers){
       rawArgs.1 <- "identifier:(ALK AND MAP3K3) AND species:9606"
       tbl.2 <- rawQuery(psicquic, "iRefIndex", rawArgs.1)
       rawArgs.2 <- paste(rawArgs.1, " AND pubid:(15657099 OR 14743216)", sep="")
       tbl.3 <- rawQuery(psicquic, "iRefIndex", rawArgs.2)
       }

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PSICQUIC)
Loading required package: IRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: biomaRt
Loading required package: httr
Loading required package: plyr

Attaching package: 'plyr'

The following object is masked from 'package:IRanges':

    desc

The following object is masked from 'package:S4Vectors':

    rename

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/PSICQUIC/rawQuery.Rd_%03d_medium.png", width=480, height=480)
> ### Name: rawQuery
> ### Title: rawQuery
> ### Aliases: rawQuery rawQuery,PSICQUIC-method
> ###   S4method{rawQuery}{PSICQUIC}
> ### Keywords: utilities
> 
> ### ** Examples
> 
>     psicquic <- PSICQUIC()
>     providers <- providers(psicquic)
> 
>        # query BioGrid for all known ALK interactions
> 
>     if("BioGrid" %in% providers){
+         tbl.1 <- rawQuery(psicquic, providers[1], "identifier:ALK AND species:9606")
+           # what publications?
+         table(tbl.1$V8)
+         }

        Bonvini P et al. (2002)     Bouwmeester T et al. (2004) 
                              4                               1 
      Crockett DK et al. (2004) H<c3><bc>binger G et al. (1999) 
                             57                               2 
          Lind SE et al. (1991)          Miyake I et al. (2002) 
                              1                               1 
        Morris SW et al. (1997)          Ouyang T et al. (2003) 
                              4                               2 
         Polgar D et al. (2005)         Stoica GE et al. (2001) 
                              1                               1 
        Stoica GE et al. (2002)            Zamo A et al. (2002) 
                              1                               1 
> 
>       # query the iRefIndex provider for interactions between
>       # two specified ids.  then further contrain by publication.
> 
>     if("iRefIndex" %in% providers){
+        rawArgs.1 <- "identifier:(ALK AND MAP3K3) AND species:9606"
+        tbl.2 <- rawQuery(psicquic, "iRefIndex", rawArgs.1)
+        rawArgs.2 <- paste(rawArgs.1, " AND pubid:(15657099 OR 14743216)", sep="")
+        tbl.3 <- rawQuery(psicquic, "iRefIndex", rawArgs.2)
+        }
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>