This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error in .normargSubject(subject) : active masks are not supported yet, please complain! in matchPWM, Biostrings

I am using Biostrings package matchPWM method and I am using the following steps:

> library(BSgenome.Hsapiens.UCSC.hg19)
> #loading my pwm
>matchPWM(pwm, Hsapiens)
Error in .normargSubject(subject) :
  active masks are not supported yet, please complain!

What is the error about and what can be done to overcome it?

Also here are the session specifications:

> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C                 LC_NAME=C
[9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] BSgenome.Hsapiens.UCSC.hg19_1.3.19 BSgenome_1.26.1
[3] GenomicRanges_1.10.7               Biostrings_2.26.3
[5] IRanges_1.16.6                     BiocGenerics_0.4.0

loaded via a namespace (and not attached):
[1] parallel_2.15.3 stats4_2.15.3   tools_2.15.3
biostrings r

1 answer

This is because Hsapiens is a MaskedDNAString, rather than just a DNAString. You should be able to use Hsapiens <- unmasked(Hsapiens) to convert to a DNAString that will work.

Edit: I should add that the basis for this is likely that soft-masked regions should be ignored by the matchPWM function.

I did try to use the command and it threw me an error:

Error in function (classes, fdef, mtable)  :
unable to find an inherited method for function unmasked for signature "BSgenome"

Well, when you iterate over a BSgenome, you end up processing the chromosomes, which are DNAStrings. They actually shouldn't be MaskedDNAStrings, so it's a bit odd that you're running into this. You might post a reproducible example (just an example PWM that causes this) or just post to the Bioconductor email list so the package authors can have a look.

Log in to answer this question.