Closed JackyHess closed 4 years ago
I have encountered the same error, can't figure out why !
I just decided to try and improve my OrgDb object by using the goTable= argument. Leaving it null avoids this error. I am chasing through AnnotationForge in an attempt to hunt down the offending DBI; at first glance, I am guessing it is in a combination of AnnotationForge:::.makeNewGOTables() and AnnotationForge:::.addOntologyData(). I haven't traced it fully yet, though; but if I were to guess, I think the error is coming from the dbGetQuery() call on the first line of makeNewGOTTables().
We are looking into this issue now.
I decided to poke at this over the weekend. For my scenario, I found a table naming collision. So I renamed my table and all was solved. In the process of tracing this, I replaced most of the dbGetQuery() calls in makeOrgPackage.R/makeOrgPackageFromNCBI.R with dbExecute() and removed some unneeded paste()s in the various SQL strings. Thus I am now only getting a couple of warnings when calling makeOrgPackage(). If these changes are of interest, I would be happy to send a PR or diff. However, the changes are a bit messy at the moment, I left all the original statements commented in place in case my changes were incorrect and I have not yet deleted them.
I'm glad to hear things are working a little better. I've been trying to replicate your problem, but am not able to with the given information. I'd be happy to look further into this if I could get a reproducible example. It looks like this is an issue that several people are having so I would like to make a change to fix this that we can push to the next version of AnnotationForge.
Oh, to replicate just make sure that there is an existing table named 'go' with some data in it.
Just so we have a common example, can you write it in code?
@JackyHess - To potentially fix this issue/reproduce it, it would be helpful to know what data you are using. I cannot run the code you provide without having the data. If you could provide some insight to the data used then we can work on fixing this issue. Thanks!
TL;DR: I fixed it for myself, and the problem is obscure and minor. The only likely thing of use to you is the fact that, while searching for it, I switched out some deprecated sqlite statements with what I think are the new recommendation.
Here is the long version and I think it will show why I didn't just give you the exact data and code in my first query; it is in the middle of a long series of data collection tasks.
My problems cropped up when invoking the make_eupath_orgdb() function, available here:
https://github.com/abelew/EuPathDB/blob/master/R/make_eupath_orgdb.R
The goal is to create orgdb instances from the various webservices under the eupathdb.org umbrella. The error came about due to how I was creating the arguments for makeOrgPackage() (the invocation is at line 413, but the arguments are created at lines: 250-263). Line 259 shows the cause of the error, if it says '"goTable" = "go"', then when makeOrgPackage() makes its own go table, there will be two of them, which does not end well. The simple solution for me was to simply change it (which I did). The slightly more complex solution would be to have some logic in makeOrgPackage() to check for an existing table named 'go' and rename/remove/warn it, but that is almost certainly more trouble than it is worth.
For a truly reproducible example, one must change line 259 back to '"goTable" = "go"', install the package, and run the following (using my favorite species as an example):
meta <- download_eupath_metadata(webservice="tritrypdb")
lm_entry <- get_eupath_entry(species="Leishmania major", metadata=meta)
test_major <- make_eupath_orgdb(entry=lm_entry)
When I run the code, I also meet the question.
@computbiol - Would you be able to provide a print out of the error that you get? This will help me better understand where you are having issues.
Also, have you thought of utilizing the Bioconductor org.At.tair.db
annotation package? This would bypass the need to create your own.
@computbiol - Would you be able to provide a print out of the error that you get? This will help me better understand where you are having issues.
Also, have you thought of utilizing the Bioconductor
org.At.tair.db
annotation package? This would bypass the need to create your own.
This is the error. Because i need create annotation of other species(GS115), so i want to create my own.
Populating genes table:
genes table filled
Populating go table:
go table filled
Populating pub_info table:
pub_info table filled
Populating symbol_info table:
symbol_info table filled
Populating function_info table:
Error: NOT NULL constraint failed: function_info.SHORT_DESCRIPTION
In addition: There were 28 warnings (use warnings() to see them)
Execution halted
@computbiol - This seems to be a completely different issue. The original reported issues deals with the error:
Error in attributes(.Data) <- c(attributes(.Data), attrib) :
'names' attribute [312311] must be the same length as the vector [1]
Your error message is different, indicating there is a NOT NULL
constraint that failed in the SHORT_DESCRIPTION column of the func_df
table. I've made a slight modification to your code and was able to build the package with no issues. My changes are to lines 58-61 of the org.At.tair.db.R file, see them below:
# I would edit the DESCRIPTION first
# and be sure to drop the ';' from the DESCRIPTION as well
func_df$DESCRIPTION <- gsub(";\\(source:Araport11\\)","", func_df$DESCRIPTION)
# then do the ifelse() for SHORT_DESCRIPTION
# but instead of NA use the DESCRIPTION
func_df$SHORT_DESCRIPTION <- ifelse(nchar(func_df$SHORT_DESCRIPTION) == 0,
func_df$DESCRIPTION, func_df$SHORT_DESCRIPTION)
I assumed that if SHORT DESCRIPTION is NA
then the DESCRIPTION should be used instead. I think the function is expecting that there be no NA
's in this column. I could be wrong making this assumption but it works nonetheless.
...
Creating package in /Users/ka36530_ca/open_issues/org.At.tair.db/org.Atair10.eg.db
Now deleting temporary database file
[1] "/Users/ka36530_ca/open_issues/org.At.tair.db/org.Atair10.eg.db"
There were 50 or more warnings (use warnings() to see the first 50)
> install.packages("./org.Atair10.eg.db", repos = NULL,
+ type = "source")
Installing package into ‘/Users/ka36530_ca/R-stuff/bin/R-4-0/4.0-Bioc-3.12/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘org.Atair10.eg.db’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (org.Atair10.eg.db)
I hope this helps!
Hi there,
I'm trying to make a custom annotation package and for some reason makeOrgPackage is having trouble using my input files. Please see below for input file headers, command and error message.
Input files
Command:
Error message:
I can run the provided example just fine and am struggling to identify key differences between the example input and my input.
Any ideas what might be causing this error?