Mercurial > repos > davidvanzessen > plotting_merged
changeset 39:a9ad03d52680 draft
Uploaded
author | davidvanzessen |
---|---|
date | Fri, 15 Nov 2013 04:00:13 -0500 |
parents | 6e490e056fc4 |
children | 2e2a29d505c7 |
files | RScript.r |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/RScript.r Thu Nov 14 06:57:35 2013 -0500 +++ b/RScript.r Fri Nov 15 04:00:13 2013 -0500 @@ -27,6 +27,8 @@ test = read.table(inFile, sep="\t", header=TRUE, fill=T) +test = test[test$Sample != "",] + test$Top.V.Gene = gsub("[*]([0-9]+)", "", test$Top.V.Gene) test$Top.D.Gene = gsub("[*]([0-9]+)", "", test$Top.D.Gene) test$Top.J.Gene = gsub("[*]([0-9]+)", "", test$Top.J.Gene) @@ -116,6 +118,9 @@ revDchain$chr.orderD = rev(revDchain$chr.orderD) plotVD <- function(dat){ + if(length(dat[,1]) == 0){ + return() + } img = ggplot() + geom_tile(data=dat, aes(x=factor(reorder(Top.D.Gene, chr.orderD)), y=factor(reorder(Top.V.Gene, chr.orderV)), fill=relLength)) + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + @@ -148,6 +153,9 @@ plotVJ <- function(dat){ + if(length(dat[,1]) == 0){ + return() + } img = ggplot() + geom_tile(data=dat, aes(x=factor(reorder(Top.J.Gene, chr.orderJ)), y=factor(reorder(Top.V.Gene, chr.orderV)), fill=relLength)) + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + @@ -177,6 +185,9 @@ lapply(VJList, FUN=plotVJ) plotDJ <- function(dat){ + if(length(dat[,1]) == 0){ + return() + } img = ggplot() + geom_tile(data=dat, aes(x=factor(reorder(Top.J.Gene, chr.orderJ)), y=factor(reorder(Top.D.Gene, chr.orderD)), fill=relLength)) + theme(axis.text.x = element_text(angle = 90, hjust = 1)) +