Ejemplo n.º 1
0
SEXP BWGFile_fromWIG(SEXP r_infile, SEXP r_seqlengths, SEXP r_outfile) {
  pushRHandlers();
  struct lm *lm = lmInit(0);
  struct hash *lenHash = createIntHash(r_seqlengths);
  struct bwgSection *sections =
    bwgParseWig((char *)CHAR(asChar(r_infile)), FALSE, lenHash, itemsPerSlot,
                lm);
  bwgCreate(sections, lenHash, blockSize, itemsPerSlot, TRUE, TRUE, TRUE,
            (char *)CHAR(asChar(r_outfile)));
  lmCleanup(&lm);
  freeHash(&lenHash);
  popRHandlers();
  return r_outfile;
}
Ejemplo n.º 2
0
/* --- .Call ENTRY POINT --- */
SEXP BWGSectionList_write(SEXP r_sections, SEXP r_seqlengths, SEXP r_compress,
                          SEXP r_file)
{
  struct bwgSection *sections = NULL;
  struct hash *lenHash = createIntHash(r_seqlengths);
  if (r_sections != R_NilValue) {
    sections = R_ExternalPtrAddr(r_sections);
    slReverse(&sections);
  }
  pushRHandlers();
  bwgCreate(sections, lenHash, blockSize, itemsPerSlot, asLogical(r_compress),
            (char *)CHAR(asChar(r_file)));
  freeHash(&lenHash);
  popRHandlers();
  return r_file;
}
Ejemplo n.º 3
0
pathExpr *createPathExpr(expr *f, locationPathExpr *l){
	exception e;
	pathExpr *pe = (pathExpr *)malloc(sizeof(pathExpr));
	if (pe==NULL){
		throwException2(out_of_mem,
			"pathExpr allocation failed ");
		return NULL;
	}
	Try{
		pe->ih = createIntHash();
	}
	Catch(e){
		free(pe);
		Throw e;
	}

	pe->freeExpr = (free_Expr) &freePathExpr;
	pe->evalBoolean = (eval_Boolean)&evalBoolean_pe;
	pe->evalNodeSet = (eval_NodeSet)&evalNodeSet_pe;
	pe->evalNumber  = (eval_Number)&evalNumber_pe;
	pe->evalString  = (eval_String)&evalString_pe;
	pe->isNumerical =  (is_Numerical)&isNumerical_pe;
	pe->isBoolean = (is_Boolean)&isBoolean_pe;
	pe->isString =  (is_String)&isString_pe;
	pe->isNodeSet = (is_NodeSet)&isNodeSet_pe;
	pe->requireContextSize = (require_ContextSize)&requireContextSize_pe;
	pe->setContextSize = (set_ContextSize)&setContextSize_pe;
	pe->setPosition = (set_Position)&setPosition_pe;
	pe->reset = (reset_)&reset_pe;
	pe->toString = (to_String)&toString_pe;
	pe->adjust = (adjust_)&adjust_pe;
	pe->fe = f;
	pe->lpe= l;
	pe->evalState = 0;

	return pe;

}