Skip to content

Commit

Permalink
workflow: control breakpoint plotting by clusters file
Browse files Browse the repository at this point in the history
  • Loading branch information
Katherine Eaton committed Aug 3, 2022
1 parent 0d4b50a commit cf613c3
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ rule issues_download:
"""
python3 scripts/download_issues.py --breakpoints {input.breakpoints} 1> {output.issues} 2> {log};
csvtk cut -t -f "issue,lineage" {output.issues} | tail -n+2 1> {output.issue_to_lineage} 2>> {log};
python3 scripts/plot_breakpoints.py --lineages {input.breakpoints} --outdir {params.outdir} >> {log} 2>&1;
python3 scripts/plot_breakpoints.py --lineages {input.breakpoints} --outdir {params.outdir} --autoscale >> {log} 2>&1;
"""

# -----------------------------------------------------------------------------#
Expand Down Expand Up @@ -1123,30 +1123,29 @@ rule plot:
{params.singletons} \
> {log} 2>&1;
# Extract the cluster IDs to be plotted
cluster_ids=$(csvtk headers -t {output.plots}/cluster_id.tsv | tail -n+2 | tr "\\n" "," | sed 's/,$/\\n/g')
# Plot breakpoints by clade
python3 scripts/plot_breakpoints.py \
--lineages {input.lineages} \
--positives {input.positives} \
--outdir {params.outdir} \
--parent-col parents_clade \
--parent-type clade \
--cluster-col cluster_id \
{params.weeks} \
{params.min_date} \
{params.max_date} \
{params.singletons} \
--clusters "${{cluster_ids}}" \
>> {log} 2>&1;
# Plot breakpoints by lineage
python3 scripts/plot_breakpoints.py \
--lineages {input.lineages} \
--positives {input.positives} \
--outdir {params.outdir} \
--parent-col parents_lineage \
--parent-type lineage \
--cluster-col cluster_id \
{params.weeks} \
{params.min_date} \
{params.max_date} \
{params.singletons} \
--clusters "${{cluster_ids}}" \
>> {log} 2>&1;
"""

Expand Down Expand Up @@ -1189,10 +1188,26 @@ rule plot_historical:
> {log} 2>&1;
# Plot breakpoints by clade
python3 scripts/plot_breakpoints.py --lineages {input.lineages} --outdir {params.outdir} --parent-col parents_clade --parent-type clade --cluster-col cluster_id >> {log} 2>&1;
python3 scripts/plot_breakpoints.py \
--lineages {input.lineages} \
--positives {input.positives} \
--outdir {params.outdir} \
--parent-col parents_clade \
--parent-type clade \
--cluster-col cluster_id \
--autoscale \
>> {log} 2>&1;
# Plot breakpoints by lineage
python3 scripts/plot_breakpoints.py --lineages {input.lineages} --outdir {params.outdir} --parent-col parents_lineage --parent-type lineage --cluster-col cluster_id >> {log} 2>&1;
python3 scripts/plot_breakpoints.py \
--lineages {input.lineages} \
--positives {input.positives} \
--outdir {params.outdir} \
--parent-col parents_lineage \
--parent-type lineage \
--cluster-col cluster_id \
--autoscale \
>> {log} 2>&1;
"""

# -----------------------------------------------------------------------------#
Expand Down

0 comments on commit cf613c3

Please sign in to comment.