targetSelectivity: Returns the target selectivity for a specified list of...

View source: R/queries.R

targetSelectivityR Documentation

Returns the target selectivity for a specified list of compounds (cids).

Description

Queries a BioassayDB database and returns the target selectivity of the specified cids.

Usage

targetSelectivity(database, cids, scoring = "total", 
                  category=FALSE, multiTarget="keepOne")

Arguments

database

A BioassayDB database to query.

cids

A string or integer vector containing query cids referring to a small molecules.

scoring

Must be one of two optional scoring methods "total" or "fraction". Fraction returns the target selectivity for each compound as the fraction of screened distinct targets that showed activity in at least one assay. Total returns the total number of active distinct targets for each compound, and does not consider inactive targets in the calculation. If fractional activity is requested, active values take precedence over inactives: if a target is both active and inactive in different assays it will be regarded as active.

category

Include only once in selectivity counts any targets which share a common annotation of this category (as used by the translateTargetId and loadIdMapping functions). For example, with the PubChem BioAssay database one could use "UniProt", "kClust", or "domains" to get selectivity by targets with unique UniProt identifiers, distinct amino acid sequences, or Pfam domains respectively (the latter is also known as domain selectivity).

multiTarget

Decides how selectivity is counted with regard to multi-target assays. If "drop" these assays are excluded entirely. If "keepOne" only the first target in the database is considered. If "all" they are counted separately towards the total.

Value

Returns an numeric vector containing the target selectivity for each query compound. Returned entires are named by their corresponding cid.

Author(s)

Tyler Backman

See Also

translateTargetId loadIdMapping

Examples

## connect to a test database
extdata_dir <- system.file("extdata", package="bioassayR")
sampleDatabasePath <- file.path(extdata_dir, "sampleDatabase.sqlite")
sampleDB <- connectBioassayDB(sampleDatabasePath)

## make a vector with compounds of interest
compoundsOfInterest <- c(2244, 2662, 3033)

## get "total" active targets for each compound of interest
targetSelectivity(sampleDB, compoundsOfInterest, scoring="total")

## get fraction of active targets for each compound of interest
targetSelectivity(sampleDB, compoundsOfInterest, scoring="fraction")

## disconnect from database
disconnectBioassayDB(sampleDB)

girke-lab/bioassayR documentation built on Oct. 22, 2024, 8:13 a.m.