Dear all,

I have  a multi-sample (>100) VCF file and a list of SNPs with CHR and POS for which the sample names and their genotypes need to be extracted.

For example, i have a SNP chr1:23455. I would like to know how many and which samples have homozygous alternate allele,  heterozygous allele and  homozygous reference allele.

Is there any existing tool that provides the above summary?

Many thanks!!!
use bioalcidaejdk http://lindenb.github.io/jvarkit/BioAlcidaeJdk.html and the following script: 

```
// all the types of Genotypes see https://samtools.github.io/htsjdk/javadoc/htsjdk/htsjdk/variant/variantcontext/GenotypeType.html
final List<GenotypeType> all_types = Arrays.asList(GenotypeType.values());
//print the header
println("CHROM\tPOS\tREF\tALT\t"+all_types.stream().map(T->"count."+T.name()+"\tsample."+T.name()).collect(Collectors.joining("\t")));
//for each variant
stream().forEach(V->println(
	//print the contig
	V.getContig()+"\t"+
	// print the position
	V.getStart()+"\t"+
	// print the REF alleles
	V.getReference().getDisplayString()+"\t"+
	// print the ALT alleles
	V.getAlternateAlleles().stream().map(A->A.getDisplayString()).collect(Collectors.joining(","))+"\t"+
	// loop over each type
	all_types.stream().map(T->
		
		String.valueOf(
			// collect all genotypes
			V.getGenotypes().stream().
			//genotype must have type T
			filter(G->G.getType().equals(T)).
			count()) +
		"\t"+
		// collect all genotypes
		V.getGenotypes().stream().
			//genotype must have type T
			filter(G->G.getType().equals(T)).
			//convert to sample name
			map(G->G.getSampleName()).
			// join string
			collect(Collectors.joining(","))
		).
		collect(Collectors.joining("\t")))
	);
```

a one-liner:

```
$ java -jar dist/bioalcidaejdk.jar -e 'final List<GenotypeType> all_types = Arrays.asList(GenotypeType.values());println("CHROM\tPOS\tREF\tALT\t"+all_types.stream().map(T->"count."+T.name()+"\tsample."+T.name()).collect(Collectors.joining("\t")));stream().forEach(V->println( V.getContig()+"\t"+ V.getStart()+"\t"+ V.getReference().getDisplayString()+"\t"+ V.getAlternateAlleles().stream().map(A->A.getDisplayString()).collect(Collectors.joining(","))+"\t"+ all_types.stream().map(T-> String.valueOf( V.getGenotypes().stream(). filter(G->G.getType().equals(T)). count()) + "\t"+ V.getGenotypes().stream(). filter(G->G.getType().equals(T)). map(G->G.getSampleName()). collect(Collectors.joining(",")) ). collect(Collectors.joining("\t"))) );'  src/test/resources/rotavirus_rf.vcf.gz 


CHROM	POS	REF	ALT	count.NO_CALL	sample.NO_CALL	count.HOM_REF	sample.HOM_REF	count.HET	sample.HET	count.HOM_VAR	sample.HOM_VAR	count.UNAVAILABLEsample.UNAVAILABLE	count.MIXED	sample.MIXED
RF01	970	A	C	0		4	S1,S2,S3,S4	0		1	S5	0		0	
RF02	251	A	T	0		3	S1,S4,S5	2	S2,S3	0		0		0	
RF02	578	G	A	0		4	S1,S2,S3,S5	0		1	S4	0		0	
RF02	877	T	A	0		4	S2,S3,S4,S5	1	S1	0		0		0	
RF02	1726	T	G	0		3	S1,S4,S5	2	S2,S3	0		0		0	
RF02	1962	TACA	TA	0		4	S2,S3,S4,S5	1	S1	0		0		0	
RF03	1221	C	G	0		3	S1,S4,S5	0		2	S2,S3	0		0	
RF03	1242	C	A	0		4	S1,S2,S3,S5	0		1	S4	0		0	
RF03	1688	T	G	0		4	S1,S2,S3,S4	0		1	S5	0		0	
```