forked from gencorefacility/GENEFLOW
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasecall.nf
More file actions
58 lines (46 loc) · 1.58 KB
/
basecall.nf
File metadata and controls
58 lines (46 loc) · 1.58 KB
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
process BASECALL {
publishDir "${params.alpha}/logs/${params.fcid}/basecall/${lane}", mode:'copy', failOnError: true, pattern: '.command.*'
tag "${params.fcid}"
module params.PICARD_MODULE
module params.JDK_MODULE
input:
val lane
output:
val(lane), emit: lane
path(".command.*")
shell:
'''
read_structure=$(python3 -c "
import xml.dom.minidom
read_structure = ''
runinfo = xml.dom.minidom.parse('!{params.run_dir_path}/RunInfo.xml')
nibbles = runinfo.getElementsByTagName('Read')
for nib in nibbles:
read_structure += nib.attributes['NumCycles'].value + 'T'
print(read_structure)
")
run_barcode=$(python3 -c "
print('!{params.run_dir_path}'.split('_')[-2].lstrip('0'))
")
out_path="!{params.alpha}/lane/!{params.fcid}/!{lane}"
mkdir -p $out_path
tmp_work_dir="!{params.tmp_dir}!{params.fcid}/!{lane}"
mkdir -p $tmp_work_dir
java -jar -Xmx58g $PICARD_JAR IlluminaBasecallsToFastq \
LANE=!{lane} \
READ_STRUCTURE=${read_structure} \
BASECALLS_DIR=!{params.run_dir_path}/Data/Intensities/BaseCalls \
OUTPUT_PREFIX=${out_path}/!{params.fcid}_l0!{lane} \
RUN_BARCODE=${run_barcode} \
MACHINE_NAME=!{params.seq_id} \
FLOWCELL_BARCODE=!{params.fcid} \
NUM_PROCESSORS=!{task.cpus} \
APPLY_EAMSS_FILTER=false \
INCLUDE_NON_PF_READS=false \
MAX_READS_IN_RAM_PER_TILE=200000 \
MINIMUM_QUALITY=2 \
COMPRESS_OUTPUTS=true \
TMP_DIR=${tmp_work_dir}
rm -rf ${tmp_work_dir}
'''
}