BaselAbujamous / clust

Automatic and optimised consensus clustering of one or more heterogeneous datasets
Other
161 stars 36 forks source link

Datasets with a single sample raise an exception #14

Closed BaselAbujamous closed 4 years ago

BaselAbujamous commented 5 years ago

If a dataset has a single sample only, it would not make sense to apply clustering to it. However, if clust is anyway run over such a dataset, this would be the resulting error:

/===========================================================================\ | Clust | | (Optimised consensus clustering of multiple heterogenous datasets) | | Python package version 1.8.9 (2018) Basel Abu-Jamous | +---------------------------------------------------------------------------+ | Analysis started at: Wednesday 07 November 2018 (12:22:27) | | 1. Reading dataset(s) | | 2. Data pre-processing | Traceback (most recent call last): File "/usr/local/bin/clust", line 11, in sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/clust/main.py", line 98, in main args.cs, args.np, args.optimisation, args.q3s, args.basemethods, args.deterministic) File "/usr/local/lib/python2.7/dist-packages/clust/clustpipeline.py", line 102, in clustpipeline filteringtype=filteringtype, filterflat=filflat, params=None, datafiles=datafiles) File "/usr/local/lib/python2.7/dist-packages/clust/scripts/preprocess_data.py", line 623, in preprocess Xproc[l] = fixnans(Xproc[l]) File "/usr/local/lib/python2.7/dist-packages/clust/scripts/preprocess_data.py", line 65, in fixnans sumnans = sum(isnan(Xinloc[i])) TypeError: 'bool' object is not iterable

BaselAbujamous commented 5 years ago

To be fixed in the next release, but as mentioned in the question, clustering doesn't seem to make sense on a single-sample dataset anyway.