<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hi Jeremy -
<div><br>
</div>
<div>Nice work, thanks for sharing.</div>
<div><br>
<div>
<div>However (and someone please correct me if I'm wrong here!), it looks like the current Leucine substitution, "YTN" would also match both of Phe's codons ("TTT" and "TTC"), and the current Arginine ("MGN") also matches two of Serine's codons ("AGT" and "AGC").
FWIW, the <a href="http://www.phylotools.com/ptdegenwebservice.htm">PhyloTools script</a> also produces the same erroneous degenerate codons. I've sent the contact address on that site a bug report.</div>
<div><br>
</div>
<div>I've updated a <a href="https://gist.github.com/jaredsampson/afe24bd0f002d818bb90">fork</a> of your original gist to implement fixes for these residues, along with a couple stylistic changes (hope you don't mind). Please feel free to incorporate them
into your original. If you want to double check the rest of the degen_dict, there's a <a href="https://en.wikipedia.org/wiki/Codon_degeneracy#Terminology">nice table on Wikipedia</a>.</div>
<div><br>
</div>
<div>Also, if you're looking to make other improvements, it might be nice to add a "frame=1" argument to degenerate_sequence() to optionally accommodate the other two reading frames rather than chopping leftover bases.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Jared</div>
<div><br>
<div>
<div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
-- <br>
Jared Sampson<br>
Xiangpeng Kong Lab<br>
NYU Langone Medical Center<br>
<a href="http://kong.med.nyu.edu/">http://kong.med.nyu.edu/</a><br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
<br>
<div>
<div>On Jul 31, 2015, at 1:39 AM, Jeremy <<a href="mailto:Jeremy.molbio@gmail.com">Jeremy.molbio@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
Carlos Pena <mycalesis <at><span class="Apple-converted-space"> </span><a href="http://gmail.com/">gmail.com</a>> writes:<br>
<br>
<blockquote type="cite"><br>
Dear Biopython members,<br>
<br>
I want to take a nucleotide string and degenerate those bases that can<br>
undergo synonymous change.<br>
<br>
For example, a string of just one codon.<br>
<br>
* Input: AAC<br>
* Output: AAY<br>
<br>
Since both AAC and AAT are translated to Asparagine (N) we can<br>
degenerate this codon to AAY (because the third position could produce a<br>
synonymous change).<br>
<br>
This is already solved in the Perl library Degen<br>
<a href="http://www.phylotools.com/ptdegendocumentation.htm">http://www.phylotools.com/ptdegendocumentation.htm</a><br>
<br>
I could use some glue to execute this Perl code from Python but<br>
I cannot include this library in my project because they are using the<br>
GPL license while I use BSD.<br>
<br>
So I thought asking around before writing a Python script to do this for<span class="Apple-converted-space"> </span><br>
</blockquote>
me.<br>
<blockquote type="cite"><br>
thanks for any pointers,<br>
<br>
carlos<br>
</blockquote>
<br>
<br>
<br>
Hi Carlos,<br>
<br>
I hacked up something that should return the same output as the Degen 1.4<span class="Apple-converted-space"> </span><br>
Perlweb tool. <br>
<br>
The gist can be found here: <br>
<br>
<a href="https://gist.github.com/biojerm/6242381eb4ad3ef18ac6">https://gist.github.com/biojerm/6242381eb4ad3ef18ac6</a><br>
<br>
I am pretty new to both Python and Biopython, so the please let me know if<span class="Apple-converted-space"> </span><br>
you have any feedback on both form, styling, and/or function.<span class="Apple-converted-space"> </span><br>
<br>
I know the method is currently quite fragile. Below are a few thoughts on<span class="Apple-converted-space"> </span><br>
the method's weaknesses<br>
<br>
1)The method does not handle sequences that are not evenly divisible by 3.<br>
<br>
2)I think the method would be a lot more useful if you could call it on a<span class="Apple-converted-space"> </span><br>
single or set of FASTA files or a GB files. But, I have not learned how<span class="Apple-converted-space"> </span><br>
to program that yet. <br>
<br>
3) I probably should return the degenerate sequences as Seq files, but at<span class="Apple-converted-space"> </span><br>
the moment they are simple strings.<br>
<br>
4)Tests...need to figure those out too. <br>
<br>
<br>
Please let me know if you find this useful or and if there are any must<span class="Apple-converted-space"> </span><br>
have features for your purposes.<br>
<br>
Thanks,<br>
Jeremy<br>
<br>
<br>
<br>
_______________________________________________<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">http://mailman.open-bio.org/mailman/listinfo/biopython</a></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
<p><br>
------------------------------------------------------------<br>
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.<br>
=================================</p></body>
</html>