The current GATK version is 3.7-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!

Did you remember to?

1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?

Then follow instructions in Article#1894.

Formatting tip!

Surround blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block.
Powered by Vanilla. Made with Bootstrap.
Picard 2.9.0 is now available. Download and read release notes here.
GATK 3.7 is here! Be sure to read the Version Highlights and optionally the full Release Notes.

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 Cambridge, MAMember, Administrator, Broadie Posts: 11,421 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 Cambridge, MAMember, Administrator, Broadie Posts: 11,421 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.