Skip to content
Snippets Groups Projects
Commit 41d39af1 authored by Achisha Saikia's avatar Achisha Saikia
Browse files

Update file atacseq_runner.sh

parent 448c6504
No related merge requests found
......@@ -333,10 +333,10 @@ for key in "${!OPTS[@]}"; do
done
NFCORE_WF="ATACseq"
NFCORE_WF_VERSION="2.0"
NFCORE_WF_COMMIT="971984a48ad4dc5b39fc20b56c5729f4ca20379a" # the commit for tags/2.0
CUTANDRUN_DIR="$SCRIPTPATH/$NFCORE_WF"
NFCORE_WF="nfcore_atacseq"
NFCORE_WF_VERSION="2.1.2"
NFCORE_WF_COMMIT="1a1dbe52ffbd82256c941a032b0e22abbd925b8a" # the commit for tags/2.0 #What is this???
ATACseq_DIR="$SCRIPTPATH/$NFCORE_WF"
# set max total resources
max_time="480.h"
......@@ -350,20 +350,20 @@ ${max_time}, ${max_cpus} CPUs, ${max_memory} Memory on $(hostname -s).
## Fix the configs
# Comment out email notification part from the configure file
config_cutandrun="${CUTANDRUN_DIR}/workflows/cutandrun.nf"
if [[ -f $config_cutandrun ]]; then
if ! grep "// NfcoreTemplate.email" $config_cutandrun > /dev/null; then
config_atacseq="${ATACseq_DIR}/workflows/atacseq.nf" ##Check this??
if [[ -f $config_atacseq ]]; then
if ! grep "// NfcoreTemplate.email" $config_atacseq > /dev/null; then
sed -i "s/NfcoreTemplate.email/\/\/ NfcoreTemplate.email/g" $config_cutandrun
fi
if ! grep "// NfcoreTemplate.summary" $config_cutandrun > /dev/null; then
sed -i "s/NfcoreTemplate.summary/\/\/ NfcoreTemplate.summary/g" $config_cutandrun
fi
else
echo "Could not find $config_cutandrun!"
echo "Could not find $config_atacseq!"
exit 1
fi
base_config="${CUTANDRUN_DIR}/conf/base.config"
base_config="${ATACseq_DIR}/conf/base.config"
sed -i "s/maxRetries = 1/maxRetries = 3/g" $base_config
sed -i "s/ check_max( 4.h / check_max( 40.h /g" $base_config
......@@ -381,7 +381,7 @@ sed -i "s/ 12.GB / $max_memory /g" $base_config
sed -i "s/ 36.GB / $max_memory /g" $base_config
sed -i "s/ 72.GB / $max_memory /g" $base_config
resources_config="${CUTANDRUN_DIR}/conf/resources.config"
resources_config="${ATACseq_DIR}/conf/resources.config"
sed -i "s/ check_max( 1.h / check_max( 10.h /g" $resources_config
sed -i "s/ check_max( 4.h / check_max( 40.h /g" $resources_config
......@@ -395,7 +395,7 @@ sed -i "s/ 8.GB / $max_memory /g" $resources_config
sed -i "s/ 32.GB / $max_memory /g" $resources_config
sed -i "s/ 64.GB / $max_memory /g" $resources_config
nextflow_config="${CUTANDRUN_DIR}/nextflow.config"
nextflow_config="${ATACseq_DIR}/nextflow.config"
sed -i "s/max_cpus = 16/max_cpus = $max_cpus/g" $nextflow_config
sed -i "s/128.GB/$max_memory/g" $nextflow_config
sed -i "s/240.h/$max_time/g" $nextflow_config
......@@ -474,17 +474,17 @@ export NXF_SINGULARITY_CACHEDIR="${workdir}/images/singularity"
# run the pipeline
echo ""
echo "The working folder is: ${Pwd}" | tee cutandrun_runner.debug.log
echo "The running command is:" | tee -a cutandrun_runner.debug.log
echo nextflow run -w ${workdir}/work ${CUTANDRUN_DIR} $RUN_OPTIONS | tee -a cutandrun_runner.debug.log
echo "" | tee -a cutandrun_runner.debug.log
echo "The working folder is: ${Pwd}" | tee nfcore_atacseq_runner.debug.log
echo "The running command is:" | tee -a nfcore_atacseq_runner.debug.log
echo nextflow run -w ${workdir}/work ${ATACseq_DIR} $RUN_OPTIONS | tee -a nfcore_atacseq_runner.debug.log
echo "" | tee -a nfcore_atacseq_runner.debug.log
cd ${Pwd}
# output for debugging
nextflow config -profile ${OPTS["profile"]} -flat -sort ${CUTANDRUN_DIR} &>> cutandrun_runner.debug.log
nextflow config -profile ${OPTS["profile"]} -flat -sort ${ATACseq_DIR} &>> nfcore_atacseq_runner.debug.log
# run
nextflow run -w ${workdir}/work ${CUTANDRUN_DIR} $RUN_OPTIONS | tee .nextflow.cutandrun.log &
nextflow run -w ${workdir}/work ${ATACseq_DIR} $RUN_OPTIONS | tee .nextflow.atac.log &
nextflowPID=$!
update_trace() {
......@@ -496,10 +496,10 @@ update_trace() {
if [[ -f $from_trace ]] && [[ -f $to_trace ]]; then
# from to_trace
grep -v "CUTANDRUN:" $to_trace > ./.trace.tmp
grep -v "ATACseq:" $to_trace > ./.trace.tmp #check
echo -e "\n\n" >> ./.trace.tmp
# from from_trace
grep "CUTANDRUN:" $from_trace | awk -F"\t" 'BEGIN {OFS="\t"}; {if ($19) print $1,$2,$3,$4,$5,$6,$7,$10,$11,$15,$16,$17,$18,$19}' | sort -un | sed s"/NFCORE_CUTANDRUN://g" >> ./.trace.tmp
grep "ATACseq:" $from_trace | awk -F"\t" 'BEGIN {OFS="\t"}; {if ($19) print $1,$2,$3,$4,$5,$6,$7,$10,$11,$15,$16,$17,$18,$19}' | sort -un | sed s"/NFCORE_ATACseq://g" >> ./.trace.tmp #Check
# update to_trace
cat ./.trace.tmp > $to_trace
# rm tmp file
......@@ -518,7 +518,7 @@ while sleep 2; do
update_trace $from_trace $to_trace
# workflow finished
if grep "Completed at:" .nextflow.cutandrun.log &> /dev/null; then
if grep "Completed at:" .nextflow.atac.log &> /dev/null; then
kill -9 $nextflowPID &> /dev/null
sleep 5
# update the trace file before leaving
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment