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