Bio::AlignIO

Bio::AlignIO is a handler for AlignIO formats.
Download

Bio::AlignIO Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Peter Schattner
  • Publisher web site:
  • http://search.cpan.org/~birney/bioperl-1.4/Bio/Tools/BPlite/HSP.pm

Bio::AlignIO Tags


Bio::AlignIO Description

Bio::AlignIO is a handler for AlignIO formats. Bio::AlignIO is a handler for AlignIO formats.SYNOPSIS use Bio::AlignIO; $inputfilename = "testaln.fasta"; $in = Bio::AlignIO->new(-file => $inputfilename , '-format' => 'fasta'); $out = Bio::AlignIO->new(-file => ">out.aln.pfam" , '-format' => 'pfam'); # note: we quote -format to keep older perl's from complaining. while ( my $aln = $in->next_aln() ) { $out->write_aln($aln); } #or use Bio::AlignIO; $inputfilename = "testaln.fasta"; $in = Bio::AlignIO->newFh(-file => $inputfilename , '-format' => 'fasta'); $out = Bio::AlignIO->newFh('-format' => 'pfam'); # World's shortest Fastapfam format converter: print $out $_ while ;Bio::AlignIO is a handler module for the formats in the AlignIO set (eg, Bio::AlignIO::fasta). It is the officially sanctioned way of getting at the alignment objects, which most people should use. The resulting alignment is a Bio::Align::AlignI compliant object. See Bio::Align::AlignI for more information.The idea is that you request a stream object for a particular format. All the stream objects have a notion of an internal file that is read from or written to. A particular AlignIO object instance is configured for either input or output. A specific example of a stream object is the Bio::AlignIO::fasta object.Each stream object has functions $stream->next_aln();and $stream->write_aln($aln);also $stream->type() # returns 'INPUT' or 'OUTPUT'As an added bonus, you can recover a filehandle that is tied to the AlignIO object, allowing you to use the standard and print operations to read and write sequence objects: use Bio::AlignIO; # read from standard input $stream = Bio::AlignIO->newFh(-format => 'Fasta'); while ( $aln = ) { # do something with $aln }and print $stream $aln; # when stream is in output modeThis makes the simplest ever reformatter #!/usr/local/bin/perl $format1 = shift; $format2 = shift || die "Usage: reformat format1 format2 < input > output"; use Bio::AlignIO; $in = Bio::AlignIO->newFh(-format => $format1 ); $out = Bio::AlignIO->newFh(-format => $format2 ); # note: you might want to quote -format to keep # older perl's from complaining. print $out $_ while < $in >;AlignIO.pm is patterned on the module SeqIO.pm and shares most the SeqIO.pm features. One significant difference currently is that AlignIO.pm usually handles IO for only a single alignment at a time (SeqIO.pm handles IO for multiple sequences in a single stream.) The principal reason for this is that whereas simultaneously handling multiple sequences is a common requirement, simultaneous handling of multiple alignments is not. The only current exception is format "bl2seq" which parses results of the Blast bl2seq program and which may produce several alignment pairs. This set of alignment pairs can be read using multiple calls to next_aln.Capability for IO for more than one multiple alignment - other than for bl2seq format -(which may be of use for certain applications such as IO for Pfam libraries) may be included in the future. For this reason we keep the name "next_aln()" for the alignment input routine, even though in most cases only one alignment is read (or written) at a time and the name "read_aln()" might be more appropriate. Requirements: · Perl


Bio::AlignIO Related Software