1

I have a multiple sequence file as

>abc|d017961
sequence1......

>cdf|rhtdm9
sequence2......

>ijm|smthr12
sequence3......

>abc|d011wejr
sequence4......

>stg|eethwe77
sequence5......

I want to edit the file and want the result file as

>abc_ABC__d017961
sequence1......

>cdf_CDF__rhtdm9
sequence2......

>ijm_IJM__smthr12
sequence3......

>abc_ABC__d011wejr
sequence4......

>stg_STG__eethwe77
sequence5......
1

1 Answer 1

4

With GNU sed:

sed 's/>\([^|]*\)|/>\1_\U\1__/'

The same with perl:

perl -pe's/>(.*?)\|/>$1_\U$1__/'

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.