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

Ewan Birney birney@ebi.ac.uk
Mon, 2 Dec 2002 17:06:17 +0000 (GMT)


On 2 Dec 2002, Scott Cain wrote:

> 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?


Why do you want to do this? 



It is likely you will need to write your own implementation class to do 
this because is sounds like you need a dummy sequence implementation.