[ensembl-dev] question variation feature and overlapping/neighbouring gene

Nathalie Conte nconte at ebi.ac.uk
Mon May 20 14:25:14 BST 2013


HI, 
 I would require some guidance please-
 I would like from a slice object containing several variation features, to retrieve all variation object and additional information (overlapping gene or ), and print them in a OUT file like this, 
name of variation:rs12114605	alles:C/T	start:55749184	end:55749184	consequence:INTRONIC		transcript_name:ENST00000521465	gene_name:ENSG00000254608	gene_extname:RP11-56A10.1

Starting from the variation and associated annotation and retrieving  overlapping gene or neighbouring information- I had a look in the variation feature object and it seems from the variation we can retrieve gene content and neighbouring genes with 2 methods below, although I didn't managed to use them from my variation feature-
public Bio::EnsEMBL::Gene 	get_nearest_Gene ()
public List 	get_overlapping_Genes ()

So I chose to get all the transcripts corresponding to my variation using get_all_TranscriptVariations method (see below), but ovisouly I am missing neighbour gene info. Is this the best way to interrogate the genetic (or neighbouring gene?) content of the variation?
thanks
Nathalie


#variation
my $human_slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Human', 'Core', 'Slice');
my $human_query_slice = $human_slice_adaptor->fetch_by_region('chromosome',$genomic_align->dnafrag->name,$genomic_align->dnafrag_start,$genomic_align->dnafrag_end);

###  get all variations in human slice
my $vfh_adaptor = Bio::EnsEMBL::Registry->get_adaptor('homo_sapiens', 'variation', 'variationfeature'); #get adaptor to VariationFeature object
my $gene_adaptor = Bio::EnsEMBL::Registry->get_adaptor('human', 'core', 'gene');

my $vfsh = $vfh_adaptor->fetch_all_by_Slice($human_query_slice); #return ALL variations defined in $slice

foreach my $vfh (@{$vfsh}){ 
	print   OUT join "\t", $vfh->variation_name, $vfh->allele_string,  $vfh->seq_region_start,$vfh->seq_region_end,$vfh->most_severe_OverlapConsequence->display_term, "\t";	;#this is where i need to check the variation gene content
#get transcripts corresponding to the variation features. 
	my $transcripts=$vfh->get_all_TranscriptVariations;	
		foreach my $transcript (@{$transcripts}) {
if (!@{$transcripts}){print 'no_gene',"\t";}
		print OUT 'transcript',"\t",my $id=$transcript->transcript_stable_id,"\t";
		my $gene = $gene_adaptor->fetch_by_transcript_stable_id($id);
     		print OUT $gene->stable_id, "\t",$gene->external_name,"\n";
		      		#print OUT $gene->stable_id if (defined $gene->external_name),"\t",$gene->external_name,"\n";
		}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20130520/afe1ac8a/attachment.html>


More information about the Dev mailing list