How can I split the names and a. acid sequences of certain organisms into columns in the fasta file I have?
1
0
Entering edit mode
2.2 years ago
logbio ▴ 30

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
Programming R table • 693 views
ADD COMMENT
0
Entering edit mode
ADD REPLY
1
Entering edit mode
2.2 years ago
kashiff007 ★ 1.9k

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
ADD COMMENT

Login before adding your answer.

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