diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bd89fcea99e526eff6eb5caad71c1c3e070b0e2c..289d3a9b022fe7a50992857dac13b27dba14289d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,21 +1,48 @@
-# recipe for building singularity image and deploy it on the registery for bwa version 0.7.17
 image:
-   name: quay.io/singularity/singularity:v3.4.0
+   name: quay.io/singularity/singularity:v3.10.0
    entrypoint: [""]
 
 stages:
  - build
- 
+
 singularity-image-metag:
+   variables:
+      IMAGE_LABEL: "$CI_COMMIT_TAG"
+   rules:
+      - if: "$CI_COMMIT_TAG == null"
+        variables:                              # Override IMAGE_LABEL defined
+            IMAGE_LABEL: "${CI_COMMIT_BRANCH}_${CI_COMMIT_SHORT_SHA}"  # at the job level.
+        when: manual
+      - if: "$CI_COMMIT_TAG != null"
+        variables:                              # Override IMAGE_LABEL defined
+            IMAGE_LABEL: "$CI_COMMIT_TAG"  # at the job level.
+        when: always
+
    stage: build
    script:
-       - singularity build metagWGS.sif env/Singularity_recipe_metagWGS
-       - singularity push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" metagWGS.sif oras://"$CI_REGISTRY_IMAGE"/"$CI_PROJECT_NAME"_"$CI_COMMIT_BRANCH":"$CI_COMMIT_TAG"
+      - df -h
+      - echo IMAGE LABEL  $IMAGE_LABEL
+      - singularity build metagWGS.sif env/Singularity_recipe_metagWGS
+      - singularity push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" metagWGS.sif oras://"$CI_REGISTRY_IMAGE"/"$CI_PROJECT_NAME":"$IMAGE_LABEL"
    when: manual
 
 singularity-image-binning:
+   variables:
+      IMAGE_LABEL: "$CI_COMMIT_TAG" 
+   rules:
+      - if: "$CI_COMMIT_TAG == null" # when the pipeline is not launch from a tag this variable is null
+        variables:                              # Override IMAGE_LABEL defined
+            IMAGE_LABEL: "${CI_COMMIT_BRANCH}_${CI_COMMIT_SHORT_SHA}"  # at the job level.
+        when: manual
+      - if: "$CI_COMMIT_TAG != null"
+        variables:                              # Override IMAGE_LABEL defined
+            IMAGE_LABEL: "$CI_COMMIT_TAG"  # at the job level.
+        when: always
+
    stage: build
    script:
+       - df -h
+       - echo IMAGE LABEL  $IMAGE_LABEL
        - singularity build binning.sif env/Singularity_recipe_binning
-       - singularity push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" binning.sif oras://"$CI_REGISTRY_IMAGE"/binning_"$CI_COMMIT_BRANCH":"$CI_COMMIT_TAG"
-   when: manual
+       - singularity push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" binning.sif oras://"$CI_REGISTRY_IMAGE"/binning:"$IMAGE_LABEL"
+   
\ No newline at end of file
diff --git a/README.md b/README.md
index b69d6ebdac74c8d61b0043d4487f791a21959bca..184ad9e6890d8f3f530830971a770dedc98722dc 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@ Many of these steps are optional and their necessity depends on the desired anal
 ![](docs/08_binning.png)
    * aligns reads samples against assemblies (according to the strategy used) ([BWA-MEM2](https://github.com/bwa-mem2/bwa-mem2) or [Minimap2](https://github.com/lh3/minimap2))
    * performs metagenome binning ([METABAT2](https://bitbucket.org/berkeleylab/metabat/src/master/) + [MAXBIN2](https://sourceforge.net/projects/maxbin/) + [CONCOCT](https://github.com/BinPro/CONCOCT))
-    * refines bin sets ([BINETTE](https://github.com/genotoul-bioinfo/Binette))
+    * refines bin sets ([BINETTE](https://github.com/genotoul-bioinfo/Binette)). Circular contigs are used as bin set if you have some (in case of HiFi reads)
    * dereplicates bins between samples ([DREP](https://github.com/MrOlm/drep))
    * taxonomically affiliates the bins ([GTDBTK](https://github.com/Ecogenomics/GTDBTk))
    * calculates bins abundances between samples ([BWA-MEM2](https://github.com/bwa-mem2/bwa-mem2) or [Minimap2](https://github.com/lh3/minimap2) + [SAMTOOLS](http://www.htslib.org/))
diff --git a/bin/add_info_to_bin_stat.py b/bin/add_info_to_bin_stat.py
index 5389c9dd74465b075ce6d772aec61be433e91b29..4603b18964cd244ccbb75d1e249bcdb947e23e01 100755
--- a/bin/add_info_to_bin_stat.py
+++ b/bin/add_info_to_bin_stat.py
@@ -1,11 +1,11 @@
 #!/usr/bin/env python3
 
 """----------------------------------------------------------------------------
-  Script Name: add_info_to_metawrap_stat.py
+  Script Name: add_info_to_bin_stat.py
   Description: Class bins by quality (High, Medium, Low Quality bins and High Contamination bins) 
                based on contamination and completeness. Parse the total size of the assembly to add
                the size of contigs that have not been binned.  
-  Input files: metawrap stat file and quast report
+  Input files: bin stat file and quast report
   Created By:  Jean Mainguy
   Date:        2021-08-02
 -------------------------------------------------------------------------------
diff --git a/bin/db_versions.py b/bin/db_versions.py
index bf762bc27b2542167d6f06c9fe51e283420238e8..878cb1955e29cca754404af2ed6928bdcdc69cff 100755
--- a/bin/db_versions.py
+++ b/bin/db_versions.py
@@ -49,6 +49,7 @@ def main():
 	with open(args.all_db,"r") as list_db:
 		lines = list_db.readlines()
 		for line in lines:
+			print(line)
 			list_info=info_db(line.strip())
 			print(*list_info,sep="\t")
 
diff --git a/bin/filter_diamond_hits.py b/bin/filter_diamond_hits.py
index a29e514e7c48c007041ebe1d3ec2c4f2405593bb..ac569ac08d51950bfbcdcf20bdf7ea799649d12b 100755
--- a/bin/filter_diamond_hits.py
+++ b/bin/filter_diamond_hits.py
@@ -67,7 +67,7 @@ def get_all_hits_per_query(blast_result_file):
 
 def is_identity_and_coverage_ok(hit, min_identity, min_coverage):
 
-    qcovhsp = (int(hit["qend"]) - int(hit["qstart"]) + 1) / int(hit['qlen'])
+    qcovhsp = (int(hit["qend"]) - int(hit["qstart"]) + 1) / int(hit['qlen']) * 100
     return float(hit['pident']) >= min_identity and qcovhsp >= min_coverage
 
 
diff --git a/bin/scrape_software_versions.py b/bin/scrape_software_versions.py
index 199170ababfd48ce4becb64c5ea062d2839033aa..74ba848ab0f0f7a084e20ae8c42b5ed203bd4860 100755
--- a/bin/scrape_software_versions.py
+++ b/bin/scrape_software_versions.py
@@ -21,13 +21,13 @@ regexes = {
     'Megahit': ['v_megahit.txt', r"MEGAHIT v(\S+)"],
     'SPAdes': ['v_spades.txt', r"SPAdes genome assembler v(\S+)"],
     'Hifiasm': ['v_hifiasm_meta.txt', r"ha base version: (\S+)"],
-    'MetaFlye': ['v_metaflye.txt', r"v(\S+)"],
+    'MetaFlye': ['v_metaflye.txt', r"(\S+)"],
     'Quast': ['v_quast.txt', r"QUAST v(\S+)"],
     'Kaiju': ['v_kaiju.txt', r"Kaiju (\S+)"],
     'Samtools': ['v_samtools.txt', r"samtools (\S+)"],
     'Eggnog-Mapper': ['v_eggnogmapper.txt', r"emapper-(\S+)"],
     'Concoct': ['v_concoct.txt', r"concoct (\S+)"],
-    'Maxbin': ['v_maxbin.txt', r"MaxBin  (\S+)"],
+    'Maxbin': ['v_maxbin.txt', r"MaxBin (\S+)"],
     'Metabat2': ['v_metabat2.txt', r"version (\S+)"],
     'CheckM2': ['v_checkm2.txt', r"(\S+)"],
     'Binette': ['v_binette.txt', r"(\S+)"],
diff --git a/conf/base.config b/conf/base.config
index 8bac4a7e48b86e727fbd065c3a54695af7e9351e..d4555769b909a175079dc7d00067e15b63b31eea 100644
--- a/conf/base.config
+++ b/conf/base.config
@@ -13,7 +13,7 @@ process {
     memory = { 20.GB * task.attempt }
 
     errorStrategy = { task.exitStatus in [143,137,104,134,139] ? 'retry' : 'finish' }
-    maxRetries = 1
+    maxRetries = 3
     maxErrors = '-1'
     
     withName: CUTADAPT {
@@ -44,15 +44,15 @@ process {
         cpus = 25
     }
     withLabel: ASSEMBLY_SR {
-        memory = { 440.GB * task.attempt }
-        cpus = 20
+        memory = { 110.GB * task.attempt }
+        cpus = 10
     }
     withLabel: QUAST {
         cpus = 4
         memory = { 32.GB * task.attempt }
     }
     withName: READS_DEDUPLICATION {
-        memory = { 32.GB * task.attempt }
+        memory = { 128.GB * task.attempt }
     }
     withLabel: ASSEMBLY_FILTER {
         memory = { 2.GB * task.attempt }
@@ -101,8 +101,8 @@ process {
         cpus = 20
     }
     withName: BINETTE {
-        memory = { 20.GB * task.attempt }
-        cpus = 20
+        memory = { 128.GB * task.attempt }
+        cpus = 10
     }
     withName: GTDBTK {
         memory = { 64.GB * task.attempt }
diff --git a/conf/functional_test.config b/conf/functional_test.config
index fd02222d91af56aa981474a292287b6ec94c8938..8c0579f62dceda73f14dc2ab6c8c3b0126432017 100644
--- a/conf/functional_test.config
+++ b/conf/functional_test.config
@@ -5,9 +5,9 @@ singularity.enabled = true
 singularity.autoMounts = true
 
 process {
-    container = "/work/project/plateforme/metaG/functional_test/singularity_img/v2.4/metagwgs.sif"
+    container = "/PATH_TO_SINGULARITY_IMAGE_YOU_WANT_TO_TEST/metagwgs.sif"
     withLabel: BINNING {
-        container = "/work/project/plateforme/metaG/functional_test/singularity_img/v2.4/binning.sif"
+        container = "/PATH_TO_SINGULARITY_IMAGE_YOU_WANT_TO_TEST/binning.sif"
     }
 } 
 
@@ -22,6 +22,7 @@ params {
     taxdump = "/work/project/plateforme/metaG/functional_test/FT_banks/taxonomy_2021-12-7/new_taxdump"
     accession2taxid = "/work/project/plateforme/metaG/functional_test/FT_banks/taxonomy_2021-12-7/prot.accession2taxid.FULL"
     diamond_bank = "/work/project/plateforme/metaG/functional_test/FT_banks/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd"
+    checkm2_bank = "/work/project/plateforme/metaG/functional_test/FT_banks/checkm2DB/CheckM2_database/uniref100.KO.1.dmnd"
     host_index = "/work/project/plateforme/metaG/functional_test/metagwgs-test-datasets/small/input/host/Homo_sapiens.GRCh38_chr21.fa.{0123,amb,ann,bwt.2bit.64,pac,sa}"
     host_fasta = "/work/project/plateforme/metaG/functional_test/metagwgs-test-datasets/small/input/host/Homo_sapiens.GRCh38_chr21.fa"
     input = "/work/project/plateforme/metaG/functional_test/metagwgs-test-datasets/small/input/samplesheet.csv"
diff --git a/docs/08_binning.png b/docs/08_binning.png
index e5b2addb722833a9a6ea9c54b2c28c6049f51abe..a6d6eee75ad40edd42c8f167964d123fad8d2db7 100644
Binary files a/docs/08_binning.png and b/docs/08_binning.png differ
diff --git a/docs/binning.svg b/docs/binning.svg
index 0681d7aafd5339de184859f5c96109af31a4f8e8..c4c147e65914577c3271795eab53e068ca7a818b 100644
--- a/docs/binning.svg
+++ b/docs/binning.svg
@@ -1,12 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    version="1.1"
    viewBox="0 0 1200 408"
    fill="none"
@@ -15,9 +8,16 @@
    stroke-miterlimit="10"
    id="svg673"
    sodipodi:docname="binning.svg"
-   inkscape:version="1.0.2-2 (e86c870879, 2021-01-15)"
+   inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
    width="12.5in"
-   height="4.25in">
+   height="4.25in"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:dc="http://purl.org/dc/elements/1.1/">
   <metadata
      id="metadata679">
     <rdf:RDF>
@@ -26,7 +26,6 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -342,30 +341,36 @@
      guidetolerance="10"
      inkscape:pageopacity="0"
      inkscape:pageshadow="2"
-     inkscape:window-width="2400"
-     inkscape:window-height="1271"
+     inkscape:window-width="1920"
+     inkscape:window-height="1017"
      id="namedview675"
      showgrid="false"
-     inkscape:zoom="2.1380642"
-     inkscape:cx="981.23637"
-     inkscape:cy="188.67634"
-     inkscape:window-x="-9"
-     inkscape:window-y="113"
+     inkscape:zoom="4.2732911"
+     inkscape:cx="794.58664"
+     inkscape:cy="135.96078"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
      inkscape:window-maximized="1"
      inkscape:current-layer="g671"
      inkscape:document-rotation="0"
      showguides="false"
      inkscape:guide-bbox="true"
      units="in"
-     width="11.5in">
+     width="11.5in"
+     inkscape:showpageshadow="2"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:document-units="in">
     <sodipodi:guide
        position="-752.72531,-34.395187"
        orientation="1,0"
-       id="guide2966" />
+       id="guide2966"
+       inkscape:locked="false" />
     <sodipodi:guide
        position="11.906024,26.457825"
        orientation="1,0"
-       id="guide2968" />
+       id="guide2968"
+       inkscape:locked="false" />
   </sodipodi:namedview>
   <clipPath
      id="gf4aee02f90_0_20.0">
@@ -403,7 +408,7 @@
     <text
        xml:space="preserve"
        id="text1591"
-       style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1593);fill:#000000;fill-opacity:1;stroke:none;" />
+       style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1593);fill:#000000;fill-opacity:1;stroke:none" />
     <text
        xml:space="preserve"
        style="font-style:normal;font-weight:normal;font-size:9.33333px;line-height:1.25;font-family:sans-serif;fill:#ffffff;fill-opacity:1;stroke:none"
@@ -579,6 +584,22 @@
          x="715.27673"
          y="91.422989"
          style="font-size:8px;fill:#00739e;fill-opacity:0.957198">MetaBAT2</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-style:normal;font-weight:normal;font-size:8px;line-height:1.25;font-family:sans-serif;fill:#00739e;fill-opacity:0.957198;stroke:none"
+       x="783.44861"
+       y="105.34122"
+       id="text1590-8"><tspan
+         sodipodi:role="line"
+         id="tspan1588-9"
+         x="783.44861"
+         y="105.34122"
+         style="font-size:8px;fill:#00739e;fill-opacity:0.957198">Circular</tspan><tspan
+         sodipodi:role="line"
+         x="783.44861"
+         y="115.34122"
+         style="font-size:8px;fill:#00739e;fill-opacity:0.957198"
+         id="tspan2462">Contigs (HiFi)</tspan></text>
     <text
        xml:space="preserve"
        style="font-style:normal;font-weight:normal;font-size:8px;line-height:1.25;font-family:sans-serif;fill:#00739e;fill-opacity:0.957198;stroke:none"
@@ -697,6 +718,27 @@
        d="m 769.66542,133.94465 c 0,5.5813 0.012,8.37093 0.025,11.16251 v 1.12453"
        fill-rule="evenodd"
        id="path637-4-0" />
+    <path
+       fill="#70ad47"
+       stroke="#70ad47"
+       stroke-width="0.916232"
+       stroke-linecap="butt"
+       d="m 775.12794,114.5966 -2.87166,0.22377 1.14004,-2.15295 z"
+       fill-rule="evenodd"
+       id="path525-3-2-7"
+       style="fill:#009999;fill-opacity:1;stroke:#009999;stroke-opacity:1"
+       inkscape:transform-center-x="-5.7365419"
+       inkscape:transform-center-y="2.3054169" />
+    <path
+       stroke="#009999"
+       stroke-width="0.886692"
+       stroke-miterlimit="800"
+       stroke-linecap="butt"
+       d="m 783.41636,104.0422 c -4.21466,4.26713 -6.31599,6.40955 -8.41841,8.55425 l -0.84916,0.85976"
+       fill-rule="evenodd"
+       id="path637-4-0-1"
+       inkscape:transform-center-x="-3.5390258"
+       inkscape:transform-center-y="17.840114" />
     <text
        xml:space="preserve"
        style="font-style:normal;font-weight:normal;font-size:8px;line-height:1.25;font-family:sans-serif;fill:#00739e;fill-opacity:0.957198;stroke:none"
diff --git a/docs/installation.md b/docs/installation.md
index f942fce33bdca81a8aa07c4d0616658d3c2a2611..4bca7738542a4dfa16abc8a5f8a2d16fd88a10bb 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -16,6 +16,7 @@ For any issue during Nextflow installation and use, you can see [this tutorial](
 
 You only need to know Nextflow version installed on genologin.
 * Run `search_module Nextflow` to find Nextflow available versions.
+* See corresponding help in more /usr/local/bioinfo/src/Nextflow/How_to_use_SLURM_Nextflow
 * Keep in mind the last version of Nextflow installed (>=v20).
 
    **WARNING:** you must use Nextflow versions available [here](http://bioinfo.genotoul.fr/index.php/how-to-use/?software=How_to_use_SLURM_Nextflow). Don't use `bioinfo/nfcore-Nextflow` versions of Nextflow.
diff --git a/docs/usage.md b/docs/usage.md
index 41cb6010fa60ba70a5581a1168fd63bbb30a2d1f..99776b41672c711637c99d6760316cb7340d7474 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -342,7 +342,9 @@ For example check the version of software in the yaml file and the singularity r
 
 #### **`S08_binning` step:**
 
-* `--gtdbtk_bank`: indicates path to the GTDBTK database. 
+* `--gtdbtk_bank`: indicates path to the GTDBTK database (See : https://ecogenomics.github.io/GTDBTk/installing/index.html). 
+
+* `--checkm2_bank`: indicates path to the checkm2 database (`PATH/uniref100.KO.1.dmnd`). To download it, launch `singularity exec -B YOUR_ACTUAL_PATH -B /work/bank/ -B /bank -B /work2 -B /work -B /save -B /home -B /work/project -B /usr/local/bioinfo PATH_TO/binning.sif checkm2 database --download --path YOUR_ACTUAL_PATH/checkm2DB`. Adapt -B parameter to your infrastructure if you are not in genologin. This command will return 2 non-blocking errors, don't worry about them.
 
 * `--metabat2_seed`: Set the seed for metabat2, for exact reproducibility of metabat2 (default: 0 (random seed))
 
@@ -367,7 +369,7 @@ For example check the version of software in the yaml file and the singularity r
 #### Check your configuration and parameters
 Because it has many levels of configuration we advise you to check your configuration using the following command: 
 For example:
-```module load bioinfo/nfcore-Nextflow-v21.10.6; module load system/singularity-3.7.3; nextflow config -profile genotoul ~/work/metagWGSNewVersion/metagwgs/main.nf```
+```module load bioinfo/Nextflow-v21.04.1; module load system/singularity-3.7.3; nextflow config -profile genotoul path_to/metagwgs/main.nf```
 will output all the configuration that will be used by the workflow
 
 ## V. Description of output files
diff --git a/env/Singularity_recipe_binning b/env/Singularity_recipe_binning
index 91b90c6c9378248654fb459d7866b1501572a716..ed343865ba0e88fdd80828345b09524db87610af 100644
--- a/env/Singularity_recipe_binning
+++ b/env/Singularity_recipe_binning
@@ -8,23 +8,22 @@ env/binning.yml /
 %post
 # build-essential g++ are needed to pip install checkm2
 apt-get update && apt-get install -y procps build-essential g++ && apt-get clean -y
-/opt/conda/bin/mamba env create -f /binning.yml  && /opt/conda/bin/conda clean -a
+/opt/conda/bin/mamba env create -q -f /binning.yml  && /opt/conda/bin/conda clean -a
 
 export PATH=/opt/conda/envs/binning/bin:$PATH
 
-git clone --recursive https://github.com/chklovski/checkm2.git
+# install Binette
+wget  https://github.com/genotoul-bioinfo/Binette/archive/refs/tags/v0.1.5.tar.gz 
+tar -xf v0.1.5.tar.gz 
+rm v0.1.5.tar.gz
 
-pip install checkm2/
-export PATH=/opt/conda/envs/binning/bin/:/checkm2/bin/:$PATH
-
-checkm2 database --download --path '.' || echo checkm2 database failed but it is probably ok
-
-git clone https://github.com/genotoul-bioinfo/Binette.git
-pip install Binette/
+pip install Binette-0.1.5/
 
 %environment
 export PATH=/opt/conda/envs/binning/bin/:/checkm2/bin/:$PATH
 
 %runscript
      "$@"
- 
\ No newline at end of file
+ 
+
+ 
diff --git a/env/binning.yml b/env/binning.yml
index 7577e2b354072b67c23a2be37bbb6bcff8ba366d..77d3f73423e6e3cc1c14a65f5d97b37535f0c762 100644
--- a/env/binning.yml
+++ b/env/binning.yml
@@ -7,7 +7,7 @@ dependencies:
   - python>=3.6
   - scikit-learn=0.23.2
   - h5py=2.10.0
-  - numpy>=1.16.4
+  - numpy=1.23.5
   - diamond>=2.0.4
   - tensorflow >= 2.3.0
   - lightgbm >= 3.2.1
diff --git a/functional_tests/README.md b/functional_tests/README.md
index 8e2fa42ba266bd87077333b26d7beee7055e94df..a687d32ec95b2ab87be64a9194a2696af3620b0a 100644
--- a/functional_tests/README.md
+++ b/functional_tests/README.md
@@ -54,6 +54,9 @@ This archive contains data banks for:
     - **Diamond** (_refseq_bacteria_2021-05-20_)
     - **NCBI Taxonomy** (_taxonomy_2021-12-7_ )
     - **Eggnog Mapper** (_eggnog-mapper-2.1.9_)
+    - **gtdb** (release207_v2)
+    - **Homo_sapiens.GRCh38_chr21** for host genome
+    - **uniref100.KO.1.dmnd** for checkm2
 
 
 4. Set enviroment variables and adapt configuration file
diff --git a/functional_tests/functions.py b/functional_tests/functions.py
index 25e764409baa560f1e7524a90f398558ba4008d6..5743491e0300e564a8da046269eae319c9c921e7 100644
--- a/functional_tests/functions.py
+++ b/functional_tests/functions.py
@@ -264,7 +264,7 @@ def test_file(exp_path, obs_path, method):
             command = 'diff <(sort {}) <(sort {})'.format(exp_path, obs_path)
 
         elif method == 'no_header_diff':
-            command = 'diff <(grep -w "^?#" {}) <(grep -w "^?#" {})'.format(exp_path, obs_path)
+            command = 'diff <(grep -v "^#" {}) <(grep -v "^#" {})'.format(exp_path, obs_path)
 
         elif method == 'zdiff':
             command = 'zdiff {} {}'.format(exp_path, obs_path)
@@ -302,4 +302,4 @@ def test_file(exp_path, obs_path, method):
             out = 'Test result:    Failed\n'
             false_cnt += 1
 
-        return test, out
\ No newline at end of file
+        return test, out
diff --git a/main.nf b/main.nf
index d2c04565dcec09a54339e20595d35fa01adb7d8f..1be4a39f2dd8cb1e0dd345cc2ddb5f717d1ad441 100644
--- a/main.nf
+++ b/main.nf
@@ -92,8 +92,9 @@ include { MULTIQC } from './modules/multiqc'
        --taxdump                     Path or FTP adress of file taxdump.tar.gz. Default: "ftp://ftp.ncbi.nih.gov/pub/taxonomy/new_taxdump/new_taxdump.tar.gz".
 
      SO8_BINNING options:
-       --gtdbtk_bank                 Path to the GTDBTK database
        --skip_binning                Skip this step
+       --gtdbtk_bank                 Path to the GTDBTK database
+       --checkm2_bank                Path to the CheckM2 database
        --metabat2_seed               Set the seed for metabat2, for exact reproducibility of metabat2 (default: 0 (random seed))
        --binning_cross_alignment     Mapping strategy to compute co-abundances for binning: .
                                       'individual': Each sample is aligned against the assembly of the sample in question
@@ -208,8 +209,8 @@ workflow {
       exit 1, "You must specify --stop_at_structural_annot or specify a diamond bank with --diamond_bank"
   }
 
-  if ( !(params.stop_at_clean) && !(params.stop_at_assembly) && !(params.stop_at_filtering) && !(params.stop_at_structural_annot) && !(params.skip_binning ) &&!(params.gtdbtk_bank) ) {
-      exit 1, "You must specify --skip_binning or specify a GTDB-TK bank with --gtdbtk_bank"
+  if ( !(params.stop_at_clean) && !(params.stop_at_assembly) && !(params.stop_at_filtering) && !(params.stop_at_structural_annot) && !(params.skip_binning ) && !(params.gtdbtk_bank || params.checkm2_bank) ) {
+      exit 1, "You must specify --skip_binning or specify a GTDB-TK bank with --gtdbtk_bank and a checkm2 bank with --checkm2_bank"
   }
 
   if ( params.coassembly && params.binning_cross_alignment == 'group'){
@@ -290,7 +291,7 @@ workflow {
   ch_taxonomy = Channel.empty()
   ch_diamon_db = Channel.empty()
   ch_gtbdtk_db = Channel.empty()
-
+  ch_gtbdtk_db = Channel.empty()
 
   DATABASES ()
   ch_host_fasta = DATABASES.out.host_fasta
@@ -300,6 +301,7 @@ workflow {
   ch_taxonomy = DATABASES.out.taxonomy
   ch_diamon_db = DATABASES.out.diamond
   ch_gtbdtk_db = DATABASES.out.gtdbtk
+  ch_checkm2_db = DATABASES.out.checkm2
 
   ch_multiqc_config = Channel.empty()
 
@@ -449,7 +451,7 @@ workflow {
 
   if ( !params.stop_at_clean && !params.stop_at_assembly && !params.stop_at_filtering && !params.stop_at_structural_annot && !params.skip_binning ) {
 
-    S08_BINNING( ch_reads, ch_assembly, ch_bam, ch_gtbdtk_db, ch_quast, ch_circular)
+    S08_BINNING( ch_reads, ch_assembly, ch_bam, ch_gtbdtk_db, ch_checkm2_db, ch_quast, ch_circular)
     ch_bins_abundances_report = S08_BINNING.out.bins_abundances_report
     ch_bins_stats_report = S08_BINNING.out.bins_stats_report
 
diff --git a/modules/binning.nf b/modules/binning.nf
index 6d90b0fe12fd9faf701ebbb417fcd99ba0f1b842..cfb9018fa0fd97ecc663a609c0c5938656c9af24 100644
--- a/modules/binning.nf
+++ b/modules/binning.nf
@@ -111,7 +111,6 @@ process CONCOCT {
   """
 }
 
-
 process BINETTE {
   errorStrategy { task.exitStatus == 255 ? 'ignore' : 'finish' }
   tag "${meta.id}"
@@ -122,6 +121,7 @@ process BINETTE {
     tuple val(meta), val(bins), path(contigs)
     val min_completeness
     val max_contamination
+    val(checkm2_db)
       
   output:
     tuple val(meta), path("bin_refinement/final_bins/*"), emit: bins, optional: true
@@ -130,7 +130,7 @@ process BINETTE {
 
 	script:
   """
-    binette -v -m ${min_completeness} -t ${task.cpus} -d ${bins.join(' ')} -c ${contigs} -o bin_refinement/
+    binette -v -m ${min_completeness} -t ${task.cpus} -d ${bins.join(' ')} -c ${contigs} -o bin_refinement/ --checkm2_db $checkm2_db
 
     sed -i 's/size/Size/' bin_refinement/final_bins_quality_reports.tsv 
     sed -i 's/^/${meta.id}_bin_/' bin_refinement/final_bins_quality_reports.tsv 
@@ -169,4 +169,4 @@ process UNBINNED_CONTIGS {
     -o unbinned_contigs.fasta
 
   """
-}
\ No newline at end of file
+}
diff --git a/modules/checkm2.nf b/modules/checkm2.nf
index 94fc69ce9bed16ca7cc530d94f62635babb76c20..8f257eda699c31a943a97ff0cf93457a742ef47f 100644
--- a/modules/checkm2.nf
+++ b/modules/checkm2.nf
@@ -3,6 +3,7 @@ process CHECKM2 {
   publishDir "${params.outdir}/08_binning/08_1_binning_per_sample/${meta.id}", mode: 'copy', pattern: "checkm2/*"
   input:
     tuple val(meta), val(bins)
+    val(checkm2_db)
       
   output:
     tuple val(meta.id), path("checkm2/*"), emit: checkm2
@@ -10,7 +11,7 @@ process CHECKM2 {
 
   script:
   """
-    checkm2 predict -x fa --threads ${task.cpus} --input ${bins.join(' ')} --output-directory checkm2/ 
+    checkm2 predict -x fa --threads ${task.cpus} --database_path ${checkm2_db} --input ${bins.join(' ')} --output-directory checkm2/ 
 
     echo "\$(checkm2 --version)_modified" > v_checkm2.txt
   """ 
diff --git a/modules/get_db_versions.nf b/modules/get_db_versions.nf
index 9805a290caa8834fd1bb442b5578f7baad7baef6..b64e41bd4d6e606b97773e55c30fbe2433ee15e5 100644
--- a/modules/get_db_versions.nf
+++ b/modules/get_db_versions.nf
@@ -10,6 +10,7 @@ process GET_DB_VERSIONS {
   path taxdump
   path diamond
   path gtdbtk
+  path checkm2
 
 
   output:
@@ -48,8 +49,10 @@ process GET_DB_VERSIONS {
     echo "GTDBTK ${gtdbtk}" > gtdbtk_db.txt
   fi
 
-  checkm2=\$(checkm2 database --current 2>&1 |  tail -n1 |awk '{ print \$5 }')
-  echo "Diamond_checkm2 \$checkm2" > checkm2_db.txt
+  if [[ "${checkm2}" != "" ]]
+  then   
+    echo "Checkm2 ${checkm2}" > checkm2_db.txt
+  fi
 
   if [[ `ls | grep db.txt` ]]
   then
@@ -64,4 +67,4 @@ process GET_DB_VERSIONS {
   db_versions.py -a all_db.txt >> db_versions.tsv
   """
 
-}
\ No newline at end of file
+}
diff --git a/nextflow.config b/nextflow.config
index 2d6f062848024deae9e2762a274831e7f87ea4f1..f733e4ecda006be424f1b8d44e015ef4fb9498c3 100644
--- a/nextflow.config
+++ b/nextflow.config
@@ -16,6 +16,7 @@ params {
     min_contigs_cpm = 1
     diamond_bank = ""
     gtdbtk_bank = ""
+    checkm2_bank = ""
     percentage_identity = 0.95
     type = ""
     coassembly = false
@@ -98,5 +99,5 @@ manifest {
     description = 'Analysis of metagenomics data'
     mainScript = 'main.nf'
     nextflowVersion = '>=20.01.0'
-    version = '2.4'
+    version = '2.4.1'
 }
diff --git a/subworkflows/00_databases.nf b/subworkflows/00_databases.nf
index dd2761ab2de50906f296ffe858c4c6f89ee5d7cb..9f1b8be4f6406612639b4984e015805b705456b4 100644
--- a/subworkflows/00_databases.nf
+++ b/subworkflows/00_databases.nf
@@ -89,9 +89,11 @@ workflow DATABASES {
         }
 
         ch_gtdbtk_db = Channel.empty()
+        ch_checkm2_db = Channel.empty()
 
         if ( !(params.stop_at_clean) && !(params.stop_at_assembly) && !(params.stop_at_filtering) && !(params.stop_at_structural_annot) && !(params.skip_binning) ) {
-            ch_gtdbtk_db = Channel.fromPath(params.gtdbtk_bank)    
+            ch_gtdbtk_db = Channel.fromPath(params.gtdbtk_bank).first()
+            ch_checkm2_db = Channel.fromPath(params.checkm2_bank).first()
         }
         
         GET_DB_VERSIONS(
@@ -102,6 +104,7 @@ workflow DATABASES {
             ch_taxdump.ifEmpty([]),
             ch_diamond.ifEmpty([]),
             ch_gtdbtk_db.ifEmpty([]),
+            ch_checkm2_db.ifEmpty([])
         )
         
     emit:
@@ -112,6 +115,7 @@ workflow DATABASES {
         taxonomy = ch_taxonomy.first()
         diamond = ch_diamond
         gtdbtk = ch_gtdbtk_db
+        checkm2 = ch_checkm2_db
 }
 
 process INDEX_HOST {
diff --git a/subworkflows/08_binning.nf b/subworkflows/08_binning.nf
index eceb6a09e9e370c3012c368627c18104c096f6f8..e9f61929fab0a582beed505bec1c005f7e11fedb 100644
--- a/subworkflows/08_binning.nf
+++ b/subworkflows/08_binning.nf
@@ -15,6 +15,7 @@ workflow STEP_08_BINNING {
   assembly
   bam
   gtdbtk_db
+  checkm2_db
   quast
   circular
 
@@ -148,7 +149,7 @@ workflow STEP_08_BINNING {
                                     single: bins.size() == 1
                                 }
 
-  CHECKM2(ch_bins_set.single)
+  CHECKM2(ch_bins_set.single, checkm2_db)
   ch_checkm2_v = CHECKM2.out.v_checkm2
 
 
@@ -168,7 +169,8 @@ workflow STEP_08_BINNING {
 
   ch_bins_assembly = ch_bins_set.multiple.join(ch_assembly)
 
-  BINETTE(ch_bins_assembly, params.min_completeness, params.max_contamination)
+  BINETTE(ch_bins_assembly, params.min_completeness, params.max_contamination, checkm2_db)
+  
   ch_binette_bins = BINETTE.out.bins
 
   ch_binette_stats = BINETTE.out.checkm_stats.join(ch_binette_bins)