[Biococoa-dev] New class: BCEntrezController

Koen van der Drift koenvanderdrift at gmail.com
Tue Oct 4 16:15:33 EDT 2011


Hi Scott,

Thanks for tracking that down. Feel free to enable the newer code. As
long as it has the same results, it's fine with me.  I probably
disabled it because I thought it looked too complicated for a simple
fasta file :)

- Koen.

On Tue, Oct 4, 2011 at 3:14 PM, Scott Christley <schristley at mac.com> wrote:
> Hi Koen,
>
> Tests are good, wish I had more of them :-)
>
> Anyways, I tracked it down to BCSequenceReader.m, specifically -readFastaFile: method.  It is has been awhile but I rewrote that method to be more efficient and I think there might have also been some bugs in the old code.  I kept the old code around (using #if) in case there was problems.  In your version, the old code has been re-enabled so that is what is triggering the test failure.  Do you remember if any specific reason to switch back to old code?
>
> Scott
>
> On Oct 4, 2011, at 12:44 PM, Koen van der Drift wrote:
>
>> Hi Scott,
>>
>> Sorry if my efforts caused these errors :)  I'll look into the error
>> I'm getting if I can find some time inbetween life.
>>
>> - Koen.
>>
>>
>>
>> On Tue, Oct 4, 2011 at 12:40 PM, Scott Christley <schristley at mac.com> wrote:
>>> Hi Koen,
>>>
>>> I went back to revision 193, before you made a bunch of changes to eliminate deprecated messages, and the tests passed fine, so my guess is that one of those changes has slightly different behavior which is causing the problem.  I won't get to it today, but I can bring forward the changes one file at a time to see where the issue is, shouldn't be a problem.
>>>
>>> As for the SDK, I'm not sure it matters much, if somebody checks out the source then they can change it to whatever they want.  It really only matters for a binary release which we haven't done in awhile (the recent releases have just been source), but it would be nice to do a binary release sometime in the future (or even just another source release as there have been a bunch of changes).
>>>
>>> cheers
>>> Scott
>>>
>>> On Oct 4, 2011, at 7:20 AM, Koen van der Drift wrote:
>>>
>>>> Thinking a bit more about this, now we're at 10.7, and I don't think
>>>> everyone uses it yet, we need to decide what is the SDK we're using:
>>>> 10.5, 10.6, 10.7?   I'm leaning towards the "current OS-1" option, so
>>>> that would be 10.6 in my case. But for those who haven't made the leap
>>>> to Lion yet, may want to use 10.5.  The same for the Xcode version. If
>>>> I open my project in Xcode 4, make some commits, and then someone else
>>>> opens it in Xcode3, will that give any problems?  I could imagine that
>>>> the warnings below are caused by such a situation.
>>>>
>>>> - Koen.
>>>>
>>>>
>>>>
>>>> On Mon, Oct 3, 2011 at 6:41 PM, Koen van der Drift
>>>> <koenvanderdrift at gmail.com> wrote:
>>>>> Hi Scott,
>>>>>
>>>>> I just now tested it on my system (Xcode4 and 10.7.1). It compiles fine, but get the following error during the run:
>>>>>
>>>>> Unknown.m:0: error: -[TestBCSuffixArray testFileConstructSuffixArray] : -[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: id)
>>>>>
>>>>> and a bunch of warnings regarding SDK and OS compatibility:
>>>>>
>>>>> LLVM GCC 4.2 default Mac OS X deployment target '10.7.1' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.7' for the Mac OS X 10.7 SDK.
>>>>>
>>>>> Unfortunately I don't have much time to look into it right now
>>>>>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> - Koen.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Oct 3, 2011, at 6:13 PM, Scott Christley wrote:
>>>>>
>>>>>> Thanks Koen!
>>>>>>
>>>>>> Have you tried the test suite lately?  I updated from SVN because I have some changes that I want to submit, but now the test suite is failing.  Oddly I am able to run the test suite from the command line without any errors, so it makes me wonder if there is a configuration problem.
>>>>>>
>>>>>> Scott
>>>>>>
>>>>>> On Oct 3, 2011, at 2:13 PM, Koen van der Drift wrote:
>>>>>>
>>>>>>> All,
>>>>>>>
>>>>>>> I have committed a new class BCEntrezController to the trunk. This class is are heavily based on Alexander's EntrezController class that he committed a few years ago to BioCocoa and is used in Mekentosj's program EnzymeX. I choose not to update his class in svn, but to create a new one, so his original entry will still be available for reference. His original class is tied to the Entrez.nib file, and I left that connection intact as well.  Interestingly, this class does not use any of the BC classes at all :)
>>>>>>>
>>>>>>> The main update is that the code now uses the native NSXMLParser instead of an older/outdated third party framework. I don't know if using NSXMLParser is the most efficient, I read about other parsers such as libxml, but for me it works. The second major change with the original code is that the data are now stored in an NSSDictionary, instead of in an EntrezResult object. The main advantage I think is that by using an NSDictionary, parsing becomes more flexible, and the user can add any info from the search results in their data model. For instance, I have added the url of the sequence as an example. But anything can be added if that info is available and needed: authors, annotations, mutations, references, etc.  Finally, multiple records can be fetched at once, and are send to the delegate as an NSArray.
>>>>>>>
>>>>>>> Obviously, there are other improvements possible: choosing a different database, choosing whether to search for proteins or nucleotides, etc. But I will leave that up to the reader. The parser code could also be factored out for more flexibility.
>>>>>>>
>>>>>>> I will also add a demo application soon that demonstrates the use of this class.
>>>>>>>
>>>>>>> Enjoy,
>>>>>>>
>>>>>>> - Koen.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Biococoa-dev mailing list
>>>>>>> Biococoa-dev at www.bioinformatics.org
>>>>>>> http://www.bioinformatics.org/mailman/listinfo/biococoa-dev
>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>



More information about the Biococoa-dev mailing list