makeOrgPackage Error in result_bind(res@ptr, params) : NOT NULL constraint failed: genes.GID
1
1
Entering edit mode
yzc706 ▴ 10
@yzc706-21224
Last seen 4.7 years ago

I am trying to make a custom OrgDB ,and have some trouble.

> makeOrgPackage(gene_info = gene_info,
+                go = gene2go,
+                ko = gene2ko,
+                pathway = gene2pathway,
+                maintainer = "*** <***@hotmail.com>",
+                author = "*** <***@hotmail.com>",
+                version = "0.0.1",
+                outputDir = ".",
+                tax_id = tax_id,
+                genus = genus,
+                species = species,
+                goTable = "go")

Populating genes table:
Error in result_bind(res@ptr, params) : 
  NOT NULL constraint failed: genes.GID
In addition: Warning messages:
1: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
2: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
3: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
4: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

the trackback()

> traceback()
15: stop(list(message = "NOT NULL constraint failed: genes.GID", 
        call = result_bind(res@ptr, params), cppstack = list(file = "", 
            line = -1L, stack = "C++ stack not available on this system")))
14: result_bind(res@ptr, params)
13: db_bind(res, as.list(params), ..., allow_named_superset = FALSE)
12: dbBind(rs, params)
11: dbBind(rs, params)
10: .local(conn, statement, ...)
9: dbSendQuery(conn, statement, ...)
8: dbSendQuery(conn, statement, ...)
7: .local(conn, statement, ...)
6: dbGetQuery(con, sql, unclass(unname(geneid)))
5: dbGetQuery(con, sql, unclass(unname(geneid)))
4: .makeGenesTable(genes, con)
3: makeOrgDbFromDataFrames(data, tax_id, genus, species, dbFileName, 
       goTable)
2: .makeOrgPackage(data, version = version, maintainer = maintainer, 
       author = author, outputDir = outputDir, tax_id = tax_id, 
       genus = genus, species = species, goTable = goTable, verbose = verbose)
1: makeOrgPackage(gene_info = gene_info, go = gene2go, ko = gene2ko, 
       pathway = gene2pathway, maintainer = "*** <***@hotmail.com>", 
       author = "*** <***@hotmail.com>", version = "0.0.1", 
       outputDir = ".", tax_id = tax_id, genus = genus, species = species, 
       goTable = "go")

Here are the input dataframes:

> head(gene2go)
# A tibble: 6 x 3
  GID             GO         EVIDENCE
  <chr>           <chr>      <chr>   
1 Chr10T0000100.1 GO:0003674 IEA     
2 Chr10T0000100.1 GO:0003824 IEA     
3 Chr10T0000100.1 GO:0004721 IEA     
4 Chr10T0000100.1 GO:0004722 IEA     
5 Chr10T0000100.1 GO:0005575 IEA     
6 Chr10T0000100.1 GO:0005622 IEA     
> head(gene2ko)
# A tibble: 6 x 2
  GID             Ko    
  <chr>           <chr> 
1 Chr10T0000100.1 K20827
2 Chr10T0000200.1 K13354
3 Chr10T0000300.1 K07760
4 Chr10T0000600.1 K13448
5 Chr10T0000700.1 K22379
6 Chr10T0000900.1 K22379
> head(gene2pathway)
# A tibble: 6 x 2
  GID             Pathway
  <chr>           <chr>  
1 Chr10T0000100.1 ko01009
2 Chr10T0000100.1 ko03021
3 Chr10T0000200.1 ko04146
4 Chr10T0000200.1 ko02000
5 Chr10T0000300.1 ko01001
6 Chr10T0000600.1 ko04626
> head(gene_info)
              GID                                                   GENENAME
1 Chr10T0000100.1 RNA polymerase II subunit B1 CTD phosphatase RPAP2 homolog
2 Chr10T0000200.1                Pentatricopeptide repeat-containing protein
3 Chr10T0000300.1          LRR receptor-like serine threonine-protein kinase
4 Chr10T0000400.1    Belongs to the mitochondrial carrier (TC 2.A.29) family
5 Chr10T0000600.1                                 Belongs to the GRAS family
6 Chr10T0000700.1                                  Bifunctional protein FolD

thank you!

AnnoationForge • 1.9k views
ADD COMMENT
0
Entering edit mode
@danielvantwisk-13028
Last seen 3.8 years ago

I'm not able to replicate this but the failing code in AnnotationForge is:

  message("Populating genes table:")
  sql<- paste("    CREATE TABLE IF NOT EXISTS genes (
      _id INTEGER PRIMARY KEY,
      GID VARCHAR(10) NOT NULL UNIQUE           -- Gene ID
    );")
  dbGetQuery(con, sql)

The GID key is used to join the different tables internally. For this reason, it has NOT NULL and UNIQUE constraints. I assume you've already checked to make certain that the GID column contains no NULLs but it is clear that there are non-unique GIDs in the gene2go table that you've shown.

ADD COMMENT
0
Entering edit mode

How to deal with gene with multiple GO in gene2go table?

ADD REPLY

Login before adding your answer.

Traffic: 647 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6