# HG changeset patch # User davidvanzessen # Date 1386672757 18000 # Node ID 8ba0fd5b03a17e913ab2f7bd325b836a89930dd1 # Parent e1aa99d86a8ac6708b62cbeec6b6d67b8c812cfc Uploaded diff -r e1aa99d86a8a -r 8ba0fd5b03a1 RScript.r --- 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 diff -r e1aa99d86a8a -r 8ba0fd5b03a1 combined.sh --- 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 diff -r e1aa99d86a8a -r 8ba0fd5b03a1 igblastmerge.py --- 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')