annotate tools/mytools/alignvis.r @ 2:c2a356708570

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:45:42 -0500
parents 9071e359b9a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 args <- commandArgs(TRUE)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 x <- read.table(args[1])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 pdf(args[2])
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 #visualize the profile with heatmap
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 srt <- sort(x[,2],index.return=T) # sort by total number of reads
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 image(-t(log(as.matrix(x[srt$ix[1:nrow(x)],3:ncol(x)],nc=ncol(x)-2))),col=gray.colors(100))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 dev.off()
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8