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 with mikado serialise: 'Engine' object has no attribute 'cursor' #450

Open
bbista opened this issue Feb 26, 2024 · 4 comments
Open

Comments

@bbista
Copy link

bbista commented Feb 26, 2024

Hello,
I am having trouble with the mikado serialize step. I get this error every time:

mikado serialise --json-conf configuration.yaml --xml mikado_prepared.blast.tsv --orfs mikado.orfs.gff3 --junctions portcullis_filtered.pass.junctions.bed -bt /uniprot/TSEprotein.faa

Mikado crashed, cause:
'Engine' object has no attribute 'cursor'
Traceback (most recent call last):
File "/home/bbista/.local/lib/python3.9/site-packages/Mikado/main.py", line 68, in main
args.func(args)
File "/home/bbista/.local/lib/python3.9/site-packages/Mikado/subprograms/serialise.py", line 383, in serialise
load_orfs(mikado_configuration, logger)
File "/home/bbista/.local/lib/python3.9/site-packages/Mikado/subprograms/serialise.py", line 183, in load_orfs
serializer()
File "/home/bbista/.local/lib/python3.9/site-packages/Mikado/serializers/orf.py", line 486, in call
self.serialize()
File "/home/bbista/.local/lib/python3.9/site-packages/Mikado/serializers/orf.py", line 461, in serialize
self.load_fasta()
File "/home/bbista/.local/lib/python3.9/site-packages/Mikado/serializers/orf.py", line 260, in load_fasta
cache = pd.read_sql_table("query", self.engine, index_col="query_name", columns=["query_name", "query_id"])
File "/home/bbista/.local/lib/python3.9/site-packages/pandas/io/sql.py", line 385, in read_sql_table
if not pandas_sql.has_table(table_name):
File "/home/bbista/.local/lib/python3.9/site-packages/pandas/io/sql.py", line 2863, in has_table
return len(self.execute(query, [name]).fetchall()) > 0
File "/home/bbista/.local/lib/python3.9/site-packages/pandas/io/sql.py", line 2670, in execute
cur = self.con.cursor()
AttributeError: 'Engine' object has no attribute 'cursor'

The log file for serialize looks like this:
2024-02-26 07:55:35,513 - serialise - serialise.py:321 - INFO - setup - MainProcess - Mikado version: 2.3.4
2024-02-26 07:55:35,513 - serialise - serialise.py:322 - INFO - setup - MainProcess - Command line: /home/bbista/.local/bin/mikado serialise --json-conf configuration.yaml --xml mikado_prepared.blast.tsv --orfs mikado.orfs.gff3 --junctions /work/LAS/nvalenzu-lab/bbista/ASP_final_annot/portcullis_out_ASP/3-filt/portcullis_filtered.pass.junctions.bed -bt /work/LAS/nvalenzu-lab/bbista/uniprot/TSEprotein.faa
2024-02-26 07:55:35,526 - serialise - serialise.py:332 - INFO - setup - MainProcess - Random seed: 0
2024-02-26 07:55:35,526 - serialise - serialise.py:345 - INFO - setup - MainProcess - Using a sqlite database (location: mikado.db)
2024-02-26 07:55:35,526 - serialise - serialise.py:348 - INFO - setup - MainProcess - Requested 1 threads, forcing single thread: False
2024-02-26 07:55:35,526 - serialise - serialise.py:176 - INFO - load_orfs - MainProcess - Starting to load ORF data

I am using Mikado v2.3.4 installed using the following steps:

mamba env create -f environment.yml

pip wheel -w dist .
pip install dist/*whl

I only have issues with the serialise part.

Any help is greatly appreaciated.

Best,
bbista

@jasonshiller
Copy link

@bbista I have the same problem. Did you manage to solve this?

@bbista
Copy link
Author

bbista commented May 28, 2024

@jasonshiller I did not solve it at all. I work in an HPC cluster and I just installed mikado in a different HPC cluster where I do not get this error. Only advice I can give you is to try a different machine.

@VitaxZhang
Copy link

I encountered the same problem as @jasonshiller and @bbista. I installed Mikado using Conda, and the version of Pandas provided was 2.2.x, while the version of SQLAlchemy was 1.4.x. The incompatibility between these two versions is documented pandas-dev/pandas#57049. I downgraded Pandas, and Mikado ran successfully afterward.

@gemygk
Copy link
Collaborator

gemygk commented Dec 10, 2024

Apologies @bbista @jasonshiller @VitaxZhang

I wanted to let you know that I added additional methods for installing Mikado (via Docker, Singularity, and Conda/Mamba) a couple of months ago. Please refer to the updated installation steps here for detailed installation steps.

Please let me know how it goes.

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

4 participants