Skip to content
Snippets Groups Projects
Select Git revision
  • 139175cb6897038862b2f19583a25c7332a2ba23
  • master default protected
  • dev
  • 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
13 results

indexing.nf

Blame
  • Forked from LBMC / nextflow
    1100 commits behind the upstream repository.
    Laurent Modolo's avatar
    4afb1981
    History
    indexing.nf 747 B
    /*                      fasta indexing                                     */
    
    params.fasta = "$baseDir/data/bam/*.fasta"
    
    log.info "fasta files : ${params.fasta}"
    
    Channel
      .fromPath( params.fasta )
      .ifEmpty { error "Cannot find any bam files matching: ${params.fasta}" }
      .set { fasta_file }
    
    process index_fasta {
      tag "$fasta.baseName"
      cpus 4
      publishDir "results/mapping/index/", mode: 'copy'
    
      input:
        file fasta from fasta_file
    
      output:
        file "*.index*" into index_files
        file "*_report.txt" into indexing_report
    
      script:
    """
    bowtie-build --threads ${task.cpus} -f ${fasta} ${fasta.baseName}.index &> ${fasta.baseName}_bowtie_report.txt
    
    if grep -q "Error" ${fasta.baseName}_bowtie_report.txt; then
      exit 1
    fi
    """
    }