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

Better error message when the input file does not exist #94

Open
loic-couderc opened this issue Oct 16, 2019 · 1 comment
Open

Better error message when the input file does not exist #94

loic-couderc opened this issue Oct 16, 2019 · 1 comment

Comments

@loic-couderc
Copy link
Member

Is your feature request related to a problem? Please describe.
When the input FASTQ file does not exist, MATAM does not stop properly its execution

Describe the solution you'd like
Stop the execution with a clear message

@loic-couderc
Copy link
Member Author

Current error message:

matam_assembly.py -i /tmp/fake.fq --cpu 4 --max_memory 10000 -v -o /tmp/matam_19_10_16-09_49_31 --perform_taxonomic_assignment --debug
2019-10-16 08:23:42,700 - root - INFO - === MATAM assembly ===
2019-10-16 08:23:42,700 - root - INFO - CMD: /home/ubuntu/matam/scripts/matam_assembly.py --verbose --debug --keep_tmp --cpu 4 --max_memory 10000 --best 10 --evalue 1.00e-05 --score_threshold 0.90 --coverage_threshold 0 --min_identity 1.00 --min_overlap_length 50 --min_read_node 1 --min_overlap_edge 1 --quorum 0.51 --read_correction auto --contig_coverage_threshold 20 --min_scaffold_length 500 --perform_taxonomic_assignment --training_model 16srrna --rdp_cutoff 0.8 --out_dir /tmp/matam_19_10_16-09_49_31 --ref_db /home/ubuntu/matam/db/SILVA_128_SSURef_NR95 --input_fastq  /tmp/fake.fq 
wc:  /tmp/fake.fq: No such file or directory
Traceback (most recent call last):
  File "bin/matam_assembly.py", line 1682, in <module>
    exit_code = main()
  File "bin/matam_assembly.py", line 918, in main
    input_fastq_line_nb = int(subprocess.check_output('wc -l {0}'.format(input_fastq_filepath), shell=True, bufsize=0).split()[0])
  File "/home/ubuntu/miniconda3/envs/matam/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/home/ubuntu/miniconda3/envs/matam/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'wc -l  /tmp/fake.fq' returned non-zero exit status 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant