How to extract sample id using bcftools or vcftools
2
7
Entering edit mode
9.0 years ago
xinhui.wang ▴ 550

Dear all,

I am working on vcf data with bcftools. It is a big data set and I would like to see the list of samples are including in this vcf file, what's the easy way with bcftools or vcftools?

Thanks and with best regards

Xinhui

SNP vcf bcftools vcftools • 52k views
ADD COMMENT
0
Entering edit mode

What do you mean by the list of samples? If you have a multisample vcf file, you can see the list of samples by looking the names of the columns of vcf file. But maybe I'm misunderstanding your question...

ADD REPLY
1
Entering edit mode

Thanks and I would like to get sample ID's in this vcf file. I know we could found at header of vcf file. Is there a parameter in vcftools or bcftools to extract sample ID's?

ADD REPLY
31
Entering edit mode
9.0 years ago
xinhui.wang ▴ 550

I got it:

bcftools query -l input.vcf

From manuals - query:

-l, --list-samples: list sample names and exit

ADD COMMENT
5
Entering edit mode
6.1 years ago
Ömer An ▴ 260

Alternatively you can use vcftools:

vcf-query -l input.vcf
ADD COMMENT
0
Entering edit mode

vcf-query -l input.vcf, this is not working, could you please give the correct command?

ADD REPLY
0
Entering edit mode

You can refer here.

ADD REPLY

Login before adding your answer.

Traffic: 2758 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