seqkit grep v2.10.0 Fails Silently or Errors Incorrectly on Minimal Valid FASTA Input (Linux/Kernel 6.8)
Environment:
Seqkit Version: v2.10.0 (also observed similar failure on v2.3.0)
Operating System: Ubuntu 24.04 (mint cinnamon)
Kernel: Linux
Installation Method: The issue occurs identically with:
seqkit installed via Conda (conda install -c bioconda seqkit=2.10.0) in a clean environment. The official pre-compiled static binary (seqkit_linux_amd64.tar.gz for v2.10.0) downloaded directly from GitHub releases.
Bug Description: seqkit grep fails to correctly identify patterns in minimal, valid FASTA files on my system. The failure mode depends puzzlingly on the presence or absence of a trailing newline in the input file.
Steps to Reproduce: Test file, no trailing newline: echo ">TestRecord" > test_no_newline.fa echo "AAAAAA" >> test_no_newline.fa ("cat test_no_newline.fa" returns expected output)
Run seqkit grep (using static binary ./seqkit or conda version): ./seqkit grep -p "AAAAA" test_no_newline.fa
Test file, trailing newline: echo ">TestRecord" > test_with_newline.fa echo "AAAAAA" >> test_with_newline.fa echo "" >> test_with_newline.fa ("cat test_with_newline.fa" returns expected output)
Run seqkit grep: ./seqkit grep -p "AAAAA" test_with_newline.fa
Observed Behavior: Case 1 (No Trailing Newline) seqkit grep exits with an error, even though the file is valid and contains the pattern: [ERRO] fastx: invalid FASTA/Q format
Case 2 (With Trailing Newline) seqkit grep exits silently with no output and (presumably) exit code 0. It fails to report the match.
Expected Behavior: In both Case 1 and Case 2, seqkit grep should correctly identify the pattern "AAAAA" within the sequence "AAAAAA" and print the matching FASTA record:
Additional Context: The issue was initially discovered trying to grep a large genome file (GCA_000001405.29_GRCh38.p14_genomic.fna) where seqkit grep also failed silently, but standard tools like rg could find patterns, and seqkit seq could parse the file headers correctly. System configuration checks (locale, ulimit -a, df -T, mount, aa-status) show standard settings (ext4 filesystem, en_US.UTF-8 locale, default limits, AppArmor active but no profile seemingly applied to seqkit). Hardware checks (memtest86+, prime95, ngstress) passed recently. 14900K/128GB ram/~7GB in use
Thanks for your hard work on seqkit!
You can disregard - just missed the -s flag. My mistake!