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

Read quality thresholds (Q) #44

Open
Hedi65 opened this issue Nov 16, 2023 · 1 comment
Open

Read quality thresholds (Q) #44

Hedi65 opened this issue Nov 16, 2023 · 1 comment
Assignees
Labels

Comments

@Hedi65
Copy link

Hedi65 commented Nov 16, 2023

dear developer

after using -vvv in the command line I am getting the below results

Read quality thresholds (Q)

5 66929 100.0%
7 66049 98.7%
10 19683 29.4%
12 127 00.2%
15 0 00.0%
20 0 00.0%
25 0 00.0%
30 0 00.0%

I am wondering if is it possible to get the percentage of reads with >8 or >9 too?

THanks

@esteinig
Copy link
Owner

esteinig commented Nov 16, 2023

Hello! At the moment the thresholds are hard-coded, although that could probably be changed, as they are pretty arbitrary. I'll flag it for the next release as a feature, thanks for letting me know this is of interest.

In the meantime, you can work around it using nanoq, awk and bash - quite verbose, but it should work:

# output read q values as txt file and get total reads from summary stats
total_reads=$(nanoq -i test.fq -s -Q qual.txt | cut -d' ' -f1)

# count reads greater than threshold in list
gt9=$(awk '$1>9{c++} END{print c+0}' qual.txt)   # > 9.0
gt8=$(awk '$1>8{c++} END{print c+0}' qual.txt)   # > 8.0

# divide and multiply for percentage
echo "scale=2 ; ($gt9 / $total_reads)*100" | bc  # > 9.0
echo "scale=2 ; ($gt8 / $total_reads)*100" | bc  # > 8.0

@esteinig esteinig self-assigned this Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants