modbamtools icon indicating copy to clipboard operation
modbamtools copied to clipboard

Clustering failure produces error message

Open rowanhowellGE opened this issue 1 year ago • 0 comments

Hi,

Sometimes when using the modbamtools plot --cluster feature (modbamtools v0.4.8), I will get an error message and no output:

  File "/opt/conda/bin/modbamtools", line 8, in <module>
    sys.exit(cli())
  File "/opt/conda/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/conda/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/conda/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/conda/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/modbamtools/cli.py", line 334, in plot
    fig = Plotter(
  File "/opt/conda/lib/python3.9/site-packages/modbamtools/modbamviz.py", line 100, in __init__
    assert self.num_tracks == len(self.titles)
AssertionError

This can be resolved by choosing a different region to attempt to cluster, so my guess would be that this occurs when multiple clusters can't be identified. I think it would be easier to interpret if this raised an informative warning, rather than this error message.

rowanhowellGE avatar Mar 21 '23 11:03 rowanhowellGE