Michael Barton RSS

Archive

Jul
22nd
Tue
permalink
Jun
19th
Thu
permalink
Jun
18th
Wed
permalink
Jun
16th
Mon
permalink
permalink
Jun
3rd
Tue
permalink

Example bioinformatics data validations

validates_true_for :alignment, :logic => lambda {

  re = Regexp.new(/\d+\s\d+/) ! re.match(alignment) },

  :message => 'Alignment field should not contain alignment count and length'

validates_format_of :alignment,

  :with => /F(Y[A-Z]{2}\d{3}[CW](-[AB])?)/,

  :message => 'Alignment should contain an S. cerevisiae gene'

permalink

Example bioinformatics log file

W, [2008-06-03T11:29:39.719022 #29112]  WARN — : Load gene: Q0075 is not a valid coding ORF


W, [2008-06-03T11:29:40.642888 #29112]  WARN — : Load alignment: No yeast ORF found in MYBR098W alignment


W, [2008-06-03T11:29:42.254248 #29112]  WARN — : Load alignment: YDR474C is not a verified ORF


W, [2008-06-03T11:29:42.585707 #29112]  WARN — : Load alignment: YER087C-A is not a verified ORF

May
29th
Thu
permalink
permalink
May
19th
Mon
permalink

Simple Ruby markdown script using BlueCloth and RubyPants

#!/usr/local/bin/ruby

require 'rubygems'
require 'bluecloth'
require 'rubypants'

puts RubyPants.new(BlueCloth.new(File.open(ARGV.shift).read).to_html).to_html