Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter Class Reference
Inheritance diagram for Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter:

List of all members.


Class Summary

Synopsis

  use Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter;
  
  my $string_handle = IO::String-\>new();
  my $w = Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter-\>new(
    -SOURCE =\> 'Ensembl', -SOURCE_VERSION =\> 63, -HANDLE =\> $string_handle
  );
  
  my $pt = $dba-\>get_ProteinTreeAdaptor()-\>fetch_node_by_node_id(2);
  
  $w-\>write_trees($pt);
  $w-\>finish(); #YOU MUST CALL THIS TO WRITE THE FINAL TAG
  
  my $xml_scalar_ref = $string_handle-\>string_ref();
  
  #Or to write to a file via IO::File
  my $file_handle = IO::File-\>new('output.xml', 'w');
  $w = Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter-\>new(
    -SOURCE =\> 'Ensembl', -SOURCE_VERSION =\> 63, -HANDLE =\> $file_handle
  );
  $w-\>write_trees($pt);
  $w-\>finish(); #YOU MUST CALL THIS TO WRITE THE FINAL TAG
  $file_handle-\>close();
  
  #Or letting this deal with it
  $w = Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter-\>new(
    -SOURCE =\> 'Ensembl', -SOURCE_VERSION =\> 63, -FILE =\> 'loc.xml'
  );
  $w-\>write_trees($pt);
  $w-\>finish(); #YOU MUST CALL THIS TO WRITE THE FINAL TAG
  $w-\>handle()-\>close();

Description

Used as a way of emitting Compara GeneTrees in a format which conforms
to OrthoXML|http://www.orthoxml.org/. The code is built to work with
instances of Bio::EnsEMBL::Compara::GeneTreeNode.
The same document is persistent between write_trees() calls so to create
a new XML document create a new instance of this object.
 

Definition at line 53 of file OrthoXMLWriter.pm.

Available Methods

protected _build_writer ()
protected _genetreenode_body ()
protected _get_members_list ()
protected _is_reliable_duplication ()
protected _process ()
protected _write_closing ()
protected _write_opening ()
protected _write_tree ()
protected _writer ()
public String file ()
public Nothing finish ()
public IO::Handle handle ()
public namespaces ()
public Instance new ()
public Boolean no_release_trees ()
public Boolean possible_orthologs ()
public String source ()
public String source_version ()
public void write_data ()
public void write_trees ()
public xml_schema_namespace ()

Method Documentation

protected Bio::EnsEMBL::Compara::Graph::BaseXMLWriter::_build_writer ( ) [inherited]
Builds the XML::Writer instance taking into account the handle to use and the
namespaces to register. Override to provide a custom writer instance
 
Code:
click to view
protected Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::_genetreenode_body ( )

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::_get_members_list ( )

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::_is_reliable_duplication ( )

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::_process ( )

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::_write_closing ( )

Undocumented method

Code:
click to view

Reimplemented from Bio::EnsEMBL::Compara::Graph::BaseXMLWriter.

protected Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::_write_opening ( )

Undocumented method

Code:
click to view

Reimplemented from Bio::EnsEMBL::Compara::Graph::BaseXMLWriter.

protected Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::_write_tree ( )

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::Compara::Graph::BaseXMLWriter::_writer ( ) [inherited]
Used to get the writer instance to use
 
Code:
click to view
public String Bio::EnsEMBL::Compara::Graph::BaseXMLWriter::file ( ) [inherited]
  Arg[0] : Set the file location
  Description : Sets the file location to write to. Will undefine handle
  Returntype : String
  Exceptions : None
  Status     : Stable
 
Code:
click to view
public Nothing Bio::EnsEMBL::Compara::Graph::BaseXMLWriter::finish ( ) [inherited]
  Description : An important method which will write the final element. This
  allows you to stream any number of trees into one XML file and then call
  finish once you are done with it. B<Always call this method when you are
  done otherwise your XML will not be valid>.
  Returntype : Nothing
  Exceptions : Thrown if you are not finishing the file off with the correct
  end element
  Status     : Stable
 
Code:
click to view
public IO::Handle Bio::EnsEMBL::Compara::Graph::BaseXMLWriter::handle ( ) [inherited]
  Arg[0] : The handle to set
  Description : Mutator for the handle backing this writer. If invoked without
  giving it an instance of a handler it will use the FILE attribute to open
  an instance of IO::File
  Returntype : IO::Handle
  Exceptions : Thrown if we cannot open a file handle
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::namespaces ( )
Provides the namespaces used in this writer (the OrthoXML namespace)
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::Compara::Graph::BaseXMLWriter.

public Instance Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::new ( )
  Arg[SOURCE]           : String; the source of the dumped data.
                          Defaults to Unknown.
  Arg[SOURCE_VERSION]   : String; the version source of the dumped data.
                          Defaults to Unknown.
  Arg[HANDLE]           : IO::Handle; pass in an instance of IO::File or
                          an instance of IO::String so long as it behaves
                          the same as IO::Handle. Can be left blank in 
                          favour of the -FILE parameter
  Arg[FILE]             : Scalar; file to write to              
  Arg[NO_RELEASE_TREES] : Boolean; if set to true this will force the writer
                          to avoid calling release_tree() on every tree
                          given. Defaults to false
  Arg[POSSIBLE_ORTHOLOGS] : Boolean: if set to true, duplication nodes with a
                            score < 0.25 are considered as speciations
  Description : Creates a new tree writer object. 
  Returntype  : Instance of the writer
  Exceptions  : None
  Example     : my $w = Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter->new(
                  -SOURCE => 'Ensembl',  -HANDLE => $handle
                );
  Status      : Stable
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::Compara::Graph::BaseXMLWriter.

public Boolean Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::no_release_trees ( )
  Arg [0] : Boolean; indicates if we need to avoid releasing trees
  Returntype : Boolean
  Exceptions : None
  Status     : Stable
 
Code:
click to view
public Boolean Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::possible_orthologs ( )
  Arg [0] : Boolean; indicates if we want to treat not-supported duplications as speciations
  Returntype : Boolean
  Exceptions : None
  Status     : Stable
 
Code:
click to view
public String Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::source ( )
  Arg[0] : The value to set this to
  Description : Indicates the source of the stable identifiers for the 
                peptides.
  Returntype : String
  Exceptions : None
  Status     : Stable
 
Code:
click to view
public String Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::source_version ( )
  Arg[0] : The value to set this to
  Description : Indicates the version of the data
  Returntype : String
  Exceptions : None
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::write_data ( )
  Arg[0]      : List reference of all the species (must contain GenomeDB objects)
  Arg[1]      : A function that, given a GenomeDB, returns a list of all the
                members used in the trees for this species
  Arg[2]      : List reference of all the trees
  Description : Generic method to write the content
  Returntype  : None
  Exceptions  : Possible if there is an issue with retrieving data from the tree
  instance
  Status      : Stable
 
Code:
click to view
public void Bio::EnsEMBL::Compara::Graph::OrthoXMLWriter::write_trees ( )
  Arg[0]      : The tree to write. Can be a single Tree or an ArrayRef
  Description : Writes a tree into the backing document representation
  Returntype  : None
  Exceptions  : Possible if there is an issue with retrieving data from the tree
  instance
  Example     : $writer->write_trees($tree);
                $writer->write_trees([$tree_one, $tree_two]);
  Status      : Stable
 
Code:
click to view
public Bio::EnsEMBL::Compara::Graph::BaseXMLWriter::xml_schema_namespace ( ) [inherited]
Returns the namespace of the XML schema (currently W3C 2001)
 
Code:
click to view

The documentation for this class was generated from the following file: