├── BNNR.m ├── Datasets ├── Cdataset.mat ├── DNdataset.mat ├── Datasets description.txt └── Fdataset.mat ├── Demo.m ├── README.md └── svt.m /BNNR.m: -------------------------------------------------------------------------------- 1 | function [T_recovery, iter] = BNNR(alpha, beta, T, trIndex, tol1, tol2, maxiter, a, b) 2 | %% BNNR: Drug repositioning based on bounded nuclear norm regularization. 3 | % Usage: [T_recovery, iter] = BNNR(alpha, beta, T, trIndex, tol1, tol2, maxiter, a, b) 4 | % 5 | % Inputs: 6 | % alpha, beta - parameters needed to give. 7 | % T - the target matrix with only known entries and the unobserved entries are 0. 8 | % trIndex - a matrix recording the observed positions in the target matrix. 9 | % tol1, tol2 - tolerance of termination conditions. 10 | % maxiter - maximum number of iterations. 11 | % a, b - the left and right endpoints of the bounded interval. 12 | % 13 | % Outputs: 14 | % T_recovery - the completed matrix. 15 | % iter - the number of iterations. 16 | % 17 | % Written by: Mengyun Yang 18 | % Email: mengyunyang@csu.edu.cn 19 | % Created: January 16, 2019 20 | 21 | X = T; 22 | W = X; 23 | Y = X; 24 | 25 | i = 1; 26 | stop1 = 1; 27 | stop2 = 1; 28 | while(stop1 > tol1 || stop2 > tol2) 29 | 30 | %the process of computing W 31 | tran = (1/beta) * (Y + alpha * (T.* trIndex)) + X; 32 | W = tran - (alpha/ (alpha + beta)) * (tran.* trIndex); 33 | W(W < a) = a; 34 | W(W > b) = b; 35 | 36 | %the process of computing X 37 | X_1 = svt(W- 1/beta* Y, 1/beta); 38 | 39 | %the process of computing Y 40 | Y = Y + beta * (X_1 - W); 41 | 42 | stop1_0 = stop1; 43 | stop1 = norm(X_1 - X, 'fro') / norm(X, 'fro'); 44 | stop2 = abs(stop1 - stop1_0)/ max(1, abs(stop1_0)); 45 | 46 | X = X_1; 47 | i = i+1; 48 | 49 | if i < maxiter 50 | iter = i - 1; 51 | else 52 | iter = maxiter; 53 | warning('reach maximum iteration~~do not converge!!!'); 54 | break 55 | end 56 | 57 | end 58 | 59 | T_recovery = W; 60 | 61 | end 62 | -------------------------------------------------------------------------------- /Datasets/Cdataset.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioinformaticsCSU/BNNR/68f8e98c02459189b6eeac68a86306ccc1da0374/Datasets/Cdataset.mat -------------------------------------------------------------------------------- /Datasets/DNdataset.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioinformaticsCSU/BNNR/68f8e98c02459189b6eeac68a86306ccc1da0374/Datasets/DNdataset.mat -------------------------------------------------------------------------------- /Datasets/Datasets description.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioinformaticsCSU/BNNR/68f8e98c02459189b6eeac68a86306ccc1da0374/Datasets/Datasets description.txt -------------------------------------------------------------------------------- /Datasets/Fdataset.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioinformaticsCSU/BNNR/68f8e98c02459189b6eeac68a86306ccc1da0374/Datasets/Fdataset.mat -------------------------------------------------------------------------------- /Demo.m: -------------------------------------------------------------------------------- 1 | clear all 2 | addpath('Datasets'); 3 | %% 1. Load Datesets 4 | load Fdataset 5 | Wrr = drug; 6 | Wdd = disease; 7 | Wdr = didr; 8 | Wrd = Wdr'; 9 | [dn,dr] = size(Wdr); 10 | 11 | %% 2. BNNR algorithm 12 | maxiter = 300; 13 | alpha = 1; 14 | beta = 10; 15 | tol1 = 2*1e-3; 16 | tol2 = 1*1e-5; 17 | T = [Wrr, Wdr'; Wdr, Wdd]; 18 | [t1, t2] = size(T); 19 | trIndex = double(T ~= 0); 20 | [WW,iter] = BNNR(alpha, beta, T, trIndex, tol1, tol2, maxiter, 0, 1); 21 | M_recovery = WW((t1-dn+1) : t1, 1 : dr); 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BNNR 2 | BNNR is a novel computational method, which utilizes Bounded Nuclear Norm Regularization algorithm to identify potential novel indications for known or new drugs. The code in this package implements Bounded Nuclear Norm Regularization (BNNR) for drug repositioning, which is implemented in Matlab2014a. 3 | 4 | This work has been presented in ISMB/ECCB 2019 conference in an oral talk during July 21-25, Basel, Switzerland. 5 | 6 | # Description 7 | "Demo.m" demonstrates the experimental result on Fdataset by BNNR. 8 | 9 | "BNNR.m" is the function of BNNR algorithm. 10 | 11 | "svt.m" is the function of singular value thresholding operator. 12 | 13 | Contact: 14 | If you have any questions or suggestions with the code, please let us know. Contact Mengyun Yang at mengyun_yang@126.com 15 | 16 | # Citation 17 | Yang M, Luo H, Li Y, et al. Drug repositioning based on bounded nuclear norm regularization[J]. Bioinformatics, 2019, 35(14): i455-i463. 18 | ``` 19 | @article{Yang2019Drug, 20 | title={Drug repositioning based on bounded nuclear norm regularization}, 21 | author={Yang, Mengyun and Luo, Huimin and Li, Yaohang and Wang, Jianxin}, 22 | volume={35}, 23 | number={14}, 24 | pages={i455--i463}, 25 | year={2019}, 26 | publisher={Oxford University Press} 27 | } 28 | ``` 29 | -------------------------------------------------------------------------------- /svt.m: -------------------------------------------------------------------------------- 1 | function E = svt(Y,x) 2 | %% SVT: singular value thresholding operator for matrix Y by thretholding parameter x 3 | [S, V, D] = svd(Y,'econ'); 4 | v = diag(V); 5 | [V_row, V_col] = size(V); 6 | x = x * ones(size(v)); 7 | v_new = zeros(size(v)); 8 | nonZero = v > x; 9 | v_new(nonZero) = v(nonZero) - x(nonZero); 10 | if V_row < V_col 11 | E = S * [diag(v_new), zeros(V_row, V_col-V_row)] * D'; 12 | else E = S * [diag(v_new); zeros(V_row-V_col, V_col)] * D'; 13 | end --------------------------------------------------------------------------------