findCompoundsByName: Find compound by name

Description Usage Arguments Value Author(s) Examples

Description

Find the ids of compounds given the names.

Usage

1
findCompoundsByName(conn, names, keepOrder = FALSE, allowMissing = FALSE)

Arguments

conn

A database connection object, such as is returned by initDb.

names

A list of names of compounds to search for. The names are those that would be returned by sdfid. An error will be raised if any names are not found.

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.

Value

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.

Author(s)

Kevin Horan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
   #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")

girke-lab/ChemmineR-release documentation built on May 17, 2019, 5:26 a.m.