show the contents and class of the DNA sequence object
p ambiguous_seq # => “atgcyrwskmbdhvn”
p ambiguous_seq.class # => Bio::Sequence::NA
convert the sequence to a Regexp object
p ambiguous_seq.to_re # =>
/atgc[tc][ag][at][gc][tg][ac][tgc][atg][atc][agc][atgc]/
p ambiguous_seq.to_re.class # => Regexp
example to match an ambiguous sequence to the rigid sequence
att_or_atc = Bio::Sequence::NA.new(“aty”).to_re
puts “match” if att_or_atc.match(Bio::Sequence::NA.new(“att”))
if Bio::Sequence::NA.new(“atc”) =~ att_or_atc
puts “also match”
end
without any problems.
After this I run it with Java and I have got following problem:
jrubyc s01.rb an then java -cp /home/mitlox/jruby-1.4.0/lib/jruby.jar:.
s01
Exception in thread “main” s01.rb:3:in `require’: no such file to load
– bio (LoadError)
from s01.rb:3
…internal jruby stack elided…
from Kernel.require(s01.rb:3)
from (unknown).(unknown)(:1)
In JRuby, whether you run from .class files or .rb files, your
application code will eventually run as JVM bytecode. There’s no need
to compile to .class files to get better performance from JRuby.