[ensembl-dev] Main gene vs. alternate

mag mr6 at ebi.ac.uk
Mon Nov 20 08:46:51 GMT 2017

Hi Mahmood,

What you call the main instance of a gene is a gene located on a 
chromosome or scaffold. These can be identified with the following API call:

The "Human alternative sequence Gene" are genes located on alternate 
sequences, either patch fixes or haplotypes.
In some cases, there is a sequencing error on the reference chromosome 
and the gene on the alternate sequence is a better choice.
You can select these with the following API call:

my $aag_adaptor = 
my $aag = $aag_adaptor->fetch_Group_by_dbID($gene->dbID);
my $reference_gene = $aag->get_representative_Gene;

If you are looking at retrieving only one version of a gene name and are 
looking for the most representative, I would recommend the second 
solution rather than arbitrarily selecting the one on the reference 

I hope this helps,

On 18/11/2017 17:37, Mahmood Naderan wrote:
> Hi,
> I use the following code to retrieve all instances of a gene name. 
> Then I compare each display_id with the gene name that I have and if 
> they match, I go further to process them.
> my @genes = @{ $gene_adaptor->fetch_all_by_external_name('HLA-DRB1') };
> while (my $gene = shift @genes) {
>   my $big_string = $gene->display_xref->display_id;
>   my $pat = "HLA-DRB1";
>   my $match_found = $big_string =~ /$pat/i;
>   if ($match_found) {
>      ..
> }
> }
> Problem is that I get multiple items and they display_id are equal to 
> what I have (HLA-DRB1). On the website, the main instance is named and 
> the others are named "Human Alternative sequence Gene". I don't want 
> to store them. I just need the main "Human Gene".
> What is the correct attribute to distinguish that?
> Regards,
> Mahmood
> _______________________________________________
> 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/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20171120/5b46b615/attachment.html>

More information about the Dev mailing list