Posts

Nostalgia

Years have passed since my last blog entry, and curious paths are always leading your life as I was here and there, moving from academia to industry and back to academia. A full pandemic (still hitting) has occurred ... I was sure to move to the Queen's land (now King's), but somehow that never happened, and looking for a new adventure (care what you wish) I got a new one ... Adapting to a new environment and language but still doing great science. A funny thing happened a few weeks ago, I was suggested to take some courses to use a subscription to a learning platform, I chose a refresh on genome stats, and even when the first part was somewhat hard, they put a big smile on my face when I see a post of this blog as part of the intro materials!!! I always believed my impact on papers and teaching was indeed positive, but finding that this material was extended beyond my direct touch was amazing. So, I honor this blog writing one more time, I will reconsider writing again if I fe

Año 2018

Tres años sin escribir, pero me tomo 5 min para desoxidar este blog (desempolvar ya se queda corto). Muchos proyectos en marcha, todo avanza bien al parecer, sigo igual (o peor) de geek y nerd, ya no doy clases pero me entretengo procesando datos y programando a lo bestia (incluso le he encontrado sabor a Python pero Perl sigue siendo mi fuerte). En fin, sigamos otro rato.

2015

Pues ya es 2015 (felicidades a quienes deseen recibir una felicitación por el cambio de año). Después de mucho tiempo sin publicar y en espera de que varios procesos acaben, me doy a la tarea de desempolvar un poco este blog. No puedo detallar mucho de los proyectos que tengo en curso pero son varios y muy interesantes, pero dado que en este blog escribo más sobre Linux, este es mi estado actual de sistemas: 1. Mi netbook cumple 5 años y sigue dando batalla, ayer actualice (más bien reinstale) a Fedora 21 - XFCE, hice varios ajustes a como tenía particionado el disco duro, pero fuera de ahí todo normal. Incluso varias cosas se instalaron más facilmente quen la 20 (Skype, Dropbox). 2. Mi workstation está con un Ubuntu 14.04, sigo sin tener mucha preferencia por esa distro pero para las clases los sistemas en las aulas son Ubuntus, por lo que me facilita mucho que pueda probar los ejercicios. Mi mayor queja es en la instalación poco ortodoxa de algunos paquetes y una alta tasa de e

Real time hacking

Image
This is a really cool (but scary) real time tracking of hacking intents worldwide by the HoneyNet Project team: http://map.honeycloud.net/

Programming challenge - synthetic whole genome vcf

I found in BioStar an nice programming challenge to produce an alternative VCF file from a complete genome sequence (the motivation to have such file is a mystery to me), anyway, I and many others produce a solution in C, Python, Perl and even AWK. As expected the C solution is the faster (but longest code), surprisily Python is really close in speed and really compact. My Perl wasn't bad, but is still a little slow. Here is my final code after reducing the initial solution: print join "\t" , '#CHROM' , 'POS' , 'ID' , 'REF' , 'ALT' , 'QUAL' , 'FILTER' , 'INFO' ; print "\n" ; % a = ( 'A' => 'C,G,T' , 'C' => 'A,G,T' , 'G' => 'A,C,T' , 'T' => 'A,C,G' ); while (<>) { chomp ; if ( m />(.+)/) { $chr = $1 ; $i = 0 ; } else { @a = split ( //, uc $_); foreach $b ( @a ) {

Selecting N random lines from a text file (Perl)

In many situations I need to sample a few lines from a big file, the basic approach is to take just the first N lines in the file, but that isn't correct, a real sampling needs a random selection of points to avoid some bias. Here is my solution in the Perl language: #!/usr/bin/perl =head1 NAME randomLines.pl =head1 DESCRIPTION Subsample some random lines from a text file. =head1 USAGE perl randomLines.pl [PARAM] Parameter Description Value Default -i --in Input file File STDIN -o --out Output file File STDOUT -n --num Number of lines to sample Integer 1000 -t --total Total lines in file Integer 1000000 -f --first Include first line Bool No -h --help Print this screen and exit -v --verbose Verbose mode --version Print version number and exit =head1 EXAMPLES 1. S

Moving to Fedora

After many years using Mandriva (even when it was Mandrake), I finally move my personal systems to Fedora . I always consider Mandriva an excellent Linux distribution, really easy to install and use (even more than Ubuntu), but the current situation of Mandriva (please google-it) gave me the signals to move on. My current situation is developing (Perl, C, R) using my Mac with Snow Leopard, but all my heavy work runs on linux servers (real and cloud) mainly CentOS, so I decided to keep me in the RedHat family. Besides my iMac, I own an Asus 1000HA netbook and an Acer Aspire 5517 laptop. First I tried Fedora 16 in the netbook, the XFCE remix, it works wonderful considering the low power of a netbook. This week I installed Fedora17 in the Acer, after a quick installation I'm using it o write this post. I have no complains with the last Gnome release, actually I like it, it's pretty. I only had a hardware problem, the wireless card, but amazingly after checking the status with dm