perl - ensembl API get 3'UTR from list of stable id -
i want sequence of 3'utr list of genes using ensembl api. below script returns first hit , stuck, ie. can not iterate each entry of table. explain why not work?
my $registry = 'bio::ensembl::registry'; $registry->load_registry_from_db( -host => 'ensembldb.ensembl.org', # alternatively 'useastdb.ensembl.org' -user => 'anonymous' ); $specie = 'danio rerio'; $transcript_adaptor= $registry->get_adaptor($specie,'core','transcript') or die "error 1 $!\n"; $geneinput= 'gene_test.txt'; open (file, "$geneinput"); @data= <file>; close file; foreach $line ( @data) # stdin ensembl gene identifier { $line=~s/ //g; $line=~s/\t//g; $ line=~s/\n//g; $transcript = $transcript_adaptor->fetch_by_stable_id($line); $name = $transcript->display_id; $n3utr = $transcript->three_prime_utr; $n3utrseq = $n3utr->seq(); print "$name$n3utrseq"; } exit;
Comments
Post a Comment