-
Notifications
You must be signed in to change notification settings - Fork 6
Frequently Asked Questions
There's a known bug in the ete3
package that can cause error messages along the lines of:
sqlite3.IntegrityError: UNIQUE constraint failed: synonym.spname, synonym.taxid
This is related to an issue with how ete3
creates the sqlite database from the NCBI taxonomy (see #469. To fix it you can attempt to edit the ncbiquery.py
file contained in the ete3 package.
Locate the file by running:
find $CONDA_PREFIX -name "ncbiquery.py"
Now, using your favourite text editor, open the file at either:
- Line 802 and change:
db.execute("INSERT OR REPLACE INTO synonym (taxid, spname) VALUES (?, ?);", (taxid, spname))
to
db.execute("INSERT or IGNORE INTO synonym (taxid, spname) VALUES (?, ?);", (taxid, spname))
- OR at line 785 and change:
CREATE TABLE synonym (taxid INT,spname VARCHAR(50) COLLATE NOCASE, PRIMARY KEY (spname, taxid));
to
CREATE TABLE synonym (taxid INT,spname VARCHAR(50), PRIMARY KEY (spname, taxid));
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
This error can occurr when there are sequences in the database linked to a taxonomic id with several entries per taxonomic rank. For instance, Howler monkey has:
taxid: 182248
name: Alouatta palliata mexicana
rank | superkingdom | phylum | order | genus | species | class | family | class |
---|---|---|---|---|---|---|---|---|
182248 | 2759 | 7711 | 9443 | 9499 | 30589 | 40674 | 378855 | 1338369 |
As you can see, the double entry for class
is what's causing the issue here.