Skip to content
Snippets Groups Projects
Select Git revision
  • f51bf1e4d50dd21bfe4e01d9f4251c0fac2d2a9a
  • master default protected
  • dchalopi-master-patch-91545
  • tp_experimental_biologists
4 results

index.nf

Blame
  • Forked from LBMC / nextflow
    Source project has a limited visibility.
    index.nf 624 B
    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
    
      script:
    """
    bowtie2-build --threads ${task.cpus} ${fasta} ${fasta.baseName}.index &> ${fasta.baseName}_bowtie2_report.txt
    
    if grep -q "Error" ${fasta.baseName}_bowtie2_report.txt; then
      exit 1
    fi
    """
    }