Teichlab / cellphonedb

MIT License
339 stars 105 forks source link

sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: interaction_table.id_cp_interaction #262

Open ntran95 opened 3 years ago

ntran95 commented 3 years ago

Hello,

I'm attempting to run cellphonedb database generate using my own user curated interactions however I'm encountering the following error:

  File "/home/nt2473/miniconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1257, in _execute_context
    cursor, statement, parameters, context
  File "/home/nt2473/miniconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 590, in do_executemany
    cursor.executemany(statement, parameters)
sqlite3.IntegrityError: UNIQUE constraint failed: interaction_table.id_cp_interaction

Here's the command I used to generate the database:

cellphonedb database generate  --user-protein user_protein_input.csv \ 
 --user-gene user_gene_input_uniq.csv \
 --user-interactions user_interaction_input_no_duplicates.csv \
 --user-complex user_complex_input.csv \
 --result-path user_db_out_uniq --user-interactions-only

Here's what my user_interaction_input_no_duplicates.csv file looks like:

image

When I open the output .db file on a DB Brower, interaction_table is empty

Attached is the full error log output: error_log.txt

Any insights is greatly appreciated, thanks!

prete commented 3 years ago

Without having a look at the whole user_interaction_input_no_duplicates.csv it's hard to tell. But, like the error suggests, perhaps there are duplicated id_cp_interaction in the input file.

pidoc commented 3 years ago

Hi, I also facing the same problem - I verified that my your_custom_inter-action_file.csv is not duplicated and matching with the proteinand gene.csv.

Here is the rest of the error: sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: interaction_table.id_cp_interaction [SQL: INSERT INTO interaction_table (annotation_strategy, source, id_cp_interaction, multidata_1_id, multidata_2_id) VALUES (?, ?, ?, ?, ?)] [parameters: (('user_curated', 'uniprot', 'CPI-SS05965E50F', 3140.0, 7593), ('user_curated', 'uniprot', 'CPI-SS05F81F445', 5980.0, 7593), ('user_curated', 'uniprot', 'CPI-SS0BC5D9645', 6330.0, 7593), ('user_curated', 'uniprot', 'CPI-SS0FC7E98D3', 472.0, 7834), ('user_curated', 'unipro [cellphone_customDB.zip](https://github.com/Teichlab/cellphonedb/files/6289263/cellphone_customDB.zip) t', 'CPI-SS03B0542B5', 517.0, 7834), ('user_curated', 'uniprot', 'CPI-SS02DCF92EB', 1009.0, 7834), ('user_curated', 'uniprot', 'CPI-SS0D2027CED', 1908.0, 7834), ('user_curated', 'uniprot', 'CPI-SS0364CC2C3', 2154.0, 7834) ... displaying 10 of 50 total bound parameter sets ... ('user_curated', 'uniprot', 'CPI-SS01C1B88E6', 472.0, 8254), ('user_curated', 'uniprot', 'CPI-SS0A3B788BE', 2272.0, 8254))] (Background on this error at: http://sqlalche.me/e/13/gkpj) cellphone_customDB.zip

Any Ideas? @ntran95 did you solve it? Thank! Jo

prete commented 3 years ago

Hi @pidoc, could you provide a minimal set of input files to reproduce this error? That would help us debug the issue.

jwang0611 commented 1 year ago

Hi @ntran95, I met with same issue and also input with deduplicated interaction list. Have you resolved the problem? Thanks!