[ensembl-dev] update API issue

nconte at ebi.ac.uk nconte at ebi.ac.uk
Fri Nov 15 15:54:24 GMT 2013


HI,
This is the bit of the code which will get the is_reference test-
if you replace $Ggene with any gene symbol from HGNC this should work.
#!/usr/local/bin/perl
use strict;
use warnings;

use Bio::EnsEMBL::Registry;

Bio::EnsEMBL::Registry->load_registry_from_db(
	-host=>"ensembldb.ensembl.org", -user=>"anonymous",
        -port=>'5306', 'db_version' => 73,);
my $gene_adaptor=Bio::EnsEMBL::Registry->get_adaptor( 'human', 'Core',
'Gene' );


my $all_genes=$gene_adaptor->fetch_all_by_external_name($Ggene,'HGNC'); #
this is where I capture the ensembl genes from each key
#######
if (!scalar (@{$all_genes})) {print  $Ggene.'no ensembl gene object
',"\t","no ensembl variation no object","\t","no ensembl orthologues no
object","\t"; next; } elsif  (scalar (@{$all_genes})){
	 foreach my $gene (@{$all_genes}){
if (!$gene){print $Ggene.' '. 'no_ensembl_gene'; next} elsif
	 ( $gene && $gene->slice->is_reference ) {
# no  genes which are on patches are removed only the ref assembly are
kept , -!!!!
#print   'GWAS_gene2: '.$Ggene,  "\t",defined($gene->external_name) ?
print   defined($gene->external_name) ?
$gene->external_name :'no_ensembl_gene',":", defined($gene->stable_id) ?
$gene->stable_id : 'no_stableID',":", defined($gene->seq_region_name) ?
$gene->seq_region_name:
'no_seq_region_name:',":",defined($gene->seq_region_start) ?
$gene->seq_region_start:
'no_seq_region_start',":",defined($gene->seq_region_end) ?
$gene->seq_region_end: 'no_seq_region_end',"," ;}

Thanks

Nat

> Hi there,
>
> A reference sequence is detected by the non-existence of a non_ref flag in
> seq_region_attrib. I've done this query in 73:
>
> select *
> from seq_region sr
> join seq_region_attrib sra using (seq_region_id)
> join attrib_type a using (attrib_type_id)
> where sr.name = 'HSCHR6_MHC_MCF_CTG1'
> and a.code = 'non_ref'
>
> And have got no rows back suggesting that $gene->slice->is_reference()
> when slice is HSCHR6_MHC_MCF_CTG1 will return false. Could you send us
> your code please?
>
> Andy
>
> On 15 Nov 2013, at 14:26, nconte at ebi.ac.uk wrote:
>
>> Hi,
>> I have been updating my ensembl API versions from 71 to 73 today, and
>> reran a script to test it was working.
>> In my script I am excluding genes  Ids for haplotypes /  LRG /
>> pseudoautomosal
>> or  assembly patches/fixes regions. I am using this test/method to
>> exclude
>> them
>> (if $gene->slice->is_reference)
>>
>> I am now getting genes mapping on HSCHR6_MHC_MCF_CTG1 which were
>> excluded
>> on my last version of the API. Is the slice->is_reference deprecated?
>> Thanks
>> Nathalie
>>
>>
>>
>> _______________________________________________
>> 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