changeset 7:18ede27dc6b0 draft

Uploaded
author davidvanzessen
date Tue, 04 Nov 2014 08:59:34 -0500
parents 6b348d07da49
children cd56ce86c4bf
files demultiplex.xml wrapper.sh
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/wrapper.sh	Mon Jul 14 05:47:08 2014 -0400
+++ b/wrapper.sh	Tue Nov 04 08:59:34 2014 -0500
@@ -38,7 +38,15 @@
 workdir=$PWD
 cd $outDir
 echo "$3"
-result=`$dir/sff2fastq $input | $dir/fastx_barcode_splitter.pl --bcfile $outDir/barcodes.txt --prefix "$prefix" --suffix ".fastq" --$EOL --mismatches $mismatches --partial $partial`
+filetype=`file $input`
+result=""
+if [[ $filetype == *ASCII* ]]
+then
+	result=`cat $input | $dir/fastx_barcode_splitter.pl --bcfile $outDir/barcodes.txt --prefix "$prefix" --suffix ".fastq" --$EOL --mismatches $mismatches --partial $partial`
+else
+	result=`$dir/sff2fastq $input | $dir/fastx_barcode_splitter.pl --bcfile $outDir/barcodes.txt --prefix "$prefix" --suffix ".fastq" --$EOL --mismatches $mismatches --partial $partial`
+fi
+
 echo "$result" | tail -n +2 | sed 's/\t/,/g' > output.txt
 echo "<html><head><title>$name demultiplex</title></head><body><table border='1'><thead><tr><th>ID</th><th>Count</th><th>FASTQ</th><th>FASTA</th><th>Trimmed FASTA</th><th>FASTQC</th></tr></thead><tbody>" >> $output
 while IFS=, read barcode count location
@@ -56,3 +64,14 @@
 		echo "<tr><td>$barcode</td><td>$count</td><td><a href='$file.fastq'>$file.fastq</a></td><td><a href='$file.fasta'>$file.fasta</a></td><td><a href='${file}_trimmed.fasta'>${file}_trimmed.fasta</a></td><td><a href='${name}_${barcode}_fastqc.html'>Report</a></td></tr>" >> $output
 done < output.txt
 echo "</tbody></body></html>" >> $output
+
+:'
+mids = "mid\tforward\treverse"
+fal = "file with sequenses on single line (no multiline)"
+for mid in mids:
+	forwardmids = len([x for x in fal if re.match("^" + mid[1], x)])
+	reversemids = len([x for x in fal if re.match(mid[2] + "$", x)])
+	both = len([x for x in fal if re.match("^" + mid[1] + ".*" + mid[2] + "$", x)])
+	if (forwardmids + reversemids + both) > 0:
+		print "%s: %d - %d - %d" % (mid[0], forwardmids, reversemids, both)
+'