gravatar for saadleeshehreen

2 hours ago by

Hi,
I have a multi-fastafile called HTH_7.fasta.

>W1DFQ1_KLEPN/141-185
 GRKKSLSSERIAELRQRVEAGEQKTKLAREFGISRETLYQYLRTD
>HIN_SALAE/139-183
GHPRAINRHEQEQISRLLEKGHPRQQLAIIFGIGVSTLYRYFPAS
>GIN_BPMU/138-182
GRPPKLTKAEWEQAGRLLAQGIPRKQVALIYDVALSTLYKKHPAK
>CIN_BPP1/138-182
GRRPKYQEETWQQMRRLLEKGIPRKQVAIIYDVAVSTLYKKFPAS
>UVP1_ECOLX/144-189
GRKPSLSEDDINEMKILLADPEMTVGAVAKRFNVSRMTIYRYTTKG

I want to paste the file name HTH_7 after each of the "> header"

>W1DFQ1_KLEPN/141-185_HTH_7
 GRKKSLSSERIAELRQRVEAGEQKTKLAREFGISRETLYQYLRTD
>HIN_SALAE/139-183_HTH_7
GHPRAINRHEQEQISRLLEKGHPRQQLAIIFGIGVSTLYRYFPAS

I tried as following but it is not served my purpose. because i=the file name also pasted after the fasta sequence. How to remove that?

awk '{print $0 "_"FILENAME}' HTH_7.fasta | sed "s/.fasta//" | head
>W1DFQ1_KLEPN/141-185_HTH_7
GRKKSLSSERIAELRQRVEAGEQKTKLAREFGISRETLYQYLRTD_HTH_7
>HIN_SALAE/139-183_HTH_7
GHPRAINRHEQEQISRLLEKGHPRQQLAIIFGIGVSTLYRYFPAS_HTH_7
>GIN_BPMU/138-182_HTH_7
 GRPPKLTKAEWEQAGRLLAQGIPRKQVALIYDVALSTLYKKHPAK_HTH_7
>CIN_BPP1/138-182_HTH_7
GRRPKYQEETWQQMRRLLEKGIPRKQVAIIYDVAVSTLYKKFPAS_HTH_7
>UVP1_ECOLX/144-189_HTH_7
GRKPSLSEDDINEMKILLADPEMTVGAVAKRFNVSRMTIYRYTTKG_HTH_7

Thanks in advance



Source link