<?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: Finding motifs in DNA sequences: twist</title>
	<atom:link href="http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/feed/" rel="self" type="application/rss+xml" />
	<link>http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/</link>
	<description>a step-by-step guide to create Python applications in bioinformatics</description>
	<lastBuildDate>Sun, 02 May 2010 04:24:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
	<item>
		<title>By: nuin</title>
		<link>http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/comment-page-1/#comment-4486</link>
		<dc:creator>nuin</dc:creator>
		<pubDate>Tue, 23 Oct 2007 18:19:54 +0000</pubDate>
		<guid isPermaLink="false">http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/#comment-4486</guid>
		<description>Hi Dilmurat,

You are right there is no need for that extra assignment. sys.exit() takes care of exiting. I changed the code already.

Thanks a lot.

Paulo</description>
		<content:encoded><![CDATA[<p>Hi Dilmurat,</p>
<p>You are right there is no need for that extra assignment. sys.exit() takes care of exiting. I changed the code already.</p>
<p>Thanks a lot.</p>
<p>Paulo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dilmurat</title>
		<link>http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/comment-page-1/#comment-4483</link>
		<dc:creator>Dilmurat</dc:creator>
		<pubDate>Tue, 23 Oct 2007 17:14:33 +0000</pubDate>
		<guid isPermaLink="false">http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/#comment-4483</guid>
		<description>Hi Paulo:

In the above second script, before sys.exit(), there is a new value &#039;False&#039; reassigned to &#039;fileinput&#039;.
Is it really necessary for that? I think &#039;sys.exit()&#039;, by itself, can end &#039;while&#039; loop and script.

Thanks!
Dilmurat</description>
		<content:encoded><![CDATA[<p>Hi Paulo:</p>
<p>In the above second script, before sys.exit(), there is a new value &#8216;False&#8217; reassigned to &#8216;fileinput&#8217;.<br />
Is it really necessary for that? I think &#8216;sys.exit()&#8217;, by itself, can end &#8216;while&#8217; loop and script.</p>
<p>Thanks!<br />
Dilmurat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nuin</title>
		<link>http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/comment-page-1/#comment-4319</link>
		<dc:creator>nuin</dc:creator>
		<pubDate>Fri, 19 Oct 2007 21:28:29 +0000</pubDate>
		<guid isPermaLink="false">http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/#comment-4319</guid>
		<description>Hi Joe

You are right, the %s are not necessary as you already have a string. Basically they do not work to convert inmotif to a string but basically put the variable in the %s argument. IT is a not a pythonic way of doing things but it is at first more didactic for those who come from other languages.

I believe in further entries I used the re.compile(&lt;string&gt;) without %s.

Cheers

Paulo</description>
		<content:encoded><![CDATA[<p>Hi Joe</p>
<p>You are right, the %s are not necessary as you already have a string. Basically they do not work to convert inmotif to a string but basically put the variable in the %s argument. IT is a not a pythonic way of doing things but it is at first more didactic for those who come from other languages.</p>
<p>I believe in further entries I used the re.compile(<string>) without %s.</p>
<p>Cheers</p>
<p>Paulo</string></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph T Oettinger MD, FACOG</title>
		<link>http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/comment-page-1/#comment-4318</link>
		<dc:creator>Joseph T Oettinger MD, FACOG</dc:creator>
		<pubDate>Fri, 19 Oct 2007 21:06:51 +0000</pubDate>
		<guid isPermaLink="false">http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/#comment-4318</guid>
		<description>Dear Paolo,

Probably just a novice question, but in the program code_05.py, in the line:

  motif = re.compile(&#039;%s&#039;, % inmotif)

why is the (&#039;%s&#039;, %) necessary? Is it to convert inmotif into a string before compilation?.

The program seems to work with just:

 motif = re.compile(inmotif)

and I had the impression that raw_input() always returned a string. For example, you have to convert the count in  

count = raw_input(&quot;enter an integer&quot;)
count = int(count)

otherwise you get an error message when you then write:

count += 2

The only thing I can think of is that, if you reuse the code and inmotif doesn&#039;t come from raw_input and isn&#039;t a string, the &#039;%s&#039;, % would prevent an error.

Sorry, this has turned into a rather wordy question on a rather minor point.

Thanks,

Joe</description>
		<content:encoded><![CDATA[<p>Dear Paolo,</p>
<p>Probably just a novice question, but in the program code_05.py, in the line:</p>
<p>  motif = re.compile(&#8216;%s&#8217;, % inmotif)</p>
<p>why is the (&#8216;%s&#8217;, %) necessary? Is it to convert inmotif into a string before compilation?.</p>
<p>The program seems to work with just:</p>
<p> motif = re.compile(inmotif)</p>
<p>and I had the impression that raw_input() always returned a string. For example, you have to convert the count in  </p>
<p>count = raw_input(&#8220;enter an integer&#8221;)<br />
count = int(count)</p>
<p>otherwise you get an error message when you then write:</p>
<p>count += 2</p>
<p>The only thing I can think of is that, if you reuse the code and inmotif doesn&#8217;t come from raw_input and isn&#8217;t a string, the &#8216;%s&#8217;, % would prevent an error.</p>
<p>Sorry, this has turned into a rather wordy question on a rather minor point.</p>
<p>Thanks,</p>
<p>Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nuin</title>
		<link>http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/comment-page-1/#comment-4216</link>
		<dc:creator>nuin</dc:creator>
		<pubDate>Tue, 16 Oct 2007 20:55:44 +0000</pubDate>
		<guid isPermaLink="false">http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/#comment-4216</guid>
		<description>Hi Joe

Thanks for spotting the error. I already corrected it. Ideally, you should change 

seqlist = open(dnafile, &#039;r&#039;).readlines()

to

seqlist = open(filename, &#039;r&#039;).readlines()

Sorry for the delay in replying. I was away for a couple of days.

Paulo</description>
		<content:encoded><![CDATA[<p>Hi Joe</p>
<p>Thanks for spotting the error. I already corrected it. Ideally, you should change </p>
<p>seqlist = open(dnafile, &#8216;r&#8217;).readlines()</p>
<p>to</p>
<p>seqlist = open(filename, &#8216;r&#8217;).readlines()</p>
<p>Sorry for the delay in replying. I was away for a couple of days.</p>
<p>Paulo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph T Oettinger MD, FACOG</title>
		<link>http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/comment-page-1/#comment-4078</link>
		<dc:creator>Joseph T Oettinger MD, FACOG</dc:creator>
		<pubDate>Sat, 13 Oct 2007 17:28:15 +0000</pubDate>
		<guid isPermaLink="false">http://python.genedrift.org/2007/02/20/finding-motifs-in-dna-sequences-twist/#comment-4078</guid>
		<description>Dear Paolo,

I think I have found a minor error in one of the sample programs in the repository.

In code_06.py,  there is the line:

seqlist = open(dnafile, &#039;r&#039;).readlines()

This produces the error meassage:

TypeError: coercing Unicode: need string or buffer, file found

I don&#039;t know exactly what that means, but I think the problem is that the variable dnafile contains, not the name of a file but the contents of a file, assigned in a previous line of the program:

dnafile = open(filename, &#039;r&#039;)

So, when I replace the error-generating line with:

seqlist = dnafile.readlines()

I don&#039;t get the error message, and the program works just fine.
I don&#039;t think the sample program is referred to in the tutorial. But it slowed me down for a while, so maybe it&#039;s worth correcting. (If indeed I&#039;m right in my analysis).

I&#039;d like to thank you again for the tutorial. It&#039;s very clear, and progresses smoothly from the simple to the complex.

Joe</description>
		<content:encoded><![CDATA[<p>Dear Paolo,</p>
<p>I think I have found a minor error in one of the sample programs in the repository.</p>
<p>In code_06.py,  there is the line:</p>
<p>seqlist = open(dnafile, &#8216;r&#8217;).readlines()</p>
<p>This produces the error meassage:</p>
<p>TypeError: coercing Unicode: need string or buffer, file found</p>
<p>I don&#8217;t know exactly what that means, but I think the problem is that the variable dnafile contains, not the name of a file but the contents of a file, assigned in a previous line of the program:</p>
<p>dnafile = open(filename, &#8216;r&#8217;)</p>
<p>So, when I replace the error-generating line with:</p>
<p>seqlist = dnafile.readlines()</p>
<p>I don&#8217;t get the error message, and the program works just fine.<br />
I don&#8217;t think the sample program is referred to in the tutorial. But it slowed me down for a while, so maybe it&#8217;s worth correcting. (If indeed I&#8217;m right in my analysis).</p>
<p>I&#8217;d like to thank you again for the tutorial. It&#8217;s very clear, and progresses smoothly from the simple to the complex.</p>
<p>Joe</p>
]]></content:encoded>
	</item>
</channel>
</rss>

