Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Is it possible to retrieve the coding sequence of a gene from NCBI GenBank database using perl ?

by poj (Abbot)
on Jan 23, 2017 at 21:31 UTC ( [id://1180177]=note: print w/replies, xml ) Need Help??


in reply to Is it possible to retrieve the coding sequence of a gene from NCBI GenBank database using perl ?

I know next to nothing about bioinformatics but perhaps this suggestion helps.

#!/usr/bin/perl use warnings; use strict; use Bio::DB::GenBank; use Bio::SeqIO; my $gb = new Bio::DB::GenBank; my $acc = "NM_021817"; my $seq1 = $gb->get_Seq_by_acc($acc); my $sequence = $seq1->seq; for my $feat ($seq1->get_SeqFeatures){ if ($feat->primary_tag eq 'CDS'){ print $feat->get_tag_values('product'),"\n"; print $feat->get_tag_values('gene'),"\n"; my $start = $feat->start; my $len = $feat->length; my $cds = substr($sequence,$start-1,$len); use Text::Wrap; # put this at top $Text::Wrap::columns = 71; print wrap('', '', $cds); } }
poj
  • Comment on Re: Is it possible to retrieve the coding sequence of a gene from NCBI GenBank database using perl ?
  • Download Code

Replies are listed 'Best First'.
Re^2: Is it possible to retrieve the coding sequence of a gene from NCBI GenBank database using perl ?
by supriyoch_2008 (Monk) on Jan 24, 2017 at 14:23 UTC

    Hi poj

    Thank you for your valuable suggestions. The code works nicely and my problem is now solved.

    With kind regards,

    supriyoch_2008

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180177]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-26 02:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found