Skip to content

Commit

Permalink
Create bpipe.config during installation, backup old pipeline_config.g…
Browse files Browse the repository at this point in the history
…roovy before overwriting during installation
  • Loading branch information
hdashnow committed Oct 16, 2018
1 parent 2b10d9f commit a1ed84a
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 4 deletions.
34 changes: 33 additions & 1 deletion .testing/install-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@
installdir=$PWD
refdir=$PWD/reference-data
toolspec=$PWD/pipelines/pipeline_config.groovy
template=$PWD/pipelines/config-examples/pipeline_config_template.groovy
bpipeconfig=$PWD/pipelines/bpipe.config
bpipeconfig_template=$PWD/pipelines/config-examples/bpipe.config_template

mkdir -p tools/bin
cd tools

if [ ! -f $toolspec ] ; then
echo "The configuration file pipelines/pipeline_config.groovy was not found, creating it."
else
echo -n "WARNING: pipelines/pipeline_config.groovy already exists so will be overwritten by this installation. "
echo "Creating backup pipelines/pipeline_config.groovy.backup in case you wish to retreive the previous version of this file."
cp $toolspec ${toolspec}.backup
fi

#a list of which programs need to be installed
commands="bpipe python goleft bedtools bwa samtools mosdepth"
jarfiles="bazam picard"
Expand Down Expand Up @@ -138,6 +147,11 @@ echo "// Uncomment the line below to use a set of WGS samples as controls, or sp
echo "//CONTROL=\"$refdir/hg19.PCRfreeWGS_143_STRetch_controls.tsv\"" >> $toolspec
echo >> $toolspec

if [ ! -f $bpipeconfig ] ; then
echo "pipelines/bpipe.config not found, creating it"
#copy bpipe.config template to pipeline directory
cp $bpipeconfig_template $bpipeconfig
fi

#loop through commands to check they are all installed
echo "**********************************************************"
Expand Down Expand Up @@ -174,5 +188,23 @@ else
echo "It looks like the reference data has been downloaded"
fi

echo "**********************************************************"

#check for config files
if [ ! -f $toolspec ] ; then
echo -n "WARNING: pipelines/pipeline_config.groovy could not be found!!!! "
echo "You will need to create this file manually."
else
echo "It looks like pipelines/pipeline_config.groovy exists"
fi

if [ ! -f $bpipeconfig ] ; then
echo -n "WARNING: pipelines/bpipe.config could not be found. "
echo -n "This file is only required when using a job submission system. "
echo "If required, you will need to create this file manually."
else
echo "It looks like pipelines/bpipe.config exists"
fi

echo "**********************************************************"
echo $Final_message
36 changes: 33 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@
installdir=$PWD
refdir=$PWD/reference-data
toolspec=$PWD/pipelines/pipeline_config.groovy
template=$PWD/pipelines/config-examples/pipeline_config_template.groovy
bpipeconfig=$PWD/pipelines/bpipe.config
bpipeconfig_template=$PWD/pipelines/config-examples/bpipe.config_template

mkdir -p tools/bin
cd tools

if [ ! -f $toolspec ] ; then
echo "The configuration file pipelines/pipeline_config.groovy was not found, creating it."
else
echo -n "WARNING: pipelines/pipeline_config.groovy already exists so will be overwritten by this installation. "
echo "Creating backup pipelines/pipeline_config.groovy.backup in case you wish to retreive the previous version of this file."
cp $toolspec ${toolspec}.backup
fi

#a list of which programs need to be installed
commands="bpipe python goleft bedtools bwa samtools mosdepth"
jarfiles="bazam picard"
Expand Down Expand Up @@ -112,7 +121,6 @@ for j in $jarfiles ; do
echo "$j=\"$PWD/bin/${j}.jar\"" >> $toolspec
done


if [ ! -f $refdir/hg19.PCRfreeWGS_143_STRetch_controls.tsv ] ; then
mkdir -p $refdir
echo "Downloading reference data"
Expand All @@ -134,6 +142,11 @@ echo "// Uncomment the line below to use a set of WGS samples as controls, or sp
echo "//CONTROL=\"$refdir/hg19.PCRfreeWGS_143_STRetch_controls.tsv\"" >> $toolspec
echo >> $toolspec

if [ ! -f $bpipeconfig ] ; then
echo "pipelines/bpipe.config not found, creating it"
#copy bpipe.config template to pipeline directory
cp $bpipeconfig_template $bpipeconfig
fi

#loop through commands to check they are all installed
echo "**********************************************************"
Expand Down Expand Up @@ -161,7 +174,6 @@ for j in $jarfiles ; do
done



echo "**********************************************************"

#check for reference data
Expand All @@ -172,5 +184,23 @@ else
echo "It looks like the reference data has been downloaded"
fi

echo "**********************************************************"

#check for config files
if [ ! -f $toolspec ] ; then
echo -n "WARNING: pipelines/pipeline_config.groovy could not be found!!!! "
echo "You will need to create this file manually."
else
echo "It looks like pipelines/pipeline_config.groovy exists"
fi

if [ ! -f $bpipeconfig ] ; then
echo -n "WARNING: pipelines/bpipe.config could not be found. "
echo -n "This file is only required when using a job submission system. "
echo "If required, you will need to create this file manually."
else
echo "It looks like pipelines/bpipe.config exists"
fi

echo "**********************************************************"
echo $Final_message
30 changes: 30 additions & 0 deletions pipelines/config-examples/bpipe.config_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Defaults
walltime="04:00:00"
memory="8g"

// Values for specific commands
commands {

mosdepth {
memory="4g"
}

bwamem {
walltime="48:00:00"
procs=8
memory="32g"
}

merge {
memory="4g"
}

bedtools {
memory="4g"
}

locuscounts {
memory="16g"
}

}

0 comments on commit a1ed84a

Please sign in to comment.