astheeggeggs / lshmm

code to run Li and Stephens
MIT License
3 stars 3 forks source link

External API #5

Closed jeromekelleher closed 2 years ago

jeromekelleher commented 2 years ago

It's not clear what the external API should be. Here's one option, we have a set of functions like

lshmm.haploid.forwards
lshmm.haploid.backwards
lshmm.haploid.viterbi
# and 
lshmm.diploid.forwards
lshmm.diploid.backwards
lshmm.diploid.viterbi

What do you think @astheeggeggs?

astheeggeggs commented 2 years ago

That makes sense to me.

jeromekelleher commented 2 years ago

OK, so simplest way to do that is to have two files haploid.py and diploid.py, each of which has those three functions.

Although, come to think of it, it could be annoying to have two different function with the same name.

What if we just had three functions and we determined the ploidy from the dimensions of the input haplotypes? That'd be nice.

astheeggeggs commented 2 years ago

I've added ls.y with wrappers to check and run relevant functions based on ploidy and have added tests.