-
Notifications
You must be signed in to change notification settings - Fork 0
Bugfixes3 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Bugfixes3 #6
Changes from all commits
6b9f3ba
d2d750c
4d3cd73
d2ca3a2
98eef2d
0c3a136
8f15409
87e8f38
d67b4ff
e611426
b45d035
f3a4aa9
b96498e
78eec22
a33cd26
4c43bba
1887a4b
d7875ab
904fc7e
02d3568
fdb8732
4a9f369
8404f15
b691cca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,18 +9,18 @@ USER roddy | |
|
|
||
| # Install Bioconda | ||
|
|
||
| RUN sudo apt-get update; sudo apt-get install -y bzip2 git | ||
| RUN sudo apt-get update; sudo apt-get install -y bzip2 git curl | ||
|
|
||
| RUN cd /home/roddy; \ | ||
| echo "Download Anaconda https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh"; \ | ||
| wget -q https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh && \ | ||
| echo "Download Anaconda"; \ | ||
| wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.1-Linux-x86_64.sh && \ | ||
| echo "Install Anaconda" && \ | ||
| sudo bash Anaconda2-4.4.0-Linux-x86_64.sh -b && \ | ||
| rm -rf Anaconda2-4.4.0-Linux-x86_64.sh && \ | ||
| sudo bash Miniconda3-4.5.1-Linux-x86_64.sh -b -p /home/roddy/miniconda3 && \ | ||
| rm -rf Miniconda3-4.5.1-Linux-x86_64.sh && \ | ||
| echo Done && \ | ||
| export PATH=/home/roddy/anaconda2/bin/:$PATH | ||
| export PATH=/home/roddy/miniconda3/bin/:$PATH | ||
|
|
||
| ENV PATH=/home/roddy/anaconda2/bin/:$PATH | ||
| ENV PATH=/home/roddy/miniconda3/bin/:$PATH | ||
|
|
||
| RUN env; \ | ||
| conda config --add channels r; \ | ||
|
|
@@ -47,6 +47,7 @@ RUN mkdir -p $BINARIES_FOLDER && cd $BINARIES_FOLDER && \ | |
| rm -rf $BINARIES_FOLDER/Roddy && \ | ||
| git clone https://github.com/eilslabs/Roddy.git && \ | ||
| cd Roddy && git checkout 2.4.10b && mkdir -p plugins_R2.4 && \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting that this still uses the 3.0 pre-release -- 2.4 never was a real release. Leave it like that -- never change a running system. |
||
| chmod 777 dist/runtime && \ | ||
| ls -l && \ | ||
| ls -l .git/ && \ | ||
| # git submodule add -f https://github.com/eilslabs/Roddy-Base-Plugin.git dist/plugins/PluginBase && \ | ||
|
|
@@ -55,7 +56,7 @@ RUN mkdir -p $BINARIES_FOLDER && cd $BINARIES_FOLDER && \ | |
| git submodule update --init --recursive && \ | ||
| cd $RODDY_BASE_PLUGINS && \ | ||
| ls -l && \ | ||
| (cd DefaultPlugin && git checkout 1.2.0) && \ | ||
| (cd DefaultPlugin && git checkout 951fc80) && \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? The commit is pretty old -- actually pre-Roddy 3! |
||
| (cd PluginBase && git checkout 1.2.0) && \ | ||
| cp -r DefaultPlugin DefaultPlugin_1.2.0 && \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the previous commit-checkout this directory name is actually misleading. I suggest leaving that at "DefaultPlugin" to express that this is a development version. |
||
| cp -r PluginBase PluginBase_1.2.0 | ||
|
|
@@ -65,9 +66,13 @@ RUN mkdir -p $BINARIES_FOLDER && cd $BINARIES_FOLDER && \ | |
| RUN cd $RODDY_PLUGINS_R2_4 && \ | ||
| git clone https://github.com/eilslabs/ACEseqWorkflow ACEseqWorkflow_1.2.10 && \ | ||
| cd ACEseqWorkflow_1.2.10 && \ | ||
| git checkout 1.2.10 | ||
| git checkout 1.2.10 && \ | ||
| sed -i -e 's/[ \t]\${EMAIL}[ \t]/ "${EMAIL}" /g' $ACESEQ_FOLDER/resources/analysisTools/copyNumberEstimationWorkflow/correct_gc_bias*.sh # wrap variable in quotes, or else e-mail is sent, even when $EMAIL is empty | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typical -- though interesting that this now produces problems. Actually, all variables should (almost) always get quoted in Bash (there are few exceptions). I will also change this code in the ACEseq head with reference to your PR. |
||
|
|
||
| RUN conda env create -n ACEseqWorkflow -f $ACESEQ_FOLDER/resources/analysisTools/copyNumberEstimationWorkflow/environments/conda.yml; | ||
| RUN sed -i -e 's/.*gsl.*//' $ACESEQ_FOLDER/resources/analysisTools/copyNumberEstimationWorkflow/environments/conda.yml && \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW: Also in the Docker script all variables should be quoted, unless there is a good reason not to do so (e.g. if For instance here, if |
||
| conda env create -n ACEseqWorkflow -f $ACESEQ_FOLDER/resources/analysisTools/copyNumberEstimationWorkflow/environments/conda.yml && \ | ||
| conda install -n ACEseqWorkflow -y bedtools=2.24.0=0 blas=1.1=openblas libgcc-ng=7.2.0=hdf63c60_3 libgfortran=3.0.0=1 libstdcxx-ng=7.2.0=hdf63c60_3 numpy=1.11.3=py27_blas_openblashd3ea46f_205 openblas=0.2.20=8 gsl=2.4=blas_openblas_0 && \ | ||
| conda clean --all -y | ||
|
|
||
| # Install Groovy 2.4.7 from Maven. OpenJDK is already installed in the base image so just link it.. | ||
| RUN mkdir -p ~/.roddy/runtimeDevel && cd ~/.roddy/runtimeDevel && \ | ||
|
|
@@ -76,7 +81,8 @@ RUN mkdir -p ~/.roddy/runtimeDevel && cd ~/.roddy/runtimeDevel && \ | |
| wget $groovyZipLink && \ | ||
| unzip $groovyArchive && \ | ||
| rm $groovyArchive && \ | ||
| ln -sf /usr/lib/jvm/java-8-openjdk-amd64 ~/.roddy/runtimeDevel/jdk && ln -sf ~/.roddy/runtimeDevel/jdk ~/.roddy/runtimeDevel/jdk1.8.0_131 | ||
| ln -sf /usr/lib/jvm/java-8-openjdk-amd64 ~/.roddy/runtimeDevel/jdk && ln -sf ~/.roddy/runtimeDevel/jdk ~/.roddy/runtimeDevel/jdk1.8.0_131 && \ | ||
| mv ~/.roddy ~/writable.template/.roddy && ln -s /home/roddy/writable/.roddy /home/roddy/.roddy # required for Singularity (will be copied to writable dir and symlinked) | ||
|
|
||
| # Currently not needed. Both are packed in R2.4.10 | ||
| #RUN cd $BINARIES_FOLDER && \ | ||
|
|
@@ -99,3 +105,9 @@ RUN cd $RODDY_PLUGINS_R2_4 && git clone https://github.com/eilslabs/COWorkflowsB | |
| ## HINT: ~/binaries/Roddy/roddy.sh run coWorkflowsTestProject@aceseq stds --c=/home/roddy/config/ini/alllocal.ini | ||
| ## HINT: Run the container with: docker run -v /home/heinold/.roddy/runtimeDevel/:/home/roddy/.roddy/runtimeDevel -v /home/heinold/temp:/home/roddy/temp -v `readlink -f config`:/home/roddy/config -t -i aceseqimage /bin/bash | ||
|
|
||
| # copy workflow config | ||
| COPY config /home/roddy/config | ||
|
|
||
| # create an empty DELLY SV file, for when the workflow is called without SVs | ||
| RUN echo -e 'chrom1\tstart1\tend1\tchrom2\tstart2\tend2\tid\tpairs\tstrand1\tstrand2\tsvtype\tsize\torient\tmapq\tsplit_reads\tsplit_mapq\tsplit_consensus\tpid\taf\tgenotypes\trd_ratio\ttumor_count\tgerm_count\tBf\tdepth.ratio\tCNt\tA\tB\tCN_supp' > /home/roddy/empty_sv.tsv | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What a hack. I understand and agree, but anyway, what a hack. |
||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,36 @@ | ||
| #!/bin/bash | ||
| # 1: Run mode, which might be "run" or "testrun" | ||
| # 2: Configuration identifier, normally "ACEseq" | ||
| # 3: Configuration directory | ||
| # 4: Dataset identifier / PID | ||
| # 5: Control bam file | ||
| # 6: Tumor bam file | ||
| # 7: Control bam sample name | ||
| # 8: Tumor bam sample name | ||
| # 9: Reference genome file | ||
| # 10: Reference files path | ||
| # 11: Output folder | ||
| # 2: Container type, "docker" or "singularity" | ||
| # 3: Dataset identifier / PID | ||
| # 4: Control bam file | ||
| # 5: Tumor bam file | ||
| # 6: Control bam sample name | ||
| # 7: Tumor bam sample name | ||
| # 8: Reference genome file | ||
| # 9: Reference files path | ||
| # 10: Output folder | ||
| # 11: Number of threads | ||
| # 12: Optional: The SV file | ||
|
|
||
| if [[ $# -lt 11 ]]; then | ||
| echo "Wrong number of arguments" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Msg. could be improved: `echo "Wrong number of arguments: Expected 11 but got $#" |
||
| head -n 12 "$0" | tail -n+2 | ||
| head -n 13 "$0" | tail -n+2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| ## Read in parameters and check files and folders | ||
| mode=${1} | ||
| configurationIdentifier=${2} | ||
| configurationFolderLcl=`readlink -f "${3}"` | ||
| pid=${4} | ||
| container=${2} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. e.g. here, if |
||
| pid=${3} | ||
|
|
||
| inputBamCtrlLcl=`readlink -f "${5}"` | ||
| inputBamTumorLcl=`readlink -f "${6}"` | ||
| inputBamCtrlSampleName=${7} | ||
| inputBamTumorSampleName=${8} | ||
| referenceGenomeFile=`readlink -f "${9}"` | ||
| referenceFilesPath=`readlink -f "${10}"` | ||
| workspaceLcl=`readlink -f "${11}"` | ||
| inputBamCtrl=`readlink -m "${4}"` | ||
| inputBamTumor=`readlink -m "${5}"` | ||
| inputBamCtrlSampleName=${6} | ||
| inputBamTumorSampleName=${7} | ||
| referenceGenomeFile=`readlink -m "${8}"` | ||
| referenceFilesPath=`readlink -m "${9}"` | ||
| workspace=`readlink -m "${10}"` | ||
| threads=${11} | ||
|
|
||
| function checkFile() { | ||
| local _file=${1} | ||
|
|
@@ -49,57 +49,67 @@ function checkDir() { | |
| } | ||
|
|
||
| [[ $mode -ne "run" && $mode -ne "testrun" ]] && echo "Mode must be run or testrun" && exit 2 | ||
| checkFile $inputBamCtrlLcl | ||
| checkFile $inputBamTumorLcl | ||
| [ "$container" != "docker" -a "$container" != "singularity" ] && echo "Container must be docker or singularity" && exit 2 | ||
| checkFile $inputBamCtrl | ||
| checkFile $inputBamTumor | ||
| checkFile ${referenceGenomeFile} | ||
| checkFile ${referenceGenomeFile}.fai | ||
| checkDir $referenceFilesPath | ||
| checkDir $workspaceLcl rw | ||
| checkDir $workspace rw | ||
| ! [[ $threads =~ ^[1-9]|1[0-9]|2[0-4]*$ ]] && echo "Number of threads must be between 1 and 24" && exit 2 | ||
|
|
||
| if [[ $# -eq 12 ]]; then | ||
| # Either use the file | ||
| local svFile=`readlink -f ${12}` | ||
| # Either use the provided SV file | ||
| svFile=`readlink -m ${12}` | ||
| checkFile $svFile | ||
| svBlock="svFile:${svFile}" | ||
| else | ||
| # or explicitely disable it. | ||
| svBlock="runWithSv:false,SV:no" | ||
| # or use an empty SV file to disable it. | ||
| svBlock="svFile:/home/roddy/empty_sv.tsv" | ||
| fi | ||
|
|
||
| # Define in-Docker files and folders | ||
|
|
||
| workspace=/home/roddy/workspace | ||
| configurationFolder=/home/roddy/config | ||
| inputBamCtrl=${inputBamCtrlLcl} | ||
| inputBamTumor=${inputBamTumorLcl} | ||
|
|
||
| roddyBinary="bash /home/roddy/binaries/Roddy/roddy.sh" | ||
| roddyConfig="--useconfig=/home/roddy/config/ini/alllocal.ini" | ||
| bamFiles="bamfile_list:$inputBamCtrl;$inputBamTumor" | ||
| sampleList="sample_list:${inputBamCtrlSampleName};${inputBamTumorSampleName}" | ||
| sampleListParameters="possibleTumorSampleNamePrefixes:(${inputBamTumorSampleName}),possibleControlSampleNamePrefixes:(${inputBamCtrlSampleName})" | ||
| tumorSample="tumorSample:${inputBamTumorSampleName}" | ||
| baseDirectoryReference="baseDirectoryReference:${referenceFilesPath}" | ||
| referenceGenome="REFERENCE_GENOME:${referenceGenomeFile}" | ||
| referenceGenomePath=`dirname ${referenceGenomeFile}` | ||
| outputBaseDirectory="outputBaseDirectory:${workspace}" | ||
| outputFileGroup="outputFileGroup:roddy" | ||
| sampleListParameters="possibleTumorSampleNamePrefixes:(${inputBamTumorSampleName}),possibleControlSampleNamePrefixes:(${inputBamCtrlSampleName})" | ||
|
|
||
| sampleXML=/home/roddy/additionalConfigs/sampleNames.xml | ||
| prepareAdditionalConfigCall="mkdir /home/roddy/additionalConfigs && cp /home/roddy/config/xml/sampleConfigTemplate.txt $sampleXML && sed -i -e 's/CONTROL_SAMPLE/${inputBamCtrlSampleName}/' $sampleXML && sed -i -e 's/TUMOR_SAMPLE/${inputBamTumorSampleName}/' $sampleXML " | ||
| call="${roddyBinary} ${mode} ACEseq@copyNumberEstimation ${pid} ${roddyConfig} --cvalues='${bamFiles},${svBlock},${sampleList},${sampleListParameters},${tumorSample},${referenceGenome},${baseDirectoryReference},${outputBaseDirectory},${outputFileGroup}'" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are aware that the braces "{ ... }" have only limited use in Bash, e.g.
... and few other cases. As used here they are probably completely useless junk -- like in many places in the original scripts. I am now turning to just change all places I find and modify anyway to use correct quoting, no matter what the "coding convention" used to be before, because the code gets better by this. |
||
|
|
||
| call="${roddyBinary} ${mode} ${configurationIdentifier}@copyNumberEstimation ${pid} ${roddyConfig} --cvalues=\"${bamFiles},${svBlock},${sampleList},${tumorSample},${referenceGenome},${baseDirectoryReference},${outputBaseDirectory},${outputFileGroup}\"" | ||
| mkdir -p "${workspace}/${pid}" | ||
|
|
||
| absoluteCall="[[ ! -d ${workspace}/${pid} ]] && mkdir ${workspace}/${pid}; $prepareAdditionalConfigCall ;$call; echo \"Wait for Roddy to finish\"; "'while [[ 2 -lt $(qstat | wc -l ) ]]; do echo $(expr $(qstat | wc -l) - 2 )\" jobs are still in the list\"; sleep 120; done;'" echo \"done\"; ec=$?" | ||
|
|
||
| docker run \ | ||
| -v ${inputBamCtrlLcl}:${inputBamCtrl} -v ${inputBamCtrlLcl}.bai:${inputBamCtrl}.bai \ | ||
| -v ${inputBamTumorLcl}:${inputBamTumor} -v ${inputBamTumorLcl}.bai:${inputBamTumor}.bai \ | ||
| -v ${workspaceLcl}:${workspace} \ | ||
| -v ${referenceGenomePath}:${referenceGenomePath} \ | ||
| -v "${referenceFilesPath}:${referenceFilesPath}" \ | ||
| -v "${configurationFolderLcl}:${configurationFolder}" \ | ||
| if [ "$container" = "docker" ]; then | ||
| docker run \ | ||
| -v "${inputBamCtrl}:${inputBamCtrl}:ro" -v "${inputBamCtrl}.bai:${inputBamCtrl}.bai:ro" \ | ||
| -v "${inputBamTumor}:${inputBamTumor}:ro" -v "${inputBamTumor}.bai:${inputBamTumor}.bai:ro" \ | ||
| -v "${workspace}:${workspace}" \ | ||
| -v "${referenceGenomeFile}:${referenceGenomeFile}:ro" -v "${referenceGenomeFile}.fai:${referenceGenomeFile}.fai:ro" \ | ||
| -v "${referenceFilesPath}:${referenceFilesPath}:ro" \ | ||
| $([ -n "${svFile}" ] && echo -v "${svFile}:${svFile}:ro") \ | ||
| --rm \ | ||
| --user 0 --env=RUN_AS_UID=`id -u` --env=RUN_AS_GID=`id -g` \ | ||
| -t -i aceseqimage \ | ||
| /bin/bash -c "$absoluteCall" | ||
| --shm-size=1G \ | ||
| --user $(id -u):$(id -g) \ | ||
| --env=THREADS=$threads \ | ||
| aceseqimage \ | ||
| /bin/bash -c "$call" | ||
| else | ||
| export SINGULARITYENV_THREADS=$threads | ||
| singularity exec \ | ||
| -B /tmp:/tmp \ | ||
| -B "${inputBamCtrl}:${inputBamCtrl}:ro" -B "${inputBamCtrl}.bai:${inputBamCtrl}.bai:ro" \ | ||
| -B "${inputBamTumor}:${inputBamTumor}:ro" -B "${inputBamTumor}.bai:${inputBamTumor}.bai:ro" \ | ||
| -B "${workspace}:${workspace}" \ | ||
| -B "${referenceGenomeFile}:${referenceGenomeFile}:ro" -B "${referenceGenomeFile}.fai:${referenceGenomeFile}.fai:ro" \ | ||
| -B "${referenceFilesPath}:${referenceFilesPath}:ro" \ | ||
| $([ -n "${svFile}" ] && echo -B "${svFile}:${svFile}:ro") \ | ||
| --containall --net \ | ||
| $(dirname "$0")/singularity.img \ | ||
| /ENTRYPOINT.sh /bin/bash -c "$call" | ||
| fi | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, "Download Conda";