Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Bio::DB::EUtilities;
- my $gene_uid = 9555;
- my $get_nuc = Bio::DB::EUtilities->new(
- -eutil => 'elink',
- -db => 'nucleotide',
- -dbfrom => 'gene',
- -id => [$gene_uid]
- );
- my %struct;
- while (my $nuc_link = $get_nuc->next_LinkSet) {
- next unless $nuc_link->get_link_name eq 'gene_nuccore_refseqrna';
- my @nuc_uids = $nuc_link->get_ids;
- foreach my $nuc_uid (@nuc_uids) {
- my $get_prot = Bio::DB::EUtilities->new(
- -eutil => 'elink',
- -db => 'protein',
- -dbfrom => 'nucleotide',
- -id => [$nuc_uid]
- );
- while (my $prot_link = $get_prot->next_LinkSet) {
- next unless $prot_link->get_link_name eq 'nuccore_protein';
- my ($prot_uid) = $prot_link->get_ids;
- $struct{$nuc_uid} = $prot_uid;
- }
- }
- }
- foreach (keys %struct) {
- say "transcript with UID $_ encodes protein with UID $struct{$_}";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement