Q score filter: 90% of the q scores from a QualityScaledDNAStringSet are above 30.
1
2
Entering edit mode
XIA.PAN ▴ 20
@xiapan-12407
Last seen 5.2 years ago

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 • 1.1k views
ADD COMMENT
3
Entering edit mode
@martin-morgan-1513
Last seen 5 months ago
United States

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 COMMENT
0
Entering edit mode

It worked! Thank you

ADD REPLY

Login before adding your answer.

Traffic: 507 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6