File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,21 @@ def compute_score(
167
167
)
168
168
print ("First 3 cells: %s" % (str (list (adata .obs_names [:3 ]))))
169
169
print ("First 5 genes: %s" % (str (list (adata .var_names [:5 ]))))
170
+ if ADJ_PROP is not None :
171
+ err_msg = "'adj_prop'=%s not in 'adata.obs.columns'" % ADJ_PROP
172
+ assert ADJ_PROP in adata .obs , err_msg
173
+ temp_df = adata .obs [[ADJ_PROP ]].groupby (ADJ_PROP ).agg ({ADJ_PROP : len })
174
+ temp_df .columns = ["n" ]
175
+ temp_df .sort_values (by = "n" , ascending = False , inplace = True )
176
+ print ("--adj-prop: %d categories" % temp_df .shape [0 ])
177
+ msg = ", " .join (
178
+ ["%s (%d)" % (x , temp_df .loc [x , "n" ]) for x in temp_df .index [:3 ]]
179
+ )
180
+ print ("Top 3: %s" % msg )
181
+ msg = ", " .join (
182
+ ["%s (%d)" % (x , temp_df .loc [x , "n" ]) for x in temp_df .index [- 3 :]]
183
+ )
184
+ print ("Bottom 3: %s" % msg )
170
185
171
186
# Load .cov file
172
187
if COV_FILE is not None :
You can’t perform that action at this time.
0 commit comments