Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Fst from VariantMatrix #16

Closed
agladstein opened this issue Mar 4, 2019 · 4 comments
Closed

Fst from VariantMatrix #16

agladstein opened this issue Mar 4, 2019 · 4 comments

Comments

@agladstein
Copy link

From the documentation it looks to me like libsequence.fst.Fst takes the object polytable.SimData as input. Is that correct?
I'm reading in msprime simulations as numpy matrix

tree_np_matrix_vmat = variant_matrix.VariantMatrix(tree_np_matrix, pos)

So, can libsequence.fst.Fst take variant_matrix.VariantMatrix or variant_matrix.VariantMatrix.count_alleles as input?
Or else, how do I calculate Fst from the VariantMatrix?

@molpopgen
Copy link
Owner

molpopgen commented Mar 4, 2019

You convert your numpy data to the correct format to make a SimData. See molpopgen/libsequence#35

Alternately, since the memory layout is the same as allel, use that for Fst in the meanwhile.

This is a consequence of no time to work on libsequence.

@agladstein
Copy link
Author

Ah...

I haven't been able to find in the docs how to convert from numpy to create the SimData.

I'm not sure what you mean by "use that or Fst".

@molpopgen
Copy link
Owner

molpopgen commented Mar 4, 2019

I haven't been able to find in the docs how to convert from numpy to create the SimData.

"Just do it"--all you need is Python. The input for a VariantMatrix is a matrix of integers with rows as sites. The input for SimData is a list of strings, where each string is a haplotype. (List of positions is needed for both, of course.)

I'm not sure what you mean by "use that or Fst".

s/or/for/

@agladstein
Copy link
Author

hahaha ok :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants