Question: Rcpp adding circular ranges to GRanges object in c++
gravatar for hauken_heyken
24 months ago by
hauken_heyken60 wrote:

Hey, I have the circular Ecoli genome, and I want to construct a GRanges object of all ORFs in the fasta file from ncbi.


I made a c++ function to do it, but of course since some of the orfs that starts just before the stop of the genome, and ends after the start, will make IRanges() constructor output error (negative widths not allowed), I want to something like in R where you can set the metacolumn of the GRangesobject to include isCircular() = vector(T,T,T,...),

Here is the sample from c++ and error:


#include <Rcpp.h>

Function GRangesC("GRanges", Environment::namespace_env("GenomicRanges"));
Function IRangesC("IRanges", Environment::namespace_env("IRanges"));

std::vector<int> ORFdef = orfs_as_vector(fastaSeq); // <- get all orfs from fasta

Seqnames.insert(Seqnames.end(), ORFdef.size() / 2, 1);
strands.insert(strands.end(),ORFdef.size() / 2,"+");


Error in find_ORFs :
  Evaluation error: solving row 149014: negative widths are not allowed.
iranges granges rcpp circular • 411 views
ADD COMMENTlink written 24 months ago by hauken_heyken60

In more simple terms, what I am saying is:

How do you allow negative widths on IRanges ?

ADD REPLYlink written 23 months ago by hauken_heyken60
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 165 users visited in the last hour