bonsai-team / matam

Mapping-Assisted Targeted-Assembly for Metagenomics
GNU Affero General Public License v3.0
19 stars 9 forks source link

Check properly the return code of system calls for sub-scripts #91

Closed loic-couderc closed 4 years ago

loic-couderc commented 5 years ago

Describe the bug The script sga_assemble.py uses subprocess.call without checking the return code. By consequence, MATAM will continue its execution until an another error occur.

To Reproduce Run matam with default parameter and use a Phred+64 fastq file.

Expected behavior Stop MATAM as soon as possible when a system call return a non zero code.

The following scripts may be impacted by a similar problem:

loic-couderc commented 5 years ago

Changing subprocess.call by subprocess.check_call in sga_assemble.py has for consequence to end MATAM prematurely.

# the following command fails because merged_output.fa is empty (6/131 components)
CMD: /home/lcouderc/anaconda3/envs/matam/bin/sga index -d 1000000 -t 1 merged_output.fa
loic-couderc commented 5 years ago

We have to distinguish 2 cases: