Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::Utils::IO::FASTASerializer Class Reference
Inheritance diagram for Bio::EnsEMBL::Utils::IO::FASTASerializer:

List of all members.


Class Summary

Synopsis

  my $serializer = Bio::EnsEMBL::Utils::IO::FASTASerializer-\>new($filehandle);
  $serializer-\>chunk_factor(1000);
  $serializer-\>line_width(60);
  $serializer-\>print_Seq($slice);
  
  $serializer = Bio::EnsEMBL::Utils::IO::FASTASerializer-\>new($filehandle,
    sub {
        my $slice = shift;
        return ">Custom header";
    }
  );

Description

  Replacement for SeqDumper, making better use of shared code. Outputs FASTA
  format with optional custom header and formatting parameters. Set line_width
  and chunk_factor to dictate buffer size depending on application. A 60kb
  buffer is used by default with a line width of 60 characters.
  Custom headers are set by supplying an anonymous subroutine to new(). Custom
  header code must accept a Slice or Bio::PrimarySeqI compliant object as 
  argument and return a string.
  The custom header method can be overridden later through set_custom_header()
  but this is not normally necessary.
 

Definition at line 38 of file FASTASerializer.pm.

Available Methods

public Int chunk_factor ()
public DESTROY ()
public void formatted_write ()
public Int line_width ()
public
Bio::EnsEMBL::Utils::IO::FASTASerializer 
new ()
public void print_main_header ()
public void print_metadata ()
public void print_Seq ()
public print_sequence ()
public Boolean printed_something ()
public set_custom_header ()

Method Documentation

public Int Bio::EnsEMBL::Utils::IO::FASTASerializer::chunk_factor ( )
    Arg [1]    : Integer e.g. 1000
    Description: Set and get the multiplier used to dictate buffer size
                 Chunk factor x line width = buffer size in bases.
    Returntype : Integer
 
Code:
click to view
public Bio::EnsEMBL::Utils::IO::Serializer::DESTROY ( ) [inherited]
	Destructor
	Description: Restores default state of the STDOUT filehandle as it is a copy
	             and may not flush correctly.
 
Code:
click to view
public void Bio::EnsEMBL::Utils::IO::Serializer::formatted_write ( ) [inherited]
   Arg [1]    : Line format, see Perldoc of formline()
   Arg [2]    : Array of arguments to suit the line format in Arg [1]
   Description: Writes data to the filehandle and rigidly formats it.
                Refer to Perldoc on formline() to specify valid formats.
                Useful for fixed-width file formats.
                Suicides in the event of file system issues.
   Example    : my $FORMAT = '^<<<<<<<<<<<<<<<<<<<|<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n';
                $serializer->formatted_write($FORMAT,@text_fields);
   Returntype : None
 
Code:
click to view
public Int Bio::EnsEMBL::Utils::IO::FASTASerializer::line_width ( )
    Arg [1]    : Integer e.g. 60 or 80
    Description: Set and get FASTA format line width. Default is 60
    Returntype : Integer
 
Code:
click to view
public Bio::EnsEMBL::Utils::IO::FASTASerializer Bio::EnsEMBL::Utils::IO::FASTASerializer::new ( )
  Arg [1]    : Filehandle (optional) 
  Arg [2]    : CODEREF subroutine for writing custom headers
  Example    : $dumper = Bio::EnsEMBL::Utils::IO::FASTASerializer->new;
  Description: Constructor
               Allows the specification of a custom function for rendering
               header lines.
  Returntype : Bio::EnsEMBL::Utils::IO::FASTASerializer;
  Exceptions : none
  Caller     : general
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::Utils::IO::Serializer.

public void Bio::EnsEMBL::Utils::IO::Serializer::print_main_header ( ) [inherited]
	Arg [1]    : Data for header, depends on serializer
	Description: Printing the header text or metadata required for this file format,
	             Re-implement in the serializer.
	Returntype : None
 
Code:
click to view

Reimplemented in Bio::EnsEMBL::Utils::IO::GFFSerializer, and Bio::EnsEMBL::Utils::IO::ReportSerializer.

public void Bio::EnsEMBL::Utils::IO::FASTASerializer::print_metadata ( )
    Arg [1]    : Bio::EnsEMBL::Slice
    Description: Printing header lines into FASTA files. Usually handled
                 internally to the serializer.                
    Returntype : None
    Caller     : print_Seq
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::Utils::IO::Serializer.

public void Bio::EnsEMBL::Utils::IO::FASTASerializer::print_Seq ( )
    Arg [1]    : Bio::EnsEMBL::Slice or other Bio::PrimarySeqI compliant object
    Description: Serializes the slice into FASTA format. Buffering is used
                 While other Bioperl PrimarySeqI implementations can be used,
                 a custom header function will be required to accommodate it.
    Returntype : None
 
Code:
click to view
public Bio::EnsEMBL::Utils::IO::Serializer::print_sequence ( ) [inherited]
	Arg [1]    : Bio::EnsEMBL::Slice
	Description: By default, prints a block of FASTA format sequence from the given slice

Deprecated:
Code:
click to view
public Boolean Bio::EnsEMBL::Utils::IO::Serializer::printed_something ( ) [inherited]
    Description: Check if serializer has printed any useful data. Not accurate with FASTA
                 due to non-reporting dumper.
    Returntype : Boolean
 
Code:
click to view
public Bio::EnsEMBL::Utils::IO::FASTASerializer::set_custom_header ( )
    Arg [1]    : CODE reference
    Description: Set the custom header function. Normally this is done at
                 construction time, but can be overridden here.
    Returntype :
 
Code:
click to view

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