Source

pyrna-rest-clients / src / annotate3d.R

Full commit
#!/usr/bin/env Rscript --slave

#You need to install the libraries RCurl and rjson to use this script
library("RCurl")
library("rjson")

argv <- commandArgs(TRUE)

if (length(argv) == 0) {
  cat("I need a pdb_Id...", "\n")
  q()
}

pdbId <- argv[1]
url <- paste("http://arn-ibmc.in2p3.fr/api/compute/2d?pdbid=", pdbId, "&tool=rnaview", sep="")

annotations <- fromJSON(httpGET(url))

for (i in 1:length(annotations)) {
  count <- length(annotations[[i]]$`2D`$tertiaryInteractions)
  cat("Number of tertiary interactions in chain", annotations[[i]]$`2D`$rna$name , ":", count, "\n") 
}