thanks for the answer, I'm not familiar with python however.. would like to keep working in R and Perl.
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
2 answers
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]]
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")
Log in to answer this question.
Duplicate? Consensus Sequence