Skip to content

Commit 3cd6165

Browse files
add additional r libraries for future plotting, organize.py now handles presence/absence of profile on user input and prepare command for running cosigt w/conda
1 parent 864c6f1 commit 3cd6165

File tree

3 files changed

+53
-9
lines changed

3 files changed

+53
-9
lines changed

Dockerfile

+12-5
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ ENV PATH="/root/.cargo/bin:${PATH}"
6363
RUN rustup update
6464
RUN cargo install --locked maturin
6565

66-
#install numpy
67-
RUN pip3 install numpy \
68-
pandas
66+
#install python libraries here
67+
#RUN pip3 install ...
6968

7069
#ln python to python3 -not used right now but, who knows?
7170
RUN ln -s /usr/bin/python3 /usr/bin/python
@@ -161,14 +160,22 @@ RUN git clone https://github.com/davidebolo1993/cosigt.git \
161160

162161
ENV PATH /opt:$PATH
163162

164-
165163
#R and R libs w/conda - adding should be easier
166164

167165
RUN curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
168166
RUN bash Miniconda3-latest-Linux-x86_64.sh -p /miniconda -b
169167
RUN rm Miniconda3-latest-Linux-x86_64.sh
170168
ENV PATH=/miniconda/bin:${PATH}
171169
RUN conda update -y conda
172-
RUN conda create -y -n renv -c conda-forge r-base r-data.table=1.15.4 r-rjson=0.2.23 r-reshape2=1.4.4 r-nbclust=3.0.1 r-ggplot2=3.5.1 r-dendextend=1.18.1
170+
RUN conda create -y -n renv -c conda-forge -c bioconda \
171+
r-base \
172+
r-data.table=1.15.4 \
173+
r-rjson=0.2.23 \
174+
r-reshape2=1.4.4 \
175+
r-nbclust=3.0.1 \
176+
r-ggplot2=3.5.1 \
177+
r-dendextend=1.18.1 \
178+
r-gggenes=0.5.1 \
179+
bioconductor-rtracklayer=1.62.0
173180
RUN echo "source activate renv" > ~/.bashrc
174181
ENV PATH /miniconda/envs/renv/bin:$PATH

cosigt_smk/workflow/envs/plot.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
channels:
2+
- conda-forge
3+
- bioconda
4+
dependencies:
5+
- r-data.table=1.15.4
6+
- r-rjson=0.2.23
7+
- r-ggplot2=3.5.1
8+
- r-gggenes=0.5.1
9+
- bioconductor-rtracklayer=1.62.0
10+
- r-base

cosigt_smk/workflow/scripts/organize.py

+31-4
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def main():
127127
additional.add_argument('--binds', help='additional paths to bind for singularity in /path/1,/path/2 format [/localscratch]', type=str, default='/localscratch')
128128
additional.add_argument('--tmp', help='SINGULARITY TMPDIR [/tmp]', type=str, default='/tmp')
129129
additional.add_argument('--output', help='output folder [results]', metavar='FOLDER', default='results')
130+
additional.add_argument('--profile', help='use profile. If "None", do not use profile and run on the local machine [config/slurm]', metavar='FOLDER', default='config/slurm')
130131

131132
metrics = parser.add_argument_group('Specify #threads, memory and time requirements')
132133

@@ -160,6 +161,7 @@ def main():
160161
metrics.add_argument('--wfmash_tmpdir', help='temporary directory - wfmash [working directory]',type=str, default=os.getcwd())
161162

162163
args = parser.parse_args()
164+
args.profile=None if args.profile == 'None' else args.profile
163165

164166
#wd
165167
wd=os.getcwd()
@@ -304,13 +306,38 @@ def main():
304306

305307
os.remove(out_yaml_tmp)
306308

307-
#write command
309+
#write command - singularity
308310
singpath=','.join(list(set([os.path.abspath(args.alignments),os.path.dirname(os.path.abspath(args.assemblies)), os.path.dirname(os.path.abspath(args.reference)),args.binds, os.path.abspath(args.pggb_tmpdir), os.path.abspath(args.wfmash_tmpdir)])))
309-
command_out='SINGULARITY_TMPDIR=' + os.path.abspath(args.tmp) + ' snakemake --profile config/slurm --singularity-args "-B '+ singpath + ' -e" cosigt'
310311

311-
with open('snakemake.run.sh', 'w') as out:
312+
if args.profile is not None:
313+
314+
command_singularity_out='SINGULARITY_TMPDIR=' + os.path.abspath(args.tmp) + ' snakemake --profile ' + args.profile + ' --singularity-args "-B '+ singpath + ' -e" cosigt'
315+
316+
with open('snakemake.singularity.profile.run.sh', 'w') as out:
317+
318+
out.write(command_singularity_out + '\n')
319+
320+
#write command - conda
321+
command_conda_out='snakemake --profile ' + args.profile + ' --use-conda cosigt'
322+
323+
with open('snakemake.conda.profile.run.sh', 'w') as out:
324+
325+
out.write(command_conda_out + '\n')
326+
327+
else:
328+
329+
command_singularity_out='SINGULARITY_TMPDIR=' + os.path.abspath(args.tmp) + ' snakemake --singularity-args "-B '+ singpath + ' -e" cosigt'
330+
331+
with open('snakemake.singularity.run.sh', 'w') as out:
332+
333+
out.write(command_singularity_out + '\n')
334+
335+
#write command - conda
336+
command_conda_out='snakemake --use-conda cosigt'
337+
338+
with open('snakemake.conda.run.sh', 'w') as out:
312339

313-
out.write(command_out + '\n')
340+
out.write(command_conda_out + '\n')
314341

315342

316343
if __name__ == '__main__':

0 commit comments

Comments
 (0)