bcftools reheader -h
2
1
Entering edit mode
5.8 years ago

Hi sorry for the very basic question! I would like to change the tags of the INFO fields of my vcf. I saw the bcftools -reader option but I cannot understand the format of the newheader.vcf that I need. Can anyone help me? I will appreciate help in order to a)create the new file needed for the script b)write the script (is it correct

bcftools reheader -h newheader.vcf filetochange.vcf

?

here an example of part of a header that I want to modify (i would like to change the ID=xxx)

##INFO=<ID=dbNSFP_ExAC_NFE_AF,Number=A,Type=Float,Description="Field 'ExAC_NFE_AF' from dbNSFP">
##INFO=<ID=dbNSFP_ExAC_SAS_AF,Number=A,Type=Float,Description="Field 'ExAC_SAS_AF' from dbNSFP">
##INFO=<ID=dbNSFP_GERP___RS,Number=A,Type=Float,Description="Field 'GERP++_RS' from dbNSFP">
##INFO=<ID=dbNSFP_GERP___NR,Number=A,Type=Float,Description="Field 'GERP++_NR' from dbNSFP">
##INFO=<ID=dbNSFP_ExAC_Adj_AC,Number=A,Type=Integer,Description="Field 'ExAC_Adj_AC' from dbNSFP">
##INFO=<ID=dbNSFP_ExAC_Adj_AF,Number=A,Type=Float,Description="Field 'ExAC_Adj_AF' from dbNSFP">
##INFO=<ID=dbNSFP_ExAC_SAS_AC,Number=A,Type=Integer,Description="Field 'ExAC_SAS_AC' from dbNSFP">
##INFO=<ID=dbNSFP_1000Gp3_AMR_AF,Number=A,Type=Float,Description="Field '1000Gp3_AMR_AF' from dbNSFP">
##INFO=<ID=dbNSFP_1000Gp3_AMR_AC,Number=A,Type=Integer,Description="Field '1000Gp3_AMR_AC' from dbNSFP">
##INFO=<ID=dbNSFP_MetaSVM_pred,Number=A,Type=Character,Description="Field 'MetaSVM_pred' from dbNSFP">
##INFO=<ID=dbNSFP_1000Gp3_EAS_AC,Number=A,Type=Integer,Description="Field '1000Gp3_EAS_AC' from dbNSFP">

thank you!

bcftools header format • 17k views
ADD COMMENT
0
Entering edit mode

Hello!

I have come across this thread and am wondering if I open my VCF file as a text file, can I edit the header manually?

I need to remove the

##contig=<ID=0,length=2147483645>

and change :

##contig=<ID=24,length=28817459>
##contig=<ID=25,length=155234708>
##contig=<ID=26,length=16391>

to

##contig=<ID=X,length=28817459>
##contig=<ID=Y,length=155234708>
##contig=<ID=MT,length=16391>

Can I do this in the text editor window and then resave file as a new .vcf? Instead of using bcftools?

thank you!!

ADD REPLY
0
Entering edit mode

try bcftools reheader -f option .fai file option to change contig names and lengths

$ bcftools reheader -f XXX.fasta.fai old.vcf -o new.vcf
ADD REPLY
3
Entering edit mode
5.8 years ago

bcftools reheader is for replacing the complete header of your vcf file. If this ist what you want to do, create a text file with the new header as the content, e.g. header.hr:

##fileformat=VCFv4.1
##INFO=<ID=CSQ,Number=.,Type=String,Description="some text">
##INFO=<ID=NEW,Number=.,Type=String,Description="some text">
#CHROM  POS ID  REF ALT QUAL    FILTER  INFO

As you can see you also need to define the columns!

Than you can replace the old header with the new one with:

$ bcftools reheader -h header.hr input.vcf > output.vcf
ADD COMMENT
0
Entering edit mode
5.8 years ago

bcftools annotate https://samtools.github.io/bcftools/bcftools.html

-c, --columns list

The imported VCF annotations can be renamed as "DST_TAG:=SRC_TAG" or "FMT/DST_TAG:=FMT/SRC_TAG".

ADD COMMENT

Login before adding your answer.

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