Bio-Python

"Ramblings on computational chemistry, in silico experiments and programming in python 3.x"

April 18, 2013

Exploratory programming using iPython

Python is an interactive shell for the Python programming language.
iPython offers several additional and useful options:
  • Better introspection
  • Additional shell syntax (magic commands that begin with % sign)
  • Tab completion
  • allows to record history
To install iPython visit : ipython.org/install

iPython has following three interfaces:



In linux terminal type "ipython qtconsole". This will launch a new Qt based window, similar to teminal.


The following magic functions are currently available: (These commands can also be found by typing %quickref in iPython shell)

April 8, 2013

Why Bio-python is not active recently?

If you visit Bio-Python regularly, you would have noticed that recently there are no new posts on this blog. I am recently contributing my spare time to develop "PlaySeeBow.com" and related android application "Prescribd". Playseebow is under pilot studies and will be unraveled for access to masses.

Don't worry, Bio-Python isn't going away.;Once Playseebow is up and running, posts will commence once again.

February 28, 2013

Python 3: Filter function and list comprehensions

Many of you who are familiar with python 2 and have switched to python 3 may already know that functions (filter, map, range etc.) that returned a list no longer do so. In python 3, these functions return an iterator.
In case you wish to use filter, map etc. and get a list in python 3, you have two techniques at your disposal, namely:
  1. Wrap the iterator around list( ) 
  2. Use list comprehensions instead

Wrapping the iterator around list

The following snippets returns all even numbers upto but not including 10.

Using list comprehension technique

We can modify the above program to do the same task but using more familiar list comprehension method.

This also gives us all even number upto but not including 10.

Leave a comment explaining how there two coding styles differ in efficiency and readability?