Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.AlignIO.Interfaces.SequentialAlignmentWriter Class Reference
Inheritance diagram for Bio.AlignIO.Interfaces.SequentialAlignmentWriter:
Inheritance graph
[legend]
Collaboration diagram for Bio.AlignIO.Interfaces.SequentialAlignmentWriter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def write_file
def write_header
def write_footer
def write_alignment
def clean

Public Attributes

 handle

Detailed Description

Base class for building MultipleSeqAlignment writers.

This assumes each alignment can be simply appended to the file.
You should write a write_alignment() method.
You may wish to redefine the __init__ method as well

Definition at line 99 of file Interfaces.py.


Constructor & Destructor Documentation

Reimplemented from Bio.AlignIO.Interfaces.AlignmentWriter.

Definition at line 106 of file Interfaces.py.

00106 
00107     def __init__(self, handle):
00108         self.handle = handle
       

Here is the caller graph for this function:


Member Function Documentation

def Bio.AlignIO.Interfaces.AlignmentWriter.clean (   self,
  text 
) [inherited]
Use this to avoid getting newlines in the output.

Definition at line 95 of file Interfaces.py.

00095 
00096     def clean(self, text):
00097         """Use this to avoid getting newlines in the output."""
        return text.replace("\n", " ").replace("\r", " ").replace("  ", " ")

Here is the caller graph for this function:

Use this to write a single alignment.

This method should be replaced by any derived class to do something
useful.

Definition at line 137 of file Interfaces.py.

00137 
00138     def write_alignment(self, alignment):
00139         """Use this to write a single alignment.
00140         
00141         This method should be replaced by any derived class to do something
00142         useful."""
00143         raise NotImplementedError("This object should be subclassed")
00144         #####################################################
00145         # You SHOULD subclass this, to write the alignment  #
00146         # objecta to the file handle                        #
00147         #####################################################
00148 

Here is the caller graph for this function:

Use this to write an entire file containing the given alignments.

alignments - A list or iterator returning MultipleSeqAlignment objects

In general, this method can only be called once per file.

Reimplemented from Bio.AlignIO.Interfaces.AlignmentWriter.

Definition at line 109 of file Interfaces.py.

00109 
00110     def write_file(self, alignments):
00111         """Use this to write an entire file containing the given alignments.
00112 
00113         alignments - A list or iterator returning MultipleSeqAlignment objects
00114 
00115         In general, this method can only be called once per file."""
00116         self.write_header()
00117         count = 0
00118         for alignment in alignments:
00119             self.write_alignment(alignment)
00120             count += 1
00121         self.write_footer()
00122         return count
        

Here is the call graph for this function:

Use this to write any footer.

This method should be replaced by any derived class to do something
useful.

Definition at line 130 of file Interfaces.py.

00130 
00131     def write_footer(self):
00132         """Use this to write any footer.
00133         
00134         This method should be replaced by any derived class to do something
00135         useful."""
00136         pass

Here is the caller graph for this function:

Use this to write any header.

This method should be replaced by any derived class to do something
useful.

Definition at line 123 of file Interfaces.py.

00123 
00124     def write_header(self):
00125         """Use this to write any header.
00126         
00127         This method should be replaced by any derived class to do something
00128         useful."""
00129         pass
    

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from Bio.AlignIO.Interfaces.AlignmentWriter.

Definition at line 107 of file Interfaces.py.


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