(resolves skip plotting for failed decompositions
@@ -599,7 +599,13 @@ def compcor_variance_plot(metadata_files, metadata_sources=None,
'alpha': 0.8
}
- decompositions = list(metadata.groupby(['source', 'mask']).groups.keys())
+ decompositions = []
+ data_sources = list(metadata.groupby(['source', 'mask']).groups.keys())
+ for source, mask in data_sources:
+ if not np.isnan(metadata.loc[
+ (metadata['source'] == source) & (metadata['mask'] == mask)
+ ]['singular_value'].values[0]):
+ decompositions.append((source, mask))
if fig is not None:
ax = [fig.add_subplot(1, len(decompositions), i+1)
