[ensembl-dev] searching for genes by description field?

Adam Witney awitney at sgul.ac.uk
Wed Feb 13 11:09:12 GMT 2013


Thanks Andy, in the meantime, I just realised, of course I can just do this:

my $genes = $dba->get_GeneAdaptor()->fetch_all();
	
foreach my $gene ( @{$genes} ) {	
	if ( $gene->description && $gene->description =~ m/$string/ ) {
		# do stuff
	}
}

Thanks again

Adam

On 13/02/2013 10:30, Andy Yates wrote:
> Hi Adam,
>
> Currently we do not support this. The actual code which implements this search is in the DBEntryAdaptor and would require edits in there. I can see a point in having this kind of functionality so we will put it on our to-do list.
>
> Andy
>
> On 13 Feb 2013, at 10:24, Adam Witney <awitney at sgul.ac.uk> wrote:
>
>>
>> Hi,
>>
>> Is there a method to search the Gene description field. I am currently using fetch_all_by_external_name, but this only works if the gene has been annotated with gyrA:
>>
>> my $genes = $dba->get_GeneAdaptor()->fetch_all_by_external_name('gyrA');
>>
>> What I would like to be able to do is search the data returned by the description method ($gene->description), is this possible? eg something like this:
>>
>> my $genes = $dba->get_GeneAdaptor()->fetch_all_by_description('%gyrase%');
>>
>> Thanks
>>
>> Adam
>>
>> _______________________________________________
>> Dev mailing list    Dev at ensembl.org
>> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
>> Ensembl Blog: http://www.ensembl.info/
>
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>




More information about the Dev mailing list