Skip to content

ms format sim_mutations() output #2342

Answered by grahamgower
mshpak76 asked this question in Q&A
Discussion options

You must be logged in to vote

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.

$ python -c "import tskit; help(tskit.write_ms)"
Help on function write_ms in module tskit.trees:

write_ms(tree_sequence, output, print_trees=False, precision=4, num_replicates=1, write_header=True)
    Write ``ms`` formatted output from the genotypes of a tree sequence
    or an iterator over tree sequences. Usage:

    .. code-block:: python

        import tskit as ts

        tree_sequence = msprime.simulate(
            sample_size=sample_size,
            Ne=Ne,
            length=length,
        …

Replies: 0 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@grahamgower
Comment options

@grahamgower
Comment options

Answer selected by mshpak76
Comment options

You must be logged in to vote
2 replies
@mshpak76
Comment options

@jeromekelleher
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants