From d008e10eec3ee484217582c26af63a10093ad468 Mon Sep 17 00:00:00 2001 From: "Brian P. Walenz" Date: Mon, 21 Sep 2020 12:54:43 -0400 Subject: [PATCH] Script for generating consensus from bogart ctgStore output. --- src/pipelines/layout-to-consensus.sh | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/pipelines/layout-to-consensus.sh diff --git a/src/pipelines/layout-to-consensus.sh b/src/pipelines/layout-to-consensus.sh new file mode 100644 index 000000000..7d8cd5389 --- /dev/null +++ b/src/pipelines/layout-to-consensus.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# Runs consensus, in parallel, on a ctgStore from bogart. +# +# Magic values for partitioning: +# partitionSize - make partitions this big, relative to the biggest contig +# 0.10 - each big contig gets its own partition +# partitionScaling - expect contigs to expand by this much due to homopoly compression +# 1.50 - 50% expansion of contig length, affects memory estimate +# partitionTigs - put this many reads (as fraction of total) in a partition +# 0.01 - puts small contigs into many partitions + +asmpre=asm +cnspre=asm +errorRate=0.01 + +if [ ! -e ./${cnspre}.ctgStore/partitioning ] ; then + echo Partitioning reads. + + utgcns -V \ + -S ../../${asmpre}.seqStore \ + -T ./${cnspre}.ctgStore 1 \ + -partition 0.10 1.50 0.01 \ + > ./${cnspre}.ctgStore/partitioning.log 2>&1 +fi + +parts=`cd ./${cnspre}.ctgStore ; ls partition.???? | sed s/partition.//` + +for pp in $parts ; do + if [ ! -e "./${cnspre}.${pp}.cns" ] ; then + echo \ + utgcns \ + -R ./${cnspre}.ctgStore/partition.${pp} \ + -T ./${cnspre}.ctgStore 1 \ + -P ${pp} \ + -A ./${cnspre}.${pp}.cns.fasta \ + -O ./${cnspre}.${pp}.cns \ + -maxcoverage 50 \ + -e ${errorRate} \ + -threads 8 \& + fi +done + +exit 0