QIIME: Difference between revisions
mNo edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
<!--T:2--> | <!--T:2--> | ||
'''Note''': QIIME 2 has replaced QIIME 1 as of January 1, 2018; version 1 is no longer supported. | '''Note''': QIIME 2 has replaced QIIME 1 as of January 1, 2018; version 1 is no longer supported. | ||
'''Note''': As of February 18, 2020, and given the issues generated by conda environments in our HPC systems, '''installation with through Ananconda or Miniconda is no longer supported'''. | |||
==Installation == <!--T:4--> | ==Installation == <!--T:4--> | ||
QIIME 2 can be installed in your home directory | QIIME 2 can be installed through a docker/singularity container or using easy build wheel. The former is strongly preferred since it does not generate thousands of files in your home directory, potentially preventing you from running your jobs. | ||
=== With singularity (preferred) === <!--T:14--> | |||
<!--T:15--> | |||
It is possible to run QIIME2 through singularity using preexisting images. A docker image is available at [https://hub.docker.com/u/qiime2 qiime2], but first you need to build a singularity image from [[Singularity/en#Creating_an_image_using_Docker_Hub|docker]]: | |||
<!--T:16--> | |||
{{Commands | |||
|module load singularity | |||
|singularity build qiime2-2019.10.sif docker://qiime2/core:2019.10 | |||
}} | |||
<!--T: | <!--T:17--> | ||
Then run your code as any other singularity [[Singularity/en|job]]. For most QIIME usage, you want to run each QIIME command within a [https://docs.computecanada.ca/wiki/Singularity/en#Running_a_single_command singularity exec statement]: | |||
===With a conda environment=== <!--T:5--> | {{Commands | ||
|singularity exec qiime2-2019.10.sif <your QIIME command> | |||
}} | |||
So your SBATCH script might look something like this: | |||
<pre> | |||
#!/bin/bash | |||
#SBATCH --time=15:00:00 | |||
#SBATCH --account=def-someuser | |||
singularity exec -B /home -B /project -B /scratch \ | |||
qiime2-2019.10.sif qiime tools import \ | |||
--type 'FeatureData[Sequence]' \ | |||
--input-path /path/to/some_fastafile.fa \ | |||
--output-path /path/to/some_output_feature.qza | |||
singularity exec -B /home -B /project -B /scratch \ | |||
qiime tools import \ | |||
--type 'FeatureData[Taxonomy]' \ | |||
--input-format HeaderlessTSVTaxonomyFormat \ | |||
--input-path /path/to/some_taxonomy_file.tax \ | |||
--output-path /path/to/some_output_ref-taxonomy.qza | |||
singularity exec -B /home -B /project -B /scratch \ | |||
qiime feature-classifier fit-classifier-naive-bayes \ | |||
--i-reference-reads /path/to/some_output_feature.qza \ | |||
--i-reference-taxonomy /path/to/some_output_ref-taxonomy.qza \ | |||
--o-classifier /path/to/some_output_classifier.qza | |||
</pre> | |||
Note that it is important to [https://docs.computecanada.ca/wiki/Singularity#Bind_mounts bind] the folders you want to work with to the execution of the container. For more information about singularity, you can watch the recorded [https://www.youtube.com/watch?v=kYb0aXS5DEE singularity webminar]. | |||
<!--T:18--> | |||
On first importing data into QIIME format you may receive an error ending with a message like this: | |||
<pre> | |||
Timezone offset does not match system offset: 0 != -18000. Please, check your config files. | |||
</pre> | |||
This can be worked around by setting a time zone before invoking Singularity: | |||
<!--T:19--> | |||
{{Commands | |||
|export TZ{{=}}'UTC' | |||
|singularity exec qiime2-2019.10.sif qiime tools import ... | |||
}} | |||
<!-- ===With a conda environment=== <!--T:5--> | |||
Although we '''do not recommend''' using conda environments in an HPC environment, we provide the option to do so at your own peril. | Although we '''do not recommend''' using conda environments in an HPC environment, we provide the option to do so at your own peril. | ||
Line 40: | Line 101: | ||
</pre> | </pre> | ||
<translate> | <translate> --> | ||
=== | === With the EasyBuild wheel === <!--T:9--> | ||
In case the singularity solution isn't working for you, we also provide an EasyBuild package that can be used with the <tt>eb</tt> command. To install version 2019.7, use | |||
</translate> | </translate> | ||
{{Commands | |||
eb --rebuild Miniconda3-4.7.10.eb QIIME2-2019.7.eb | |eb --rebuild Miniconda3-4.7.10.eb QIIME2-2019.7.eb | ||
}} | |||
<translate> | <translate> | ||
<!--T:10--> | <!--T:10--> | ||
This takes a while, but will provide you with the qiime/2019.7 module that you need to load before using QIIME 2. | This takes a while, but will provide you with the qiime/2019.7 module that you need to load before using QIIME 2. | ||
</translate> | </translate> | ||
{{Commands | {{Commands | ||
|module load | |module load qiime2/2019.7 | ||
}} | }} | ||
<translate> | |||
Because this creates all the packages required for QIIME, it generates too many files in your home directory. We recommend that you remove those files once you are done with all computations since it uses almost half of your total allocation. Even better, we recommend you use our [https://docs.computecanada.ca/wiki/QIIME#With_singularity_.28preferred.29 singularity] solution, that creates a big file instead of thousand of smaller files. | |||
=References = <!--T:11--> | =References = <!--T:11--> | ||
Line 90: | Line 125: | ||
[http://qiime.org/ QIIME homepage]<br> | [http://qiime.org/ QIIME homepage]<br> | ||
[https://easybuild.readthedocs.io/en/latest/ EasyBuild documentation]<br> | [https://easybuild.readthedocs.io/en/latest/ EasyBuild documentation]<br> | ||
[https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html Getting started with Conda]<br> | <!--[https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html Getting started with Conda]<br>--> | ||
</translate> | </translate> | ||
[[Category:Bioinformatics]] | [[Category:Bioinformatics]] | ||
[[Category:User Installed Software]] | [[Category:User Installed Software]] |
Revision as of 19:07, 18 February 2020
QIIME (pronounced chime) stands for Quantitative Insights Into Microbial Ecology, is an open-source bioinformatics pipeline for performing microbiome analysis from raw DNA sequencing data. QIIME is designed to take users from raw sequencing data generated on Illumina or other platforms to publication-quality graphics and statistics. This includes demultiplexing and quality filtering, OTU picking, taxonomic assignment, phylogenetic reconstruction, diversity analyses and visualizations. QIIME has been applied to studies based on billions of sequences from tens of thousands of samples.
Note: QIIME 2 has replaced QIIME 1 as of January 1, 2018; version 1 is no longer supported.
Note: As of February 18, 2020, and given the issues generated by conda environments in our HPC systems, installation with through Ananconda or Miniconda is no longer supported.
Installation
QIIME 2 can be installed through a docker/singularity container or using easy build wheel. The former is strongly preferred since it does not generate thousands of files in your home directory, potentially preventing you from running your jobs.
With singularity (preferred)
It is possible to run QIIME2 through singularity using preexisting images. A docker image is available at qiime2, but first you need to build a singularity image from docker:
[name@server ~]$ module load singularity
[name@server ~]$ singularity build qiime2-2019.10.sif docker://qiime2/core:2019.10
Then run your code as any other singularity job. For most QIIME usage, you want to run each QIIME command within a singularity exec statement:
[name@server ~]$ singularity exec qiime2-2019.10.sif <your QIIME command>
So your SBATCH script might look something like this:
#!/bin/bash #SBATCH --time=15:00:00 #SBATCH --account=def-someuser singularity exec -B /home -B /project -B /scratch \ qiime2-2019.10.sif qiime tools import \ --type 'FeatureData[Sequence]' \ --input-path /path/to/some_fastafile.fa \ --output-path /path/to/some_output_feature.qza singularity exec -B /home -B /project -B /scratch \ qiime tools import \ --type 'FeatureData[Taxonomy]' \ --input-format HeaderlessTSVTaxonomyFormat \ --input-path /path/to/some_taxonomy_file.tax \ --output-path /path/to/some_output_ref-taxonomy.qza singularity exec -B /home -B /project -B /scratch \ qiime feature-classifier fit-classifier-naive-bayes \ --i-reference-reads /path/to/some_output_feature.qza \ --i-reference-taxonomy /path/to/some_output_ref-taxonomy.qza \ --o-classifier /path/to/some_output_classifier.qza
Note that it is important to bind the folders you want to work with to the execution of the container. For more information about singularity, you can watch the recorded singularity webminar.
On first importing data into QIIME format you may receive an error ending with a message like this:
Timezone offset does not match system offset: 0 != -18000. Please, check your config files.
This can be worked around by setting a time zone before invoking Singularity:
[name@server ~]$ export TZ='UTC'
[name@server ~]$ singularity exec qiime2-2019.10.sif qiime tools import ...
With the EasyBuild wheel
In case the singularity solution isn't working for you, we also provide an EasyBuild package that can be used with the eb command. To install version 2019.7, use
[name@server ~]$ eb --rebuild Miniconda3-4.7.10.eb QIIME2-2019.7.eb
This takes a while, but will provide you with the qiime/2019.7 module that you need to load before using QIIME 2.
[name@server ~]$ module load qiime2/2019.7
Because this creates all the packages required for QIIME, it generates too many files in your home directory. We recommend that you remove those files once you are done with all computations since it uses almost half of your total allocation. Even better, we recommend you use our singularity solution, that creates a big file instead of thousand of smaller files.