Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queryBases filter with pattern returns no matching reads #190

Open
adomingues opened this issue May 5, 2019 · 0 comments
Open

queryBases filter with pattern returns no matching reads #190

adomingues opened this issue May 5, 2019 · 0 comments

Comments

@adomingues
Copy link

I am not sure if this is a bug or if I am setting up the command incorrectly, but when trying to filter alignments based on the first nucleotide in the query sequence, no match is found. This what I tried (bamtools 2.5.1):

1. Using my actual query, where I am trying to get sequences that start with an "A"

bamtools filter -in WT_TAP.bam  -queryBases "^A*" | bamtools count
0

This is unexpected because there are plenty of sequences that should match this pattern:

samtools view WT_TAP.bam | cut -f 10 | egrep "^A" | wc -l
712681

2. testing a (full) sequence that exists in the file

bamtools filter -in WT_TAP.bam  -queryBases "GTTTGACGGCCTTGATGTGCACT" | bamtools count
5

which returns the expected output.

3. testing a subset of the above sequence with and without regex

bamtools filter -in WT_TAP.bam  -queryBases "GTTT" | bamtools count
0

or with pattern

bamtools filter -in WT_TAP.bam  -queryBases "GTTT*" | bamtools count
30667

Which returns the expected result. However, if I restrict it to only a single nucleotide, it again fails to return any match:

bamtools filter -in WT_TAP.bam  -queryBases "G*" | bamtools count
0

This is a bit puzzling. Could you please help me construct a query to select alignments whose query sequence starts with a particular nucleotide? Along the same lines, and related to this question, what is the best way to take in account the reverse-complemented sequences (0x10 flag)?

@adomingues adomingues changed the title queryBases filter with patter returns no matching reads queryBases filter with pattern returns no matching reads May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant