RNASeq.nf 939 Bytes
Newer Older
nlecouvr's avatar
nlecouvr committed
1
2
nextflow.enable.dsl=2

nlecouvr's avatar
test    
nlecouvr committed
3

nlecouvr's avatar
nlecouvr committed
4
include { fastp } from "./nf_modules/fastp/main.nf"
nlecouvr's avatar
nlecouvr committed
5
include { fasta_from_bed } from "./nf_modules/bedtools/main.nf"
nlecouvr's avatar
nlecouvr committed
6
include { index_fasta; mapping_fastq } from './nf_modules/kallisto/main.nf'
nlecouvr's avatar
nlecouvr committed
7

nlecouvr's avatar
nlecouvr committed
8
params.fastq = "data/fastq/*_{1,2}.fastq"
nlecouvr's avatar
nlecouvr committed
9
10

log.info "fasta file : ${params.fasta}"
nlecouvr's avatar
nlecouvr committed
11
log.info "bed file : ${params.bed}"
nlecouvr's avatar
nlecouvr committed
12
13
14
15
16
17
18
19
20
21
22
23
24

channel
  .fromPath( params.fasta )
  .ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
  .map { it -> [it.simpleName, it]}
  .set { fasta_files }

channel
  .fromPath( params.bed )
  .ifEmpty { error "Cannot find any bed files matching: ${params.bed}" }
  .map { it -> [it.simpleName, it]}
  .set { bed_files }

nlecouvr's avatar
nlecouvr committed
25
channel
nlecouvr's avatar
nlecouvr committed
26
  .fromFilePairs( params.fastq, size: -1)
nlecouvr's avatar
nlecouvr committed
27
28
  .set { fastq_files }

nlecouvr's avatar
test    
nlecouvr committed
29

nlecouvr's avatar
nlecouvr committed
30
workflow {
nlecouvr's avatar
nlecouvr committed
31
    fastp(fastq_files)
nlecouvr's avatar
nlecouvr committed
32
    fasta_from_bed(fasta_files, bed_files)
nlecouvr's avatar
nlecouvr committed
33
34
    index_fasta(fasta_from_bed.out.fasta)
    mapping_fastq(index_fasta.out.index.collect(), fastp.out.fastq)
nlecouvr's avatar
nlecouvr committed
35
}