Skip to content

Commit c9e04d3

Browse files
authored
Merge pull request #208 from sc13-bioinf/sc13_tag_raw_fastqc
Use prefix for raw reads fastqc multiqc results
2 parents 3d42d0c + b143b7d commit c9e04d3

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

assets/multiqc_config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ top_modules:
66
- 'fastqc':
77
name: 'FastQC (pre-AdapterRemoval)'
88
path_filters:
9-
- '*_fastqc.zip'
10-
path_filters_exclude:
11-
- '*.combined.prefixed_fastqc.zip'
9+
- '*_raw_fastqc.zip'
1210
- 'fastp'
1311
- 'adapterRemoval'
1412
- 'fastqc':
1513
name: 'FastQC (post-AdapterRemoval)'
1614
path_filters:
15+
- '*.truncated_fastqc.zip'
1716
- '*.combined*_fastqc.zip'
1817
- 'samtools'
1918
- 'preseq'

main.nf

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def helpMessage() {
3939
--snpcapture Runs in SNPCapture mode (specify a BED file if you do this!)
4040
4141
References If not specified in the configuration file, or you wish to overwrite any of the references.
42-
--bwa_index Path to directory containing BWA index files
42+
--bwa_index Prefix of the BWA index files including the full path (everything before the endings '.amb' '.ann' '.bwt' most likely the same value supplied with the --fasta option)
4343
--bedfile Path to BED file for SNPCapture methods
4444
--seq_dict Path to picard sequence dictionary file (typically ending in '.dict')
4545
--fasta_index Path to samtools FASTA index (typically ending in '.fai')
@@ -144,7 +144,7 @@ params.pairedEnd = false
144144
params.genome = "Custom"
145145
params.snpcapture = false
146146
params.bedfile = ''
147-
params.fasta = false
147+
params.fasta = ''
148148
params.seq_dict = false
149149
params.fasta_index = false
150150
params.saveReference = false
@@ -230,7 +230,9 @@ multiqc_config = file(params.multiqc_config)
230230
output_docs = file("$baseDir/docs/output.md")
231231
where_are_my_files = file("$baseDir/assets/where_are_my_files.txt")
232232
// Validate inputs
233-
if("${params.fasta}".endsWith(".gz")){
233+
if ( params.fasta.isEmpty () ){
234+
exit 1, "Please specify --fasta with the path to your reference"
235+
} else if("${params.fasta}".endsWith(".gz")){
234236
//Put the zip into a channel, then unzip it and forward to downstream processes. DONT unzip in all steps, this is inefficient as NXF links the files anyways from work to work dir
235237
zipped_fasta = file("${params.fasta}")
236238

@@ -444,7 +446,7 @@ ${summary.collect { k,v -> " <dt>$k</dt><dd><samp>${v ?: '<span style
444446
* Create BWA indices if they are not present
445447
*/
446448

447-
if(!params.bwa_index && params.fasta && (params.aligner == 'bwa' || params.bwamem)){
449+
if(!params.bwa_index && !params.fasta.isEmpty() && (params.aligner == 'bwa' || params.bwamem)){
448450
process makeBWAIndex {
449451
tag {fasta}
450452
publishDir path: "${params.outdir}/reference_genome/bwa_index", mode: 'copy', saveAs: { filename ->
@@ -480,7 +482,7 @@ process makeFastaIndex {
480482
else if(!params.saveReference && filename == "where_are_my_files.txt") filename
481483
else null
482484
}
483-
when: !params.fasta_index && params.fasta && params.aligner == 'bwa'
485+
when: !params.fasta_index && !params.fasta.isEmpty() && params.aligner == 'bwa'
484486

485487
input:
486488
file fasta from fasta_for_indexing
@@ -509,7 +511,7 @@ process makeSeqDict {
509511
else null
510512
}
511513

512-
when: !params.seq_dict && params.fasta
514+
when: !params.seq_dict && !params.fasta.isEmpty()
513515

514516
input:
515517
file fasta from fasta_for_indexing
@@ -570,6 +572,8 @@ process fastqc {
570572
script:
571573
"""
572574
fastqc -q $reads
575+
rename 's/_fastqc\\.zip\$/_raw_fastqc.zip/' *_fastqc.zip
576+
rename 's/_fastqc\\.html\$/_raw_fastqc.html/' *_fastqc.html
573577
"""
574578
}
575579

0 commit comments

Comments
 (0)