changeset 4:8ba0fd5b03a1 draft

Uploaded
author davidvanzessen
date Tue, 10 Dec 2013 05:52:37 -0500
parents e1aa99d86a8a
children 3ce07f5889ad
files RScript.r combined.sh igblastmerge.py
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/RScript.r	Mon Dec 09 07:13:51 2013 -0500
+++ b/RScript.r	Tue Dec 10 05:52:37 2013 -0500
@@ -38,6 +38,9 @@
 test$VDJCDR3 = do.call(paste, c(test[unlist(strsplit(clonalType, ","))], sep = ":"))
 
 PROD = test[test$VDJ.Frame != "In-frame with stop codon" & test$VDJ.Frame != "Out-of-frame" & test$CDR3.Found.How != "NOT_FOUND" , ]
+if("Functionality" %in% colnames(test)) {
+	PROD = test[test$Functionality == "productive" | test$Functionality == "productive (see comment)", ]
+}
 
 NONPROD = test[test$VDJ.Frame == "In-frame with stop codon" | test$VDJ.Frame == "Out-of-frame" | test$CDR3.Found.How == "NOT_FOUND" , ]
 
@@ -90,6 +93,8 @@
 
 setwd(outDir)
 
+write.table(PRODF, "allUnique.tsv", sep="\t",quote=F,row.names=T,col.names=T)
+
 pV = ggplot(PRODFV)
 pV = pV + geom_bar( aes( x=factor(reorder(Top.V.Gene, chr.orderV)), y=relFreq, fill=Sample), stat='identity', position="dodge") + theme(axis.text.x = element_text(angle = 90, hjust = 1))
 pV = pV + xlab("Summary of V gene") + ylab("Frequency") + ggtitle("Relative frequency of V gene usage")
@@ -231,7 +236,6 @@
 	clonalityFrame = PROD
 	clonalityFrame$ReplicateConcat = do.call(paste, c(clonalityFrame[c("VDJCDR3", "Sample", "Replicate")], sep = ":"))
 	clonalityFrame = clonalityFrame[!duplicated(clonalityFrame$ReplicateConcat), ]
-	
 	write.table(clonalityFrame, "clonalityComplete.tsv", sep="\t",quote=F,row.names=T,col.names=T)
 
 	ClonalitySampleReplicatePrint <- function(dat){
@@ -247,7 +251,7 @@
 
     clonalityFrameSplit = split(clonalityFrame, f=clonalityFrame[,"Sample"])
     lapply(clonalityFrameSplit, FUN=ClonalitySamplePrint)
-	
+
 	clonalFreq = data.frame(data.table(clonalityFrame)[, list(Type=.N), by=c("Sample", "VDJCDR3")])
 	clonalFreqCount = data.frame(data.table(clonalFreq)[, list(Count=.N), by=c("Sample", "Type")])
 	clonalFreqCount$realCount = clonalFreqCount$Type * clonalFreqCount$Count
--- a/combined.sh	Mon Dec 09 07:13:51 2013 -0500
+++ b/combined.sh	Tue Dec 10 05:52:37 2013 -0500
@@ -30,7 +30,6 @@
 	mergerInput+=($convertedFileName)
 	count=$((count+1))
 done
-wait
 
 
 
--- a/igblastmerge.py	Mon Dec 09 07:13:51 2013 -0500
+++ b/igblastmerge.py	Tue Dec 10 05:52:37 2013 -0500
@@ -7,7 +7,7 @@
 # main
 def main():
     args = sys.argv[1:-2]
-    print args
+    
     try:
         o = open(sys.argv[-1], 'w')
         i = open(args[1], 'r')