Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better visualization management #62

Merged
merged 3 commits into from
Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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