Dear all,

I got an error message: invalid graphics state as below from BUILD report for 
atSNP 0.99.23 
(https://master.bioconductor.org/packages/3.9/bioc/html/atSNP.html). This 
occurs on every platform: malbec2, tokay2, and celaya2. Running  
devtools::check()  on my local computer does not produce the error. I would 
appreciate it if anyone can help debugging.

* creating vignettes ... ERROR

--- re-building ‘atsnp-vignette.rmd’ using rmarkdown
Quitting from lines 292-294 (atsnp-vignette.rmd)
Error: processing vignette 'atsnp-vignette.rmd' failed with diagnostics:
invalid graphics state
--- failed re-building ‘atsnp-vignette.rmd’

SUMMARY: processing the following file failed:
  ‘atsnp-vignette.rmd’

Error: Vignette re-building failed.
Execution halted

The graphing function which makes the error is plotMotifMatch(match.seq,  
motif.lib = motif_library). Below is the part of the code that is needed  to be 
fixed, I think.

{
  par(mfrow=c(4,1), oma=c(1,1,4,1))
  plot.new()
  par(mar=c(1.5, 3, 4, 2))
  plotMotifLogo(pcm2pfm(ref_aug_pwm), "Best match to the reference genome", 
yaxis=FALSE, xaxis=FALSE, xlab="", ylab="PWM", ...)
if(motif.match$ref_strand=='+') {
arrows((min(which(colSums(ref_aug_pwm)!=0))-1)/ncol(ref_aug_pwm), -0.17, 
max(which(colSums(ref_aug_pwm)!=0))/ncol(ref_aug_pwm), -0.17, length = 0.1, 
angle = 15, code = 2, col = "blue", lwd = 1.5, xpd=NA)
  mtext("5'", 1, adj=(min(which(colSums(ref_aug_pwm)!=0))-1)/ncol(ref_aug_pwm), 
padj=1, col="blue", cex=1)
  mtext("3'", 1, adj=max(which(colSums(ref_aug_pwm)!=0))/ncol(ref_aug_pwm), 
padj=1, col="blue", cex=1)
} else {
arrows(max(which(colSums(ref_aug_pwm)!=0))/ncol(ref_aug_pwm), -0.17, 
(min(which(colSums(ref_aug_pwm)!=0))-1)/ncol(ref_aug_pwm), -0.17, length = 0.1, 
angle = 15, code = 2, col = "blue", lwd = 1.5, xpd=NA)
  mtext("5'", 1, adj=max(which(colSums(ref_aug_pwm)!=0))/ncol(ref_aug_pwm), 
padj=1, col="blue", cex=1)
  mtext("3'", 1, adj=(min(which(colSums(ref_aug_pwm)!=0))-1)/ncol(ref_aug_pwm), 
padj=1, col="blue", cex=1)
}
  par(mar = c(4, 3, 1.5, 2))
plotMotifLogo(pcm2pfm(ref_aug_match_pwm), font="mono,Courier", yaxis=FALSE, 
xlab="", ylab=paste("(", motif.match$ref_strand, ")", sep=""), ...)
segments(snp_loc/motif.match$snp_ref_length, 0, 
snp_loc/motif.match$snp_ref_length, 1, col="blue", lty=3, lwd=2)
segments(snp_loc/motif.match$snp_ref_length, 1, 
(snp_loc+1)/motif.match$snp_ref_length, 1, col="blue", lty=3, lwd=2)
segments((snp_loc+1)/motif.match$snp_ref_length, 0, 
(snp_loc+1)/motif.match$snp_ref_length, 1, col="blue", lty=3, lwd=2)
segments(snp_loc/motif.match$snp_ref_length, 0, 
(snp_loc+1)/motif.match$snp_ref_length, 0, col="blue", lty=3, lwd=2)
  if(motif.match$ref_strand=="+")   {
  mtext("5'", 1,  adj=0, padj=1, col="blue", cex=1)
  mtext("3'", 1,  adj=1, padj=1, col="blue", cex=1)
} else {
  mtext("3'", 1, adj=0, padj=1, col="blue", cex=1)
  mtext("5'", 1, adj=1, padj=1, col="blue", cex=1)
  }
par(mar=c(1.5, 3, 4, 2))
plotMotifLogo(pcm2pfm(snp_aug_match_pwm), "Best match to the SNP genome", 
font="mono,Courier", yaxis=FALSE, xlab="", ylab=paste("(", 
motif.match$snp_strand, ")", sep=""), ...)
segments(snp_loc/motif.match$snp_ref_length, 0, 
snp_loc/motif.match$snp_ref_length, 1, col="blue", lty=3, lwd=2)
segments(snp_loc/motif.match$snp_ref_length, 1, 
(snp_loc+1)/motif.match$snp_ref_length, 1, col="blue", lty=3, lwd=2)
segments((snp_loc+1)/motif.match$snp_ref_length, 0, 
(snp_loc+1)/motif.match$snp_ref_length, 1, col="blue", lty=3, lwd=2)
segments(snp_loc/motif.match$snp_ref_length, 0, 
(snp_loc+1)/motif.match$snp_ref_length, 0, col="blue", lty=3, lwd=2)
  if(motif.match$snp_strand=="+")   {
  mtext("5'", 1,  adj=0, padj=1, col="blue", cex=1)
  mtext("3'", 1,  adj=1, padj=1, col="blue", cex=1)
} else {
  mtext("3'", 1, adj=0, padj=1, col="blue", cex=1)
  mtext("5'", 1, adj=1, padj=1, col="blue", cex=1)
  }
par(mar=c(4, 3, 1.5, 2))
plotMotifLogo(pcm2pfm(snp_aug_pwm), yaxis=FALSE, xaxis=FALSE, xlab="", 
ylab="PWM", ...)
if(motif.match$snp_strand=='+') {
arrows((min(which(colSums(snp_aug_pwm)!=0))-1)/ncol(snp_aug_pwm), -0.17, 
max(which(colSums(snp_aug_pwm)!=0))/ncol(snp_aug_pwm), -0.17, length = 0.1, 
angle = 15, code = 2, col = "blue", lwd = 1.5, xpd=NA)
  mtext("5'", 1, adj=(min(which(colSums(snp_aug_pwm)!=0))-1)/ncol(snp_aug_pwm), 
padj=1, col="blue", cex=1)
  mtext("3'", 1, adj=max(which(colSums(snp_aug_pwm)!=0))/ncol(snp_aug_pwm), 
padj=1, col="blue", cex=1)
} else {
arrows(max(which(colSums(snp_aug_pwm)!=0))/ncol(snp_aug_pwm), -0.17, 
(min(which(colSums(snp_aug_pwm)!=0))-1)/ncol(snp_aug_pwm), -0.17, length = 0.1, 
angle = 15, code = 2, col = "blue", lwd = 1.5, xpd=NA)
  mtext("5'", 1, adj=max(which(colSums(snp_aug_pwm)!=0))/ncol(snp_aug_pwm), 
padj=1, col="blue", cex=1)
  mtext("3'", 1, adj=(min(which(colSums(snp_aug_pwm)!=0))-1)/ncol(snp_aug_pwm), 
padj=1, col="blue", cex=1)
}
title(main=paste(motif.match$motif, " Motif Scan for ", motif.match$snpid, 
sep=""), outer=TRUE, cex.main=cex.main)
}

Just in case, I added the sessionInfo() of the local run.

sessionInfo()

R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.3

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.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] atSNP_0.99.23  usethis_1.4.0  devtools_2.0.1


Best,

Sunyoung



        [[alternative HTML version deleted]]

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to