Skip to content

[Bioc-devel] Exposing some more IRanges mojo to C.

4 messages · Hervé Pagès, Steve Lianoglou

#
Hi Steve,

Yes we can expose more stuff if needed. There are already a lot of
functions that are exposed (130 of the 274 functions currently defined
in IRanges) and we can expose more.

It's good to keep some level of encapsulation though, by exposing only
what's stable and potentially useful. This IRanges C-interface is hard
to maintain at the moment: adding a function to it or changing the type
of a function argument requires making more or less the same change in
3 or 4 different places. I guess this could probably be made easier by
using some custom script...

Rle_seqselect itself is not a good candidate for exposure because it's
a .Call entry point. We've tried so far to not expose .Call entry points
because the type of their arguments (SEXP) make them less re-usable in
C code than if those types were low-level C-types like int *, char *
etc... One way to go is to reorganize a little bit our code by adding
and exposing a lower-level function that does (almost) all the work
that Rle_seqselect currently does but with args:

   (SEXP x, const int *start, const int *width, int length)

instead of

   (SEXP x, SEXP start, SEXP width)

and then have Rle_seqselect call it. This lower-level function is more
reusable because, in the client code, the 'start' and 'with' vectors
are not always stored in SEXP's. For example they could be in temporary
int buffers (typically), and there is no reason why the client code
would need to convert those buffers into SEXP's before it can
call the C function in IRanges.

I'll make that change and will let you know.

Cheers,
H.
On 11-10-27 01:31 PM, Steve Lianoglou wrote:

  
    
#
This is done in IRanges 1.13.2. The exposed function is
_seqselect_Rle().

Cheers,
H.
On 11-11-02 03:01 PM, Herv? Pag?s wrote:

  
    
#
On 11-11-02 05:46 PM, Herv? Pag?s wrote:
Actually I should say that the exact name of the exposed function
is seqselect_Rle (no underscore prefix).

Cheers,
H.
#
Hi Herv?,

2011/11/3 Herv? Pag?s <hpages at fhcrc.org>:
Thanks for whipping that together!

I'll see if I can start messing with it in the next few days or so.

Cheers,
-steve