Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

how to split multiple samples in a single VCF file?

rcholicrcholic DenverMember

I finally got the filtered VCF file from PWA + PiCard + GATK pipeline, and have 11 exome-seq data files which were processed as a list of input to GATK. In the process of getting VCF, I did not see an option of separating the 11 samples. Now, I've got two VCF files (one for SNPs and the other for indels) that each has 11 samples. My question is how to proceed from here?

Should I separate the 11 files before annotation? or annotation first then split them 11 samples to individual files? Big question here is how to split the samples from vcf files? thanks

Tagged:

Best Answer

Answers

  • rcholicrcholic DenverMember

    Thanks Generaldine for the answer. A new question though: Since I have 11 samples in the VCF, if I do not split them, how do I filter the VCF file for individual samples same time? For example, my criteria is: at least 20 depth of coverage and 10 variant allele counts. Can I still use SelectVariants with parameter "-select "DP > 20.0" " ? how do I differentiate the total DP from at least 10 variant allels?

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Have a look at the doc on VariantFiltration of genotype-level fields here: http://www.broadinstitute.org/gatk/guide/article?id=51

    Let me know if you still have questions, and if possible please use an example so I can be sure I understand what you're trying to do.

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Actually I see you have a new question open; let's continue the discussion in that thread then.

  • BlueBlue Member

    To rcholic or anyone else who stumbles in here,

    To split a vcf file by sample:

    Use vcf-subset, with the -c option:

    -c, --columns File or comma-separated list of columns to keep in the vcf file. If file, one column per row
    So if your sample is named S1 and you want a VCF file for only that sample named S1.vcf:

    vcf-subset -c S1 bigfile.vcf > S1.vcf
    There are examples on the VCFtools documentation page, labelled "Stripping columns".

    https://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_variantutils_SelectVariants.php
    Select two samples out of a VCF with many samples:
    java -Xmx2g -jar GenomeAnalysisTK.jar \
    -R ref.fasta \
    -T SelectVariants \
    --variant input.vcf \
    -o output.vcf \
    -sn SAMPLE_A_PARC \
    -sn SAMPLE_B_ACTG

Sign In or Register to comment.