#!/bin/bash

shopt -s expand_aliases

alias ~=”:«’~bash’”

:«’~~~bash’

Usage

param1=value1 param2=value2 ... runWorkFlow.sh [options]
---
title: runWorkflow.sh
---
flowchart TD
    REF[(
        

reference_file

start1 ref1 end1 start2 ref2 end2
... ... ... ... ... ...
)] MK1[(marker1)] --> DM MK2[(marker2)] --> DM R1[(fastqR1)] --> RD[removeDuplicates.sh] R2[(faqstR2)] --> RD RD --> UNIQUE[(

removeDuplicates_file

R1 R2 #
... ... ...
)] UNIQUE --> DM[demultiplex.sh] SCORE[(

minScores

score1 score2
... ...
)] SCORE --> DM DM --> ONTARGET[(

demultiplex_file

R1 R2 # id rstart1 rend1 qstart1 qend1 rstart2 rend2 qstart2 qend2
... ... ... ... ... ... ... ... ... ... ... ...
)] ONTARGET --> QUERY[(

input_file

query # id
... ... ...
)] --> REARR[rearrangement] REF --> REARR REARR --> ALG[(

rearrangement_file

idx # score id
ref1 ref2
query
)] REF --> CMH[correct_micro_homology.awk] DIRECTION[(

direction_file

up/down
...
)] --> CMH ALG --> CMH CMH --> CORRECTED[(

correct_micro_homology_file

idx # score id udangle rstart1 qstart1 rend1 qend1 random rstart2 qstart2 rend2 qend2 ddangle cut1 ref1+cut2
ref1 ref2
query
)]

Source

# The following parameters should be replaced.
makeTarget=${makeTarget:-test/test_work_flow/rearr.alg}
fastqFiles=${fastqFiles:-test/test_work_flow/A2-g1n-3.R2.fq.gz,test/test_work_flow/A2-g1n-3.fq.gz}
markerIndices=${markerIndices:-test/test_work_flow/target.fa,test/test_work_flow/pair.fa}
minScores=${minScores:-30,100}

refFile=${refFile:-test/test_work_flow/ref}
directionFile=${directionFile:-"${refFile}.direct"}

# The following parameters are default in most cases.
s0=${s0:--6}
s1=${s1:-4}
s2=${s2:-2}
u=${u:--3}
v=${v:--9}
ru=${ru:-0}
rv=${rv:-0}
qu=${qu:-0}
qv=${qv:--5}

default_prefix=${CONDA_PREFIX:-"${HOME}/.local"}
prefix=${prefix:-"${default_prefix}"}
if [ -f "workFlow.mak" ]
then
    make_file="workFlow.mak"
else
    make_file="${prefix}/share/rearr/workFlow.mak"
fi

make $@ -f "${make_file}" "${makeTarget}" \
    fastqFiles="${fastqFiles}" \
    markerIndices="${markerIndices}" \
    minScores="${minScores}" \
    refFile="${refFile}" \
    directionFile="${directionFile}" \
    s0="${s0}" \
    s1="${s1}" \
    s2="${s2}" \
    u="${u}" \
    v="${v}" \
    ru="${ru}" \
    rv="${rv}" \
    qu="${qu}" \
    qv="${qv}"
alias ~~~=":" # This suppresses a warning and is not part of source.