I am using the code below but not getting any output. Please let me know what is wrong here.
my $string = param("genBankSeq");
my $format = "genbank";
my $fastaSeq;
my $stringfh;
open($stringfh, "<", \$string) or die "Could not open string for reading: $!";
my $seqio = Bio::SeqIO-> new(
-fh => $stringfh,
-format => $format,
);
while( my $seq = $seqio->next_seq ) {
# process each seq
$fastaSeq = $seq->seq();
}
my $formattedFastaSeq = "";
my $fromStr = 0;
my $temp = "";
while($fromStr < length($fastaSeq)){
$temp = substr($fastaSeq, $fromStr, 70);
$formattedFastaSeq = $formattedFastaSeq.$temp."<br>";
$fromStr = $fromStr + length($temp);
}
print $formattedFastaSeq;
Sorry.........didn't work
Also... if you don't really need bioperl, there are several tools that make this pretty easy. This is an Emboss example. You'd have to save the genbank to a file first though.
Thanks I got my code working I m supposed to use only bioperl.
that great. But, if I need to get CDS proteins sequence also of genbank format into fasta?