Skip to content

Commit 098b0b7

Browse files
authored
Merge pull request #926 from nf-core/dsl2-indexing
DSL2: single-genome indexing
2 parents 75c95d4 + 996d101 commit 098b0b7

26 files changed

Lines changed: 1155 additions & 274 deletions

bin/check_samplesheet.py

Lines changed: 263 additions & 235 deletions
Large diffs are not rendered by default.

conf/base.config

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ process {
2828
// See https://www.nextflow.io/docs/latest/config.html#config-process-selectors
2929
withLabel:process_single {
3030
cpus = { check_max( 1 , 'cpus' ) }
31-
memory = { check_max( 6.GB * task.attempt, 'memory' ) }
31+
memory = { check_max( 4.GB * task.attempt, 'memory' ) }
3232
time = { check_max( 4.h * task.attempt, 'time' ) }
3333
}
3434
withLabel:process_low {
3535
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
36-
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
36+
memory = { check_max( 4.GB * task.attempt, 'memory' ) }
3737
time = { check_max( 4.h * task.attempt, 'time' ) }
3838
}
3939
withLabel:process_medium {
40-
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
41-
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
40+
cpus = { check_max( 4 * task.attempt, 'cpus' ) }
41+
memory = { check_max( 8.GB * task.attempt, 'memory' ) }
4242
time = { check_max( 8.h * task.attempt, 'time' ) }
4343
}
4444
withLabel:process_high {
45-
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
46-
memory = { check_max( 72.GB * task.attempt, 'memory' ) }
45+
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
46+
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
4747
time = { check_max( 16.h * task.attempt, 'time' ) }
4848
}
4949
withLabel:process_long {

conf/modules.config

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,40 @@ process {
3838
]
3939
}
4040

41+
withName: SAMTOOLS_FAIDX {
42+
publishDir = [
43+
path: { "${params.outdir}/reference/${meta.id}/" },
44+
mode: params.publish_dir_mode,
45+
pattern: '*.fai',
46+
enabled: params.save_reference
47+
]
48+
}
49+
50+
withName: PICARD_CREATESEQUENCEDICTIONARY {
51+
publishDir = [
52+
path: { "${params.outdir}/reference/${meta.id}/" },
53+
mode: params.publish_dir_mode,
54+
pattern: '*.dict',
55+
enabled: params.save_reference
56+
]
57+
}
58+
59+
withName: BOWTIE2_BUILD {
60+
publishDir = [
61+
path: { "${params.outdir}/reference/${meta.id}/" },
62+
mode: params.publish_dir_mode,
63+
pattern: 'bowtie2/',
64+
enabled: params.save_reference
65+
]
66+
}
67+
68+
withName: BWA_INDEX {
69+
publishDir = [
70+
path: { "${params.outdir}/reference/${meta.id}/" },
71+
mode: params.publish_dir_mode,
72+
pattern: 'bwa/',
73+
enabled: params.save_reference
74+
]
75+
}
76+
4177
}

conf/test.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ params {
2222
// Input data
2323
// TODO nf-core: Specify the paths to your test data on nf-core/test-datasets
2424
// TODO nf-core: Give any required params for the test so that command line flags are not needed
25-
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'
25+
input = 'https://github.com/nf-core/test-datasets/raw/eager/testdata/Mammoth/samplesheet.tsv'
2626

2727
// Genome references
28-
genome = 'R64-1-1'
28+
fasta = 'https://raw.githubusercontent.com/nf-core/test-datasets/eager/reference/Mammoth/Mammoth_MT_Krause.fasta'
2929
}

docs/usage.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,33 @@ TREATMENT_REP3,AEG588A6_S6_L004_R1_001.fastq.gz,
5252

5353
An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline.
5454

55+
## Reference input
56+
57+
nf-core/eager supports two methods of supplying a reference FASTA via `--fasta`.
58+
The first is a direct path to a single FASTA file with optional prebuilt indicies via `--fasta_fai`, `--fasta_dict`, etc., and the second is via a reference sheet.
59+
60+
Providing a reference sheet to `--fasta` allows users to simultaenously map their input reads (separately) to _multiple_ reference genomes. The reference sheet must be in the format of, and the file extension to be either `csv` or `tsv`.
61+
62+
This reference file is also used to specfiy paths to optional user-built reference indicies (namely, `.fai`, `.dict`, and a directory pointing to a directory containing the indicies for the given mapper).
63+
Note that passing the reference sheet to `--fasta` to the pipeline will _override_ the corredonding user-build indicies parameters (`--fasta_fai`, `--fasta_dict`).
64+
65+
If using a reference sheet, this must be in format (if in `csv`), and must have a header consisting of:
66+
67+
```txt
68+
reference_name,fasta,fai,dict,mapper_index,circular_target,mitochondrion
69+
```
70+
71+
Only `reference_name`, and `fasta` are required.
72+
Files for `fai`, `dict`, `mapper_index` will be generated by the pipeline for you if not specified.
73+
`circular_target` and `mitochondiron` are only needed if circular mapper and MtNucRatio modules are selected.
74+
75+
A filled-in example is like so, where a user-supplied `.dict` file nor circular generator not MtNucRatio is required:
76+
77+
```txt
78+
reference_name,fasta,fai,dict,mapper_index,circular_target,mitochondrion
79+
tannerella_forsythia,~/data/reference/tannerella_forstythia.fasta,~/data/reference/tannerella_forstythia.fasta.fai,,~/data/reference/tannerella_forstythia.dict,~/data/reference/,,
80+
```
81+
5582
## Running the pipeline
5683

5784
The typical command for running the pipeline is as follows:

modules.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
"https://github.com/nf-core/modules.git": {
66
"modules": {
77
"nf-core": {
8+
"bowtie2/build": {
9+
"branch": "master",
10+
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
11+
"patch": "modules/nf-core/bowtie2/build/bowtie2-build.diff"
12+
},
13+
"bwa/index": {
14+
"branch": "master",
15+
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
16+
"patch": "modules/nf-core/bwa/index/bwa-index.diff"
17+
},
818
"custom/dumpsoftwareversions": {
919
"branch": "master",
1020
"git_sha": "8022c68e7403eecbd8ba9c49496f69f8c49d50f0"
@@ -13,9 +23,21 @@
1323
"branch": "master",
1424
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905"
1525
},
26+
"gunzip": {
27+
"branch": "master",
28+
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905"
29+
},
1630
"multiqc": {
1731
"branch": "master",
1832
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905"
33+
},
34+
"picard/createsequencedictionary": {
35+
"branch": "master",
36+
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905"
37+
},
38+
"samtools/faidx": {
39+
"branch": "master",
40+
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905"
1941
}
2042
}
2143
}

modules/local/samplesheet_check.nf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
process SAMPLESHEET_CHECK {
22
tag "$samplesheet"
3+
label 'process_single'
34

45
conda (params.enable_conda ? "conda-forge::python=3.8.3" : null)
56
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
@@ -13,6 +14,9 @@ process SAMPLESHEET_CHECK {
1314
path '*.csv' , emit: csv
1415
path "versions.yml", emit: versions
1516

17+
when:
18+
task.ext.when == null || task.ext.when
19+
1620
script: // This script is bundled with the pipeline, in nf-core/eager/bin/
1721
"""
1822
check_samplesheet.py \\

modules/nf-core/bowtie2/build/bowtie2-build.diff

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/bowtie2/build/main.nf

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/bowtie2/build/meta.yml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)