Bio::SeqIO::chaos(3) chaos sequence input/output stream


#In general you will not want to use this module directly;
#use the chaosxml format via SeqIO
$outstream = Bio::SeqIO->new(-file => $filename,
-format => 'chaosxml');
while ( my $seq = $instream->next_seq() ) {


This is the guts of Bio::SeqIO::chaosxml - please refer to the documentation for this module


ChaosXML is an XML mapping of the chado relational database; for more information, see

chaos can be represented in various syntaxes - XML, S-Expressions or indented text. You should see the relevant SeqIO file. You will probably want to use Bio::SeqIO::chaosxml, which is a wrapper to this module.


non-standard bioperl stuff you don't necessarily need to know follows

This module (in write mode) is an event producer - it generates XML events via the Data::Stag module. If you only care about the final end-product xml, use Bio::SeqIO::chaosxml

You can treat the resulting chaos-xml stream as stag XML objects;

    $outstream = Bio::SeqIO->new(-file => $filename, -format => 'chaos');
    while ( my $seq = $instream->next_seq() ) {
    my $chaos = $outstream->handler->stag;
    # stag provides get/set methods for xml elements
    # (these are chaos objects, not bioperl objects)
    my @features = $chaos->get_feature;
    my @feature_relationships = $chaos->get_feature_relationships;
    # stag objects can be queried with functional-programming
    # style queries
    my @features_in_range =
                    sub {
                         my $featureloc = shift->get_featureloc;
                         $featureloc->strand == 1 &&
                         $featureloc->nbeg > 10000 &&
                         $featureloc->nend < 20000;
    foreach my $feature (@features_in_range) {
      my $featureloc = $feature->get_featureloc;
      printf "%s [%d->%d on %s]\n",



Downloadable from CPAN; see also


Mailing Lists

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.

  [email protected]                  - General discussion  - About the mailing lists


Please direct usage questions or support issues to the mailing list:

[email protected]

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.

Reporting Bugs

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:

AUTHOR - Chris Mungall

Email [email protected]


The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _


 Title   : context_namespace
 Usage   : $obj->context_namespace($newval)
 Example :
 Returns : value of context_namespace (a scalar)
 Args    : on set, new value (a scalar or undef, optional)

IDs will be preceded with the context namespace


 Title   : next_seq
 Usage   : $seq = $stream->next_seq()
 Function: returns the next sequence in the stream
 Returns : Bio::Seq object
 Args    :


 Title   : write_seq
 Usage   : $stream->write_seq($seq)
 Function: writes the $seq object (must be seq) to the stream
 Returns : 1 for success and 0 for error
 Args    : Bio::Seq