From 2bb31740bcdc6a5a2ea1e11e252c4704e197ae36 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Fri, 26 Mar 2021 14:08:34 -0600 Subject: [PATCH] Add ONT consolidation script --- ont/ont-demux | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ont/ont-demux diff --git a/ont/ont-demux b/ont/ont-demux new file mode 100644 index 0000000..f551131 --- /dev/null +++ b/ont/ont-demux @@ -0,0 +1,24 @@ +#!/bin/bash +# Combines the output from the ONT GridION into a single compressed fastq file + +# Initiation, get some important info +RUNNAME=$(basename "${1}") +NUMCPU=$(grep -c processor < /proc/cpuinfo) +OUTNAME="$RUNNAME"_demux + +#echo "$RUNNAME" +#echo "$NUMCPU" +#echo "$OUTNAME" + +# Let guppy do its thing +guppy_barcoder --input_path "$RUNNAME" --save_path "$OUTNAME" --recursive --records_per_fastq 0 --compress_fastq --worker_threads "$NUMCPU" --device cuda:all:100% + +# Unzip the fastqs +parallel --gnu -j12 --eta gunzip ::: "$OUTNAME"/*/*.fastq.gz + +# Squish them together +cat "$OUTNAME"/*/*.fastq > "$OUTNAME"/"$RUNNAME".fastq + +# Rezip the fastqs +parallel --gnu -j"$NUMCPU" --eta gzip ::: "$OUTNAME"/*/*.fastq +gzip "$OUTNAME"/"$RUNNAME".fastq