How to modify Chromosome names in genome fasta file
1
0
Entering edit mode
3 months ago
Elisa • 0

Hi everyone,

I'd like to know how to modify chromosome names in my genome fasta file.

Specifically, I'd like to substitute:

chr1_1-hap-1
chr2_1-hap-1
...
chrX_1-hap-1
chrY_1-hap-1

with:

chr1
chr2 ... chrX, chrY 

Can someone suggest me how to do that?

Thanks in advance

fasta • 302 views
ADD COMMENT
4
Entering edit mode
3 months ago
cut -d '_' -f 1 < in.fa
ADD COMMENT
1
Entering edit mode

Just dissecting this nice one-liner for the sake of learning. Thank you Pierre.

cut ... < in.fa : print the selected parts of lines from in.fa to standard output (also prints the lines with no delimiters)
-d '_': set the '_' char as field delimiter    
-f 1: select the first field
ADD REPLY

Login before adding your answer.

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