findCompoundsByName | R Documentation |
Find the ids of compounds given the names.
findCompoundsByName(conn, names, keepOrder = FALSE, allowMissing = FALSE)
conn |
A database connection object, such as is returned by |
names |
A list of names of compounds to search for. The names are those that would be
returned by |
keepOrder |
If true, the order of the output compound ids will be the same as the input names. This imposes a performance hit that can be significant for large datasets, thus it should be left FALSE unless needed. |
allowMissing |
When this is false an error will be raised when names queried were not found in the database. If true, just those that are found will be returned with no error or warning. |
Returns the compound ids for compounds with the given name. The output order is not guaranteed unless keepOrder is set to TRUE. An error will be raised if any name cannot be found.
Kevin Horan
#create and initialize a new SQLite database
conn = initDb("test4.db")
data(sdfsample)
#just load the data with no features or descriptors
ids=loadSdf(conn,sdfsample)
# find id of compound 650003
findCompoundsByName(conn,c("650003"))
unlink("test4.db")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.