Error in RCircos.Validate.Genomic.Data
4
0
Entering edit mode
7.6 years ago
Vassia • 0

Hi everyone, I've been trying making a Circos plot for my genomic data using RCircos package. I am new in R environment and especially with this package. If anyone is familiar with this package please share your knowledge.

This is the code I have used:

> library(RCircos)
> data("UCSC.HG19.Human.CytoBandIdeogram")
> my_data <-read.csv("data.csv", header = T)
> cyto.info <-UCSC.HG19.Human.CytoBandIdeogram
> chr.exclude <-NULL
> tracks.inside <-10
> tracks.outside <-0
> RCircos.Set.Core.Componentscyto.info, chr.exclude, tracks.inside,
> tracks.outside)
> RCircos.Reset.Plot.Parameters()
> pdf("Rcircos.pdf", height = 8, width = 8, compress = T)
> RCircos.Set.Plot.Area()
> RCircos.Chromosome.Ideogram.Plot()
> dev.off()
> name.col <-4
> side <-"in"
> track.num <-1
> RCircos.Gene.Connector.Plot(genomic.data = my_data, name.col,
> track.num, side, inside.pos = NULL, outside.pos = NULL,
> genomic.columns = 3, is.sorted = T)
> 
> track.num <-2
> 
> RCircos.Gene.Name.Plot(gene.data = my_data, name.col, track.num, side,
> inside.pos = NULL, outside.pos = NULL, genomic.columns = 3, is.sorted
> = T)

I have created a dataframe for my data with 4 columns, Chromosome name, Start position, End position and Gene name:

head(my_data)

Chr  Start       End     Gene
chr1 801943 801943 LOC643837(dist=12203),FAM41C(dist=1508) 
chr1 802289 802289 LOC643837(dist=12549),FAM41C(dist=1162)  
chr1 802300 802300 LOC643837(dist=12560),FAM41C(dist=1151)  
chr1 802320 802320 LOC643837(dist=12580),FAM41C(dist=1131)  
chr1 802338 802338 LOC643837(dist=12598),FAM41C(dist=1113)    
chr1 802381 802381 LOC643837(dist=12641),FAM41C(dist=1070)

My ideogram is plotted but when I try to connect my data and link the gene names in the plot it gives this error: "Error in RCircos.Validate.Genomic.Data(genomic.data = my_data, plot.type = c("plot"), : Some chromosomes in plot data is not in ideogram."

I have tried changing the cytoband ideogram and use the hg38 still nothing, I checked my data and has all the chromosomes in and the start and end positions are withing the range of the cytoband info found in UCSC cytoband info. I have read most of the documentation that there is for this package but still nothing, there is a simple solution I am sure of it but I cannot figure this out. I would much appreciate if anyone could explain to me where the error is and what should I try.

Thank you in advance

R RCircos Error • 6.3k views
ADD COMMENT
0
Entering edit mode

Are you sure your data has no additional chromosomes? In my dataset, I often have to filter out things like "chrUn," for example. I usually just take my data into Excel and filter out anything that isn't a standard chromosome name. That fixed the problem for me with RCircos, at least. Hope it helps.

ADD REPLY
0
Entering edit mode

Did you find the solution for this? I am getting a similar error for my data.

ADD REPLY
1
Entering edit mode
7.6 years ago

my data:

Chr  Start    End                                    Gene
1 chr1 801943 801943 LOC643837(dist=12203),FAM41C(dist=1508)
2 chr1 802289 802289 LOC643837(dist=12549),FAM41C(dist=1162)
3 chr1 802300 802300 LOC643837(dist=12560),FAM41C(dist=1151)
4 chr1 802320 802320 LOC643837(dist=12580),FAM41C(dist=1131)
5 chr1 802338 802338 LOC643837(dist=12598),FAM41C(dist=1113)
6 chr1 802381 802381 LOC643837(dist=12641),FAM41C(dist=1070)

my code:

library(RCircos)   
setwd("~/Desktop/")   
data("UCSC.HG19.Human.CytoBandIdeogram")   
my_data <-read.csv("data.csv", header = T, sep="\t")    
cyto.info <-UCSC.HG19.Human.CytoBandIdeogram   
tracks.inside <-10   
tracks.outside <-0   
chr.exclude <-NULL   
RCircos.Set.Core.Components ( cyto.info, chr.exclude, tracks.inside,tracks.outside)
#pdf("Rcircos.pdf", height = 8, width = 8, compress = T)
RCircos.Set.Plot.Area() 
RCircos.Chromosome.Ideogram.Plot() 
name.col <-4 
side <-"in" 
track.num <-1 
RCircos.Gene.Connector.Plot(genomic.data= my_data, track.num = track.num,  side=side)  
track.num <-2 
RCircos.Gene.Name.Plot(my_data, name.col,track.num, side)
#dev.off()

Remove # to store the image as pdf.

image: https://drive.google.com/file/d/0B0MpwluEDxNuM3ZROHNzeHZ3eF8za19HYVhIbUN3WTFQNXh3/view?usp=sharing

ADD COMMENT
0
Entering edit mode

Thank you cpad0112. Unfortunately, I get the same error as before: "Error in RCircos.Validate.Genomic.Data(genomic.data, "plot", genomic.columns) : Some chromosomes in plot data is not in ideogram." I have run it in a new session, removed all variables, load them again and still getting that error. Any thoughts on why? I don't think there is something wrong with the code, could be a bug error of the package? Sorry for being annoying it just does not make sense why I'm getting the same error over and over.

ADD REPLY
0
Entering edit mode

please post your session info and cross check your R version and package version with those of current versions.

ADD REPLY
0
Entering edit mode

Both R and RCircos are up-to-date.

sessionInfo() R version 3.4.0 (2017-04-21) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Sierra 10.12.4

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] RCircos_1.2.0 loaded via a namespace (and not attached): [1] compiler_3.4.0 tools_3.4.0

I am also posting the Plot Parameters for this session. Parameters for current RCircos session.

Parameters in inch:

radius.len: 1.84 chr.ideo.pos: 1.94 highlight.pos: 2.09 chr.name.pos: 2.14 plot.radius: 2.64 track.in.start: 1.89 track.out.start: 2.49 chrom.width: 0.1 track.padding: 0.02 track.height: 0.1

Parameters in chromosome unit:

base.per.unit: 30000 chrom.paddings: 300 heatmap.width: 100 hist.width: 100 gene name char. width: 500

General R graphic parameters:

text.size: 0.4 highlight.width: 2 point.type: . point.size: 1 text.color: black heatmap.color: BlueWhiteRed hist.color: red line.color: black scatter.color: black tile.color: black track.background: wheat grid.line.color: gray Bezier.point: 1000 max.layers: 5 sub.tracks: 5

Data track numbers:

tracks.inside: 10 tracks.outside: 0

Following are procedures to change RCircos plot parameters: params <- RCircos.Get.Plot.Parameters(); params$radius.len <- 2.0; params$base.per.unit <- 5000; RCircos.Reset.Plot.Parameters(params)

Chromosome ideogram data were automatically modified.

ADD REPLY
0
Entering edit mode

try running the code with default graphic parameters.

ADD REPLY
0
Entering edit mode

Can you point out exactly which line of your code gives the error?

ADD REPLY
1
Entering edit mode
7.3 years ago
adrian86 ▴ 10

Are you using dplyr and/or tibbles? if so, convert your data to a df with as.data.frame().

I had the same problem with my genomic data in R. I've been looking into the source code of the function and got no further clues. Maybe the message isn't clear enough? but you get the idea correct: there's some chromosome in your data that doesn't match the ideogram... Well, in the source code I saw this line dataChroms <- unique(as.character(genomic.data[, theCol])) (where theCol = 1). That code works different with tibbles, it doesn't return c("chr2", "chr3") (for i.e.) but something like "chr2"\n"chr3"\n and so the code breaks there.

ADD COMMENT
1
Entering edit mode
6.8 years ago

run RCircos.Get.Gene.Name.Plot.Parameters() if you have other chromosome than those listed, eg. chrMT, it won't work.

ADD COMMENT
0
Entering edit mode
7.4 years ago
ccwangxi • 0

I meet the same problem. I have not figured out how this happen.

ADD COMMENT

Login before adding your answer.

Traffic: 2190 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6