QIIME: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(Marked this version for translation)
(there was an error in the batch script example (/projects instead of /project))
 
(3 intermediate revisions by one other user not shown)
Line 11: Line 11:


== QIIME2 as a module == <!--T:31-->
== QIIME2 as a module == <!--T:31-->
QIIME2 is now available in our environment using a module which wraps around a container. You can run  
QIIME2 is available in our environment via a module which wraps around a container. To know which versions are available, run  
{{Command|module spider qiime2}}
{{Command|module spider qiime2}}
to find which versions we have available.


<!--T:32-->
<!--T:32-->
Line 22: Line 22:
{{Callout
{{Callout
   |title=Note
   |title=Note
   |content=Since the <tt>qiime</tt> command is in fact calling a container, you may have to define the environment variable <tt>APPTAINER_BIND</tt> to bind specific folders within the container to access your data. For example: <tt>APPTAINER_BIND=/home qiime ...</tt>
   |content=Since the <code>qiime</code> command is in fact calling a container, you may have to define the environment variable <code>APPTAINER_BIND</code> to bind specific folders within the container to access your data. For example: <code>APPTAINER_BIND=/home qiime ...</code>
}}
}}


Line 46: Line 46:


<!--T:17-->
<!--T:17-->
Then run your code as described at [[Apptainer]].  Typically you will run each QIIME command in a <code>apptainer exec</code> statement:
Then run your code as described in the [[Apptainer]] pageYou will typically run each QIIME command in a <code>apptainer exec</code> statement:
</translate>
</translate>


Line 64: Line 64:


apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
   -B /projects/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
   -B /project/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
   qiime tools import --type 'FeatureData[Sequence]' \
   qiime tools import --type 'FeatureData[Sequence]' \
   --input-path /inputs/some_fastafile.fa \
   --input-path /inputs/some_fastafile.fa \
Line 70: Line 70:


apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
   -B /projects/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
   -B /project/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
   qiime tools import \
   qiime tools import \
   --type 'FeatureData[Taxonomy]' \
   --type 'FeatureData[Taxonomy]' \
Line 78: Line 78:


apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
   -B /projects/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
   -B /project/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
   qiime feature-classifier fit-classifier-naive-bayes \
   qiime feature-classifier fit-classifier-naive-bayes \
   --i-reference-reads  /outputs/some_output_feature.qza \
   --i-reference-reads  /outputs/some_output_feature.qza \
Line 87: Line 87:
<translate>
<translate>
<!--T:28-->
<!--T:28-->
Note that it is important to use the [[Apptainer#Bind_mounts|bind]] option (<code>-B</code>) with each folder you want to work with when you run programs in your container. For more information about Apptainer, you can watch the recorded [https://www.youtube.com/watch?v=bpmrfVqBowY Apptainer webinar].
Note that it is important to use the [[Apptainer#Bind_mounts|bind]] option (<code>-B</code>) with each folder you want to work with when you run programs in your container. For more information about Apptainer, you can watch this [https://www.youtube.com/watch?v=bpmrfVqBowY Apptainer webinar].


<!--T:18-->
<!--T:18-->

Latest revision as of 16:25, 9 January 2024

Other languages:

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 2020, due to various issues generated by Conda environments on our HPC systems, installation using Anaconda or Miniconda is no longer supported.

QIIME2 as a module

QIIME2 is available in our environment via a module which wraps around a container. To know which versions are available, run

Question.png
[name@server ~]$ module spider qiime2


After loading the module, you can run

Question.png
[name@server ~]$ qiime --help


Note

Since the qiime command is in fact calling a container, you may have to define the environment variable APPTAINER_BIND to bind specific folders within the container to access your data. For example: APPTAINER_BIND=/home qiime ...


Installation

QIIME2 can be installed using Apptainer or EasyBuild. Apptainer is strongly preferred since it does not generate many thousands of files in your /home directory, potentially causing you to exceed the disk quota limit on the number of files.


Outdated

This page or section contains obsolete information and some statements may not be valid. The technical documentation is currently being updated by our support team.




Using Apptainer

The QIIME2 developers publish images on Quay.io. In order to use one of these images on our systems, you must first build an Apptainer image:

[name@server ~]$ module load apptainer
[name@server ~]$ apptainer build qiime2-2021.11.sif docker://quay.io/qiime2/core:2021.11


This build step may take over an hour, but you only need to do this once. Save the image file (qiime2-2021.11.sif in this example) for later re-use.

Then run your code as described in the Apptainer page. You will typically run each QIIME command in a apptainer exec statement:

[name@server ~]$ apptainer exec qiime2-2021.11.sif <your QIIME command>


So your SBATCH script might look something like this:

#!/bin/bash
#SBATCH --time=15:00:00
#SBATCH --account=def-someuser

apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
  -B /project/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
  qiime tools import --type 'FeatureData[Sequence]' \
  --input-path /inputs/some_fastafile.fa \
  --output-path /outputs/some_output_feature.qza

apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
  -B /project/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
  qiime tools import \
  --type 'FeatureData[Taxonomy]' \
  --input-format HeaderlessTSVTaxonomyFormat \
  --input-path /inputs/some_taxonomy_file.tax \
  --output-path /outputs/some_output_ref-taxonomy.qza

apptainer exec -B $PWD:/home -B /scratch/someuser:/outputs \
  -B /project/def-somePI/someuser/path/to/inputs:/inputs qiime2-2021.11.sif \
  qiime feature-classifier fit-classifier-naive-bayes \
  --i-reference-reads  /outputs/some_output_feature.qza \
  --i-reference-taxonomy /outputs/some_output_ref-taxonomy.qza \
  --o-classifier /outputs/some_output_classifier.qza

Note that it is important to use the bind option (-B) with each folder you want to work with when you run programs in your container. For more information about Apptainer, you can watch this Apptainer webinar.

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 Apptainer:

[name@server ~]$ export TZ='UTC'
[name@server ~]$ apptainer exec qiime2-2021.11.sif qiime tools import ...


References

QIIME home page