Bioconductor Digest, Vol 73, Issue 25
1
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 11 months ago
Palo Alto, CA, USA
Hi all, I am sorry to fill your inbox mail with a naive question, although I would really appreciate your opinion. I am looking for a R function that takes a set of aligned sequences, and transforms a position frequency matrix into a position weight matrix. Thanks a lot. bogdan [[alternative HTML version deleted]]
• 448 views
ADD COMMENT
0
Entering edit mode
Patrick Aboyoun ★ 1.6k
@patrick-aboyoun-6734
Last seen 10.1 years ago
United States
Bogdan, Try the consensusMatrix function in the Biostrings package. It accepts a character vector, XStringSet (e.g. DNAStringSet), or an object generated by the pairwiseAlignment function: > suppressMessages(library(Biostrings)) > consensusMatrix(DNAStringSet(c("ACGT", "AAAA", "ACCT", "AGGG"))) [,1] [,2] [,3] [,4] A 4 1 1 1 C 0 2 1 0 G 0 1 2 1 T 0 0 0 2 M 0 0 0 0 R 0 0 0 0 W 0 0 0 0 S 0 0 0 0 Y 0 0 0 0 K 0 0 0 0 V 0 0 0 0 H 0 0 0 0 D 0 0 0 0 B 0 0 0 0 N 0 0 0 0 - 0 0 0 0 + 0 0 0 0 > consensusMatrix(DNAStringSet(c("ACGT", "AAAA", "ACCT", "AGGG")), baseOnly = TRUE) [,1] [,2] [,3] [,4] A 4 1 1 1 C 0 2 1 0 G 0 1 2 1 T 0 0 0 2 other 0 0 0 0 > sessionInfo() R version 2.9.0 Under development (unstable) (2009-02-23 r47990) i386-apple-darwin9.6.0 locale: en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Biostrings_2.11.42 IRanges_1.1.54 loaded via a namespace (and not attached): [1] Biobase_2.3.11 Bogdan Tanasa wrote: > Hi all, > > I am sorry to fill your inbox mail with a naive question, although I would > really appreciate your opinion. > I am looking for a R function that takes a set of aligned sequences, and > transforms a position frequency > matrix into a position weight matrix. Thanks a lot. > > bogdan > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENT

Login before adding your answer.

Traffic: 752 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