Package Bio :: Package Phylo :: Module TreeConstruction :: Class _DistanceMatrix
[hide private]
[frames] | no frames]

Class _DistanceMatrix

source code

object --+    
         |    
   _Matrix --+
             |
            _DistanceMatrix

Distance matrix class that can be used for distance based tree
algorithms.

All diagonal elements will be zero no matter what the users provide.

Instance Methods [hide private]
 
__init__(self, names, matrix=None)
Initialize matrix by a list of names and a list of lower triangular matrix data
source code
 
__setitem__(self, item, value)
Set value by the index(s) or name(s). Similar to __getitem__ dm[1] = [1, 0, 3, 4] set values from '1' to others; dm[i, j] = 2 set the value from 'i' to 'j'
source code
 
_set_zero_diagonal(self)
set all diagonal elements to zero
source code

Inherited from _Matrix: __delitem__, __getitem__, __len__, __repr__, __str__, insert

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, names, matrix=None)
(Constructor)

source code 
Initialize matrix by a list of names and a list of lower triangular matrix data
Parameters:
  • names - names of elements, used for indexing
  • matrix - nested list of numerical lists in lower triangular format
Overrides: object.__init__
(inherited documentation)

__setitem__(self, item, value)
(Index assignment operator)

source code 
Set value by the index(s) or name(s). Similar to __getitem__ dm[1] = [1, 0, 3, 4] set values from '1' to others; dm[i, j] = 2 set the value from 'i' to 'j'
Overrides: _Matrix.__setitem__
(inherited documentation)