MDU-PHL / abritamr

A pipeline for running AMRfinderPlus and collating results into functional classes
69 stars 14 forks source link

abritamr should fail with non-zero exit code if the amrfinder command is not successful #30

Closed bernt-matthias closed 2 months ago

bernt-matthias commented 1 year ago

I see the followining error (due to missing parallel .. see https://github.com/bioconda/bioconda-recipes/pull/41088) but abritamr has exit code 0 (which indicates success).

[INFO:05/22/2023 01:03:43 PM] The input file seems to be in the correct format. Thank you.
[INFO:05/22/2023 01:03:43 PM] Checking that the input data is present.
[INFO:05/22/2023 01:03:43 PM] Checking if file /tmp/tmp6j2k5pye/files/3/3/f/dataset_33fbe018-0709-481b-b4b2-3117e725ad73.dat exists
[INFO:05/22/2023 01:03:43 PM] Checking for amrfinder DB: /usr/local/lib/python3.11/site-packages/abritamr/db/amrfinderplus/data/2022-08-09.1 and comparing it to 2022-08-09.1
[INFO:05/22/2023 01:03:43 PM] You seem to have the correct AMRfinder DB setup. Well done!
[INFO:05/22/2023 01:03:43 PM] All check complete now running AMRFinder
[INFO:05/22/2023 01:03:43 PM] You are running abritamr in batch mode. Now executing : parallel -j 2 --colsep '\t' 'mkdir -p {1} && amrfinder -n {2} -o {1}/amrfinder.out --plus  --threads 1 -d /usr/local/lib/python3.11/site-packages/abritamr/db/amrfinderplus/data/2022-08-09.1 --ident_min 0.9 ' :::: /tmp/tmp6j2k5pye/job_working_directory/000/2/configs/tmp27psiuwg
[CRITICAL:05/22/2023 01:03:43 PM] There appears to have been a problem with running amrfinder plus. The following erro has been reported : 
 /bin/sh: parallel: command not found

[CRITICAL:05/22/2023 01:03:43 PM] The amrfinder output : CP009102.1.fasta/amrfinder.out is missing. Something has gone wrong with AMRfinder plus. Please check all inputs and try again.
oturner2 commented 5 months ago

Hi,

I installed abritamr earlier today and am also getting a similar error message (see below) from trying to run abritamr not in report mode. Is there a fix for this that I've missed? I also tried running AMRfinder plus independently of abritamr which worked absolutely fine. Apologies if this is not helpful!

Many thanks, Olivia

[INFO:05/15/2024 11:51:30 AM] Checking for amrfinder DB: /home/olivia/mambaforge/envs/abritamrENV/lib/python3.12/site-packages/abritamr/db/amrfinderplus/data/2024-01-31.1 and comparing it to 2024-01-31.1
[INFO:05/15/2024 11:51:30 AM] You seem to have the correct AMRfinder DB setup. Well done!
[INFO:05/15/2024 11:51:30 AM] All check complete now running AMRFinder
[INFO:05/15/2024 11:51:30 AM] You are running abritamr in batch mode. Now executing : parallel -j 16 --colsep '\t' 'mkdir -p {1} && amrfinder -n {2} -o {1}/amrfinder.out --plus  --threads 1 -d /home/olivia/mambaforge/envs/abritamrENV/lib/python3.12/site-packages/abritamr/db/amrfinderplus/data/2024-01-31.1' :::: fasta_info.tab
[CRITICAL:05/15/2024 11:51:30 AM] There appears to have been a problem with running amrfinder plus. The following erro has been reported : 
 /bin/sh: 1: parallel: not found

[CRITICAL:05/15/2024 11:51:30 AM] The amrfinder output : 52246047271_plasmid_00001/amrfinder.out is missing. Something has gone wrong with AMRfinder plus. Please check all inputs and try again.
[INFO:05/15/2024 04:40:51 PM] The input file seems to be in the correct format. Thank you.
kristyhoran commented 5 months ago

@bernt-matthias and @oturner2 Thanks for reaching out and identifying this bug. Can you tell me what systems you are running on? parallel is a GNU command that is normally installed on (most) systems i have tested - so it was not included as a dependency in the conda installation. I will update the recipe to add this in. But in the meantime if you have admin rights to the systems you are running on you can install parallel (or request your sys admin to do it if needs be), there will be different packages depending on the system. But brew install parallel should work well if you use brew. Alternatively you can use the following

conda activate <your_abritamr_env_name>
conda install conda-forge::parallel
man parallel (to test)

I will also update the docs for others to see.

Thanks again.

bernt-matthias commented 5 months ago

Thanks for coming back to us. We execute in the biocontainer built from the bioconda recipe. But, anyway: I have added parallel to the recipe already: https://github.com/bioconda/bioconda-recipes/pull/41088

Now we are down to the problem reported by https://github.com/oturner2

I will try come up with a command line + test data that reproduces the problem.

oturner2 commented 5 months ago

Hi Both,

Thank you for your incredibly quick response! I've just installed parallel and it runs perfectly now, thank you for your help!

bernt-matthias commented 5 months ago

Apparently this has been messed up in the mean time. Lets see if this helps: https://github.com/bioconda/bioconda-recipes/pull/47930