Hi,
I need to extract heterozygous genotype from my vcf file. The genotype GT:0/1 and 1/2 should be extracted separately and is under the FORMAT field in vcf file. I am not posting the data from vcf file since there is been some formatting issue while pasting the values lately (not sure why???).
Also, I need to calculate the AB (allele balance) values for these heterozygous genotype (by sample). I have tried several vcf manipulator utilites but its not been very much helpful.
Can someone please assist me regarding the problem.
Thanks,
Hi @Pierre'
Thanks for the support. I will try your script tomorrow, also I want to get only the GT:0/1 or GT/1/2 separately. Something for calculating AB will be great.
Thanks,
Hi Pierre, I installed and ran the program but getting some error.
Command: curl -s "raw01_variants_S1-forTest.vcf" | gunzip -c | java -jar /home/everestial007/jvarkit/dist/bioalcidae.jar -F vcf -e 'while(iter.hasNext()) {var ctx=iter.next(); for(var i=0;i< ctx.getNSamples();++i) {var g=ctx.getGenotype(i); if(!g.isHet()) continue; out.println(ctx.getContig()+" "+ctx.getStart()+" "+g.getSampleName()+" "+g.getAlleles()); }}'
Error message: [main] ERROR jvarkit - Your input file has a malformed header: We never saw the required CHROM header line (starting with one #) for the input VCF file [main] ERROR jvarkit - Command failed
I think the header of the VCF file always starts with #. Since CHROM is in the first column its typically #CHROM.
Thanks,
why did you run 'gunzip -c ' if the input is not a gzipped source ?
why do you use curl ? please, try to understand the command line before running it.
Hi Pierre,
Thanks for the command but I a little not savvy with manipulating the commands. I will give a try. I had gzipped the file so used gunzip, but the posted command just had .vcf.
Will let you know !