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

Error when running top_priority_effect() second time in pyramid webapp #248

Open
pajanne opened this issue Mar 10, 2021 · 0 comments
Open

Comments

@pajanne
Copy link

pajanne commented Mar 10, 2021

I am facing a strange error when running top_priority_effect() for the second time in my Pyramid WebApp using an SQLite back-end database:

var = Variant(contig=contig, start=start, ref=ref, alt=alt, ensembl=genome)
top_effect = var.effects().top_priority_effect()
consequence = top_effect.__class__.__name__

I've tried running adding genome.clear_cache() before but without any success.
Please find below the error message I get:

Traceback (most recent call last):
  File "/Users/pajanne/workspace/GenEditID-test2projects/python/geneditid/plotter.py", line 195, in get_variant_classification
    top_effect = var.effects().top_priority_effect()
  File "/Users/pajanne/workspace/GenEditID-test2projects/venv/lib/python3.8/site-packages/varcode/variant.py", line 451, in effects
    return predict_variant_effects(
  File "/Users/pajanne/workspace/GenEditID-test2projects/venv/lib/python3.8/site-packages/varcode/effects/effect_prediction.py", line 66, in predict_variant_effects
    gene_ids = variant.gene_ids
  File "/Users/pajanne/workspace/GenEditID-test2projects/venv/lib/python3.8/site-packages/varcode/variant.py", line 423, in gene_ids
    self._gene_ids = self.genome.gene_ids_at_locus(
  File "/Users/pajanne/workspace/GenEditID-test2projects/venv/lib/python3.8/site-packages/pyensembl/genome.py", line 538, in gene_ids_at_locus
    return self.db.distinct_column_values_at_locus(
  File "/Users/pajanne/workspace/GenEditID-test2projects/venv/lib/python3.8/site-packages/pyensembl/database.py", line 402, in distinct_column_values_at_locus
    return self.column_values_at_locus(
  File "/Users/pajanne/workspace/GenEditID-test2projects/venv/lib/python3.8/site-packages/pyensembl/database.py", line 358, in column_values_at_locus
    tuples = self.connection.execute(query, query_params).fetchall()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 123145447256064 and this is thread id 123145464045568.

The only way to make it works so far is to restart the webapp each time I wish to run this code. There must be something better to do to avoid this error message. Please let me know. Many thanks.

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

No branches or pull requests

1 participant