How to convert scaffold name to chromosome number in vcf file
1
0
Entering edit mode
3.0 years ago
kk.mahsa ▴ 150

How to convert scaffold name to chromosome number in vcf file? for example

NC3251.1 convert to 1
NC3252.1 convert to 2

I would be very grateful if you could help me solve this problem.

VCF Scaffold Chromosome • 1.1k views
ADD COMMENT
3
Entering edit mode
3.0 years ago
awk '{printf("%s\t%d\n",$1,NR);}' /path/to/ref.fasta.fai > change.txt

and then

bcftools annotate --rename-chrs  change.txt in.vcf
ADD COMMENT
0
Entering edit mode

Thank you Pierre, it worked for me

ADD REPLY

Login before adding your answer.

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