[Bioperl-pipeline] Re: CIONA

Shawn shawnh@fugu-sg.org
06 Aug 2002 23:31:39 +0800


Thinking about it more.
There are two ways of going about it. One option which I like more is
to have in the job_setup_xml file an entry that specifies what module
and what method call to return ids.

<job_setup>
 <dbadaptor id="1">
    <dbname>biosql_june_02</dbname>
    <driver>mysql</driver>
    <host>pulse</host>
    <user>root</user>
    <password></password>
    <module>Bio::EnsEMBL::DBSQL::DBAdaptor</module>
  </dbadaptor>
  <method>
     <name>get_all_Clone_id</name>
     <rank>1</rank>
   </method>

</job_setup>

Inside Xml2DB.pl
it parses this file,
Creates the object and calls the method call.

require $module;
my @ids = $module->$name;
Then u create the inputs as you want.

A little neater. So I'm not sure you need the Initializer for this. But
for better setup/testing, we can use the Initializer module.
Of course the XML should allow for explicit inputs as well as method
calls like before. I like this as it allows one to do the EnsMART
concept where the web interface defines the method calls necessary to
fetch the input ids.


> Bio::Pipeline::Initializer.pm
> ------------------------------------------------------------
> sub get_contig_input_through_internal_id{
>     my($self)=@_;
>    my $user =$self->user ;
>    my $db =$self->dbname;
>    my $dbsource = "DBI:mysql:$db";
> 
>    my $dbh = DBI->connect($dbsource, $user) ||
>     die print "couldn't connect using Source : $dbsource, User : $user";
>    my $count;
>    my $sth = $dbh->prepare('SELECT COUNT(*) FROM contig');
>    $sth->execute;
>    while (my @data = $sth->fetchrow_array()){
>     $count = $data[0];
>   }
>  $dbh->disconnect;
>  return $count;
> }

The problem with this module is that it is schema specific to EnsEMBL
which we cannot assume is the case. In this way, your module will be
littered with these methods when all we want is just an array of
input_ids.


> How is it??   Is it a bad approach or something???? It solved the current
> problem though............ please advise.....
> 
> thanks
> 
> bala
> 
> 
> 
>