Entering edit mode
6.4 years ago
monsah1991
•
0
This is my code :
data(UCSC.Mouse.GRCm38.CytoBandIdeogram);
data(UCSC.HG38.Human.CytoBandIdeogram);
mouse.data <- mouse.bed;
human.data <- input.bed;
pattern<-"chrM";
pattern2<-"random";
link.data <- data.frame(mouse.data[,1:3], human.data[,1:3]);
if(length(which(link.data$V1=="chrM"))>0 ||length(which(link.data$V1=="random")) >0){
link.data=link.data[-which(link.data$V1=="chrM"),]
link.data=link.data[- grep("random",link.data$V1),];
}
species.list <- c("M", "H");
cyto.list <- list(UCSC.Mouse.GRCm38.CytoBandIdeogram,
UCSC.HG38.Human.CytoBandIdeogram);
RCircos.Multiple.Species.Core.Components(cyto.list,
species.list, NULL, 5, 5);
data.list <- list(mouse.data,
human.data);
link.data[,1] <- paste(species.list[1], link.data[,1], sep="");
link.data[,4] <- paste(species.list[2], link.data[,4], sep="");
params <- RCircos.Get.Plot.Parameters();
params$chrom.paddings<-1000;
params$chrom.width<-0.3;
params$chrom.paddings=2000;
params$base.per.unit <- 30000;
RCircos.Reset.Plot.Parameters(params);
pdf(file="MousevsHuman.pdf", height=8, width=8);
RCircos.Set.Plot.Area();
par(mai=c(0.25, 0.25, 0.25, 0.25));
plot.new();
plot.window(c(-2.5,2.5), c(-2.5, 2.5));
# Plot chromosome ideogram and link lines
RCircos.Chromosome.Ideogram.Plot();
track.num<-1;
RCircos.Link.Plot(link.data, track.num, FALSE,lineWidth=10);
data(RCircos.Gene.Label.Data);
name.col <- 4;
side <- "out";
track.num <- 1;
RCircos.Gene.Connector.Plot(RCircos.Gene.Label.Data,
track.num, side);
track.num <- 2;
RCircos.Gene.Name.Plot(RCircos.Gene.Label.Data,
name.col,track.num, side);
title(" Mouse and Human Gene Expression");
legend(1, 2, legend=c("Right:Mouse",
"Left: Human"), cex=0.8);
dev.off();
message("done ...\n\n");
It would make sense if my chromosome list wasn't found in ideogram, BUT surprisingly RCircos.Link.Plot which ALSO has the Validate function works! So the error isn't really coming from my list of chromosomes. This Validate function ONLY gives an error when I include :
data(RCircos.Gene.Label.Data);
name.col <- 4;
side <- "out";
track.num <- 1;
RCircos.Gene.Connector.Plot(RCircos.Gene.Label.Data,
track.num, side);
track.num <- 2;
RCircos.Gene.Name.Plot(RCircos.Gene.Label.Data,
name.col,track.num, side);
Without this piece of code, my plot works perfectly. I'm really confused ! I need to label the genes but I keep getting this error! My data is correct and the proof that the plot works without this code (only gives me links)
Could you please provide some example data?