R/addToPlot.r

Defines functions addToPlot

####################################################################
## Author: Gro Nilsen, Knut Liestřl and Ole Christian Lingjćrde.
## Maintainer: Gro Nilsen <gronilse@ifi.uio.no>
## License: Artistic 2.0
## Part of the copynumber package
## Reference: Nilsen and Liestřl et al. (2012), BMC Genomics
####################################################################

##Input:
### plot.ideo: should ideogram be plotted, TRUE/FALSE
### op: other plot parameters
### type: plot type; genome, sample, chromosome or aspcf



##Required by:
### plotObs
### plotSegments

##Requires:
###
###

#Add axes, labels, title and reference line to plot
addToPlot <- function(plot.ideo,op,type){
  if(!plot.ideo && type!="genome"){
	  #Labels along xaxis
		axis(side=1,cex.axis=op$cex.axis,at=op$at.x,labels=as.integer(op$at.x),mgp=op$mgp,tcl=op$tcl)
	}else{
	  #No labels
		axis(side=1,labels=FALSE,tcl=0,at=op$xlim)
	}
	axis(side=2,cex.axis=op$cex.axis,at=op$at.y,mgp=op$mgp.y,las=op$las,tcl=op$tcl)

	#x- and y-lab
	mtext(text=op$xlab,side=1,line=op$mgp[1],cex=op$cex.lab)
	mtext(text=op$ylab,side=2,line=op$mgp.y[1],cex=op$cex.lab)

	#main title for this plot
	title(main=op$main,line=op$main.line,cex.main=op$cex.main)

  #Add reference line at y=h; h=NULL suppresses plotting of ref.line:
	if(!is.null(op$h)){
		abline(h=op$h,lty=op$h.lty,lwd=op$h.lwd,col=op$h.col)
	}#endif

}#end addToPlot

Try the copynumber package in your browser

Any scripts or data that you put into this service are public.

copynumber documentation built on Nov. 8, 2020, 6:10 p.m.