Re-naming some sequences header within the fasta file
0
0
Entering edit mode
9.2 years ago
seta ★ 1.9k

Dear all,

I got a large fasta file with two types of header, the header name for some sequences is contig and for some of them is cx_gx_ix. I want to rename all headers named contig to another name say c_g_i. Please help me how I should do it?

Assembly sequence • 2.2k views
ADD COMMENT
1
Entering edit mode
ADD REPLY
0
Entering edit mode

Thanks friend

ADD REPLY
0
Entering edit mode
sed 's/>.*/>c_g_i/g' filename.fasta
ADD REPLY
0
Entering edit mode

Try this

sed -i 's/^>contig/>c_g_i/g' file.fasta
ADD REPLY

Login before adding your answer.

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