changeset 69:a59de79f6c0f draft

Uploaded
author davidvanzessen
date Mon, 08 Aug 2016 08:53:33 -0400
parents 85a1d832d197
children 6fdafffd7f0f
files complete_immunerepertoire.xml report_clonality/RScript.r report_clonality/r_wrapper.sh
diffstat 3 files changed, 32 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/complete_immunerepertoire.xml	Tue Aug 02 09:05:44 2016 -0400
+++ b/complete_immunerepertoire.xml	Mon Aug 08 08:53:33 2016 -0400
@@ -10,13 +10,13 @@
 #end for
 " $out_file $out_file.files_path "$clonaltype"
 #if $gene_selection.source == "imgtdb"		
-	"${gene_selection.species}" "${gene_selection.locus}" $filterproductive $clonality_method
+	"${gene_selection.species}" "${gene_selection.locus}" $filterproductive ${clonality_method}
 #else
 	"custom" "${gene_selection.vgenes};${gene_selection.dgenes};${gene_selection.jgenes}" $filterproductive $clonality_method
 #end if
 	</command>
 	<inputs>
-		<repeat name="patients" title="Patients" min="1" default="1">
+		<repeat name="patients" title="Donor" min="1" default="1">
 			<repeat name="samples" title="Sample" min="1" default="1">
 					<param name="sample" type="data" label="Sample to Process" />
 			</repeat>
@@ -32,7 +32,7 @@
 		</param>
 		
 		<conditional name="gene_selection" >
-			<param name="source" type="select" label="Gene reference" help="" >
+			<param name="source" type="select" label="Order of V(D)J genes in graphs" help="" >
 					<option value="imgtdb" selected="true">IMGT-DB</option>
 					<option value="custom">User defined</option>
 			</param>
@@ -98,16 +98,15 @@
 			</when>
 		</conditional>
 		
-		<param name="filterproductive" type="select" label="Filter out the unproductive sequences">
+		<param name="filterproductive" type="select" label="Remove the unproductive sequences from graphs ">
 			<option value="yes">Yes</option>
 			<option value="no">No</option>
 		</param>
-
+		
 		<param name="clonality_method" type="select" label="Old clonality algorithm or the newer R package">
 			<option value="old">Old</option>
-			<option value="boyd">R Package</option>
+			<option value="boyd">R Package (needs 3 replicate minimum)</option>
 		</param>
-
 	</inputs>
 	<outputs>
 		<data format="html" name="out_file" />
--- 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")]
--- a/report_clonality/r_wrapper.sh	Tue Aug 02 09:05:44 2016 -0400
+++ b/report_clonality/r_wrapper.sh	Mon Aug 08 08:53:33 2016 -0400
@@ -105,7 +105,9 @@
 	echo "<img src='DPlot.png'/>" >> $outputFile
 fi
 echo "<img src='JPlot.png'/>" >> $outputFile
-echo "<img src='AAComposition.png'/></div>" >> $outputFile
+echo "<img src='AAComposition.png'/>" >> $outputFile
+echo "<img src='DReadingFrame.png'/>" >> $outputFile
+echo "</div>" >> $outputFile
 
 #Heatmaps