<commit_before>#
#
# Cared for by <NAME>  <<EMAIL>>
#
# Copyright <NAME>
#
# You may distribute this module under the same terms as perl itself
#
# POD documentation - main docs before the code

=pod 

=head1 NAME

 Bio::EnsEMBL::Pipeline::RunnableDB::Waba

=head1 SYNOPSIS

 my $trna = Bio::EnsEMBL::Pipeline::RunnableDB::Waba->new ( -dbobj      => $db,
			                                    -input_id   => $input_id
                                                            -analysis   => $analysis );
 $trna->fetch_input();
 $trna->run();
 $trna->output();
 $trna->write_output(); #writes to DB

=head1 DESCRIPTION

 This object wraps Bio::EnsEMBL::Pipeline::Runnable::Waba to add
 functionality to read and write to databases.
 The appropriate Bio::EnsEMBL::Analysis object must be passed for
 extraction of appropriate parameters. A Bio::EnsEMBL::Pipeline::DBSQL::Obj is
 required for database access.

=head1 CONTACT

 Describe contact details here

=head1 APPENDIX

 The rest of the documentation details each of the object methods. 
 Internal methods are usually preceded with a _

=cut

package Bio::EnsEMBL::Pipeline::RunnableDB::Waba;

use strict;
$|=1;
use Bio::EnsEMBL::Pipeline::RunnableDB;
use Bio::EnsEMBL::Pipeline::Runnable::Waba;
use vars qw(@ISA);

@ISA = qw(Bio::EnsEMBL::Pipeline::RunnableDB);

=head2 new

    Title   :   new
    Usage   :   $self->new(-DBOBJ       => $db
                           -INPUT_ID    => $id
                           -ANALYSIS    => $analysis);
                           
    Function:   creates a Bio::EnsEMBL::Pipeline::RunnableDB::Waba object
    Returns :   A Bio::EnsEMBL::Pipeline::RunnableDB::Waba object
    Args    :   -dbobj:     A Bio::EnsEMBL::DBSQL::DBAdaptor, 
                -input_id:   Contig input id , 
                -analysis:  A Bio::EnsEMBL::Analysis

=cut

sub new {
    my ($class, @args) = @_;
    my $self = $class->SUPER::new(@args);

    $self->{'_fplist'}      = [];  
    $self->{'_genseq'}      = undef;
    $self->{'_runnable'}    = undef;
    

    $self->throw("Analysis object required") unless ($self->analysis);
    
    # set up waba specific parameters (none for the moment)
    my $params = $self->parameters();
    if ($params ne "") { $params .= " , "; }

    $self->parameters($params);

    $self->runnable('Bio::EnsEMBL::Pipeline::Runnable::Waba');
    return $self;
}

=head2 fetch_input

    Title   :   fetch_input
    Usage   :   $self->fetch_input
    Function:   Fetches input data for Waba from the database
    Returns :   none
    Args    :   none

=cut

sub fetch_input {
    my( $self) = @_;
    
    $self->throw("No input id") unless defined($self->input_id);
    
    my $contigid  = $self->input_id;
    my $contig    = $self->db->get_Contig($contigid);
    my $genseq    = $contig->primary_seq() or $self->throw("Unable to fetch contig");

    $self->genseq($genseq);
}

=head2 runnable

    Title   :   runnable
    Usage   :   $self->runnable($arg)
    Function:   Sets a runnable for this RunnableDB
    Returns :   Bio::EnsEMBL::Pipeline::RunnableI
    Args    :   Bio::EnsEMBL::Pipeline::RunnableI
<commit_msg>changes to bring upto date<commit_after>#
#
# Cared for by <NAME>  <<EMAIL>>
#
# Copyright <NAME>
#
# You may distribute this module under the same terms as perl itself
#
# POD documentation - main docs before the code

=pod 

=head1 NAME

 Bio::EnsEMBL::Pipeline::RunnableDB::Waba

=head1 SYNOPSIS

 my $trna = Bio::EnsEMBL::Pipeline::RunnableDB::Waba->new ( -dbobj      => $db,
			                                    -input_id   => $input_id
                                                            -analysis   => $analysis );
 $trna->fetch_input();
 $trna->run();
 $trna->output();
 $trna->write_output(); #writes to DB

=head1 DESCRIPTION

 This object wraps Bio::EnsEMBL::Pipeline::Runnable::Waba to add
 functionality to read and write to databases.
 The appropriate Bio::EnsEMBL::Analysis object must be passed for
 extraction of appropriate parameters. A Bio::EnsEMBL::Pipeline::DBSQL::Obj is
 required for database access.

=head1 CONTACT

 Describe contact details here

=head1 APPENDIX

 The rest of the documentation details each of the object methods. 
 Internal methods are usually preceded with a _

=cut

package Bio::EnsEMBL::Pipeline::RunnableDB::Waba;

use strict;
$|=1;
use Bio::EnsEMBL::Pipeline::RunnableDB;
use Bio::EnsEMBL::Pipeline::Runnable::Waba;
use vars qw(@ISA);

@ISA = qw(Bio::EnsEMBL::Pipeline::RunnableDB);

=head2 new

    Title   :   new
    Usage   :   $self->new(-DBOBJ       => $db
                           -INPUT_ID    => $id
                           -ANALYSIS    => $analysis);
                           
    Function:   creates a Bio::EnsEMBL::Pipeline::RunnableDB::Waba object
    Returns :   A Bio::EnsEMBL::Pipeline::RunnableDB::Waba object
    Args    :   -dbobj:     A Bio::EnsEMBL::DBSQL::DBAdaptor, 
                -input_id:   Contig input id , 
                -analysis:  A Bio::EnsEMBL::Analysis

=cut

sub new {
    my ($class, @args) = @_;
    my $self = $class->SUPER::new(@args);

    $self->{'_fplist'}      = [];  
    $self->{'_genseq'}      = undef;
    $self->{'_runnable'}    = undef;
    

    $self->throw("Analysis object required") unless ($self->analysis);
    
    # set up waba specific parameters (none for the moment)
    my $params = $self->parameters();
    if ($params ne "") { $params .= " , "; }

    $self->parameters($params);

    $self->runnable('Bio::EnsEMBL::Pipeline::Runnable::Waba');
    return $self;
}

=head2 fetch_input

    Title   :   fetch_input
    Usage   :   $self->fetch_input
    Function:   Fetches input data for Waba from the database
    Returns :   none
    Args    :   none

=cut

sub fetch_input {
    my( $self) = @_;
    
    $self->throw("No input id") unless defined($self->input_id);
    
    my $ctg_name  = $self->input_id;
    my $contig    = $self->db->get_RawContigAdaptor->fetch_by_name($ctg_name);

    $self->genseq($contig);
}

=head2 runnable

    Title   :   runnable
    Usage   :   $self->runnable($arg)
    Function:   Sets a runnable for this RunnableDB
    Returns :   Bio::EnsEMBL::Pipeline::RunnableI
    Args    :   Bio::EnsEMBL::Pipeline::RunnableI

{'fraction_non_alphanumeric': 0.13415809768637532, 'fraction_numerical': 0.002892030848329049, 'mean_word_length': 2.6107888631090486, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1683495', 'n_tokens_mistral': 2164, 'n_tokens_neox': 2014, 'n_words': 506}