Skip to content

VCF metadata question #46

@akijarl

Description

@akijarl

Hi Peter, a question regarding pyslim's VCF output:
When you output VCF files from SLiM it has that great feature to include the mutation type (MT), as well as the mutation ID value, in the VCF output. However when we recap/mutate and then output a VCF with pyslim all that information is lost. If that metadata is still there after recap/mutate, is there a possibility that information could be included in the VCF of the pyslim write_vcf output?

Activity

petrelharp

petrelharp commented on Jul 22, 2019

@petrelharp
Contributor

That's a great idea. The information is totally there, so we could output it. The vcf output for tskit also needs to be improved; so the best solution would start with that and then modifying it for pyslim.

I probably can't do this right away, though. Help is appreciated!

akijarl

akijarl commented on Sep 9, 2019

@akijarl
Author

Hi Peter,

I've been trying to modify VcfWriter in the tskit - vcf.py file with the code below to the get the metadata output as part of the write_vcf command:

muts=iter(self.mutations())
print(
     self.contig_id, pos, ".", ref, alt, ".", "PASS", next(muts).metadata, "GT", 
sep="\t", end="\t", file=output)

I've been struggling with getting this to work, but I just updated tskit and now even when I attempt the usual vcf output I'm getting errors like "Cannot specify ploidy when individuals present" and when I remove the ploidy specification

with open("T1.vcf", "w") as vcf_file:
    mutated.write_vcf(vcf_file)

I get a "Cannot generate genotypes for non-samples unless missing data imputation is enabled". Do you know what's going on with that?

petrelharp

petrelharp commented on Sep 9, 2019

@petrelharp
Contributor

I don't know! Here's my suggestion:

  1. Start a pull request for either pyslim (if this is slim-specific) or tskit (if not) with your modifications. That way we can see the code and help figure out what's going on.
  2. To make sure normal vcf output works, make double sure you're working with an unmodified version of tskit and pyslim; if not, there's a bug, so post an issue to tskit with the usual details.

Looking forward to it,
peter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @petrelharp@akijarl

        Issue actions

          VCF metadata question · Issue #46 · tskit-dev/pyslim