Skip to content

Commit

Permalink
Merge pull request #62 from AndreaGuarracino/better_vis_management
Browse files Browse the repository at this point in the history
better visualization management
  • Loading branch information
subwaystation authored Mar 24, 2021
2 parents 6060af9 + 8f6d87d commit c459137
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,21 @@ process smoothxg {
"""
}

process removeConsensusPaths {
publishDir "${params.outdir}/smoothxg", mode: "${params.publish_dir_mode}"

input:
path(graph)

output:
path("${graph}.no_cons.gfa"), emit: gfa_smooth_no_cons

script:
"""
grep "Consensus_" "$graph" -v > "${graph}.no_cons.gfa"
"""
}

process odgiBuild {
publishDir "${params.outdir}/odgi_build", mode: "${params.publish_dir_mode}"

Expand Down Expand Up @@ -227,12 +242,13 @@ process odgiViz {
output:
path("${graph}.viz_mqc.png")

"""
odgi viz \
script:
"""
odgi viz \
-i $graph \
-o ${graph}.viz_mqc.png \
-x 1500 -y 500 -P 5
"""
-x 1500 -y 500 -P 10
"""
}

process odgiChop {
Expand Down Expand Up @@ -277,8 +293,8 @@ process odgiDraw {
-c $layoutGraph \
-p ${layoutGraph}.draw_mqc.png \
-C \
-w 50 \
-H 1000 -t ${task.cpus}
-w 20 \
-H 1500 -t ${task.cpus}
"""
}

Expand Down Expand Up @@ -325,16 +341,20 @@ workflow {
seqwish(fasta, wfmash.out.collect{it[1]})
}
smoothxg(seqwish.out)

removeConsensusPaths(smoothxg.out.gfa_smooth)
if (params.do_stats) {
odgiBuild(seqwish.out.collect{it[1]}.mix(smoothxg.out.gfa_smooth, smoothxg.out.consensus_smooth.flatten()))
odgiStats(odgiBuild.out)
odgiBuild(seqwish.out.collect{it[1]}.mix(removeConsensusPaths.out, smoothxg.out.consensus_smooth.flatten()))
odgiStats(odgiBuild.out)
}
else {
odgiBuild(smoothxg.out.gfa_smooth)
odgiBuild(seqwish.out.collect{it[1]}.mix(removeConsensusPaths.out, smoothxg.out.gfa_smooth))
}

odgiVizOut = Channel.empty()
removeConsensusPathsOut = Channel.empty()
if (params.do_viz) {
odgiVizOut = odgiViz(odgiBuild.out.filter(~".*smooth.*"))
odgiVizOut = odgiViz(odgiBuild.out)
}
odgiDrawOut = Channel.empty()
if (params.do_layout) {
Expand Down

0 comments on commit c459137

Please sign in to comment.