diff report_clonality/RScript.r @ 69:a59de79f6c0f draft

Uploaded
author davidvanzessen
date Mon, 08 Aug 2016 08:53:33 -0400
parents 69a6bba9ada9
children 7c9b9d97d596
line wrap: on
line diff
--- a/report_clonality/RScript.r	Tue Aug 02 09:05:44 2016 -0400
+++ b/report_clonality/RScript.r	Mon Aug 08 08:53:33 2016 -0400
@@ -572,6 +572,8 @@
       res[is.na(res)] = 0      
       infer.result = infer.clonality(as.matrix(res[,2:ncol(res)]))
       
+      print(infer.result)
+      
       write.table(data.table(infer.result[[12]]), file=paste("lymphclon_clonality_", sample_id, ".csv", sep=""), sep=",",quote=F,row.names=F,col.names=F)
       
       res$type = rowSums(res[,2:ncol(res)])
@@ -775,6 +777,27 @@
 
 PRODF = bak
 
+
+# ---------------------- D reading frame ----------------------
+
+D.REGION.reading.frame = PRODF$D.REGION.reading.frame
+
+D.REGION.reading.frame[is.na(D.REGION.reading.frame)] = "No D"
+
+D.REGION.reading.frame = data.frame(table(D.REGION.reading.frame))
+
+write.table(D.REGION.reading.frame, "DReadingFrame.csv" , sep="\t",quote=F,row.names=F,col.names=T)
+
+D.REGION.reading.frame = ggplot(D.REGION.reading.frame)
+D.REGION.reading.frame = D.REGION.reading.frame + geom_bar(aes( x = D.REGION.reading.frame, y = Freq), stat='identity', position='dodge' ) + ggtitle("D reading frame") + xlab("Frequency") + ylab("Frame")
+
+png("DReadingFrame.png")
+D.REGION.reading.frame
+dev.off()
+
+
+
+
 # ---------------------- AA composition in CDR3 ----------------------
 
 AACDR3 = PRODF[,c("Sample", "CDR3.Seq")]