<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>scienceoss.com &#187; codons</title>
	<atom:link href="http://scienceoss.com/tags/codons/feed/" rel="self" type="application/rss+xml" />
	<link>http://scienceoss.com</link>
	<description>useful tidbits for using open source software in science</description>
	<lastBuildDate>Wed, 26 May 2010 03:34:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Return a list of codons from a sequence</title>
		<link>http://scienceoss.com/return-a-list-of-codons-from-a-sequence/</link>
		<comments>http://scienceoss.com/return-a-list-of-codons-from-a-sequence/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 15:44:57 +0000</pubDate>
		<dc:creator>ryan</dc:creator>
				<category><![CDATA[BioPython]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[codons]]></category>

		<guid isPermaLink="false">http://scienceoss.com/?p=58</guid>
		<description><![CDATA[There are no built-in functions (that I know of) for returning a list of codons from a sequence, but making your own is quite simple. This function is from Solution A.5 from the Python Course in Bioinformatics def codons(s, frame=0): """Return a list of codons from a string, s, giving an optional frameshift.""" codons=[] end=len(s[frame:]) [...]]]></description>
			<content:encoded><![CDATA[<p>There are no built-in functions (that I know of) for returning a list of codons from a sequence, but making your own is quite simple.  This function is from Solution A.5 from the Python Course in Bioinformatics</p>
<pre class = "prettyprint"><code class = "code">
def codons(s, frame=0):
    """Return a list of codons from a string, s, giving an optional frameshift."""

    codons=[]

    end=len(s[frame:]) - (len(s[frame:]) % 3) - 1

    for i in range(frame,end,3):
        codons.append(s[i:i+3])

    return codons
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://scienceoss.com/return-a-list-of-codons-from-a-sequence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A quick codon table</title>
		<link>http://scienceoss.com/a-quick-codon-table/</link>
		<comments>http://scienceoss.com/a-quick-codon-table/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 02:40:25 +0000</pubDate>
		<dc:creator>ryan</dc:creator>
				<category><![CDATA[BioPython]]></category>
		<category><![CDATA[codons]]></category>

		<guid isPermaLink="false">http://scienceoss.com/?p=50</guid>
		<description><![CDATA[Sometimes it&#8217;s nice to be able to have a codon table handy. Rather than typing out one by hand, theTranslate module contains the codon table of your choice in dictionary form: Note 1: See the NCBI Translation Tables for the correctid number to use for your sequence. And here&#8217;s how to easily reverse it, where [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s nice to be able to have a codon table handy. Rather than typing out one by hand, theTranslate module contains the codon table of your choice in dictionary form:<span id="more-50"></span></p>
<pre class="brush: python; title: ; notranslate">
from Bio import Translate
translater=Translate.unambiguous_dna_by_id[11]
bacterial_table=translater.table.forward_table
</pre>
<p><a name="note1" title="note1" id="note1"></a><br />
<strong>Note 1:</strong> See the <a href="http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi">NCBI Translation Tables</a> for the correctid number to use for your sequence.</p>
<pre class="brush: python; title: ; notranslate">
bacterial_table['TAT']
&gt;&gt;&gt;'Y'
</pre>
<p>And here&#8217;s how to easily reverse it, where the keys are amino acids and the values are lists of codons:</p>
<pre class="brush: python; title: ; notranslate">
back_table = {}
for key,value in bacterial_table.iteritems():
    try:
        back_table[value].append(key)
    except KeyError:
        back_table[value]=[key]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://scienceoss.com/a-quick-codon-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

