KMC icon indicating copy to clipboard operation
KMC copied to clipboard

Can't count kmer on fastq file

Open chequochuu opened this issue 6 years ago • 11 comments
trafficstars

I using the latest kmc code but i can't count kmer on fastq file. It work on fasta

$cat r1_test.fq 
@0|Chromosome|4051100|4051286/2 BX:Z:CGACACGGTTTGGGCC
AAACCCAACCAC
+
FFFFFFFFFFFF

$kmc -fq -m5 -ci1 -k3 r1_test.fq res ./tmp/
Stage 1: 100%
1st stage: 0.000393s
2nd stage: 6.4e-05s
Total    : 0.000457s
Tmp size : 0MB

Stats:
   No. of k-mers below min. threshold :            0
   No. of k-mers above max. threshold :            0
   No. of unique k-mers               :            0
   No. of unique counted k-mers       :            0
   Total no. of k-mers                :            0
   Total no. of reads                 :            1
   Total no. of super-k-mers          :            0

chequochuu avatar Sep 10 '19 12:09 chequochuu

Hi,

I am not able to reproduce this bug.

By latest kmc code you mean that you compile commit 85ad76956d890aa24fc8525eee5653078ed86ace?

Could you rerun it with -v switch and send me your output?

Could you try to rerun it with -t1 and check if it still does not work?

marekkokot avatar Sep 10 '19 12:09 marekkokot

Yes, I use that commit. Still got error.


Info: Small k optimization on!

******* configuration for small k mode: *******
No. of input files           : 1
Output file name             : res
Input format                 : FASTQ

k-mer length                 : 3
Max. k-mer length            : 256
Min. count threshold         : 1
Max. count threshold         : 1000000000
Max. counter value           : 255
Both strands                 : true
Input buffer size            : 33554432

No. of readers               : 1
No. of splitters             : 1

Max. mem. size               :  5000MB

Max. mem. for PMM (FASTQ)    :  3294MB
Part. mem. for PMM (FASTQ)   :    33MB
Max. mem. for PMM (reads)    :     1MB
Part. mem. for PMM (reads)   :     0MB
Max. mem. for PMM (b. reader):   402MB
Part. mem. for PMM (b. reader):   134MB

Stage 1: 100%
1st stage: 0.000247s
2nd stage: 6.3e-05s
Total    : 0.00031s
Tmp size : 0MB

Stats:
   No. of k-mers below min. threshold :            0
   No. of k-mers above max. threshold :            0
   No. of unique k-mers               :            0
   No. of unique counted k-mers       :            0
   Total no. of k-mers                :            0
   Total no. of reads                 :            1
   Total no. of super-k-mers          :            0

chequochuu avatar Sep 10 '19 14:09 chequochuu

It seem that it doesn't work when reading with barcode included in the read name. When I remove the barcode:

@0|Chromosome|4051100|4051286/2
AAACCCAACCAC
+
FFFFFFFFFFFF

It works like a charm!

chequochuu avatar Sep 10 '19 17:09 chequochuu

Hmmm, it is still weird, that it worked on my machine. Maybe I have prepared input file other then yours. Could you maybe send me your file r1_test.fq ?

marekkokot avatar Sep 10 '19 18:09 marekkokot

This is all my r1_test.fq

@0|Chromosome|4051100|4051286/2 BX:Z:CGACACGGTTTGGGCC
AAACCCAACCAC
+
FFFFFFFFFFFF

chequochuu avatar Sep 11 '19 01:09 chequochuu

Hi, I ment send me a file not its content, because maybe github remove something when you copy paste. It seems unlikely, but currently, I cannot imagine another reason why it works on my machine.

You may also copy what you have pasted here to a new file and check if KMC still produces wrong results on your machine.

marekkokot avatar Sep 11 '19 07:09 marekkokot

I have find out that the character between id and barcode is \t instead of space. Sorry, my bad.

chequochuu avatar Sep 13 '19 02:09 chequochuu

Ok, thanks for the info. It seems it is the same bug as #42, so I will keep it open to remember to add '\t' support. Anyway, thanks for reporting that issue and thanks for using KMC.

marekkokot avatar Sep 13 '19 06:09 marekkokot

Bump! I ran into the same issue as of today. Would be cool to have it fixed, especially given that many linked-read pipelines produce tabbed headers by default.

taprs avatar Dec 05 '23 10:12 taprs

The new versions of Nanopore's Dorado and related tools also produce tabbed headers in their fastq files, so I would also appreciate a fix :)

richardstoeckl avatar May 31 '24 10:05 richardstoeckl