Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite3.OperationalError #1

Closed
geneticsmcgill opened this issue Apr 8, 2019 · 5 comments
Closed

sqlite3.OperationalError #1

geneticsmcgill opened this issue Apr 8, 2019 · 5 comments
Assignees
Labels

Comments

@geneticsmcgill
Copy link

Hello,

I was using the FOCUS finemap function and seem to be getting the following error. I've munged the dataset and I'm using the recommended LD panel + focus.db. Do you know why I may be getting this error? Thank you so much!

ERROR BELOW:

[2019-04-08 15:54:39 - WARNING] No GWAS SNPs with p-value < 5e-08 found at 1:41975327 - 1:43758457. Skipping
[2019-04-08 15:54:39 - ERROR] (sqlite3.OperationalError) too many SQL variables
[SQL: SELECT weight.id, weight.snp, weight.chrom, weight.pos, weight.effect_allele, weight.alt_allele, weight.effect, weight.std_error, weight.model_id, model.id, model.inference, model.ref_id, model.mol_id, molecularfeature.id, molecularfeature.ens_gene_id, molecularfeature.ens_tx_id, molecularfeature.mol_name, molecularfeature.type, molecularfeature.chrom, molecularfeature.tx_start, molecularfeature.tx_stop, refpanel.id, refpanel.ref_name, refpanel.tissue, refpanel.assay
FROM weight JOIN model ON model.id = weight.model_id JOIN molecularfeature ON molecularfeature.id = model.mol_id JOIN refpanel ON refpanel.id = model.ref_id
WHERE weight.snp IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ....'rs2429049', 'rs673242', 'rs11210864', 'rs3011220', 'rs12746640', 'rs11210913', 'rs3791102', 'rs325145', 'rs3818536', 'rs783304', 'rs12140156', 'rs803682', 'rs72683973', 'rs11210949', 'rs2527776', 'rs574736', 'rs78263317')]
(Background on this error at: http://sqlalche.me/e/e3q8)
[2019-04-08 15:54:39 - INFO] Finished twas & fine-mapping

@quattro
Copy link
Contributor

quattro commented Apr 8, 2019

Hi thanks for your interest in FOCUS. I'm looking into this issue as several users have recently reported it. It looks like sqlite has a limit of the number of variables that can be used within an 'IN' statement (999).

I'm working on a bugfix that will require getting results in batches and joining them together after-the-fact rather than all at once.

@quattro
Copy link
Contributor

quattro commented Apr 16, 2019

Hello @geneticsmcgill , I just released a new version (0.5) of FOCUS that should address this issue. You can install either by pulling the latest from the repo and installing, or using pip.

Please let me know if you have any other questions or issues.

This was fixed by commit: ff06df0

@quattro quattro self-assigned this Apr 16, 2019
@quattro quattro added the bug label Apr 16, 2019
@quattro quattro closed this as completed Apr 16, 2019
@quattro
Copy link
Contributor

quattro commented May 29, 2019

If users are still running into this issue I would recommend updating the sqlite software with conda or another package manager. The software limit implemented in pyfocus is based on a newer sqlite version and there is no clean way to programmatically determine what the limit is. Given that, the simplest solution is to update sqlite.

@BinglanLi
Copy link

BinglanLi commented May 29, 2019

I also ran into this issue and am not sure what sqlite3 version is expected. Here is what I saw when checking the sqlite3 version in python.

`Python 3.6.5 (default, Jun 19 2018, 16:28:05)

[GCC 6.2.0] on linux

Type "help", "copyright", "credits" or "license" for more information.

import sqlite3

sqlite3.version

'2.6.0'

sqlite3.sqlite_version

'3.7.17'`

what version is expected?

@quattro
Copy link
Contributor

quattro commented May 29, 2019

Here is what I have on my end:

In [3]: sqlite3.sqlite_version                                                                                                                                                                                                                                    
Out[3]: '3.26.0'
In [4]: sqlite3.version                                                                                                                                                                                                                                           
Out[4]: '2.6.0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants