psathyrella / partis

B- and T-cell receptor sequence annotation, simulation, clonal family and germline inference, and affinity prediction
GNU General Public License v3.0
57 stars 34 forks source link

Crash when running plot-partitions on output of partis partition run. #301

Closed wfs-lilly closed 4 years ago

wfs-lilly commented 5 years ago
Singularity partis_latest.sif:~/v5x3838/linearham> /partis/bin/partis plot-partitions --outfname ./TSPN-m6-dedup2.part.yaml --cluster-indices 0:10 --plotdir ./plots
  plotting partitions
Traceback (most recent call last):
  File "/partis/bin/partis", line 472, in <module>
    args.func(args)
  File "/partis/bin/partis", line 217, in run_partitiondriver
    parter.run(actions)
  File "/partis/python/partitiondriver.py", line 120, in run
    self.action_fcns[tmpaction]()
  File "/partis/python/partitiondriver.py", line 484, in read_existing_output
    partplotter.plot(self.args.plotdir + '/partitions', partition=cpath.partitions[cpath.i_best], annotations=annotation_dict, reco_info=self.reco_info, cpath=cpath)
  File "/partis/python/partitionplotter.py", line 483, in plot
    fnames += self.make_shm_vs_cluster_size_plots(sorted_clusters, annotations, plotdir)
  File "/partis/python/partitionplotter.py", line 202, in make_shm_vs_cluster_size_plots
    self.plotting.make_single_joyplot(high_mutation_clusters, annotations, repertoire_size, plotdir, get_fname(high_mutation=True), plot_high_x=True, cluster_indices=cluster_indices, title='families with mean > %d mutations' % self.n_max_mutations, high_x_val=self.n_max_mutations, queries_to_include=self.args.queries_to_include, debug=debug)
  File "/partis/python/plotting.py", line 1243, in make_single_joyplot
    xbounds = {x1key : getbounds(x1key)}  # these are the smallest/largest x values in any of <sorted_clusters>, whereas <high_x_val> is a fixed calling-fcn-specified value that may be more or less (kind of wasteful to get all the x vals here and then also in the main loop)
  File "/partis/python/plotting.py", line 1156, in getbounds
    bounds = [f(all_xvals) for f in [min, max]]
ValueError: min() arg is an empty sequence
Singularity partis_latest.sif:~/v5x3838/linearham> /partis/bin/partis plot-partitions --outfname ./TSPN-m6-dedup2.part.yaml --plotdir ./plots
  plotting partitions
Traceback (most recent call last):
  File "/partis/bin/partis", line 472, in <module>
    args.func(args)
  File "/partis/bin/partis", line 217, in run_partitiondriver
    parter.run(actions)
  File "/partis/python/partitiondriver.py", line 120, in run
    self.action_fcns[tmpaction]()
  File "/partis/python/partitiondriver.py", line 484, in read_existing_output
    partplotter.plot(self.args.plotdir + '/partitions', partition=cpath.partitions[cpath.i_best], annotations=annotation_dict, reco_info=self.reco_info, cpath=cpath)
  File "/partis/python/partitionplotter.py", line 483, in plot
    fnames += self.make_shm_vs_cluster_size_plots(sorted_clusters, annotations, plotdir)
  File "/partis/python/partitionplotter.py", line 202, in make_shm_vs_cluster_size_plots
    self.plotting.make_single_joyplot(high_mutation_clusters, annotations, repertoire_size, plotdir, get_fname(high_mutation=True), plot_high_x=True, cluster_indices=cluster_indices, title='families with mean > %d mutations' % self.n_max_mutations, high_x_val=self.n_max_mutations, queries_to_include=self.args.queries_to_include, debug=debug)
  File "/partis/python/plotting.py", line 1243, in make_single_joyplot
    xbounds = {x1key : getbounds(x1key)}  # these are the smallest/largest x values in any of <sorted_clusters>, whereas <high_x_val> is a fixed calling-fcn-specified value that may be more or less (kind of wasteful to get all the x vals here and then also in the main loop)
  File "/partis/python/plotting.py", line 1156, in getbounds
    bounds = [f(all_xvals) for f in [min, max]]
ValueError: min() arg is an empty sequence

[edited to add code quoting by DR]

psathyrella commented 5 years ago

Yep, nice find, just pushed a fix.

p.s. sorry for all the crashes... I promise it's largely the result of running fairly uncommon options. Either way we very much appreciate the destructive testing.

p.p.s. let me know if you have any suggestions on the partition plots, I don't know of anyone else using them, so it'd be good to know if anything is confusing to people that aren't me.