[BioC] Biostrings C interface :: example not compiling

Erik Wright eswright at wisc.edu
Sat Apr 3 16:43:27 CEST 2010


Hello again,

It looks like my problem is that the function listed in the example code, "cache_XRaw()", is deprecated.  Is there any source of information about how to use the functions listed in Biostrings_interface.h?

Thanks again,
Erik



On Apr 2, 2010, at 11:00 AM, Erik Wright wrote:

> Hello all,
> 
> I am trying to interface Biostrings from C for the first time.  I followed the example given in the header of Biostrings_interface.h to the letter (quite literally).  In step "e" I paste the example function into myFile.c, register it as a .Call entry point and compile with R CMD CHECK.  I get the following errors:
> 
> myFile.c:13: warning: implicit declaration of function Œcache_XRaw‚
> myFile.c:13: error: incompatible types in assignment
> myFile.c:14: error: ŒcachedCharSeq‚ has no member named Œelts‚
> myFile.c:14: error: ŒcachedCharSeq‚ has no member named Œnelt‚
> 
> Based on the error, it seems like I still don't have access to any of the Biostrings variable definitions.  I have tried everything that I can think of, so I am quite stuck.  Does anyone know what I am doing incorrectly?  I have pasted myFile.c below for reference.
> 
> Thanks!,
> Erik
> 
> 
> 
> 
> //myFile.c
> 
> #include <Rdefines.h>
> #include <R_ext/Rdynload.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include "Biostrings_interface.h"
> 
> SEXP print_XString_bytes(SEXP xstring)
> {
> 	cachedCharSeq x;
> 	int i;
> 	const char *x_char;
> 	
> 	x = cache_XRaw(xstring);
> 	for (i = 0, x_char = x.elts; i < x.nelt; i++, x_char++)
> 		Rprintf("%x ", *x_char);
> 	Rprintf("\n");
> 	return R_NilValue;
> }
> 
> /*
> * -- REGISTRATION OF THE .Call ENTRY POINTS ---
> */
> static const R_CallMethodDef callMethods[] = {
> 	{"print_XString_bytes", (DL_FUNC) &print_XString_bytes, 1},
> 	{NULL, NULL, 0}
> };
> 
> void R_init_GoneFISHing(DllInfo *info)
> {
> 	R_registerRoutines(info, NULL, callMethods, NULL, NULL);
> }
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list