Skip to content
Snippets Groups Projects
Select Git revision
  • ebecfb6dc6ec771e44b543e541e426edd3625cf7
  • 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

tests.sh

Blame
  • mapping_single.nf 895 B
    params.fastq = "$baseDir/data/fastq/*.fastq"
    
    log.info "fastq files : ${params.fastq}"
    log.info "index files : ${params.index}"
    
    Channel
      .fromPath( params.fastq )
      .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
      .set { fastq_files }
    Channel
      .fromPath( params.index )
      .ifEmpty { error "Cannot find any index files matching: ${params.index}" }
      .set { index_files }
    
    process mapping_fastq {
      tag "$reads.baseName"
      cpus 4
      publishDir "results/mapping/bams/", mode: 'copy'
    
      input:
      file reads from fastq_files
      file index from index_files.toList()
    
      output:
      file "*.bam" into bam_files
    
      script:
    """
    bowtie2 --very_sensitive -p ${task.cpus} -x ${index[0].baseName} \
    -U ${reads} 2> \
    ${reads.baseName}_bowtie2_report.txt | \
    samtools view -Sb - > ${reads.baseName}.bam
    
    if grep -q "Error" ${reads.baseName}_bowtie2_report.txt; then
      exit 1
    fi
    """
    }