Repository navigation
Closed
Description
I seem to be unable to use the Bingo cartridge with RPostgres. The Bingo cartridge allows doing in-database chemoinformatic queries against different representations of molecules: https://lifescience.opensource.epam.com/bingo/user-manual-postgres.html#queries
library(RPostgres)
library(DBI)
library(tidyverse)
con <- DBI::dbConnect(
RPostgres::Postgres(),
host=host_name,
port=port,
user=user_name,
password=password)
rs <- DBI::dbSendQuery("select * from compounds where mol_structure @ ('CN', '')::Bingo.sub;")gives this error:
Error: Failed to prepare query: ERROR: operator does not exist: text @ bingo.sub
LINE 1: SELECT * FROM compound WHERE mol_structure @ ('CN', '')::bingo...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.The same query with RPostgreSQL works:
library(RPostgreSQL)
library(DBI)
library(tidyverse)
con <- DBI::dbConnect(
DBI::dbDriver("PostgreSQL"),
host=host_name,
port=port,
user=user_name,
password=password)
rs <- DBI::dbSendQuery("select * from compounds where mol_structure @ ('CN', '')::Bingo.sub;")
data <- DBI::dbFetch(rs, n=-1)!> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] forcats_0.4.0 stringr_1.4.0 dplyr_0.8.5
[4] purrr_0.3.4 readr_1.3.1 tidyr_1.0.2
[7] tibble_3.0.0 ggplot2_3.2.1 tidyverse_1.3.0.9000
[10] RPostgreSQL_0.6-2 DBI_1.1.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 cellranger_1.1.0 pillar_1.4.3 compiler_3.6.3
[5] dbplyr_1.4.3.9000 RPostgres_1.2.0 tools_3.6.3 bit_1.1-15.2
[9] lubridate_1.7.4 jsonlite_1.6.1 lifecycle_0.2.0 nlme_3.1-144
[13] gtable_0.3.0 lattice_0.20-38 pkgconfig_2.0.3 rlang_0.4.5
[17] reprex_0.3.0 rstudioapi_0.11 cli_2.0.2 haven_2.2.0
[21] withr_2.1.2 xml2_1.2.2 httr_1.4.1 fs_1.3.1
[25] generics_0.0.2 vctrs_0.2.4 hms_0.5.3 bit64_0.9-7
[29] grid_3.6.3 tidyselect_1.0.0 glue_1.4.0 R6_2.4.1
[33] fansi_0.4.1 readxl_1.3.1 modelr_0.1.6 blob_1.2.1
[37] magrittr_1.5 backports_1.1.5 scales_1.1.0 ellipsis_0.3.0
[41] rvest_0.3.5 assertthat_0.2.1 colorspace_1.4-1 stringi_1.4.6
[45] lazyeval_0.2.2 munsell_0.5.0 broom_0.5.4 crayon_1.3.4Metadata
Metadata
Assignees
Labels
No labels
Activity
krlmlr commentedon Sep 28, 2020
Thanks. The reason here might be that RPostgres prepares all queries and RPostgreSQL does not. We need support for
dbSendQuery(immediate = FALSE)in this package.krlmlr commentedon Dec 26, 2020
Now in #272.
github-actions commentedon Dec 27, 2021
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.