A file path to be opened for reading or writing. The usual Perl
You may provide new() with a previously-opened filehandle. For
example, to read from STDIN:
Note that you must pass filehandles as references to globs.
If neither a filehandle nor a filename is specified, then the module will read from the @ARGV array or STDIN, using the familiar <> semantics.
Specify the format of the file. Supported formats include:
Currently only those formats which were implemented in Bio::SimpleAlign have been incorporated into Bio::AlignIO. Specifically, mase, stockholm and prodom have only been implemented for input. See the specific module (e.g. Bio::AlignIO::prodom) for notes on supported versions.
If no format is specified and a filename is given, then the module will attempt to deduce it from the filename suffix. If this is unsuccessful, fasta format is assumed.
The format name is case insensitive; FASTA, Fasta and fasta are all treated equivalently.
$fh = Bio::AlignIO->newFh(-fh => \*FILEHANDLE, -format=>$format); # read from STDIN or use @ARGV: $fh = Bio::AlignIO->newFh(-format => $format);
This constructor behaves like new, but returns a tied filehandle rather than a Bio::AlignIO object. You can read sequences from this object using the familiar <> operator, and write to it using print. The usual array and $_ semantics work. For example, you can read all sequence objects into an array like this:
@sequences = <$fh>;
Other operations, such as read(), sysread(), write(), close(), and printf() are not supported.
By default, all files (or filehandles) opened for writing alignments
will be flushed after each write_aln() making the file immediately
usable. If you do not need this facility and would like to marginally
improve the efficiency of writing multiple sequences to the same file
(or filehandle), pass the -flush option 0 or any other value that
evaluates as defined but false:
See below for more detailed summaries. The main methods are:
CW$alignment = CW$AlignIO->next_aln()Fetch an alignment from a formatted file.
CW$AlignIO->write_aln($aln)Write the specified alignment to a file..
TIEHANDLE(), READLINE(), PRINT()These provide the tie interface. See perltie for more details.
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
Jason Stajich, firstname.lastname@example.org
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
Title : new Usage : $stream = Bio::AlignIO->new(-file => $filename, -format => Format) Function: Returns a new seqstream Returns : A Bio::AlignIO::Handler initialised with the appropriate format Args : -file => $filename -format => format -fh => filehandle to attach to -displayname_flat => 1 [optional] to force the displayname to not show start/end information
Title : newFh Usage : $fh = Bio::AlignIO->newFh(-file=>$filename,-format=>Format) Function: does a new() followed by an fh() Example : $fh = Bio::AlignIO->newFh(-file=>$filename,-format=>Format) $sequence = <$fh>; # read a sequence object print $fh $sequence; # write a sequence object Returns : filehandle tied to the Bio::AlignIO::Fh class Args :
Title : fh Usage : $obj->fh Function: Example : $fh = $obj->fh; # make a tied filehandle $sequence = <$fh>; # read a sequence object print $fh $sequence; # write a sequence object Returns : filehandle tied to the Bio::AlignIO::Fh class Args :
Title : format Usage : $format = $stream->format() Function: Get the alignment format Returns : alignment format Args : none
Title : _load_format_module Usage : *INTERNAL AlignIO stuff* Function: Loads up (like use) a module at run time on demand Example : Returns : Args :
Title : next_aln Usage : $aln = stream->next_aln Function: reads the next $aln object from the stream Returns : a Bio::Align::AlignI compliant object Args :
Title : write_aln Usage : $stream->write_aln($aln) Function: writes the $aln object into the stream Returns : 1 for success and 0 for error Args : Bio::Seq object
Title : _guess_format Usage : $obj->_guess_format($filename) Function: Example : Returns : guessed format of filename (lower case) Args :
Title : force_displayname_flat Usage : $obj->force_displayname_flat($newval) Function: Example : Returns : value of force_displayname_flat (a scalar) Args : on set, new value (a scalar or undef, optional)
Title : alphabet Usage : $obj->alphabet($newval) Function: Get/Set alphabet for purpose of passing to Bio::LocatableSeq creation Example : $obj->alphabet(dna); Returns : value of alphabet (a scalar) Args : on set, new value (a scalar or undef, optional)
|perl v5.20.3||BIO::ALIGNIO (3)||2016-04-05|