Skip to content

Commit

Permalink
Merge pull request #58 from SusiJo/dev
Browse files Browse the repository at this point in the history
Apply formatting changes from code review
  • Loading branch information
SusiJo authored May 18, 2023
2 parents 535a376 + 8a31b25 commit 33bd917
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
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

0 comments on commit 33bd917

Please sign in to comment.