I have an excel file that I created from VCF file for common SNPs across 6 samples. This excel have the chromosomes and the position of the SNPs only (see example table1)
Now I would like to obtain the other information (eg. allels, Genotype, depth, etc) from the VCF files of the 6 samples (i.e. the one that contains these positions).
I tried using AWK command like here for position 23432 on chr. 1 for the 6 file :
awk -F " " '$1=="1" && $2=="23432"' file1.vcf
awk -F " " '$1=="1" && $2=="23432"' file2.vcf
awk -F " " '$1=="1" && $2=="23432"' file3.vcf
awk -F " " '$1=="1" && $2=="23432"' file4.vcf
awk -F " " '$1=="1" && $2=="23432"' file5.vcf
awk -F " " '$1=="1" && $2=="23432"' file6.vcf
he issue is that these SNPs I have are thousands positions, so I need an automated way to do this
Could you advise on that ?
Thanks
-F '\t'
. And you never want-F " "
, unless you truly want to break on spaces and only spaces. By default awk will split on any whitespace character (including tabs and spaces) so you don't need this. $\endgroup$