SearchBIOCYC:

Usage Arguments Examples

Usage

1
SearchBIOCYC(biocyc, organism = "Multiorganism")

Arguments

biocyc
organism

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (biocyc, organism = "Multiorganism") 
{
    switch(organism, Multiorganism = "META", Human = "HUMAN", 
        Ecoli = "ECOLI", Basillus = "BSUB", )
    if (!OBJECTID == "error") {
        url <- paste0("http://websvc.biocyc.org/apixml?fn=pathways-of-compound&id=", 
            organism, ":", biocyc)
        xmlhttp <- getURL(url)
        if (grepl("ptools-xml", xmlhttp, ignore.case = TRUE) == 
            TRUE) {
            if (is.null(xmlhttp)) {
                return("error")
            }
            else {
                doc <- xmlParse(xmlhttp)
                src <- tryCatch(xpathApply(doc, "//common-name", 
                  xmlValue), error = function(e) {
                  NULL
                })
                html <- c("&", "<i>", "</i>")
                for (i in 1:length(html)) {
                  src <- sub(html[i], "", src, fixed = FALSE)
                }
                src <- as.vector(fixlc(src))
                return(src)
            }
        }
        else {
            return("error")
        }
    }
    else {
        return("error")
    }
  }

cherkaos/MetabToPathways documentation built on May 13, 2019, 3:54 p.m.