DNAcopy plot error
1
0
Entering edit mode
5.0 years ago

I am running DNAcopy package for copy number analysis on whole genome sequencing data. I successfully plotted chromosome and map position but when i was trying to plot by chromosome , I am continuously getting an error. Following is my code and error.

> setwd("C:/Users/User/Desktop/DNAcopy")

> library(DNAcopy)

> P1 = read.table ("R025.output.copynumber.called", header=TRUE)

> CNA.object <- CNA( genomdat = P1[,7], chrom = P1[,1], maploc = P1 [,2], data.type = 'logratio',sampleid="R025")

> CNA.object.smoothed     <- smooth.CNA(CNA.object)

> CNA.object.smoothed.seg <- segment(CNA.object.smoothed, verbose=0, min.width=2)

> seg.pvalue <- segments.p(CNA.object.smoothed.seg, ngrid=100, tol=1e-6, alpha=0.05, search.range=100, nperm=1000)

> write.table (seg.pvalue,file="R025_DNAcopy.pvalue", row.names=F, col.names=T, quote=F, sep="\t")

> jpeg("R025.jpeg")

> plot(CNA.object.smoothed.seg, plot.type="w")

> dev.off()

null device 
          1 

> plot(CNA.object.smoothed.seg, plot.type="s")

Setting multi-figure configuration

Error in plot.new() : figure margins too large
R sequencing CNV analysis next-gen • 1.4k views
ADD COMMENT
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

Thanks!

ADD REPLY
2
Entering edit mode
5.0 years ago

"1) "Error in plot.new() : figure margins too large"

This error indicates that the margins of the particular plot are very large while the region allocated for the plot is too small. You can solve this problem by increasing the size of the plots pane. " - via https://support.rstudio.com/hc/en-us/articles/200488548-Problem-with-Plots-or-Graphics-Device

ADD COMMENT
0
Entering edit mode

Also, try not to save your figures as JPG, PNG, BMP, or any other pixel format. These are difficult to manipulate later and can look grainy and horrendous when zoomed in. Use vector-based image formats, like PDF and SVG.

In your code above, I would do:

pdf('image1.pdf', width = 12, height = 12)
  plot(CNA.object.smoothed.seg, plot.type="w")
dev.off()

pdf('image1.pdf', width = 12, height = 12)
  plot(CNA.object.smoothed.seg, plot.type="s")
dev.off()
ADD REPLY
1
Entering edit mode

Thank you for your suggestion. It worked for me.

ADD REPLY

Login before adding your answer.

Traffic: 2640 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