[Bioperl-l] seq object usage

Fields, Christopher J cjfields at illinois.edu
Tue Jun 12 15:31:32 UTC 2012


Bio::Seq::LargePrimarySeq/LargeSeq actually is a better fit here than my previous suggestion; note the 'add_sequence_as_string' method:

http://search.cpan.org/~cjfields/BioPerl-1.6.901/Bio/Seq/LargeSeq.pm#add_sequence_as_string

chris

On Jun 12, 2012, at 10:26 AM, Christopher Fields wrote:

> Bio::LiveSeq is supposed to handle cases like this:
> 
> http://www.bioperl.org/wiki/HOWTO:Bioperl_Objects#LiveSeq
> 
> ...but it is severely undocumented.  This is one we're planning on pulling out of core and releasing on its own.  The code hasn't been updated in quite a while, but it's better than starting from scratch if anyone wants to take it.
> 
> chris
> 
> On Jun 12, 2012, at 8:54 AM, Roy Chaudhuri wrote:
> 
>> Bio::Seq's seq method just delegates to Bio::PrimarySeq:
>> http://doc.bioperl.org/releases/bioperl-current/bioperl-live/Bio/Seq.html#CODE2
>> 
>> So this should work:
>> $bio_seq_obj->seq($bio_seq_obj->seq.$some_addition_seq)
>> 
>> You're right about the memory thing though. Math, couldn't you just print out a Fasta file directly rather than using BioPerl?
>> 
>> Cheers,
>> Roy.
>> 
>> 
>> On 12/06/2012 14:28, Frank Schwach wrote:
>>> the Bio::Seq's "seq" method doesn't take an argument to set a new
>>> sequence, so I think you would have to do it like this:
>>> 
>>> $bio_seq_obj->primary_seq(
>>> Bio:PrimarySeq->new(
>>> -seq => $bio_seq_obj->seq .$some_addition_seq
>>> )
>>> );
>>> 
>>> but it wouldn't save you any memory because you still have the whole
>>> sequence in memory.
>>> 
>>> 
>>> 
>>> 
>>> On 12/06/12 11:27, math math wrote:
>>>> Hi,
>>>> 
>>>> consider the following case:
>>>> 
>>>> A seq object's string field (ie the sequence part) needs to be filled
>>>> gradually in a PERL loop. The seq object(s) can be hundreds of millions
>>>> bases long at the end of this loop. The final goal is to write this seq
>>>> object(s) to an output file (in multi-fasta format).
>>>> 
>>>> My question is, how can one append progressively more sequence to a seq
>>>> object (i.e. instead of all at once, to minimize memory), and make sure
>>>> that these get written to a file.
>>>> 
>>>> Thanks.
>>>> _______________________________________________
>>>> Bioperl-l mailing list
>>>> Bioperl-l at lists.open-bio.org
>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>> 
>>> 
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 





More information about the Bioperl-l mailing list