[ensembl-dev] getting the gene for a variation feature in a pseudogene of rna gene
Andreas Kahari
ak at ebi.ac.uk
Wed Dec 8 09:30:55 GMT 2010
On Tue, Dec 07, 2010 at 08:56:45PM +0000, Andrea Edwards wrote:
> Hi
>
> I'm using the api to have a look at Watson SNPs and i was wondering
> how i would get the genes the SNPs are in. (i know you can get this
> using biomart but i was using the api to get more used to it).
>
> I just wanted to check that snps in mRNA genes and pseudogenes have
> transcripts (and hence transcript variations) in ensembl otherwise
> my code below to get the gene from the transcript id of the
> transcript object of the transcriptvariation(s) of a variation
> feature (this seems long winded doesn't it - am i missing an easier
> way) won't work for snps in mRNA genes and pseuodgenes.
>
> Every pseudogene/rna gene that i have looked at in ensembl has a
> transcript but i would like to be sure i can count on it.
Every gene has at least one transcript. Every transcript has at least
one exon. So, the simplest gene you can have is a gene consisting of a
single-exon transcript.
Actually, "gene" is just an abstraction, and it makes no sense talking
about genes in Ensembl if there are no underlying transcripts.
Regards,
Andreas
> thanks a lot
>
> my $variation_set_adaptor= $reg->get_adaptor('human', 'variation',
> 'variationset');
> my $watson_set = $variation_set_adaptor->fetch_by_name("ENSEMBL:Watson");
>
> my $slice_adaptor = $reg->get_adaptor($species, 'core', 'slice');
> my $gene_adaptor =$reg->get_adaptor($species, 'core','gene');
> my $transcript_adaptor =$reg->get_adaptor($species, 'core','Transcript');
>
> @slices = @{ $slice_adaptor->fetch_all('chromosome', undef, 0, 1) };
> foreach $slice (@slices) {
>
> unless ($slice->seq_region_name() =~ /Un/) {
>
>
> my @vfs
> =@{$watson_set->get_all_VariationFeatures_by_Slice($slice)};
> foreach my $vf (@vfs) {
> next if ($vf->var_class ne 'snp');
>
>
> #@dbsnp_syns = @{$var->get_all_synonyms('dbSNP')};
> $all_synonyms = join ',', @{$var->get_all_synonyms()};
>
> my @tvs = @{$vf->get_all_TranscriptVariations};
> foreach my $tv (@tvs) {
> $gene_id =
> $gene_adaptor->fetch_by_transcript_id($tv->transcript->stable_id());
> print "gene id: $gene_id\n";
> print "variation: ",
> $tv->variation_feature()->variation_name(), "\n";
> print "transcript: ", $tv->transcript->stable_id(), "\n";
> print "consequence type: @{$tv->consequence_type()}\n";
> print "peptide alleles: ",
> $tv->pep_allele_string(), "\n";
>
> }
> }
> }
> }
>
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev
>
--
Andreas Kähäri, Ensembl Software Developer
European Bioinformatics Institute (EMBL-EBI)
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD, United Kingdom
More information about the Dev
mailing list