This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Difference in chromosome numbering

I am using bedtools getfasta to extract some sequences from the reference genome, hg38. I have the bed file ready but the chromosome numbering is like 1,2,3,...,25.

In my hg38.fa, however the chromosomes are numbered from 1,2,3, ...,X,Y,Mt. This is the reason I am not able to get fasta sequences from chromosomes 23,24 etc.

How to solve this?

r next-gen bedtools fasta

1 answer

Rename X,Y,MT to 23,24,25. Something like this should work:

sed -e 's/X/23/' -e 's/Y/24/' -e 's/MT/25/' hg38.fa > new.fa

Log in to answer this question.