<div dir="ltr">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:<div>.</div><div>.</div><div>.</div><div><div><font face="monospace, monospace"> elif all(isinstance(i, str) for i in item):</font></div><div><font face="monospace, monospace">                row_name, col_name = item</font></div><div><font face="monospace, monospace">                if row_name in self.names and col_name in self.names:</font></div><div><font face="monospace, monospace">                    row_index = self.names.index(row_name)</font></div><div><font face="monospace, monospace">                    col_index = self.names.index(col_name)</font></div><div><font face="monospace, monospace">                else:</font></div><div><font face="monospace, monospace">                    raise ValueError("Item not found.")</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">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.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">./I</font></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 27, 2016 at 7:56 AM, Konrad Koehler <span dir="ltr"><<a href="mailto:konrad.koehler@mac.com" target="_blank">konrad.koehler@mac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px">Hello Everyone,</span></font></span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px"><br></span></font></span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px">I wanted to use the ‘grant’ s</span></font></span><font face="Menlo"><span style="font-size:11px">ubstitution matrix, but when I specify this matrix in </span></font><span style="font-family:Menlo;font-size:11px">DistanceCalculator</span><font face="Menlo"><span style="font-size:11px">, it throws a ValueError (the full error message is reproduced below). </span></font><font face="Menlo"><span style="font-size:11px">I have tested all the available </span></font><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px">s</span></font></span><font face="Menlo"><span style="font-size:11px">ubstitution matrices and they all work with the exception of ‘fitch’ and ‘grant’. </span></font><span style="font-family:Menlo;font-size:11px">These matrices are stored in the following file:</span></div><div style="margin:0px;line-height:normal"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">~/anaconda/lib/python2.7/site-<wbr>packages/Bio/SubsMat/</span>MatrixInf<wbr>o.py</div></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;font-size:11px"><font face="Menlo"><br></font></span></div><div style="margin:0px;line-height:normal"><font face="Menlo"><span style="font-size:11px">The fitch and grant matrices in this file look OK and I cannot see any obvious reason why these matrices are failing to load. </span></font><span style="font-family:Menlo;font-size:11px">I would be very grateful for any suggesting for how to fix these matrices.</span></div><div style="margin:0px;line-height:normal"><br></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;font-size:11px"><font face="Menlo">Thanks,</font></span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;font-size:11px"><font face="Menlo"><br></font></span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;font-size:11px"><font face="Menlo">Konrad</font></span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;font-size:11px"><font face="Menlo"><br></font></span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px">------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-------------</span></font></span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px">The following was produced by Biopython </span></font></span><span style="font-family:Menlo;font-size:11px">1.68 on Mac </span><font face="Menlo"><span style="font-size:11px">OS X installed using pip:</span></font></div><div style="margin:0px;line-height:normal"><font face="Menlo"><span style="font-size:11px"><br></span></font></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;font-size:11px"><font face="Menlo">>>> from Bio.Phylo.TreeConstruction import DistanceCalculator</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">>>> calculator = DistanceCalculator('grant')</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Traceback (most recent call last):</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  File "<stdin>", line 1, in <module></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  File “~/anaconda/lib/python2.7/<wbr>site-packages/Bio/Phylo/<wbr>TreeConstruction.py", line 411, in __init__</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    self.protein_matrices[model])</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  File “~/anaconda/lib/python2.7/<wbr>site-packages/Bio/Phylo/<wbr>TreeConstruction.py", line 480, in _build_protein_matrix</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    protein_matrix[aa1, aa2] = v</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  File “~/anaconda/lib/python2.7/<wbr>site-packages/Bio/Phylo/<wbr>TreeConstruction.py", line 222, in __setitem__</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    raise ValueError("Item not found.")</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">ValueError: Item not found.</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px">------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-------------</span></font></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><font face="Menlo"><span style="font-size:11px"><br></span></font></span></div></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><div style="margin:0px;line-height:normal"><br></div><div><font face="Menlo"><span style="font-size:11px"><br></span></font></div><div><font face="Menlo"><span style="font-size:11px"><br></span></font></div></span></div></div><br>______________________________<wbr>_________________<br>
Biopython mailing list  -  <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" rel="noreferrer" target="_blank">http://mailman.open-bio.org/<wbr>mailman/listinfo/biopython</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Iddo Friedberg<br><a href="http://iddo-friedberg.net/contact.html" target="_blank">http://iddo-friedberg.net/contact.html</a><br>++++++++++[>+++>++++++>++++++++>++++++++++>+++++++++++<<<<<-]>>>>++++.><br>++++++..----.<<<<++++++++++++++++++++++++++++.-----------..>>>+.-----.<br>.>-.<<<<--.>>>++.>+++.<+++.----.-.<++++++++++++++++++.>+.>.<++.<<<+.>><br>>>----.<--.>++++++.<<<<------------------------------------.<br></div>
</div>