So a question that could have been asked in rcpp forum, but maybe you have already made a wrapper for it, so I ask here.
I want to access the ith row of a GRangesList:
#include <Rcpp.h> using namespace Rcpp; Environment envGRanges("package:GenomicRanges"); Function GRangesList = envGRanges["GRangesList"]; S4 getGRL_byIndex(S4 fiveUTR, int i ){ S4 grangesObj("GRangesList"); grangesObj = as<GRangesList>fiveUTRs[i]; return grangesObj; }
Error is: no match for operator = (types: s4 and unresolved overload function type)
Is this possible to do ?
FWIW, It will not be faster to manipulate a GRanges object in C than in R. If there were some operations I wanted to perform on a GRanges object that were not supported in R (it is challenging to know what these operations are -- I wonder what you are trying to accomplish?) then my strategy would be to extract the relevant information from the GRanges object in R, and pass as simple vectors to / from C.
This is not my goal, it's only a part of the program, my whole program takes a GRangeslist and fastaSequences, and returns a GRangesList with all orfs of the original GRangeslist.
I need this to access each GRangesList by transcript
I'm thinking about the simple vector possibility, but I still need a grouped vector by transcripts, makes it harder..
i.g
if grangeslist have 2 transcript with two exons each, I would need to make a class or something for this, would be easier to use GRangesList API if it exists..