# TODO: Add comment
# 
# Author: E.Korsching May 16, 2012
###############################################################################



plot.profile <- function(x){
	# plot condensed and stacked profiles of col vectors of data
	# x: data.frame : e.g. cols: antibody measurements, rows : patient samples
	
	#ini
	nrx <- nrow(x)
	ncx <- ncol(x)
	
	x.range <- range(x)
	cat("\n x range:",x.range,", col range:\n")
	c.range <- apply(x,2,range)
	print(c.range)
	
	y <- apply(x,2,adaptScale, minS=1, maxS=4, minT=0, maxT=0.9, verbose=F)
	
	#plot
	plot(1,1, type="n", xlim=c(0,nrx+1), ylim=c(0,ncx+1), xlab="patient samples", ylab="stacked range of AB score", axes=F)
	abline(h=seq(0.5,ncx,1))
	for(i in 1:ncx){
		for(j in 1:(nrx-1)){
			plot.bar.point.segment(x=j,x2=j+1,height=y[j,i],height2=y[j+1,i],width=1,col="red",density=-1,horiz=F,at=i-0.5,lwd=0.1,type="segment")
		}
	}
	axis(side=1, labels=F, tick=F)
}


#plot.profile(x=h.uni.ident.dseed.4a)


