Protocol Online logo
Top : New Forum Archives (2009-): : Be a Geek

Which programming language for bio-sci? - (Jul/12/2010 )

Pages: 1 2 Next

Hello,
Having a little bit more free time on my hands, at least for now, I'm thinking about starting to learn some programming language. My idea is to use it for writing small dedicated programs to help with my lab work and perhaps some DIY/home improvement/"gadget hacking"/"mad scientists" stuff. Which one would you advise me to learn?

-K.B.-

Perl.

-HomeBrew-

Hi HomeBrew,
I heard there is also Bio-Perl... which is better? I'm a total noob in programming....but i wish to learn.
<_<

-adrian kohsf-

BioPerl is a collection of Perl modules written to facilitate bioinformatics programming in Perl. The modules themselves are written in Perl. A Perl module is just a pre-written piece of code that one can call from within their main program to perform a function, thus saving the Perl programmer from having to re-invent the wheel.

For example, if in my Perl program I wanted to get information from a BLAST results file, I could write my own Perl code to parse this file and return all the various pieces of data for me, or I could just use the appropriate BioPerl module, e.g.:

#!/usr/bin/perl -w
use strict;
use Bio::SearchIO; # This line loads the BioPerl module SearchIO

my $in = new Bio::SearchIO(-format => 'blast', -file => "your_favorite_file.blast");

while (my $result = $in->next_result) {
while (my $hit = $result->next_hit) {
while (my $hsp = $hit->next_hsp) {
print "Hit name: " . $hit->name . "\n";
print "HSP start (hit): " . $hsp->start('hit') . "\n";
print "HSP end (hit): " . $hsp->end('hit') . "\n";
print "HSP start (query): " . $hsp->start('query') . "\n";
print "HSP end (query): " . $hsp->end('query') . "\n";
print "HSP length: " . $hsp->hsp_length . "\n";
print "number of identical residues: " . $hsp->num_identical . "\n";
print "number of conserved residues: " . $hsp->num_conserved . "\n";
print "strand: " . hit->strand . "\n";
print "sequence of hit: " . $hsp->hit_string . "\n";
}
}
}

-HomeBrew-

I worked as a developer before going into bio. Although I love perl, I cannot recommend it. Go with python. Much clearer syntax, and so many systems comes with python api these days.

-Thensome-

That may be (clearer syntax, etc.) but take a look at the bioinformatic journals -- if code is released, it's usually in Perl... So, while Python may be a technically superior language in your opinion, Perl is much more widely used in bioinformatics, thus learning it is more beneficial.

But, in any event, it's got to be Perl, Python, or Ruby, if you're looking for a scripting language...

-HomeBrew-

HomeBrew on Jul 13 2010, 01:35 AM said:

That may be (clearer syntax, etc.) but take a look at the bioinformatic journals -- if code is released, it's usually in Perl... So, while Python may be a technically superior language in your opinion, Perl is much more widely used in bioinformatics, thus learning it is more beneficial.

But, in any event, it's got to be Perl, Python, or Ruby, if you're looking for a scripting language...


o_O
==''

Perl, Ruby, Phyton, Bioperl... is endless... I wish I learn at least one of this...

Any idea or good books (Perl for dummies???) I can begin with?
LOL

-adrian kohsf-

adrian kohsf on Jul 12 2010, 07:51 PM said:

Any idea or good books (Perl for dummies???) I can begin with?



Well, the classic starting book for Perl is Programming Perl, aka "the Camel book", now in its 3rd edition. This is a comprehensive book, covering all aspects of Perl. One of the authors, Larry Wall, is the creator of Perl.

For a quick-start on bioinformatics in particular, Beginning Perl for Bioinformatics is pretty good too, but a bit dated.

-HomeBrew-

Thanks ya.

-adrian kohsf-

I agree with HomeBrew that perl is the right one to start with. Of course if you want to create some web based applications, php is another laugauge you must learn. The good news is that once you know perl or any programming language, learn other languages is a piece of cake.

-pcrman-
Pages: 1 2 Next