Skip to content

Commit 4561080

Browse files
authored
update test suite (#140) (#141)
-update test suite
1 parent be68027 commit 4561080

22 files changed

+258
-13626
lines changed

.github/workflows/main.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
#
6+
# See https://github.com/r-lib/actions/tree/master/examples#readme for
7+
# additional example workflows available for the R community.
8+
9+
name: netZooM
10+
11+
env:
12+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
13+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
14+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
15+
16+
on:
17+
push:
18+
branches:
19+
- master
20+
- devel
21+
pull_request:
22+
branches:
23+
- master
24+
- devel
25+
26+
jobs:
27+
build:
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
matrix:
31+
os: [ubuntu-latest]
32+
33+
steps:
34+
35+
- uses: actions/checkout@v2
36+
with:
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
- name: Set up MATLAB
39+
uses: matlab-actions/setup-matlab@v1
40+
41+
- name: install bedtools ubuntu
42+
if: matrix.os == 'ubuntu-latest'
43+
run: |
44+
wget https://github.com/arq5x/bedtools2/releases/download/v2.29.0/bedtools-2.29.0.tar.gz
45+
tar -zxvf bedtools-2.29.0.tar.gz
46+
cd bedtools2
47+
make
48+
ls
49+
pwd
50+
cd ..
51+
52+
- name: install bedtools macos
53+
if: matrix.os == 'macos-latest'
54+
run: |
55+
wget https://github.com/marouenbg/bedtools2/archive/refs/heads/master.zip
56+
unzip master.zip
57+
mv bedtools2-master bedtools2
58+
cd bedtools2
59+
make
60+
ls
61+
pwd
62+
cd ..
63+
64+
- name: Run tests and generate artifacts
65+
run: |
66+
ls && pwd
67+
cd ..
68+
git clone https://github.com/MOxUnit/MOxUnit.git # Install MOxUnit, which adds itself to the startup path
69+
git clone https://github.com/MOcov/MOcov.git
70+
pwd
71+
ls
72+
shell: bash
73+
74+
- name: run actual tests
75+
run: |
76+
matlab -batch 'cd ../MOcov;addpath(genpath(pwd));cd ../netZooM;addpath(genpath("/home/runner/work/netZooM/"));back=cd("../MOxUnit/MOxUnit/"); moxunit_set_path(); cd(back); pwd; ls; moxunit_runtests tests -recursive -verbose -junit_xml_file testresults.xml -with_coverage -cover netZooM -cover_exclude tests -cover_xml_file coverage.xml -cover_json_file coveralls.json); exit(double(~ans))'
77+
78+
- name: report coverage
79+
run: |
80+
bash <(curl -s https://codecov.io/bash)
81+

.travis.yml

-74
This file was deleted.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
[![TRAVIS](https://img.shields.io/travis/netZoo/netZooM/master?label=master)](https://travis-ci.org/netZoo/netZooM/)
2-
[![TRAVIS](https://img.shields.io/travis/netZoo/netZooM/devel?label=devel)](https://travis-ci.org/netZoo/netZooM/)
1+
[![netZooM](https://github.com/netZoo/netZooM/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/netZoo/netZooM/actions/workflows/main.yml)
2+
[![netZooM](https://github.com/netZoo/netZooM/actions/workflows/main.yml/badge.svg?branch=devel)](https://github.com/netZoo/netZooM/actions/workflows/main.yml)
33
[![codecov](https://codecov.io/gh/netZoo/netZooM/branch/devel/graph/badge.svg)](https://codecov.io/gh/netZoo/netZooM)
44
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
55
[![Documentation Status](https://readthedocs.org/projects/netzoom/badge/?version=latest)](https://netzoom.readthedocs.io/en/latest/?badge=latest)
66
[![tutorials](https://img.shields.io/badge/netZooM-tutorials-9cf)](https://github.com/netZoo/netZooM/tree/master/tutorials)
77

8-
netZooM is tested on: (OS: Linux + Macos) X (Language: Octave)
8+
netZooM is tested on: (OS: Ubuntu) X (Language: MATLAB)
99

1010
## Description
1111
netZooM is a MATLAB package of network methods.

netZooM/spider/spider_run.m

+1-8
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,13 @@
7272
DefineRegulatoryRegions(annofile, ranges, regfile, chrinfo);
7373
end
7474

75-
CreateEpigeneticMotif(epifile, motifdir, motifhitfile, bedtoolspath,nTF);
75+
CreateEpigeneticMotif(epifile, motifdir, motifhitfile, bedtoolspath, nTF);
7676

7777
%%%% Run SPIDER %%%%
7878

7979
% Build SPIDER prior
80-
8180
[PriorNet, TFNames, GeneNames]=BuildSPIDERprior(motifhitfile, regfile, bedtoolspath);
8281

83-
%temporary reduction in number of genes for TRAVIS
84-
numGenes = 100
85-
GeneNames = GeneNames(1:numGenes);
86-
PriorNet = PriorNet(:,1:numGenes);
87-
% Remove this section for including all genes.
88-
8982

9083
% Run message-passing
9184
SpiderNet=SPIDER(PriorNet, eye(length(GeneNames)), eye(length(TFNames)), alpha, computing);

netZooM/tools/processData.m

+1-64
Original file line numberDiff line numberDiff line change
@@ -131,68 +131,5 @@
131131
j = j(indCommPPI);
132132
weightPPI = weightPPI(indCommPPI);
133133
TFCoop(sub2ind([NumTFs, NumTFs], i, j)) = weightPPI;
134-
TFCoop(sub2ind([NumTFs, NumTFs], j, i)) = weightPPI;
135-
136-
end
137-
138-
function [GeneMotif,GeneNamesExp,TfMotif,TFNamesInit,NumConditions,...
139-
ExpInit,TF,gene,weightMotif,weightPPI,TF1,TF2,SampleNames]=...
140-
readData(exp_file,motif_file,ppi_file)
141-
% Description:
142-
% readData reads the input files for PANDA.
143-
% Inputs:
144-
% exp_file : file for gene expression
145-
% motif_file: file for motif data
146-
% ppi_file : file for TF PPI data
147-
% Ouputs:
148-
% GeneMotif : Gene names from gene motif data
149-
% GeneNamesExp : Gene names from gene expression data
150-
% TfMotif : TF names from gene motif data
151-
% TFNamesInit : TF names from gene PPI data
152-
% NumConditions: Number of gene expression data
153-
% ExpInit : Gene expression matrix
154-
% TF : list of TF edges in motif (source)
155-
% gene : list of gene edges in motif (target)
156-
% weightMotif : edge weight in the motif network
157-
% weightPPI : edge weight in the PPI network
158-
% TF1 : list of TF edges in PPI (source)
159-
% TF2 : list of TF edges in PPI (target)
160-
% SampleNames : gene expression samples IDs
161-
% Author:
162-
% Marouen Ben Guebila 12/2019
163-
164-
% Read expression
165-
disp('Reading in expression data!');
166-
tic
167-
exp_file_tbl = readtable(exp_file,'FileType','text','PreserveVariableNames',1);
168-
SampleNames = exp_file_tbl.Properties.VariableNames;
169-
ExpInit = exp_file_tbl{:,2:end};
170-
GeneNamesExp = exp_file_tbl{:,1};
171-
[NumGenes, NumConditions] = size(ExpInit);
172-
fprintf('%d genes and %d conditions!\n', NumGenes, NumConditions);
173-
toc
174-
if length(unique(GeneNamesExp)) ~= length(GeneNamesExp)
175-
error('There are duplicate genes in the expression matrix.')
176-
end
177-
% Read motif
178-
disp('Reading in motif data!');
179-
motif_file_id = fopen(motif_file);
180-
C = textscan(motif_file_id, '%s%s%f');
181-
fclose(motif_file_id);
182-
TF=C{1,1};gene=C{1,2};weightMotif=C{1,3};
183-
TfMotif = unique(TF);
184-
GeneMotif= unique(gene);
185-
% Read PPI
186-
disp('Reading in ppi data!');
187-
if(~isempty(ppi_file))
188-
ppi_file_id = fopen(ppi_file);
189-
C = textscan(ppi_file_id, '%s%s%f');
190-
fclose(motif_file_id);
191-
TF1=C{1,1};TF2=C{1,2};weightPPI=C{1,3};
192-
end
193-
TFNamesInit=unique(TF1);
194-
if ~isequal(TFNamesInit,unique(TF2))
195-
error('PPI data has missing information.')
196-
end
197-
134+
TFCoop(sub2ind([NumTFs, NumTFs], j, i)) = weightPPI;
198135
end

netZooM/tools/readData.m

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
function [GeneMotif,GeneNamesExp,TfMotif,TFNamesInit,NumConditions,ExpInit,TF,gene,weightMotif,weightPPI,TF1,TF2,SampleNames]=readData(exp_file,motif_file,ppi_file)
2+
% Description:
3+
% readData reads the input files for PANDA.
4+
% Inputs:
5+
% exp_file : file for gene expression
6+
% motif_file: file for motif data
7+
% ppi_file : file for TF PPI data
8+
% Ouputs:
9+
% GeneMotif : Gene names from gene motif data
10+
% GeneNamesExp : Gene names from gene expression data
11+
% TfMotif : TF names from gene motif data
12+
% TFNamesInit : TF names from gene PPI data
13+
% NumConditions: Number of gene expression data
14+
% ExpInit : Gene expression matrix
15+
% TF : list of TF edges in motif (source)
16+
% gene : list of gene edges in motif (target)
17+
% weightMotif : edge weight in the motif network
18+
% weightPPI : edge weight in the PPI network
19+
% TF1 : list of TF edges in PPI (source)
20+
% TF2 : list of TF edges in PPI (target)
21+
% SampleNames : gene expression samples IDs
22+
% Author:
23+
% Marouen Ben Guebila 12/2019
24+
25+
% Read expression
26+
disp('Reading in expression data!');
27+
tic
28+
exp_file_tbl = readtable(exp_file,'FileType','text','PreserveVariableNames',1);
29+
SampleNames = exp_file_tbl.Properties.VariableNames;
30+
ExpInit = exp_file_tbl{:,2:end};
31+
GeneNamesExp = exp_file_tbl{:,1};
32+
[NumGenes, NumConditions] = size(ExpInit);
33+
fprintf('%d genes and %d conditions!\n', NumGenes, NumConditions);
34+
toc
35+
if length(unique(GeneNamesExp)) ~= length(GeneNamesExp)
36+
error('There are duplicate genes in the expression matrix.')
37+
end
38+
% Read motif
39+
disp('Reading in motif data!');
40+
motif_file_id = fopen(motif_file);
41+
C = textscan(motif_file_id, '%s%s%f');
42+
fclose(motif_file_id);
43+
TF=C{1,1};gene=C{1,2};weightMotif=C{1,3};
44+
TfMotif = unique(TF);
45+
GeneMotif= unique(gene);
46+
% Read PPI
47+
disp('Reading in ppi data!');
48+
if(~isempty(ppi_file))
49+
ppi_file_id = fopen(ppi_file);
50+
C = textscan(ppi_file_id, '%s%s%f');
51+
fclose(motif_file_id);
52+
TF1=C{1,1};TF2=C{1,2};weightPPI=C{1,3};
53+
end
54+
TFNamesInit=unique(TF1);
55+
if ~isequal(TFNamesInit,unique(TF2))
56+
error('PPI data has missing information.')
57+
end
58+
end

tests/panda2.test.mat

4.69 MB
Binary file not shown.

0 commit comments

Comments
 (0)