Skip to content

Commit

Permalink
added new consensus identity mini alignment function
Browse files Browse the repository at this point in the history
  • Loading branch information
KatyBrown committed May 14, 2024
1 parent 5aff1a6 commit 752c415
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CIAlign/argP.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ def getParser():
rows which have been removed by each function marked \
up in corresponding colours. Default: %(default)s")

optional.add("--plot_consensus_identity", dest="plot_consensus_identity",
action="store_true",
help="""Plot a mini alignment showing positions which are \
identical to or differ from the consensus. \
Default: %(default)s""")

optional.add("--plot_dpi", dest="plot_dpi",
type=int, default=300, metavar="(int)",
help="DPI for mini alignments. Default: %(default)s")
Expand Down
15 changes: 15 additions & 0 deletions CIAlign/runCIAlign.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def whichFunctions(args):
if any([args.plot_input,
args.plot_output,
args.plot_markup,
args.plot_consensus_identity,
args.visualise,
args.all_options]):
which_functions.append("mini_alignments")
Expand Down Expand Up @@ -884,6 +885,20 @@ def runMiniAlignments(args, log, orig_arr, orig_nams, arr, nams,
markupdict=markupdict,
force_numbers=fn,
palette=args.palette)
if args.plot_consensus_identity:
log.info("Plotting identity to consensus")
if not args.silent:
print("Plotting identity to consensus")
outf = "%s_consensus_identity.%s" % (args.outfile_stem,
args.plot_format)
miniAlignments.drawMiniAlignment(arr, nams, log,
outf, typ,
plot_type='boolean',
dpi=args.plot_dpi,
width=args.plot_width,
height=args.plot_height,
force_numbers=fn,
palette=args.palette)


def runConsensus(args, log, orig_arr, orig_nams, arr, nams, removed_seqs):
Expand Down

0 comments on commit 752c415

Please sign in to comment.