changeset 3:275ab5175fd6 draft

Uploaded
author davidvanzessen
date Thu, 27 Oct 2016 09:40:45 -0400
parents e85fec274cde
children 477e95b098fd
files merge_and_filter.r shm_csr.py shm_csr.r wrapper.sh
diffstat 4 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/merge_and_filter.r	Thu Oct 27 07:26:45 2016 -0400
+++ b/merge_and_filter.r	Thu Oct 27 09:40:45 2016 -0400
@@ -194,6 +194,10 @@
 	result[!higher_than,"best_match"] = paste("unmatched,", result[!higher_than,"best_match"])
 }
 
+if(class.filter == "101_101"){
+	result$best_match = "all"
+}
+
 if(any(higher_than, na.rm=T)){
 	#summ = summ[higher_than,]
 }
--- a/shm_csr.py	Thu Oct 27 07:26:45 2016 -0400
+++ b/shm_csr.py	Thu Oct 27 09:40:45 2016 -0400
@@ -85,7 +85,7 @@
 	AALength = 64
 
 AA_mutation = [0] * AALength
-AA_mutation_dic = {"IGA": AA_mutation[:], "IGG": AA_mutation[:], "IGM": AA_mutation[:], "unm": AA_mutation[:]}
+AA_mutation_dic = {"IGA": AA_mutation[:], "IGG": AA_mutation[:], "IGM": AA_mutation[:], "unm": AA_mutation[:], "all": AA_mutation[:]}
 AA_mutation_empty = AA_mutation[:]
 
 aa_mutations_by_id_file = outfile[:outfile.rindex("/")] + "/aa_id_mutations.txt"
--- a/shm_csr.r	Thu Oct 27 07:26:45 2016 -0400
+++ b/shm_csr.r	Thu Oct 27 09:40:45 2016 -0400
@@ -414,8 +414,8 @@
 p = ggplot(dat.clss, aes(best_match, percentage_mutations))
 p = p + geom_point(aes(colour=best_match), position="jitter") + geom_boxplot(aes(middle=mean(percentage_mutations)), alpha=0.1, outlier.shape = NA)
 p = p + xlab("Subclass") + ylab("Frequency") + ggtitle("Frequency scatter plot") + theme(panel.background = element_rect(fill = "white", colour="black"), text = element_text(size=13, colour="black"))
-p = p + scale_fill_manual(values=c("IGA" = "blue4", "IGA1" = "lightblue1", "IGA2" = "blue4", "IGG" = "olivedrab3", "IGG1" = "olivedrab3", "IGG2" = "red", "IGG3" = "gold", "IGG4" = "darkred", "IGM" = "darkviolet"))
-p = p + scale_colour_manual(values=c("IGA" = "blue4", "IGA1" = "lightblue1", "IGA2" = "blue4", "IGG" = "olivedrab3", "IGG1" = "olivedrab3", "IGG2" = "red", "IGG3" = "gold", "IGG4" = "darkred", "IGM" = "darkviolet"))
+p = p + scale_fill_manual(values=c("IGA" = "blue4", "IGA1" = "lightblue1", "IGA2" = "blue4", "IGG" = "olivedrab3", "IGG1" = "olivedrab3", "IGG2" = "red", "IGG3" = "gold", "IGG4" = "darkred", "IGM" = "darkviolet", "all" = "blue4"))
+p = p + scale_colour_manual(values=c("IGA" = "blue4", "IGA1" = "lightblue1", "IGA2" = "blue4", "IGG" = "olivedrab3", "IGG1" = "olivedrab3", "IGG2" = "red", "IGG3" = "gold", "IGG4" = "darkred", "IGM" = "darkviolet", "all" = "blue4"))
 
 png(filename="scatter.png")
 print(p)
@@ -441,7 +441,7 @@
 
 p = ggplot(frequency_bins_data, aes(frequency_bins, frequency))
 p = p + geom_bar(aes(fill=best_match_class), stat="identity", position="dodge") + theme(panel.background = element_rect(fill = "white", colour="black"), text = element_text(size=13, colour="black"))
-p = p + xlab("Frequency ranges") + ylab("Frequency") + ggtitle("Mutation Frequencies by class") + scale_fill_manual(values=c("IGA" = "blue4", "IGG" = "olivedrab3", "IGM" = "black"))
+p = p + xlab("Frequency ranges") + ylab("Frequency") + ggtitle("Mutation Frequencies by class") + scale_fill_manual(values=c("IGA" = "blue4", "IGG" = "olivedrab3", "IGM" = "black", "all" = "blue4"))
 
 png(filename="frequency_ranges.png")
 print(p)
--- a/wrapper.sh	Thu Oct 27 07:26:45 2016 -0400
+++ b/wrapper.sh	Thu Oct 27 09:40:45 2016 -0400
@@ -260,17 +260,17 @@
 		done < $outdir/data_${func}.txt
 		
 	else
-		tmp=`cat $outdir/unmatched_${func}_n.txt`
+		tmp=`cat $outdir/all_${func}_n.txt`
 		echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output
 		
 		while IFS=, read name cax cay caz ca1x ca1y ca1z ca2x ca2y ca2z cgx cgy cgz cg1x cg1y cg1z cg2x cg2y cg2z cg3x cg3y cg3z cg4x cg4y cg4z cmx cmy cmz unx uny unz allx ally allz
 		do
 			if [ "$name" == "FR R/S (ratio)" ] || [ "$name" == "CDR R/S (ratio)" ] ; then #meh
-				echo "<tr><td>$name</td><td>${unx}/${uny}</td></tr>" >> $output
+				echo "<tr><td>$name</td><td>${allx}/${ally}</td></tr>" >> $output
 			elif [ "$name" == "Median of Number of Mutations (%)" ] ; then
-				echo "<tr><td>$name</td><td>${unz}%</td></tr>" >> $output
+				echo "<tr><td>$name</td><td>${allz}%</td></tr>" >> $output
 			else
-				echo "<tr><td>$name</td><td>${unx}/${uny} (${unz}%)</td></tr>" >> $output
+				echo "<tr><td>$name</td><td>${allx}/${ally} (${allz}%)</td></tr>" >> $output
 			fi
 		done < $outdir/data_${func}.txt