Skip to content

Pro tips

Nikita Tikhomirov edited this page Nov 21, 2024 · 3 revisions

Scripts to make groups files

Alternatively, use bcftools query -l to get a list of samples in a VCF file.

All samples belong to one group

tabix -H file.vcf.gz | gawk -F"\t" '/#CHROM/{for (i=10;i<=NF;i++) print $i, "the_only_group"}' 

Each sample is on its own

tabix -H file.vcf.gz | gawk -F"\t" '/#CHROM/{for (i=10;i<=NF;i++) print $i, $i}' 

Make Dxy-based genetic network of all samples in the VCF file

Using spectre for network inference

Can take quite some time for several hundreds of samples!

piawka --nopi -v file.vcf.gz -g divide | piawka2nexus > dist.nex
netmake -o neighbornet dist.nex