changeset 5:0544b052af07 draft

Uploaded
author davidvanzessen
date Tue, 10 Dec 2013 07:26:10 -0500
parents 83a2a084577f
children a43100e5d032
files imgtconvert.py plotting_merged.xml r_wrapper.sh
diffstat 3 files changed, 53 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/imgtconvert.py	Fri Nov 29 07:07:49 2013 -0500
+++ b/imgtconvert.py	Tue Dec 10 07:26:10 2013 -0500
@@ -18,7 +18,7 @@
 old_sequence_columns = [u'CDR1-IMGT', u'CDR2-IMGT', u'CDR3-IMGT']
 old_junction_columns = [u'JUNCTION']
 
-added_summary_columns = [u'V-REGION identity %', u'V-REGION identity nt', u'D-REGION reading frame', u'AA JUNCTION', u'Functionality comment', u'Sequence']
+added_summary_columns = [u'Functionality', u'V-REGION identity %', u'V-REGION identity nt', u'D-REGION reading frame', u'AA JUNCTION', u'Functionality comment', u'Sequence']
 added_sequence_columns = [u'FR1-IMGT', u'FR2-IMGT', u'FR3-IMGT', u'CDR3-IMGT', u'JUNCTION', u'J-REGION', u'FR4-IMGT']
 added_junction_columns = [u"P3'V-nt nb", u'N1-REGION-nt nb', u"P5'D-nt nb", u"P3'D-nt nb", u'N2-REGION-nt nb', u"P5'J-nt nb", u"3'V-REGION trimmed-nt nb", u"5'D-REGION trimmed-nt nb", u"3'D-REGION trimmed-nt nb", u"5'J-REGION trimmed-nt nb"]
 
@@ -104,9 +104,9 @@
     for col in added_junction_columns:
         tmp[col] = fJunction[col]
 
-    outFrame.append(tmp)
+    outFrame = outFrame.append(tmp)
 
-outFrame.columns = [u'ID', u'VDJ Frame', u'Top V Gene', u'Top D Gene', u'Top J Gene', u'CDR1 Seq', u'CDR1 Length', u'CDR2 Seq', u'CDR2 Length', u'CDR3 Seq', u'CDR3 Length', u'CDR3 Seq DNA', u'CDR3 Length DNA', u'Strand', u'CDR3 Found How', 'V-REGION identity %', 'V-REGION identity nt', 'D-REGION reading frame', 'AA JUNCTION', 'Functionality comment', 'Sequence', 'FR1-IMGT', 'FR2-IMGT', 'FR3-IMGT', 'CDR3-IMGT', 'JUNCTION', 'J-REGION', 'FR4-IMGT', 'P3V-nt nb', 'N1-REGION-nt nb', 'P5D-nt nb', 'P3D-nt nb', 'N2-REGION-nt nb', 'P5J-nt nb', '3V-REGION trimmed-nt nb', '5D-REGION trimmed-nt nb', '3D-REGION trimmed-nt nb', '5J-REGION trimmed-nt nb']
+outFrame.columns = [u'ID', u'VDJ Frame', u'Top V Gene', u'Top D Gene', u'Top J Gene', u'CDR1 Seq', u'CDR1 Length', u'CDR2 Seq', u'CDR2 Length', u'CDR3 Seq', u'CDR3 Length', u'CDR3 Seq DNA', u'CDR3 Length DNA', u'Strand', u'CDR3 Found How', u'Functionality', 'V-REGION identity %', 'V-REGION identity nt', 'D-REGION reading frame', 'AA JUNCTION', 'Functionality comment', 'Sequence', 'FR1-IMGT', 'FR2-IMGT', 'FR3-IMGT', 'CDR3-IMGT', 'JUNCTION', 'J-REGION', 'FR4-IMGT', 'P3V-nt nb', 'N1-REGION-nt nb', 'P5D-nt nb', 'P3D-nt nb', 'N2-REGION-nt nb', 'P5J-nt nb', '3V-REGION trimmed-nt nb', '5D-REGION trimmed-nt nb', '3D-REGION trimmed-nt nb', '5J-REGION trimmed-nt nb']
 
 vPattern = re.compile(r"IGHV[1-9]-[0-9ab]+-?[1-9]?")
 dPattern = re.compile(r"IGHD[1-9]-[0-9ab]+")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plotting_merged.xml	Tue Dec 10 07:26:10 2013 -0500
@@ -0,0 +1,15 @@
+<tool id="test_plotting_merged" name="TEST-Plotting the merged data-TEST" version="1.0">
+	<description>Creating a graph of the merged reports.</description>
+	<command interpreter="bash">
+		r_wrapper.sh $in_file $out_file $out_file.files_path
+	</command>
+	<inputs>
+		<param name="in_file" format="tabular" type="data" label="Data to Process" />
+	</inputs>
+	<outputs>
+		<data format="html" name="out_file" />
+	</outputs>
+	<help>
+		Step 4 of the Immune Repertoire tools, plots the merged data, generating 3 bar charts for V, D and J frequencies and 3 heatmaps for every sample (V-D, V-J, D-J)
+	</help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/r_wrapper.sh	Tue Dec 10 07:26:10 2013 -0500
@@ -0,0 +1,35 @@
+#!/bin/bash
+echo $1
+echo $2
+echo $3
+
+inputFile=$1
+outputFile=$2
+outputDir=$3
+dir="$(cd "$(dirname "$0")" && pwd)"
+mkdir $3
+Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir 2>&1
+echo "<html>" >> $2
+echo "<img src='VPlot.png'/>" >> $2
+echo "<img src='DPlot.png'/>" >> $2
+echo "<img src='JPlot.png'/>" >> $2
+
+samples=`cat $outputDir/samples.txt`
+count=1
+echo "<table border='1'>" >> $outputFile
+for sample in $samples; do
+	echo "<tr><td colspan='3' height='100'></td>" >> $outputFile
+	echo "<tr><td colspan='3'><h1>$sample</h1></td></tr>" >> $outputFile
+	echo "<tr><td><h2>V-D Heatmap:</h2></td><td><h2>V-J Heatmap:</h2></td><td><h2>D-J Heatmap:</h2></td></tr><tr>" >> $outputFile
+	mv "$outputDir/HeatmapVD_$sample.png" "$outputDir/VD_$sample.png"
+	echo "<td><img src='VD_$sample.png'/></td>" >> $outputFile
+	mv "$outputDir/HeatmapVJ_$sample.png" "$outputDir/VJ_$sample.png"
+	echo "<td><img src='VJ_$sample.png'/></td>" >> $outputFile
+	mv "$outputDir/HeatmapDJ_$sample.png" "$outputDir/DJ_$sample.png"
+	echo "<td><img src='DJ_$sample.png'/></td></tr>" >> $outputFile
+	count=$((count+1))
+done
+echo "</table>" >> $outputFile
+
+echo "</html>" >> $2
+