File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
modules/local/combinebeds/filter/templates Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -98,14 +98,20 @@ def format_yaml_like(data: dict, indent: int = 0) -> str:
9898 continue
9999 memberships = series .to_list ()
100100 dataset = upsetplot .from_memberships (memberships )
101+
102+ n_combinations = 50
103+
104+ # Limit to top n_combinations largest combinations if there are more than n_combinations
105+ if len (dataset ) > n_combinations :
106+ dataset = dataset .nlargest (n_combinations )
107+
101108 upsetplot .plot (dataset ,
102109 orientation = 'horizontal' ,
103110 show_counts = True ,
104- subset_size = "count" ,
105- min_degree = 2 ,
106- min_subset_size = min (50 , int (n_bsjs * 0.02 )))
111+ subset_size = "count" )
107112 plot_file = f"{ prefix } _{ col } .upset.png"
108113 plt .savefig (plot_file )
114+ plt .close ()
109115
110116 image_string = base64 .b64encode (open (plot_file , "rb" ).read ()).decode ("utf-8" )
111117 image_html = f'<div class="mqc-custom-content-image"><img src="data:image/png;base64,{ image_string } " /></div>'
You can’t perform that action at this time.
0 commit comments