Skip to content
Snippets Groups Projects
Select Git revision
  • 4a7355a22204e9c387da350c65a6a511d1aded8b
  • master default protected
  • dev
  • v2.0.0
  • v0.4.0
  • v0.3.0
  • v0.2.9
  • v0.2.8
  • v0.2.7
  • v0.2.6
  • v0.1.0
  • v0.2.5
  • v0.2.4
  • v0.2.3
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.2
18 results

index_bams.nf

Blame
  • index_bams.nf 472 B
    params.bam = "$baseDir/data/bam/*.bam"
    
    log.info "bams files : ${params.bam}"
    
    Channel
      .fromPath( params.bam )
      .ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
      .map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
      .set { bam_files }
    
    process index_bam {
      tag "$file_id"
    
      input:
        set file_id, file(bam) from bam_files
    
      output:
        set file_id, "*.bam*" into indexed_bam_file
    
      script:
    """
    sambamba index -t ${task.cpus} ${bam}
    """
    }