Closed komalsrathi closed 3 years ago
Based on your code sample, it seems you are using the toy database rather than a downloaded instance of the ChEMBL database (as well as UniChem ID mappings). To work with your own data it is important to set up the proper working environment by following the instructions provided under section 2.1 of the vignette here. In general when an R vignette uses system.file()
then this points to a resource where your R packages are installed. In many cases you want to follow the instructions how to point to your own environment paths to work with your own data. In this case it is mainly the ChEMBL database you want to download from here. This database file is rather large >20GB. So make sure you store it in a location where you have enough space on your system.
Oh, right! I'll give that a try and close both if it works. Thanks!!
Downloaded the full db and still getting the error:
library(drugTargetInteractions)
genes <- c("HOXC11", "HOXC12")
# obtained from ftp://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb/chembl_29_sqlite.tar.gz
chembldb <- file.path(ref_dir, "chembl", "chembl_29_sqlite", "chembl_29.db")
resultsPath <- system.file("extdata", "results", package = "drugTargetInteractions")
config <- genConfig(chemblDbPath = chembldb, resultsPath = resultsPath)
downloadUniChem(config = config)
cmpIdMapping(config = config)
idMap <- getSymEnsUp(EnsDb = "EnsDb.Hsapiens.v86", ids = genes, idtype = "GENE_NAME")
ens_gene_id <- idMap$ens_gene_id
queryBy <- list(molType="gene", idType = "ensembl_gene_id", ids = names(ens_gene_id))
res_list <- getParalogs(queryBy)
# runDrugTarget_Annot_Bioassay
drug_target_list <- runDrugTarget_Annot_Bioassay(res_list = res_list,
up_col_id = "ID_up_sp",
ens_gene_id = ens_gene_id,
config = config)
Error in vapply(names(ensids), function(x) ens_gene_id[ensids[[x]]], character(1)) :
values must be length 1,
but FUN(X[[1]]) result is length 2
My db looks right:
du -sh $refdir/chembl/chembl_29_sqlite/chembl_29.db
20G $refdir/chembl/chembl_29_sqlite/chembl_29.db
It appears there were some changes in the table structures of the latest ChEMBL29 release from July. I have committed a fix for this to the GitHub repos of the package. For those changes to be life on Bioconductor it can take ~2-3 days. To get the changes immediately on your system, you can install the updated package from GitHub directly as shown below. The additional sample code should work.
devtools::install_github("girke-lab/drugTargetInteractions@RELEASE_3_13") # intalls release (for devel drop @...)
library(drugTargetInteractions)
packageVersion("drugTargetInteractions") # should return 1.0.2 or 1.1.2
chembldb <- "./downloads/chembl_29_sqlite/chembl_29.db" # Assumes chembl db is in downloads dir
config <- genConfig(chemblDbPath=chembldb) # default creates ./results directory where unichem mappings will be stored
downloadUniChem(config=config) # Downloads lookup data
cmpIdMapping(config=config) # Generates lookup table and stores in path defined under config
gene_name <- c("HOXC11", "HOXC12", "PTGS1")
idMap <- getSymEnsUp(EnsDb="EnsDb.Hsapiens.v86", ids=gene_name, idtype="GENE_NAME")
queryBy <- list(molType="protein", idType="UniProt_ID", ids=names(idMap$up_gene_id))
qresult <- drugTargetAnnot(queryBy, config=config)
qresult[1:6,1:14] # Inspect result
gene_name <- c("HOXC11", "HOXC12", "PTGS1")
idMap <- getSymEnsUp(EnsDb = "EnsDb.Hsapiens.v86", ids = gene_name, idtype = "GENE_NAME")
ens_gene_id <- idMap$ens_gene_id
queryBy <- list(molType="gene", idType = "ensembl_gene_id", ids = names(idMap$ens_gene_id))
res_list <- getParalogs(queryBy)
drug_target_list <- runDrugTarget_Annot_Bioassay(res_list=res_list, up_col_id="ID_up_sp", ens_gene_id, config=config)
sapply(drug_target_list, dim) # Prints list summary
drug_target_list$Annotation[1:11,-18] # Inspect annotation results
drug_target_list$Bioassay[1:11,] # Inspect bioassay results
Thank you for your quick response, I will test this tomorrow and close this if works.
Works as expected, thanks!
Hi,
I am trying to get the following code working, this is taken from the manual: https://www.bioconductor.org/packages/devel/bioc/vignettes/drugTargetInteractions/inst/doc/drugTargetInteractions.html#7_Workflow_to_Run_Everything
The code works on your example genes i.e. CA7 and CFTR but does not work on several other genes including the example below:
Error:
Session Info:
Also posted on: https://support.bioconductor.org/p/9139193/