<?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>Beginning Python for Bioinformatics &#187; off topic</title>
	<atom:link href="http://python.genedrift.org/category/off-topic/feed/" rel="self" type="application/rss+xml" />
	<link>http://python.genedrift.org</link>
	<description>a step-by-step guide to create Python applications in bioinformatics</description>
	<lastBuildDate>Wed, 10 Mar 2010 13:03:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BioPython and CVS</title>
		<link>http://python.genedrift.org/2009/03/13/biopython-and-cvs/</link>
		<comments>http://python.genedrift.org/2009/03/13/biopython-and-cvs/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 19:25:38 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[biopython]]></category>
		<category><![CDATA[CVS]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/?p=266</guid>
		<description><![CDATA[



Image via Wikipedia



I start this post with an apology. I usually don&#8217;t rant or vent here, which are feelings that I usually reserve to my personal blog.
I don&#8217;t use BioPython, never used it. I have it installed in my systems, but I never wrote a piece of code importing BioPython routines. But I subscribe to [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl style="width: 135px;" class="wp-caption alignright">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:Bazaar_logo_%28software_product%29.svg"><img src="http://upload.wikimedia.org/wikipedia/en/thumb/c/c1/Bazaar_logo_%28software_product%29.svg/125px-Bazaar_logo_%28software_product%29.svg.png" alt="Bazaar" title="Bazaar" height="128" width="125"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:Bazaar_logo_%28software_product%29.svg">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>I start this post with an apology. I usually don&#8217;t rant or vent here, which are feelings that I usually reserve to my personal blog.</p>
<p>I don&#8217;t use BioPython, never used it. I have it installed in my systems, but I never wrote a piece of code importing BioPython routines. But I subscribe to their mailing lists, both user and developer. I maybe have written once to the list, and I just follow the discussions there. </p>
<p>Since last year one of the main topics has been the possibility of moving BioPython from CVS to another version control system. Yes, you read it right. It&#8217;s 2009 and BioPython uses CVS and their version control system. Soon, CVS will be like typewriters and LPs to young developers. Last stable release of CVS was sometime in 2005, what in interwebs time is equivalent to something like 1972. Since 2005, Subversion has taken the world of version control by storm, and Git is getting also very strong, not to mention Bazaar, Darcs, Mercurial and some others that I might not be aware of.</p>
<p>This is a discussion that have been dragging for sometime in the list. And it&#8217;s a shame, a clear lack of leadership from whoever is (not) leading the project. BioRuby is Git, BioPerl SVN and BioPython is CVS, because they &#8220;need to care for the legacy developers&#8221;. It&#8217;s like MSFT keeping two copies of the Notepad executable because they needed to cater to legacy applications, but with a different scale of course. With the current Python steam in the non-bioinformatics and bioinformatics community is very sad to see BioPython not evolving (before you ask me, no, I&#8217;m not interested in helping, not the way things are now). Perl which is language forever-in-waiting for its holy grail (Perl 6) has a strong community behind it, and more important an excellent leadership, that&#8217;s not scare of making decisions.</p>
<p>So, if you&#8217;re still using CVS, it&#8217;s 2009!</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/06117f0a-6d25-497d-b686-1a96e8a7d81c/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=06117f0a-6d25-497d-b686-1a96e8a7d81c" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2009/03/13/biopython-and-cvs/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Expert Python Programming by Tarek Ziadé &#8211; a review of Chapter 3</title>
		<link>http://python.genedrift.org/2009/02/09/expert-python-programming-by-tarek-ziade-a-review-of-chapter-3/</link>
		<comments>http://python.genedrift.org/2009/02/09/expert-python-programming-by-tarek-ziade-a-review-of-chapter-3/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 18:29:24 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2009/02/09/expert-python-programming-by-tarek-ziade-a-review-of-chapter-3/</guid>
		<description><![CDATA[The chapter 3 review that I promised for &#8220;tomorrow&#8221; (last Saturday) was lazily postponed until today. So, let&#8217;s get to it. Tarek in this chapter continues with syntax best practices, but at this time at class level. As expected the chapter requires that you have a minimal knowledge of Python classes, so I can say [...]]]></description>
			<content:encoded><![CDATA[<p>The chapter 3 review that I promised for &#8220;tomorrow&#8221; (last Saturday) was lazily postponed until today. So, let&#8217;s get to it. Tarek in this chapter continues with syntax best practices, but at this time at class level. As expected the chapter requires that you have a minimal knowledge of Python classes, so I can say it&#8217;s geared to somewhat experienced programmers, and not to newcomers. There is a short explanation on sub-classing that warms up things for the next sections. </p>
<p>Next is the built-in method (type?) <code>super</code>, which was new to me. Basically <code>super</code> gives you access a method or attribute of a class by calling its parent directly. This is a segue into understanding the Method Resolution Order in Python, which is understanding which class has precedence over the others. For me, I haven&#8217;t dealt with such structures before it was a good and straight explanation, especially when he explains about possible pitfalls of using <code>super</code>. A short list of best practices helps:</p>
<ul>
<li></li>
<li>Multiple inheritance should be avoided: </li>
<li>super usage has to be consistent: Mixing super and classic calls is a confusing practice. </li>
<li>Don&#8217;t mix old-style and new-style classes</li>
<li>Class hierarchy has to be looked over when a parent class is called</li>
</ul>
<p>After dealing with MRO, comes what I think is one of the best sections of the book so far, where Tarek explains about object descriptors and gives a little bit of the Python&#8217;s approach to introspection. This short section is basically all code, but it&#8217;s good to have a good best practices reference, including here properties and slots. </p>
<p>The last part of the chapter covers meta programming, and as Chris pointed in the comments, that&#8217;s a difficult area of Python (maybe for the ones like me that don&#8217;t have a CS formation). I would have to try the examples by hand and maybe define areas in my code where I can use it, so to take fully advantage and fully understand it.</p>
<p>Overall, the chapter gives a good series of topics about Python classes and I enjoyed learning a little bit more things that I couldn&#8217;t understand previously. Next we will see a review of chapter 4, that deals with PEP 8 and naming best practices.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2009/02/09/expert-python-programming-by-tarek-ziade-a-review-of-chapter-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Expert Python Programming by Tarek Ziadé &#8211; a review of Chapter 2</title>
		<link>http://python.genedrift.org/2009/02/06/expert-python-programming-by-tarek-ziade-a-review-of-chapter-2/</link>
		<comments>http://python.genedrift.org/2009/02/06/expert-python-programming-by-tarek-ziade-a-review-of-chapter-2/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 16:08:03 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[expert]]></category>
		<category><![CDATA[expert python programming]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/?p=235</guid>
		<description><![CDATA[



Cover via Amazon



So we&#8217;re up to the second chapter of Tarek&#8217;s book. A short disclaimer before diving into it. I started this blog, basically one year after I had started programming with Python. The initial idea was to &#8220;convert&#8221; the Beginning Perl for Bioinformatics book to Python and see what were the advantages and disadvantages [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl style="width: 159px;" class="wp-caption alignright">
<dt class="wp-caption-dt"><a href="http://www.amazon.com/Beginning-Perl-Bioinformatics-James-Tisdall/dp/0596000804%3FSubscriptionId%3D0G81C5DAZ03ZR9WH9X82%26tag%3Dzemanta-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596000804"><img src="http://ecx.images-amazon.com/images/I/41GpHIPgOlL._SL200_.jpg" alt="Cover of &quot;Beginning Perl for Bioinformati..." title="Cover of &quot;Beginning Perl for Bioinformati..." height="200" width="149"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;"><a href="http://www.amazon.com/Beginning-Perl-Bioinformatics-James-Tisdall/dp/0596000804%3FSubscriptionId%3D0G81C5DAZ03ZR9WH9X82%26tag%3Dzemanta-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596000804">Cover via Amazon</a></dd>
</dl>
</div>
</div>
<p>So we&#8217;re up to the second chapter of Tarek&#8217;s book. A short disclaimer before diving into it. I started this blog, basically one year after I had started programming with Python. The initial idea was to &#8220;convert&#8221; the Beginning Perl for Bioinformatics book to Python and see what were the advantages and disadvantages of both languages. I was far from being a advanced Python programmer, and the inception of the blog helped me getting close to that, even though I consider myself far from being an expert programmer in Python. I learned a lot working on converting the Perl and learned a lot from the comments and interaction with other programmers and visitors of the blog. As anything in life one&#8217;s path is long and tortuous and there&#8217;s nothing better than daily learning and exercise.</p>
<p>So, as I mentioned in the previous post, this book was tailored for someone like me. I needed a boost on advanced Python techniques and the second chapter just gave me that. Tarek writes in this chapter about good syntax practices below the class level, functions and methods that are common in daily usage. He starts with list comprehensions, that we have seen in this site. It&#8217;s a short and concise section and gives you exactly what you need about this functionality.</p>
<p>Next, iterators and generators. I had a little bit of background on iterators, and have used them here and there, but not a lot on generators. I learned a bit from this section, what you expect from a book like this, things like the <code>close</code> and <code>throw</code>. Although this was good first step on generators, I wished the section could be longer, but that maybe not the focus of the book.</p>
<p>Coroutines was a completely new subject for me. Maybe I haven&#8217;t been diving into Python as much as I needed to, but time is short these days and programming Python is not the first objective of my work. The example is complete and easy to understand, but again I wish it was a tad bit longer. Tarek then explains a bit of generator expressions (list comprehension for generators) and enters the itertools module. So far so good, it&#8217;s a nice summary (at least for me) of simple techniques that can be incorporated into daily coding. And then &#8230; Decorators. </p>
<p>I blame on my poor CS skills or maybe my whole background on programming, but I still cannot get decorators. In my short-sighted view of the programming world I cannot see a place, at least on the things I&#8217;m doing, where I can use a decorator. And here comes the first criticism of the book: I still cannot get after reading the section. One thing that would help a bit would be to have colours on the examples and maybe go over them explaining some code lines. But at the same time, I admit that this might be a personal problem, where the concept of decorators don&#8217;t fit into my brain, and maybe the focus of the book is to show this advanced technique to someone that has a better grasp of the concept.</p>
<p>Overall, it&#8217;s a very good chapter and a good pointer to some expert/advanced techniques in Python. Tomorrow, chapter 3, and we&#8217;re a going to see classes. </p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/2b86d192-b0ab-48fa-88ac-28aacbdf82e5/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=2b86d192-b0ab-48fa-88ac-28aacbdf82e5" alt="Reblog this post [with Zemanta]"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2009/02/06/expert-python-programming-by-tarek-ziade-a-review-of-chapter-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Expert Python Programming by Tarek Ziadé &#8211; a review of Chapter 1</title>
		<link>http://python.genedrift.org/2009/02/05/expert-python-programming-by-tarek-ziade-a-review-of-chapter-1/</link>
		<comments>http://python.genedrift.org/2009/02/05/expert-python-programming-by-tarek-ziade-a-review-of-chapter-1/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 23:20:23 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[expert python programming]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2009/02/05/expert-python-programming-by-tarek-ziade-a-review-of-chapter-1/</guid>
		<description><![CDATA[I&#8217;ve bought (no, Packt Publishing didn&#8217;t send me a copy for review) Tarek&#8217;s book quite sometime ago, but job changes, and extra-Python issues kept me away from reading it with the attention if fully deserve. When I saw the announcement, I thought that this was the book I wanted in Python. First, a little bit [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve bought (no, Packt Publishing didn&#8217;t send me a copy for review) Tarek&#8217;s book quite sometime ago, but job changes, and extra-Python issues kept me away from reading it with the attention if fully deserve. When I saw the announcement, I thought that this was the book I wanted in Python. First, a little bit of perspective.</p>
<p>I&#8217;m a a biologist, self-taught programmer/coder/you-name-it. I only had a brief course on programming logic with Pascal in 1993 (I think). I first learned Basic on Apple ][, then on PC, then moved to Visual Basic, Pascal, C and C++, most of them with the help of books. About three and a half years ago, I got tired of compiling things and decided to learn a different language that would be more agile to code with. Not liking Perl, made me check Python. And I got hooked. Of course as a lay programmer, I won&#8217;t discuss why it&#8217;s better or worse than any other language using technical terms, but I can say that Python fits my needs in fast and efficient programming and I&#8217;m quite happy with the choice I&#8217;ve made. So, this review will not be technical, but will try to expose the book&#8217;s strengths and the weak parts. </p>
<p>Chapter one gives a good introduction on how to install Python and some nice pointers on how to program Python, such as IDEs and initial settings you can add to it. Also there is a short overview of the modern Python implementations. Is it a necessary chapter? Yes and no. No, because the schooled Python user won&#8217;t need it, his or her programming environment will already be installed, configured, set and ready to go. Yes, because this chapter works as a disclaimer for the not-so-experienced Python programmer, and shows everyone of what is expected of this book and what standards will be used. In my opinion, it&#8217;s a necessary starting point, so the author knows that everyone is at the same level. This chapter is also a good short summary of good practices of installing and setting up Python.</p>
<p>Tomorrow, chapter 2.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2009/02/05/expert-python-programming-by-tarek-ziade-a-review-of-chapter-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Magazine?</title>
		<link>http://python.genedrift.org/2008/12/30/python-magazine-2/</link>
		<comments>http://python.genedrift.org/2008/12/30/python-magazine-2/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 17:22:16 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2008/12/29/python-magazine-2/</guid>
		<description><![CDATA[I have been buying Python Magazine in the last months and I really like it, especially now that I already miss Linux Magazine and have no close source for Linux Journal (I should subscribe, I know). Last week I got an email from Python Magazine that I could use a coupon to buy some issues. [...]]]></description>
			<content:encoded><![CDATA[<p>I have been buying Python Magazine in the last months and I really like it, especially now that I already miss Linux Magazine and have no close source for Linux Journal (I should subscribe, I know). Last week I got an email from Python Magazine that I could use a coupon to buy some issues. Coupon that I used right away. Paid with PayPal and I&#8217;m still waiting for my issue to show up. Sent a couple of emails using the contact form and until now, nothing. I&#8217;ll wait until next year and see what happened. It&#8217;s really sad because this issue covers cloud computing with Python.</p>
<p><em>Edit: problem solved. Thanks everyone!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/12/30/python-magazine-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test from Zoundry Raven</title>
		<link>http://python.genedrift.org/2008/08/05/test-from-zoundry-raven/</link>
		<comments>http://python.genedrift.org/2008/08/05/test-from-zoundry-raven/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 23:24:03 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[zoundry raven]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2008/08/05/test-from-zoundry-raven/</guid>
		<description><![CDATA[I am testing a offline/desktop bloggin tool, called Zoundry Raven. New posts are on the way, as promised.
]]></description>
			<content:encoded><![CDATA[<p>I am testing a offline/desktop bloggin tool, called Zoundry Raven. New posts are on the way, as promised.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/08/05/test-from-zoundry-raven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New posts</title>
		<link>http://python.genedrift.org/2008/07/24/new-posts/</link>
		<comments>http://python.genedrift.org/2008/07/24/new-posts/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 22:59:12 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/?p=117</guid>
		<description><![CDATA[Image via WikipediaPosts will resume next week. I was off on vacation and then I changed jobs, so there was no time for Python fun.

]]></description>
			<content:encoded><![CDATA[<p><span class="zemanta-img" style="margin: 1em; float: right; display: block;"><a href="http://en.wikipedia.org/wiki/Image:Python_logo.svg"><img src="http://upload.wikimedia.org/wikipedia/en/thumb/0/06/Python_logo.svg/202px-Python_logo.svg.png" alt="CPython" style="border: medium none ; display: block;"></a><span class="zemanta-img-attribution" style="margin: 1em 0pt 0pt; display: block;">Image via <a href="http://en.wikipedia.org/wiki/Image:Python_logo.svg">Wikipedia</a></span></span>Posts will resume next week. I was off on vacation and then I changed jobs, so there was no time for <a href="http://www.python.org/" title="Python (programming language)" rel="homepage" class="zem_slink">Python</a> fun.
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/90106b90-f576-4234-be6c-4aa36029c6b0/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=90106b90-f576-4234-be6c-4aa36029c6b0" alt="Zemanta Pixie"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/07/24/new-posts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Code repository</title>
		<link>http://python.genedrift.org/2008/05/06/code-repository/</link>
		<comments>http://python.genedrift.org/2008/05/06/code-repository/#comments</comments>
		<pubDate>Wed, 07 May 2008 00:01:22 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/?p=101</guid>
		<description><![CDATA[I am transferring the current repository, which is &#8220;hosted&#8221; in a static page on th blog, to a Git repository on github.com. I am posting soon a quick guide on how to access it. I am also making all relevant entries from the blog into stand alone html pages for off-line browsing.
Anyone with Git experience [...]]]></description>
			<content:encoded><![CDATA[<p>I am transferring the current repository, which is &#8220;hosted&#8221; in a static page on th blog, to a Git repository on <a href="http://github.com">github.com</a>. I am posting soon a quick guide on how to access it. I am also making all relevant entries from the blog into stand alone html pages for off-line browsing.</p>
<p>Anyone with Git experience the link to the repository is <a href="http://github.com/nuin/beginning-python-for-bioinformatics/tree">here</a> (not many commits yet, but it is coming).
<div id="zemanta-pixie" style="margin: 5px 0pt; width: 100%;"><a id="zemanta-pixie-a" href="http://www.zemanta.com/" title="Zemified by Zemanta"><img id="zemanta-pixie-img" src="http://img.zemanta.com/pixie.png?x-id=e8381a4c-60e2-423f-a07e-6050da5476ef" style="border: medium none ; float: right;"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/05/06/code-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking for topics</title>
		<link>http://python.genedrift.org/2008/04/29/looking-for-topics/</link>
		<comments>http://python.genedrift.org/2008/04/29/looking-for-topics/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 16:47:52 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[subjects]]></category>
		<category><![CDATA[topics]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/?p=96</guid>
		<description><![CDATA[I am preparing a couple of posts based on the latest entries and some other subject and after that we going to check again functional programming in Python geared to Bioinformatics. I am also planning on covering topics on Mastering Perl for Bioinformatics and convert them to Python.
Apart from that I already have some suggestions [...]]]></description>
			<content:encoded><![CDATA[<p>I am preparing a couple of posts based on the latest entries and some other subject and after that we going to check again functional programming in Python geared to Bioinformatics. I am also planning on covering topics on Mastering Perl for Bioinformatics and convert them to Python.</p>
<p>Apart from that I already have some suggestions from friends and colleagues, but I am still looking for some subjects that the readers would like to see covered here. Leave me a message or a comment below with some Bioinformatics subject that would be interesting to write about.</p>
<p>On another note, the blog now is syndicated on Planet Python and Unofficial Planet Python. Welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/04/29/looking-for-topics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RSS</title>
		<link>http://python.genedrift.org/2008/03/28/rss-2/</link>
		<comments>http://python.genedrift.org/2008/03/28/rss-2/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 02:17:53 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[unofficial planet python]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2008/03/28/rss-2/</guid>
		<description><![CDATA[I added a more evident link to the RSS feed on the sidebar. If you haven&#8217;t already subscribed, please do so. The feed is now syndicated through the Unofficial Planet Python. 
]]></description>
			<content:encoded><![CDATA[<p>I added a more evident link to the RSS feed on the sidebar. If you haven&#8217;t already subscribed, please do so. The feed is now syndicated through the Unofficial Planet Python. </p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/03/28/rss-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change</title>
		<link>http://python.genedrift.org/2008/02/25/change/</link>
		<comments>http://python.genedrift.org/2008/02/25/change/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 20:37:48 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2008/02/25/change/</guid>
		<description><![CDATA[I changed the plugin that handles code highlighting, making possible to also change the theme. I don&#8217;t know if I let some unmodified code lingering, so if anyone see any problem, just drop me a note.
]]></description>
			<content:encoded><![CDATA[<p>I changed the plugin that handles code highlighting, making possible to also change the theme. I don&#8217;t know if I let some unmodified code lingering, so if anyone see any problem, just drop me a note.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/02/25/change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>99 problems</title>
		<link>http://python.genedrift.org/2008/02/22/99-problems/</link>
		<comments>http://python.genedrift.org/2008/02/22/99-problems/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 04:13:17 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[Crunchy]]></category>
		<category><![CDATA[Python problems]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2008/02/22/99-problems/</guid>
		<description><![CDATA[André Roberge, of Crunchy fame, is converting a list of 99 Prolog problems to Python. Check it out.
]]></description>
			<content:encoded><![CDATA[<p>André Roberge, of <a href="http://code.google.com/p/crunchy/">Crunchy</a> fame, is converting a list of 99 Prolog problems to Python. <a href="http://aroberge.blogspot.com/2008/02/99-problems-looking-for-volunteers.html">Check it out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/02/22/99-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contact form</title>
		<link>http://python.genedrift.org/2008/02/19/contact-form/</link>
		<comments>http://python.genedrift.org/2008/02/19/contact-form/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 14:02:34 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>
		<category><![CDATA[contact form]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2008/02/19/contact-form/</guid>
		<description><![CDATA[I added a contact form if anyone is interested in dropping me a note. It can be accessed from the menu above.
]]></description>
			<content:encoded><![CDATA[<p>I added a contact form if anyone is interested in dropping me a note. It can be accessed from the menu above.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2008/02/19/contact-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Splitting a FASTA file using awk (no sed required), or do we care about csplit?</title>
		<link>http://python.genedrift.org/2007/10/29/splitting-a-fasta-file-using-awk-no-sed-required-or-do-we-care-about-csplit/</link>
		<comments>http://python.genedrift.org/2007/10/29/splitting-a-fasta-file-using-awk-no-sed-required-or-do-we-care-about-csplit/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 16:37:07 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[Phase 2]]></category>
		<category><![CDATA[off topic]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2007/10/29/splitting-a-fasta-file-using-awk-no-sed-required-or-do-we-care-about-csplit/</guid>
		<description><![CDATA[We saw that &#8220;top notch bioinformaticians&#8221; use csplit to split FASTA files, so I decided to post as many as possible alternatives to split these files. As csplit, awk is something found with more frequency in Linux machines than Windows, but it can be installed on Windows (even Vista) and it runs fine. Awk is [...]]]></description>
			<content:encoded><![CDATA[<p>We saw that &#8220;<a href="http://eridanus.net/">top notch bioinformaticians</a>&#8221; use csplit to split FASTA files, so I decided to <a href="http://python.genedrift.org/2007/10/10/alternative-methods-to-split-a-fasta-file/">post as many as possible alternatives</a> to split these files. As csplit, awk is something found with more frequency in Linux machines than Windows, but it can be installed on Windows (even Vista) and it runs fine. Awk is usually shown in parallel with sed, as both utilities have the main objective of text processing.</p>
<p>I browsed the web searching for a sed/awk solution to split FASTA files something that I thought could be done in one line. And I found <a href="http://www.unix.com/shell-programming-scripting/14576-split-file-using-awk.html">it</a>. With a little tweak I ended up with a one-liner using awk that split the sequences in multiple files:</p>
<p><code>awk '/^>/{f="fasta."++d} {print > f}' <infile></code></p>
<p>Awk breaks each line of its input into fields that can be checked, printed or ignored. In the command line above. awk&#8217;s commands are in between the single quotes. The first command is a regex that matches initial <code>></code>. Inside the curly braces we assign a variable <code>f</code> to store the output filename we want and also have an integer that is incremented every time we pass through it. The second curly braces are for the actual output, where we use awk&#8217;s <code>print</code> command and redirect output to a file named after the variable we created in the first commands in between curly braces. Finally, we assign an input file, outside the region delimited by single quotes. And that&#8217;s it. As output we will have a series of files called fasta.# each one containing one sequence.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2007/10/29/splitting-a-fasta-file-using-awk-no-sed-required-or-do-we-care-about-csplit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating multiple sets of random DNA sequences with one script (and a bash example) [updated]</title>
		<link>http://python.genedrift.org/2007/10/26/generating-multiple-sets-of-random-dna-sequences-with-one-script-and-a-bash-one/</link>
		<comments>http://python.genedrift.org/2007/10/26/generating-multiple-sets-of-random-dna-sequences-with-one-script-and-a-bash-one/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 17:15:47 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[Section 4]]></category>
		<category><![CDATA[off topic]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2007/10/26/generating-multiple-sets-of-random-dna-sequences-with-one-script-and-a-bash-one/</guid>
		<description><![CDATA[A commenter, Dilmurat, gave me an idea about the script that generates random DNA sequence sets. Apparently it wasn&#8217;t clear that the script was intended to generate only one sequence set, and not multiple sets. Dilmurat also offered his solution:

#!/usr/bin/env python

import random
import sys

def simulate_sequence(length):
    dna = [&#039;A&#039;, &#039;C&#039;, &#039;G&#039;, &#039;T&#039;]
   [...]]]></description>
			<content:encoded><![CDATA[<p>A commenter, Dilmurat, gave me an idea about the <a href="http://python.genedrift.org/2007/04/04/a-script-to-simulate-dna-sequence-sets/">script</a> that generates random DNA sequence sets. Apparently it wasn&#8217;t clear that the script was intended to generate only one sequence set, and not multiple sets. Dilmurat also offered his solution:</p>
<pre name="code" class="python">
#!/usr/bin/env python

import random
import sys

def simulate_sequence(length):
    dna = [&#039;A&#039;, &#039;C&#039;, &#039;G&#039;, &#039;T&#039;]
    sequence = &#039;&#039;
    for i in range(length):
        sequence += random.choice(dna)
    return sequence

setsize = int(sys.argv[1])
minlength = int(sys.argv[2])
maxlength = int(sys.argv[3])

rlength = []
sequenceset = []
for i in range(setsize):
    rlength.append(random.randint(minlength, maxlength))

for length in rlength:
    sequenceset.append(simulate_sequence(length))

for sequence in sequenceset:
    print sequence
</pre>
<p>I don&#8217;t know if the lack of formatting in the comments might have generated a different result to me, but let&#8217;s see how we can generate multiple sets of random DNA sequence. Getting back to section 4, we can start with the original script that creates only one set</p>
<pre name="code" class="python">
#!/usr/bin/env python

import random
import sys

def simulate_sequence(length):
    dna = [&#039;A&#039;, &#039;C&#039;, &#039;G&#039;, &#039;T&#039;]
    sequence = &#039;&#039;
    for i in range(length):
        sequence += random.choice(dna)
    return sequence

setsize = int(sys.argv[1])
minlength = int(sys.argv[2])
maxlength = int(sys.argv[3])

sequenceset = []
for i in range(setsize):
    rlength = random.randint(minlength, maxlength)
    sequenceset.append(simulate_sequence(rlength))

for sequence in sequenceset:
    print sequence
</pre>
<p>There is a very easy way of changing this code to make it output a definite number of sets. WE add a new input parameter and also a loop to it, and that should take care of everything.</p>
<pre name="code" class="python">
#!/usr/bin/env python

import random
import sys

def simulate_sequence(length):
    dna = [&#039;A&#039;, &#039;C&#039;, &#039;G&#039;, &#039;T&#039;]
    sequence = &#039;&#039;
    for i in range(length):
        sequence += random.choice(dna)
    return sequence

setsize = int(sys.argv[1])
minlength = int(sys.argv[2])
maxlength = int(sys.argv[3])
nsets = int(sys.argv[4])

for i in range(nsets):
    sequenceset = []
    for i in range(setsize):
        rlength = random.randint(minlength, maxlength)
        sequenceset.append(simulate_sequence(rlength))

    for sequence in sequenceset:
        print sequence

    print
</pre>
<p>A test with 10 as the number of sequences, 20 as minimum and 30 as maximum length and 2 sets output somthing like this</p>
<p><verbatim>GAGGACGACGTGTCGGATTAGAT<br />
GCAGATAAACGGGTAAGATGA<br />
ATTAGGAAGGGTCTAAGAGATCCCGGTAA<br />
ATCAGCCTCCGCACGCCTCGTGTA<br />
AGTTTAGCTAGCCGTAGTACTTTC<br />
TTTGAAGCTCGGGGCTAAACTCCGACCAC<br />
GACAGGGTAAGGTGACCTTCTCAG<br />
TGGTTGACTCTGTTCTCTGGT<br />
CGCAATACGTCGTGGTGCCGCTCCACT<br />
TCCTGCAGGGAGGCAGCAGC</p>
<p>TTCGGAGGTATTGAGTACTGTTGCATCG<br />
CCCTTATAATACCTAGTGTAACATTC<br />
TAGTCATGTCATATAACCTGTGTCG<br />
AGCGCGAACCCTCCAGTTTTTTT<br />
AGGGCGTGTAAGCGACGTTGAACAAG<br />
CCATGCGTCTTTTTGGCGATCCGT<br />
ACTCAGATCGGCTAGTATCCTTCGCACG<br />
CTATCGTCGTTCCCAGCAACGGCAGCAGA<br />
CGTGCGATGGGGCGAGATTTTT<br />
ACGCTTTGGCTAGTGGGGAGTTTCGCCACT</verbatim></p>
<p>what is basically what we need. Quick &#8216;n&#8217; easy.</p>
<p>Of course a <a href="eridanus.net/blog/">top notch bioinformatician</a> that uses Linux 100% of the time would be able to create a simple bash script and use the initial script to generate multiple random sets. bash is not a primary scope of the blog, but let&#8217;s see how to do that. Saying the our initial script was saved as <code>randomset.py</code> we would have a very short script in bash to generate multiple sets. We want to generate 10 sets of sequences of length between 20 and 30 nucleotides, and each set would need to have 10 different sequences (remeber that our initial script only accepts 3 parameters).</p>
<p><strong>Off topic</strong></p>
<p><code>for ((i=0;i<10;i++))<br />
do<br />
    min=20<br />
    max=30<br />
    nseqs=10<br />
    python randomset.py $nseqs $min $max<br />
    echo<br />
done</code></p>
<p>That should do the trick. You can even type it from the command line. The <code>for</code> syntax in bash is very similar to C/C++ but it does not accept spaces, as all the variable assignments. When you assigning a variable value in bash you omit the dollar sign and when you are reading the variable value you access it with the dollar sign, like in the line that runs the script. A <code>for</code> loop in bash starts with a <code>do</code> command and ends in a <code>done</code> command, not brackets or parenthesis involved. The <code>echo</code> at the end helps adding a separating blank line after each random set.</p>
<p><b>off topic</b></p>
<p>Of course we could use "makenucseq from the EMBOSS package", we can even use <a href="http://http://scit.us/projects/dawg">Dawg</a> from my friend Reed Cartwright, which I believe has a shorter learning curve (and faster compilation) than EMBOSS, but that will be away from the scope of this blog, which is to show how to use <b>Python</b> in <b>simple</b> bioinformatics scripts. I allowed myself to post off topic subjects (including this last paragraph)  because a (very) small percentage of the commenter(s) seems to misunderstand the real focus of this tutorial. We don't need fancy words or complex topics to show how simple things can achieve good results in almost no time. My focus is not give the reader the fish and chips ready to eat. My focus is to show how to fish and peel, cut and fry the potato in order to cook the dish. This way, next time he or she might be cooking better things to eat.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2007/10/26/generating-multiple-sets-of-random-dna-sequences-with-one-script-and-a-bash-one/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Off topic</title>
		<link>http://python.genedrift.org/2007/10/18/off-topic/</link>
		<comments>http://python.genedrift.org/2007/10/18/off-topic/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 13:10:59 +0000</pubDate>
		<dc:creator>Paulo Nuin</dc:creator>
				<category><![CDATA[off topic]]></category>

		<guid isPermaLink="false">http://python.genedrift.org/2007/10/18/off-topic/</guid>
		<description><![CDATA[Mr Daniel Swan accused me of not publishing his comment or reply to his comments. I have never seen his reply, either in the comments or as an email to me, so to fulfill his desires it is published here. 
I admit that some of the things you have addressed in the past, whilst ‘reinventing’ [...]]]></description>
			<content:encoded><![CDATA[<p>Mr Daniel Swan accused me of not publishing his <a href="http://eridanus.net/blog/?p=233#respond">comment</a> or reply to his comments. I have never seen his reply, either in the comments or as an email to me, so to fulfill his desires it is published here. </p>
<blockquote><p>I admit that some of the things you have addressed in the past, whilst ‘reinventing’ the wheel, offer important insights into the general problems of programming in general &#8211; this particular example was not one of them. From following the course which I assume was outlined by ‘Beginning Perl for Bioinformatics’ (which I do not think is a good reference for beginning Perl at all) a user should already be able to perform the following operations &#8211; open a file, iterate over and parse the contents, open a file for writing, and apply some rules for formatting the output. Thus you have already given them the tools to complete the operation should they wish to do so in a Python context.</p>
<p>The problem is that you are trying to educate potentially early career/transitional bioinformaticians here &#8211; and showing them how to complete tasks in X lines of Python when there is a single command line application to do the trick I think is disingenuous. We wouldn’t dream, for instance, of educating our MRes students in this way.</p>
<p>I also would take issue that diversity is a key. You can be as diverse as you like but no-one is seriously going to suggest that you write your next script to parse something out of a GenBank file in assembler. One of the hallmarks of any computer professional in any field is the ability to use the right tool for the job. You should be technology agnostic and be prepared to string together applications or scripts from anywhere to reach your goal &#8211; take a look at something like Taverna for instance.</p>
<p>I notice in the other post that you mention there is a high proportion of Windows users to this site and therefore command line *nix comments are of no interest. Although I know a number of bioinformaticians who use Windows (generally to integrate with an institutions existing Microsoft heavy infrastructure) they all have logins to dozens of *nix machines, run *nix in a VM or at the very least have a Cygwin installation with which to work with. Basing the availability of technology on the OS of your page imprints is not necessarily indicative.</p>
<p>I hope you don’t mind me addressing these points here rather in my blog, as my blog is personal (hence the lack of bioinformatics content on there). I have actually been following these tutorials for a while (as someone who came into Bioinformatics some time ago &#8211; my first forays in programming were in Perl) it is nice for me to see tasks that I find intuitive in one language written in another. Consequently the fact that I felt need to comment, merely suggests that I felt strongly on this issue, rather than having any negative feelings towards what you are trying to achieve.</p></blockquote>
<p>I am sorry for the usual readers of this tutorial, for posting his comments as an article here. We will be back to our uneducated, simple and basic &#8220;tutorial for bioinformatics in X lines for the noobie in Windows&#8221; soon.</p>
<p>Thanks Daniel.</p>
]]></content:encoded>
			<wfw:commentRss>http://python.genedrift.org/2007/10/18/off-topic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

