Vikram,<div><br><div>    I recognize this domain in many of the questions that have been asked. There are several times where I&#39;ve thought, &quot;That *so* isn&#39;t the most ideal &#39;Computer Science&#39; way to do something.&quot; But, I also recognize that, especially in the Biological world, we have no control how we receive the data and thus, we still have to solve problems like those reviewed.</div>
<div><br></div><div>   So, I normally don&#39;t challenge the base assumption in the question because I know from experience, we don&#39;t always get the most ideal inputs to work with. HOWEVER, I do want to challenge this one because I know there&#39;s a standard way that this is represented in the Biological community without using three characters for a single base. I recognize your original question of z = &#39;AT/CG&#39; to mean, In Biological terms, that:</div>
<div><br></div><div>&quot;Zee equals the string of three nucleotide bases. The first base is Adenine. The second base is either Thymine or Cytosine. The third base is Guanine.&quot;</div><div><br></div><div>There&#39;s a *much* better (and commonly accepted) way to represent this.</div>
<div><br></div><div>The way this is traditionally is represented is with the extended genetic alphabet (<a href="http://www.hrbc-genomics.net/training/bcd/Curric/PrwAli/node7.html">http://www.hrbc-genomics.net/training/bcd/Curric/PrwAli/node7.html</a>). In this case, the middle base would be represented by the letter Y as that means either Thymine or Cytosine. </div>
<div><br></div><div>I feel it&#39;s much better to represent this as:</div><div><br></div><div>z = &#39;AYG&#39;</div><div><br></div><div>Then, the string will work without any expected manipulations. I would always work with the alphabet and not put the three character string back in as this alphabet is defined and accepted in the community. However, if one wanted to they still could later represent this in a &#39;lookup dictionary&#39; such as follows if the output ever needed to be in a the format in question.</div>
<div><br></div><div>lookup = {&#39;R&#39;: &#39;G/A&#39;,</div><div>              &#39;Y&#39;: &#39;T/C&#39;, </div><div>              &#39;M&#39;: &#39;A/C&#39;,....}</div><div><br></div><div>Cheers,</div><div><br></div>
<div><br></div><div>Glen</div><div>               </div><div><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 9:37 PM, Vikram K <span dir="ltr">&lt;<a href="mailto:kpguy1975@gmail.com">kpguy1975@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Suppose i have this string:<br>z = &#39;AT/CG&#39;<br><br>How do i get this list:<br><br>zlist = [&#39;A&#39;,&#39;T/C&#39;,&#39;G&#39;]<br>
<br>
<br>_______________________________________________<br>
Baypiggies mailing list<br>
<a href="mailto:Baypiggies@python.org">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br>
<a href="http://mail.python.org/mailman/listinfo/baypiggies" target="_blank">http://mail.python.org/mailman/listinfo/baypiggies</a><br></blockquote></div><br><br clear="all"><br>-- <br>Whatever you can do or imagine, begin it;<br>
boldness has beauty, magic, and power in it.<br><br>-- Goethe <br>
</div></div>