[BioRuby] reading multiple hmmpfam reports

George Githinji georgkam at gmail.com
Fri Jan 16 09:24:24 UTC 2015


Many thanks for the clarification!

There is a little bit more complain from the report class. Not sure why.

Users/george/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bio-1.4.3.0001/lib/bio/appl/hmmer/report.rb:267:in
`parse_header_data': undefined method `split' for nil:NilClass
(NoMethodError)
    from /Users/george/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bio-1.4.3.0001/lib/bio/appl/hmmer/report.rb:165:in
`initialize'
    from /Users/george/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bio-1.4.3.0001/lib/bio/appl/hmmer/report.rb:66:in
`new'
    from /Users/george/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bio-1.4.3.0001/lib/bio/appl/hmmer/report.rb:66:in
`block in reports'
    from /Users/george/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bio-1.4.3.0001/lib/bio/appl/hmmer/report.rb:64:in
`each_line'
    from /Users/george/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bio-1.4.3.0001/lib/bio/appl/hmmer/report.rb:64:in
`reports'
    from /Users/george/Code/Ruby/parse_hmmpfam.rb:13:in `<main>'


On Fri, Jan 16, 2015 at 11:36 AM, Naohisa GOTO
<ngoto at gen-info.osaka-u.ac.jp> wrote:
> Hi,
>
> This is caused by a bug of file load order by "require".
>
> A workaroud is to add the following lines on top of the script.
>
>  require 'bio'
>  require 'bio/appl/hmmer'
>  require 'bio/appl/hmmer/report'
>
> Naohisa Goto
> ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org
>
>
> On Thu, 15 Jan 2015 18:43:05 +0300
> George Githinji <georgkam at gmail.com> wrote:
>
>> With bioruby version 1.4.3.0001, I am not sure what is causing the no
>> method error with this code taken from the example code.
>>
>> Running the code below gives a NoMethodError.
>>
>> undefined method `reports' for Bio::HMMER::Report:Class (NoMethodError)
>>
>> file = ARGV[0] # a hmmpfam text file with multiple results
>>
>> Bio::HMMER.reports(File.read(file)) do |report|
>>   report.program['name']
>>   report.parameter['HMM file']
>>   report.query_info['Query sequence']
>>   report.hits.each do |hit|
>>     hit.accession
>>     hit.description
>>     hit.score
>>     hit.evalue
>>     hit.hsps.each do |hsp|
>>       hsp.accession
>>       hsp.domain
>>       hsp.evalue
>>       hsp.midline
>>     end
>>   end
>> end
>>
>>
>> --
>> ---------------
>> Sincerely
>> George
>> Skype: george_g2
>> Blog: http://www.biorelated.com/
>> Twitter: http://twitter.com/#!/george_l
>> _______________________________________________
>> BioRuby Project - http://www.bioruby.org/
>> BioRuby mailing list
>> BioRuby at mailman.open-bio.org
>> http://mailman.open-bio.org/mailman/listinfo/bioruby
>



-- 
---------------
Sincerely
George
Skype: george_g2
Blog: http://www.biorelated.com/
Twitter: http://twitter.com/#!/george_l


More information about the BioRuby mailing list