#### The support.bioconductor.org editor has been updated to markdown! Please see more info at: Tutorial: Updated Support Site Editor

Question: Q score filter: 90% of the q scores from a QualityScaledDNAStringSet are above 30.
2
9 months ago by
XIA.PAN20
XIA.PAN20 wrote:

Dear all,

I need to filter a QualityScaledDNAStringSet that have less than 10% of the nucleotide having a Q score less than 30.

I can get the numbers of Q scores in a list with as(quality(Set), "IntegerList")

How can I apply the calculation?

Thank you!

q score • 208 views
modified 9 months ago by Martin Morgan ♦♦ 22k • written 9 months ago by XIA.PAN20
Answer: Q score filter: 90% of the q scores from a QualityScaledDNAStringSet are above 3
3
9 months ago by
Martin Morgan ♦♦ 22k
United States
Martin Morgan ♦♦ 22k wrote:

For some IntegerList

set.seed(123)
il = IntegerList(runif(20, 25, 40), runif(30, 25, 40))

you can perform mathematical operations that are vectorized over the elements

keep = (sum(il > 30) / lengths(il)) > .6

and then subset the original

Set[keep]