Issue with Bcftools reheader
1
1
Entering edit mode
5.8 years ago

Hi,

I have a sample with a strange name. It has been giving me some issues with some software that I use. I am trying to change the sample name in the VCF file using bcftools reheader

The command I am using is

bcftools reheader -s "99686 C99686\n" input.vcf -o output.reheader.vcf

but when I try looking at the samples name in the file using bcftools query, the name is unchanged.

bcftools query -l /gpfs_backup/meurs_data/TestBCF/output.reheader.vcf

I assuming I am doing something wrong with the reheader command but I am not sure what I am doing wrong.

genome alignment next-gen sequencing • 5.6k views
ADD COMMENT
6
Entering edit mode
5.8 years ago

the option -s of bcftools reheader is a FILE not a string. https://samtools.github.io/bcftools/bcftools.html

 -s, --samples FILE
    new sample names, one name per line, in the same order as they appear in the VCF file. Alternatively, only samples which need to be renamed can be listed as "old_name new_name\n" pairs separated by whitespaces, each on a separate line. If a sample name contains spaces, the spaces can be escaped using the backslash character, for example "Not\ a\ good\ sample\ name".
ADD COMMENT
0
Entering edit mode

Oh Pierre, I knew you would come to help! Thanks so much! That worked like a charm. Sorry that I didn't see that I needed to add a file >.<

ADD REPLY

Login before adding your answer.

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