Question: RCircos errors: Warning message: In data(file) data set file not found & non-numeric argument to binary operator
gravatar for marvel479
9 months ago by
marvel4790 wrote:

Here is the code I have been using. I am getting two different errors with it. Being new to R, I am sure I am making some obvious mistake, I just for the life of me cannot figure out where. I intend to add 2 tracks to the mouse ideogram using my .csv files that have chr#, chrstart, chrstop, name, no. of reads and strand info as columns. I am trying to construct a histogram using no. of reads at each genomic position. My .csv files are visible in the environment and properly appear when I do a head(). I also tried to Import them, that did not work either.

In addition, I get the following error:

> data(nohc_control)
**Warning message:
In data(nohc_control) : data set ‘nohc_control’ not found**
> data.col <- 5;
> track.num <- 1;
> side <- "in";
> RCircos.Histogram.Plot(nohc_control, track.num, side);
**Error in track.num - 1 : non-numeric argument to binary operator**
**In addition: Warning message:
In if (side == "in") { :
  the condition has length > 1 and only the first element will be used**

Here is the full code. Any help is appreciated.


nohc_control <- read.table("A:/A/circRNAs/nohc_control.csv", header = FALSE, sep = ",", stringsAsFactors = FALSE)
nohc_gen <- read.table("A:/A/circRNAs/nohc_gen.csv", header = FALSE, stringsAsFactors = FALSE)


chr.exclude <- NULL; <- UCSC.Mouse.GRCm38.CytoBandIdeogram;
tracks.inside <- 2;
tracks.outside <- 0;, chr.exclude,tracks.inside, tracks.outside);

out.file <- "haircell_circ_mm3.pdf";
pdf(file=out.file, height=8, width=8);

par(mai=c(0.25, 0.25, 0.25, 0.25));;
plot.window(c(-2.5,2.5), c(-2.5, 2.5));


data.col <- 5;
track.num <- 1;
side <- "in";
RCircos.Histogram.Plot(nohc_control, track.num, side);

data.col <- 5
track.num <- 2;
side <- "in";
RCircos.Histogram.Plot(nohc_gen, track.num, side);
plots rcircos rstudio R genome • 330 views
ADD COMMENTlink modified 9 months ago by zx87549.9k • written 9 months ago by marvel4790

Hi there, this is not exactly helpful, but I ran a few years back into comparable issues using Rcircos. I found the documentation was sort of fragmentary, I never understood what I needed to do to avoid all the errors...

Eventually I was much better off using the circlize package. The documentation is way better and more exhaustive, making error tracing so much simpler. In addition the graphics have superior quality.

ADD REPLYlink modified 9 months ago • written 9 months ago by Carambakaracho2.3k

Hi @Carambakaracho, thanks for the suggestion. I did try circlize and it is much better. I am confused about my usage of it though. I want to draw a histogram for one of its tracks and would like to use my read counts for Y-axis, and the x should be the genomic position, however wide or narrow. The syntax however is:

circos.trackHist(factors, x, ....)

I am assuming I can write : circos.trackHist(factors = mydataframe$reads, x = x) that doesn't work though. How should I imply that my x should have chromosome no., start and stop position information?

ADD REPLYlink written 9 months ago by marvel4790

What is x? did you initialize the plot before?




initialze with ideogram is handy when working with a model species (though I vaguely remember I used it with a non model species), the other option lets you customize everything. Your reads, I fear must be a per base count (depth), so you x should be a vector seq(1, end_of_chromosome)

ADD REPLYlink written 9 months ago by Carambakaracho2.3k

I have done


I am working with a model species, and have an Ideogram for it, but I am working with circular RNAs, and so I wanted to use raw reads represented, as depth may not be appropriate here. The plan for using library normalization and RPMs was for the circular:linear ratio data. I do not understand for circos.trackHist(factors, x, ....), what the x should be. The whole idea is that I clearly see some genomic positions having circRNA (non-coding) with really high read raw counts, in one sample and really few in another. Using tracks and histograms, I wanted to show this difference in sample outputs. If you have suggestions other than using a histogram, I am open to those as well.

ADD REPLYlink written 9 months ago by marvel4790

both need to be vectors of the same lengths, but trackHist seems to work raw data and compute the frequency. I'm also not sure how coverage counts need to be formatted there. Since you ask e me, I would calculate the coverage (bedtools/deeptols/samtools, you name it), smooth it to a sensible resolution with a rolling average and the use a line plot.

ADD REPLYlink written 9 months ago by Carambakaracho2.3k
Please log in to add an answer.


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