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

mapping_paired.nf

Blame
  • Laurent Modolo's avatar
    4ff7d565
    History
    mapping_paired.nf 972 B
    params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
    params.index = "$baseDir/data/index/*.index.*"
    
    log.info "fastq files : ${params.fastq}"
    log.info "index files : ${params.index}"
    
    Channel
      .fromFilePairs( 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 "$pair_id"
      publishDir "results/mapping/bams/", mode: 'copy'
    
      input:
      set pair_id, file(reads) from fastq_files
      file index from index_files.collect()
    
      output:
      set pair_id, "*.bam" into bam_files
      file "*.out" into mapping_report
    
      script:
    """
    mkdir -p index
    mv ${index} index/
    STAR --runThreadN ${task.cpus} \
    --genomeDir index/ \
    --readFilesIn ${reads[0]} ${reads[1]} \
    --outFileNamePrefix ${pair_id} \
    --outSAMmapqUnique 0 \
    --outSAMtype BAM SortedByCoordinate
    """
    }