PERL ONLY. Use the BioPerl modules to write a script that takes a protein sequen
ID: 3868859 • Letter: P
Question
PERL ONLY.
Use the BioPerl modules to write a script that takes a protein sequence accession number as input (on the command line), then fetches this sequence from GenBank, BLASTs it against the non-redundant database, and then retrieves all the hits that are above a certain e-value cutoff (also given as input on the command line). The retrieved sequences should be written to files, one sequence per file, in the current directory. If no hits satisfy the e-value cutoff, the script should note that instead of writing any files.
Explanation / Answer
use Bio::DB::GenBank; $db_obj = Bio::DB::GenBank->new; $db_obj = Bio::DB::GenBank->new; $seq_obj = $db_obj->get_Seq_by_id(2); use Bio::DB::Query::GenBank; $query = "Arabidopsis[ORGN] AND topoisomerase[TITL] and 0:3000[SLEN]"; $query_obj = Bio::DB::Query::GenBank->new(-db => 'nucleotide', -query => $query ); $query_obj = Bio::DB::Query::GenBank->new( -query => 'gbdiv est[prop] AND Trypanosoma brucei [organism]', -db => 'nucleotide' ); use Bio::DB::GenBank; use Bio::DB::Query::GenBank; $query = "Arabidopsis[ORGN] AND topoisomerase[TITL] and 0:3000[SLEN]"; $query_obj = Bio::DB::Query::GenBank->new(-db => 'nucleotide', -query => $query ); $gb_obj = Bio::DB::GenBank->new; $stream_obj = $gb_obj->get_Stream_by_query($query_obj); while ($seq_obj = $stream_obj->next_seq) { # do something with the sequence object print $seq_obj->display_id, " ", $seq_obj->length, " "; }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.