Skip to content

Commit a4d2792

Browse files
Martin MetsojaMartin Metsoja
authored andcommitted
merged 1.1.0_mac
2 parents d5b5ec0 + c70c18d commit a4d2792

File tree

10 files changed

+202
-197
lines changed

10 files changed

+202
-197
lines changed

build/entitlements.mac.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
<true/>
77
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
88
<true/>
9+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
10+
<true/>
11+
<key>com.apple.security.cs.disable-library-validation</key>
12+
<true/>
913
<key>com.apple.security.cs.debugger</key>
1014
<true/>
1115
<key>com.apple.security.network.client</key>

gitlog.txt

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
FROM ubuntu:24.04
1+
FROM --platform=linux/amd64 ubuntu:24.04
22
ENV LANG=C.UTF-8
33
ENV LC_ALL=C.UTF-8
44
ENV CONDA_DIR=/opt/conda
55
ENV PATH=$CONDA_DIR/bin:$PATH
6-
7-
COPY image_development/protaxFungi.zip image_development/protaxAnimal.zip image_development/OptimOTU_v5.yaml /
8-
96
RUN apt-get update && \
107
apt-get install -y wget git zip build-essential zlib1g-dev && \
11-
git clone --branch main https://github.com/brendanf/optimotu_targets.git /optimotu_targets && \
12-
sed -i 's|BASEDIR=$(pwd)|BASEDIR="/optimotu_targets"|g' /optimotu_targets/scripts/runprotax && \
8+
git clone --branch main https://github.com/brendanf/optimotu_targets.git /optimotu_targets
9+
COPY image_development/protaxFungi/ /optimotu_targets/protaxFungi/
10+
COPY image_development/protaxAnimal/ /optimotu_targets/protaxAnimal/
11+
COPY image_development/OptimOTU_v5.yaml /
12+
13+
RUN sed -i 's|BASEDIR=$(pwd)|BASEDIR="/optimotu_targets"|g' /optimotu_targets/scripts/runprotax && \
1314
sed -i '1i#!/bin/bash' /optimotu_targets/scripts/runprotax && \
1415
sed -i 's|$PROTAX/usearch10.0.240_i86linux32|usearch|g' /optimotu_targets/scripts/runprotax && \
1516
cd /optimotu_targets && \
@@ -18,7 +19,6 @@ RUN apt-get update && \
1819
chmod +x bin/fastqindex_0.9.0b && \
1920
wget https://s3.hpc.ut.ee/plutof-public/original/5dcbe93a-b50c-4ff5-8898-528160c4e593.zip && \
2021
unzip -j 5dcbe93a-b50c-4ff5-8898-528160c4e593.zip data/shs_out.txt data/sanger_refs_sh.fasta -d data/sh_matching_data && \
21-
rm -rf protaxFungi && \
2222
wget -O FinPROTAX.zip https://github.com/psomervuo/FinPROTAX/archive/refs/heads/main.zip && \
2323
unzip FinPROTAX.zip -d . && \
2424
mv FinPROTAX-main FinPROTAX && \
@@ -28,13 +28,10 @@ RUN apt-get update && \
2828
cd protaxAnimal_bin/protaxA_c2 && make && \
2929
cp classify_v2 classify_info dist_best dist_matrix dist_bipart /optimotu_targets/bin && \
3030
cd /optimotu_targets && \
31-
unzip /protaxFungi.zip -d . && \
32-
unzip /protaxAnimal.zip -d . && \
33-
gzip protaxAnimal/refs.aln && \
34-
mv protaxAnimal/refs.aln.gz protaxAnimal/refs.aln && \
3531
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
3632
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
3733
conda env create -f /OptimOTU_v5.yaml && \
34+
chmod -R 777 /opt/conda/envs/OptimOTU_v5 && \
3835
eval "$(conda shell.bash hook)" && \
3936
conda activate OptimOTU_v5 && \
4037
Rscript -e "install.packages('renv', repos='https://cloud.r-project.org')" && \
@@ -47,8 +44,6 @@ RUN apt-get update && \
4744
usearch -makeudb_usearch protaxFungi/addedmodel/amptk_synmock.fasta -output protaxFungi/addedmodel/amptk_synmock.udb && \
4845
usearch -makeudb_usearch protaxFungi/addedmodel/its2.fa -output protaxFungi/addedmodel/its2.udb && \
4946
rm -f /optimotu_targets/5dcbe93a-b50c-4ff5-8898-528160c4e593.zip && \
50-
rm -f /protaxFungi.zip && \
51-
rm -f /protaxAnimal.zip && \
5247
rm -f /optimotu_targets/FinPROTAX.zip && \
5348
rm -f /optimotu_targets/protaxAnimal_bin.zip && \
5449
rm -f ~/miniconda.sh && \
@@ -57,4 +52,6 @@ RUN apt-get update && \
5752
apt-get remove -y wget git build-essential && \
5853
apt-get autoremove -y && \
5954
apt-get clean && \
60-
rm -rf /var/lib/apt/lists/*
55+
rm -rf /var/lib/apt/lists/* && \
56+
gzip protaxAnimal/refs.aln && \
57+
mv protaxAnimal/refs.aln.gz protaxAnimal/refs.aln

image_development/Dockerfile_vsearch_dada2_v3

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ RUN apt-get update -y \
2525
&& apt-get install -y libdw1 \
2626
&& apt-get install -y libuv1 \
2727
&& apt-get install libnghttp2-14 \
28-
&& apt-get install locales -y
28+
&& apt-get install locales -y \
29+
&& apt-get install libgit2-dev -y
2930
RUN wget https://github.com/shenwei356/seqkit/releases/download/v2.9.0/seqkit_linux_amd64.tar.gz -O /tmp/seqkit.tar.gz && \
3031
tar zxvf /tmp/seqkit.tar.gz -C /usr/bin/ && rm /tmp/seqkit.tar.gz
3132
RUN git clone --branch v2.29.4 https://github.com/torognes/vsearch.git \
@@ -41,7 +42,7 @@ RUN Rscript -e 'install.packages("BiocManager")'
4142
RUN Rscript -e 'BiocManager::install(version = "3.20", ask=FALSE)'
4243
RUN Rscript -e 'BiocManager::install("dada2")'
4344
RUN Rscript -e 'remotes::install_github("tobiasgf/lulu")'
44-
RUN wget ftp://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/ORFfinder/linux-i64/ORFfinder.gz
45+
RUN wget https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/ORFfinder/linux-i64/ORFfinder.gz
4546
RUN gunzip ORFfinder.gz
4647
RUN chmod 755 ORFfinder
4748
RUN mv ORFfinder /bin/.

src/components/Run.vue

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export default {
244244
let result = await dockerode
245245
.run(
246246
step.imageName,
247-
["sh", "-c", `chmod +x /scripts/${scriptName} && /scripts/${scriptName}`],
247+
["bash", "-c", `bash /scripts/${scriptName}`],
248248
[stdout, stderr],
249249
dockerProps
250250
)
@@ -382,7 +382,7 @@ export default {
382382
let result = await dockerode
383383
.run(
384384
selectedStep.imageName,
385-
["sh", "-c", `chmod +x /scripts/${selectedStep.scriptName} && /scripts/${selectedStep.scriptName}`],
385+
["bash", "-c", `bash /scripts/${selectedStep.scriptName}`],
386386
[stdout, stderr],
387387
dockerProps
388388
)
@@ -762,27 +762,24 @@ export default {
762762
await this.$store.dispatch('generateOptimOTUYamlConfig');
763763
await this.imageCheck('pipecraft/optimotu:5');
764764
await this.clearContainerConflicts('optimotu');
765-
let logStream;
766765
try {
767-
const logDir = this.$store.state.inputDir;
768-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
769-
const logFile = path.join(logDir, `optimotu-${timestamp}.log`);
770-
logStream = fs.createWriteStream(logFile, {
771-
flags: 'a',
772-
mode: 0o666 // Read/write permissions for all users
773-
});
774766
const container = await dockerode.createContainer({
775767
Image: 'pipecraft/optimotu:5',
776768
name: 'optimotu',
777769
Cmd: ['/scripts/run_optimotu.sh'],
778770
Tty: false,
779771
AttachStdout: true,
780772
AttachStderr: true,
773+
Platform: "linux/amd64",
781774
Env: [
782775
`HOST_UID=${this.userId}`,
783776
`HOST_GID=${this.groupId}`,
784777
`fileFormat=${this.$store.state.data.fileFormat}`,
785-
`readType=${this.$store.state.data.readType}`
778+
`readType=${this.$store.state.data.readType}`,
779+
'R_ENABLE_JIT=0', // Disable JIT compilation
780+
'R_COMPILE_PKGS=0', // Disable package compilation
781+
'R_DISABLE_BYTECODE=1', // Disable bytecode compilation
782+
'R_KEEP_PKG_SOURCE=yes' // Keep package sources
786783
],
787784
HostConfig: {
788785
Binds: this.getOptimOTUBinds(),
@@ -798,19 +795,15 @@ export default {
798795
});
799796
800797
stream.on('data', (data) => {
801-
const output = data.toString();
802-
console.log(output);
803-
logStream.write(output);
798+
console.log(data.toString());
804799
});
805800
806801
await container.start();
807802
808803
const data = await container.wait();
809804
console.log('Container exited with status code:', data.StatusCode);
810805
this.$store.commit("resetRunInfo");
811-
// Close the log stream
812-
logStream.end();
813-
console.log(`Container log written to ${logFile}`);
806+
814807
if (data.StatusCode == 0) {
815808
Swal.fire("Workflow finished");
816809
} else {
@@ -823,10 +816,6 @@ export default {
823816
await container.remove({ v: true, force: true });
824817
} catch (err) {
825818
console.error('Error running container:', err);
826-
if (logStream) {
827-
logStream.write(`\nERROR: ${err.message}\n${err.stack}\n`);
828-
logStream.end();
829-
}
830819
this.$store.commit("resetRunInfo");
831820
832821
// Check if the error is due to the user stopping the container
@@ -883,7 +872,7 @@ export default {
883872
dockerode
884873
.run(
885874
"vmikk/nextits:0.5.0",
886-
["sh", "-c", `/scripts/NextITS_Pipeline.sh`],
875+
["bash", "-c", `bash /scripts/NextITS_Pipeline.sh`],
887876
false,
888877
props,
889878
(err, data, container) => {

src/pipecraft-core/service_scripts/pipeline_options.yaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ trimming:
2121
cut_R2: 0
2222
action: "trim"
2323
protax:
24-
aligned: yes
25-
location: "/optimotu_targets/protaxAnimal"
24+
aligned: no
25+
location: "/optimotu_targets/protaxFungi"
2626
ranks:
27-
- kingdom: Animalia
28-
- phylum: Arthropoda
27+
- kingdom: Fungi
28+
- phylum
2929
- class
3030
- order
3131
- family
3232
- genus
3333
- species
34-
orient: fwd
34+
orient: mixed
3535
control:
3636
spike:
3737
positive:
38-
forward_primer: "CCHGAYATRGCHTTYCCHCG"
39-
reverse_primer: "TCDGGRTGNCCRAARAAYCA"
38+
forward_primer: "GCATCGATGAAGAACGCAGC"
39+
reverse_primer: "TCCTCCGCTTATTGATATGC"
4040
custom_sample_table: FALSE
4141
filtering:
4242
maxEE_R1: 1
@@ -45,14 +45,15 @@ tag_jump:
4545
f: 0.03
4646
p: 1
4747
amplicon_model:
48-
model_type: HMM
49-
model_file: /optimotu_targets/data/COI.hmm
50-
model_align: yes
51-
numt_filter: yes
48+
model_type: CM
49+
model_file: /optimotu_targets/data/ITS3_ITS4.cm
50+
model_align: no
51+
numt_filter: no
5252
model_filter:
53-
max_model_start: 245
54-
min_model_end: 652
55-
min_model_score: 200
53+
max_model_start: 5
54+
min_model_end: 140
55+
min_model_score: 50
5656
outgroup_reference:
57-
sequences: /optimotu_targets/data/outgroup/BOLD_Public.27-Sep-2024.part_001.m300.fasta
58-
cluster_thresholds: /optimotu_targets/metadata/MBRAVE_thresholds.tsv
57+
sequences: /optimotu_targets/data/sh_matching_data/sanger_refs_sh.fasta
58+
taxonomy: /optimotu_targets/data/sh_matching_data/shs_out.txt
59+
cluster_thresholds: /optimotu_targets/metadata/GSSP_thresholds.tsv

src/pipecraft-core/service_scripts/run_optimotu.sh

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export fileFormat
1010

1111
echo "specified fileFormat: $fileFormat"
1212

13+
14+
1315
# # check files in 01_raw and subdirectories
1416
# # Find all subdirectories in 01_raw
1517
while IFS= read -r subdir; do
@@ -42,6 +44,20 @@ cp -f /scripts/pipeline_options.yaml /optimotu_targets/sequences/pipeline_option
4244
# Activate the conda environment
4345
source /opt/conda/etc/profile.d/conda.sh
4446
conda activate OptimOTU_v5
47+
48+
# Try to install a compatible version of qs2
49+
echo "Installing compatible version of qs2..."
50+
R --vanilla -e '
51+
# Remove existing qs2 if present
52+
if("qs2" %in% installed.packages()[,"Package"]) remove.packages("qs2")
53+
54+
# Install from source with minimal optimizations
55+
Sys.setenv(PKG_CFLAGS="-O0 -march=x86-64")
56+
Sys.setenv(PKG_CXXFLAGS="-O0 -march=x86-64")
57+
install.packages("qs2", type="source", repos="https://cloud.r-project.org")
58+
'
59+
60+
4561
cd /optimotu_targets
4662

4763
# Print current environment for debugging
@@ -94,12 +110,7 @@ Start time: $start_time
94110
End time: $(date)
95111
Runtime: $runtime seconds
96112
97-
echo "All operations completed."
98113
99-
if [ ! -z "$HOST_UID" ] && [ ! -z "$HOST_GID" ]; then
100-
echo "Setting ownership of /optimotu_targets to $HOST_UID:$HOST_GID"
101-
chown -R $HOST_UID:$HOST_GID /optimotu_targets/sequences
102-
fi
103114
104115
The outputs of the pipeline are a set of tables in TSV format (tab-delimited files) and
105116
RDS format (for easy loading in R), as well as sequences in gzipped FASTA format.
@@ -127,4 +138,11 @@ EOF
127138

128139
#Done
129140
printf "\nDONE "
130-
printf "Total time: $runtime sec.\n "
141+
printf "Total time: $runtime sec.\n "
142+
143+
echo "All operations completed."
144+
145+
if [ ! -z "$HOST_UID" ] && [ ! -z "$HOST_GID" ]; then
146+
echo "Setting ownership of /optimotu_targets to $HOST_UID:$HOST_GID"
147+
chown -R $HOST_UID:$HOST_GID /optimotu_targets/sequences
148+
fi

0 commit comments

Comments
 (0)