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

ValueError: max() arg is an empty sequence #106

Open
sandravelascoc opened this issue Oct 3, 2024 · 5 comments
Open

ValueError: max() arg is an empty sequence #106

sandravelascoc opened this issue Oct 3, 2024 · 5 comments

Comments

@sandravelascoc
Copy link

sandravelascoc commented Oct 3, 2024

Hi, everyone:

I am running docker/singularity version of MitoHiFi with apptainer as:

apptainer run -C -B /home -B /project -B /scratch -W ${SLURM_TMPDIR} mitohifi.sif python3 /opt/MitoHiFi/src/mitohifi.py -c /home/velascoc/projects/def-strelkov/velascoc/HiFi/pggb/S16_OS00FE2B_DA230375_bc2089.p_ctg_prefixed.fa -f /home/velascoc/scratch/HiFi/MitoHiFi/P_brassicae_Mitochondrion_LS992577_1.fasta -g /home/velascoc/scratch/HiFi/MitoHiFi/P_brassicae_Mitochondrion_LS992577_1.gb -t 4 -o 4

However, I get the following error:

/opt/MitoHiFi/src/parallel_annotation.py:69: UserWarning: Contig S16#1#ptg000007c does not have an annotation file, check MitoFinder's log
  warnings.warn("Contig "+ contig_id + " does not have an annotation file, check MitoFinder's log")
Traceback (most recent call last):
  File "/opt/MitoHiFi/src/mitohifi.py", line 566, in <module>
    main()
  File "/opt/MitoHiFi/src/mitohifi.py", line 303, in main
    tRNA_ref = fetch.get_ref_tRNA()
  File "/opt/MitoHiFi/src/fetch.py", line 48, in get_ref_tRNA
    reference_tRNA = max(tRNAs, key=tRNAs.get)
ValueError: max() arg is an empty sequence
Program finished with exit code 1 at: Wed Oct  2 14:03:41 PDT 2024

The weird thing is that the command works perfectly with some .gb files and does not work with other .gb files. For example, using NC_034004 as a reference, I get the expected output files, while when I use LS992577, I get the error.

I know that the error is caused by mitofinder and is associated with the genome I am using as a reference. However, I don't know how to fix it. Does anyone have any idea?

I created the container as:
apptainer build mitohifi.sif docker://ghcr.io/marcelauliano/mitohifi:master

and the version is:

 apptainer shell mitohifi.sif
 Apptainer>  python3 /opt/MitoHiFi/src/mitohifi.py --version
 MitoHiFi 3.2.1

Thanks
Sandra

@bioinfoMMS
Copy link

Any luck on this? I am having the same issue with two different reference mitochondria genbank files and the singularity container. I have gotten MitoHifi to work in the past with the same command on a different organism so not sure what is going on here.

@bbrunet
Copy link

bbrunet commented Nov 6, 2024

I just encountered the same issue too. I'm using the conda installation, with everything installed today and the genbank file fetched today.

@foreignsand
Copy link

I'm having the same issue using MitoHiFi as a docker image on my local machine running MacOs Sequoia 15.1.

@dgpinheiro
Copy link

dgpinheiro commented Nov 18, 2024

I'm having the same issue using MitoHiF-3.2.2.

Traceback (most recent call last):
File "/usr/local/bioinfo/MitoHiFi-3.2.2/src/mitohifi.py", line 567, in
main()
File "/usr/local/bioinfo/MitoHiFi-3.2.2/src/mitohifi.py", line 304, in main
tRNA_ref = fetch.get_ref_tRNA()
File "/srv/bioinfo/MitoHiFi-3.2.2/src/fetch.py", line 48, in get_ref_tRNA
reference_tRNA = max(tRNAs, key=tRNAs.get)
ValueError: max() arg is an empty sequence

The issue was solved by fixing the MitoFinder installation, the "python-xml" package was missing.

@bbrunet
Copy link

bbrunet commented Nov 20, 2024

I ended up figuring out that mitohifi was getting tripped up on the fact that none of the putative mitochondrial contigs were circularized and as a result mitofinder would not proceed with annotation. After mapping the reads to the reference and assembling them into contigs using Flye, I was able to get mitohifi to run to completion using the contigs as input. I ended up using the docker image via singularity in the end, and it all works fine now so long as the input contigs are circular.

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

5 participants