bcm-uga / Loter

A software package for local ancestry inference and haplotype phasing
Other
38 stars 7 forks source link

multiple sources #7

Closed angelesdecara closed 5 years ago

angelesdecara commented 5 years ago

Hi,

I'm trying to compare the results I have with RFmix and Loter, with one target population which may have received input from other 13 (I should have started somewhere simpler). When I try to save the output, it obviously complains either if I try with %i or %13i:

ValueError: Expected 1D or 2D array, got 3D array instead

what's the format of the output? i.e., what dimensions does res_loter have when using multiple populations? Sorry for my python ignorance...

Many thanks!

gdurif commented 5 years ago

Hi, Could you tell me which function of Loter you are using as the outputs can be different depending on the function (c.f. https://github.com/bcm-uga/Loter/blob/master/python-package/Local_Ancestry_Example.ipynb) ?

Could you paste a code example ?

Thanks

angelesdecara commented 5 years ago

Sorry for my late reply. Here's the function I used:

res_loter=lc.loter_local_ancestry([Hnp02,Hnp03,Hnp04,Hnp05,Hnp06,Hnp07,Hnp08,Hnp09,Hnp10,Hnp11,Hnp12,Hnp13,Hnp14],Hnp01,num_threads=4)

Many thanks!

gdurif commented 5 years ago

In this case, res_loter[0] contains the inferred ancestries, being a matrix (as a numpy array) with haplotypes in rows and SNPs in columns, each entry between 0 and 12 identifies one of the 13 ref populations (respecting the index order of input); and res_loter[1] contains the number of time that each ancestry was picked in the bagging procedure.

I hope that it will help.

angelesdecara commented 5 years ago

Many thanks! That did the trick when saving it (using res_loter[0])!

gdurif commented 5 years ago

You're welcome, do not hesitate if you have any questions.