[BioRuby] bio blast
George Githinji
georgkam at gmail.com
Wed Jan 30 12:01:46 UTC 2008
Hello ,
Am running this code on ruby 1.8.6, bioruby 1.2.1 on a windows xp platform,
require 'bio'
#seq_to_blast =
"DIADIIRGKDLYLGDQERKQHLEKRLETMFEKIQKNNNNKLSNLSTKEVREYWWALNRDQVWKAITCDAGAADEYFKKSGKLEFEFTGGQCGRDGENVPTYLDYVPQFFR"
#program = "blastp"
db = "f:/var_blast_datasets/Kenyan_field_var_PR.txt"
factory = Bio::Blast.new("blastp","#{db}","-m 0", "local")
result = factory.query
('DIADIIRGKDLYLGDQERKQHLEKRLETMFEKIQKNNNNKLSNLSTKEVREYWWALNRDQVWKAITCDAGAADEYFKKSGKLEFEFTGGQCGRDGENVPTYLDYVPQFFR')
result.each do |hit|
puts hit.bit_score # bit score (*)
puts hit.query_seq # query sequence (TRANSLATOR'S NOTE:
sequence of homologous region of query sequence)
puts hit.midline # middle line string of alignment of
homologous region (*)
puts hit.target_seq # hit sequence (TRANSLATOR'S NOTE: sequence
of homologous region of query sequence)
puts hit.evalue # E-value
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.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.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
But instead i get this error:
C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast/format8.rb:70:in
`tab_parse_hsp': undefined method `strip' for nil:NilClass (NoMethodError)
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast/format8.rb:32:in
`tab_parse'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast/format8.rb:30:in
`each'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast/format8.rb:30:in
`tab_parse'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast/report.rb:71:in
`auto_parse'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast/report.rb:89:in
`initialize'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast.rb:232:in
`new'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast.rb:232:in
`parse_result'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast.rb:246:in
`exec_local'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast.rb:212:in
`send'
from C:/ruby-1.8.6/ruby/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/appl/blast.rb:212:in
`query'
from F:/Netbeans_folder/vargene/lib/bio_blast.rb:8
Where could i be messing up?
Thank you.
More information about the BioRuby
mailing list