Question: How to extract sample id using bcftools or vcftools
3
gravatar for xinhui.wang
5.1 years ago by
xinhui.wang220
Netherlands
xinhui.wang220 wrote:

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 vcftools bcftools vcf • 18k views
ADD COMMENTlink modified 18 months ago by zx87549.2k • written 5.1 years ago by xinhui.wang220

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 REPLYlink written 5.1 years ago by iraun3.7k

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 REPLYlink written 5.1 years ago by xinhui.wang220
13
gravatar for xinhui.wang
5.1 years ago by
xinhui.wang220
Netherlands
xinhui.wang220 wrote:

I got it:

bcftools query -l input.vcf

From manuals - query:

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

ADD COMMENTlink modified 18 months ago by zx87549.2k • written 5.1 years ago by xinhui.wang220
3
gravatar for Ömer An
2.2 years ago by
Ömer An200
Singapore
Ömer An200 wrote:

Alternatively you can use vcftools:

vcf-query -l input.vcf
ADD COMMENTlink modified 18 months ago by zx87549.2k • written 2.2 years ago by Ömer An200
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1810 users visited in the last hour