Skip to content

Silent failure with invalid k-mer size, hangs with kmer size zero #141

@peterjc

Description

@peterjc

This works, using -k 16 which is documented in the fastANI -h help as the maximum:

fastANI -v
version 1.33fastANI -q MGV-GENOME-0264574.fas -r MGV-GENOME-0266457.fna -k 16 -o /dev/stdout ; echo "Return code $?"
>>>>>>>>>>>>>>>>>>
Reference = [MGV-GENOME-0266457.fna]
Query = [MGV-GENOME-0264574.fas]
Kmer size = 16
Fragment length = 3000
Threads = 1
ANI output file = /dev/stdout
Sanity Check  = 0
>>>>>>>>>>>>>>>>>>
INFO [thread 0], skch::main, Count of threads executing parallel_for : 1
INFO [thread 0], skch::Sketch::build, window size for minimizer sampling  = 24
INFO [thread 0], skch::Sketch::build, minimizers picked from reference = 3186
INFO [thread 0], skch::Sketch::index, unique minimizers = 3184
INFO [thread 0], skch::Sketch::computeFreqHist, Frequency histogram of minimizers = (1, 3182) ... (2, 2)
INFO [thread 0], skch::Sketch::computeFreqHist, consider all minimizers during lookup.
INFO [thread 0], skch::main, Time spent sketching the reference : 0.00338479 sec
INFO [thread 0], skch::main, Start Map 1
INFO [thread 0], skch::main, Time spent mapping fragments in query #1 : 0.0054579 sec
INFO [thread 0], skch::main, Time spent post mapping : 1.1101e-05 sec
INFO [thread 0], skch::main, ready to exit the loop
INFO, skch::main, parallel_for execution finished
MGV-GENOME-0264574.fas  MGV-GENOME-0266457.fna  99.5014 12      13
Return code 0

However, trying a larger value like -k 17 gives the following:

fastANI -q MGV-GENOME-0264574.fas -r MGV-GENOME-0266457.fna -k 17 -o /dev/stdout ; echo "Return code $?"
>>>>>>>>>>>>>>>>>>
Reference = [MGV-GENOME-0266457.fna]
Query = [MGV-GENOME-0264574.fas]
Kmer size = 17
Fragment length = 3000
Threads = 1
ANI output file = /dev/stdout
Sanity Check  = 0
>>>>>>>>>>>>>>>>>>
INFO [thread 0], skch::main, Count of threads executing parallel_for : 1
INFO [thread 0], skch::Sketch::build, window size for minimizer sampling  = 33
INFO [thread 0], skch::Sketch::build, minimizers picked from reference = 2304
INFO [thread 0], skch::Sketch::index, unique minimizers = 2303
INFO [thread 0], skch::Sketch::computeFreqHist, Frequency histogram of minimizers = (1, 2302) ... (2, 1)
INFO [thread 0], skch::Sketch::computeFreqHist, consider all minimizers during lookup.
INFO [thread 0], skch::main, Time spent sketching the reference : 0.00330126 sec
INFO [thread 0], skch::main, Start Map 1
INFO [thread 0], skch::main, Time spent mapping fragments in query #1 : 0.00448644 sec
INFO [thread 0], skch::main, Time spent post mapping : 1.0888e-05 sec
INFO [thread 0], skch::main, ready to exit the loop
INFO, skch::main, parallel_for execution finished
MGV-GENOME-0264574.fas  MGV-GENOME-0266457.fna  99.4869 12      13
Return code 0

There is no error - the return code is zero - and there is no error message.

There is nothing in the output file (which is fine).

Similarly for -k -1, -k 2 and -k 3.

However, using -k 0 seems to hang.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions