[BioRuby] reading multiple hmmpfam reports

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Fri Jan 16 08:36:27 UTC 2015


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



More information about the BioRuby mailing list