[Biojava-dev] DNATools.forSymbol

Rhett Sutphin rhett-sutphin at uiowa.edu
Fri Mar 14 07:53:35 EST 2003


Hi,

I think its worthwhile to have these two similar methods.  One operates 
on a String and returns a SymbolList and the other operates on a char 
and returns a Symbol.  So long as the documentation points out that 
using createDNA(String) is more efficient than forSymbol if you are 
trying to parse more than one char, I don't think we should give up the 
added flexibility.

I would not be opposed to deprecating the forSymbol _name_, however, 
and replacing it with a same-functionality method called 
createDNA(char).  "forSymbol" is counterintuitive -- it sounds like the 
parameter should be a Symbol, not the return type.  "createDNA" would 
indicate the parallel functionality with createDNA(String).

Rhett

On Friday, March 14, 2003, at 03:12  AM, Matthew Pocock wrote:

> Hi,
>
> I think this is a throw-back to the days before alphabet indexers and 
> symbol tokenizers. Are we going to end up with two methods that do the 
> same thing? Should we deprecate/remove one of them?
>
> Matthew
>
> Schreiber, Mark wrote:
>> Hi -
>> This method works on a switch statement which doesn't have a case for 
>> n
>> but I don't see any reason I cannot put one in. I may even put one in
>> for all the IUB ambiguity codes.
>> - Mark
>>> -----Original Message-----
>>> From: Rhett Sutphin [mailto:rhett-sutphin at uiowa.edu] Sent: Friday, 
>>> 14 March 2003 11:14 a.m.
>>> To: Schreiber, Mark
>>> Cc: biojava-dev at biojava.org
>>> Subject: Re: [Biojava-dev] DNATools.forSymbol
>>>
>>>
>>> Hi Mark,
>>>
>>> Thanks for the amazingly quick response.  (With a patch, no less.)
>>>
>>> But I'm still wondering why DNATools.forSymbol('n') should throw an 
>>> exception while DNATools.createDNA("n") does not.  Is there a >>> reason?
>>>
>>> Rhett
>>>
>>> On Thursday, March 13, 2003, at 03:51  PM, Schreiber, Mark wrote:
>>>
>>>
>>>> Hi -
>>>>
>>>> There is no good reason other than it is a weakly observed
>>>
>>> convention
>>>
>>>> to
>>>> use lower case letters for DNA and RNA and upper case for Protein. I
>>>> have changed the methods in DNA and RNA tools to be case
>>>
>>> insensitive. I
>>>
>>>> have commited the changes to biojava-live.
>>>>
>>>> - Mark
>>>>
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Rhett Sutphin [mailto:rhett-sutphin at uiowa.edu]
>>>>> Sent: Friday, 14 March 2003 10:44 a.m.
>>>>> To: biojava-dev at biojava.org
>>>>> Subject: [Biojava-dev] DNATools.forSymbol
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have what might be a stupid question:  why isn't
>>>>> DNATools.forSymbol(c) the same as
>>>>> DNATools.createDNA(Character.toString(c)).symbolAt(1) for all c? 
>>>>> forSymbol only works for lowercase a, c, g, and t, while createDNA 
>>>>> handles uppercase and lowercase of the whole DNA alphabet,
>>>
>>> plus gaps.
>>>
>>>>> Is there a special meaning/use of forSymbol that warrants this
>>>>> difference in behavior?
>>>>>
>>>>> Just curious,
>>>>> Rhett



More information about the biojava-dev mailing list