changeset 7:e55dfd9a8c00 draft default tip

Uploaded
author davidvanzessen
date Thu, 12 Feb 2015 10:47:15 -0500
parents 7346cd210a43
children
files vidjil.sh vidjil.xml
diffstat 2 files changed, 21 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/vidjil.sh	Thu Feb 12 09:54:07 2015 -0500
+++ b/vidjil.sh	Thu Feb 12 10:47:15 2015 -0500
@@ -2,21 +2,24 @@
 set -e
 
 inputFile=$1
-outputFile=$2
-outputDir=$3
-database=$4
-limit_reads=$5
-limit_ratio=$6
-selection=$7
-germline=$8
+id=$2
+outputFile=$3
+outputDir=$4
+database=$5
+limit_reads=$6
+limit_ratio=$7
+selection=$8
+germline=$9
+fastaFile=${10}
 
+wd="$PWD"
 dir="$(cd "$(dirname "$0")" && pwd)"
 mkdir $outputDir
+mkdir $outputDir/data
+echo "<html><center><h1><a href='index.html'>Click here for the results</a></h1>Tip: Open it in a new tab (middle mouse button or right mouse button -> 'open in new tab' on the link above)</center></html>" > $outputFile
 
 unzip $dir/browser.zip -d $outputDir/ > $outputDir/unziplog.log
 
-mkdir $outputDir/data
-
 if [[ "$database" == "download" ]] ; then
 	echo "Downloading up to date database from IMGT..."
 	mkdir $outputDir/tmp
@@ -31,34 +34,12 @@
 	cd $dir
 fi
 
+./vidjil -G germline/$germline -y all -r ${limit_reads} -% ${limit_ratio} -b $id -o $outputDir/data $inputFile
 
-inputFiles=$(echo "$inputFile" | tr "| " "\n")
-files_for_config=""
-last_file=""
-for id_file in $inputFiles
-do
-	tmp=($(echo "${id_file}" | tr ";" "\n"))
-	id=${tmp[0]}
-	file=${tmp[1]}
-	
-	./vidjil -G germline/$germline -y all -r ${limit_reads} -% ${limit_ratio} -b $id -o $outputDir/data $file
-	
-	if [[ "$files_for_config" != "" ]] ; then
-		files_for_config="${files_for_config},"
-	fi
-	files_for_config="${files_for_config}'${id}.vidjil'"
-	last_file="${id}.vidjil"
-done
-
-echo "<html><center><h1><a href='index.html'>Click here for the results</a></h1>Tip: Open it in a new tab (middle mouse button or right mouse button -> 'open in new tab' on the link above)</center></html>" > $outputFile
+mv $outputDir/data/${id}.vdj.fa $fastaFile
 
 echo -e \
 "var config = {\n" \
-"    'file_menu' : {\n" \
-"        'path' : 'data/',\n" \
-"        'file' : [\n" \
-"            ${files_for_config}\n" \
-"        ]\n" \
-"    },\n" \
-"    'autoload' : 'data/${last_file}'\n" \
+"    'autoload' : 'data/${id}.vidjil'\n" \
 "}" > $outputDir/js/conf.js;
+
--- a/vidjil.xml	Thu Feb 12 09:54:07 2015 -0500
+++ b/vidjil.xml	Thu Feb 12 10:47:15 2015 -0500
@@ -1,17 +1,11 @@
 <tool id="vidjil_galaxy_wrapper" name="Vidjil" version="1.0">
 	<description></description>
 	<command interpreter="bash">
-		vidjil.sh "
-#for $i, $f in enumerate($in_files)
-${f.id};${f.in_file}|
-#end for
-" $out_file $out_file.files_path $database $limit_reads $limit_ratio $selection $germline
+		vidjil.sh $in_file $id $out_file $out_file.files_path $database $limit_reads $limit_ratio $selection $germline $fasta_out
 	</command>
 	<inputs>
-		<repeat name="in_files" title="Input Files" min="1" default="1">
-			<param name="in_file" type="data" format="fasta,fastq" label="Data to Process" />
-			<param name="id" type="text" label="ID" />
-		</repeat>
+		<param name="in_file" type="data" format="fasta,fastq" label="Data to Process" />
+		<param name="id" type="text" label="ID" />
 		<param name="database" type="select" label="Database">
 			<option value="current">Germline database from IMGT of 30-9-14</option>
 			<option value="download">Download newest database from IMGT</option>
@@ -34,7 +28,8 @@
 		<param name="limit_ratio" type="text" label="Minimal percentage of reads supporting a clone" value='0'/>
 	</inputs>
 	<outputs>
-		<data format="html" name="out_file" label="Vidjil on blah"/>
+		<data format="html" name="out_file" label="Vidjil browser of ${in_file.name}"/>
+		<data format="fasta" name="fasta_out" label="Vidjil fasta of ${in_file.name}" />
 	</outputs>
 	<help>
 A Galaxy wrapper for Vidijl and the Vidjil browser for analysis and visualization of **FASTA** and **FASTQ** files.