| Title: | R Interface to the 'ClassyFire' REST API |
|---|---|
| Description: | Access to the 'ClassyFire' REST API <http://classyfire.wishartlab.com>. Retrieve existing entity classifications and submit new entities for classification. |
| Authors: | Tom Wilson [aut, cre] (ORCID: <https://orcid.org/0000-0003-3112-4682>), Jasen Finch [aut], Gordon Getzinger [ctb], Florian Schmidt [ctb] |
| Maintainer: | Tom Wilson <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.3.8 |
| Built: | 2026-05-29 09:58:39 UTC |
| Source: | https://github.com/wilsontom/classyfireR |
Get the alternative_parents
Get the alternative_parents
alternative_parents(object) ## S4 method for signature 'ClassyFire' alternative_parents(object) ## S4 method for signature 'Query' alternative_parents(object)alternative_parents(object) ## S4 method for signature 'ClassyFire' alternative_parents(object) ## S4 method for signature 'Query' alternative_parents(object)
object |
a |
a tbl_df of alternative parents
a tbl_df of alternative parents
Get the predicted ChEBI identifications
Get the predicted ChEBI identifications
chebi(object) ## S4 method for signature 'ClassyFire' chebi(object) ## S4 method for signature 'Query' chebi(object)chebi(object) ## S4 method for signature 'ClassyFire' chebi(object) ## S4 method for signature 'Query' chebi(object)
object |
a |
a character vector of ChEBI terms
a character vector of ChEBI terms
Get the ClassyFire classification results
Get the ClassyFire classification results
classification(object) ## S4 method for signature 'ClassyFire' classification(object) ## S4 method for signature 'Query' classification(object)classification(object) ## S4 method for signature 'ClassyFire' classification(object) ## S4 method for signature 'Query' classification(object)
object |
a |
a tbl_df of classifications
a tbl_df of classifications
A S4 class to store the results from the ClassyFire RESTful API
metaa list of the input SMILE, InChI Key and classification version used
classificationa tibble of the ClassyFire classification results
direct_parenta list of the direct parent
alternative_parentsa tibble of alternative parents
predicted_chebia character vector of the predicted ChEBI terms
external_descriptorsa tibble of any external identificatons
descriptiona character string of the compound description
Get the ClassyFire description
Get the ClassyFire description
description(object) ## S4 method for signature 'ClassyFire' description(object) ## S4 method for signature 'Query' description(object)description(object) ## S4 method for signature 'ClassyFire' description(object) ## S4 method for signature 'Query' description(object)
object |
a |
a character string of the classification description
a character string of the classification description
Get the external descriptors
Get the external descriptors
descriptors(object) ## S4 method for signature 'ClassyFire' descriptors(object) ## S4 method for signature 'Query' descriptors(object)descriptors(object) ## S4 method for signature 'ClassyFire' descriptors(object) ## S4 method for signature 'Query' descriptors(object)
object |
a |
a tbl_df of available external descriptors
a tbl_df of available external descriptors
Get the direct_parent
Get the direct_parent
direct_parent(object) ## S4 method for signature 'ClassyFire' direct_parent(object) ## S4 method for signature 'Query' direct_parent(object)direct_parent(object) ## S4 method for signature 'ClassyFire' direct_parent(object) ## S4 method for signature 'Query' direct_parent(object)
object |
a |
a list of the direct parent
a list of the direct parent
Retrieve entity classification from ‘http://classyfire.wishartlab.com/entities/’. The optional local cache function enables classification requests with less waiting time. Furthermore, there will be fewer traffic on the classyFire servers. For best high efficiency there is an option for creating a SQLight database to cache results.
get_classification(inchi_key, conn = NULL)get_classification(inchi_key, conn = NULL)
inchi_key |
a character string of a valid InChIKey |
conn |
a DBIConnection object, as produced by dbConnect |
a ClassyFire S4 object.
ClassyFire-class
## Not run: # Valid InChI key where all four classification levels are available get_classification('BRMWTNUJHUMWMS-LURJTMIESA-N') # Valid InChI key where only three classification levels are available get_classification('MDHYEMXUFSJLGV-UHFFFAOYSA-N') # Invalid InChI key get_classification('MDHYEMXUFSJLGV-UHFFFAOYSA-B') ## End(Not run)## Not run: # Valid InChI key where all four classification levels are available get_classification('BRMWTNUJHUMWMS-LURJTMIESA-N') # Valid InChI key where only three classification levels are available get_classification('MDHYEMXUFSJLGV-UHFFFAOYSA-N') # Invalid InChI key get_classification('MDHYEMXUFSJLGV-UHFFFAOYSA-B') ## End(Not run)
Retrieves the classification results for a given query.
get_query(query_id, format = c("json", "sdf", "csv"))get_query(query_id, format = c("json", "sdf", "csv"))
query_id |
query_id a numeric value for the ID of the query. |
format |
a string of the format of the query (either JSON, CSV, or SDF) |
the parsed text output displaying the classification results for
Get the ClassyFire meta data
Get the ClassyFire meta data
meta(object) ## S4 method for signature 'ClassyFire' meta(object) ## S4 method for signature 'Query' meta(object)meta(object) ## S4 method for signature 'ClassyFire' meta(object) ## S4 method for signature 'Query' meta(object)
object |
a |
a list of meta data
a list of meta data
Creates a SQLight database for the local caching. This database includes already queried Inchikeys and the serialized classification object.
open_cache(dbname = ":memory:")open_cache(dbname = ":memory:")
dbname |
The path to the database file. SQLite keeps each database instance in one single file. The name of the database is the file name, thus database names should be legal file names in the running platform. There are two exceptions: "" will create a temporary on-disk database. The file will be deleted when the connection is closed. ":memory:" or "file::memory:" will create a temporary in-memory database. |
conn a DBIConnection object, as produced by dbConnect
A S4 class to store the results from the ClassyFire RESTful API Queries
metaa 'tibble' of the input SMILE, InChI Key and classification version used
classificationa tibbles of the ClassyFire classification results
direct_parenta tibbles the direct parent
alternative_parentsa tibbles of alternative parents
predicted_chebia list of character vectors of the predicted ChEBI terms
external_descriptorsa list of tibbles of any external identifications
descriptiona list of character vectors for the compound descriptions
unclassifieda character string of any input structures that failed the ClassyFire classification
show-ClassyFire
show-Query
## S4 method for signature 'ClassyFire' show(object) ## S4 method for signature 'Query' show(object)## S4 method for signature 'ClassyFire' show(object) ## S4 method for signature 'Query' show(object)
object |
a |
Submits a ClassyFire query in a JSON format.
submit_query(label, input, type = "STRUCTURE")submit_query(label, input, type = "STRUCTURE")
label |
a string the label of the query. |
input |
a named list or vector of SMILES strings. |
type |
a string the type of the query. |
A list of tibbles named by input name.
## Not run: input <- c(MOL1 = 'CCCOCC', MOL2 = 'COCC=CCC') submit_query(label = 'query_test', input = input, type = 'STRUCTURE') ## End(Not run)## Not run: input <- c(MOL1 = 'CCCOCC', MOL2 = 'COCC=CCC') submit_query(label = 'query_test', input = input, type = 'STRUCTURE') ## End(Not run)
Get the identifiers of any inputs that were not classified
unclassified(object) ## S4 method for signature 'Query' unclassified(object)unclassified(object) ## S4 method for signature 'Query' unclassified(object)
object |
a |
a character string of inputs that were not successfully classified