Entering edit mode
10.6 years ago
xinhui.wang
▴
570
I am running vcftools to get ped file from a list of vcf files. I would like to know the reference allele for these snps and I already download the fa file from http://www.ensembl.org/info/data/ftp/index.html
However, is there some tool with which I could extract the allele information for each SNP?
Thanks and with best regards,
Xinhui
Dear Pierre, Thanks. However, i had a huge list of SNP''s in my vcf file. do you mind to show me one command hoe to index the reference and search each positon and samtools faidx is a little diffcult for me. Thanks and with best regards, Xinhui
something like this:
samtools faix ref.fa grep -v "#" in.vcf | wk '{printf("%s:%s-%s\n",$1,$2,$2);}' | while read P; do samtools faix ref.fa ${P} ; doneDear Pierre,
Thanks and it worked very well. However, the output is on screen and I would like to output results to a txt file. Could you help me a little more with that? Sorry I am not familiar with linux.
With best regards,
Xinhui