R/searchForNscs.R

Defines functions searchForNscs

Documented in searchForNscs

#' Search for NSCs 
#' 
#' @param pattern a search pattern. This string will be treated as a regular expression 
#'   with the case ignored.  
#' @return A vector of matching NSCs
#' 
#' @details Use this function with caution. Not all compounds have names and 
#'   compounds can have many synonyms not included in CellMiner. 
#'   
#' @examples 
#' searchForNscs("nib$")  
#' 
#' @concept rcellminer
#' @export
searchForNscs <- function(pattern) {
	df <- as(featureData(getAct(rcellminerData::drugData)), "data.frame")
	idx <- grep(pattern, df[, "NAME"], ignore.case = TRUE)
	results <- df[idx, "NSC"]
	names(results) <- df[idx, "NAME"]
	return(results)
}

Try the rcellminer package in your browser

Any scripts or data that you put into this service are public.

rcellminer documentation built on Nov. 26, 2020, 2:02 a.m.