[Bioperl-l] fasta format

Kevin Brown Kevin.M.Brown at asu.edu
Wed Dec 9 10:26:22 EST 2009

Even easier to accomplish in one step. Read in the fasta file and output
it right to another fasta file with SeqIO

my $in = Bio::SeqIO->new(-format=>'fasta',-file=>$file);
my $out = Bio::SeqIO->new(-format=>'fasta',-file=>'>file.fasta');
while (my $seq = $in->next){$out->write_seq($seq);}

Kevin Brown
Center for Innovations in Medicine
Biodesign Institute
Arizona State University  

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org 
> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of Amir Karger
> Sent: Wednesday, December 09, 2009 8:02 AM
> To: Jonas Schaer; bioperl-l at bioperl.org
> Subject: Re: [Bioperl-l] fasta format
> > Is there any way to use these fasta files with diffrent length of
> > lines with this fasta.pm module or will i have to change the format
> > of my fasta-files(big databases...) ?
> > 
> Jonas,
> It's not Bioperl, but for a quick fix you can use the 
> Scriptome. Use the change_fasta_to_tab script 
> (http://sysbio.harvard.edu/csb/resources/computational/scripto
> me/Windows/Tools/Change.html#change_a_fasta_file_into_tabular_
> format__change_fasta_to_tab_) to change your FASTA into a 
> tab-delimited file. Then use the next tool 
> (change_tab_to_fasta) to change your files back.
> To use a tool: change the input and output file names on the 
> website, then cut and paste the Perl script from the green 
> box into a CMD window. The script works one sequence at a 
> time, so it doesn't need a lot of memory. (As long as you 
> have enough disk space to store the tab-delimited copy).
> The recreated FASTAs will be 60 characters per line (although 
> you can hand-edit the line after you paste it to be whatever 
> number of characters you'd like).
> Let me know if you have a problem.
> -Amir Karger
> Life Sciences Research Computing, FAS IT
> Harvard University
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

More information about the Bioperl-l mailing list