Question: Position Weight Matrix From Sequence Alignment
3
gravatar for Timtico
8.1 years ago by
Timtico330
NL
Timtico330 wrote:

Hello,

I use a Perl script to find a specific sequence, and as output I parse a fastafile containing the match sequence including a defined number of basepairs.

Now I want to do a multiple sequence alignment (e.g. ClustalW), but I want a position weight matrix as output, since for compatibility issues I need to create sequence using an R package. (instead of online tools such as weblogo)

Anyone knows a alignment tool (Bioperl, Bioconductor, online?) which gives me the matrix as output?

Regards

clustalw multiple • 5.9k views
ADD COMMENTlink modified 3.0 years ago by Biostar ♦♦ 20 • written 8.1 years ago by Timtico330

duplicate? http://biostar.stackexchange.com/questions/2806/consensus-sequence

ADD REPLYlink written 8.1 years ago by brentp23k
5
gravatar for brentp
8.1 years ago by
brentp23k
Salt Lake City, UT
brentp23k wrote:

You can create a position weight matrix with motility (python or c++). The interface is very simple so even if you don't use python, it should be straight-forward.

seqs = ['AGATAA', 'TGATAA', 'AGATAG']
pwm = motility.make_pwm(seqs)
print (pwm.max_score(), pwm.min_score())
# (11.1699250014, 0.0)
print pwm
#[[1.5849625007211563, 0.0, 0.0, 1.0],
# [0.0, 0.0, 2.0, 0.0],
# [2.0, 0.0, 0.0, 0.0],
# [0.0, 0.0, 0.0, 2.0],
# [2.0, 0.0, 0.0, 0.0],
# [1.5849625007211563, 0.0, 1.0, 0.0]]
ADD COMMENTlink written 8.1 years ago by brentp23k

thanks for the answer, I'm not familiar with python however.. would like to keep working in R and Perl.

ADD REPLYlink written 8.1 years ago by Timtico330
3
gravatar for hadasa
8.1 years ago by
hadasa1.0k
hadasa1.0k wrote:

Have a look at the BioStrings package in R. It is part of the Bioconductor. To install

source("http://www.bioconductor.org/biocLite.R"
 biocLite("Biostrings")
ADD COMMENTlink written 8.1 years ago by hadasa1.0k

nice, the consmat() function in the biostrings package seems to do the trick :)

ADD REPLYlink written 8.1 years ago by Timtico330

Just an update. Now it is called: consensusMatrix() function.

ADD REPLYlink written 19 months ago by tiago2112871.1k
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.3.0
Traffic: 1751 users visited in the last hour