Closed mattloose closed 5 months ago
I don't think that the current fix addresses the problem in the issue. Which is an extra .
in the filename (GCA_000001405.15_GRCh38_no_alt_analysis_set.fna.mmi
), so pathlib suggests that the suffix is .15_grch38_no_alt_analysis_set.fna.mmi
We could use something like:
file_extensions = ['.fasta', '.fna', '.fsa', '.fa', '.fastq',
'.fq', '.fasta.gz', '.fna.gz', '.fsa.gz',
'.fa.gz', '.fastq.gz', '.fq.gz', '.mmi']
if not any(index.lower().endswith(suffix) for suffix in file_extensions):
raise ...
Probably should add a test case TOML for this too.
I mean - it does fix it...
But I'll look at this alternative.
OK It doesn't fix it.
Whoops.
This addresses the issue raised by @alexomics (thanks - good spot).
I've attempted to add in a test toml but I don't think this is yet correct - advice from anyone appreciated.
So the TOML tests are a bit of a Rube Goldberg machine, you need to:
readfish/tests/static/toml_validation_test/fail/005_bad_reference_file.TOML
)readfish/tests/static/toml_validation_test/fail/005_bad_reference_file.txt
) that contains the expected error message(s) the TOML will generateIt's described a little bit more on the README for each test folder.
re: the tests - the output of the readfish validate command won't error on this file now - it will just give a warning - can that be caught in a text file? I note that in the other examples for validating mappy the text file is just empty?
OK - this adds a fail and pass test for these specific issues - the pass reference index file is named as per the issue that started this.
Almost there! You seem to be missing a TOML file tests/static/mappy_validation_test/fail/004_bad_reference_file_extension.toml
D'oh
Should be there now. I forgot I needed to force add the toml due to the gitignore!
…abels to catch acceptable file types.
This request addresses #326 and enables validation of the following file type endings.
['.fasta.gz', '.fna.gz', '.fsa.gz', '.fa.gz', '.fastq.gz', '.fq.gz', '.fasta.mmi', '.fna.mmi', '.fsa.mmi', '.fa.mmi', '.fastq.mmi', '.fq.mmi', '.fasta', '.fna', '.fsa', '.fa', '.fastq', '.fq', '.mmi']
I think a better way to handle this in the future would be to explicitly detemine if the file is readable by mappy. However, this will catch the most common possible mmi extension types.