|
1 |
| -function dataRecovered = scrabble(data,parameter,nIter) |
| 1 | +function dataRecovered = scrabble(data,parameter,nIter,nIter_inner,error_inner_threshold,error_outer_threshold) |
2 | 2 |
|
3 | 3 | %% DESCRIPTION
|
4 | 4 | % SCRABBLE: scrabble is used to impute the scRNAseq combining with
|
|
23 | 23 | % input data matrix.
|
24 | 24 | %
|
25 | 25 | % nIter: nIter is the maximal number of iterations. The recommmdation times of
|
26 |
| -% iteration are 100. |
| 26 | +% iteration are 20. |
27 | 27 |
|
28 | 28 | % AUTHOR: Tao Peng
|
29 | 29 | % Email: pengt@email.chop.edu
|
30 | 30 |
|
31 | 31 | %% Main Codes
|
32 | 32 | % Check the inputs of SCRABBLE
|
33 |
| -if nargin < 3 |
| 33 | +if nargin < 2 |
34 | 34 | disp('The inputs of SCRABBLE are not enough. Please check your input.')
|
35 | 35 | return;
|
36 | 36 | end
|
37 | 37 |
|
| 38 | +if nargin == 2 |
| 39 | + nIter = 20; |
| 40 | + nIter_inner = 20; % the maximum iteration times in the inner optimization |
| 41 | + error_inner_threshold = 1e-4; % set up the threshold for the inner loop |
| 42 | + error_outer_threshold = 1e-4; % set up the threshold for the outer loop |
| 43 | +end |
| 44 | + |
| 45 | +if nargin == 3 |
| 46 | + nIter_inner = 20; % the maximum iteration times in the inner optimization |
| 47 | + error_inner_threshold = 1e-4; % set up the threshold for the inner loop |
| 48 | + error_outer_threshold = 1e-4; % set up the threshold for the outer loop |
| 49 | +end |
| 50 | + |
| 51 | + |
| 52 | +if nargin == 4 |
| 53 | + error_inner_threshold = 1e-4; % set up the threshold for the inner loop |
| 54 | + error_outer_threshold = 1e-4; % set up the threshold for the outer loop |
| 55 | +end |
| 56 | + |
| 57 | +if nargin == 5 |
| 58 | + error_outer_threshold = 1e-4; % set up the threshold for the outer loop |
| 59 | +end |
| 60 | + |
38 | 61 | % Determine if the data is consistent or not.
|
39 | 62 | if ~isempty(data.data_sc) && ~isempty(data.data_bulk)
|
40 | 63 | disp('The scRNAseq data and bulk RNAseq data is loaded.')
|
|
50 | 73 | zones = (Y > 0); % calculate the projection operator
|
51 | 74 | alpha = parameter(1); % define the weight of rank
|
52 | 75 | beta = parameter(2); % define the weight of consistency of bulk RNAseq
|
53 |
| -gamma = 1e-3*parameter(1); % define the regularization coefficient |
| 76 | +gamma = parameter(3); % define the regularization coefficient |
54 | 77 |
|
55 | 78 | % generate the bulk RNAseq.
|
56 | 79 | % Here we consider two cases. One is the input including the bulk RNAseq
|
|
83 | 106 | % Since we save the time of optimization, we found that the 2 can get good
|
84 | 107 | % performance. If we could not get good performance, we could increase the
|
85 | 108 | % iteration times here.
|
86 |
| -nIter_inner = 10; % the maximum iteration times in the inner optimization |
87 |
| -error_inner_threshold = 1e-6; % set up the threshold for the inner loop |
88 |
| -error_outer_threshold = 1e-7; % set up the threshold for the outer loop |
| 109 | + |
89 | 110 | gamma = double(gamma); % make the scalar double
|
90 | 111 | Y = double(Y); % make the matrix double
|
91 | 112 | B = double(B); % make the matrix double
|
|
0 commit comments