Reverse Complement utility, Bio::Alg, return value problem

Georg Fuellen fuellen@dali.Mathematik.Uni-Bielefeld.DE
Wed, 6 Aug 1997 09:34:36 +0000 (GMT)


I agree w/ SteveC -re- a web driver (see today's post).
I've already got a little experience using Bio::UnivAln with
CGI.pm and PGPLOT, see 
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/UnivAln/t/univaln.cgi
(the script is kinda dated, e.g. I've now got a much better grip of PGPLOT)
Do you think this is on the right track ?
Anyway, we should keep in mind that for the GUI, we're probably
going to have Java applets, too -- and then we can also demonstrate that Perl is
an excellent glue for all this.

[...]
> You might want a different name than Bio::Alg, since this name to me 
> implies that the module *provides* the algorithms rather than simply 
> wraps around them. Perhaps AlgManager? AlgWrapper?

I agree; IMO AlgMgr is best.
(SteveC: If you think your GCG.pm is worth looking at, pls mail it
or point to it.)

> > > 3) Regarding return-values, pls let me know soon about your opinion.
> > > Btw, in my post I should have used get_seq() instead of slice(), so that 
> > > we have
> > > $myseq->get_seq(seq($beg,$end))       returns modified object
> > 
> > I'm confused.  Is seq an exported function?  

I'd like to follow the PDL example; I think they export the inplace()
function, and seq() [and possibly some other, similar functions]
could be handled the same way.

> > When you say "returns modified object," do you mean modifies the current
> > object or creates a new object and returns that?

creates a new object and returns that. You modify the current object
by 'inplace'.

> > > $myseq->get_seq($beg,$end)            same as current get_seq() -- returns sequence
> > > $myseq->get_seq(inplace($beg,$end))   modifies the object itself -- ithis saves time+space
> > > 
> > > And for revcom:
> > > $myseq->revcom(seq($beg,$end))      returns modified object
> > > $myseq->revcom($beg,$end)           same as current revcom() -- returns sequence
> > > $myseq->revcom(inplace($beg,$end))  modifies the object itself -- this saves time+space
> > > 
> 
> I'm also confused about how the seq() and inplace() calls within the 
> get_seq() and revcom() calls are being used.  Either of these might be 
> more obvious:
> 
> $myseq->revcom($myseq->inplace($beg,$end))

The analog $myseq->get_seq($myseq->seq($beg,$end)) [which slices and returns
a new object containing the slice] doesn't look nice to me.

> OR
> $myseq->revcom($beg,$end,'inplace')

This runs into problems if for some utilities you later add a 3rd parameter
(and need to move 'inplace' one step further towards the end of the parameter
list).

> Cheers,
> 
> SteveC
> 

best wishes,
georg