[Bioperl-l] fasta format

Mark A. Jensen maj at fortinbras.us
Wed Dec 9 15:18:08 EST 2009


$ perl -MPerlIO::via::SeqIO -e 'open($f, "<:via(SeqIO)", shift); open($g, 
">:via(SeqIO::fasta)", shift); while (<$f>) { print $g $_; }' in.fas out.fas

----- Original Message ----- 
From: "Smithies, Russell" <Russell.Smithies at agresearch.co.nz>
To: "'Kevin Brown'" <Kevin.M.Brown at asu.edu>; <bioperl-l at bioperl.org>
Sent: Wednesday, December 09, 2009 2:44 PM
Subject: Re: [Bioperl-l] fasta format


> It's even easier as the script is already written for you :-)
>
> bp_seqconvert.pl --from fasta --to fasta < file.in.fa > file.out.fa
>
>
> --Russell
>
>
>> -----Original Message-----
>> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
>> bounces at lists.open-bio.org] On Behalf Of Kevin Brown
>> Sent: Thursday, 10 December 2009 4:26 a.m.
>> To: bioperl-l at bioperl.org
>> Subject: Re: [Bioperl-l] fasta format
>>
>> 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
>> >
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> =======================================================================
> Attention: The information contained in this message and/or attachments
> from AgResearch Limited is intended only for the persons or entities
> to which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipients is prohibited by AgResearch
> Limited. If you have received this message in error, please notify the
> sender immediately.
> =======================================================================
>
> _______________________________________________
> 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