[Bioperl-l] Question: creating an empty Bio::Seq object

Scott Cain cain@cshl.org
02 Dec 2002 10:48:38 -0500


Hello all,

I have a relatively simple question.  I want to create a Bio::Seq object
before I have the actual DNA sequence, but when I do know the length, so
I would like to do something like this:

my $bioseq = Bio::Seq->new ( -alphabet         => 'dna'
                             -accession_number => $name ,
                             -length           => $$hash_ref{'seqlen'});

however, this doesn't appear to work.  Amusingly, if I do this and then
do $bioseq->length, it answers with '9', since the test accession number
I am using is 9 characters long (at least I assume that is where the 9
is coming from). So, is there a way to construct a Bio::Seq and give it
a length without actually having a DNA sequence?

Thanks,
Scott


-- 
------------------------------------------------------------------------
Scott Cain, Ph. D.                                         cain@cshl.org
GMOD Coordinator (http://www.gmod.org/)                     216-392-3087
Cold Spring Harbor Laboratory