Open anmwinter opened 7 years ago
I think I see what the issue is but I don't know perl well enough to fix this.
while (<>) { my (undef,$seqID,$taxid,$score, undef, $hitLength, $queryLength, $numMatches) = split /\t/; next if $only_unique && $numMatches > 1; next if defined $min_length && $hitLength < $min_length; next if defined $min_score && $score < $min_score; $taxo_counts{$taxid} += 1/$numMatches; $seq_count++; }
So numMatches is being read in from the centrifuge report. But in my case (others as well) the numMatches can be 0. It looks like the 0 numMatches are being carried forward so it throws an error when we try to divide 1 by 0.
Any suggestions?
I figured it out. We were actually using the wrong report file as input! The manual is wrong or weirdly worded but you don't use the output of --report-file
or centrifuge-report.tsv
or whatever you called the output. Instead you have to use the additional classification output file generated by centrifuge with -S
.
After I ran centrifuge-kreport
with that, it didn't give any errors and the output seems reasonable ;)
Oh weird. Yeah I though it was the .csv. I'll give it a try. Thanks for tracking this down.
I ran with the -S option and then fed that file into centrifuge-kreport
. That worked just fine. Ended up with the kraken format.
The manual is weirdly worded about this process.
@anmwinter I agree with you that we should use the result.txt
produced by using the -S option
. The centrifuge-kreport
works fine when result.txt contains 7 columns with the following column names: readID seqID taxID score hitLength queryLength numMatches
.
However, the result.txt obtained from centrifuge v.1.0.4 contains 8 columns and lacks headers. To successfully run centrifuge-kreport
, you need to remove the fifth column 2ndBestScore
and then add the headers to it.
I found centrifuge-kreport in the github repo. After I ran make and moved all the files to the correct directory I tried to run centrifuge-kreport. I ended up with the following error.
Aras-MacBook-Pro:Desktop ara$ centrifuge-kreport -x p_compressed/p_compressed centrifuge_report.tsv Loading taxonomy ... Loading names file ... Loading nodes file ... Use of uninitialized value $numMatches in division (/) at /Users/ara/bin/centrifuge-kreport line 80, <> line 2. Illegal division by zero at /Users/ara/bin/centrifuge-kreport line 80, <> line 2.