[BioRuby] reading multiple hmmpfam reports

George Githinji georgkam at gmail.com
Fri Jan 16 12:49:29 UTC 2015


It seems the split method called from parse_header_data method of the
report class cannot parse the header file?

Here is a section of the input file.


hmmpfam - search one or more sequences against HMM database
HMMER 2.3.2 (Oct 2003)
Copyright (C) 1992-2003 HHMI/Washington University School of Medicine
Freely distributed under the GNU General Public License (GPL)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Query sequence: DD2var01a
Accession:      [none]
Description:    [none]

Scores for sequence family classification (score includes all domains):
Model                 Description                       Score    E-value  N
--------              -----------                       -----    ------- ---
HB36                                                     45.3    1.5e-11   1
HB5                                                      37.8    2.7e-09   1
HB14                                                     34.0    3.6e-08   1
HB210                                                    21.0     0.0003   1
HB79                                                     18.0    0.00057   1
HB88                                                     11.6      0.006   1
HB54                                                     10.8      0.024   1

Parsed for domains:
Model                 Domain  seq-f seq-t    hmm-f hmm-t      score  E-value
--------              ------- ----- -----    ----- -----      -----  -------
HB54                    1/1       9    23 ..     1    15 []    10.8    0.024
HB79                    1/1       9    24 ..     1    16 []    18.0  0.00057
HB14                    1/1      25    48 ..     1    24 []    34.0  3.6e-08
HB210                   1/1      44    56 ..     1    13 []    21.0   0.0003
HB5                     1/1      57    76 ..     1    20 []    37.8  2.7e-09
HB36                    1/1      78   104 ..     1    30 []    45.3  1.5e-11
HB88                    1/1     102   108 ..     1     7 []    11.6    0.006

Alignments of top-scoring domains:
HB54: domain 1 of 1, from 9 to 23: score 10.8, E = 0.024
                   *->KDLYlGnkkkdkkek<-*
                      +DLYlGn ++ k++
   DD2var01a     9    RDLYLGNPQEIKQRQ    23

HB79: domain 1 of 1, from 9 to 24: score 18.0, E = 0.00057
                   *->kDlflGnkkEkkkRkk<-*
                      +Dl+lGn++E k+R++
   DD2var01a     9    RDLYLGNPQEIKQRQQ    24

HB14: domain 1 of 1, from 25 to 48: score 34.0, E = 3.6e-08
                   *->LEenLKkIFkkIyekLkkkkkkky<-*
                      LE+nLK+IF+kIyekL ++ +++
   DD2var01a    25    LENNLKTIFGKIYEKLNGAEARYG    48

HB210: domain 1 of 1, from 44 to 56: score 21.0, E = 0.0003
                   *->kkrYGnDenFFkL<-*
                      ++rYGnD+ FFkL
   DD2var01a    44    EARYGNDPEFFKL    56

HB5: domain 1 of 1, from 57 to 76: score 37.8, E = 2.7e-09
                   *->RedWWeanrkdiWkaMlCal<-*
                      RedWW+anr+ +Wka++C +
   DD2var01a    57    REDWWTANRETVWKAITCNA    76

HB36: domain 1 of 1, from 78 to 104: score 45.3, E = 1.5e-11
                   *->gakYFRaTCgdsgggsqtknkCRCndgdvp<-*
                      g++YF+aTC   + g +tk++CRCnd++vp
   DD2var01a    78    GNTYFHATC---NRGERTKGYCRCNDDQVP    104

HB88: domain 1 of 1, from 102 to 108: score 11.6, E = 0.006
                   *->qvPtYFD<-*
                      qvPtYFD
   DD2var01a   102    QVPTYFD    108

//


On Fri, Jan 16, 2015 at 3:28 PM, Naohisa GOTO
<ngoto at gen-info.osaka-u.ac.jp> wrote:
> Hi George,
>
> The error may depend on the input data.
> Showing the data file contents, hmmer version, and command-line options
> may help to solve the problem.
>
> Naohisa Goto
> ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org
>
> On Fri, 16 Jan 2015 12:24:24 +0300
> George Githinji <georgkam at gmail.com> wrote:
>
>> 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
>
>



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


More information about the BioRuby mailing list