seppinho / haplogrep-cmd

HaploGrep - mtDNA haplogroup classification. Supporting rCRS and RSRS.
https://haplogrep.i-med.ac.at/
MIT License
74 stars 23 forks source link

Allow FastA file extension other than "fasta"? #20

Closed alexhbnr closed 5 years ago

alexhbnr commented 5 years ago

When using a FastA file as input, haplogrep throws an exception when a valid FastA file is provided as input but it has a file extension different from fasta, e.g. fas

It is due to a htsjdk function (see below). I am not sure if this can be escaped or is part of the package when using htsjdk to parse the file. If the latter, maybe put a note into the documentary to avoid confusions when users use other file extensions, e.g. fas or fna.

java.lang.IllegalArgumentException: File is not a supported reference file type: /tmp/311humans.fas at htsjdk.samtools.reference.ReferenceSequenceFileFactory.lambda$getFastaExtension$0(ReferenceSequenceFileFactory.java:249) at java.util.Optional.orElseGet(Optional.java:267) at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getFastaExtension(ReferenceSequenceFileFactory.java:249) at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getDefaultDictionaryForReferenceSequence(ReferenceSequenceFileFactory.java:219) at htsjdk.samtools.reference.AbstractFastaSequenceFile.findSequenceDictionary(AbstractFastaSequenceFile.java:101) at htsjdk.samtools.reference.AbstractFastaSequenceFile.(AbstractFastaSequenceFile.java:63) at htsjdk.samtools.reference.FastaSequenceFile.(FastaSequenceFile.java:61) at htsjdk.samtools.reference.FastaSequenceFile.(FastaSequenceFile.java:56) at importer.FastaImporter.load(FastaImporter.java:63) at genepi.haplogrep.main.Haplogrep.run(Haplogrep.java:151) at genepi.base.Tool.start(Tool.java:193) at genepi.haplogrep.main.Haplogrep.main(Haplogrep.java:197)

seppinho commented 5 years ago

thanks. looks like this is the default htsjdk behavior. I'll update the readme.