-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscrna_seq.nf
91 lines (72 loc) · 2.33 KB
/
scrna_seq.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/ nextflow
nextflow.enable.dsl=1
/*
========================================================================================
QC Report Generator Nextflow Workflow
========================================================================================
Github :
Contact :
----------------------------------------------------------------------------------------
*/
Channel
.fromPath( params.samples_csv )
.splitCsv( header: true, sep: ',' )
.map { row -> row.sample_id }
.set { sample_id_ch }
(sample) = sample_id_ch.into(1)
println """\
RNA Seq - N F P I P E L I N E
===================================
Experiment : ${params.experiment_id}
Samplesheet : ${params.in_key}
CellBender Directory : ${params.cellbender_dir}
QC Report input directory : ${params.qc_in_dir}
QC Report Output directory: ${params.qc_output}
"""
.stripIndent()
process QC_Summary {
publishDir (
path: "${params.outdir}",
mode: 'copy',
overwrite: 'true',
)
input:
each sample
output:
path("${sample}.h5") into qc_summary
script:
"""
Rscript ${baseDir}/scripts/rna_seq_pipeline_bwh/tenx_metadata_rna_adder.r \
-i ${params.cellrangers_outs_dir}/${sample}/outs/filtered_feature_bc_matrix.h5 \
-l ${params.cellrangers_outs_dir}/${sample}/outs/molecule_info.h5 \
-s ${params.cellrangers_outs_dir}/${sample}/outs/metrics_summary.csv \
-k ${params.in_key} \
-j ${sample} \
"""
}
process QC_Report {
publishDir params.qc_output // output dir
input:
file(qc_sum) from qc_summary.collect()
output:
script:
"""
Rscript ${baseDir}/scripts/qcreporter/qc_batch_summary.r \
-e ${params.experiment_id} \
-m "snrna" \
-i ${params.qc_in_dir} \
-z ${params.cellbender_dir} \
-f ${params.refdir} \
-k ${params.in_key} \
-d ${params.qc_output} \
-o ${params.qc_output}/${params.experiment_id}_rnaseq_sample_report.html \
-l "Homo Sapiens" \
-a ${params.percent_ribo} \
-j ${params.resolution} \
-b ${params.filter_MALAT} \
-c ${params.percent_mito} \
-u ${params.filter_MITO} \
-q ${params.filter_RIBO} \
-s 4
"""
}