[BioRuby-cvs] bioruby/lib/bio/appl/blast format8.rb,1.7,1.8
Katayama Toshiaki
k at dev.open-bio.org
Fri Dec 14 16:15:22 UTC 2007
Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv23172/lib/bio/appl/blast
Modified Files:
format8.rb
Log Message:
* fixed a bug that two lines of same target with diffrent queries are
come in continuously, the parser failed to create an new Hit object.
Index: format8.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/format8.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** format8.rb 5 Apr 2007 23:35:39 -0000 1.7
--- format8.rb 14 Dec 2007 16:15:20 -0000 1.8
***************
*** 2,6 ****
# = bio/appl/blast/format8.rb - BLAST tab-delimited output (-m 8) parser
#
! # Copyright:: Copyright (C) 2002, 2003 Toshiaki Katayama <k at bioruby.org>
# License:: The Ruby License
#
--- 2,6 ----
# = bio/appl/blast/format8.rb - BLAST tab-delimited output (-m 8) parser
#
! # Copyright:: Copyright (C) 2002, 2003, 2007 Toshiaki Katayama <k at bioruby.org>
# License:: The Ruby License
#
***************
*** 23,26 ****
--- 23,27 ----
@query_id = @query_def = data[/\S+/]
+ query_prev = ''
target_prev = ''
hit_num = 1
***************
*** 30,34 ****
ary = line.chomp.split("\t")
query_id, target_id, hsp = tab_parse_hsp(ary)
! if target_prev != target_id
hit = Hit.new
hit.num = hit_num
--- 31,35 ----
ary = line.chomp.split("\t")
query_id, target_id, hsp = tab_parse_hsp(ary)
! if query_prev != query_id or target_prev != target_id
hit = Hit.new
hit.num = hit_num
***************
*** 42,45 ****
--- 43,47 ----
hsp_num += 1
hit.hsps.push(hsp)
+ query_prev = query_id
target_prev = target_id
end
More information about the bioruby-cvs
mailing list