ms format sim_mutations() output #2342
-
Is there a straightforward way to display the results of sim_mutations() in ms output format, i.e. a matrix with each row representing the genotype at every segregating site For the msprime-generated object mts:
I would like to display something along the lines of e.g. for 5 segregating sites
Presumably mts has the appropriate attribute to do so, but I don't know which one. Among the attributes listed is mts.genotype_matrix and mts.haplotypes, but I don't know if these are the correct attributes, nor what to do with them. I would like to do this without running ms code in mspms. Alternatively, my main reason for wanting this is to generate an output matrix from which I can readily compute allele frequencies at each segregating site and other population statistics, so perhaps there is a more efficient way of doing this. |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 6 replies
-
Hey @mshpak76. The
|
Beta Was this translation helpful? Give feedback.
-
It's probably worth while looking through a few of our tutorials @mshpak76, starting here. Tskit has lots of methods for computing popgen stats that will be much more efficient than outputting text. |
Beta Was this translation helpful? Give feedback.
Hey @mshpak76. The
genotype_matrix()
method of the tree sequence is probably what you want. There is also an (undocumented)tskit.write_ts()
method that will give you ms-formatted output.