How can I split the names and a. acid sequences of certain organisms into columns in the fasta file I have?
My fasta file:
>H_sapiens_ [Homo sapiens]
MANGTADVR
>P_troglodytes_[Pan troglodytes]
MANGTADV
>C_elegans_ [Caenorhabditis elegans]
MSSDSKDQ
I'm trying to get a table like this by pulling codes that are only c.elegance and human.
H_sapiens_ [Homo sapiens]. C_elegans_ [Caenorhabditis elegans]
M M
A S
N S
• 1,333 views
•
link
1 answer
Since you are not interested in main sequence, just grep line with the names:
grep "H_sapiens_" your.fasta > output1.txt
grep "C_elegans_" your.fasta > output2.txt
Then merge two files:
cat output1.txt output2.txt > output_final.txt
• 0 views
•
link
Log in to answer this question.
cross posted: https://stackoverflow.com/questions/71118224/