#!/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 |
|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... |
removeDuplicates_file
| R1 | R2 | # |
|---|---|---|
| ... | ... | ... |
minScores
| score1 | score2 |
|---|---|
| ... | ... |
demultiplex_file
| R1 | R2 | # | id | rstart1 | rend1 | qstart1 | qend1 | rstart2 | rend2 | qstart2 | qend2 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
input_file
| query | # | id |
|---|---|---|
| ... | ... | ... |
rearrangement_file
| idx | # | score | id |
| ref1 | ref2 | ||
| query |
direction_file
| up/down |
|---|
| ... |
correct_micro_homology_file
| idx | # | score | id | udangle | rstart1 | qstart1 | rend1 | qend1 | random | rstart2 | qstart2 | rend2 | qend2 | ddangle | cut1 | ref1+cut2 |
| ref1 | ref2 | |||||||||||||||
| query |
optionsare passed to the underlyingmakecalling.makeTargetis the file you want to generate. The underlymakeengine use file extensions to determine which step to run, so the file extension matters. Depending onmakeTarget, you may need to provide additional parameters and input files.- To remove duplicates for paired (or multiply paired)
fastqfiles, runmakeTarget=removeDuplicates_file.noDup \ fastqFiles=fastqR1,fastqR2,... \ runWorkFlow.shFor more details, see
removeDuplicates.sh. - To demultiplex
removeDuplicates_file.noDup, runmakeTarget=demultiplex_file.demultiplex \ markerIndices=marker1,marker2,... \ minScores=score1,scores2,... \ runWorkFlow.shFor more details, see
demultiplex.sh. Ifmarkeris not indexed bybowtie2,runWorkFlow.shwill index it silently - To align
query.postto reference and correct microhomology, runmakeTarget=correct_micro_homology_file.alg \ refFile=reference_file \ directionFile=direction_file \ runWorkFlow.shChimeric alignment scores used by
rearrangementcan be set as follows.s0=-6 s1=4 s2=2 u=-3 v=-9 ru=0 rv=0 qu=0 qv=-5For more details, see core part of rearr. If only
refFileis provided, a defaultdirectionFile=${refFile}.directwill be created with allup. For more details, seeworkFlow.mak. - The output of
demultiplex.shdoes not fit the input of core part of rearr. The transformation between them is highly dependent on the design of experiment and changes from now and that. By default,workFlow.makuse the first column of the output ofdemultiplex.shas query. - To run the full workflow for the test data (the test data put fastqR2 before fastqR1),
makeTarget=correct_micro_homology_file.alg \ fastqFiles=fastqR2,fastqR1 \ markerIndices=pasmid_file.target.fa,pasmid_file.pair.fa \ refFile=plasmid_file.ref \ ./runWorkFlow.shrunWorkFlow.shwill run all steps above for you to generatecorrect_micro_homology_file.alg. runWorkFlow.shuse make engine, which skips the updating of the outputs if no change is detected in the inputs necesary to generate that output. This saves computations for you.
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.