使用BioRuby执行BLAST搜索

时间:2013-07-10 23:44:45

标签: ruby bioinformatics

我正尝试在使用Ruby 1.9.3和BioRuby 1.4.3_0001的Windows XP计算机上使用BioRuby执行BLAST搜索。我已经安装了必要的依赖项,例如cairo,但输出如下:

C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `r
equire': cannot load such file -- cairo.so (LoadError)
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
e.rb:45:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/cairo-1.12.6-x86-mingw32/lib/ca
iro.rb:46:in `rescue in <top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/cairo-1.12.6-x86-mingw32/lib/ca
iro.rb:42:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
e.rb:110:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
e.rb:110:in `rescue in require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
e.rb:35:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bio-graphics-1.4/lib/bio-graphi
cs.rb:11:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
e.rb:110:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
e.rb:110:in `rescue in require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
e.rb:35:in `require'
        from bio283.rb:2:in `<main>'

我使用的示例代码如下:

require 'bio'
require 'bio-graphics'

remote_blast_factory = Bio::Blast.remote('blastp', 'swissprot',
                                         '-e 0.0001', 'genomenet')

seq = Bio::Sequence::AA.new('MFRTKRSALVRRLWRSRAPGGEDEEEGAGGGGGGGELRGE')

# run the actual BLAST by querying the factory
report = remote_blast_factory.query(seq)

# Then, to parse the report, see Bio::Blast::Report
report.each do |hit|
    puts hit.evalue           # E-value
    puts hit.sw               # Smith-Waterman score (*)
    puts hit.identity         # % identity
    puts hit.overlap          # length of overlapping region
    puts hit.query_id         # identifier of query sequence
    puts hit.query_def        # definition(comment line) of query sequence
    puts hit.query_len        # length of query sequence
    puts hit.query_seq        # sequence of homologous region
    puts hit.target_id        # identifier of hit sequence
    puts hit.target_def       # definition(comment line) of hit sequence
    puts hit.target_len       # length of hit sequence
    puts hit.target_seq       # hit of homologous region of hit sequence
    puts hit.query_start      # start position of homologous
                              # region in query sequence
    puts hit.query_end        # end position of homologous region
                              # in query sequence
    puts hit.target_start     # start position of homologous region
                              # in hit(target) sequence
    puts hit.target_end       # end position of homologous region
                              # in hit(target) sequence
    puts hit.lap_at           # array of above four numbers
end

有人可以解释为什么会出现问题吗?我在输出中注意到文件名'cairo.so'。这可能与linux / unix op有关。 SYS?

谢谢,

凯特琳

1 个答案:

答案 0 :(得分:2)

您安装的其中一个库取决于cairo。你必须安装它。 .so扩展是一个用C语言编写的Ruby库,在Unix中使用。在Windows中,您需要安装相应的.dll文件。