-
Notifications
You must be signed in to change notification settings - Fork 5
/
runassemblyvisualizer.nf
50 lines (39 loc) · 1.85 KB
/
runassemblyvisualizer.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
process RUNASSEMBLYVISUALIZER {
tag "$sample_id_on_tag"
label 'process_single'
container "docker.io/gallvp/3d-dna:63029aa"
input:
tuple val(sample_id_on_tag), path(agp_assembly_file), path(sorted_links_txt_file)
output:
tuple val(sample_id_on_tag), path("*.hic") , emit: hic
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
if ( !task.memory ) { error '[RUNASSEMBLYVISUALIZER] Available memory not known. Specify process memory requirements to fix this.' }
def avail_mem = (task.memory.giga*0.8).intValue()
"""
assembly_tag=\$(echo $sample_id_on_tag | sed 's/.*\\.on\\.//g')
file_name="${agp_assembly_file}"
mkdir user_home
export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=user_prefs -Duser.home=user_home -Xms${avail_mem}g -Xmx${avail_mem}g"
/usr/src/3d-dna/visualize/run-assembly-visualizer.sh \\
-p false \\
$agp_assembly_file $sorted_links_txt_file
mv "\${file_name%.*}.hic" "\${assembly_tag}.hic"
cat <<-END_VERSIONS > versions.yml
"${task.process}":
run-assembly-visualizer.sh: \$(/usr/src/3d-dna/visualize/run-assembly-visualizer.sh -h | sed -n '/Visualizing draft genomes in juicebox:/ s/Visualizing draft genomes in juicebox: //p')
END_VERSIONS
"""
stub:
if ( !task.memory ) { error '[RUNASSEMBLYVISUALIZER] Available memory not known. Specify process memory requirements to fix this.' }
"""
assembly_tag=\$(echo $sample_id_on_tag | sed 's/.*\\.on\\.//g')
touch "\${assembly_tag}.hic"
cat <<-END_VERSIONS > versions.yml
"${task.process}":
run-assembly-visualizer.sh: \$(/usr/src/3d-dna/visualize/run-assembly-visualizer.sh -h | sed -n '/Visualizing draft genomes in juicebox:/ s/Visualizing draft genomes in juicebox: //p')
END_VERSIONS
"""
}