-
Notifications
You must be signed in to change notification settings - Fork 10
/
sc_cluster_x.m
47 lines (41 loc) · 1.35 KB
/
sc_cluster_x.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function [c] = sc_cluster_x(X, k, varargin)
%sc_cluster_x - cluster cells using UMI matrix X
%
%see also: sc_cluster_s
p = inputParser;
defaultType = 'sc3';
validTypes = {'sc3', 'simlr', 'soptsc', 'sinnlrr', 'specter'};
checkType = @(x) any(validatestring(x, validTypes));
checkK = @(x) (x > 0) && isnumeric(x) && isscalar(x);
addRequired(p, 'X', @isnumeric);
addRequired(p, 'k', checkK);
addOptional(p, 'type', defaultType, checkType);
addOptional(p, 'usehvgs', true);
parse(p, X, k, varargin{:})
if p.Results.usehvgs
disp('Using 2000 HVGs.')
[~, X] = sc_splinefit(X, [], true, false);
X = X(1:min([size(X, 1), 2000]), :);
end
switch p.Results.type
case 'simlr'
% disp('To specify k, use RUN_SIMLR(X,k).');
[c] = run.ml_SIMLR(X, k, true);
case 'soptsc'
% Symmetric NMF for cell clustering
% https://www.biorxiv.org/content/biorxiv/early/2019/01/01/168922.full.pdf
%disp('To specify k, use RUN_SOPTSC(X,''k'',k).');
[c] = run.ml_SoptSC(X, 'k', k, 'donorm', true);
case 'sc3'
%disp('To specify k, use SC_SC3(X,k).');
[c] = run.ml_SC3(X, k);
case 'sinnlrr'
% disp('To specify k, use RUN_SINNLRR(X,k).');
[c] = run.ml_SinNLRR(X, k);
case 'specter'
[c] = run.ml_Specter(X, k);
case 'alona'
warning('In development.');
% [C]=sc_alona(X);
end
end