Skip to content

Commit

Permalink
Remove problematic indexing (args.method is a string, not list)
Browse files Browse the repository at this point in the history
  • Loading branch information
baileythegreen committed Jun 17, 2022
1 parent 7255824 commit 1acbdca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pyani/scripts/subcommands/subcmd_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def write_distribution(
for fmt in outfmts:
outfname = Path(args.outdir) / f"distribution_{matdata.name}_run{run_id}.{fmt}"
logger.debug("\tWriting graphics to %s", outfname)
DISTMETHODS[args.method[0]](
DISTMETHODS[args.method](
matdata.data,
outfname,
matdata.name,
Expand Down Expand Up @@ -227,12 +227,13 @@ def write_heatmap(
logger.info("Writing %s matrix heatmaps", matdata.name)
cmap = pyani_config.get_colormap(matdata.data, matdata.name)
for fmt in outfmts:
outfname = Path(args.outdir) / f"matrix_{matdata.name}_run{run_id}.{fmt}"
outfname = (
Path(args.outdir) / f"matrix_{matdata.name}_run{run_id}_{args.method}.{fmt}"
)
logger.debug("\tWriting graphics to %s", outfname)
params = pyani_graphics.Params(cmap, result_labels, result_classes)
# Draw heatmap
_, newicks = GMETHODS[args.method](

matdata.data,
outfname,
title=f"matrix_{matdata.name}_run{run_id}",
Expand Down Expand Up @@ -281,7 +282,7 @@ def write_scatter(
logger.debug("\tWriting graphics to %s", outfname)
params = pyani_graphics.Params(cmap, result_labels, result_classes)
# Draw scatterplot
SMETHODS[args.method[0]](
SMETHODS[args.method](
matdata1.data,
matdata2.data,
outfname,
Expand Down

0 comments on commit 1acbdca

Please sign in to comment.