how to split multiple samples in a single VCF file?

rcholicrcholic DenverPosts: 68Member

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 DenverPosts: 68Member

    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 Posts: 8,171Administrator, GATK Dev 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 Van der Auwera, PhD

  • Geraldine_VdAuweraGeraldine_VdAuwera Posts: 8,171Administrator, GATK Dev admin

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

    Geraldine Van der Auwera, PhD

  • BlueBlue Posts: 45Member

    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.