How Do I Find The Number Of Individuals In A Vcf File?
1
0
Entering edit mode
11.1 years ago

Couldn't find the answer on google.

vcf • 5.5k views
ADD COMMENT
3
Entering edit mode
11.1 years ago
awk '{if ($1 == "#CHROM"){print NF-9; exit}}' input_vcf_file.vcf

Yes, it was trivial.

ADD COMMENT
4
Entering edit mode

exactly, it is just the number of columns, after substracting the first 9. Moreover, when you do any operation with vcftools, the number of individuals is shown in the log messages ("File contains 2737 entries and 1092 individuals.", "After filtering, kept 1092 out of 1092 Individuals")

ADD REPLY

Login before adding your answer.

Traffic: 2131 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6