Query to reproduce SIF download from Pathway Commons PCViz
1
0
Entering edit mode
mamillerpa • 0
@mamillerpa-8668
Last seen 6.9 years ago
United States

Could someone please recommend a query for getting the proteins that interact with a single gene from Pathway Commons?  I would be glad to use paxtoolsr or a raw SPARQL query.  I have browsed the documentation for paxtoolsr, but I am having a hard time determining which sources and properties to use.  

For the gene PTGS2, I can get the data I want by surfing to http://www.pathwaycommons.org/about/, entering PTGS2 where it says "enter a gene" and clicking "start exploring."  That takes me to http://www.pathwaycommons.org/pcviz/#neighborhood/ptgs2 where I click on download to SIF.  That gives me http://www.pathwaycommons.org/pc2//graph?source=PTGS2&kind=neighborhood&format=BINARY_SIF

 

This example is close to what I have in mind, but it takes a path as input, not a single gene. 

genes <- c("AKT1", "IRS1", "MTOR", "IGF1R") 
t1 <- graphPc(source = genes, kind = "PATHSBETWEEN", format = "BINARY_SIF", verbose = TRUE)

 

thanks,

Mark

 

paxtools sparql sif • 1.4k views
ADD COMMENT
0
Entering edit mode
mamillerpa • 0
@mamillerpa-8668
Last seen 6.9 years ago
United States

If anyone else is wondering, this is extremely straighforward.  I had tried this appraoch several days ago, but got corrupted results in my primary enviroment.  See below if interested.

library(paxtoolsr)
# can visualize with igraph or other libraries
library(igraph)

my.gene <- "PTGS2"
pc.result <-
  graphPc(
    source = my.gene, kind = "NEIGHBORHOOD", format = "BINARY_SIF", verbose = TRUE
  )
my.gene.flag <- pc.result$PARTICIPANT_B == my.gene
ceo.flag <- pc.result$INTERACTION_TYPE == "controls-expression-of"
ceo.frame <- pc.result[ceo.flag & my.gene.flag ,]
# lazy and sloppy elimintation of microRNAs
ceo.frame <- ceo.frame[-grep("^MI", ceo.frame$PARTICIPANT_A) ,]
g <-
  graph.edgelist(as.matrix(ceo.frame[, c(1, 3)]), directed = FALSE)
plot(g, layout = layout.fruchterman.reingold)

 

Under R 3.2.2, RStudio 0.99.485 on Windows 7, the graphPc query returned 39075 neighbors (as strings) and the script ran to completion.  Under  R 3.2.2, RStudio Server 0.99.485 on CentOS 6.7, I got only 58 neighbors as factors, the warnings below, and nothing after I applied my filters.

Warning messages:
1: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
  EOF within quoted string
2: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
  number of items read is not a multiple of the number of columns
ADD COMMENT

Login before adding your answer.

Traffic: 729 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6