Hii,

I have to call genotype for multiple samples using joint genotyping methedology of GATK best practices, So I made a shell script which take  list of samples in a text file as an input, and script through all commands on each sample one by one up to GVCF step. After generating GVCF for each sample, I want to call joint genotype using following command:

    java -jar GenomeAnalysisTK.jar -T GenotypeGVCFs -R hg19.fa -V sample1.g.vcf -V sample2.g.vcf [.. -V sampleN.g.vcf] -o rawVariants.vcf

So I pass "-V sample1.g.vcf -V sample2.g.vcf -V sampleN.g.vcf" as a variable like below:

    V="-V sample1.g.vcf -V sample2.g.vcf .. -V sampleN.g.vcf"

    java -jar GenomeAnalysisTK.jar -T GenotypeGVCFs -R hg19.fa `echo $V` -o rawVariants.vcf

OR

    java -jar GenomeAnalysisTK.jar -T GenotypeGVCFs -R hg19.fa $V -o rawVariants.vcf

I got "**ERROR MESSAGE:** Invalid argument value '-V sample1.g.vcf -V sample2.g.vcf .. -V sampleN.g.vcf'.
As the command is considering $V variable as a single argument.

Please provide me some way to pass '-V sample1.g.vcf -V sample2.g.vcf .. -V sampleN.g.vcf' to the GATK command in shell script.

Thanks in advance!  



Use a list with the '.list' suffix


    echo "sample1.g.vcf" > my.list
    echo "sample2.g.vcf" >> my.list
    echo "sample3.g.vcf" >> my.list
    echo "sampleN.g.vcf" >> my.list

and then

    java -jar GenomeAnalysisTK.jar -T GenotypeGVCFs -R hg19.fa -V my.list -o rawVariants.vcf