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

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 • 953 views
ADD COMMENT
3
Entering edit mode
2.6 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: 1458 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