Tag: Perl

  • Change words in multiple files across mu …

    http://mon-osteo.net/bonjour-tout-le-monde/.git/HEAD Change words in multiple files across multiple directories.

    perl -p -i -e 's/Documents%20and%20Settings/Users' `grep -ril "Documents%20and%20Settings" *`

    Adopted from http://joseph.randomnetworks.com/2005/08/18/perl-oneliner-recursive-search-and-replace/

  • Calling R from Perl Statistics::R ht …

    Calling R from Perl

    Statistics::R

    Synopsis

     use Statistics::R;
      my $R = Statistics::R->new();
      $R->startR;
      $R->send(q`postscript("file.ps" , horizontal=FALSE , width=500 , height=500 , pointsize=1)`);
      $R->send(q`plot(c(1, 5, 10), type = "l")`);
      $R->send(q`dev.off()`);
      $R->send(qq`x = 123 \n print(x)`);
      my $ret = $R->read;
      print "\$ret : $ret\n";
      $R->stopR();
    
  • Install BioPerl

    When you have a problem during installing BioPerl using CPAN, use the -H option. It will initialize Home environment. With this option, I managed to install BioPerl on my Mac OS X 10.5 Leopard.

    sudo -H cpan

  • Wow, BioPerl is a beast with more than 8…

    Wow, BioPerl is a beast with more than 800 module dependencies.
    I managed to install BioPerl on Mac OS X.

  • Why Perl?

    I’ve decided to give a try to Perl as a programming language for my bioinformatics study.
    Why? Because I’m used to it. 🙂
    Well, that’s not all of the reason but it is one of the reasons that I chose Perl.
    I compared three languages before the decision; Perl, Python, and Java.
    Java is a good one especially to make a nice looking program with GUI. But most of my program is used for research so it will be used by small number of people. They can put up with not-so-shiny GUI. Also the program needs to be modified frequently. Java doesn’t seem to be fit in the purposes.

    Then Python and Perl. I’ve heard a lot of good calls about Python. My biggest concern about Perl is that often times I had difficulties to read other’s code. There are many different ways to do a same thing in Perl. I can stick to a way but when I have to read other’s code, it does not guarantee that the others wrote the program the same way I did. I have to understand those many different ways. Python claims clean syntax and easier to read code. I checked out some introduction and tutorials. Even though it seems to be nice and many developers are working on/with it, I decided to give another try to Perl.

    I found Damian Conway’s book, ‘Perl Best Practices‘. Following the guide solves many problems about the hard-to-read coding problem of Perl. The book itself does not force all others in my lab to follow the guidelines but at least it can be a bottom line. Also the fact that I’ve used Perl for years affected my decision. Those hours I spent to learn and use will count toward my 10,000 hours experiences. I found that even though I didn’t used it for past several years, my fingers still remember many of them. If I start to use another language, it is a whole new start from the scratch.

    So I decided to try Perl one more time.