gbouras13 / pypolca

Standalone Python re-implementation of the POLCA polisher from MaSuRCA
MIT License
27 stars 1 forks source link

Exception ignored in sys.unraisablehook: <built-in function unraisablehook> #21

Closed hempelc closed 1 month ago

hempelc commented 2 months ago

Hello,

I'm running into a cryptic error when running pypolca and was hoping you've seen this one before and can help me out.

I'm running pypolca with this command:

pypolca run -a $long_reads -1 $short_reads_R1 -2 $short_reads_R2 -m 11G -f -t 40 -o pypolca_results --careful

Where long_read is a fasta file and the short reads are fq.gz files.

Here is the log (only posting one line before the error message and the error message itself):

2024-08-16 22:10:53.194 | INFO     | pypolca.utils.external_tools:run:52 - Done running bwa index pypolca_results/temp/assembly.fasta
--- Logging error in Loguru Handler #0 ---
--- Logging error in Loguru Handler #2 ---
Traceback (most recent call last):
Exception ignored in atexit callback: <bound method Logger.remove of <loguru.logger handlers=[(id=3, level=40, sink=<lambda>)]>>
Exception ignored in sys.unraisablehook: <built-in function unraisablehook>

I'm running this in a mamba environment on an Ubuntu SLURM computer cluster, if that helps.

Thank you!

gbouras13 commented 2 months ago

Hi @hempelc ,

This is very bizarre - the error seems to be with loguru.

Perhaps try pip uninstall loguru followed by pip install loguru.

George

hempelc commented 2 months ago

Hi @gbouras13 , Thanks for getting back to me so quickly!

I tried to reinstall loguru in the mamba environment but mamba weirdly gave me an error and did not let me uninstall it. I then switched to pip and installed pypolca with pip. In both cases, the loguru version is 0.7.2.

However, I was not able to run pypolca installed via pip since it was missing a lot of dependencies that would have been too cumbersome to install by hand.

Would you mind testing if you can reproduce the error with the same loguru version (0.7.2)?

Thanks! Chris

gbouras13 commented 2 months ago

Hi @hempelc ,

I have tested it on my cluster - no issues. Loguru is a very strange program to fail - my guess is BWA is failing and passing something strange to it.

Do you mind trying out this sample on a different machine to see if you get the same error? Pypolca is pretty lightweight so should be fine on eg a laptop.

George

hempelc commented 2 months ago

Hi @gbouras13,

I tested pypolca on a subset of reads on my local machine and it ran without a problem. I couldn't test the entire sample since it's 100s of GB large, but the small subsample should have failed as well if there were any issues with the installation. So it looks like it's an issue with the pypolca installation on the supercomputer I'm using. No exactly sure how to fix that as the installation seems to run fine. Any idea?

gbouras13 commented 2 months ago

@hempelc ,

Probably I recommend the container in that case (assuming your cluster can use singularity/apptainer). I'll add some documentation to the README.

George

gbouras13 commented 2 months ago

The documentation is here https://github.com/gbouras13/pypolca?tab=readme-ov-file#container

George

hempelc commented 2 months ago

Thanks George, I'll give it a try!

hempelc commented 1 month ago

Hi George, just wanted to give you an update that it ran smoothly with the container via singularity. Thanks for your help! Best, Chris