Skip to content

How do you add ancestral state to SampleData object? #545

Closed Answered by hyanwong
lakishadavid asked this question in Q&A
Discussion options

You must be logged in to vote

@awohns wrote some code to do this, I think, but it might be helpful to post demo code here. The main problem is going to be to ensure that you are using the same chromosome build in the VCF as the fasta file, because any function we write here might not be able to check. Perhaps we should at least check that the chromosome lengths are the same in the VCF and the fasta?

The code we used is here: https://github.com/mcveanlab/treeseq-inference/blob/0cbbb062c96ad4433d8b4d0f120f93ac2d985345/human-data/convert.py#L581 coupled with the function at https://github.com/mcveanlab/treeseq-inference/blob/0cbbb062c96ad4433d8b4d0f120f93ac2d985345/human-data/convert.py#L89. It uses the pysam library. I …

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
6 replies
@lakishadavid
Comment options

@lakishadavid
Comment options

@hyanwong
Comment options

@lakishadavid
Comment options

@jeromekelleher
Comment options

Answer selected by benjeffery
Comment options

You must be logged in to vote
1 reply
@lakishadavid
Comment options

Comment options

You must be logged in to vote
1 reply
@hyanwong
Comment options

Comment options

You must be logged in to vote
0 replies
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