#! /usr/bin/perl -w
#get sequences from NCBI according to gi
use strict;
use Bio::Perl;
use Bio::SeqIO;
use Bio::Seq;
open(GIIN,"$ARGV[0]") or die "Cannot open file";
open(GIED,"> $ARGV[1]") or die "cannot create file";
my @allgi=<GIIN>; #read all of gies
my $seqout = new Bio::SeqIO(-file =>'>> nameofafile', -format => "genbank");
foreach my $allgi(@allgi){
my $seq = get_sequence('genbank', $allgi);
if($seq){
$seqout->write_seq($seq);
my $gied = $allgi;
print GIED "$gied"; #put gies of downloaded sequences into a file
}
}
close GIIN;
close GIED;
05-15
05-15
05-15