Hi,

I am planning on doing eQTL analysis using the MatrixEQTL R ([MatrixEQTL link][1]) package and I need to extract genotype information and create a SnpMatrix file for that like the one given here [SNP.txt file link][2]. I have tried vcftools to create a similar looking file but to no avail, I have tried 

 - vcf-to-tab < genotypes.vcf > requiredFormat.txt
- [Sample output][3]
 
 - vcftools --vcf genotypes.vcf --extract-FORMAT-info GT --out requiredFormat.txt
- [Sample output][4]

Is there any other way to extract genotype information from the VCF file and convert it to that format?

Thanks
> Description of the SnpMatrix file - In VCF files, 0 represents the reference allele and integers greater than 0
  represent the alternate alleles (i.e., 2, 3, 4 would indicate the 2nd, 3rd
  or 4th allele in the ALT field for a particular variant). This function only 
  supports variants with a single alternate allele and therefore the alternate 
  values will always be 1. Genotypes are stored in the SnpMatrix 
  as 0, 1, 2 or 3 where 0 = missing, 1 = "0/0", 2 = "0/1" or "1/0" and 
  3 = "1/1". In SnpMatrix terminology, "A" is the reference allele 
  and "B" is the risk allele. Equivalent statements to those made with 0 and 1 
  allele values would be 0 = missing, 1 = "A/A", 2 = "A/B" or "B/A" and 3 = "B/B".

  [1]: http://www.bios.unc.edu/research/genomic_software/Matrix_eQTL/R.html "MatrixEQTL link"
  [2]: http://www.bios.unc.edu/research/genomic_software/Matrix_eQTL/Sample_Data/SNP.txt "SNP.tx"
  [3]: https://postimg.cc/image/riksnalf9 "out"
  [4]: https://postimg.org/image/n2u7bbdxl/ "out2"
using bioalcidae and the following script: http://lindenb.github.io/jvarkit/BioAlcidae.html


    var snp_id=0;
    var samples = header.getSampleNamesInOrder();
    out.print("id");
    for(var i=0;i< samples.size();++i)
    	{
    	out.print("\t"+samples.get(i));
    	}
    out.println();
    
    while(iter.hasNext()) {
     var ctx= iter.next();
     ++snp_id;
     out.print(new java.lang.Integer(snp_id));
     for(var i=0;i< samples.size();++i)
    	{
    	out.print("\t");
    	var g= ctx.getGenotype(samples.get(i));
    	if(g.isHomRef())
    		{
    		out.print("1");
    		}
    	else if(g.isHet())
    		{
    		out.print("2");
    		}
    	else if(g.isHomVar())
    		{
    		out.print("3");
    		}
    	else 
    		{
    		out.print("0");
    		}
    	}
      
     out.println();
     }