Fix to issue #82 refering to failed barcode determination error #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix to the error message "Error: Porechop could not determine barcode orientation". I analysed the error and found out that the orientation was 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 perfectly aligning read.
As a solution to this 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.