regex - how to extract a part of header in Fasta file by using Linux command -
i have fasta file unique header,i extract part of header using regular expression in unix.
for example fasta file start header:
>jgi|penbr2|47586|fgenesh1_pm.1_#_25
and extract last part of header like:
>fgenesh1_pm.1_#_25
actually use regular expression in vim editor did not work:
:%s/^([^|]+\|){3}//g
or
:%s/^([a-z][0-9]+\|){3}//g
i appropriate if give me suggestion.
you can use sed
:
sed -e 's/>.*|/>/' fasta-file
i.e. between >
, |
replaced >
.
Comments
Post a Comment