Update fqfilter_v2.pl - Fix problem with multiple whitespaces in read-IDs #362
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.
Hi there,
hope everything is going well in sweden! :)
We recently encountered a small bug within the fqfilter script.
For read-IDs containing multiple whitespaces, only the last part (after the last whitespace) was removed due to greedy pattern matching.
Subsequently, read-IDs within the *.unmapped.bam can still contain whitespaces, which causes problems when mapping with STAR.
Adapting the pattern to just match the first non-whitespace character-set within the read-ID fixes this Problem.
Cheers,
Daniel
P.S.: A short example:
Some demultiplexing tools keep the index-combinations within the read-header. This will trigger the bug.
For this read-ID within the fastq file
@VL00118:284:AACMFY5M5:1:1101:33986:1000 1:N:0:0 ACTGAGCG:CGTGTGAT
we would get this read-ID within the unmapped bam
@VL00118:284:AACMFY5M5:1:1101:33986:1000 1:N:0:0
STAR does not throw any error but will fail to get the correct read sequences from the bam, resulting in all reads consisting of only one 'N' within any bam files produced downstream.