zjshi / Maast

Microbial agile accurate SNP Typer
MIT License
29 stars 2 forks source link

Check if genomes exists #5

Closed snayfach closed 2 years ago

snayfach commented 2 years ago

If there are no valid genomes provided, Maast should exit with informative error instead of proceeding to next step. In the example below I provided a directory of gzipped FASTA files and got the following error:

[Warning] Total number of genomes (0) < min. number of genomes required for effective SNP calling with MAF 0.01 (100) [Warning] Skip tag genome selection, all genomes will be used reference genome path:

b'' b"mash: Relink /global/u1/s/snayfach/.conda/envs/maast/bin/../lib/./libgfortran.so.5' with/lib64/librt.so.1' for IFUNC symbol `clock_gettime'\nWriting to maast/100/temp/mash/100/mash_sketch.msh...\n"[calculating mash distance]: start

Error: the following returned non-zero status: 'mash dist -p 1 maast/100/temp/mash/100/mash_sketch.msh maast/100/temp/mash/100/mash_sketch.msh > maast/100/temp/mash/100/mash_dist.tsv ':

b"mash: Relink /global/u1/s/snayfach/.conda/envs/maast/bin/../lib/./libgfortran.so.5' with/lib64/librt.so.1' for IFUNC symbol `clock_gettime'\n/bin/sh: line 1: 10466 Floating point exceptionmash dist -p 1 maast/100/temp/mash/100/mash_sketch.msh maast/100/temp/mash/100/mash_sketch.msh > maast/100/temp/mash/100/mash_dist.tsv\n"

snayfach commented 2 years ago

Also, looks like you have an off-by one error:

[Warning] Total number of genomes (100) < min. number of genomes required for effective SNP calling with MAF 0.01 (100)

zjshi commented 2 years ago

Min genome number checking added.