Patch the fastq detector

This commit is contained in:
Eric Coissac
2025-08-08 10:23:03 -04:00
parent 7a6d552450
commit 6d204f6281
3 changed files with 8 additions and 2 deletions

View File

@@ -568,6 +568,8 @@ func ReadCSVNGSFilter(reader io.Reader) (*obingslibrary.NGSLibrary, error) {
for i = 0; i < len(records) && records[i][0] == "@param"; i++ {
}
log.Infof("%d parameters found", i)
params := records[0:i]
records = records[i:]

View File

@@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "730d448"
var _Commit = "7a6d552"
var _Version = "Release 4.4.0"
// Version returns the version of the obitools package.

View File

@@ -78,7 +78,11 @@ func RegisterOBIMimeType() {
}
fastqDetector := func(raw []byte, limit uint32) bool {
ok, err := regexp.Match("^@[^ ].*\n[A-Za-z.-]+\n\\+", raw)
ok, err := regexp.Match("^@[^ ].*\n[A-Za-z.-]+", raw)
if ok && err == nil {
ok, err = regexp.Match("^@param,[^ ]", raw)
ok = !ok
}
return ok && err == nil
}