Bioinformatics forum: topic

This is a public forum

perl vs. python

Eva Amsen

Thursday, 22 May 2008 21:55 UTC

My only Bioinformatics experience is as a user. I’ve TA-ed a course for 4th year Biochemistry students where they learn how to visualize proteins, make phylogenetic trees, sequence logos, alignments, etc. and have to understand how the programs work at a very basic level (eg. what is Hidden Markov Model)

I’d like to learn the other end of the field and want to teach myself a useful programming language. I’ve been leaning towards Python after several people’s input, but I know that Perl is more established in bioinformatics. Would I be able to be of any use if I knew only Python? Would I be behind the times if I knew only Perl? Is either one harder to pick up after knowing only the other?

If you had the choice to learn one of these languages from scratch, which would you pick?

(I feel the same way as when I had the choice between learning to ski or learning to snowboard.)

  • Replies

    Post a reply
    • There is no hard answer. No language is perfect. But here is a breakdown of language and the domain specific languages, coming from personal experience:

      If you want to compile biological data (numeric) for further analysis any scripting language will do. But perl has obvious advantage of having the largest amount of reuseable code.

      If you want to go into algorithm development learn C, C++ and if possible Java.

      If you want to go into graphical tools (graph visualization, microarray, systems biology), go for Java and R.

      Bottom line is, if you are interested in biological question and are not interested in software development learn the simplest language possible. Go to perl, python and Ruby sites and look for example code and see which one you like better.

    • @paulo

      Why you would not agree with “perl6 is around the corner”?

    • “In early 2007 Jesse Vincent, the Perl 6 Project Manager said, ‘The Perl 6 project has no schedule … one doesn’t want to rush a largely volunteer effort to design and implement a worthy successor to Perl 5.’”

      Perl 6 has been “around the corner” for a couple of years already, being optimistic.

    • @Paulo

      You can use Perl6 right now. But the implementation is in Haskell. Look at Pugs (http://www.pugscode.org/).

    • I know, just not “officially” released, right? Maybe in a couple of years …

    • You will be more productive and be so sooner in Python than in Perl and you will subsequently find it easier to maintain your code.

    • Okay, I’ve decided: Python
      What pushed me into my final decision was this course

      I can easily follow along with it (all the non-programming parts are exactly what I’ve been TA-ing for 4 years, and I already have the required Mount textbook) and they use Python.

    • Hi Eva,

      I respect every one’s opinion here. Please read my comments on all languages:

      PHP
      -
      a) Pros

      1)Easier to learn, use and deploy.
      2)Good web frameworks like Kohana and CakePHP
      3)Good ORM like Doctrine

      b) Cons

      1)Very few modules for Bioinformatics/scientific usage. ( Eg: No PCA analyis, Gene expression modules)

      Perl
      --
      a) Pros

      1)You can achieve most things in perl.
      2)Vast library support for bioinformatics/general use (BioPerl, CPAN)
      3)Catalyst web framework and DBI::X for databases

      b) Cons
      1)Looks ugly and needs proper coding style to maintain larger code.
      2)TIMTOWTDI
      3)Average OOP support

      Python
      -——
      a) Pros

      1)Enforces good coding style, which makes code clean and maitainable
      2)Easy to extend (C/C++)
      3)Powerful OOP capabilities
      4)Superior quality libraries (even though less in no than perl) for
      bioinformatics, general usage (Eg. PyMoL > PerlMol, Pybel (no perl
      equivalent), Numpy, Scipy etc)
      5)Best web frameworks compared to other languages like Django, Pylons, Web2py
      6)Ultimate ORM of any language – SQLAlchemy

      b) Cons

      1)Slow in execution
      (but this is not a problem as we can use Psycho/pypy modules to speed up.
      Also, the project unladen shallow makes python run at 5x times than the
      current implementation)

      2) User can get lost with options available in web application frameworks.
      For example, overwhelming libraries come with Zope and a lot of options to
      choose the various components for Pylons.(Many people who don’t like Django
      ORM move to pylons/Zope and get lost with other details)

      Java
      --

      a) Pros

      1)Great language with good speed
      2)Superior quality libraries
      3)JRE plug-in for browsers

      b) Cons

      1)Overly verbose and hence tedious to code
      2)Numerous web frameworks and ORM/DAL choices and hence choices hugely vary
      between different groups developing applications. Also, sometimes hard to
      put all we want in one umbrella due to lot of configuration settings.

      Conclusion:
      -———-

      The choice of language use in bioinformatics essentially boils down to 5 facts:
      a) Easier to code, maintain and extend
      b) Superior bio/general libraries with simple usage (good abstraction needed)
      c) Fast processing speed
      d) Mining data in a simple and efficient way (using ORMs)
      e) Making graphics, general and web apps with ease.

      • May be python is the way to go. ********************

      (We could have very well adopted Ruby and RAILS, if it had speed, enough libraries, consistency and security fixes. But, this is still 4 years away story. By then python 3.0 will sweep all.)

      Cheers,
      HeMan

    • “Java

      a) Pros

      1)Great language with good speed"

      Delusional. Java and “good speed” in the same phrase.

    • Dear Paulo,

      Really Java is fast. Please check the below link. has interesting comments too…

      http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/

      Cheers,
      HeMan

    Post a reply

Search forums Advanced search

web feed

Submit this topic to

Advertisement