Clustalw.py
A set of classes to interact with the multiple alignment command
line program Clustalw (which is the command line version of the current
graphical Clustalx aligment program).
This requires Clustalx1.8.1 available from:
ftp://ftp-igbmc.u-strasbg.fr/pub/ClustalX/.
Older versions may work, but haven't been tested yet.
functions:
o parse_file
o do_alignment
classes:
o ClustalAlignment
o _AlignCreator
o MultipleAlignCL
Imported modules
|
|
from Bio import Alphabet
from Bio.Align.Generic import Alignment
from Bio.Alphabet import IUPAC
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import clustal_format
import os
import string
from xml.sax import saxutils, handler
|
Functions
|
|
do_alignment
parse_file
|
|
do_alignment
|
do_alignment ( command_line, alphabet=None )
Perform an alignment with the given command line.
Arguments:
o command_line - A command line object that can give out
the command line we will input into clustalw.
o alphabet - the alphabet to use in the created alignment. If not
specified IUPAC.unambiguous_dna and IUPAC.protein will be used for
dna and protein alignment respectively.
Returns:
o A clustal alignment object corresponding to the created alignment.
If the alignment type was not a clustal object, None is returned.
Exceptions
|
|
IOError( "Cannot open sequence file %s" % command_line.sequence_file )
IOError( "Sequence file %s has an invalid format." % command_line.sequence_file )
IOError( "Sequence file %s has only one sequence present." % command_line.sequence_file )
IOError("Output .aln file %s not produced, commandline: %s" %( out_file, command_line ) )
ValueError("Bad command line option in the command: %s" % str( command_line ) )
|
|
|
parse_file
|
parse_file ( file_name, alphabet=IUPAC.unambiguous_dna )
Parse the given file into a clustal aligment object.
Arguments:
o file_name - The name of the file to parse.
o alphabet - The type of alphabet to use for the alignment sequences.
This should correspond to the type of information contained in the file.
Defaults to be unambiguous_dna sequence.
|
Classes
|
|
|
|