[Biococoa-dev] more ramblings

Alexander Griekspoor mek at mekentosj.com
Thu Nov 25 17:13:15 EST 2004


Op 19-nov-04 om 2:46 heeft Koen van der Drift het volgende geschreven:

>
>> Again, although certainly a possibility, sometimes there are 
>> alternatives just as good. For example, the thing that I immediately 
>> thought after reading:
>>> An advantage is that when you ever decide to change the way a 
>>> sequence is created, or introduce a new type of sequence, you only 
>>> have to modify the code once in the factory, not in each readXXX 
>>> method.
>> was "Why not do the type checking/bcsequence subclass creation in one 
>> method inside the current implementation?"
>> We don't check the type in each readXXX method either, so one method 
>> like "determineSequenceType" or "sequenceObjectForFile" would also 
>> allow you to keep all "factory" methods centralized and easy to 
>> change right?
>
> Right. See my other post, IMO a readXXX file should only parse the 
> input, and then pass on the requested info to a class that creates a 
> sequence.

Yes, but again, I don't see why that would require different classes. 
The readXXXFile METHOD should indeed only parse the input, but ANOTHER 
METHOD in the same class could help return the proper sequence. An idea 
of methods to implement:
- a general method to determine (guess) the filetype
- a general method to determine (guess) the sequence type (protein, 
dna, rna)
- methods that do the parsing
	- based on the sequence type determination
	- based on the type as a (user set) argument

>> I think it all comes down to how to describe the border or guidelines 
>> of when to choose for internal or external methods. My gut feeling 
>> says, hardcoded properties, "one liner" calculations, and trivial 
>> methods can be done internally. Also speed is an issue, if it takes 
>> time to calculate things it's way nicer to provide a wrapper object 
>> because that allows to go for threading, asynchronous methods, and 
>> progress monitoring very elegantly. Things like length, is so easy to 
>> calculate (a typical one-liner) that it would be ridiculous to have a 
>> helper calculate that.
>
> I agree, but let's then focus on having these one-liners in BCSequence 
> only, not in the subclasses.
Why? There will certainly be cases where you can have dna sequence 
characteristics/calculations in one line? Why not add them?
>
>>

>> Right so a BCSequence should have a GC% method or MW method or 
>> something alike for example right? So we add what the favorite thing 
>> what everyone would love to see (in the superclass if it's a general 
>> thing (in the case for MW, and not for GC%)):
>> [mySequence gcPercentage] or [mySequence molecularWeight] (purely 
>> hypothetical).
>
> I'd say in the superclass only. We can have the wrappers test if it is 
> the appropriate sequencetype.
Same question here...
>
> Guys, I'm glad the mailinglist is back alive. We're having some good 
> and very useful discussions.
Copy that!
Alex

*********************************************************
                     ** Alexander Griekspoor **
*********************************************************
               The Netherlands Cancer Institute
               Department of Tumorbiology (H4)
          Plesmanlaan 121, 1066 CX, Amsterdam
                   Tel:  + 31 20 - 512 2023
                   Fax:  + 31 20 - 512 2029
                   E-mail: a.griekspoor at nki.nl
	        AIM: mekentosj at mac.com
               Web: http://www.mekentosj.com

                  EnzymeX - To cut or not to cut
              http://www.mekentosj.com/enzymex

*********************************************************




More information about the Biococoa-dev mailing list