[Bioperl-l] module for formating sequence output on the screen

Cook, Malcolm MEC at stowers-institute.org
Thu May 18 18:39:15 EDT 2006


Li,

Here's a one-liner that uses bioperl's Bio::SeqIO module to reformat
fasta on standard input to 50 char wide fasta on standard output.

perl -MBio::SeqIO -e 'select Bio::SeqIO->newFh(-format => "fasta",
-width => 50);  $in = Bio::SeqIO->newFh(-format => "fasta", -fh =>
\*STDIN); print while <$in>' 

You can call it like this:

perl -MBio::SeqIO -e 'select Bio::SeqIO->newFh(-format => "fasta",
-width => 50);  $in = Bio::SeqIO->newFh(-format => "fasta", -fh =>
\*STDIN); print while <$in>' inputfile.fasta > outputfile.fasta

Does this help?

--Malcolm Cook


>-----Original Message-----
>From: bioperl-l-bounces at lists.open-bio.org 
>[mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of chen li
>Sent: Tuesday, May 16, 2006 7:53 PM
>To: bioperl-l at bioperl.org
>Subject: [Bioperl-l] module for formating sequence output on the screen
>
>Hi all,
>
>Thank you very much for the help.
>
>I have some DNA sequences printed on the screen. But
>the default output is longer than I expect.  I need 50
>necleotides/line. I search CPAN but can not get the
>right module.  Which bioperl module can do this job?
>
>Li
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>_______________________________________________
>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