Question: Q score filter: 90% of the q scores from a QualityScaledDNAStringSet are above 30.
2
gravatar for XIA.PAN
17 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 • 356 views
ADD COMMENTlink modified 17 months ago by Martin Morgan ♦♦ 23k • written 17 months ago by XIA.PAN20
Answer: Q score filter: 90% of the q scores from a QualityScaledDNAStringSet are above 3
3
gravatar for Martin Morgan
17 months ago by
Martin Morgan ♦♦ 23k
United States
Martin Morgan ♦♦ 23k 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 17 months ago by Martin Morgan ♦♦ 23k

It worked! Thank you

ADD REPLYlink written 17 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 16.09
Traffic: 167 users visited in the last hour