[Biococoa-dev] biococoa svn and everything
Koen van der Drift
kvddrift at earthlink.net
Wed Oct 3 20:32:33 EDT 2007
Hi Scott,
>> I noticed you did a lot of updates recently with these class -
>> this is great. Form your comments in the code I have a hard time
>> understanding what exactly a suffix array is (I'm an analytical
>> chemist that mainly works with proteins, so pardon my
>> ignorance ;-) Maybe you could add some more info in the source
>> code to help better understand these classes?
>
> Definitely! I noticed that there is a documentation setup similar
> to how javadoc works, so I will eventually add those comments.
We actually use HeaderDoc: http://bioinformatics.org/biococoa/wiki/
pmwiki.php?n=Main.UsingHeaderDoc
> I tend to be an iterative programmer, trying out a design then
> tweaking it until it converges on a best setup, so I think I'm
> getting there and once I do I will document more thoroughly. The
> suffix array is a nifty data structure, it essentially holds all of
> the strings in a sequence in sorted order, making it quick to
> search for exact string matches.
Ok, ignorant question #2, isn't a sequence just one (1) string?
Again, this is from someone who works with proteins ;-)
>
>> Another question I have is why you are using calls such as fopen,
>> fread, etc instead of the methods that Obj-C and Cocoa provide for
>> I/O. Mind you, I am just trying to understand the code, it's no
>> criticism at all.
>
> I presume you mean NSFileHandle? I was actually thinking of using
> it, the current code which uses fopen, fread, etc is from the
> original code for my standalone programs. The main reason why I
> didn't switch over is that NSFileHandle can only return data with
> NSData, and the type of programs which use suffix arrays and etc do
> alot of file reading, which would mean lots and lots of NSData
> objects being created and released. If only NSFileHandle could put
> the data directly into a buffer provided by the user, or an
> existing NSMutableData, that would be perfect.
A quick search in cocoabuilder.com gave the following snippet:
NSMutableData *data = [NSMutableData data];
NSData *someData;
NSFileHandle *readHandle = [[aTask standardOutput]
fileHandleForReading];
while ((someData = [readHandle availableData]) && [someData
length]) {
[data appendData:someData]; // Or, if possible, process the
data here
}
would that help?
cheers,
- Koen.
More information about the Biococoa-dev
mailing list