The current GATK version is 3.6-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Powered by Vanilla. Made with Bootstrap.

how to split multiple samples in a single VCF file?

rcholicrcholic DenverMember Posts: 68

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


Best Answer


  • rcholicrcholic DenverMember Posts: 68

    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 Administrator, Dev Posts: 10,677 admin

    Have a look at the doc on VariantFiltration of genotype-level fields here:

    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 Administrator, Dev Posts: 10,677 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 Member Posts: 48

    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".
    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 \

Sign In or Register to comment.