Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel #1

Merged
merged 122 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
077b6cd
update workflow
marouenbg Jun 27, 2022
e7c4692
update workflow2
marouenbg Jun 27, 2022
70f6d81
fix-actions-3
marouenbg Jun 27, 2022
c90c77e
add r lib v2
marouenbg Jun 27, 2022
31674f0
add r lib v2
marouenbg Jun 27, 2022
5129e1c
update condor test
marouenbg Jun 28, 2022
de7a516
update condor test
marouenbg Jun 28, 2022
de5b323
update condor test
marouenbg Jun 28, 2022
5c469c1
update condor test
marouenbg Jun 28, 2022
534a568
show testthat output
marouenbg Jun 28, 2022
fc9ecc4
add pandoc and use cache
marouenbg Jun 28, 2022
d748cd9
use built in check
marouenbg Jun 28, 2022
1836947
use built in check
marouenbg Jun 28, 2022
cc7fc1e
update actions with built in check
marouenbg Jun 28, 2022
702a3e8
bump version
marouenbg Jun 28, 2022
115b644
use built in coverage
marouenbg Jun 28, 2022
912b3b3
use built in coverage
marouenbg Jun 28, 2022
9e415ff
remove sudo
marouenbg Jun 28, 2022
f2b77ac
update actions
marouenbg Jun 28, 2022
41d1d89
update actions
marouenbg Jun 28, 2022
3fa9115
removed sudo from actions
marouenbg Jun 28, 2022
75d7ea8
ugrade to R42
marouenbg Jun 28, 2022
c1cac6c
remove virtualenv
marouenbg Jun 28, 2022
1d93ccd
remove virtualenv
marouenbg Jun 28, 2022
b505ada
remove virtualenv
marouenbg Jun 28, 2022
4336aa6
modify condor test
marouenbg Jun 29, 2022
defaf1e
update condor test
marouenbg Jun 29, 2022
e7e7ef6
update condor test
marouenbg Jun 29, 2022
563e20d
adding retiucualte to covr
marouenbg Jun 29, 2022
ba53689
adding retiucualte to covr
marouenbg Jun 29, 2022
01944de
add panda test to coverignore
marouenbg Jun 29, 2022
d2b579e
update actions
marouenbg Jun 29, 2022
48235bb
remove lioness tests from coverage
marouenbg Jun 29, 2022
6fdd4d5
remove lioness tests from coverage
marouenbg Jun 29, 2022
0fd74ec
remove lionessR test
marouenbg Jun 29, 2022
4139e26
put back otter in rbuild
marouenbg Jun 29, 2022
66554cf
remove condor test
marouenbg Jun 29, 2022
4b00d1a
remove condor test
marouenbg Jun 30, 2022
db9927f
remove lioness docs
marouenbg Jun 30, 2022
74ddd95
add lioness to buildingore
marouenbg Jun 30, 2022
f53d822
donttest lionesss
marouenbg Jun 30, 2022
a5023fe
remove coverage from ubuntu test
marouenbg Jun 30, 2022
48f0fe2
remove rbuilignore
marouenbg Jun 30, 2022
60d2611
update rbuildignore
marouenbg Jun 30, 2022
8ed5634
update rbuildignore
marouenbg Jun 30, 2022
23592bd
update rbuildignore
marouenbg Jun 30, 2022
94495b3
update rbuildignore
marouenbg Jun 30, 2022
9ba4746
update rbuildignore
marouenbg Jun 30, 2022
e1befc3
add back buildignore
marouenbg Jun 30, 2022
1add3e6
add back buildignore
marouenbg Jun 30, 2022
dbcaa6d
add back buildignore
marouenbg Jun 30, 2022
08f570c
add back buildignore
marouenbg Jun 30, 2022
b61e582
add back buildignore
marouenbg Jun 30, 2022
9437c40
add back buildignore
marouenbg Jun 30, 2022
29d01fa
add back buildignore
marouenbg Jun 30, 2022
4c5ea04
add back buildignore
marouenbg Jun 30, 2022
5e48772
add back buildignore
marouenbg Jun 30, 2022
1a22c9f
add back buildignore
marouenbg Jun 30, 2022
52c1c11
put back tests
marouenbg Jun 30, 2022
636c803
add padanedge diff test
marouenbg Jun 30, 2022
7ad152e
add back egeret test
marouenbg Jun 30, 2022
93275c7
add monster test
marouenbg Jun 30, 2022
c043c12
fix monster test
marouenbg Jul 1, 2022
b0996a8
tolerance in expect equal
marouenbg Jul 1, 2022
2461c73
tolerance in expect equal
marouenbg Jul 1, 2022
dc0fbaf
tolerance in expect equal
marouenbg Jul 1, 2022
7ed40ef
tolerance in expect equal
marouenbg Jul 1, 2022
919cfd7
add sourceppi
marouenbg Jul 1, 2022
59c44a9
fixed PANDA tests
marouenbg Jul 1, 2022
6be7455
modify panda test
marouenbg Jul 5, 2022
c0bdbfa
update lioness test
marouenbg Jul 5, 2022
13aa71d
fix expect message
marouenbg Jul 5, 2022
cfbf975
update tests
marouenbg Jul 5, 2022
3ccf096
update tests
marouenbg Jul 5, 2022
865e389
update tests
marouenbg Jul 5, 2022
e0cf2ba
update tests
marouenbg Jul 5, 2022
fa29d0a
update tests
marouenbg Jul 5, 2022
e5f9d14
update tests
marouenbg Jul 5, 2022
f5567ab
reduced lioness test data
marouenbg Jul 6, 2022
003c638
reduced lioness test data
marouenbg Jul 6, 2022
8b51a84
reduced lioness test data
marouenbg Jul 6, 2022
aee2581
reduced lioness test data
marouenbg Jul 6, 2022
9e3e333
reduce test size
marouenbg Jul 6, 2022
57cd613
Merge pull request #247 from marouenbg/fix-actions
marouenbg Jul 6, 2022
29a2cd7
Merge pull request #248 from katehoffshutta/master
marouenbg Jul 6, 2022
417c16c
netZooR 1.0.11 (#249)
marouenbg Jul 7, 2022
3d7ab30
updating bioc (#250)
marouenbg Jul 7, 2022
15c4d27
Merge branch 'master' into devel
marouenbg Jul 7, 2022
d06244a
bioc-update (#251)
marouenbg Jul 7, 2022
0a81184
update citation
marouenbg Jul 7, 2022
b84122e
update citation
marouenbg Jul 7, 2022
3e50cbb
Merge branch 'master' into devel
marouenbg Jul 7, 2022
1f2a7d3
update citation file (#253)
marouenbg Jul 7, 2022
8008152
Update README.md
marouenbg Jul 15, 2022
2bf7181
Update README.md
marouenbg Jul 15, 2022
0f0b29f
Update main.yml
marouenbg Jul 15, 2022
78d2e76
Update main.yml
marouenbg Jul 15, 2022
212c893
Update .Rbuildignore
marouenbg Jul 15, 2022
210ae58
Update .Rbuildignore
marouenbg Jul 19, 2022
1217750
update lioness test
marouenbg Jul 19, 2022
b07f2aa
removed two last lioness tests
marouenbg Jul 19, 2022
8cc58ff
removed two last lioness tests
marouenbg Jul 19, 2022
38ad4e3
removed two last lioness tests
marouenbg Jul 19, 2022
e2d5a30
no saving of lioness networks
marouenbg Jul 19, 2022
a992531
no saving of lioness networks
marouenbg Jul 19, 2022
3a2d89e
no saving of lioness networks
marouenbg Jul 19, 2022
3ba0841
no saving of lioness networks
marouenbg Jul 20, 2022
fa457ae
update lioness test
marouenbg Jul 20, 2022
1302e6b
lower sizeof test
marouenbg Jul 20, 2022
e31bddc
update test data
marouenbg Jul 20, 2022
4c63d99
update test data
marouenbg Jul 20, 2022
6a1d8c5
update test data
marouenbg Jul 20, 2022
b721a51
1.1.13 (#254)
marouenbg Jul 20, 2022
5f55e85
Update main.yml
marouenbg Jul 20, 2022
4f6b9f2
reduce panda tests
marouenbg Jul 20, 2022
5250b41
remove old test data
marouenbg Jul 20, 2022
28cbe77
remove old test data
marouenbg Jul 20, 2022
15f3781
Merge branch 'master' into devel
marouenbg Jul 20, 2022
0d59b71
Update main.yml
marouenbg Jul 21, 2022
8947f13
1.1.16
marouenbg Aug 16, 2022
ee77a8b
trying collapse readme (#261)
marouenbg Aug 23, 2022
29033b8
Update README.md
marouenbg Aug 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ CONDUCT\.md$
.Rhistory
coverZoo.r
.github
tests/testthat/test-panda.R
tests/testthat/test-lioness.R
tests/testthat/test-egret.R
tests/testthat/test-monster.R
tests/testthat/test-alpaca.R
tests/testthat/test.source.PPI.R
tests/testthat/test-pandatoalpaca.R
tests/testthat/test-pandatocondorobject.R
tests/testthat/test-pandadiffedges.R
tests/testthat/test-sambar.R
tests/testthat/test-otter.R
LICENSE
netZooR.Rcheck/
vignettes/ApplicationwithTBdataset.Rmd
Expand All @@ -41,6 +30,5 @@ vignettes/pandaR.Rmd
vignettes/pandaRApplicationinGTExData.Rmd
vignettes/yarn.Rmd
notes.md
R/pandaDiffEdges.R
R/createDiffPandaStyle.R
R/visDiffPandaInCytoscape.R
83 changes: 37 additions & 46 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,70 +26,61 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 300
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
r-version: [4.1]
os: [ubuntu-latest, macos-latest]
r-version: [4.2]

steps:

- uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-pandoc@v2

- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v1
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Install bash dependencies 1
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libopenblas-base libatlas3-base
- name: Install reticulate 1

- name: install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
extra-packages: |
any::reticulate
any::rcmdcheck
any::covr
needs: |
website
coverage

- name: Install blas/lapack
run: |
La_library()
extSoftVersion()["BLAS"]
install.packages('reticulate', repos = "http://cran.us.r-project.org")
library('reticulate')
shell: Rscript {0}
- name: Install reticulate 2-1
if: matrix.os == 'macos-latest'
run: |
library('reticulate')
py_config()
use_python("/usr/local/bin/python3")
virtualenv_create("r-reticulate")
shell: sudo -E Rscript {0}
- name: Install reticulate 2-2
if: matrix.os == 'ubuntu-latest'

- name: Install reticulate
run: |
library('reticulate')
library("reticulate")
py_config()
use_python("/usr/bin/python3")
virtualenv_create("r-reticulate")
shell: sudo -E Rscript {0}
- name: Install reticulate 3
run: |
library('reticulate')
virtualenv_install("r-reticulate","numpy")
virtualenv_install("r-reticulate","scipy")
virtualenv_install("r-reticulate","pandas")
virtualenv_install("r-reticulate","joblib")
shell: sudo -E Rscript {0}
- name: Install dependencies 2
run: |
install.packages(c("remotes", "rcmdcheck"), repos = "http://cran.us.r-project.org")
remotes::install_cran("covr")
remotes::install_deps(dep = T)
py_install("numpy")
py_install("scipy")
py_install("pandas")
py_install("joblib")
shell: Rscript {0}

- name: Check
run: |
library('reticulate')
py_config()
rcmdcheck::rcmdcheck(args = c("--no-manual","--ignore-vignettes"), error_on = "error", build_args="--no-build-vignettes")
shell: sudo -E Rscript {0}
uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--ignore-vignettes")'
build_args: 'c("--no-build-vignettes")'
error-on: '"error"'

- name: Report coverage
run: |
library('reticulate')
py_config()
covr::codecov()
shell: sudo -E Rscript {0}

shell: Rscript {0}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DS_Store
.Rhistory
Untitled.R
.Rbuildignore
inst/doc/
doc
Meta
Expand Down
27 changes: 16 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
Package: netZooR
Title: netZooR integrates tools for the inference and analysis of gene regulatory networks.
Version: 1.0.4
Date: 2021-09-20
Type: Package
Title: Unified methods for the inference and analysis of gene regulatory networks
Version: 1.1.16
Date: 2022-07-07
Authors@R: c(person("Marouen", "Ben Guebila",
email = "benguebila@hsph.harvard.edu", role = c("aut","cre")),
email = "benguebila@hsph.harvard.edu", role = c("aut","cre"), comment = c(ORCID = "0000-0001-5934-966X")),
person("Tian", "Wang",
email = "tian.wang@bc.edu", role = c("aut")),
email = "tian.wang@bc.edu", role = c("aut"), comment = c(ORCID = "0000-0002-2767-3243")),
person("John", "Platig",
email="john.platig@channing.harvard.edu",role="aut"),
email="john.platig@channing.harvard.edu", role="aut"),
person("Marieke", "Kuijjer",
email = "marieke.kuijjer@ncmm.uio.no", role = "aut"),
email = "marieke.kuijjer@ncmm.uio.no", role = "aut", comment = c(ORCID = "0000-0001-6280-3130")),
person("Megha", "Padi",
email = "mpadi@email.arizona.edu", role = "aut"),
email = "mpadi@email.arizona.edu", role = "aut", comment = c(ORCID = "0000-0002-3446-4562")),
person("Rebekka", "Burkholz",
email = "rburkholz@hsph.harvard.edu",role = "aut"),
person("Deborah", "Weighill",
email = "",role = "aut"))
Description: PANDA (Passing Attributes between Networks for Data Assimilation) is a message-passing algorithm to reconstruct gene regulatory network. It integrates multiple sources of biological data, including protein-protein interaction data, gene expression data, and sequence motif information to reconstruct genome-wide, condition-specific regulatory networks.[(Glass et al. 2013)]. LIONESS(Linear Interpolation to Obtain Network Estimates for Single Samples) is a method to estimate sample-specific regulatory networks by applying linear interpolation to the predictions made by existing aggregate network inference approaches. CONDOR(COmplex Network Description Of Regulators)is a bipartite community structure analysis tool of biological networks, especially eQTL networks, including a method for scoring nodes based on their modularity contribution.[(Platig et al. 2016). ALPACA(ALtered Partitions Across Community Architectures) is a method for comparing two genome-scale networks derived from different phenotypic states to identify condition-specific modules.[(Padi and Quackenbush 2018)]. This package integrates pypanda--the Python implementation of PANDA and LIONESS(https://github.com/davidvi/pypanda),the R implementation of CONDOR(https://github.com/jplatig/condor) and the R implementation of ALPACA (https://github.com/meghapadi/ALPACA) into one workflow. Each tool can be call in this package by one function, and the relevant output could be accessible in current R session for downstream analysis.
person("Des", "Weighill",
email = "",role = "aut", comment = c(ORCID = "0000-0003-4979-5871")),
person("Kate", "Shutta",
email = "",role = "ctb", comment = c(ORCID = "0000-0003-0402-3771")))
Maintainer: Marouen Ben Guebila <benguebila@hsph.harvard.edu>
Description: netZooR unifies the implementations of several Network Zoo methods (netzoo, netzoo.github.io) into a single package by creating interfaces between network inference and network analysis methods. Currently, the package has 3 methods for network inference including PANDA and its optimized implementation OTTER (network reconstruction using mutliple lines of biological evidence), LIONESS (single-sample network inference), and EGRET (genotype-specific networks). Network analysis methods include CONDOR (community detection), ALPACA (differential community detection), CRANE (significance estimation of differential modules), MONSTER (estimation of network transition states). In addition, YARN allows to process gene expresssion data for tissue-specific analyses and SAMBAR infers missing mutation data based on pathway information.
Depends: R (>= 4.1.0),
igraph,
reticulate,
Expand Down Expand Up @@ -73,3 +77,4 @@ VignetteEngine: knitr
VignetteBuilder: knitr
RoxygenNote: 7.1.2
BugReports: https://github.com/netZoo/netZooR/issues
URL: https://github.com/netZoo/netZooR, https://netzoo.github.io/
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export(monsterTransitionNetworkPlot)
export(monsterTransitionPCAPlot)
export(monsterdTFIPlot)
export(otter)
export(pandaDiffEdges)
export(pandaPy)
export(pandaToAlpaca)
export(pandaToCondorObject)
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CHANGES IN VERSION 1.1.12
--------------------------

o Reactivated unit tests for Ubuntu GitHub actions.
o LIONESS can now build single-sample coexpression networks using @kshutta's implementation
o Fix for ALPACA singleton community case (detected by @talkhanz)
o Fix for CRANE significance test on constant modularity scores (detected by @talkhanz)
o Improved method description by @kshutta
o Fix for PANDA edge case when only expression is provided
22 changes: 14 additions & 8 deletions R/LIONESS.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Run python implementation of LIONESS
#'
#' \strong{LIONESS}(Linear Interpolation to Obtain Network Estimates for Single Samples) is a method to estimate sample-specific regulatory networks.
#' \href{https://arxiv.org/abs/1505.06440}{[(LIONESS arxiv paper)])}.
#' \href{https://pubmed.ncbi.nlm.nih.gov/30981959/}{[(LIONESS publication)])}.
#'
#' @param expr_file Character string indicating the file path of expression values file, with each gene(in rows) across samples(in columns).
#' @param motif_file An optional character string indicating the file path of a prior transcription factor binding motifs dataset.
Expand Down Expand Up @@ -46,13 +46,17 @@
lionessPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu", precision="double", save_tmp=TRUE, modeProcess="union", remove_missing=FALSE, start_sample=1, end_sample="None", save_single_network=FALSE, save_dir="lioness_output", save_fmt='npy'){

if(missing(expr_file)){
stop("Please provide the gene expression value with option e, e.g. e=\"expression.txt\"") }
else{ expr.str <- paste("\'", expr_file, "\'", sep = '') }
stop("Please provide the gene expression value with option e, e.g. e=\"expression.txt\"")
}else{
expr.str <- paste("\'", expr_file, "\'", sep = '')
}

if(is.null(motif_file)){
motif.str <- 'None'
message("Prior motif network is not provided, analysis continues with Pearson correlation matrix.") }
else{ motif.str <- paste("\'", motif_file,"\'", sep = '') }
message("Prior motif network is not provided, analysis continues with Pearson correlation matrix.")
}else{
motif.str <- paste("\'", motif_file,"\'", sep = '')
}

if(is.null(ppi_file)){
ppi.str <- 'None'
Expand Down Expand Up @@ -112,7 +116,7 @@ lionessPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu"
panda_net <- py$panda_network

# re-assign data type of cloumn.
panda_net$tf <- as.character(panda_net$tf)
panda_net$tf <- as.character(panda_net$tf)
panda_net$gene <- as.character(panda_net$gene)

# rename first two columns
Expand All @@ -128,8 +132,10 @@ lionessPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu"
# create an instance named "lioness_obj" of Lioness Class.
# when save_single_network = TRUE
if(save_single_network==TRUE){
py_run_string(paste("lioness_obj = Lioness(panda_obj", " , " , "computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, " , " ,'save_single_network= True', " , ", "save_dir='", save_dir, "' , " , "save_fmt='" , save_fmt, "' )",sep = "" ))
} else {py_run_string(paste("lioness_obj = Lioness(panda_obj", " , " , "computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, ")",sep = "" ))}
py_run_string(paste("lioness_obj = Lioness(panda_obj", " , " , "computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, " , ", "save_dir='", save_dir, "' , " , "save_fmt='" , save_fmt, "' )",sep = "" ))
}else{
py_run_string(paste("lioness_obj = Lioness(panda_obj", " , " , "computing='", computing, "' , ","start=", start_sample," , ", "end=" ,end_sample, ")",sep = "" ))
}

# retrieve the "total_lioness_network" attribute of instance "lionesss_obj"
py_run_string("lioness_network = lioness_obj.export_lioness_results",local = FALSE, convert = TRUE)
Expand Down
32 changes: 25 additions & 7 deletions R/PANDA.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#'


pandaPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu", precision="double",save_memory=FALSE, save_tmp=TRUE, keep_expression_matrix=FALSE, modeProcess="union", remove_missing=FALSE){
pandaPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu", precision="double",save_memory=FALSE, save_tmp=TRUE, keep_expression_matrix=FALSE, modeProcess="union", remove_missing=FALSE, with_header=FALSE){

if(missing(expr_file)){
stop("Please provide the path of gene expression data file to 'expr_file' variable") }
Expand Down Expand Up @@ -106,6 +106,13 @@ pandaPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu",
keepexpression.str <- "keep_expression_matrix=True"
} else{ keepexpression.str <- "keep_expression_matrix=False" }

# with header option
if(with_header==FALSE){
withheader.str <- "with_header=False"
}else if (with_header==TRUE){
withheader.str <- "with_header=True"
}

# when pre-processing mode is legacy
if(modeProcess == "legacy"){

Expand All @@ -130,7 +137,9 @@ pandaPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu",
reticulate::source_python(pandapath,convert = TRUE)

# invoke Python script to create a Panda object
obj.str <- paste("panda_obj=Panda(", expr.str, ",", motif.str,",", ppi.str, ",", computing.str, ",", precision.str, ",", savememory.str, ",", savetmp.str, "," , keepexpression.str, ",", mode.str, ")", sep ='')
obj.str <- paste("panda_obj=Panda(", expr.str, ",", motif.str,",", ppi.str, ",",
computing.str, ",", precision.str, ",", savememory.str, ",", savetmp.str, "," ,
keepexpression.str, ",", mode.str, "," , withheader.str, ")", sep ='')

# run Python code
py_run_string(obj.str)
Expand All @@ -144,12 +153,21 @@ pandaPy <- function(expr_file, motif_file=NULL, ppi_file=NULL, computing="cpu",
# re-assign data type
panda_net$tf <- as.character(panda_net$tf)
panda_net$gene <- as.character(panda_net$gene)
panda_net$motif <- as.numeric(panda_net$motif)
if("motif" %in% names(panda_net)){
panda_net$motif <- as.numeric(panda_net$motif)
}
panda_net$force <- as.numeric(panda_net$force)
# adjust column order
panda_net <- panda_net[,c("tf","gene","motif","force")]
# rename the PANDA output colnames
colnames(panda_net) <- c("TF","Gene","Motif","Score")
if("motif" %in% names(panda_net)){
# adjust column order
panda_net <- panda_net[,c("tf","gene","motif","force")]
# rename the PANDA output colnames
colnames(panda_net) <- c("TF","Gene","Motif","Score")
}else{
# adjust column order
panda_net <- panda_net[,c("tf","gene","force")]
# rename the PANDA output colnames
colnames(panda_net) <- c("TF","Gene","Score")
}


# in-degree of panda network
Expand Down
3 changes: 1 addition & 2 deletions R/pandaDiffEdges.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' Identify differential edges in two PANDA networks
#'
#'To determine the probability that an edge is "different" between the networks,
Expand All @@ -14,7 +13,6 @@
#' @return a data.frame with five columns: tf, gene, motif, Score and defined condition name(the row with "T" in this column means this egde belongs to first condition or phenotype,
#' "F" means this edge belongs to the second condition or phenotype)
#' @examples
#'
#' # refer to four input datasets files in inst/extdat
#' treated_expression_file_path <- system.file("extdata", "expr4_matched.txt",
#' package = "netZooR", mustWork = TRUE)
Expand All @@ -38,6 +36,7 @@
#'
#' @export
#'

pandaDiffEdges <- function(panda.net1, panda.net2, threshold=0.8, condition_name="cond.1"){

# reshape two PANDA networks
Expand Down
Loading