rrwick / Porechop

adapter trimmer for Oxford Nanopore reads
GNU General Public License v3.0
322 stars 123 forks source link

Error: Porechop could not determine barcode orientation #82

Closed JingXia730 closed 4 years ago

JingXia730 commented 5 years ago

Hi,

I was trying to use Porechop for barcode demultiplexing, and got the following error and found no rearranged FASTQ in the output folder:

Error: Porechop could not determine barcode orientation

This is the command I used:

porechop -i /zfs1/jboyle/jingxia/Bd_Nc_gDNA/Bd_Nc_FASTQ/ -b /zfs1/jboyle/jingxia/Bd_Nc_gDNA/Demultiplexing_Bd_Nc/

Any advice to solve this problem?

Thank you so much!!

Jing

MarkusHaak commented 5 years ago

Hi Jing,

I encountered the same error and wrote a fix for it. I only realized this error now, but had a look at older data and saw that it was there for quite some time, leading to some substancial data loss in previous experiments. I analysed the reasons for the error and found out that the orientation is determined the following way: Each read in the processed fastq file is aligned against every adapter set, where there exist two seperate sets (forward and reverse) for each barcode. For each barcode set, only the best score among all alignments is stored. To determine the orientation, Porechop compares the sum of max scores of all forward sets to the sum of max scores of all reverse sets. The problem occurs because this strategy, considering only the max scores, is highly dependent on both the read quality and the number of reads per fastq file. By analysing the cases were the error occured I discovered that both orientations of a set, in my case forward and reverse of BC11, had a max score of 100.0, meaning at least one read aligned perfectly. As a solution to the problem, I changed the determination of orientation to comparing the sum of all scores instead of only the maximum score. This should be much more robust.

I hope that this solves your problems as well.

Best, Markus

JingXia730 commented 4 years ago

Thanks Markus!

Jing