[Bioperl-pipeline] Annotation+Transformers

Elia Stupka elia at tll.org.sg
Thu Mar 20 10:56:02 EST 2003


> Isn't neater to just add the subroutine to ensembl?
> Its something that ensembl used to have anyway....

I'll add it, not to worry, not such a big deal!

Elia



>
> 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
>>
>
>
---
Bioinformatics Program Manager
Temasek Life Sciences Laboratory
1, Research Link
Singapore 117604
Tel. +65 6874 4945
Fax. +65 6872 7007



More information about the bioperl-pipeline mailing list