Gaius-Augustus / GALBA

GALBA is a pipeline for fully automated prediction of protein coding gene structures with AUGUSTUS in novel eukaryotic genomes for the scenario where high quality proteins from one or several closely related species are available.
Other
120 stars 4 forks source link

Pygustus type error #32

Closed SamCT closed 11 months ago

SamCT commented 1 year ago

Hello,

I am running GALBA with Singularity on a small data set, since BRAKER3 is not properly annotating a genic region of interest. I had a successful run of GALBA previously, but once I changed the AUGUSTUS_CONFIG_PATH to a writeable dir I received a pygustus error at the ab initio prediction phase.

GALBA.log: ********************************************************************************** PREDICTING GENES WITH AUGUSTUS (NO UTRS) Tue May 9 07:47:02 2023: RUNNING AUGUSTUS Tue May 9 07:47:02 2023: AUGUSTUS ab initio /opt/conda/bin/python3 /data/BRAKER3/H1_GALBA/JV4H12_only/GALBA/pygustus_ab_initio.py 1> /data/BRAKER3/H1_GALBA/JV4H12_only/GALBA/pygustus_ab_initio.out 2>/data/BRAKER3/H1_GALBA/JV4H12_only/GALBA/errors/pygustus_ab_initio.err

pygustus_ab_initio.err:

'Traceback (most recent call last): File "/data/BRAKER3/H1_GALBA/JV4H12_only/GALBA/pygustus_ab_initio.py", line 9, in <module> augustus.predict('/data/BRAKER3/H1_GALBA/JV4H12_only/GALBA/genome.fa', species='Sp_6',**augargs, partitionLargeSequences=True, minSplitSize=1000000, chunksize=2500000, jobs=24, **augargs) TypeError: pygustus.augustus.predict() got multiple values for keyword argument 'exonnames'

Here is the pygustus_ab_initio.py that is being called:

import os
os.environ['AUGUSTUS_CONFIG_PATH'] = '/nfs/lab/usr/Augustus/config'
from pygustus import augustus

augustus.config_set_bin('/usr/bin//augustus')

augargs = {'exonnames' : 1, 'codingseq': 1, 'outfile': '/data/BRAKER3/H1_GALBA/JV4H12_only/GALBA/augustus.abinitio.gff', 'softmasking':True , 'stopCodonExcludedFromCDS':'false'}

augustus.predict('/data/BRAKER3/H1_GALBA/JV4H12_only/GALBA/genome.fa', species='Sp_6',**augargs, partitionLargeSequences=True, minSplitSize=1000000, chunksize=2500000, jobs=24, **augargs)

I realize that **augargs is passed twice, but not sure how to access this python script within the singularity container to fix that, since it is called fresh and then deleted while running GALBA. Any thoughts on how to move forward?

Thank you

CEPHAS-01 commented 1 year ago

Hi, I experienced this same issue and do not know how to fix it too. Kindly help. Thank you

@SamCT: I got into the bash in the singularity image with the following but could not locate the pygustus_ab_initio.py script. I don't know if it helps.

singularity exec galba.sif /bin/bash

KatharinaHoff commented 1 year ago

Providing the complete call of galba.pl would generally have been helpful ;-) But don't worry, I figured out that you are running galba.pl with the Augustus ab initio mode.

I believe I have fixed that issue with a novel release, today. Please rebuild your singularity images (latest has been updated) and try, again. Let me know whether that solves the problem. (At least the double passed augargs should definitely not occur, anymore). https://github.com/Gaius-Augustus/GALBA/commit/21ef2ad9e13aabb5e7cd504d7b604c4d1523a842

CEPHAS-01 commented 1 year ago

Hi @KatharinaHoff Thanks for providing the updates. As you suggested, I rebuilt the singularity image with the :latest tag but still encountered the following error as highlighted in various files:

pygustus_ab_initio.err Traceback (most recent call last): File "/path/GALBA/pygustus_ab_initio.py", line 9, in augustus.predict('/path/GALBA/genome.fa', species='hsaMmuBtaOarCodingGenes',augargs, partitionLargeSequences=True, minSplitSize=1000000, chunksize=2500000, jobs=30, augargs) TypeError: pygustus.augustus.predict() got multiple values for keyword argument 'exonnames'

Standard error output: JobID_err.out warning: Coverage appears to be high, --ignoreCoverage flag will be ignored ERROR in file /opt/GALBA/scripts/galba.pl at line 5005 Failed to execute: /opt/conda/bin/python3 /path/GALBA/pygustus_ab_initio.py 1> /path/GALBA/pygustus_ab_initio.out 2>/path/GALBA/errors/pygustus_ab_initio.err

GALBA.log

**

                           PREDICTING GENES WITH AUGUSTUS (NO UTRS)           

**

Mon May 15 10:29:33 2023: RUNNING AUGUSTUS Mon May 15 10:29:33 2023: AUGUSTUS ab initio /opt/conda/bin/python3 /path/GALBA/pygustus_ab_initio.py 1> /path/GALBA/pygustus_ab_initio.out 2>/path/GALBA/errors/pygustus_ab_initio.err (END)

NB: I changed my absolute file paths to "/path/".

Thank you for your help.

Temitayo

SamCT commented 1 year ago

Hi @KatharinaHoff ,

Thank you for your reply. Apologies for not including the original command ! :)

This was my original run: PATH=/usr/bin/:${PATH} singularity exec -B $PWD:$PWD,/nfsX/LAB/Usr/bin/Augustus/config:/nfsX/LAB/Usr/bin/Augustus/config /nfsX/LAB/Usr/bin/GALBA/update_5-15/galba.sif galba.pl --genome=genome_haplotype1_smask.fa --prot_seq=Original_braker12_geneModel.aa --threads 24 --gff3 --AUGUSTUS_ab_initio --eval=Original_braker12_geneModel.gtf --AUGUSTUS_CONFIG_PATH=/nfsX/LAB/Usr/bin/Augustus/config

I also rebuilt GALBA, using running singularity build galba.sif docker://katharinahoff/galba-notebook:latest and hit the same error as before, the same as described by @CEPHAS-01 . When I call the new singularity container and check the version, it seems to still be v1.0.6?

singularity exec galba.sif galba.pl --version galba.pl version 1.0.6

Thank you, Sam

kullrich commented 1 year ago

As a temporary work around:

singularity build galba.sif docker://katharinahoff/galba-notebook:latest
singularity build --sandbox galba/ galba.sif
vim ./galba/opt/GALBA/scripts/galba.pl

see here for necessary changes: https://github.com/Gaius-Augustus/GALBA/commit/21ef2ad9e13aabb5e7cd504d7b604c4d1523a842

After changing line 4991:

."minSplitSize=1000000, chunksize=$chunksize, jobs=$CPU, **augargs)\n";

into:

."minSplitSize=1000000, chunksize=$chunksize, jobs=$CPU)\n";

rebuild singularity image from sandbox:

singularity build galba2.sif galba/

Run galba as usual:

singularity exec galba2.sif galba.pl
KatharinaHoff commented 11 months ago

This was fixed in the previous release. Thanks for reporting.