How to delete spaces from fasta file IDs
1
0
Entering edit mode
2.6 years ago
Paula ▴ 60

Hi All!

I need to delete the blank spaces between words in the headers from my fasta file.

Example

Input:

> Proteobacteria;_1 # 52 # 312 # 1 # ID=1_1;partial=01;start

Output:

>Proteobacteria;_1#52#312#1# ID=1_1;partial=01;start

Thanks a lot!

fasta • 673 views
ADD COMMENT
2
Entering edit mode
2.6 years ago
Joe 21k

sed -i 's/\ //g' file.fasta

Your example output leaves a space in still. I've assumed that's a typo based on your request.

ADD COMMENT
0
Entering edit mode

You can use SEDA (https://www.sing-group.org/seda/). The "Rename header / Replace word" operation (https://www.sing-group.org/seda/manual/operations.html#replace-word) allows to do this.

ADD REPLY

Login before adding your answer.

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