[Bioperl-pipeline] Annotation+Transformers
bala
bala at tll.org.sg
Thu Mar 20 10:08:35 EST 2003
On Thursday, March 20, 2003, at 10:00 AM, Juguang Xiao wrote:
>>
>>
>> So either I over kill the problem by attaching an iohandler to the
>> Transformer and fetch the RawContig or attach a RawContigAdaptor to
>> the converter
>> and fetch it using the original input id...any feelings?
>>
>
> I do not like this first way, since Transformer instance module should
> be biopipe independant, at least the converter is. In general,
> converter is just in charge of conversion, database information is
> necessary.
>
> I also had such problem, Shawn, do you remember that I added
> get_all_Contig_name in RawContigAdaptor in my local code, and never
> submit into ensembl because i am not sure if they like this
> no-harm-but-not-necessary-for-them sub. I prefer to have 2 own
> module, rather than changing the ensembl code.
>
You mean creating another supplementary module?
Isn't neater to just add the subroutine to ensembl?
Its something that ensembl used to have anyway....
bala
> # My_EnsEMBL_DBSQL_DBAdaptor.pm
> package My_EnsEMBL_DBSQL_DBAdaptor;
> use strict;
> use Bio::EnsEMBL::DBSQL::DBAdaptor;
> use vars qw(@ISA);
> @ISA = qw(Bio::EnsEMBL::DBSQL::DBAdaptor);
>
> sub get_RawContigAdaptor{
> my ($self) = @_;
> return $self->_get_adaptor("My_EnsEMBL_DBSQL_RawContigAdaptor");
>
> }
> 1;
>
> # My_EnsEMBL_DBSQL_RawContigAdaptor.pm
> package My_EnsEMBL_DBSQL_RawContigAdaptor;
> use strict;
> use vars qw(@ISA);
> use Bio::EnsEMBL::DBSQL::RawContigAdaptor;
> @ISA = qw(Bio::EnsEMBL::DBSQL::RawContigAdaptor);
>
> =head2 get_all_Contig_name
>
> Title : get_all_Contig_id
> Usage :
> my @contig_names = $obj->get_all_Contig_name;
> my @contig_names = $obj->get_all_Contig_name(-limit => 5);
> my @contig_names = $obj->get_all_Contig_name(-where =>
> $where_clause);
>
> Function: returns all the valid (live) Contig ids in the database
> Example :
> Returns : an array of RawContig objects.
> Args :
>
> =cut
>
> sub get_all_Contig_name{
> my ($self, @args) = @_;
> my $sql = "select name from contig";
> my ($limit, $where) = $self->_rearrange([qw(LIMIT WHERE)], @args);
>
> $sql .= " where $where" if (defined $where);
> $sql .= " limit $limit" if(defined $limit && $limit =~ /^\d+$/);
>
> my $sth = $self->prepare($sql);
> my $res = $sth->execute;
> my @out;
> while( my $rowhash = $sth->fetchrow_hashref) {
> push(@out,$rowhash->{'name'});
> }
>
> return @out;
> }
> 1;
>
> Juguang
>
>
> Juguang Xiao
> Bioinformatics Engineer
> Computational Biology
> Temasek Life Sciences Laboratory
> 1 Research Link
> National University of Singapore
> Singapore 117604
>
More information about the bioperl-pipeline
mailing list