forked from shiquan/PISA
/
scLFR_evalue5.wdl
125 lines (125 loc) · 3.93 KB
/
scLFR_evalue5.wdl
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
workflow main {
String root
String LFR_fastq1
String LFR_fastq2
String fastq1
String fastq2
String outdir
String iDrop_3_config
String beads_config
String cell_umi_config
String refdir
String hisat
String sambamba
String gtf
call makedir {
input:
outdir = outdir
}
call parse_fastq_3end {
input:
fastq1=fastq1,
fastq2=fastq2,
config=iDrop_3_config,
root = root,
outdir = makedir.out,
refdir = refdir,
hisat = hisat,
sambamba = sambamba,
gtf = gtf
}
call parse_lfr {
input:
fastq1 = LFR_fastq1,
fastq2 = LFR_fastq2,
config = beads_config,
segment_config = cell_umi_config,
root = root,
outdir = makedir.out,
refdir = refdir,
hisat = hisat,
sambamba = sambamba,
gtf = gtf
}
call merge {
input:
iDrop_bam = parse_fastq_3end.bam,
LFR_bam = parse_lfr.bam,
sambamba = sambamba,
root = root,
outdir = outdir,
}
}
task makedir {
String outdir
command {
echo "[`date +%F` `date +%T`] workflow start" > ${outdir}/workflowtime.log
mkdir -p ${outdir}
mkdir -p ${outdir}/iDrop
mkdir -p ${outdir}/scLFR
mkdir -p ${outdir}/outs
}
output {
String out = "${outdir}"
}
}
task parse_fastq_3end {
String fastq1
String fastq2
String config
String root
String outdir
String refdir
String hisat
String sambamba
String gtf
command {
${root}/PISA parse -t 15 -f -q 20 -dropN -config ${config} -cbdis ${outdir}/iDrop/barcode_counts_raw.txt -report ${outdir}/iDrop/sequencing_report.csv ${fastq1} ${fastq2} > ${outdir}/iDrop/reads.fq
${hisat} -p 20 -x ${refdir} -q ${outdir}/iDrop/reads.fq | ${root}/PISA sam2bam -o ${outdir}/iDrop/aln.bam /dev/stdin
${sambamba} sort -t 20 -o ${outdir}/iDrop/sorted.bam ${outdir}/iDrop/aln.bam
${root}/PISA anno -gtf ${gtf} -o ${outdir}/iDrop/annotated.bam ${outdir}/iDrop/sorted.bam 2>>${outdir}/workflowtime.log
${sambamba} index ${outdir}/iDrop/annotated.bam
echo "[`date +%F` `date +%T`] iDrop workflow finished" >> ${outdir}/workflowtime.log
}
output {
String bam = "${outdir}/iDrop/annotated.bam"
}
}
task parse_lfr {
String fastq1
String fastq2
String config
String segment_config
String root
String outdir
String refdir
String hisat
String sambamba
String gtf
command {
${root}/PISA parse -t 15 -q 20 -dropN -config ${config} -cbdis ${outdir}/scLFR/beads_barcode_dis.txt -report ${outdir}/scLFR/beads_report.csv ${fastq1} ${fastq2} > ${outdir}/scLFR/read.fq 2>> ${outdir}/workflowtime.log
${root}/PISA fsort -dedup -t 10 -tag LB -p ${outdir}/scLFR/read.fq > ${outdir}/scLFR/sorted.fq 2>> ${outdir}/workflowtime.log
${root}/cleanup -t 10 ${outdir}/scLFR/sorted.fq > ${outdir}/scLFR/cleanup.fq 2>> ${outdir}/workflowtime.log
${root}/PISA unitig -t 20 -tag LB ${outdir}/scLFR/cleanup.fq > ${outdir}/scLFR/unitig.fq 2>> ${outdir}/workflowtime.log
${root}/PISA segment -config ${segment_config} -k -tag LB ${outdir}/scLFR/unitig.fq > ${outdir}/scLFR/parsed_reads.fa 2>> ${outdir}/workflowtime.log
${hisat} -p 20 -x ${refdir} -f ${outdir}/scLFR/parsed_reads.fa | ${root}/PISA sam2bam -o ${outdir}/scLFR/aln.bam -k /dev/stdin
${sambamba} sort -t 20 -o ${outdir}/scLFR/sorted.bam ${outdir}/scLFR/aln.bam
${root}/PISA anno -gtf ${gtf} -ignore-strand -splice-consider -t 20 -o ${outdir}/scLFR/annotated.bam ${outdir}/scLFR/sorted.bam 2>>${outdir}/workflowtime.log
${sambamba} index ${outdir}/scLFR/annotated.bam
}
output {
String bam="${outdir}/scLFR/annotated.bam"
}
}
task merge {
String iDrop_bam
String LFR_bam
String root
String outdir
String sambamba
command {
${sambamba} merge -o ${outdir}/outs/merged.bam ${iDrop_bam} ${LFR_bam}
${root}/PISA corr -tag UB -tags GN -@ 5 -t 20 -o ${outdir}/outs/UMI_corrected.bam ${outdir}/outs/merged.bam
${root}/PISA impute -impute CB,UB -tags LB,GN -t 20 -o ${outdir}/outs/final.bam ${outdir}/outs/imputed_CB.bam
}
}