Skip to content

Commit 402fad8

Browse files
authored
Merge pull request #435 from BU-ISCIII/cutadapt
Changed Cutadapt to use nf-core modules
2 parents e1eb311 + e963569 commit 402fad8

18 files changed

+399
-59
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ jobs:
111111
- "--skip_plasmidid false --skip_asciigenome"
112112
- "--additional_annotation ./GCA_009858895.3_ASM985889v3_genomic.gtf.gz"
113113
- "--bowtie2_index ./GCA_009858895.3_ASM985889v3_genomic.200409.bt2.index.tar.gz"
114+
- "--skip_noninternal_primers --threeprime_adapters"
114115
isMaster:
115116
- ${{ github.base_ref == 'master' }}
116117
# Exclude conda and singularity on dev

CHANGELOG.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,23 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements
2828
- [[PR #434](https://github.com/nf-core/viralrecon/pull/434)] - Add blast result filtering through `min_contig_length` and `min_perc_contig_aligned`.
2929
- [[PR #438](https://github.com/nf-core/viralrecon/pull/438)] - Update fastp container to 0.23.4
3030
- [[PR #439](https://github.com/nf-core/viralrecon/pull/439)] - Fix cardinality issue when using `--bowtie2_index`
31+
- [[PR #435](https://github.com/nf-core/viralrecon/pull/435)] - Changed to a patched cutadapt from nf-core modules, added `skip_noninternal_primers` param to allow users to process primers inside the pipeline, and added `threeprime_adapters` to determine whether primers are 3' or 5' adapters.
3132

3233
### Parameters
3334

34-
| Old parameter | New parameter |
35-
| ------------- | --------------------------- |
36-
| | `--skip_freyja` |
37-
| | `--freyja_repeats` |
38-
| | `--freyja_db_name` |
39-
| | `--freyja_barcodes` |
40-
| | `--freyja_lineages` |
41-
| | `--skip_freyja_boot` |
42-
| | `--additional_annotation` |
43-
| | `--min_contig_length` |
44-
| | `--min_perc_contig_aligned` |
35+
| Old parameter | New parameter |
36+
| ------------- | ---------------------------- |
37+
| | `--skip_freyja` |
38+
| | `--freyja_repeats` |
39+
| | `--freyja_db_name` |
40+
| | `--freyja_barcodes` |
41+
| | `--freyja_lineages` |
42+
| | `--skip_freyja_boot` |
43+
| | `--additional_annotation` |
44+
| | `--min_contig_length` |
45+
| | `--min_perc_contig_aligned` |
46+
| | `--skip_noninternal_primers` |
47+
| | `--threeprime_adapters` |
4548

4649
> **NB:** Parameter has been **updated** if both old and new parameter information is present.
4750
> **NB:** Parameter has been **added** if just the new parameter information is present.
@@ -53,9 +56,10 @@ Note, since the pipeline is now using Nextflow DSL2, each process will be run wi
5356

5457
| Dependency | Old version | New version |
5558
| ---------- | ----------- | ----------- |
59+
| `cutadapt` | | 4.6 |
60+
| `fastp` | 0.23.2 | 0.23.4 |
5661
| `freyja` | | 1.5.0 |
5762
| `multiqc` | 1.14 | 1.19 |
58-
| `fastp` | 0.23.2 | 0.23.4 |
5963

6064
> **NB:** Dependency has been **updated** if both old and new version information is present.
6165
>

conf/modules_illumina.config

+8-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,14 @@ if (!params.skip_assembly) {
757757
enabled: params.save_reference
758758
]
759759
}
760-
760+
withName: 'PREPARE_PRIMER_FASTA' {
761+
ext.args = '^'
762+
ext.prefix = { "${meta.id}"}
763+
publishDir = [
764+
path: { "${params.outdir}/assembly/cutadapt/log" },
765+
enabled: false
766+
]
767+
}
761768
withName: 'CUTADAPT' {
762769
ext.args = '--overlap 5 --minimum-length 30 --error-rate 0.1'
763770
ext.prefix = { "${meta.id}.primer_trim" }

docs/usage.md

+14
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,20 @@ To learn how to provide additional arguments to a particular tool of the pipelin
321321

322322
[Freyja](https://github.com/andersen-lab/Freyja) relies on a dataset of barcodes that use lineage defining mutations (see [UShER](https://usher-wiki.readthedocs.io/en/latest/#)). By default the most recent barcodes will be downloaded and used. However, if analyses need to be compared across multiple datasets, it might be of interest to re-use the same barcodes, or to rerun all Freyja analyses with the most recent dataset. To do this, specify the barcodes and lineages using the `--freyja_barcodes`, `--freyja_lineages` parameters, respectivly. The boostrapping of Freyja can be skipped by specifying `--skip_freyja_boot`.
323323

324+
### Cutadapt
325+
326+
According to [Cutadapt's documentation regarding adapter types](https://cutadapt.readthedocs.io/en/stable/guide.html#adapter-types), you can have:
327+
328+
- Regular 3’ adapter: `-a ADAPTER`
329+
- Set `--skip_noninternal_primers` to `true`
330+
- Set `--threeprime_adapters` to `true`
331+
- Regular 5’ adapter: `-g ADAPTER`
332+
- Set `--skip_noninternal_primers` to `true`
333+
- Non-internal 3’ adapter: `-a ADAPTERX`:
334+
- Change `modules_illumina.config` > `PREPARE_PRIMER_FASTA` > `ext.args` to use `$` instead of `^` to add the X at the end of the sequence.
335+
- Set `--threeprime_adapters` to `true`
336+
- **Non-internal 5’ adapter**: `-g XADAPTER`: **This is the option by default**.
337+
324338
### nf-core/configs
325339

326340
In most cases, you will only need to create a custom config as a one-off but if you and others within your organisation are likely to be running nf-core pipelines regularly and need to use the same settings regularly it may be a good idea to request that your custom config file is uploaded to the `nf-core/configs` git repository. Before you do this please can you test that the config file works with your pipeline of choice using the `-c` parameter. You can then create a pull request to the `nf-core/configs` repository with the addition of your config file, associated documentation file (see examples in [`nf-core/configs/docs`](https://github.com/nf-core/configs/tree/master/docs)), and amending [`nfcore_custom.config`](https://github.com/nf-core/configs/blob/master/nfcore_custom.config) to include your custom profile.

modules.json

+5
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@
105105
"git_sha": "1b0ffa4e5aed5b7e3cd4311af31bd3b2c8345051",
106106
"installed_by": ["modules"]
107107
},
108+
"cutadapt": {
109+
"branch": "master",
110+
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
111+
"installed_by": ["modules"]
112+
},
108113
"fastp": {
109114
"branch": "master",
110115
"git_sha": "1ceaa8ba4d0fd886dbca0e545815d905b7407de7",

modules/local/cutadapt.nf

-43
This file was deleted.

modules/local/prepare_primer_fasta.nf

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
process PREPARE_PRIMER_FASTA {
2+
tag "$adapters"
3+
label 'process_low'
4+
5+
conda "conda-forge::sed=4.7"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/ubuntu:20.04' :
8+
'nf-core/ubuntu:20.04' }"
9+
10+
input:
11+
path adapters
12+
13+
output:
14+
path 'adapters.sub.fa', emit: adapters
15+
16+
when:
17+
task.ext.when == null || task.ext.when
18+
19+
script:
20+
def args = task.ext.args ?: ''
21+
22+
"""
23+
sed -r '/^[ACTGactg]+\$/ s/$args/X/g' $adapters > adapters.sub.fa
24+
25+
cat <<-END_VERSIONS > versions.yml
26+
"${task.process}":
27+
sed: \$(echo \$(sed --version 2>&1) | sed 's/^.*GNU sed) //; s/ .*\$//')
28+
END_VERSIONS
29+
"""
30+
}

modules/nf-core/cutadapt/cutadapt.diff

+46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/cutadapt/environment.yml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/cutadapt/main.nf

+66
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/cutadapt/meta.yml

+58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)