[ensembl-dev] ensembl API get 3'UTR sequence from gene list
Kieron Taylor
ktaylor at ebi.ac.uk
Tue Apr 9 10:41:08 BST 2013
Dear Olivier,
Perhaps you can send us the first five identifiers you are reading in
from 'gene_test.txt'? It would also be useful if you can provide any
errors or warnings that appear during the running of your script.
The mailing list will probably reject any attachment, so please include
the data in-line. This will help us a great deal in determining the
nature of your problem.
--
Kieron Taylor PhD.
Ensembl Core team
EBI
On 09/04/2013 10:07, Olivier armant wrote:
> Dear Ensembl API support,
>
> I want to get back the 3'UTR sequence from an array of genes defined
by their stable id. The script I am using is below. I only get back the
first hit and then get stuck. Could you please explain me why this does
not work?
>
> Cordially
>
> Olivier A
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> use lib "/data/shared/src/Perl_API/ensembl_70/modules";
> use Bio::SeqIO;
> use Bio::EnsEMBL::SeqFeature;
> use Bio::EnsEMBL::Registry;
> use Bio::EnsEMBL::DBSQL::GeneAdaptor;
> #use Bio::EnsEMBL::DBSQL::ExonAdaptor;
> use Bio::EnsEMBL::Transcript;
> #use Data::Dumper;
>
> my $registry = 'Bio::EnsEMBL::Registry';
> $registry->load_registry_from_db(
> -host => 'ensembldb.ensembl.org', # alternatively 'useastdb.ensembl.org'
> -user => 'anonymous'
> );
> my $specie = 'Danio rerio';
> my $transcript_adaptor= $registry->get_adaptor($specie,'Core','Transcript') or die "ERROR 1 $!\n";
> my $geneinput= 'gene_test.txt';
> open (FILE, "$geneinput");
> my @data= <FILE>;
> close FILE;
> foreach my $line ( @data) # stdin as ensembl gene identifier
> {
> $line=~s/ //g;
> $line=~s/\t//g;
> $line=~s/\n//g;
> my $transcript = $transcript_adaptor->fetch_by_stable_id($line);
> my $name = $transcript->display_id;
> my $n3UTR = $transcript->three_prime_utr;
> my $n3UTRseq = $n3UTR->seq();
> print "$name$n3UTRseq";
> }
> exit;
>
>
> Olivier ARMANT PhD.
>
> Institute of Toxicology and Genetics
> KIT Campus Nord
> Hermann-von-Helmholtz-Platz 1
> D-76344 Eggenstein-Leopoldshafen
> Germany
>
> tel: +49-721-608-26774
> fax: +49-721-608-23354
>
>
> _______________________________________________
> 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