Have problem using HUMAnN on cluster

663 views
Skip to first unread message

yangfa...@gmail.com

unread,
Feb 11, 2015, 12:20:31 PM2/11/15
to humann...@googlegroups.com
Dear HUMAnN developers,

I have problem using HUMAnN on cluster. IT people told me that HUMAnN wasn’t really designed to be run on a shared resource. IT people installed HUMAnN on cluster. However, I don't have permission to put files into /home/apps/humann/humann-0.99/input/ directory. They made changes for me to help me successfully use HUMAnN on cluster. The following is what they taught me how to do it.

"This is how you use it.
use qsub -I to connect to a compute node

Create the directories:
/home/n-z/yang66/input
/home/n-z/yang66/output

Load the module:
module load humann/0.99

Change your current directory to:
cd /home/apps/humann/human-0.99

Now run:
scons

This will take whatever files you input into the /home/n-z/yang66/input directory
then output the results to the /home/n-z/yang66/output directory."

I put one blast result into /home/n-z/yang66/input/403.txt directory. Then I did the above. But I have problems. The following is the error message.

scons: Reading SConscript files ...
Please create the directories /home/n-z/yang66/input and /home/n-z/yang66/output
IOError: [Errno 13] Permission denied: '/home/apps/humann/humann-0.99/provenance
.txt':
File "/home/apps/humann/humann-0.99/SConstruct", line 46:
format = '%(asctime)s %(levelname)-8s %(message)s' )
File "/home/apps/python/python-2.7.3/lib/python2.7/logging/__init__.py", line
1519:
hdlr = FileHandler(filename, mode)
File "/home/apps/python/python-2.7.3/lib/python2.7/logging/__init__.py", line
897:
StreamHandler.__init__(self, self._open())
File "/home/apps/python/python-2.7.3/lib/python2.7/logging/__init__.py", line
916:
stream = open(self.baseFilename, self.mode)

Could you help me fix it?

Thanks a lot for your help in advance.

Fang


Lauren McIver

unread,
Feb 11, 2015, 1:39:39 PM2/11/15
to humann...@googlegroups.com
Hello Fang,

There is a humann script that will create a local workspace ( humann/src/humann_init.py ). I think using a local workspace will resolve your error.

Here are the steps to create a local workspace (with paths that I think are right for your cluster based on your email):

0. Connect to a compute node and load the humann module

1. Select a directory for the local humann workspace (lets call it humann_workspace for the example commands)
$ mkdir /home/n-z/yang66/humann_workspace

2. Change into that directory
$ cd /home/n-z/yang66/humann_workspace

3. Run the script to create a local workspace
$ /home/apps/humann/human-0.99/src/humann_init.py

4. Review the SConstruct file to make sure the input and output directories are set to the local workspace
These two variables in the SConstruct file should be set as follows
# Directory name scanned for input files
c_strDirInput = "input"
# Directory into which all output files are placed
c_strDirOutput = "output"

After the local workspace has been created, you should be able to run humann with these steps:

0. Connect to a compute node and load the humann module (if not already connected and loaded)

1. Change into the local workspace directory
$ cd /home/n-z/yang66/humann_workspace

2. Add your inputs to /home/n-z/yang66/humann_workspace/input (it will originally contain the humann demo inputs)

3. Run humann
$ scons

4. The output will be written to /home/n-z/yang66/humann_workspace/output

Please let me know if this resolves your error message.

Thank you,
Lauren




Fang Yang

unread,
Feb 11, 2015, 2:22:59 PM2/11/15
to humann...@googlegroups.com
Dear Lauren,

I really appreciate your help. I have a problem when I am following your instructions. The error message is as follows. Where can I download humann_init.py?

[yang66@compute-5-11 ~]$ mkdir /home/n-z/yang66/humann_workspace
[yang66@compute-5-11 ~]$ cd /home/n-z/yang66/humann_workspace
[yang66@compute-5-11 humann_workspace]$ module load humann/0.99
[yang66@compute-5-11 humann_workspace]$ /home/apps/humann/human-0.99/src/humann_
init.py
-system-specific: /home/apps/humann/human-0.99/src/humann_init.py: No such file
or directory
[yang66@compute-5-11 humann_workspace]$ module load python
[yang66@compute-5-11 humann_workspace]$ python /home/apps/humann/human-0.99/src/
humann_init.py
python: can't open file '/home/apps/humann/human-0.99/src/humann_init.py': [Errn
o 2] No such file or directory

Thanks.

Fang
--
Fang Yang

Division of Nutritional Sciences
University of Illinois at Urbana-Champaign
382 Edward R. Madigan Laboratory
1201 West Gregory Drive
Urbana, IL 61801
Phone:217-418-4483

Lauren McIver

unread,
Feb 11, 2015, 3:51:22 PM2/11/15
to humann...@googlegroups.com
Hi Fang,

To create a local humann2 workspace, you need to run the humann_init.py included in the humann install. I believe humann_init.py should be in a sub-folder of /home/apps/humann/human-0.99/ on your cluster. However, I am not sure which sub-folder. If you run the following command it should provide the location of the src directory : $ ls -Rl /home/apps/humann/human-0.99/ | grep src . humann_init.py should be in the humann/src directory. Alternatively you could try running : $ python humann_init.py (which will also find the file if humann/src/ is included in your $PYTHONPATH when you load the humann install) .

Thank you,
Lauren



Ali May

unread,
Feb 11, 2015, 7:17:06 PM2/11/15
to humann...@googlegroups.com, yangfa...@gmail.com
You should be able to run humann on a cluster node without having it installed as a module. Can you try the following? Note my comments on steps 7 and 11 for relevant changes

1- mkdir /home/n-z/yang66/humann_work #Create working space
2- cd /home/n-z/yang66/humann_work #cd to the working space
3- wget https://bitbucket.org/biobakery/humann/downloads/humann-v0.99.tar.gz # Get a local copy of humann in the working space
4- tar xf humann-v0.99.tar.gz # Extract humann
5- cd humann-0.99 # Change dir to humann
6- mkdir MyProjectInput MyProjectOutput #Create custom input and output folders
7- ln -s /home/n-z/yang66/MyProject/blastoutput/* MyProjectInput #Soft link the mapping results ot the custom input folder. NOTE: Change the path to your blast results accordingly, i.e. change  /home/n-z/yang66/MyProject/blastoutput/ to the relevant path. Note that all the files in this folder should be blast (mapping, to be more precise) outputs. Otherwise just softlink/copy all the mapping outputs to the MyProjectInput folder. 
8- cp SConstruct MyProjectSconstruct #Create a custom Sconstruct file
9- sed -i 's/^c_strDirInput.*/c_strDirInput="MyProjectInput"\n/' MyProjectSconstruct #Change the line with the default input dir to the custom input dir
10- sed -i 's/^c_strDirOutput.*/c_strDirOutput="MyProjectOutput"\n/' MyProjectSconstruct #Same with the default output dir to the custom output dir
11- scons -f MyProjectSconstruct -j NumberOfThreads #Run humann. NOTE: NumberOfThreads = The number of cores in the cluster node you're connected to. If you're unsure just use "-j 1"

The results (after some time, depending on the size of your input) should appear in the MyProjectOutput folder.

Fang Yang

unread,
Feb 12, 2015, 12:43:44 PM2/12/15
to humann...@googlegroups.com
Hi Ali,

Thanks for your help. All steps work fine except the last step. The following is the error message. The results didn't appear in the 403Output folder. Could you help me fix it? Thanks a lot for your help.

[yang66@compute-5-16 humann-0.99]$ scons -f 403Sconstruct -j 1

scons: Reading SConscript files ...
Please create the directories /home/n-z/yang66/input and /home/n-z/yang66/output
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.

Ali Rahnavard

unread,
Feb 12, 2015, 1:10:42 PM2/12/15
to humann...@googlegroups.com, yangfa...@gmail.com
Hi Fang,

I believe that you need to remove the old output directories using "scons -c" and then re-try it.

Thank you,
Ali

====
The Huttenhower lab

Fang Yang

unread,
Feb 12, 2015, 4:06:33 PM2/12/15
to humann...@googlegroups.com
Dear Lauren,

It works.

Thanks so much for your help.

Fang

raven...@gmail.com

unread,
Apr 29, 2016, 5:25:35 PM4/29/16
to HUMAnN Users
Hi all,

I may have a similar question. I am also trying to use a cluster and the humann2_test showed no errors, but when I attempt download the full database using:

!/bin/bash
#SBATCH -e slurm.err
#SBATCH -o slurm.out
export PATH=/opt/apps/slurm/bowtie2-2.2.5/:/opt/apps/slurm/metaphlan2:/opt/apps/Python-2.7.10/bin/:$PATH
humann2_databases --download chocophlan full .
humann2_databases --download uniref uniref50_diamond .


I get the following error:
Unable to write to the config file: /opt/apps/Python-2.7.10/lib/python2.7/site-packages/humann2-0.7.0-py2.7.egg/humann2/humann2.cfg

This makes me think HUMAnN2 is trying to alter Python and because Python is a shared resource I don't have writing privileges.
Does that seem like a correct interpretation? And if so, do you have any suggestions for working around this? Perhaps the best approach would be to install Python in my home directory.

Thanks!
Raven

Eric Franzosa

unread,
Apr 30, 2016, 7:06:42 PM4/30/16
to humann...@googlegroups.com
Hi Raven,

Yes, that sounds like the right interpretation to me. Please have a look at the "--local" install option in the HUMAnN manual. You can install and use personal Python packages that way without having to install your own Python -- it's really handy!

Thanks,
Eric


Lauren McIver

unread,
May 20, 2016, 2:59:44 PM5/20/16
to HUMAnN Users
Hi Raven,

When humann2 downloads the databases it writes the location to the config file (humann2.cfg). This is how humann2 keeps track of where the default databases are located. Ideally the databases would be installed at the same time as humann2 with the same privileges. So if humann2 was installed globally as root the databases would also be installed globally as root. This way all users will have the same default databases. If you installed humann2 as root, then if you install the databases as root it will resolve the error message you are seeing.

Your post brings up a good point that users might want to run the global humann2 install to download databases for individual use. This is possible with the current version however it will issue an error during the last step of trying to write to the config file. I will update the download script so that it only issues a warning if it is unable to write to the config file.

Currently you should be all set to run. The only difference in your environment is that humann2 was unable to record the locations of the downloaded databases. Therefore to run with these databases you would need to provide the locations with the following humann2 options "--protein-database $UNIREF" and "--nucleotide-database $CHOCOPHLAN" as the humann2 config file was not updated and so is set to use the demo databases.

Please let me know if you have any questions.

Thank you,
Lauren
 

Raven Bier

unread,
Jun 15, 2016, 9:50:32 AM6/15/16
to humann...@googlegroups.com
Thanks Eric and Lauren! We were able to change the location of some files, after which it ran unhindered.

Best,
Raven
Reply all
Reply to author
Forward
0 new messages