# Kneaddata installed with conda is not available

**URL:** <https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147>\
**Category:** KneadData\
**Created:** [October 2, 2022, 8:41am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147 "2022-10-02T08:41:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Cheng](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@Roy\_Cheng](https://forum.biobakery.org/u/Roy_Cheng)\
**Post date:** [October 2, 2022, 8:41am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/1 "2022-10-02T08:41:09Z")

</div>

hi! I used conda to install KneadData, but it didn’t work. The error message appears to be related to Trimmomatic. I’ve left the necessary code below. Thank you.

```auto
(kneaddata) t010208@bio3-Horsea-12U:~/Chengtao/meta/test$ kneaddata -i1 seq/C1_1.fq.gz -i2 seq/C1_2.fq.gz \
> -o temp/qc -v -t 20 --remove-intermediate-output \
> --trimmomatic ${soft}/envs/kneaddata/share/trimmomatic/ \
> --trimmomatic-options "ILLUMINACLIP:${soft}/envs/kneaddata/share/trimmomatic/adapters/TruSeq2-PE.fa:2:40:15 SLIDINGWINDOW:4:20 MINLEN:50" \
> --reorder --bowtie2-options "--very-sensitive --dovetail" \
> -db ${db}/kneaddata/human_genome/hg37dec_v0.1
Decompressing gzipped file ...

Decompressing gzipped file ...

Reformatting file sequence identifiers ...

Reformatting file sequence identifiers ...

Initial number of reads ( /home/data/t010208/Chengtao/meta/test/temp/qc/reformatted_identifiers556tnqui_decompressed_rg4eb61__C1_1 ): 75000.0
Initial number of reads ( /home/data/t010208/Chengtao/meta/test/temp/qc/reformatted_identifiers1l3tuc73_decompressed_0kz7yoj5_C1_2 ): 75000.0
Running Trimmomatic ... 

java -Xmx500m -jar /home/data/t010208/miniconda3/envs/kneaddata/share/trimmomatic/trimmomatic PE -threads 20 -phred33 /home/data/t010208/Chengtao/meta/test/temp/qc/reformatted_identifiers556tnqui_decompressed_rg4eb61__C1_1 /home/data/t010208/Chengtao/meta/test/temp/qc/reformatted_identifiers1l3tuc73_decompressed_0kz7yoj5_C1_2 /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.1.fastq /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.single.1.fastq /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.2.fastq /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.single.2.fastq ILLUMINACLIP:/home/data/t010208/miniconda3/envs/kneaddata/share/trimmomatic/adapters/TruSeq2-PE.fa:2:40:15 SLIDINGWINDOW:4:20 MINLEN:50

CRITICAL ERROR: Error executing: java -Xmx500m -jar /home/data/t010208/miniconda3/envs/kneaddata/share/trimmomatic/trimmomatic PE -threads 20 -phred33 /home/data/t010208/Chengtao/meta/test/temp/qc/reformatted_identifiers556tnqui_decompressed_rg4eb61__C1_1 /home/data/t010208/Chengtao/meta/test/temp/qc/reformatted_identifiers1l3tuc73_decompressed_0kz7yoj5_C1_2 /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.1.fastq /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.single.1.fastq /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.2.fastq /home/data/t010208/Chengtao/meta/test/temp/qc/C1_1_kneaddata.trimmed.single.2.fastq ILLUMINACLIP:/home/data/t010208/miniconda3/envs/kneaddata/share/trimmomatic/adapters/TruSeq2-PE.fa:2:40:15 SLIDINGWINDOW:4:20 MINLEN:50

Error message returned from Trimmomatic :
Error: Invalid or corrupt jarfile /home/data/t010208/miniconda3/envs/kneaddata/share/trimmomatic/trimmomatic

(kneaddata) t010208@bio3-Horsea-12U:~$ kneaddata --version
kneaddata v0.12.0
(kneaddata) t010208@bio3-Horsea-12U:~$ conda list
# packages in environment at /home/data/t010208/miniconda3/envs/kneaddata:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_gnu conda-forge
bowtie2 2.4.5 py310h8d7afc0_4 bioconda
bzip2 1.0.8 h7f98852_4 conda-forge
c-ares 1.18.1 h7f98852_0 conda-forge
ca-certificates 2022.9.24 ha878542_0 conda-forge
curl 7.83.1 h2283fc2_0 conda-forge
expat 2.4.9 h27087fc_0 conda-forge
fastqc 0.11.9 hdfd78af_1 bioconda
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
fontconfig 2.14.0 hc2a2eb6_1 conda-forge
freetype 2.12.1 hca18f0e_0 conda-forge
keyutils 1.6.1 h166bdaf_0 conda-forge
kneaddata 0.12.0 pyhdfd78af_0 bioconda
krb5 1.19.3 h08a2579_0 conda-forge
ld_impl_linux-64 2.36.1 hea4e1c9_2 conda-forge
libcurl 7.83.1 h2283fc2_0 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 h516909a_1 conda-forge
libffi 3.4.2 h7f98852_5 conda-forge
libgcc-ng 12.1.0 h8d9b700_16 conda-forge
libgomp 12.1.0 h8d9b700_16 conda-forge
libnghttp2 1.47.0 hff17c54_1 conda-forge
libnsl 2.0.0 h7f98852_0 conda-forge
libpng 1.6.38 h753d276_0 conda-forge
libsqlite 3.39.3 h753d276_0 conda-forge
libssh2 1.10.0 hf14f497_3 conda-forge
libstdcxx-ng 12.1.0 ha89aaad_16 conda-forge
libuuid 2.32.1 h7f98852_1000 conda-forge
libzlib 1.2.12 h166bdaf_3 conda-forge
ncurses 6.3 h27087fc_1 conda-forge
openjdk 8.0.332 h166bdaf_0 conda-forge
openssl 3.0.5 h166bdaf_2 conda-forge
perl 5.32.1 2_h7f98852_perl5 conda-forge
pip 22.2.2 pyhd8ed1ab_0 conda-forge
python 3.10.6 ha86cf86_0_cpython conda-forge
python_abi 3.10 2_cp310 conda-forge
readline 8.1.2 h0f457ee_0 conda-forge
samtools 1.6 h3f2fef4_8 bioconda
setuptools 65.4.0 pyhd8ed1ab_0 conda-forge
tbb 2021.6.0 h924138e_0 conda-forge
tk 8.6.12 h27826a3_0 conda-forge
trf 4.09.1 hec16e2b_2 bioconda
trimmomatic 0.39 hdfd78af_2 bioconda
tzdata 2022d h191b570_0 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
xz 5.2.6 h166bdaf_0 conda-forge
zlib 1.2.12 h166bdaf_3 conda-forge
zstd 1.5.2 h6239696_4 conda-forge

```

---

<div class="post-metadata">

**Author:** ![Kirby](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/kirby/32/1600_2.png) [@Kirby](https://forum.biobakery.org/u/Kirby)\
**Post date:** [October 16, 2022, 12:25pm UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/2 "2022-10-16T12:25:10Z")

</div>

try edit [trimmomatic\_jar=“trimmomatic\*” to “trimmomatic.jar”] in python script [~/miniconda3/envs/kneaddata/lib/python3.7/site-packages/kneaddata/config.py]

---

<div class="post-metadata">

**Author:** ![Yunliang81](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yunliang81/32/1885_2.png) [@Yunliang81](https://forum.biobakery.org/u/Yunliang81)\
**Post date:** [January 14, 2023, 2:10am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/3 "2023-01-14T02:10:50Z")

</div>

I have the same issue as Roy\_Cheng mentioned. I tried edit the [trimmomatic\_jar=“trimmomatic\*” to “trimmomatic.jar”] in the “config.py”. However, it still doesn’t work. Any ideas? Thanks

---

<div class="post-metadata">

**Author:** ![Alex\_Grier](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/alex_grier/32/1922_2.png) [@Alex\_Grier](https://forum.biobakery.org/u/Alex_Grier)\
**Post date:** [February 1, 2023, 5:35am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/4 "2023-02-01T05:35:22Z")

</div>

This was a weird one. Here is a solution:

```auto
mkdir trim_tools
cp -r ~/miniconda3/envs/$MYENV/share/trimmomatic/adapters trim_tools/
cp ~/miniconda3/envs/$MYENV/share/trimmomatic/trimmomatic.jar trim_tools/

```

Replace `$MYENV` with the name of your conda environment.

Then, include the argument `--trimmomatic $PWD/trim_tools` every time you run the `kneaddata` command. (`$PWD` is obviously a stand in for the full path of wherever you made the `trim_tools` directory)

---

<div class="post-metadata">

**Author:** ![Ben\_Siranosian](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/ben_siranosian/32/2286_2.png) [@Ben\_Siranosian](https://forum.biobakery.org/u/Ben_Siranosian)\
**Post date:** [July 5, 2023, 4:14pm UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/5 "2023-07-05T16:14:26Z")

</div>

I’ve come across this error as well. It is due to a conflict between the biobakery workflows and the conda install. If you look at the file `$MYENV/bin/trimmomatic` you can see it is just a plain text wrapper for a java file. The first comment is “Wrapper script for Java Conda packages that ensures that the java runtime”

However, biobakery\_workflows is trying to call this plain text file as the jar file, visible in the error message `Err: CRITICAL ERROR: Error executing: java -Xmx500m -jar $MYENV/bin/trimmomatic SE -threads 1 ...`

I found the jar file that the wrapper script is calling, and replaced the wrapper script with it. First I backed up the wrapper script so it can still be used with the command “trimmomatic\_cmdline”

```auto
cp $MYENV/bin/trimmomatic $MYENV/bin/trimmomatic_cmdline
ln -s $MYENV/share/trimmomatic/trimmomatic.jar $MYENV/bin/trimmomatic
ln -s $MYENV/share/trimmomatic/trimmomatic.jar $MYENV/bin/trimmomatic.jar

```

Then, you can use the tools as normal, and use `trimmomatic_cmdline` if needed.  
`$MYENV` should be replaced with the path to your conda environment.

---

<div class="post-metadata">

**Author:** ![levlitichev](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@levlitichev](https://forum.biobakery.org/u/levlitichev)\
**Post date:** [July 13, 2023, 4:19am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/6 "2023-07-13T04:19:53Z")

</div>

This is great, Ben. Thanks for sharing. I had to modify your first line to make this work:

```auto
mv $MYENV/bin/trimmomatic $MYENV/bin/cmdline_trimmomatic

```

- I changed `cp` to `mv` so that `ln` didn’t complain about the destination already existing
- Having the file `trimmomatic_cmdline` still caused an error:

```auto
Error: Invalid or corrupt jarfile /home/litichev/mambaforge/envs/humann3/bin/trimmomatic_cmdline

```

But renaming the file to `cmdline_trimmomatic` fixed this.

---

<div class="post-metadata">

**Author:** ![davised](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/davised/32/2421_2.png) [@davised](https://forum.biobakery.org/u/davised)\
**Post date:** [September 15, 2023, 6:39am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/7 "2023-09-15T06:39:22Z")

</div>

Ok, here is the shortest path to getting it working:

```auto
conda activate kneaddata
cd $CONDA_PREFIX/bin
ln -s ../share/trimmomatic/trimmomatic.jar .
sed -i 's/trimmomatic_jar="trimmomatic\*"/trimmomatic_jar="trimmomatic.jar"/' ../lib/python3.10/site-p
ackages/kneaddata/config.py
python ../lib/python3.10/site-packages/kneaddata/config.py

```

Then you should be good to go. You can still run trimmomatic standalone as well.

---

<div class="post-metadata">

**Author:** ![yang\_wang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yang_wang/32/2614_2.png) [@yang\_wang](https://forum.biobakery.org/u/yang_wang)\
**Post date:** [December 25, 2023, 2:26pm UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/8 "2023-12-25T14:26:24Z")

</div>

it works, one nice solution! niubi!

---

<div class="post-metadata">

**Author:** ![Suparna\_Mitra](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/suparna_mitra/32/2170_2.png) [@Suparna\_Mitra](https://forum.biobakery.org/u/Suparna_Mitra)\
**Post date:** [September 30, 2024, 5:29am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/9 "2024-09-30T05:29:14Z")

</div>

Hi, @levlitichev first I tried ben’s solution but as you specified I had problem with ln complain about the destination already existing… Then I tried yours but I am seeing similar error like yours.

You said renaming the file to cmdline\_trimmomatic… which file do I need to rename? Please guide.  
Thanks

---

<div class="post-metadata">

**Author:** ![levlitichev](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@levlitichev](https://forum.biobakery.org/u/levlitichev)\
**Post date:** [October 1, 2024, 12:58am UTC](https://forum.biobakery.org/t/kneaddata-installed-with-conda-is-not-available/4147/10 "2024-10-01T00:58:07Z")

</div>

Maybe try `mv /home/litichev/mambaforge/envs/humann3/bin/trimmomatic_cmdline /home/litichev/mambaforge/envs/humann3/bin/cmdline_trimmomatic` but make the path whatever it is on your system.
