{"id":7756,"date":"2024-06-17T12:06:42","date_gmt":"2024-06-17T11:06:42","guid":{"rendered":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=7756"},"modified":"2026-07-27T09:52:36","modified_gmt":"2026-07-27T08:52:36","slug":"coverm","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/coverm\/","title":{"rendered":"CoverM"},"content":{"rendered":"<h2>Overview<\/h2>\n<p><a href=\"https:\/\/github.com\/wwood\/CoverM\">CoverM<\/a> aims to be a configurable, easy to use and fast DNA read coverage and relative abundance calculator focused on metagenomics applications.<\/p>\n<p>CoverM calculates coverage of genomes\/MAGs <a href=\"https:\/\/wwood.github.io\/CoverM\/coverm-genome.html\"><code>coverm genome<\/code><\/a> or individual contigs  <a href=\"https:\/\/wwood.github.io\/CoverM\/coverm-contig.html\"><code>coverm contig<\/code><\/a>. Calculating coverage by read mapping, its input can either be BAM files sorted by reference, or raw reads and reference genomes in various formats.<\/p>\n<p>Version 0.7.0 and 0.8.0 is installed on the CSF.<\/p>\n<p><strong>However, we recommend installing your own local copy in <em>conda environemtn<\/em> which will install some of the optional packages that our central install doesn&#8217;t support.<\/strong> See below for the simple instructions on how to install CoverM in <a href=\"#condaenv\">your own CSF3 conda env<\/a>.<\/p>\n<h2>Restrictions on use<\/h2>\n<p>CoverM is made available under GPL3+. There are no access restrictions on the CSF but all usage must adhere to that <a href=\"https:\/\/github.com\/wwood\/CoverM\/blob\/main\/LICENCE.txt\">license<\/a>.<\/p>\n<h2 id=\"condaenv\">Installing your own CoverM Conda Environment (Recommended)<\/h2>\n<p>By installing a copy of CoverM in a local <em>conda environment<\/em> (in your home directory) you&#8217;ll have a more up-to-date version than our central install, and will have all of the necessary and optional bioinf tools called by CoverM.<\/p>\n<p>Please run the following commands on the login node:<\/p>\n<pre>\r\nmodule purge\r\nmodule load apps\/binapps\/conda\/miniforge3\/25.9.1\r\n\r\n# Create a conda environment named coverm (or whatever name you want - but make a note of it)\r\nconda create -n coverm\r\n\r\nProceed ([y]\/n)? <strong>y<\/strong>\r\n\r\n# Activate the env\r\nconda activate coverm\r\n\r\n# Now install coverm into your env (will get the latest release)\r\nconda install coverm\r\n\r\nProceed ([y]\/n)? <strong>y<\/strong>\r\n\r\n# Test\r\ncoverm -h\r\n\r\n# Deactivate the env to return to your normal login node setup\r\nconda deactivate\r\n<\/pre>\n<p>When running the application, you should use the following commands in your jobscript:<\/p>\n<pre>\r\nmodule purge\r\nmodule load apps\/binapps\/conda\/miniforge3\/25.9.1\r\nconda activate coverm\r\ncoverm <em>COMMAND-LINE-FLAGS<\/em>\r\n<\/pre>\n<p>See below for complete examples.<\/p>\n<h2>Using the centrally installed version<\/h2>\n<p>We recommend that you use the <a href=\"#condaenv\">Conda Environment method (above)<\/a> (the centrally installed version may be an old version.)<\/p>\n<p>However, should you wish to use the centrally installed version, load one of the following modulefiles:<\/p>\n<pre>\r\nmodule load apps\/binapps\/coverm\/0.8.0\r\nmodule load apps\/binapps\/coverm\/0.7.0\r\n  #\r\n  # Both of these modulefiles will load automatically the following modulefiles:\r\n  module load apps\/gcc\/samtools\/1.9\r\n  module load apps\/binapps\/minimap2\/2.24\r\n  module load apps\/binapps\/bwa-mem2\/2.2.1\r\n  module load apps\/binapps\/dashing\/1.0.3\r\n  module load apps\/gcc\/fastani\/1.3\r\n  #\r\n  # For version 0.8.0 an additional dependency module is required which is automatically loaded too:\r\n  module load apps\/rust\/strobealign\/0.18.0\r\n\r\n# Additionally, you may want to load the following tools manually, if you want CoverM to use them:\r\nmodule load apps\/binapps\/skani\/0.3.2\r\nmodule load apps\/binapps\/rammap\/1.1.1\r\n<\/pre>\n<h2>Running the application<\/h2>\n<p>Please do not run CoverM on the login node. Jobs should be submitted to the compute nodes via batch.<\/p>\n<h3>Serial batch job submission<\/h3>\n<p>Ensure that your input files are in the directory from which you wish to run your job.<\/p>\n<p>Create a batch submission script (which will load the modulefile in the jobscript) in the same directory, for example:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#SBATCH -p serial        # Partition - run on the nodes dedicated to serial jobs\r\n#SBATCH -n 1             # Number of cores (optional for serial - it's always 1)\r\n#SBATCH -t 4-0           # Job wallclock. Max permitted is 7-0 (7 days, 0 hours)\r\n\r\nmodule purge\r\n\r\n# If using your own conda env install:\r\nmodule load apps\/binapps\/conda\/miniforge3\/25.9.1\r\nconda activate coverm\r\n\r\n# Or, if using the central install (not recommended)\r\nmodule load apps\/binapps\/coverm\/0.8.0\r\n\r\ncoverm genome &LT;GENOME_DESCRIPTION&GT; &LT;MAPPING_INPUT&GT; ..\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>sbatch <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<h3>Parallel batch job submission<\/h3>\n<p>Ensure that your input files are in the directory from which you wish to run your job.<\/p>\n<p>Create a batch submission script (which will load the modulefile in the jobscript) in the same directory, for example:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#SBATCH -p multicore     # Partition - run on the AMD 168-core nodes dedicated to parallel jobs\r\n#SBATCH -n 8             # Number of cores (can be 2--168)\r\n#SBATCH -t 4-0           # Job wallclock. Max permitted is 7-0 (7 days, 0 hours)\r\n\r\nmodule purge\r\n\r\n# If using your own conda env install:\r\nmodule load apps\/binapps\/conda\/miniforge3\/25.9.1\r\nconda activate coverm\r\n\r\n# Or, if using the central install (not recommended)\r\nmodule load apps\/binapps\/coverm\/0.8.0\r\n\r\n# $SLURM_NTASKS is set to the number specified on the -n line above\r\ncoverm genome -t $SLURM_NTASKS &LT;GENOME_DESCRIPTION&GT; &LT;MAPPING_INPUT&GT; ..\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>sbatch <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<h3>Interactive use<\/h3>\n<p>The following is an example of running CoverM interactively at the command-line, on a compute node. It is NOT permitted to run CoverM processing on the login nodes. You MUST use an interactive job.<\/p>\n<p>You should first do the <a href=\"#condaenv\">Conda Environment Install<\/a> of CoverM (see above).<\/p>\n<p>The following commands are taken from the <a href=\"https:\/\/github.com\/wwood\/CoverM#demo\">CoverM Demo<\/a> on their github site.<\/p>\n<pre>\r\n# On the login node, start with a clean env, then start a (0 days) 1 hour interactive job\r\n# using 8 cores of the AMD 168-core node:\r\nmodule purge\r\nsrun -p interactive -n 8 -t 0-1 --pty bash\r\n\r\n# You will now be on a compute node with 8 cores assigned to your job.\r\n# Activate your coverm conda environment\r\nmodule load apps\/binapps\/conda\/miniforge3\/25.9.1\r\nconda activate coverm\r\n\r\n# Node go to scratch and download the demo data\r\nmkdir ~\/scratch\/coverm_demo \r\ncd ~\/scratch\/coverm_demo\r\n\r\n# Download files\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/sample_1.1.fq.gz\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/sample_1.2.fq.gz\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_1.fna\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_2.fna\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_3.fna\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_4.fna\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_5.fna\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_6.fna\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_7.fna\r\nwget https:\/\/raw.githubusercontent.com\/wwood\/CoverM\/refs\/heads\/main\/demo\/genome_8.fna\r\n\r\n# Next, we can actually run CoverM. We use --coupled to specify the paired-end reads,\r\n# and --genome-fasta-files to specify the genomes. We also specify the number of threads\r\n# to use with -t, and the metrics we want to calculate with -m. We will calculate the mean\r\n# coverage, relative abundance, and covered fraction for each genome in the sample.\r\n# The output will be written to output_coverm.tsv.\r\n\r\ncoverm genome \\\r\n  --coupled sample_1.1.fq.gz sample_1.2.fq.gz \\\r\n  --genome-fasta-files \\\r\n    genome_1.fna genome_2.fna genome_3.fna genome_4.fna \\\r\n    genome_5.fna genome_6.fna genome_7.fna genome_8.fna \\\r\n  -t $SLURM_NTASKS \\\r\n  -m mean relative_abundance covered_fraction \\\r\n  -o output_coverm.tsv\r\n\r\n# Check the results - see https:\/\/github.com\/wwood\/CoverM#demo\r\ncat output_coverm.tsv\r\n\r\n# Terminate your interactive job, returning to the login node\r\nexit\r\n<\/pre>\n<h2>Further info<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/wwood\/CoverM\">CoverM website<\/a><\/li>\n<\/ul>\n<h2>Updates<\/h2>\n<p>None.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview CoverM aims to be a configurable, easy to use and fast DNA read coverage and relative abundance calculator focused on metagenomics applications. CoverM calculates coverage of genomes\/MAGs coverm genome or individual contigs coverm contig. Calculating coverage by read mapping, its input can either be BAM files sorted by reference, or raw reads and reference genomes in various formats. Version 0.7.0 and 0.8.0 is installed on the CSF. However, we recommend installing your own local.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/coverm\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"parent":86,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-7756","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/7756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=7756"}],"version-history":[{"count":20,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/7756\/revisions"}],"predecessor-version":[{"id":12516,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/7756\/revisions\/12516"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/86"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=7756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}