Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply formatting changes from code review #58

Merged
merged 6 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,3 @@ To get started:
Devcontainer specs:

- [DevContainer config](.devcontainer/devcontainer.json)
- [Dockerfile](.devcontainer/Dockerfile)
3 changes: 3 additions & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
repository_type: pipeline
lint:
files_unchanged:
- .github/CONTRIBUTING.md
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Introduction

**nf-core/bamtofastq** is a bioinformatics best-practice analysis pipeline that converts (un)mapped `.bam` files or `.cram` files into `fq.gz` files. Initially, it auto-detects, whether the input file contains single-end or paired-end reads. Following this step, the reads are sorted using `samtools collate` and extracted with `samtools fastq`. Furthermore, for mapped bam/cram files it is possible to only convert reads mapping to a specific region or chromosome. The obtained FastQ files can then be used to further process with other pipelines.
**nf-core/bamtofastq** is a bioinformatics best-practice analysis pipeline that converts (un)mapped `.bam` or `.cram` files into `fq.gz` files. Initially, it auto-detects, whether the input file contains single-end or paired-end reads. Following this step, the reads are sorted using `samtools collate` and extracted with `samtools fastq`. Furthermore, for mapped bam/cram files it is possible to only convert reads mapping to a specific region or chromosome. The obtained FastQ files can then be used to further process with other pipelines.

The pipeline is built using [Nextflow](https://www.nextflow.io), 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. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!

Expand Down Expand Up @@ -84,7 +84,6 @@ We thank the following people for their extensive assistance in the development

- [Gisela Gabernet](https://github.com/ggabernet)
- [Matilda Åslin](https://github.com/matrulda)
- [Susanne Jodoin](https://github.com/SusiJo)
- [Bruno Grande](https://github.com/BrunoGrandePhd)

### Resources
Expand Down
14 changes: 7 additions & 7 deletions subworkflows/local/prepare_indices.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ workflow PREPARE_INDICES {

// INDEX BAM/CRAM only if not provided
SAMTOOLS_INDEX(input_to_index)
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions)
ch_index_files = Channel.empty().mix(SAMTOOLS_INDEX.out.bai, SAMTOOLS_INDEX.out.crai)
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions)
ch_index_files = Channel.empty().mix(SAMTOOLS_INDEX.out.bai, SAMTOOLS_INDEX.out.crai)

// Combine channels
ch_new = input_to_index.join(ch_index_files)
ch_out = samtools_input.is_indexed.mix(ch_new)
ch_new = input_to_index.join(ch_index_files)
ch_out = samtools_input.is_indexed.mix(ch_new)


// INDEX FASTA
Expand All @@ -51,7 +51,7 @@ workflow PREPARE_INDICES {

// Gather versions of all tools used
emit:
ch_input_indexed = ch_out
fasta_fai = fasta_fai
versions = ch_versions
ch_input_indexed = ch_out
fasta_fai = fasta_fai
versions = ch_versions
}
8 changes: 4 additions & 4 deletions workflows/bamtofastq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ if (params.input) { ch_input = extract_csv(file(params.input, checkIfExists: tru


// Initialize file channels based on params
fasta = params.fasta ? Channel.fromPath(params.fasta).collect() : Channel.value([])
fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect() : Channel.value([])
fasta = params.fasta ? Channel.fromPath(params.fasta).collect() : Channel.value([])
fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect() : Channel.value([])

// Initialize value channels based on params
chr = params.chr ?: Channel.empty()
chr = params.chr ?: Channel.empty()

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -52,7 +52,7 @@ ch_multiqc_custom_methods_description = params.multiqc_methods_description ? fil
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { CHECK_IF_PAIRED_END } from '../modules/local/check_paired_end'
include { CHECK_IF_PAIRED_END } from '../modules/local/check_paired_end'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down