Compare commits

...

6 Commits

Author SHA1 Message Date
Eric Coissac
1ce5da9bee 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.
2026-02-11 06:31:10 +01:00
coissac
dc23d9de9a Merge pull request #85 from metabarcoding/push-smturnsrozkp
Push smturnsrozkp
2026-02-10 22:19:22 +01:00
Eric Coissac
aa9d7bbf72 Bump version to 4.4.14
Update version number from 4.4.13 to 4.4.14 in both version.go and version.txt files.
2026-02-10 22:17:23 +01:00
Eric Coissac
db22d20d0a Rename obisuperkmer test script to obik-super and update command references
Update test script name from obisuperkmer to obik-super and adjust all command references accordingly.

- Changed TEST_NAME from 'obisuperkmer' to 'obik-super'
- Changed CMD from 'obisuperkmer' to 'obik'
- Updated MCMD to 'OBIk-super'
- Modified command calls to use '$CMD super' instead of direct command names
- Updated help test to use '$CMD super -h'
- Updated all test cases to use the new command format
2026-02-10 22:17:22 +01:00
coissac
7c05bdb01c Merge pull request #84 from metabarcoding/push-uxvowwlxkrlq
Push uxvowwlxkrlq
2026-02-10 22:12:18 +01:00
Eric Coissac
b6542c4523 Bump version to 4.4.13
Update version from 4.4.12 to 4.4.13 in version.txt and pkg/obioptions/version.go
2026-02-10 22:10:38 +01:00
4 changed files with 13 additions and 32 deletions

View File

@@ -4,8 +4,8 @@
# Here give the name of the test serie # Here give the name of the test serie
# #
TEST_NAME=obisuperkmer TEST_NAME=obik-super
CMD=obisuperkmer CMD=obik
###### ######
# #
@@ -16,7 +16,7 @@ TEST_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
OBITOOLS_DIR="${TEST_DIR/obitest*/}build" OBITOOLS_DIR="${TEST_DIR/obitest*/}build"
export PATH="${OBITOOLS_DIR}:${PATH}" export PATH="${OBITOOLS_DIR}:${PATH}"
MCMD="$(echo "${CMD:0:4}" | tr '[:lower:]' '[:upper:]')$(echo "${CMD:4}" | tr '[:upper:]' '[:lower:]')" MCMD="OBIk-super"
TMPDIR="$(mktemp -d)" TMPDIR="$(mktemp -d)"
ntest=0 ntest=0
@@ -65,31 +65,10 @@ log "files: $(find $TEST_DIR | awk -F'/' '{print $NF}' | tail -n +2)"
#### ####
#### Below are the tests #### Below are the tests
#### ####
#### Before each test :
#### - increment the variable ntest
####
#### Run the command as the condition of an if / then /else
#### - The command must return 0 on success
#### - The command must return an exit code different from 0 on failure
#### - The datafiles are stored in the same directory than the test script
#### - The test script directory is stored in the TEST_DIR variable
#### - If result files have to be produced they must be stored
#### in the temporary directory (TMPDIR variable)
####
#### then clause is executed on success of the command
#### - Write a success message using the log function
#### - increment the variable success
####
#### else clause is executed on failure of the command
#### - Write a failure message using the log function
#### - increment the variable failed
####
###################################################################### ######################################################################
((ntest++)) ((ntest++))
if $CMD -h > "${TMPDIR}/help.txt" 2>&1 if $CMD super -h > "${TMPDIR}/help.txt" 2>&1
then then
log "$MCMD: printing help OK" log "$MCMD: printing help OK"
((success++)) ((success++))
@@ -100,7 +79,7 @@ fi
# Test 1: Basic super k-mer extraction with default parameters # Test 1: Basic super k-mer extraction with default parameters
((ntest++)) ((ntest++))
if obisuperkmer "${TEST_DIR}/test_sequences.fasta" \ if $CMD super "${TEST_DIR}/test_sequences.fasta" \
> "${TMPDIR}/output_default.fasta" 2>&1 > "${TMPDIR}/output_default.fasta" 2>&1
then then
log "$MCMD: basic extraction with default parameters OK" log "$MCMD: basic extraction with default parameters OK"
@@ -148,7 +127,7 @@ fi
# Test 5: Extract super k-mers with custom k and m parameters # Test 5: Extract super k-mers with custom k and m parameters
((ntest++)) ((ntest++))
if obisuperkmer -k 15 -m 7 "${TEST_DIR}/test_sequences.fasta" \ if $CMD super -k 15 -m 7 "${TEST_DIR}/test_sequences.fasta" \
> "${TMPDIR}/output_k15_m7.fasta" 2>&1 > "${TMPDIR}/output_k15_m7.fasta" 2>&1
then then
log "$MCMD: extraction with custom k=15, m=7 OK" log "$MCMD: extraction with custom k=15, m=7 OK"
@@ -172,7 +151,7 @@ fi
# Test 7: Test with different output format (FASTA output explicitly) # Test 7: Test with different output format (FASTA output explicitly)
((ntest++)) ((ntest++))
if obisuperkmer --fasta-output -k 21 -m 11 \ if $CMD super --fasta-output -k 21 -m 11 \
"${TEST_DIR}/test_sequences.fasta" \ "${TEST_DIR}/test_sequences.fasta" \
> "${TMPDIR}/output_fasta.fasta" 2>&1 > "${TMPDIR}/output_fasta.fasta" 2>&1
then then
@@ -209,7 +188,7 @@ fi
# Test 10: Test with output file option # Test 10: Test with output file option
((ntest++)) ((ntest++))
if obisuperkmer -o "${TMPDIR}/output_file.fasta" \ if $CMD super -o "${TMPDIR}/output_file.fasta" \
"${TEST_DIR}/test_sequences.fasta" 2>&1 "${TEST_DIR}/test_sequences.fasta" 2>&1
then then
log "$MCMD: output to file with -o option OK" log "$MCMD: output to file with -o option OK"

View File

@@ -3,7 +3,7 @@ package obioptions
// Version is automatically updated by the Makefile from version.txt // Version is automatically updated by the Makefile from version.txt
// The patch number (third digit) is incremented on each push to the repository // The patch number (third digit) is incremented on each push to the repository
var _Version = "Release 4.4.12" var _Version = "Release 4.4.14"
// Version returns the version of the obitools package. // Version returns the version of the obitools package.
// //

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")
} }
} }

View File

@@ -1 +1 @@
4.4.12 4.4.14