3 # BioPerl module for Bio::Tools::HMMER::Domain
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Ewan Birney <birney@sanger.ac.uk>
9 # Copyright Ewan Birney
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Tools::HMMER::Domain - One particular domain hit from HMMER
21 Read the Bio::Tools::HMMER::Results docs
25 A particular domain score. We reuse the Homol SeqFeature system
26 here, so this inherits off Homol SeqFeature. As this code
27 originally came from a separate project, there are some backward
28 compatibility stuff provided to keep this working with old code.
30 Don't forget this inherits off Bio::SeqFeature, so all your usual
31 nice start/end/score stuff is ready for use.
35 Ewan Birney, birney@ebi.ac.uk
39 Jason Stajich, jason@bioperl.org
43 The rest of the documentation details each of the object
44 methods. Internal methods are usually preceded with a _
49 package Bio
::Tools
::HMMER
::Domain
;
51 use Bio
::SeqFeature
::Generic
;
55 use base
qw(Bio::SeqFeature::FeaturePair);
58 my($class,@args) = @_;
59 my $self = $class->SUPER::new
(@args);
61 $self->{'alignlines'} = [];
63 my $hmmf1 = Bio
::SeqFeature
::Generic
->new(@args);
64 my $hmmf2 = Bio
::SeqFeature
::Generic
->new(@args);
66 $self->feature1($hmmf1);
67 $self->feature2($hmmf2);
72 =head2 add_alignment_line
74 Title : add_alignment_line
75 Usage : $domain->add_alignment_line($line_from_hmmer_output);
76 Function: add an alignment line to this Domain object
80 Adds an alignment line, mainly for storing the HMMER alignments
81 as flat text which can be reguritated. You're right. This is *not
82 nice* and not the right way to do it. C'est la vie.
86 sub add_alignment_line
{
89 push(@
{$self->{'alignlines'}},$line);
92 =head2 each_alignment_line
94 Title : each_alignment_line
95 Usage : foreach $line ( $domain->each_alignment_line )
96 Function: reguritates the alignment lines as they were fed in.
97 only useful realistically for printing.
105 sub each_alignment_line
{
107 return @
{$self->{'alignlines'}};
113 Usage : $domain->get_nse()
114 Function: Provides a seqname/start-end format, useful
115 for unique keys. nse stands for name-start-end
116 It is used alot in Pfam
119 Args : Optional seperator 1 and seperator 2 (default / and -)
131 if( !defined $sep2 ) {
134 if( !defined $sep1 ) {
138 return sprintf("%s%s%d%s%d",$self->seq_id,$sep1,$self->start,$sep2,$self->end);
145 # Usage : Backward compatibility with old HMMER modules.
146 # should use $domain->start
158 $self->warn("Using old domain->start_seq. Should use domain->start");
159 return $self->start($start);
165 # Usage : Backward compatibility with old HMMER modules.
166 # should use $domain->end
178 $self->warn("Using old domain->end_seq. Should use domain->end");
179 return $self->end($end);
185 # Usage : Backward compatibility with old HMMER modules, and
186 # for convience. Equivalent to $self->homol_SeqFeature->start
197 $self->warn("Using old domain->start_hmm. Should use domain->hstart");
198 return $self->hstart($start);
204 # Usage : Backward compatibility with old HMMER modules, and
205 # for convience. Equivalent to $self->homol_SeqFeature->start
217 $self->warn("Using old domain->end_hmm. Should use domain->hend");
218 return $self->hend($end);
224 Usage : $domain->hmmacc($newacc)
225 Function: set get for HMM accession number. This is placed in the homol
235 my ($self,$acc) = @_;
237 $self->feature2->add_tag_value('accession',$acc);
239 my @vals = $self->feature2->each_tag_value('accession');
246 Usage : $domain->hmmname($newname)
247 Function: set get for HMM accession number. This is placed in the homol
256 return shift->hseq_id(@_);
263 Function: backward compatibility. Same as score
271 return shift->score(@_);
278 Function: $domain->evalue($value);
286 return shift->_tag_value('evalue',@_);
293 Function: $domain->seqbits($value);
301 return shift->_tag_value('seqbits',@_);
308 Function: Throws an exception to catch scripts which need to upgrade
316 my ($self,@args) = @_;
318 $self->throw("You have accessed an old method. Please recode your script to the new bioperl HMMER module");
325 Function: Throws an exception to catch scripts which need to upgrade
334 my ($self,@args) = @_;
336 $self->throw("You have accessed an old method. Please recode your script to the new bioperl HMMER module");