R/test.R

Defines functions test_lipinski_rule

Documented in test_lipinski_rule

#' Test Lipinski's Rule of Five
#'
#' This function tests Lipinski's Rule of Five based on calculated molecular properties.
#'
#' @param properties_df Data frame with molecular properties.
#' @return A vector indicating whether each molecule passes or fails Lipinski's Rule of Five.
#' @export
test_lipinski_rule <- function(properties_df) {
  pass_rule <- with(properties_df, 
                    MW <= 500 & 
                      nHBDon <= 5 & 
                      nHBAcc <= 10 & 
                      ALogP <= 5)
  result <- ifelse(pass_rule, "Pass", "Fail")
  return(result)
}

#' @examples
#' test_lipinski_rule(properties_df)

Try the LipinskiFilters package in your browser

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

LipinskiFilters documentation built on May 29, 2024, 1:37 a.m.