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

index.nf

Blame
  • Forked from LBMC / nextflow
    1264 commits behind the upstream repository.
    index.nf 1016 B
    params.fasta = "$baseDir/data/bam/*.fasta"
    params.annotation = "$baseDir/data/bam/*.gff3"
    
    log.info "fasta files : ${params.fasta}"
    
    Channel
      .fromPath( params.fasta )
      .ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
      .set { fasta_file }
    Channel
      .fromPath( params.annotation )
      .ifEmpty { error "Cannot find any annotation files matching: ${params.annotation}" }
      .set { annotation_file }
    
    process index_fasta {
      tag "$fasta.baseName"
      cpus 4
      publishDir "results/mapping/index/", mode: 'copy'
    
      input:
        file fasta from fasta_file
        file annotation from annotation_file
    
      output:
        file "*.index*" into index_files
    
      script:
      def cmd_annotation = "--gff3 ${annotation}"
      if(annotation ==~ /.*\.gtf$/){
        cmd_annotation = "--gtf ${annotation}"
      }
    """
    rsem-prepare-reference -p ${task.cpus} --bowtie2 \
    --bowtie2-path \$(which bowtie2 | sed 's/bowtie2\$//g') \
    ${cmd_annotation} ${fasta} ${fasta.baseName}.index > \
    ${fasta.baseName}_rsem_bowtie2_report.txt
    """
    }