Where can I find a Python implementation of Clark's or EM algorithm?
1
5
Entering edit mode
7.2 years ago
alec_djinn ▴ 380

I have a list of allelic frequencies estimated by RFLP. I am looking for a Python implementation of the Clark's algo or the EM algo I can use to determine the haplotype frequencies. Can anyone point me out to some good resource?

python Clark's algorithm • 2.4k views
ADD COMMENT
2
Entering edit mode
7.2 years ago
IP ▴ 760

This is the implementation I did when doing a course in my masters, of course, it can be wrong. It is done to estimate genotype frequencies. But I think that it could be helpful for you. If you want, I could provide you the files qualities.txt and bases.txt. They show the error rate and the bases.

ADD COMMENT
0
Entering edit mode

The identation of the code looks fine, but does anyone know a way to post the whole code?

ADD REPLY
0
Entering edit mode

Put your code on Github and include a link for the public Gist. Biostars understands the links and will reproduce the code inline.

ADD REPLY
0
Entering edit mode

Done! thank you very much!

ADD REPLY
0
Entering edit mode

It doesn't look like the Clark's or the EM algo. Can you please post the input files? In general, however, I don't need to check the reads and the bases of a sequence. I expect to input a list of allelic frequencies and to get the haplotype frequencies as output.

ADD REPLY
0
Entering edit mode

sure, here you have a link to the files in gist
I am not an expert on the EM- algorithm, but I think that you could modify the script to do what you want. The part of the EM algorithm begins at line 51, with the initial guess. and then it performs the Expectation and maximization steps.

ADD REPLY
0
Entering edit mode

Unfortunately, this is not what I am looking for.

ADD REPLY

Login before adding your answer.

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