Entering edit mode
4.3 years ago
bioinformatics.queries
▴
70
Hello Everyone
Can anyone you guide me editing of the fasta header file. My fasta header file shown as below
>NP_006556.1 transcriptional repressor CTCF isoform 1 [Homo sapiens]
And I want the output should have
>NP_006556.1 [Homo sapiens]
Thank you so much
use
sed
I used the sed command but it did not work for me.
I used the following command
That pattern doesn't match your example header above in the way you need it to. Use
[^ ]+
to capture the first part and\[.+\]
to capture the second.Could you please help with the command. I tried with the pattern you mentioned but it did not work
Please be more specific. Show us an example of an input line, the exact command you ran and the result it yields, as well as how this result differs from your expected result.
Please find the command used for running it.
and it shows the error as
try to google "sed unterminated substitute pattern" ....
I used the following command and it worked for me.
I need to use grep command to extract the pattern the organism name in brackets
If you are sure that there are only two brackets per line and the species name is always between them, you can use this: