/Bio/Pipeline/Runnable/Tmhmm.pm
Perl | 199 lines | 125 code | 61 blank | 13 comment | 9 complexity | 272f437c5a4733494824c3849905309b MD5 | raw file
Possible License(s): LGPL-2.0
- # Pipeline module for Tmhmm Bio::Pipeline::Runnable::Tmhmm
- #
- # Based on the EnsEMBL module Bio::EnsEMBL::Pipeline::Runnable::Protein::Tmhmm
- # originally written by Marc Sohrmann (ms2@sanger.ac.uk)
- # Written in BioPipe by Balamurugan Kumarasamy <savikalpa@fugu-sg.org>
- # Please direct questions and support issues to <bioperl-l@bioperl.org>
- #
- # Cared for by the Fugu Informatics team (fuguteam@fugu-sg.org)
- # You may distribute this module under the same terms as perl itself
- #
- # POD documentation - main docs before the code
- =head1 NAME
- Bio::Pipeline::Runnable::Tmhmm
- =head1 SYNOPSIS
- my $runnable = Bio::Pipeline::Runnable::Tmhmm->new();
- $runnable->analysis($analysis);
- $runnable->run;
- my $output = $runnable->output;
- =head1 DESCRIPTION
- Runnable for Tmhmm
- =head1 FEEDBACK
- =head2 Mailing Lists
- User feedback is an integral part of the evolution of this and other
- Bioperl modules. Send your comments and suggestions preferably to the
- Bioperl mailing lists Your participation is much appreciated.
- bioperl-l@bioperl.org - General discussion
- http://bioperl.org/wiki/Mailing_lists - About the mailing lists
- =head2 Support
-
- Please direct usage questions or support issues to the mailing list:
-
- L<bioperl-l@bioperl.org>
-
- rather than to the module maintainer directly. Many experienced and
- reponsive experts will be able look at the problem and quickly
- address it. Please include a thorough description of the problem
- with code and data examples if at all possible.
- =head2 Reporting Bugs
- report bugs to the Bioperl bug tracking system to help us keep track
- the bugs and their resolution. Bug reports can be submitted via
- email or the web:
- bioperl-bugs@bio.perl.org
- http://bugzilla.open-bio.org/
- =head1 AUTHOR
- Based on the EnsEMBL module Bio::EnsEMBL::Pipeline::Runnable::Protein::Tmhmm
- originally written by Marc Sohrmann (ms2@sanger.ac.uk)
- Written in BioPipe by Balamurugan Kumarasamy <savikalpa@fugu-sg.org>
- # Please direct questions and support issues to <bioperl-l@bioperl.org>
- #
- Cared for by the Fugu Informatics team (fuguteam@fugu-sg.org)
- =head1 APPENDIX
- The rest of the documentation details each of the object methods.
- Internal methods are usually preceded with a _.
- =cut
- package Bio::Pipeline::Runnable::Tmhmm;
- use vars qw(@ISA);
- use strict;
- use FileHandle;
- use Bio::PrimarySeq;
- use Bio::SeqFeature::FeaturePair;
- use Bio::SeqFeature::Generic;
- use Bio::SeqI;
- use Bio::SeqIO;
- use Bio::Root::Root;
- use Bio::Pipeline::DataType;
- use Bio::Pipeline::RunnableI;
- use Bio::Tools::Run::Tmhmm;
- @ISA = qw(Bio::Pipeline::RunnableI);
- sub new {
- my ($class, @args) = @_;
- my $self = $class->SUPER::new(@args);
- return $self;
- }
- =head2 datatypes
- Title : datatypes
- Usage : $self->datatypes
- Function: Returns the datatypes that the runnable requires.
- Returns : It returns a hash of the different data types.
- Args :
- =cut
- sub datatypes {
- my ($self) = @_;
- my $dt1 = Bio::Pipeline::DataType->new('-object_type'=>'Bio::PrimarySeqI',
- '-name'=>'sequence',
- '-reftype'=>'SCALAR');
- my %dts;
- $dts{feat1} = $dt1;
- return %dts;
- }
-
- =head2 feat1
- Title : feat1
- Usage : $self->feat1($seq)
- Function:
- Returns :
- Args :
- =cut
- sub feat1{
- my ($self,$feat) = @_;
- if (defined($feat)){
- $self->{'_feat1'} = $feat;
- }
- return $self->{'_feat1'};
- }
- =head2 run
- Title : run
- Usage : $self->run($seq)
- Function: Runs Tmhmm
- Returns :
- Args :
- =cut
- sub run {
- my ($self) = @_;
- my $seq = ($self->feat1);
- $self->throw("Analysis not set") unless $self->analysis->isa("Bio::Pipeline::Analysis");
- my $factory;
- $factory = Bio::Tools::Run::Tmhmm->new();
-
- my $program_file = $self->analysis->program_file;
- $factory->executable($program_file) if $program_file;
-
- my @genes;
- eval {
- @genes = $factory->predict_protein_features($seq);
- };
- $self->throw("Problems running predict_protein_featuers due to $@") if $@;
-
- $self->output(\@genes);
-
- return \@genes;
- }
- =head2 output
- Title : output
- Usage : $self->output($seq)
- Function: Get/set method for output
- Returns :
- Args :
- =cut
- sub output{
- my ($self,$gene) = @_;
- if(defined $gene){
- (ref($gene) eq "ARRAY") || $self->throw("Output must be an array reference.");
- $self->{'_gene'} = $gene;
- }
- return @{$self->{'_gene'}};
- }