splitting fasta sequences into variables
1
0
Entering edit mode
9.2 years ago

Hi everyone

I am really new to perl and I wish if some one could ever help

I have a multi fasta file, I need to split each fasta sequence into different variable to I can do some types of analysis, any one could help me with any idea (please, not BioPerl)

I am thinking of Creating a regex but it became more complicated each minute

Thanks everyone

perl multi-fasta • 2.3k views
ADD COMMENT
0
Entering edit mode

"into different variable " what do you mean ? a variable from any language ?

ADD REPLY
0
Entering edit mode

I had to read it twice myself, but it says "Perl" the second line

ADD REPLY
0
Entering edit mode

ah yes, I was mislead by "no BioPerl"

ADD REPLY
2
Entering edit mode
9.2 years ago
thackl ★ 3.0k

Here you can find a simple Fasta Parser in Perl.
https://github.com/BioInf-Wuerzburg-teaching/teaching-Fasta-Parser/blob/master/Fasta-Parser.pl

This is a neat one-liner, in case you want to split a FASTA file in individual sequences

csplit -z FILE.fa '/>/' '{*}'
ADD COMMENT
0
Entering edit mode

With Mac OS X the equivalent is

split -p ">" file.fa

Output is xaa, xab, xac, etc. -a suffixLength is useful for bigger files

ADD REPLY

Login before adding your answer.

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