[Bioperl-l] cloning, upgrading,
downgrading and conversion functionality
Marc Logghe
Marc.Logghe at devgen.com
Fri Jul 4 13:13:13 EDT 2003
Hi,
As promised I added a number of methods to Bio::PrimarySeq, Bio::Seq and
Bio::RichSeq to enable cloning, upgrading, downgrading and conversion
functionality.
Two extra methods are available for sequence objects (directly or via the
parents):
copy() and convert_to()
This little script should show the possibilities:
#!/usr/bin/perl -w
use Bio::SeqIO;
use Bio::Seq;
use Data::Dumper;
$io = Bio::SeqIO->new(-format => 'genbank');
# Get a Bio::Seq::RichSeq object
$seq1 = $io->next_seq;
# Convert a Bio::Seq::RichSeq to a Bio::PrimarySeq object
$seq2 = $seq1->convert_to('Bio::PrimarySeq');
# Clone the Bio::PrimarySeq object
$seq3 = $seq2->copy;
# Convert Bio::PrimarySeq to Bio::Seq object
$seq4 = Bio::Seq->copy($seq3);
# Let's have a look at the objects
for ('seq1', 'seq2', 'seq3', 'seq4')
{
print "${$_}\n",
Data::Dumper->Dump( [${$_}],[$_] );
} <<Bio.seq.tar.gz>>
Tried to add the pod and added a test to Seq.t. Hopefully it passes the
quality control ;-)
Regards,
Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bio.seq.tar.gz
Type: application/octet-stream
Size: 20705 bytes
Desc: not available
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20030704/43282a52/Bio.seq.tar.obj
More information about the Bioperl-l
mailing list