Skip to content
Snippets Groups Projects
Select Git revision
  • 231fd9e6a361a8095f07f32ce8c42b69f9409f8f
  • master default protected
  • dev
  • 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
17 results

fasta_from_bed.nf

Blame
  • Forked from LBMC / nextflow
    Source project has a limited visibility.
    main.nf 1.22 KiB
    version = "0.6.7"
    container_url = "lbmc/sambamba:${version}"
    
    params.index_bam = ""
    process index_bam {
      container = "${container_url}"
      label "big_mem_multi_cpus"
      tag "$file_id"
    
      input:
        tuple val(file_id), path(bam)
    
      output:
        tuple val(file_id), path("*.bam*"), emit: bam
    
      script:
    """
    sambamba index ${params.index_bam} -t ${task.cpus} ${bam}
    """
    }
    
    params.sort_bam = ""
    process sort_bam {
      container = "${container_url}"
      label "big_mem_multi_cpus"
      tag "$file_id"
    
      input:
        tuple val(file_id), path(bam)
    
      output:
        tuple val(file_id), path("*.bam*"), emit: bam
    
      script:
    """
    sambamba sort -t ${task.cpus} ${params.sort_bam} -o ${bam.baseName}_sorted.bam ${bam}
    """
    }
    
    params.split_bam = ""
    process split_bam {
      container = "${container_url}"
      label "big_mem_multi_cpus"
      tag "$file_id"
    
      input:
        tuple val(file_id), path(bam)
    
      output:
        tuple val(file_id), path("*_forward.bam*"), emit: bam_forward
        tuple val(file_id), path("*_reverse.bam*"), emit: bam_reverse
      script:
    """
    sambamba view -t ${task.cpus} ${params.split_bam} -h -F "strand == '+'" ${bam} > \
      ${bam.baseName}_forward.bam
    sambamba view -t ${task.cpus} ${params.split_bam} -h -F "strand == '-'" ${bam} > \
      ${bam.baseName}_reverse.bam
    """
    }