Search
Question: Q score filter: 90% of the q scores from a QualityScaledDNAStringSet are above 30.
2
gravatar for XIA.PAN
6 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!

ADD COMMENTlink modified 6 months ago by Martin Morgan ♦♦ 22k • written 6 months ago by XIA.PAN20
3
gravatar for Martin Morgan
6 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]
ADD COMMENTlink written 6 months ago by Martin Morgan ♦♦ 22k

It worked! Thank you

ADD REPLYlink written 6 months ago by XIA.PAN20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 473 users visited in the last hour