This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Sortware or PERL code to find and delete orthologus groups in an OrthoFinder output file.

Having the OrthoFinder output file, I want to delete all of the orthologous groups except those who share the protein code 0014| or 0023|. A sample of the output file is next shown:

OG0003945: 0007|194963.15.peg.4284 0014|379.23.peg.4854 0014|379.23.peg.295
OG0003946: 0023|379.49.peg.6173 0014|379.23.peg.2147 0014|379.23.peg.4156
OG0003947: 0014|379.23.peg.3574 0014|379.23.peg.3573 0023|379.49.peg.3001
OG0003948: 0014|379.23.peg.113 0023|379.49.peg.338 0014|379.23.peg.3632
OG0003949: 0014|379.23.peg.3636 0014|379.23.peg.215 0023|379.49.peg.5154

I want to keep the OG's having 0014| AND 0023|, even if repeated or despite the order they have in the line (every OG is a line); and delete everything else not fitting this requirements (e.g.: 0014| + 0023| + 0007|).

Any guidance will be pleasantly received. Thank you, guys.

perl orthofinder

Hello martindaniel_150988!

We believe that this post does not fit the main topic of this site.

This is a simple text processing problem. An easy grep (such as egrep "0014\||0023\|" input_file > output_file ) will do the job.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

I plenty understand.

I appreciate your guidance, it meant a lot.

Thank you!

0 answers

No answers yet.

Log in to answer this question.