Saturday, May 31, 2008

PHD Comics

Multi-tasking? A PhD must have ...

Friday, May 30, 2008

GBK parser

Last day, le Jacou asks me about the GenBank format, because he is writing a parser for this to integrate in his super-shining-colorfull-visual man-see annotation interface, so he needs a parser to split the file by sequences, each one will be in a separate HTML file. Later he show me his code in C# and after I think how it can be translate in Perl, I suggest:

#!/usr/bin/perl -w

# Juan Caballero @ 2008

$ARGV[0] or die "Usage: parseGBK2HTML \n";

use CGI qw(:standard);
use BIO:SeqIO;

my $file_in = shift @ARGV;
my ($seq_in, $seq_out, $file_out, $seq, $features);

$seq_in = Bio::SeqIO->new(-format=>'genbank', -file=>$file_in);
while ($seq = $seq_n->next_seq() ) {
$file_out = $seq->accession_number;
$file_out .= '.html';
$features = $seq->get_SeqFeatures;
open OUT, ">$file_out" or die "Cannot open $file_out";
print OUT header, start_html("$file_out");
print OUT p($features);
print OUT end_html;
close OUT;

Good: less code, easy to understand, parser is controlled by BioPerl::SeqIO, HTML output is controlled by CGI.
Bad: require 2 modules, maybe modules make slow the routine, can not control the output in get_SeqFeatures, but you can build your own calling the objects inside $seq, it needs some eval points.

That's why I love Perl.

Monday, May 12, 2008

Relations in OS

From here:

Friday, May 9, 2008

Working with Mac

This weeks had been a transition, new home, new work, new projects. All things are a little different, this week finally I got a computer to work and it's a Mac, its name is Broadcast. Many times I had used the Mac, specially from OS X, now I need to use it every day.

The Unix inside is working great, all is simply and pretty, and the best is the 24" screen, larger than my old TV, my software selections are:
  • Web browser: Mozilla Firefox
  • Multichat: Adium
  • Text edit: jEdit
  • RSS reader: Vienna
  • Seqs Tools: eBioX
  • CHM Reader: Chmox
  • FTP Client: Fetch
  • Screensaver: Tron/RedPill
I miss Linux, but many server and clusters are Linux-based, so I use my Mac to connect with it.

Maybe later I try Xcode to develop some application for Mac.