[ensembl-dev] Wrongly documented gene_adaptor method ?

Andy Yates ayates at ebi.ac.uk
Mon Jun 25 14:40:12 BST 2012

Hi Trevor,

Alt allele does cover patches as well as haplotype regions. For example if we take the patch fix region GL383517.1 (which is HG999_2_PATCH in Ensembl) and run the following query:

select aa.alt_allele_id
from seq_region sr 
join gene g using (seq_region_id)
join alt_allele aa on (g.gene_id = aa.gene_id)
where sr.name = 'HG999_2_PATCH';

That gives us an alt_allele_id of 1579. We then try to find the stable IDs linked to this ID & if it's the reference gene or not:

select stable_id, is_ref
from gene 
join alt_allele using (gene_id)
where alt_allele_id = 1579;

stable_id	is_ref
ENSG00000229663	1
ENSG00000260191	0

This same logic is available from the $gene->get_all_alt_alleles() method. Once you have the other genes you can decipher the type of assembly exception we have performed using the $slice->assembly_exception_type() method which will report REF, PATCH_FIX, PATCH_NOVEL or HAP.



On 25 Jun 2012, at 13:50, PATERSON Trevor wrote:

> According to the Perl documentation, you should be able to get a list of genes for a given display label, using:
> public    Listref    Bio::EnsEMBL::DBSQL::GeneAdaptor::fetch_all_by_display_label ( )
> However,  this method is wrongly documented in the online perl docs, and does not return an array – but a single gene object
> my @genes = @{$geneAdaptor->fetch_by_display_label("TBC1D3B")};
> When you look at the real code in Release 67 API, rather than the www perldocs, the method actually returns a single gene, preferring one that is on a reference slice.
> I am looking for a way of getting alternative gene models on Patch exceptions: and this method would have been promising. e.g for the geneENSG00000224226 Location Chromosome 17: 34,493,061-34,503,984 how do I get its equivalent on the patch-fix ENSG00000260069 Location Chromosome HG75_PATCH: 34,493,132-34,503,984.
> obviously I can dig into the API and call the appropriate sql code myself:
> my $constraint = "x.display_label = '". $gene->display_xref()->display_id()."' AND g.is_current = 1";
> my @same_labelled_genes = @{ $gene_adaptor->generic_fetch($constraint) };
> but is there an alternative (simple) method to get either ‘same_labelled’ genes  or ideally ‘equivalent-exception’ genes for a given gene?
> the method
> public    Listref    Bio::EnsEMBL::Gene::get_all_alt_alleles ( )
> of course does something similar using the alt_alleles table , but only for alternative haplotypes not patches.
> Thanks
> Trevor
> Trevor Paterson PhD
> trevor.paterson at roslin.ed.ac.uk
> Bioinformatics 
> The Roslin Institute
> Royal (Dick) School of Veterinary Studies
> University of Edinburgh
> Easter Bush
> Midlothian
> EH25 9RG
> Scotland UK
> phone +44 (0)131 651 9157
> http://bioinformatics.roslin.ed.ac.uk/
> Please consider the environment before printing this e-mail
> The University of Edinburgh is a charitable body, registered in Scotland with registration number SC005336
> Disclaimer:This e-mail and any attachments are confidential and intended solely for the use of the recipient(s) to whom they are addressed. If you have received it in error, please destroy all copies and inform the sender.
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/

More information about the Dev mailing list