running qiime in a shell script

764 views
Skip to first unread message

Husen Zhang

unread,
Apr 1, 2016, 12:30:43 PM4/1/16
to Qiime 1 Forum
Hi qiime community:

On a typical qiime install on Ubuntu Linux, is there a way to use qiime in a shell script? The equivalent commands under MacOS and a cluster might be :
 source /macqiime/config/bash_profile 
 module load qiime 

Husen



Jenya Kopylov

unread,
Apr 1, 2016, 5:12:37 PM4/1/16
to Qiime 1 Forum
Hi Husen,

The two commands you posted set QIIME's and all its dependencies paths (into $PATH and $PYTHONPATH) to be usable in the current shell. 
If you installed QIIME on Linux with correct paths setup, then you could call all of QIIME's script directly via a shell (or put QIIME commands in a bash script and launch them in a shell).

Let me know if I'm not interpreting your question correctly ..
Jenya

Husen Zhang

unread,
Apr 1, 2016, 6:11:27 PM4/1/16
to Qiime 1 Forum
Jenya-
Thanks for your reply!   I'm using NERC bio-linux8, a non-standard qiime install?  I normally type qiime in a command line, then i see a qiime prompt. then I start to use qiime's scripts like this:

$ qiime
$ qiime > print_qiime_config.py 

If i need to put "print_qiime_config.py" in a script like : 

#!/bin/bash
print_qiime_config.py

it doesn't work because bash won't know where to look for print_qiime_config.py... 
how to I tell my bash script the correct paths?

husen


Colin Brislawn

unread,
Apr 1, 2016, 8:27:36 PM4/1/16
to Qiime 1 Forum
Hello Husen,

I also use qiime on Linux clusters, like you do. The trick here is to activate the qiime environment (by typing 'module load qiime' or 'source activate qiime' or whatever) before running the script.

So I might type:

ssh nodename
cd correct_working_directory
module load qiime
./first_qiime_script.sh

Does that help?

how to I tell my bash script the correct paths?
You don't. Instead, you tell your terminal first, then you run the .bash script. 


Colin

Husen Zhang

unread,
Apr 1, 2016, 11:03:34 PM4/1/16
to Qiime 1 Forum
Hi Colin:
Thanks for chiming in.  Yes and no ... looks like source /somepath/to/qiime/activate.sh may work, but that might change my bio-linux default behavior. Should I read:
https://github.com/qiime/qiime-deploy
?
Husen

Husen Zhang

unread,
Apr 1, 2016, 11:10:23 PM4/1/16
to Qiime 1 Forum
I should have said that I had no problem running qiime under a cluster.   I do have a problem running qiime under a workstation, since there is no "module load" option for me on a workstation..

Colin Brislawn

unread,
Apr 3, 2016, 7:33:43 PM4/3/16
to Qiime 1 Forum
Let's see if I can help you get it running on your computer. What have you tried? Do any of the qiime commands work?  

Colin

Husen Zhang

unread,
Apr 4, 2016, 10:25:38 AM4/4/16
to Qiime 1 Forum
Hi Colin and Jenya -
My bad. Once I typed "qiime" at the command line then all the scripts works individually or one by one in a text file. Everything works fine for me now. 

Thanks!

Colin Brislawn

unread,
Apr 4, 2016, 1:11:09 PM4/4/16
to Qiime 1 Forum
Oh great!
Let us know if you have any other questions,
Colin

Husen Zhang

unread,
Apr 7, 2016, 10:07:20 AM4/7/16
to Qiime 1 Forum
Thanks Colin! 
For those who also uses a bio-linux machine, the command "source /usr/bin/qiime" is equivalent of typing "qiime" at the command line.
Husen
Reply all
Reply to author
Forward
0 new messages