[Bioperl-l] sequence upgrading

Marc Logghe Marc.Logghe at devgen.com
Thu Jun 26 12:43:19 EDT 2003


> 
> This depends entirely on your implementation. E.g., if you put a copy 
> constructor on Bio::Seq::RichSeq that accepts Bio::PrimarySeqs (or 
> whatever) then you would 'upgrade'.
> 
> 	-hilmar
OK, I see.
Something like:
1) deep copying 
use Bio::SeqIO;
my $gbio = Bio::SeqIO->new(-format => 'genbank');

while (my $seq1 = $gbio->next_seq)
{
  my $seq2 = $seq1->copy # $seq2 is deep copy of Bio::Seq::RichSeq object
$seq1

  # do some stuff with $seq2
}

or:
2) 'upgrading'
use Bio::SeqIO;
use Bio::Seq::RichSeq;
my $fasta_io = Bio::SeqIO->new;

while (my $seq1 = $fasta_io->next_seq)
{
   my $seq2 = Bio::Seq::RichSeq->copy($seq1) # $seq2 is enriched fasta seq
object

   # do some stuff with $seq2
}

Correct ?
Marc


More information about the Bioperl-l mailing list