R/similarity.R
chemical_similarity_threshold.Rd
Requires chemfp installed on the python server.
chemical_similarity_threshold( query, target = NULL, fingerprint_type = c("morgan", "topological"), fingerprint_args = NULL, threshold = 0.7, n_threads = 1, url = "http://127.0.0.1:8000" )
query | A character vector of compounds, optionally named.
Assumed to be InChI. Specify descriptor explicitly or attach
pre-computed fingerprints using |
---|---|
target | A character vector of compounds like |
fingerprint_type | Calculate morgan or topological fingerprints. |
fingerprint_args | Optional list of additional arguments to the RDKit fingerprinting function. |
threshold | A double between 0 and 1 representing the minimum reported similarity. |
n_threads | Number of threads used to process the query |
url | URL to the lspcheminf python server |
A tibble with three columns, containing names of query and target compounds and their similarity.
chemical_similarity_threshold( c("resveratrol" = "InChI=1S/C14H12O3/c15-12-5-3-10(4-6-12)1-2-11-7-13(16)9-14(17)8-11/h1-9,15-17H/b2-1+"), c( "tofacitnib" = "InChI=1S/C16H20N6O/c1-11-5-8-22(14(23)3-6-17)9-13(11)21(2)16-12-4-7-18-15(12)19-10-20-16/h4,7,10-11,13H,3,5,8-9H2,1-2H3,(H,18,19,20)/t11-,13+/m1/s1", "aspirin" = "InChI=1S/C9H8O4/c1-6(10)13-8-5-3-2-4-7(8)9(11)12/h2-5H,1H3,(H,11,12)" ), threshold = 0.1 )#> # A tibble: 1 x 3 #> query score target #> <chr> <dbl> <chr> #> 1 resveratrol 0.132 aspirinchemical_similarity_threshold( compounds( c("a" = "880DF", "b" = "881DF", "c" = "870E0"), descriptor = "fingerprint" ), threshold = 0.8 )#> # A tibble: 1 x 3 #> query score target #> <chr> <dbl> <chr> #> 1 a 0.929 b