nf-core / taxprofiler

Highly parallelised multi-taxonomic profiling of shotgun short- and long-read metagenomic data
https://nf-co.re/taxprofiler
MIT License
128 stars 36 forks source link

KrakenUniq read extraction #474

Closed SannaAb closed 6 months ago

SannaAb commented 7 months ago

Description of the bug

Hi,

I am using the output classified reads from krakenuniq within taxprofiler and noticed that when i am using illumina (PE) i get .unmapped.merged.unclassified.fasta.gz files. These contains the merged classified reads in fasta format. But when running taxprofiler using iontorrent data (SE) the output is .classified.fasta.gz. Looking into these files the reads are not in fasta format but in fastq. I dont know if this is an issue in taxprofiler or if this is coupled directly to krakenuniq.

Version of taxprofiler used is 1.1.5

Thank you so much for your help and for this great tool!

Command used and terminal output

# Run from iontorrent
gunzip -c 020_KV15-3173-D1-211101_446-996_211102_Run1.classified.fasta.gz | head

@U6L9C:07999:12907
TGGCATTTTTTTTGTCCACTGAAGTTTTAATTTTCTATGCCTGATCAATGTTTATCTAAGGACTTTCCTTTATGGCTTATGCAGACTTGGGATATTTGCCAGGAAAGGCCTTCCATACCAGCCCTGACCTGG
+
054958888888$5::7<>><<7;;::-:0888*8;::996//////)////)///5/262///8/6267066745505988876..)..).667737:5:;6:?4;06-3-30556:0666:17777311+
@U6L9C:08007:12909
GTGACAGTAGGGGAACCTGTCAAAAGAAAGGAGGGAATGGGAAGGAGTGTAGTGGAGTGTTGTGGAGTGGAGTGGAGTGGAATTGGAGATTAATGTAACGGAGTGGAGTGG
+
88;<<<<<<<<<7<7<9=<<==A>7=<<4;6888.87==>8=9>9>=;;;<<<<7<==;;6;<<6<>8818==<8=<;;4;4;5;8<<<=4:5:::<6<;4::67/58883
@U6L9C:07996:13114
CTTGAAGTTTCATTCGAGTTTCCTCAAAACAGCTATTGAATTCACTATACTGAAAGGTCGCATTACGCTCTGTCTTTCATGGAATTAGTTCCGTGGTAGCTTTATTTAATTCATCATGGTGTGGTCAT

# run from illumina
gunzip -c KV19-3902-MetaVal-DNA_240328_run1.unmapped.merged.classified.fasta.gz | head

>NB501037:997:H23YNAFX7:1:11102:6373:17697
GTATAATTATTCTTTACTGTCTTATTCTTTTCACTTTACATTATACATGCACATACCATGATTAAATACTTTGTTGCTAAAAATGCTAATGATCCCCTGAGCCTTCAGCAAGTTGTAATCTTTTTGCTGGTGGAGAGTCTTCCTTCAATNTTGGCCATCAACATTGAAGGAAGACTCTCCACCAGCAAAAAGATTACAACTTGCTGAAGGCTCAGGGGATCATTAGCATTTTTAGCAACAAAGTATTTAATCATGGTATGTGCATGTATAATGTAAAGTGAAAAGAATAAGACAGTAA
>NB501037:997:H23YNAFX7:1:11102:20152:17704
GTATTTGAAGTCAAAAGACTTGGTTTGATTCATTTTGTGACTTTTCCTCCTGGTAAATGACATATACACTCATTTATAGCCATTCATGATGTTCAAAGCTATTTGCCTTAACTTGTCCCTGAATATGCATGCACCACTACGGCCGGCTANGCAGATCACCTGAGGTAGGGAGTTCAAGACCAGCCTGACCAACATGAAGAAACCCCCATCTCTATTAGAAATACAAAATTAGCCGGCCGTAGTGGTGCATGCATATTCAGGGACAAGTTAAGGCAAATAGCTTTGAACATCATGAATGG

Relevant files

No response

System information

No response

jfy133 commented 7 months ago

Hi @SannaAb ,

Huh ok interesting. Can you confirm: are your input reads for both Illumina and iontorrent FASTQ or FASTA?

I'm wonderinf KrakenUniq just spits out reads in the same format as the input? In which case, yeah we made a false assumption in the module thinking the output is always FASTA but maybe it is not.

jfy133 commented 7 months ago

OK I think we've found the case:

KrakenUniq automatically can read internally either FASTA or FASTQ, but it forces you to 'name' the entire output file yourself (including extension). I think we made a faulty assumption(? - @Midnighter ) it's always FASTA, whereas it'll actually just spit out the same format as was given as input.

We will need to update the module to 'auto-detect' the input format, and save the classified reads with the same suffix.

jfy133 commented 7 months ago

And we will do a 1.1.7 patch release with a couple of other bug fixes very soon :)

Midnighter commented 7 months ago

I see now the relation to your other comment. sigh