SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Struggling with quality trimming Alex852013 Introductions 3 12-02-2015 12:52 PM
Trimmomatic quality trimming kga1978 Bioinformatics 26 11-24-2015 10:14 AM
Can you do quality trimming in NovoAlign? prs321 Bioinformatics 1 12-05-2013 11:21 AM
Adapter trimming and trimming by quality question alisrpp Bioinformatics 5 04-08-2013 04:55 PM
newbler quality trimming Himalaya 454 Pyrosequencing 2 08-22-2012 04:44 AM

Reply
 
Thread Tools
Old 04-16-2020, 01:28 AM   #1
maxz411
Junior Member
 
Location: Rochester, NY

Join Date: Feb 2020
Posts: 7
Default Incorrect bbmap quality trimming

I am using bbmap to trim bases below a certain quality threshold in a FASTQ file. The file looks fine to me in terms of quality scores, but when I run bbmap it trims almost all the bases away and seems to leave just one base per read, despite most of the bases meeting the quality threshold.

I am not sure if this makes any difference, but this is a FASTQ file generated by merging overlapping paired-end reads and adjusting quality scores to reflect this with SeqPrep. As a result, most of the quality scores are high (lowercase ASCII characters) and I am setting a trim threshold of 59. Nonetheless, many more of the bases in the file should meet this threshold than what bbmap is outputting.

In case it is helpful, I pasted my command below. I also pasted a few lines of the FASTQ input.

Code:
./reformat.sh in=./samples/B10C_merge.fq out=./samples/B10C_trim.fq qtrim=rl trimq=59 qin=33 qout=33
Code:
@M02713:293:GW200329AmpliconEZC0318:1:2105:15470:1423 1:N:0:TGATCACG+AGGCGAAG
GATCTGTTGCTGCCCCAGGATGTTGAGGAGTTTTTTGAAGGCCCAAGTGAAGCCCTCCAAGTGTTAGGAGCTCCTGCAGCACAGGCCCTGCCCCAGCTACTCCATGGCCCCCGTCATCTTTTGTCCCTTCTCAAAAAACTTACCAGGGCAACTATGGCTTCCACCTGGGCTTCCTGCAGTC
+
hhiijlllllllmmnnnnnnnnooooooomnooonnnmnoooonnoooooonnnooonoooooooooooonlooooooooonnnnmmmnnnnonnnoooooooonnnnnnlmnnnnnoononnonoononnnnnooolnooooooonnnnnoooooooonnnnnnnnnmmmjmmmmijjij
@M02713:293:GW200329AmpliconEZC0318:1:2105:18370:1751 1:N:0:TGATCACG+AGGCGAAG
TTTGATGATGGCTGTCATGTCTGGGAGCCTGTGGCTGAAGAAAAAGGAGGAGAGAGATGGCAGAAGCTGCTGGTGGCGGGGCTTCTTCTGCAGGATGGAAATGGCTCTGGACTTGGCGGTGGCTGATGCCCCTCGCTCTGCTGCCGCTTGGTTCTGGACAGCAGCCGGGTAATGGCTGCTGCGGCGGCTGCTGGATGGTTGCAGCGACTGGGCCTGCTTCTCCTCAGCAGCCA
+
fggggkkkkkkkllllllkgllmmmmlllmmmgmmmlmmmmmmmmlllmlmmnmmmmnnnmnmmnmnnnmlmnnnmnmmnmnmnoonooomooomoonnmonooojnnolnonnnnlnmbhkojmWWljnnmkmjiUjcmlllnniigllnahWaWmWmmgkhllmmnn`jninnmikehhkagdTj`T`UUa`T`WbWaTThhh`TgfgklekkkeVhVV[gU^UQZPZQfO
@M02713:293:GW200329AmpliconEZC0318:1:2105:12451:2026 1:N:0:TGATCACG+AGGCGAAG
TTTGATGATGGCTGTCATGGCAAAGGGAGGAGGACAGGCTTCTCCGTCCCCAGGAAGCAACTGGAGGCCCAGCTGAGCCCAGCTCTGCCTCAGCTTCCCCATCTGTAAAATGGGGTGATGGGCACCAGGCGGTAGGTGCAGCCTCACTGTCTTCTTGCCCCCAGCGGAGCTGATGGAGCGGGCCGCGGTGCCACCCCTTTGGCCGGCCCTGTACCCACCAGGCCGCAGCTCCCTGCACCACGCCCAGCAGCTGCAGCTCTTCTCCTCAGCAGCC
+
CABCCFFFFFFFGGGGGGGGGGHHmmlmllllllmmhllmmmmmkammllmmllmmlmmmmmlmmmljlllmmlmmmmllmmmmmmmmmmmmmmmmmlmmmmmmmmmmmmmmmmlllklmnnnmmmnngnmmmkmmnnnknnooooomonoonljnnnnnlmmmnnnnnnnoonlmknnmlmmmmmlmmdhjTllmmmmllUhllgkmlmmmlllmlmllllllllmllllmmmmklllllmlkmklmHGHHGGGGGGGGGGFCFFFFCCCCCB
@M02713:293:GW200329AmpliconEZC0318:1:2105:19453:2143 1:N:0:TGATCACG+AGGCGAAG
GAGGGGCATCAGCCACCGCCAAGTCCAGAGCCATTTCCATCCTGCAGAAGAAGCCCCGCCACCAGCAGCTTCTGCCATCTCTCTCCTCCTTTTTCTTCAGCCACAGGCTCCCAGACATGACAGCCATCATCAA
+
[Ofd[Q]RS^RRib;eimnlnmnjnmnjYiiimmmYmnjVnmi[iomnomoldnnnmnlmimooooomoonnoojomlkjnlnnnonnlkomkjoonnonomomonnlmonmnjnmnnnnjmljmmmmiiiii
@M02713:293:GW200329AmpliconEZC0318:1:2105:11660:2539 1:N:0:TGATCACG+AGGCGAAG
AGCCCCGCCACCAGCAGCTTCTGCCATCTCTCTCCTCCTTTTTCTTCAGCCACAGGCTCCCAGACATGACAGCCATCATCAAA
+
Qbiiijkjkijmjmnnnnnmmnnooonnnnonnnoonlooommoonnooooooonnmoonnnnmmnnnnnnmmmmmmmiifgi
@M02713:293:GW200329AmpliconEZC0318:1:2105:18713:2826 1:N:0:TGATCACG+AGGCGAAG
CTGTTATTGCTAGCGTTTTAGCACAGGTGCAGCTGGTGGAGTCTGGGGGAGGATTGGTCCAGGCTGGAGGCTCTCTGAGACTCTCCTGTGCAGGCTCTTCACCCGCCTTCACTAAACTCGCCGTGGGGTGGTTCCGCCAGGCTCCAGGAAAGGAGCGTGAGTTTGTCGCAGCTTGTGGTTGGAGTGGAAGTGATACATACTATGCGGACTCCGTGAAGGGCCGATCCAGCATCTTCAGAGACAACGCCAAGAACACGGTGTATCTGCAAATGAACAGCCTGAAACCTGAGGACACGGCCATTTATTACTGTGCAGTGAGAGTATGGTGGGCGGGCGATTGGGATACAGAAACGCAGTATGATTACTGGGGCCAGGGGACCCAGGTCACCGTCTCCTCAGAATTCGGTAAGCCTATCCCTAAC
+
BBBBBFFFFFFFFGGEFGGGGGHHHHHGHFHHFHHHGFGGHFHHGHHGGGGGGHHHEFGFHHHHHHGHHGGHHHHHHHHHHHHEHHHGHHGFHGGHHHEHHHHGGFEFGGFFHHHGHHEGGGG@DGFG<@CGGGHGGGGFGGECEHFHEHHAGGHHGDFGGCGFGFFGHGGGGlkjflgUTUghU_lgkl`^kllkgh^lkigejlgjaejlkjlgilhdcjkilahmlllmmlmkmmmkjllkhkKgmHHGGHFGFFHGHHEGDDGFHHGHHHHHFGHHHHFGEEGFFGHFDBGHGGFFHHFHHHFHHGHFHFFHHEHFGFFHGGGEECEEEAFCF3HFGEGFHGHHECFEHFHFHFGD5HHHDFE1GGHFHHHHFFCHFFG3FFAEEFAGHFGHEDBFEGFEBGGGGGFFFFFFFAA>33
@M02713:293:GW200329AmpliconEZC0318:1:2105:11972:2903 1:N:0:TGATCACG+AGGCGAAG
GGGGCTTCTTCTGCAGGATGGAAATGGCTCTGGACTTGGCGGTGGCTGATGCCCCTCGCTCTGCTGCCGCTTG
+
jkikkjjmmmmmnnnnnnnnnnoooooooonoooomnnnnnnnnmoononnmnnmmmmmmnmjjjjklkkkjj
@M02713:293:GW200329AmpliconEZC0318:1:2105:13695:2965 1:N:0:TGATCACG+AGGCGAAG
TGGCTGCTGAGGAGAAGCAGGCCCAGTCGCTGCAACCATCCAGCAGCCGCCGCAGCAGCCATTACCCGGCTGCTGTCCAGAACCAAGCGGCAGCAGAGCGAGGGGCATCAGCCACCGCCAAGTCCAGAGCCATTTCCATCCTGCAGAAGAAGCCCCGCCACCAGCAGCTTCTGCCATCTCTCTCCTCCTTTTTCTTCAGCCACAGGCTCCCAGACATGACAGCCATCATCAAA
+
OZQPQPQTS8_\VV_VT`T`Sh__;TaTVV`TTh<`Ua;aWW`TTTaTS`SV8VTgVimmmka<mkfiUiU_TW`WiWWaaWhUaTTfiVVbbVUjjTgbTmmlWWlWmcWnhcnnnnnnmmkooommmoooonimmYVonmmmnioooollnnnmnmnmnnnmnnnnnmmnnnnnmmnnkmmlmmllmmmmmmoolommmmlmllllmmmllllllllllkkkkkkkhihgg
@M02713:293:GW200329AmpliconEZC0318:1:2105:15588:3299 1:N:0:TGATCACG+AGGCGAAG
TGGCTGCTGAGGAGAAGCAGGCCCAGTCGCTGCAACCATCCAGCAGCCGCCGCAGCAGCCATTACCCGGCTGCTGTCCAGAACCAAGCGGCAGCAGAGCGAGGGGCATCAGCCACCGCCAAGTCCAGAGCCATTTCCATCCTGCAGAAGAAGCCCCGCCACCAGTAGCTTCTGCCATCTCTCTCCTCCTTTTTCTTCAGCCACAGGCTCCCAGACATGACAGCCATCATCAAA
+
4ZOPP\6TT8^\`9UUU9T_ScaS;TTT`UUUTa<b;U0aTTTT<TbT_`SUUVT`VinmmiaUh`TiUTUiTjaWWajjjWbUbTTSiVnmmljiUTTbTllmWjbWUWVlgcnnlmhnnnnoonmilooooonnonmonommonooonfnnnnmnmnnnnmn`mmnnmmnnnnnmmmmnmmmnmlllmmlmmlmlmmmmmmmlllmmmmllllllllllkkkkkkkhhhhh
maxz411 is offline   Reply With Quote
Old 04-16-2020, 06:14 AM   #2
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,076
Default

Quote:
trim threshold of 59
If this data is in Illumina encoding (Phred+64) then you need to specify "qin=64". If you need the Q scores reformatted to sanger then "qout=33".
GenoMax is offline   Reply With Quote
Old 04-16-2020, 08:30 AM   #3
maxz411
Junior Member
 
Location: Rochester, NY

Join Date: Feb 2020
Posts: 7
Default

I thought Phred+64 was no longer used for Illumina scores? I am pretty sure mine is encoded in Phred+33. And I specified qin=33 and qout=33 in the command.

The reason the threshold is 59 is not because it is Phred+64, but because the scores were increased during merging.
maxz411 is offline   Reply With Quote
Old 04-16-2020, 10:51 AM   #4
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 7,076
Default

I see. Did you merge the data using `bbmerge`? If not can you try it instead of whichever program you used? I am not sure having Q-scores that go past even Illumina encoding make sense.
GenoMax is offline   Reply With Quote
Old 04-16-2020, 01:40 PM   #5
maxz411
Junior Member
 
Location: Rochester, NY

Join Date: Feb 2020
Posts: 7
Default

Ah I figured out what was happening. Your comment about the high Phred scores got me thinking on the right track. After looking at the documentation further it seems that bbmap has a flag to cap base quality which is set to 41 by default, which would eliminate almost all of my bases, explaining my results.

I added the following flags

maxcalledquality=1000 ibq

to remove the cap on quality score and also 'ibq' to ignore any base scores it might consider problematic in case they are still being flagged somehow. This fixed my issue and outputted a properly trimmed file.
maxz411 is offline   Reply With Quote
Reply

Tags
bbmap, miseq, trimming reads

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 10:11 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO