Difference in chromosome numbering
1
1
Entering edit mode
6.0 years ago
Gene_MMP8 ▴ 240

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.3k views
ADD COMMENT
3
Entering edit mode
6.0 years ago
GenoMax 142k

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
ADD COMMENT

Login before adding your answer.

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