Skip to content

Commit

Permalink
netZooM 0.5.5 (#146)
Browse files Browse the repository at this point in the history
* update test suite (#140)

* update test suite

* update test suite

* update test suite

* update test suite

* update test suite

* update test suite

* update test suite

* update test suite

* update test suite

* update test suite

* update tests

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update actions

* update ci without spider

* update ci without spider

* update ci without spider

* update ci without spider

* update ci without spider

* update ci without spider

* update ci without spider

* update ci without spider

* update ci without spider

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update workflow

* update actions

* update github

* update github

* update github

* update github

* update github

* update github

* update github

* fix spider test

* update test data with annotation in lioness

* changed test data lioness

* update test data

* update test data

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* separte process functions

* removed macos from tests

* fix savepairs (#142)

* fix savepairs

* fix savepairs

* add eye in PPI (#145)

* add eye in PPI

* update tfcoop

* add python gt data

* add labels to panda test

* expand test data
  • Loading branch information
marouenbg authored Oct 21, 2022
1 parent fd3edac commit afa8ba3
Show file tree
Hide file tree
Showing 9 changed files with 16,017 additions and 2 deletions.
2 changes: 1 addition & 1 deletion netZooM/tools/NormalizeNetwork.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
% Outputs:
% normMat: normalized adjacency matrix
% Author(s):
% Kimberley Glass
% Kimberly Glass

%compute means and stds
mu2 = mean(X,2);
Expand Down
2 changes: 1 addition & 1 deletion netZooM/tools/processData.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
%Initialize result
RegNet = zeros(NumTFs,NumGenes);
Exp = zeros(NumGenes,NumConditions);
TFCoop = zeros(NumTFs,NumTFs);
TFCoop = eye(NumTFs);
%Populate result
%Gene expression
[ig,locg]= ismember(GeneNamesExp,GeneNames);
Expand Down
83 changes: 83 additions & 0 deletions tests/testPanda.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,89 @@
initTestSuite;
end

function testPandaPantest()
% Tell if this is Octave (Unit tests) or Matlab
isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;

% Load statistics package from Octave
if isOctave
%we need the nan package because it has a fast implementation of corrcoeff
%pkg load statistics
pkg load nan;
return % readtable is not available in octave
end

% Set Program Parameters
exp_file = 'tests/test_data/pantests/expression.txt';
motif_file = 'tests/test_data/pantests/motif.txt';
ppi_file = 'tests/test_data/pantests/ppi.txt';
panda_out = ''; % optional, leave empty if file output is not required
save_temp = ''; % optional, leave empty if temp data files will not be needed afterward
lib_path = '../netZooM'; % path to the folder of PANDA source code
alpha = 0.1;
save_pairs = 0;%saving in .pairs format
modeProcess= 'legacy';

% Add path
addpath(genpath(fullfile(pwd,'tests')));

% Call Panda
tic;[AgNet,TFNames,GeneNames] = panda_run(lib_path,exp_file, motif_file, ppi_file, panda_out,...
save_temp, alpha, save_pairs, modeProcess);toc;
ExpTbl = array2table(AgNet,'RowNames',TFNames,'VariableNames',GeneNames');

% Load the expected result
filename = 'panda_pantests_gt_matlab.csv';
ExpAgNet = readtable(filename,'ReadVariableNames',1,'ReadRowNames',1,'PreserveVariableNames',1);

% Compare the outputs
tolMat =1e-6;
deltaMat=max(max(abs(ExpTbl{:,:}-ExpAgNet{:,:})));
assertTrue( deltaMat < tolMat );

end

function testPandaPythonData()
% Tell if this is Octave (Unit tests) or Matlab
isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;

% Load statistics package from Octave
if isOctave
%we need the nan package because it has a fast implementation of corrcoeff
%pkg load statistics
pkg load nan;
return % readtable is not available in octave
end

% Set Program Parameters
exp_file = 'tests/test_data/panda/ToyExpressionData.txt';
motif_file = 'tests/test_data/panda/ToyMotifData.txt';
ppi_file = 'tests/test_data/panda/ToyPPIData.txt';
panda_out = ''; % optional, leave empty if file output is not required
save_temp = ''; % optional, leave empty if temp data files will not be needed afterward
lib_path = '../netZooM'; % path to the folder of PANDA source code
alpha = 0.1;
save_pairs = 0;%saving in .pairs format
modeProcess= 'legacy';

% Add path
addpath(genpath(fullfile(pwd,'tests')));

% Call Panda
tic;[AgNet,TFNames,GeneNames] = panda_run(lib_path,exp_file, motif_file, ppi_file, panda_out,...
save_temp, alpha, save_pairs, modeProcess);toc;
ExpTbl = array2table(AgNet,'RowNames',TFNames,'VariableNames',GeneNames');

% Load the expected result
filename = 'panda_gt_matlab.csv';
ExpAgNet = readtable(filename,'ReadVariableNames',1,'ReadRowNames',1,'PreserveVariableNames',1);

% Compare the outputs
tolMat =1e-6;
deltaMat=max(max(abs(ExpTbl{:,:}-ExpAgNet{:,:})));
assertTrue( deltaMat < tolMat );
end

function testPandaSimple()
% Tell if this is Octave (Unit tests) or Matlab
isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;
Expand Down
1,000 changes: 1,000 additions & 0 deletions tests/test_data/panda/ToyExpressionData.txt

Large diffs are not rendered by default.

Loading

0 comments on commit afa8ba3

Please sign in to comment.