# HG changeset patch # User davidvanzessen # Date 1384506013 18000 # Node ID a9ad03d52680d8d35fc9388f91123e61b0d16efe # Parent 6e490e056fc414c461ae44c9532d5b2f2f9e7805 Uploaded diff -r 6e490e056fc4 -r a9ad03d52680 RScript.r --- 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)) +