Extract specific peptides from a FASTA file
1
0
Entering edit mode
6.6 years ago
ijvechetti ▴ 10

I hope someone could help me with a simple line command.

I have a protein FASTA file:

>Protein1
sequence 
>protein2
sequence

I want to extract the sequences that has specifics peptides (ERLE). I could do that using grep -A, however it prints the sequence and the header of the below protein. For example, let say the sequence is on protein 1, when I use grep it prints the sequence 1 whit the header of protein 2:

sequence
>Protein2

Is there a way to solve that?

Thank you in advance

Protein • 1.4k views
ADD COMMENT
0
Entering edit mode

Thank you so much. Worked really well

ADD REPLY
4
Entering edit mode
6.6 years ago
GenoMax 141k

Look at -B option for grep.

ADD COMMENT

Login before adding your answer.

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