[Biococoa-dev] Alignment & HMM Support in Biococoa

John Timmer jtimmer at bellatlantic.net
Tue Feb 22 15:46:55 EST 2005

>> Incidentally, I recently wound up building OS-X versions of Muscle and
>> ClustalW.  Now that our sequence object is stabilizing a bit, I was
>> wondering if people thought it might be worth some effort trying to
>> write a
>> generic wrapper that could feed our sequences to command line apps and
>> get a
>> result back?  This would potentially help us provide a layer of
>> abstraction
>> to a large number of Unix tools.
> Do I understand you correctly that you want to generate a general
> NSTaskController that does the following:
> BCSequence -> NSString -> Run Task with arguments -> parse output ->
> BCSequence or other objects?
More or less.  Give the user the option of whether to have our existing file
reading classes try to interpret the output, or to have it returned as a
string and let them sort it out.

>> The reason this comes to mind is that I'm finding that a lot of these
>> things
>> only take input in a limited number of formats, and we've already got
>> format
>> conversion code in place....
> The real question is how you can make the thing multipurpose instead of
> having tens of different controllers for very specific tasks... But you
> must have something in mind right?
Flags - lots and lots of flags.

The idea is that most of these tools have a limited number of file formats
they take as input.  Some of them can take input from stdin, others need
files.  Some output a single file, others multiple files.  We need to give
the user enough opportunity to work with as many as possible.

The point of the wrapper would be to do what your initial comment suggested,
but also automate handling things like creating tmp files as needed, reading
from the STDOUT and STDERR pipes, handling conversions back to BCSequences,
cleaning up, sending callback messages, etc.

Clearly, there are going to be a bunch of user-supplied flags that will
differ between tasks, but I think a lot of the grunt work could be wrapped,
so that most tools could be run as something like the following:

BCTask *myTask;
[myTask setSequence: mySequnce];
[myTask setUsesSTDIN: NO];  /// know to use a tmp file
[myTask setInputFormat: BCFastaFormat];
[myTask setAdditionalFlags: myFlagArray];
[myTask setUsesSTDOUT:  NO];  // use a tmp output file
[myTask setCallBack: @selector(taskDone:contextInfo:) target: self
contextInfo: nil];
[myTask setCreatesSequencesFromOutput: YES];
[myTask setRetainsSTDERRasString: YES];
[myTask launch];

This mind intentionally left blank

More information about the Biococoa-dev mailing list