Support new sequence file formats and improve error handling

Add support for .gbff and .gbff.gz file extensions in sequence reader.

Update the logic to return an error instead of using NilIBioSequence when no sequence files are found, improving the error handling and user feedback.
This commit is contained in:
Eric Coissac
2026-02-11 06:31:03 +01:00
parent dc23d9de9a
commit 1ce5da9bee

View File

@@ -68,6 +68,8 @@ func ExpandListOfFiles(check_ext bool, filenames ...string) ([]string, error) {
strings.HasSuffix(path, "seq.gz") || strings.HasSuffix(path, "seq.gz") ||
strings.HasSuffix(path, "gb") || strings.HasSuffix(path, "gb") ||
strings.HasSuffix(path, "gb.gz") || strings.HasSuffix(path, "gb.gz") ||
strings.HasSuffix(path, "gbff") ||
strings.HasSuffix(path, "gbff.gz") ||
strings.HasSuffix(path, "dat") || strings.HasSuffix(path, "dat") ||
strings.HasSuffix(path, "dat.gz") || strings.HasSuffix(path, "dat.gz") ||
strings.HasSuffix(path, "ecopcr") || strings.HasSuffix(path, "ecopcr") ||
@@ -204,7 +206,7 @@ func CLIReadBioSequences(filenames ...string) (obiiter.IBioSequence, error) {
iterator = iterator.PairTo(ip) iterator = iterator.PairTo(ip)
} }
} else { } else {
iterator = obiiter.NilIBioSequence return obiiter.NilIBioSequence, fmt.Errorf("no sequence files found in the provided paths")
} }
} }