<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Obtaining overrepresented motifs in DNA sequences, part 13</title>
	<atom:link href="http://python.genedrift.org/2008/08/20/obtaining-overrepresented-motifs-in-dna-sequences-part-13/feed/" rel="self" type="application/rss+xml" />
	<link>http://python.genedrift.org/2008/08/20/obtaining-overrepresented-motifs-in-dna-sequences-part-13/</link>
	<description>a step-by-step guide to create Python applications in bioinformatics</description>
	<lastBuildDate>Mon, 22 Feb 2010 18:22:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andrew Dalke</title>
		<link>http://python.genedrift.org/2008/08/20/obtaining-overrepresented-motifs-in-dna-sequences-part-13/comment-page-1/#comment-18180</link>
		<dc:creator>Andrew Dalke</dc:creator>
		<pubDate>Sun, 24 Aug 2008 15:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://python.genedrift.org/?p=149#comment-18180</guid>
		<description>The code doesn&#039;t use the id_no inside of each quorum set, only the length of each set.  If you don&#039;t need that number then you can use a counter instead of of a set, as in:

def get_quorums(seqs, mlen):
__quorum = defaultdict(int)
__for seq in seqs:
____for n in range(len(seq) - mlen):
______quorum[seq[n:n + mlen]] += 1
__return quorum

and replace the main code with 

for i in foreground:
__term1 = choose(background[i], foreground[i])
__term2 = choose((N - background[i]), len(input_seqs)-1)
__term3 = choose(N, len(input_seqs))
__p = (float(term1) * float(term2)) / term3
__if 0 &lt; p &lt;= 0.0001:
____print i, foreground[i], background[i], p</description>
		<content:encoded><![CDATA[<p>The code doesn&#8217;t use the id_no inside of each quorum set, only the length of each set.  If you don&#8217;t need that number then you can use a counter instead of of a set, as in:</p>
<p>def get_quorums(seqs, mlen):<br />
__quorum = defaultdict(int)<br />
__for seq in seqs:<br />
____for n in range(len(seq) &#8211; mlen):<br />
______quorum[seq[n:n + mlen]] += 1<br />
__return quorum</p>
<p>and replace the main code with </p>
<p>for i in foreground:<br />
__term1 = choose(background[i], foreground[i])<br />
__term2 = choose((N &#8211; background[i]), len(input_seqs)-1)<br />
__term3 = choose(N, len(input_seqs))<br />
__p = (float(term1) * float(term2)) / term3<br />
__if 0 &lt; p &lt;= 0.0001:<br />
____print i, foreground[i], background[i], p</p>
]]></content:encoded>
	</item>
</channel>
</rss>

