diff --git a/.github/workflows/awsfulltest.yml b/.github/workflows/awsfulltest.yml
index 4d71d9a3f171658e4189107f2abc239f9f98bfa2..82c1a4ecd1bac8b5410b2825e230f9f3924594d3 100644
--- a/.github/workflows/awsfulltest.yml
+++ b/.github/workflows/awsfulltest.yml
@@ -28,6 +28,3 @@ jobs:
               "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/hic/results-${{ github.sha }}"
             }
           profiles: test_full,aws_tower
-          nextflow_config: |
-            process.errorStrategy = 'retry'
-            process.maxRetries = 3
diff --git a/.github/workflows/awstest.yml b/.github/workflows/awstest.yml
index f892cfd3f1d6deb2f2c57cd60269c51638c85dc6..5cd0714273dca87007b7c5ea50df27d05fe3606d 100644
--- a/.github/workflows/awstest.yml
+++ b/.github/workflows/awstest.yml
@@ -23,6 +23,3 @@ jobs:
               "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/hic/results-test-${{ github.sha }}"
             }
           profiles: test,aws_tower
-          nextflow_config: |
-            process.errorStrategy = 'retry'
-            process.maxRetries = 3
diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml
index 363667229e33a8fe022f697e4755d911234a12fb..b92e3d24195d72e7a4c39605fd29de3cf657bd06 100644
--- a/.github/workflows/branch.yml
+++ b/.github/workflows/branch.yml
@@ -13,7 +13,7 @@ jobs:
       - name: Check PRs
         if: github.repository == 'nf-core/hic'
         run: |
-          "{ [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/hic ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]"
+          { [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/hic ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]
 
       # If the above check failed, post a comment on the PR explaining the failure
       # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets
@@ -42,4 +42,3 @@ jobs:
             Thanks again for your contribution!
           repo-token: ${{ secrets.GITHUB_TOKEN }}
           allow-repeats: false
-#
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cc0fc52d25b4945b1bf0e460f3ce6527e5cad992..0dac5c2786f66f7e503085c858823a4833afb92a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -45,6 +45,3 @@ jobs:
       - name: Run pipeline with test data
         run: |
           nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
-
-#
-
diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml
new file mode 100644
index 0000000000000000000000000000000000000000..502eff95019714bf6b719046f0127d1e998f6b8a
--- /dev/null
+++ b/.github/workflows/fix-linting.yml
@@ -0,0 +1,55 @@
+name: Fix linting from a comment
+on:
+  issue_comment:
+    types: [created]
+
+jobs:
+  deploy:
+    # Only run if comment is on a PR with the main repo, and if it contains the magic keywords
+    if: >
+      contains(github.event.comment.html_url, '/pull/') &&
+      contains(github.event.comment.body, '@nf-core-bot fix linting') &&
+      github.repository == 'nf-core/hic'
+    runs-on: ubuntu-latest
+    steps:
+      # Use the @nf-core-bot token to check out so we can push later
+      - uses: actions/checkout@v3
+        with:
+          token: ${{ secrets.nf_core_bot_auth_token }}
+
+      # Action runs on the issue comment, so we don't get the PR by default
+      # Use the gh cli to check out the PR
+      - name: Checkout Pull Request
+        run: gh pr checkout ${{ github.event.issue.number }}
+        env:
+          GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}
+
+      - uses: actions/setup-node@v2
+
+      - name: Install Prettier
+        run: npm install -g prettier @prettier/plugin-php
+
+      # Check that we actually need to fix something
+      - name: Run 'prettier --check'
+        id: prettier_status
+        run: |
+          if prettier --check ${GITHUB_WORKSPACE}; then
+            echo "::set-output name=result::pass"
+          else
+            echo "::set-output name=result::fail"
+          fi
+
+      - name: Run 'prettier --write'
+        if: steps.prettier_status.outputs.result == 'fail'
+        run: prettier --write ${GITHUB_WORKSPACE}
+
+      - name: Commit & push changes
+        if: steps.prettier_status.outputs.result == 'fail'
+        run: |
+          git config user.email "core@nf-co.re"
+          git config user.name "nf-core-bot"
+          git config push.default upstream
+          git add .
+          git status
+          git commit -m "[automated] Fix linting with Prettier"
+          git push
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
index e9cf5de3ac6a3a8a41923568a170315053d7e2e0..77358dee77fafceacab736de94ae79f2258a523f 100644
--- a/.github/workflows/linting.yml
+++ b/.github/workflows/linting.yml
@@ -48,7 +48,7 @@ jobs:
           wget -qO- get.nextflow.io | bash
           sudo mv nextflow /usr/local/bin/
 
-      - uses: actions/setup-python@v1
+      - uses: actions/setup-python@v3
         with:
           python-version: "3.6"
           architecture: "x64"
@@ -78,5 +78,3 @@ jobs:
             lint_log.txt
             lint_results.md
             PR_number.txt
-
-#
diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml
index 91c487a1a5020bf2b0ff8d31a3c2b9d589e5fed8..04758f61e368b37a7651aff015e51a9c31162542 100644
--- a/.github/workflows/linting_comment.yml
+++ b/.github/workflows/linting_comment.yml
@@ -26,4 +26,3 @@ jobs:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           number: ${{ steps.pr_number.outputs.pr_number }}
           path: linting-logs/lint_results.md
-#
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000000000000000000000000000000000000..d0e7ae58916d32ec5fc706ae0eda9403db44f290
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,9 @@
+email_template.html
+.nextflow*
+work/
+data/
+results/
+.DS_Store
+testing/
+testing*
+*.pyc
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3478c9d43223d5a31da6b35c737006e0a691242e..b66d2bc633650b8e74a028f5e760a79c83627dff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,7 @@
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
-## v1.4.0
+## v1.4.0dev
 
 ### `Added`
 
diff --git a/README.md b/README.md
index 8e7f9b97c22fc4459536d5ed97acd5134277a666..48a23b070e337e18fd7ceb230d4aa802f7bdd4e5 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,19 @@
-# ![nf-core/hic](docs/images/nf-core/hic_logo_light.png#gh-light-mode-only) ![nf-core/hic](docs/images/nf-core/hic_logo_dark.png#gh-dark-mode-only)
+# ![nf-core/hic](docs/images/nf-core-hic_logo_light.png#gh-light-mode-only) ![nf-core/hic](docs/images/nf-core-hic_logo_dark.png#gh-dark-mode-only)
 
 [![GitHub Actions CI Status](https://github.com/nf-core/hic/workflows/nf-core%20CI/badge.svg)](https://github.com/nf-core/hic/actions?query=workflow%3A%22nf-core+CI%22)
 [![GitHub Actions Linting Status](https://github.com/nf-core/hic/workflows/nf-core%20linting/badge.svg)](https://github.com/nf-core/hic/actions?query=workflow%3A%22nf-core+linting%22)
-[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/hic/results)
-[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)
-[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg?labelColor=000000)](https://www.nextflow.io/)
-[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)
-[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)
-[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)
-
-[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23hic-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/hic)
-[![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?labelColor=000000&logo=twitter)](https://twitter.com/nf_core)
-[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)
+[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?logo=Amazon%20AWS)](https://nf-co.re/hic/results)
+[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8)](https://doi.org/10.5281/zenodo.XXXXXXX)
+
+[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/)
+[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?logo=anaconda)](https://docs.conda.io/en/latest/)
+[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?logo=docker)](https://www.docker.com/)
+[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg)](https://sylabs.io/docs/)
+[![Launch on Nextflow Tower](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Nextflow%20Tower-%234256e7)](https://tower.nf/launch?pipeline=https://github.com/nf-core/hic)
+
+[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23hic-4A154B?logo=slack)](https://nfcore.slack.com/channels/hic)
+[![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?logo=twitter)](https://twitter.com/nf_core)
+[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?logo=youtube)](https://www.youtube.com/c/nf-core)
 
 ## Introduction
 
diff --git a/assets/email_template.html b/assets/email_template.html
index 80d5dac884d9d5032c63f7be02e8bb7c788a51d7..d207f011f3ab74ac04ace7a4e277c59900cf058a 100644
--- a/assets/email_template.html
+++ b/assets/email_template.html
@@ -1,111 +1,53 @@
 <html>
-  <head>
-    <meta charset="utf-8" />
-    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
 
-    <!-- prettier-ignore -->
-    <meta name="description" content="nf-core/hic: Analysis of Chromosome Conformation Capture data (Hi-C)" />
-    <title>nf-core/hic Pipeline Report</title>
-  </head>
-  <body>
-    <div style="font-family: Helvetica, Arial, sans-serif; padding: 30px; max-width: 800px; margin: 0 auto">
-      <img src="cid:nfcorepipelinelogo" />
+  <meta name="description" content="nf-core/hic: Analysis of Chromosome Conformation Capture data (Hi-C)">
+  <title>nf-core/hic Pipeline Report</title>
+</head>
+<body>
+<div style="font-family: Helvetica, Arial, sans-serif; padding: 30px; max-width: 800px; margin: 0 auto;">
 
-      <h1>nf-core/hic v${version}</h1>
-      <h2>Run Name: $runName</h2>
+<img src="cid:nfcorepipelinelogo">
 
-      <% if (!success){ out << """
-      <div
-        style="
-          color: #a94442;
-          background-color: #f2dede;
-          border-color: #ebccd1;
-          padding: 15px;
-          margin-bottom: 20px;
-          border: 1px solid transparent;
-          border-radius: 4px;
-        "
-      >
-        <h4 style="margin-top: 0; color: inherit">nf-core/hic execution completed unsuccessfully!</h4>
+<h1>nf-core/hic v${version}</h1>
+<h2>Run Name: $runName</h2>
+
+<% if (!success){
+    out << """
+    <div style="color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
+        <h4 style="margin-top:0; color: inherit;">nf-core/hic execution completed unsuccessfully!</h4>
         <p>The exit status of the task that caused the workflow execution to fail was: <code>$exitStatus</code>.</p>
         <p>The full error message was:</p>
-        <pre style="white-space: pre-wrap; overflow: visible; margin-bottom: 0">${errorReport}</pre>
-      </div>
-      """ } else { out << """
-      <div
-        style="
-          color: #3c763d;
-          background-color: #dff0d8;
-          border-color: #d6e9c6;
-          padding: 15px;
-          margin-bottom: 20px;
-          border: 1px solid transparent;
-          border-radius: 4px;
-        "
-      >
+        <pre style="white-space: pre-wrap; overflow: visible; margin-bottom: 0;">${errorReport}</pre>
+    </div>
+    """
+} else {
+    out << """
+    <div style="color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
         nf-core/hic execution completed successfully!
-      </div>
-      """ } %>
+    </div>
+    """
+}
+%>
 
-      <p>The workflow was completed at <strong>$dateComplete</strong> (duration: <strong>$duration</strong>)</p>
-      <p>The command used to launch the workflow was as follows:</p>
-      <pre
-        style="
-          white-space: pre-wrap;
-          overflow: visible;
-          background-color: #ededed;
-          padding: 15px;
-          border-radius: 4px;
-          margin-bottom: 30px;
-        "
-      >
-$commandLine</pre
-      >
+<p>The workflow was completed at <strong>$dateComplete</strong> (duration: <strong>$duration</strong>)</p>
+<p>The command used to launch the workflow was as follows:</p>
+<pre style="white-space: pre-wrap; overflow: visible; background-color: #ededed; padding: 15px; border-radius: 4px; margin-bottom:30px;">$commandLine</pre>
 
-      <h3>Pipeline Configuration:</h3>
-      <table
-        style="
-          width: 100%;
-          max-width: 100%;
-          border-spacing: 0;
-          border-collapse: collapse;
-          border: 0;
-          margin-bottom: 30px;
-        "
-      >
-        <tbody style="border-bottom: 1px solid #ddd">
-          <% out << summary.collect{ k,v -> "
-          <tr>
-            <th
-              style="
-                text-align: left;
-                padding: 8px 0;
-                line-height: 1.42857143;
-                vertical-align: top;
-                border-top: 1px solid #ddd;
-              "
-            >
-              $k
-            </th>
-            <td
-              style="
-                text-align: left;
-                padding: 8px;
-                line-height: 1.42857143;
-                vertical-align: top;
-                border-top: 1px solid #ddd;
-              "
-            >
-              <pre style="white-space: pre-wrap; overflow: visible">$v</pre>
-            </td>
-          </tr>
-          " }.join("\n") %>
-        </tbody>
-      </table>
+<h3>Pipeline Configuration:</h3>
+<table style="width:100%; max-width:100%; border-spacing: 0; border-collapse: collapse; border:0; margin-bottom: 30px;">
+    <tbody style="border-bottom: 1px solid #ddd;">
+        <% out << summary.collect{ k,v -> "<tr><th style='text-align:left; padding: 8px 0; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'>$k</th><td style='text-align:left; padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'><pre style='white-space: pre-wrap; overflow: visible;'>$v</pre></td></tr>" }.join("\n") %>
+    </tbody>
+</table>
 
-      <p>nf-core/hic</p>
-      <p><a href="https://github.com/nf-core/hic">https://github.com/nf-core/hic</a></p>
-    </div>
-  </body>
+<p>nf-core/hic</p>
+<p><a href="https://github.com/nf-core/hic">https://github.com/nf-core/hic</a></p>
+
+</div>
+
+</body>
 </html>
diff --git a/bin/check_samplesheet.py b/bin/check_samplesheet.py
index 17137e53b338a6a6a3e591ab1c71a5879c045994..6be15bd25d60d6901b2ff4154033e6271d9f3869 100755
--- a/bin/check_samplesheet.py
+++ b/bin/check_samplesheet.py
@@ -97,7 +97,7 @@ class RowChecker:
         if row[self._first_col] and row[self._second_col]:
             row[self._single_col] = False
             assert (
-                Path(row[self._first_col]).suffixes == Path(row[self._second_col]).suffixes
+                Path(row[self._first_col]).suffixes[-2:] == Path(row[self._second_col]).suffixes[-2:]
             ), "FASTQ pairs must have the same file extensions."
         else:
             row[self._single_col] = True
@@ -128,6 +128,16 @@ class RowChecker:
                 #    row[self._sample_col] = f"{sample}_T{seen[sample]}"
 
 
+def read_head(handle, num_lines=10):
+    """Read the specified number of lines from the current position in the file."""
+    lines = []
+    for idx, line in enumerate(handle):
+        if idx == num_lines:
+            break
+        lines.append(line)
+    return "".join(lines)
+
+
 def sniff_format(handle):
     """
     Detect the tabular format.
@@ -143,13 +153,13 @@ def sniff_format(handle):
         https://docs.python.org/3/glossary.html#term-text-file
 
     """
-    peek = handle.read(2048)
+    peek = read_head(handle)
+    handle.seek(0)
     sniffer = csv.Sniffer()
     if not sniffer.has_header(peek):
         logger.critical(f"The given sample sheet does not appear to contain a header.")
         sys.exit(1)
     dialect = sniffer.sniff(peek)
-    handle.seek(0)
     return dialect
 
 
diff --git a/bin/hicpro_merge_validpairs.sh b/bin/hicpro_merge_validpairs.sh
index 09f97277aee9ee4e23199c2b996077db63e30464..e6c5200bb9e09fc9b21302c6e6aae56a5468276a 100755
--- a/bin/hicpro_merge_validpairs.sh
+++ b/bin/hicpro_merge_validpairs.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+set -e
 
 ##
 ## HiC-Pro
@@ -17,11 +18,36 @@ done
 shift $(( OPTIND - 1 ))
 
 vpairs="$@"
+vpairs_sorted=$(echo $vpairs | sed -e 's/validPairs/sorted.validPairs/g')
+
+mkdir -p ./tmp/
 
 if [[ ${rmDup} == 1 ]]; then
-    ## Sort valid pairs and remove read pairs with same starts (i.e duplicated read pairs)
-    sort -S 50% -k2,2V -k3,3n -k5,5V -k6,6n -m ${vpairs} | \
-        awk -F"\t" 'BEGIN{c1=0;c2=0;s1=0;s2=0}(c1!=$2 || c2!=$5 || s1!=$3 || s2!=$6){print;c1=$2;c2=$5;s1=$3;s2=$6}' > ${prefix}.allValidPairs
+    ## Sort individual validPairs files
+    fcounts=0
+    for vfile in ${vpairs}
+    do
+        echo "Sorting ${vfile} ..."
+        fcounts=$((fcounts+1))
+        ofile=$(echo ${vfile} | sed -e 's/validPairs/sorted.validPairs/')
+        #sort -k2,2V -k3,3n -k5,5V -k6,6n -T ./tmp/ -o ${ofile} ${vfile}
+        sort -k2,2 -k5,5 -k3,3n -k6,6n -T ./tmp/ -o ${ofile} ${vfile}
+    done
+
+    if [[ $fcounts -gt 1 ]]
+    then
+        echo "Merging and removing the duplicates ..."
+        ## Sort valid pairs and remove read pairs with same starts (i.e duplicated read pairs)
+        #sort -k2,2V -k3,3n -k5,5V -k6,6n -T ./tmp/ -m ${vpairs_sorted} | \
+        sort -k2,2 -k5,5 -k3,3n -k6,6n -T ./tmp/ -m ${vpairs_sorted} | \
+            awk -F"\t" 'BEGIN{c1=0;c2=0;s1=0;s2=0}(c1!=$2 || c2!=$5 || s1!=$3 || s2!=$6){print;c1=$2;c2=$5;s1=$3;s2=$6}' > ${prefix}.allValidPairs
+    else
+        echo "Removing the duplicates ..."
+        cat ${vpairs_sorted} | awk -F"\t" 'BEGIN{c1=0;c2=0;s1=0;s2=0}(c1!=$2 || c2!=$5 || s1!=$3 || s2!=$6){print;c1=$2;c2=$5;s1=$3;s2=$6}' > ${prefix}.allValidPairs
+    fi
+
+    ## clean
+    /bin/rm -rf ${vpairs_sorted}
 else
     cat ${vpairs} > ${prefix}.allValidPairs
 fi
@@ -33,3 +59,6 @@ cat ${prefix}.allValidPairs | wc -l >> ${prefix}_allValidPairs.mergestat
 
 ## Count short range (<20000) vs long range contacts
 awk 'BEGIN{cis=0;trans=0;sr=0;lr=0} $2 == $5{cis=cis+1; d=$6>$3?$6-$3:$3-$6; if (d<=20000){sr=sr+1}else{lr=lr+1}} $2!=$5{trans=trans+1}END{print "trans_interaction\t"trans"\ncis_interaction\t"cis"\ncis_shortRange\t"sr"\ncis_longRange\t"lr}' ${prefix}.allValidPairs >> ${prefix}_allValidPairs.mergestat
+
+## clean
+/bin/rm -rf ./tmp/
diff --git a/conf/base.config b/conf/base.config
index 96e174215898ee824c5a09641e864d2659e7ab40..e1895e3f5a6e7dfcc9b68b268225d7a8dd5376a7 100644
--- a/conf/base.config
+++ b/conf/base.config
@@ -43,7 +43,7 @@ process {
         time   = { check_max( 20.h  * task.attempt, 'time'    ) }
     }
     withLabel:process_high_memory {
-        memory = { check_max( 200.GB * task.attempt, 'memory' ) }
+        memory = { check_max( 24.GB * task.attempt, 'memory' ) }
     }
     withLabel:error_ignore {
         errorStrategy = 'ignore'
diff --git a/conf/modules.config b/conf/modules.config
index 06aaba2244691800445094279ee717851eafb94a..5b279c54cb9ec6fc7a5b127a9292a10316434e55 100644
--- a/conf/modules.config
+++ b/conf/modules.config
@@ -49,7 +49,7 @@ process {
             mode: 'copy',
             enabled: params.save_aligned_intermediates
         ]
-        ext.prefix = { params.split_fastq ? "${meta.chunk}_${meta.mates}" : "${meta.id}_${meta.mates}" }
+        ext.prefix = { "${meta.id}_${meta.chunk}_${meta.mates}" }
         ext.args = params.bwt2_opts_end2end ?: ''
         ext.args2 = !params.dnase ? "-F 4" :""
     }
@@ -68,7 +68,7 @@ process {
             mode: 'copy',
             enabled: params.save_aligned_intermediates
         ]
-        ext.prefix = { params.split_fastq ? "${meta.chunk}_${meta.mates}_trimmed" : "${meta.id}_${meta.mates}_trimmed" }
+        ext.prefix = { "${meta.id}_${meta.chunk}_${meta.mates}_trimmed" }
         ext.args = params.bwt2_opts_trimmed ?: ''
         ext.args2 = ""
     }
@@ -79,7 +79,7 @@ process {
             mode: 'copy',
             enabled: params.save_aligned_intermediates
         ]
-        ext.prefix = { params.split_fastq ? "${meta.chunk}_${meta.mates}" : "${meta.id}_${meta.mates}" }
+        ext.prefix = { "${meta.id}_${meta.chunk}_${meta.mates}" }
     }
 
     withName: 'COMBINE_MATES' {
@@ -93,7 +93,7 @@ process {
             params.keep_multi ? "--multi" : "",
             params.min_mapq ? "-q ${params.min_mapq}" : ""
         ].join(' ').trim()
-        ext.prefix = { params.split_fastq ? "${meta.chunk}" : "${meta.id}" }
+        ext.prefix = { "${meta.id}_${meta.chunk}" }
     }
 
     withName: 'GET_VALID_INTERACTION' {
diff --git a/modules/local/cooltools/eigs-cis.nf b/modules/local/cooltools/eigs-cis.nf
index a63dee2eb39ca6a7e37f06a6d09c39a4971a47e5..55d6d1697f80bdd893c95349b827861b05f5bf39 100644
--- a/modules/local/cooltools/eigs-cis.nf
+++ b/modules/local/cooltools/eigs-cis.nf
@@ -29,7 +29,7 @@ process CALL_COMPARTMENTS {
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        cooltools: \$(cooltools --version 2>&1 | sed 's/cooletools, version //')
+        cooltools: \$(cooltools --version 2>&1 | grep version | sed 's/cooltools, version //')
     END_VERSIONS
     """
 }
diff --git a/modules/local/hicpro/build_contact_maps.nf b/modules/local/hicpro/build_contact_maps.nf
index 1ba3550d274e6f9327a895cde99dc11a4ab0ab70..097ff59a8f51465b4867146a400211664d24067c 100644
--- a/modules/local/hicpro/build_contact_maps.nf
+++ b/modules/local/hicpro/build_contact_maps.nf
@@ -1,6 +1,6 @@
 process BUILD_CONTACT_MAPS{
   tag "$meta.id - $res"
-  label 'process_highmem'
+  label 'process_high_memory'
 
   conda (params.enable_conda ? "conda-forge::sed=4.7" : null)
   container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
diff --git a/modules/local/hicpro/dnase_mapping_stats.nf b/modules/local/hicpro/dnase_mapping_stats.nf
index edc40dc26329dee3334b66240a85e8803352032b..950529822dcb16df817185fcfd5e31bdd79df602 100644
--- a/modules/local/hicpro/dnase_mapping_stats.nf
+++ b/modules/local/hicpro/dnase_mapping_stats.nf
@@ -16,7 +16,7 @@ process MAPPING_STATS_DNASE {
     tuple val(meta), path("${prefix}.mapstat"), emit:stats
 
     script:
-    prefix = meta.id + "_" + meta.mates
+    prefix = meta.id + "_" + meta.chunk + "_" + meta.mates
     tag = meta.mates
     """
     echo "## ${prefix}" > ${prefix}.mapstat
diff --git a/modules/local/hicpro/hicpro2pairs.nf b/modules/local/hicpro/hicpro2pairs.nf
index 4ee35b0c1715ec35adb731738e3fb6f26e9976ab..aa475c23e150be45e0166ee21103750e5c0f66d6 100644
--- a/modules/local/hicpro/hicpro2pairs.nf
+++ b/modules/local/hicpro/hicpro2pairs.nf
@@ -19,13 +19,13 @@ process HICPRO2PAIRS {
     prefix = "${meta.id}"
     """
     ##columns: readID chr1 pos1 chr2 pos2 strand1 strand2
-    awk '{OFS="\t";print \$1,\$2,\$3,\$5,\$6,\$4,\$7}' $vpairs > ${prefix}_contacts.pairs
-    sort -k2,2 -k4,4 -k3,3n -k5,5n ${prefix}_contacts.pairs | bgzip -c > ${prefix}_contacts.pairs.gz
+    awk '{OFS="\t";print \$1,\$2,\$3,\$5,\$6,\$4,\$7}' $vpairs | bgzip -c > ${prefix}_contacts.pairs.gz
+    ##sort -k2,2 -k4,4 -k3,3n -k5,5n ${prefix}_contacts.pairs | bgzip -c > ${prefix}_contacts.pairs.gz
     pairix -f ${prefix}_contacts.pairs.gz
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        pairix: \$(echo \$(pairix 2>&1 | grep Version | sed -e 's/Version: //')
+        pairix: \$(echo \$(pairix 2>&1 | grep Version | sed -e 's/Version: //'))
     END_VERSIONS
     """
 }
diff --git a/modules/local/hicpro/merge_valid_interaction.nf b/modules/local/hicpro/merge_valid_interaction.nf
index 6da435621a1835e667f8111935c74cd8f6e0c008..c5b716d4493aad83d6339dffd85e287cfd317104 100644
--- a/modules/local/hicpro/merge_valid_interaction.nf
+++ b/modules/local/hicpro/merge_valid_interaction.nf
@@ -1,6 +1,6 @@
 process MERGE_VALID_INTERACTION {
     tag "$prefix"
-    label 'process_highmem'
+    label 'process_high_memory'
 
     conda (params.enable_conda ? "conda-forge::gawk=5.1.0" : null)
     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
diff --git a/modules/local/hicpro/run_ice.nf b/modules/local/hicpro/run_ice.nf
index e77b5c240934dac3f034939fba2f58c1303e7af2..996baf1e117dffa39ddc4a3c9769075771dab359 100644
--- a/modules/local/hicpro/run_ice.nf
+++ b/modules/local/hicpro/run_ice.nf
@@ -1,6 +1,6 @@
 process ICE_NORMALIZATION{
     tag "$rmaps"
-    label 'process_highmem'
+    label 'process_high_memory'
 
     conda (params.enable_conda ? "conda-forge::python=3.9  bioconda::iced=0.5.10 conda-forge::numpy=1.22.3" : null)
     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
diff --git a/nextflow.config b/nextflow.config
index 2a010be8d32879513280943f75f3a54a11555fd0..b003a2270e2297c98f77d5e204e06e3f06f0df69 100644
--- a/nextflow.config
+++ b/nextflow.config
@@ -233,7 +233,7 @@ trace {
 }
 dag {
     enabled = true
-    file    = "${params.tracedir}/pipeline_dag_${trace_timestamp}.svg"
+    file    = "${params.tracedir}/pipeline_dag_${trace_timestamp}.html"
 }
 
 manifest {
diff --git a/subworkflows/local/cooler.nf b/subworkflows/local/cooler.nf
index 8780b821d05b059f439cb17ea703a64ef581daf5..7ce15de2065780d12154f1b9fa31044f33948c91 100644
--- a/subworkflows/local/cooler.nf
+++ b/subworkflows/local/cooler.nf
@@ -63,8 +63,9 @@ workflow COOLER {
   if (!params.res_zoomify){
     ch_res_zoomify = cool_bins.min()
   }else{
-    ch_res_zoomify = params.res_zoomify
+    ch_res_zoomify = Channel.from(params.res_zoomify).splitCsv().flatten().unique().toInteger()
   }
+
   ch_cool
     .combine(ch_res_zoomify)
     .filter{ it[2] == it[3] }
diff --git a/workflows/hic.nf b/workflows/hic.nf
index 60e54a04d34dd5c7244db643a0faddfa33217544..a58b89c57a3b19399c95a22a93a82eb330cecf72 100644
--- a/workflows/hic.nf
+++ b/workflows/hic.nf
@@ -36,13 +36,20 @@ if (params.digestion){
 }
 
 //****************************************
-// Maps resolution for downstream analysis
+// Combine all maps resolution for downstream analysis
+
+ch_map_res = Channel.from( params.bin_size ).splitCsv().flatten().toInteger()
+
+if (params.res_zoomify){
+  ch_zoom_res = Channel.from( params.res_zoomify ).splitCsv().flatten().toInteger()
+  ch_map_res = ch_map_res.concat(ch_zoom_res)
+}
 
-ch_map_res = Channel.from( params.bin_size ).splitCsv().flatten()
 if (params.res_tads && !params.skip_tads){
   Channel.from( "${params.res_tads}" )
     .splitCsv()
     .flatten()
+    .toInteger()
     .set {ch_tads_res}
   ch_map_res = ch_map_res.concat(ch_tads_res)
 }else{
@@ -56,6 +63,7 @@ if (params.res_dist_decay && !params.skip_dist_decay){
   Channel.from( "${params.res_dist_decay}" )
     .splitCsv()
     .flatten()
+    .toInteger()
     .set {ch_ddecay_res}
    ch_map_res = ch_map_res.concat(ch_ddecay_res)
 }else{
@@ -69,6 +77,7 @@ if (params.res_compartments && !params.skip_compartments){
   Channel.from( "${params.res_compartments}" )
     .splitCsv()
     .flatten()
+    .toInteger()
     .set {ch_comp_res}
    ch_map_res = ch_map_res.concat(ch_comp_res)
 }else{
@@ -154,8 +163,6 @@ workflow HIC {
     ch_input
   )
 
-  INPUT_CHECK.out.reads.view()
-
   //
   // SUBWORKFLOW: Prepare genome annotation
   //
@@ -202,7 +209,6 @@ workflow HIC {
   if (!params.skip_dist_decay){
     COOLER.out.cool
       .combine(ch_ddecay_res)
-      .view()
       .filter{ it[0].resolution == it[2] }
       .map { it -> [it[0], it[1]]}
       .set{ ch_distdecay }