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:
If no format is specified and a filename is given, then the module will attempt to deduce it from the filename. If this is unsuccessful, PDB format is assumed.
The format name is case insensitive. PDB, Pdb and pdb are all supported.
$fh = Bio::Structure::IO->newFh(-fh => \*FILEHANDLE, -format=>$format); $fh = Bio::Structure::IO->newFh(-format => $format); # etc.
This constructor behaves like new(), but returns a tied filehandle rather than a Bio::Structure::IO object. You can read structures 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 structure objects into an array like this:
@structures = <$fh>;
Other operations, such as read(), sysread(), write(), close(), and printf() are not supported.
See below for more detailed summaries. The main methods are:
CW$structure = CW$structIO->next_structure()Fetch the next structure from the stream.
CW$structIO->write_structure($struc [,$another_struc,...])Write the specified structure(s) to the stream.
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:
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
Title : newFh Usage : $fh = Bio::Structure::IO->newFh(-file=>$filename,-format=>Format) Function: does a new() followed by an fh() Example : $fh = Bio::Structure::IO->newFh(-file=>$filename,-format=>Format) $structure = <$fh>; # read a structure object print $fh $structure; # write a structure object Returns : filehandle tied to the Bio::Structure::IO::Fh class Args :
Title : fh Usage : $obj->fh Function: Example : $fh = $obj->fh; # make a tied filehandle $structure = <$fh>; # read a structure object print $fh $structure; # write a structure object Returns : filehandle tied to the Bio::Structure::IO::Fh class Args :
Title : format Usage : $format = $obj->format() Function: Get the structure format Returns : structure format Args : none
Title : next_structure Usage : $structure = stream->next_structure Function: Reads the next structure object from the stream and returns a Bio::Structure::Entry object. Certain driver modules may encounter entries in the stream that are either misformatted or that use syntax not yet understood by the driver. If such an incident is recoverable, e.g., by dismissing a feature of a feature table or some other non-mandatory part of an entry, the driver will issue a warning. In the case of a non-recoverable situation an exception will be thrown. Do not assume that you can resume parsing the same stream after catching the exception. Note that you can always turn recoverable errors into exceptions by calling $stream->verbose(2) (see Bio::RootI POD page). Returns : a Bio::Structure::Entry object Args : none
Title : write_structure Usage : $stream->write_structure($structure) Function: writes the $structure object into the stream Returns : 1 for success and 0 for error Args : Bio::Structure object
Title : _load_format_module Usage : *INTERNAL Structure::IO stuff* Function: Loads up (like use) a module at run time on demand Example : Returns : Args :
Title : _concatenate_lines Usage : $s = _concatenate_lines($line, $continuation_line) Function: Private. Concatenates two strings assuming that the second stems from a continuation line of the first. Adds a space between both unless the first ends with a dash. Takes care of either arg being empty. Example : Returns : A string. Args :
Title : _filehandle Usage : $obj->_filehandle($newval) Function: This method is deprecated. Call _fh() instead. Example : Returns : value of _filehandle Args : newvalue (optional)
Title : _guess_format Usage : $obj->_guess_format($filename) Function: Example : Returns : guessed format of filename (lower case) Args :
|perl v5.20.3||BIO::STRUCTURE::IO (3)||2016-04-05|