Skip to content

Commit

Permalink
Merge pull request #35 from fmalmeida/dev
Browse files Browse the repository at this point in the history
Release v2.6.3
  • Loading branch information
fmalmeida authored Feb 23, 2024
2 parents dad810c + 99e3e09 commit a6e51ab
Show file tree
Hide file tree
Showing 17 changed files with 92 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_pr_illumina_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Testing illumina / docker from PR
on:
pull_request:
branches: master
branches: [ master, dev ]
types: [ opened, synchronize, reopened ]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_pr_illumina_singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Testing illumina / singularity from PR
on:
pull_request:
branches: master
branches: [ master, dev ]
types: [ opened, synchronize, reopened ]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_pr_nanopore_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Testing nanopore / docker from PR
on:
pull_request:
branches: master
branches: [ master, dev ]
types: [ opened, synchronize, reopened ]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_pr_nanopore_singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Testing nanopore / singularity from PR
on:
pull_request:
branches: master
branches: [ master, dev ]
types: [ opened, synchronize, reopened ]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_pr_pacbio_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Testing pacbio / docker from PR
on:
pull_request:
branches: master
branches: [ master, dev ]
types: [ opened, synchronize, reopened ]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_pr_pacbio_singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Testing pacbio / singularity from PR
on:
pull_request:
branches: master
branches: [ master, dev ]
types: [ opened, synchronize, reopened ]

jobs:
Expand Down
35 changes: 0 additions & 35 deletions .readthedocs.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"description": "<p>The pipeline</p>\n\n<p>ngs-preprocess is built using Nextflow, a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. It is an easy to use pipeline that uses state-of-the-art software for quality check and pre-processing ngs reads of Illumina, Pacbio and Oxford Nanopore Technologies.</p>",
"license": "other-open",
"title": "fmalmeida/ngs-preprocess: A pipeline for preprocessing short and long sequencing reads",
"version": "v2.6.2",
"version": "v2.6.3",
"upload_type": "software",
"creators": [
{
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The tracking for changes started in v2.2

## v2.6.3 -- [2024-Fev-23]

* [[#32](https://github.com/fmalmeida/ngs-preprocess/issues/32)] - Add as output a template samplesheet that can be readily used as input for MpGAP to assemble each downloaded read on its own.

## v2.6.2 -- [2024-Jan-19]

* [[#24](https://github.com/fmalmeida/ngs-preprocess/issues/24)] - Added documentation on generated outputs, as requested in paper review
Expand Down
18 changes: 18 additions & 0 deletions docs/outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ preprocessed_reads
├── final_output
│ └── nanopore
│ └── SRR23337893.filtered.fq.gz
# a template input ready for MpGAP
├── mpgap_samplesheet.yml
# directory containing the nextflow execution reports
├── pipeline_info
│ ├── ngs_preprocess_report_2023-11-18_10-07-36.html
Expand All @@ -35,6 +37,22 @@ preprocessed_reads
└── SRR23337893_sra_runInfo.csv
```

## The pre-formatted MpGAP input samplesheet

Once finished, the pipeline also generates a file called `mpgap_samplesheet.yml` (showed below). Basically this samplesheet defines all the **minimum** definitions in order to assemble these reads using the [MpGAP](https://mpgap.readthedocs.io/en/latest/) pipeline.

```yaml
samplesheet:
- id: SRR23337893
nanopore: /workspace/ngs-preprocess/testing/preprocessed_reads/final_output/nanopore/SRR23337893.filtered.fq.gz
```
!!! note
One must keep in mind that, this template samplesheet contains only the **bare minimum** to launch MpGAP but many other customizations are possible. For example, the generated samplesheet will assemble each read separately, but, MpGAP can also perform hybrid assemblies. Therefore, users can/must use this output as a template for easily customization of the assembly pipeline input to use the results of ngs-preprocess pipeline.
For more information, please refer to the [MpGAP](https://mpgap.readthedocs.io/en/latest/) documentation.
## Example of QC outputs
Here I am going to display just a very few examples of results produced, focusing on the QC, as the main result is a cleaned FASTQ file.
Expand Down
47 changes: 47 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,53 @@ workflow {
)
ILLUMINA( shortreads_ch )

/*
* Collect all the generated results as a samplesheet for MpGAP
*/

// get string of final dir
def final_outdir = file("${params.output}").toUriString()
final_outdir = "${final_outdir}/final_output"

// start samplesheet channel and feed it
ch_mpgap_samplesheet = Channel.value( "samplesheet:" )
ch_mpgap_samplesheet.concat(

// short reads data
ILLUMINA.out.reads
.map{ meta, subdir, reads ->
def reads_list = (meta.shortreads_type == 'paired' && !params.fastp_merge_pairs) ? "\s\s\s\s\s\s- ${final_outdir}/${subdir}/${reads[0].getName()}\n\s\s\s\s\s\s- ${final_outdir}/${subdir}/${reads[1].getName()}" : "\s\s\s\s\s\s- ${final_outdir}/${subdir}/${reads.getName()}"
def final_string = "\n\s\s- id: ${meta.id}"
final_string = final_string + "\n\s\s\s\sillumina:\n"
final_string = final_string + reads_list

final_string
},

// nanopore data
NANOPORE.out.reads
.map{ meta, subdir, reads ->
def final_string = "\n\s\s- id: ${meta.id}"
final_string = final_string + "\n\s\s\s\snanopore: ${final_outdir}/${subdir}/${reads.getName()}"

final_string
},

// pacbio data
PACBIO.out.reads
.map{ meta, subdir, reads ->
def final_string = "\n\s\s- id: ${meta.id}"
final_string = final_string + "\n\s\s\s\spacbio: ${final_outdir}/${subdir}/${reads.getName()}"

final_string
},

// end line
Channel.value( "\n" )

)
.collectFile( name: 'mpgap_samplesheet.yml', storeDir: params.output, sort: false, cache: false, newLine: false )

}

workflow.onComplete {
Expand Down
5 changes: 4 additions & 1 deletion modules/fastp.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ process FASTP {

output:
path "*"
tuple val(meta), val('short_reads'), path("*${reads_output}"), emit: reads

script:
reads_output = ".preprocessed.fq.gz"
if (meta.shortreads_type == 'paired') {
if (params.fastp_merge_pairs) {
reads_param = "--in1 ${reads[0]} --in2 ${reads[1]} --out1 ${meta.id}_R1.unmerged.fq.gz --out2 ${meta.id}_R2.unmerged.fq.gz --detect_adapter_for_pe --merge --merged_out ${meta.id}.merged.fq.gz"
reads_param = "--in1 ${reads[0]} --in2 ${reads[1]} --out1 ${meta.id}_R1.unmerged.fq.gz --out2 ${meta.id}_R2.unmerged.fq.gz --detect_adapter_for_pe --merge --merged_out ${meta.id}.merged.fq.gz"
reads_output = ".merged.fq.gz"
} else {
reads_param = "--in1 ${reads[0]} --in2 ${reads[1]} --out1 ${meta.id}_R1.preprocessed.fq.gz --out2 ${meta.id}_R2.preprocessed.fq.gz --detect_adapter_for_pe"
}
Expand Down
2 changes: 1 addition & 1 deletion modules/lreads_filter.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ process FILTER {
tuple val(meta), path(reads)

output:
path "*filtered.fq.gz", emit: fastqs
tuple val(meta), val("${meta.longreads_type}"), path("*filtered.fq.gz"), emit: reads

when:
!(reads =~ /input.*/)
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ manifest {
homePage = "https://github.com/fmalmeida/ngs-preprocess"
mainScript = "main.nf"
nextflowVersion = ">=21.10.0"
version = "2.6.2"
version = "2.6.3"
}
3 changes: 3 additions & 0 deletions workflows/illumina.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions workflows/nanopore.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions workflows/pacbio.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a6e51ab

Please sign in to comment.