[Biopython] ‘grant’ substitution matrix error

Konrad Koehler konrad.koehler at mac.com
Mon Oct 31 09:01:09 UTC 2016


Thanks Iddo,

After removing dictionary entries containing ‘U’ or ‘O’ from MatrixInfo.py, I can now load the ‘grant’ matrix.

/Konrad


> On 27 Oct 2016, at 15:48, Iddo Friedberg <idoerg at gmail.com> wrote:
> 
> Wild guess: grant & fitch are the only matrices in MatrixInfo.py to have the 'U" amino acid in the 2-tuples that make up the key in the dictionary representing the matrices.  "U" is a non-canonical single amino-acid letter code. Since the program fails on the following:
> .
> .
> .
>  elif all(isinstance(i, str) for i in item):
>                 row_name, col_name = item
>                 if row_name in self.names and col_name in self.names:
>                     row_index = self.names.index(row_name)
>                     col_index = self.names.index(col_name)
>                 else:
>                     raise ValueError("Item not found.")
> 
> My guess is that the 'U'   is not in self.names, which triggers the ValueError. Try inserting a different MatrixInfo file, where keys having 'U' are removed.
> 
> ./I
> 
> 
> On Thu, Oct 27, 2016 at 7:56 AM, Konrad Koehler <konrad.koehler at mac.com <mailto:konrad.koehler at mac.com>> wrote:
> Hello Everyone,
> 
> I wanted to use the ‘grant’ substitution matrix, but when I specify this matrix in DistanceCalculator, it throws a ValueError (the full error message is reproduced below). I have tested all the available substitution matrices and they all work with the exception of ‘fitch’ and ‘grant’. These matrices are stored in the following file:
> 
> ~/anaconda/lib/python2.7/site-packages/Bio/SubsMat/MatrixInfo.py
> 
> The fitch and grant matrices in this file look OK and I cannot see any obvious reason why these matrices are failing to load. I would be very grateful for any suggesting for how to fix these matrices.
> 
> Thanks,
> 
> Konrad
> 
> -------------------------------------------------------------------------------------------------------------------------------------
> The following was produced by Biopython 1.68 on Mac OS X installed using pip:
> 
> >>> from Bio.Phylo.TreeConstruction import DistanceCalculator
> >>> calculator = DistanceCalculator('grant')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File “~/anaconda/lib/python2.7/site-packages/Bio/Phylo/TreeConstruction.py", line 411, in __init__
>     self.protein_matrices[model])
>   File “~/anaconda/lib/python2.7/site-packages/Bio/Phylo/TreeConstruction.py", line 480, in _build_protein_matrix
>     protein_matrix[aa1, aa2] = v
>   File “~/anaconda/lib/python2.7/site-packages/Bio/Phylo/TreeConstruction.py", line 222, in __setitem__
>     raise ValueError("Item not found.")
> ValueError: Item not found.
> -------------------------------------------------------------------------------------------------------------------------------------
> 
> 
> 
> 
> 
> _______________________________________________
> Biopython mailing list  -  Biopython at mailman.open-bio.org <mailto:Biopython at mailman.open-bio.org>
> http://mailman.open-bio.org/mailman/listinfo/biopython <http://mailman.open-bio.org/mailman/listinfo/biopython>
> 
> 
> 
> -- 
> Iddo Friedberg
> http://iddo-friedberg.net/contact.html <http://iddo-friedberg.net/contact.html>
> ++++++++++[>+++>++++++>++++++++>++++++++++>+++++++++++<<<<<-]>>>>++++.>
> ++++++..----.<<<<++++++++++++++++++++++++++++.-----------..>>>+.-----.
> .>-.<<<<--.>>>++.>+++.<+++.----.-.<++++++++++++++++++.>+.>.<++.<<<+.>>
> >>----.<--.>++++++.<<<<------------------------------------.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20161031/97ed0177/attachment.html>


More information about the Biopython mailing list