[BioRuby] Ruby speed

Yannick Wurm yannick.wurm at unil.ch
Tue Nov 3 14:11:52 UTC 2009


Hi,

this is a more general ruby question, but since my application is  
bioinformatics, I'm posting it here.

Just wanted to prepend a few characters in front of FASTA identifiers.


$time cat clustering/dirsForAssembly/singlets.fasta | ruby -pe "gsub(/ 
^>/, '>MyPrefix')" > abc
	real	0m20.379s
	user	0m0.741s
	sys	0m0.168s


While the perl equivalent is one heck of a lot faster!!!


$time cat clustering/dirsForAssembly/singlets.fasta | perl -p -i -e 's/ 
^>/>MyPrefix/g' > ab
	real	0m2.165s
	user	0m0.266s
	sys	0m0.146s


Is there any hope for ruby?

Thanks,
yannick


--------------------------------------------
           yannick . wurm @ unil . ch
Ant Genomics, Ecology & Evolution @ Lausanne
    http://www.unil.ch/dee/page28685_fr.html





More information about the BioRuby mailing list