Description

Align reads to two different reference genomes using bwa, then use bamcmp to keep only reads that align better to the first genome, then sort with samtools

Input

Name (Type)
Description
Pattern

ch_reads

List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
Structure: [ val(meta), [ path(reads) ] ]

ch_primary_index

BWA genome index files for the primary species.
Structure: [ val(meta2), path(primary_index) ]

ch_contaminant_index

BWA genome index files for the contamination species.
Structure: [ val(meta3), path(contaminant_index) ]

val_sort_bam (boolean)

If true sort resulting primary bam files.

true|false

ch_primary_fasta (file)

Optional reference fasta file for the primary genome. This only needs to be given if val_sort_bam = true
Structure: [ path(fasta) ]

Output

Name (Type)
Description
Pattern

bam

BAM file, sorted by samtools if requested
Structure: [ val(meta), path(bam) ]

contaminant_bam

BAM file of the reads that map better to the contamination genome. Sorted by queryname.
Structure: [ val(meta), path(bam) ]

bai

BAI index of the ordered BAM file
Structure: [ val(meta), path(bai) ]

csi

CSI index of the ordered BAM file
Structure: [ val(meta), path(csi) ]

stats

File containing samtools stats output
Structure: [ val(meta), path(stats) ]

flagstat

File containing samtools flagstat output
Structure: [ val(meta), path(flagstat) ]

idxstats

File containing samtools idxstats output
Structure: [ val(meta), path(idxstats) ]

unfiltered_stats

File containing samtools stats output for primary unfiltered alignment.
Structure: [ val(meta), path(stats) ]

unfiltered_flagstat

File containing samtools flagstat output for primary unfiltered alignment.
Structure: [ val(meta), path(flagstat) ]

unfiltered_idxstats

File containing samtools idxstats output for primary unfiltered alignment.
Structure: [ val(meta), path(idxstats) ]

versions

Files containing software versions
Structure: [ path(versions.yml) ]