# How to write/use qiime2 script for LSF (bsub) + docker set up?

**URL:** <https://forum.qiime2.org/t/how-to-write-use-qiime2-script-for-lsf-bsub-docker-set-up/26451>\
**Category:** Technical Support\
**Created:** [May 15, 2023, 1:13am UTC](https://forum.qiime2.org/t/how-to-write-use-qiime2-script-for-lsf-bsub-docker-set-up/26451 "2023-05-15T01:13:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MBugay](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mbugay/32/4463_2.png) [@MBugay](https://forum.qiime2.org/u/MBugay)\
**Post date:** [May 15, 2023, 1:13am UTC](https://forum.qiime2.org/t/how-to-write-use-qiime2-script-for-lsf-bsub-docker-set-up/26451/1 "2023-05-15T01:13:01Z")

</div>

Hello all,

I'm looking for guidance on how to write a non-interactive job script for qiime2. The HPC I have access to uses LSF and docker images, which are both new to me. So far, I have been creating an interactive shell to use qiime2 (I created a .sh file that I submit) and have used the below when submitting the job:

```auto
#! /bin/bash
 bsub -Is -G [compute-group] -q general-interactive -R 'rusage[mem=16GB]' -a 'docker(quay.io/qiime2/core:2023.2)' /bin/bash

```

This has worked fine and, if I need to increase RAM, I re-submit with 16GB replaced with 32GB. However, an issue is that this shell has a 24 hour limit and so does the vpn I use to access the HPC. If I wanted to submit a non-interactive job (no time limit unless you specify it) for any qiime2 commands (e.g., `dada2`, `cutadapt`, etc), how would I write a script for this?

I have seen some write their scripts like this:

```auto
#!/bin/bash
##NECESSARY JOB SPECIFICATIONS
#BSUB -J [JobName]
#BSUB -L /bin/bash
#BSUB -R "rusage[mem=32G]"
#BSUB -q general 
#BSUB -u name@email.com
#BSUB -B -N
#BSUB -o OutErr.%J
#BSUB -a 'docker(quay.io/qiime2/core:2023.2)'

##EXECUTABLE CODE

```

What would I put under "Executable Code"? Would it just be the qiime2 command I want to use? Would this also be a .sh file that I submit?

Any help or guidance to resources would be greatly appreciated! Thank you so much.

---

<div class="post-metadata">

**Author:** ![cherman2](https://forum.qiime2.org/user_avatar/forum.qiime2.org/cherman2/32/17129_2.png) [@cherman2](https://forum.qiime2.org/u/cherman2)\
**Post date:** [May 15, 2023, 4:36pm UTC](https://forum.qiime2.org/t/how-to-write-use-qiime2-script-for-lsf-bsub-docker-set-up/26451/2 "2023-05-15T16:36:42Z")

</div>

Hi @MBugay,  
I think our docs on docker would be helpful for you. Here is a step by step tutorial: [Running The Moving Pictures Tutorial In Docker (2018.11)](https://forum.qiime2.org/t/running-the-moving-pictures-tutorial-in-docker-2018-11/7105) and here is our install guide that has a little info on running commands with docker: [Installing QIIME 2 using Docker — QIIME 2 2023.2.0 documentation](https://docs.qiime2.org/2023.2/install/virtual/docker/)

Hope that helps!  
🐢

---

<div class="post-metadata">

**Author:** ![MBugay](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mbugay/32/4463_2.png) [@MBugay](https://forum.qiime2.org/u/MBugay)\
**Post date:** [June 9, 2023, 7:57pm UTC](https://forum.qiime2.org/t/how-to-write-use-qiime2-script-for-lsf-bsub-docker-set-up/26451/3 "2023-06-09T19:57:14Z")

</div>

Hi @cherman2

Thank you! I'll try out the tutorial and see what happens

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [July 11, 2023, 1:58am UTC](https://forum.qiime2.org/t/how-to-write-use-qiime2-script-for-lsf-bsub-docker-set-up/26451/4 "2023-07-11T01:58:09Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
