- 
                Notifications
    You must be signed in to change notification settings 
- Fork 928
New align dedup bwamem #9197
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
          
     Merged
      
      
    
  
     Merged
                    New align dedup bwamem #9197
Changes from 62 commits
      Commits
    
    
            Show all changes
          
          
            80 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      09a0768
              
                tests
              
              
                eduard-watchmaker eb5e9a1
              
                tests
              
              
                eduard-watchmaker 410f815
              
                confs
              
              
                eduard-watchmaker 9fed518
              
                confs
              
              
                eduard-watchmaker bfe4c92
              
                confs
              
              
                eduard-watchmaker e378261
              
                confs
              
              
                eduard-watchmaker ddec51c
              
                confs
              
              
                eduard-watchmaker a814a98
              
                confs
              
              
                eduard-watchmaker 64cb5fb
              
                confs
              
              
                eduard-watchmaker 0d25fb6
              
                gpu
              
              
                eduard-watchmaker 1d4e368
              
                gpu
              
              
                eduard-watchmaker 346c924
              
                last snap
              
              
                 1135a44
              
                snap
              
              
                eduard-watchmaker 89553aa
              
                rm snap
              
              
                 1b94c68
              
                snap
              
              
                eduard-watchmaker 4fc5292
              
                removed snapshot
              
              
                eduard-watchmaker e789607
              
                Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
              
              
                eduard-watchmaker 4d386e2
              
                new snap
              
              
                 e96bf5e
              
                Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
              
              
                eduard-watchmaker bd582bd
              
                lint
              
              
                eduard-watchmaker 387bee6
              
                lint
              
              
                eduard-watchmaker 96267d4
              
                channel
              
              
                eduard-watchmaker 72deafb
              
                channel
              
              
                eduard-watchmaker cc687b0
              
                channel
              
              
                eduard-watchmaker dfb3163
              
                snap test
              
              
                eduard-watchmaker a5eb4ba
              
                last snapshot
              
              
                 8066ff9
              
                last lint
              
              
                eduard-watchmaker 29c5767
              
                gpu snap
              
              
                 8c6dc7d
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker b7491fa
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker 40c3b95
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker d4247ea
              
                PR feedback
              
              
                eduard-watchmaker def28fc
              
                Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
              
              
                eduard-watchmaker d08254b
              
                samtools sort prefix
              
              
                eduard-watchmaker 486af86
              
                samtools sort prefix
              
              
                eduard-watchmaker c6e37a2
              
                samtools sort prefix
              
              
                eduard-watchmaker 73279d0
              
                samtools sort prefix
              
              
                eduard-watchmaker 3e28150
              
                samtools sort prefix
              
              
                eduard-watchmaker 8fb8884
              
                samtools sort prefix
              
              
                eduard-watchmaker 2d15776
              
                new snap
              
              
                 3f95612
              
                new snap
              
              
                 1a62f20
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/meta.yml
              
              
                eduard-watchmaker 54e69d3
              
                changed tests again
              
              
                eduard-watchmaker 8d93435
              
                new cpu snapshot
              
              
                 ecc24de
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker df90876
              
                low memory to fq2bam
              
              
                eduard-watchmaker 2cc3841
              
                conf revert
              
              
                eduard-watchmaker f502775
              
                rm nftest utils line and add lowmem to fq2bam
              
              
                eduard-watchmaker 4f75db5
              
                revert lowmem to fq2bam
              
              
                eduard-watchmaker f63895c
              
                index file
              
              
                eduard-watchmaker 6e39c51
              
                path to index
              
              
                eduard-watchmaker dfd3339
              
                path to index
              
              
                eduard-watchmaker d844298
              
                revert nft utils
              
              
                eduard-watchmaker f9e083c
              
                test
              
              
                eduard-watchmaker 2466b40
              
                test
              
              
                eduard-watchmaker e028f2c
              
                removed parabricks
              
              
                eduard-watchmaker 336ec28
              
                new snapshot
              
              
                 4137153
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker 93ce7bb
              
                revert test data fw2bam
              
              
                eduard-watchmaker 81ce2f1
              
                Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
              
              
                eduard-watchmaker c978768
              
                revert test data fw2bam
              
              
                eduard-watchmaker 42fd557
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker a04aad1
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker 95ca65b
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/main.nf
              
              
                eduard-watchmaker fa439e4
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker 157c25a
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker ba77a08
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker 3dda2ee
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker eb145ea
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker ff3be92
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/nextflow.config
              
              
                eduard-watchmaker fe03a14
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker 98f6e24
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker b99c6f2
              
                Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
              
              
                eduard-watchmaker f578b99
              
                added new tag at test
              
              
                eduard-watchmaker 9237960
              
                added new tag at test
              
              
                eduard-watchmaker 6b84e16
              
                new snapshot
              
              
                 acf88ba
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker 1954238
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker fff2c7f
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker 94b7c6d
              
                Merge branch 'master' into new_align_dedup_bwamem
              
              
                eduard-watchmaker File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| include { FASTQ_ALIGN_BWA } from '../../nf-core/fastq_align_bwa/main' | ||
| include { PICARD_ADDORREPLACEREADGROUPS } from '../../../modules/nf-core/picard/addorreplacereadgroups/main' | ||
| include { PICARD_MARKDUPLICATES } from '../../../modules/nf-core/picard/markduplicates/main' | ||
| include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' | ||
|  | ||
| workflow FASTQ_ALIGN_DEDUP_BWAMEM { | ||
|  | ||
| take: | ||
| ch_reads // channel: [ val(meta), [ reads ] ] | ||
| ch_fasta // channel: [ val(meta), [ fasta ] ] | ||
| ch_fasta_index // channel: [ val(meta), [ fasta index ] ] | ||
| ch_bwamem_index // channel: [ val(meta), [ bwam index ] ] | ||
| skip_deduplication // boolean: whether to deduplicate alignments | ||
| use_gpu // boolean: whether to use GPU or CPU for bwamem alignment | ||
|  | ||
| main: | ||
|  | ||
| ch_alignment = Channel.empty() | ||
| ch_alignment_index = Channel.empty() | ||
| ch_flagstat = Channel.empty() | ||
| ch_stats = Channel.empty() | ||
| ch_picard_metrics = Channel.empty() | ||
| ch_multiqc_files = Channel.empty() | ||
| ch_versions = Channel.empty() | ||
|  | ||
| FASTQ_ALIGN_BWA ( | ||
| ch_reads, | ||
| ch_bwamem_index, | ||
| true, // val_sort_bam hardcoded to true | ||
| ch_fasta | ||
| ) | ||
| ch_alignment = ch_alignment.mix(FASTQ_ALIGN_BWA.out.bam) | ||
| ch_alignment_index = ch_alignment.mix(FASTQ_ALIGN_BWA.out.bai) | ||
| ch_stats = ch_alignment.mix(FASTQ_ALIGN_BWA.out.stats) // channel: [ val(meta), path(stats) ] | ||
| ch_flagstat = ch_alignment.mix(FASTQ_ALIGN_BWA.out.flagstat) // channel: [ val(meta), path(flagstat) ] | ||
| ch_idxstats = ch_alignment.mix(FASTQ_ALIGN_BWA.out.idxstats) // channel: [ val(meta), path(idxstats) ] | ||
| ch_versions = ch_versions.mix(FASTQ_ALIGN_BWA.out.versions.first()) | ||
|  | ||
| if (!skip_deduplication) { | ||
| /* | ||
| * Run Picard AddOrReplaceReadGroups to add read group (RG) to reads in bam file | ||
| */ | ||
| PICARD_ADDORREPLACEREADGROUPS ( | ||
| ch_alignment, | ||
| ch_fasta, | ||
| ch_fasta_index | ||
| ) | ||
| ch_versions = ch_versions.mix(PICARD_ADDORREPLACEREADGROUPS.out.versions.first()) | ||
|  | ||
| /* | ||
| * Run Picard MarkDuplicates with the --REMOVE_DUPLICATES true flag | ||
| */ | ||
|  | ||
| PICARD_MARKDUPLICATES ( | ||
| PICARD_ADDORREPLACEREADGROUPS.out.bam, | ||
| ch_fasta, | ||
| ch_fasta_index | ||
| ) | ||
| ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions.first()) | ||
|  | ||
| /* | ||
| * Run samtools index on deduplicated alignment | ||
| */ | ||
| SAMTOOLS_INDEX ( | ||
| PICARD_MARKDUPLICATES.out.bam | ||
| ) | ||
| ch_alignment = PICARD_MARKDUPLICATES.out.bam | ||
| ch_alignment_index = SAMTOOLS_INDEX.out.bai | ||
| ch_picard_metrics = PICARD_MARKDUPLICATES.out.metrics | ||
| ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) | ||
| } | ||
|  | ||
| /* | ||
| * Collect MultiQC inputs | ||
| */ | ||
| ch_multiqc_files = ch_picard_metrics.collect{ meta, metrics -> metrics } | ||
| .mix(ch_flagstat.collect{ meta, flagstat -> flagstat }) | ||
| .mix(ch_stats.collect{ meta, stats -> stats }) | ||
| .mix(ch_idxstats.collect{ meta, stats -> stats }) | ||
|  | ||
| emit: | ||
| bam = ch_alignment // channel: [ val(meta), [ bam ] ] | ||
| bai = ch_alignment_index // channel: [ val(meta), [ bai ] ] | ||
| samtools_flagstat = ch_flagstat // channel: [ val(meta), [ flagstat ] ] | ||
| samtools_stats = ch_stats // channel: [ val(meta), [ stats ] ] | ||
| samtools_index_stats = ch_idxstats // channel: [ val(meta), [ idxstats ] ] | ||
| picard_metrics = ch_picard_metrics // channel: [ val(meta), [ metrics ] ] | ||
| multiqc = ch_multiqc_files // channel: [ *{html,txt} ] | ||
| versions = ch_versions // channel: [ versions.yml ] | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json | ||
| name: "fastq_align_dedup_bwamem" | ||
| description: Performs alignment of DNA or TAPS-treated reads using bwamem, sort and deduplicate | ||
| keywords: | ||
| - bwamem | ||
| - alignment | ||
| - map | ||
| - 5mC | ||
| - methylseq | ||
|         
                  vagkaratzas marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| - DNA | ||
| - fastq | ||
| - bam | ||
| components: | ||
| - samtools/index | ||
| - picard/addorreplacereadgroups | ||
| - picard/markduplicates | ||
| - fastq_align_bwa | ||
| input: | ||
| - ch_reads: | ||
| description: | | ||
| List of input FastQ files of size 1 and 2 for single-end and paired-end data, | ||
| respectively. | ||
| Structure: [ val(meta), [ path(reads) ] ] | ||
| pattern: "*.{fastq,fastq.gz}" | ||
| - ch_fasta: | ||
| type: file | ||
| description: | | ||
| Structure: [ val(meta), path(fasta) ] | ||
| pattern: "*.{fa,fa.gz}" | ||
| - ch_fasta_index: | ||
| type: file | ||
| description: | | ||
| Structure: [ val(meta), path(fasta index) ] | ||
| - ch_bwamem_index: | ||
| type: directory | ||
| description: | | ||
|         
                  eduard-watchmaker marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| Bwa-mem genome index files | ||
| Structure: [ val(meta), path(index) ] | ||
| pattern: "Bwa-memIndex" | ||
|         
                  eduard-watchmaker marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| - skip_deduplication: | ||
| type: boolean | ||
| description: | | ||
| Skip deduplication of aligned reads | ||
| output: | ||
| - bam: | ||
| type: file | ||
| description: | | ||
| Channel containing BAM files | ||
| Structure: [ val(meta), path(bam) ] | ||
| pattern: "*.bam" | ||
| - bai: | ||
| type: file | ||
| description: | | ||
| Channel containing indexed BAM (BAI) files | ||
| Structure: [ val(meta), path(bai) ] | ||
| pattern: "*.bai" | ||
| - samtools_flagstat: | ||
| type: file | ||
| description: | | ||
| File containing samtools flagstat output | ||
| Structure: [ val(meta), path(flagstat) ] | ||
| pattern: "*.flagstat" | ||
| - samtools_idxstats: | ||
| type: file | ||
| description: | | ||
| File containing samtools idxstats output | ||
| Structure: [ val(meta), path(idxstats) ] | ||
| pattern: "*.idxstats" | ||
| - samtools_stats: | ||
|         
                  eduard-watchmaker marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| type: file | ||
| description: | | ||
| File containing samtools stats output | ||
| Structure: [ val(meta), path(stats) ] | ||
| pattern: "*.{stats}" | ||
| - picard_metrics: | ||
| type: file | ||
| description: | | ||
| Duplicate metrics file generated by picard | ||
| Structure: [ val(meta), path(metrics) ] | ||
| pattern: "*.{metrics.txt}" | ||
| - multiqc: | ||
| type: file | ||
| description: | | ||
| Channel containing MultiQC report aggregating results across samples. | ||
| Structure: [ val(meta), path(multiqc_report.html) ] | ||
| pattern: "*.html" | ||
| - versions: | ||
| type: file | ||
| description: | | ||
| File containing software versions | ||
| Structure: [ path(versions.yml) ] | ||
| pattern: "versions.yml" | ||
| authors: | ||
| - "@eduard-watchmaker" | ||
| maintainers: | ||
| - "@eduard-watchmaker" | ||
        
          
          
            13 changes: 13 additions & 0 deletions
          
          13 
        
  subworkflows/nf-core/fastq_align_dedup_bwamem/nextflow.config
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| process { | ||
|         
                  eduard-watchmaker marked this conversation as resolved.
              Show resolved
            Hide resolved         
                  eduard-watchmaker marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| withName: 'SAMTOOLS_SORT' { | ||
| ext.prefix = { "${meta.id}.sorted" } | ||
| } | ||
| withName: 'PICARD_MARKDUPLICATES' { | ||
| ext.args = "--ASSUME_SORTED true --REMOVE_DUPLICATES true --VALIDATION_STRINGENCY LENIENT --PROGRAM_RECORD_ID 'null' --TMP_DIR tmp" | ||
| ext.prefix = { "${meta.id}.deduped.sorted" } | ||
| } | ||
| withName: 'PICARD_ADDORREPLACEREADGROUPS' { | ||
| ext.args = "--RGID 1 --RGLB lib1 --RGPL illumina --RGPU unit1 --RGSM sample1" | ||
| ext.prefix = { "${meta.id}.RG.sorted" } | ||
| } | ||
| } | ||
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.