Hi all, I maintain a set of C++ tools (bedtools) that are used in the genomics/bioinformatics field. Several users have asked that I create APIs to the libraries such that "hooks" are available for Perl and Python, for example (many requests for Python). Therefore, I am interested in using SWIG, as it has support for C++ and in theory, can be used to create APIs to several languages.
However, the aforementioned tools were written so that they could be "piped" together in an UNIX stream, and as such, all of the libraries write to stdout. I am struggling to figure out how to use SWIG to make the output from the existing methods (printfs and couts) available as an API. My ideal vision would be that the output of the tools would be a iterator that could be looped over in Python/
Does anyone have experience with this? I would be very grateful for concrete examples with sample code. Hopefully, I am missing something very obvious.
Gratefully, Aaron