Skip to content

Commit

Permalink
netZooR 1.0.11 (#249)
Browse files Browse the repository at this point in the history
* add bioc information

* update website

* add crane and docs

* update crane

* update worflow

* update crane

* update workflows

* update workflows

* update workfolw

* update workfolw

* update workfolw

* update workfolw

* Update main.yml

* Update main.yml

* Update main.yml

* fix lioness py

* udpate lioness in R

* include calculations python

* update panda rm missing

* update panda

* update lioness joblib

* revert commits

* ALPACA fix to NAs in community assignement

* version bump

* revert lioness

* update crane with alpaca changes

* update lioness

* update lioness python

* fix test

* update workflows

* put back github actions

* Fixed typo

* Added LIONESS-pearson option + unit test

* changed param labels in LIONESS example

* updated docs for lioness() function

* Update main.yml

* Update main.yml

* Update DESCRIPTION

* fix crane issue #240

* expanded PANDA and LIONESS description

* update crane fix

* added ALPACA, EGRET, and OTTER descriptions

* Update README.md

* typo in na.rm

* update workflow

* update workflow2

* fix-actions-3

* add r lib v2

* add r lib v2

* update condor test

* update condor test

* update condor test

* update condor test

* show testthat output

* add pandoc and use cache

* use built in check

* use built in check

* update actions with built in check

* bump version

* use built in coverage

* use built in coverage

* remove sudo

* update actions

* update actions

* removed sudo from actions

* ugrade to R42

* remove virtualenv

* remove virtualenv

* remove virtualenv

* modify condor test

* update condor test

* update condor test

* adding retiucualte to covr

* adding retiucualte to covr

* add panda test to coverignore

* update actions

* remove lioness tests from coverage

* remove lioness tests from coverage

* added MONSTER and SAMBAR

* remove lionessR test

* Added CONDOR and YARN

* Update README.md

* put back otter in rbuild

* remove condor test

* remove condor test

* remove lioness docs

* add lioness to buildingore

* donttest lionesss

* remove coverage from ubuntu test

* remove rbuilignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* update rbuildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* add back buildignore

* put back tests

* add padanedge diff test

* add back egeret test

* add monster test

* fix monster test

* tolerance in expect equal

* tolerance in expect equal

* tolerance in expect equal

* tolerance in expect equal

* add sourceppi

* fixed PANDA tests

* modify panda test

* update lioness test

* fix expect message

* update tests

* update tests

* update tests

* update tests

* update tests

* update tests

* reduced lioness test data

* reduced lioness test data

* reduced lioness test data

* reduced lioness test data

* reduce test size

Co-authored-by: Kate Hoff Shutta <kshutta@umass.edu>
Co-authored-by: katehoffshutta <43797774+katehoffshutta@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 7, 2022
1 parent 57a24ca commit 417c16c
Show file tree
Hide file tree
Showing 146 changed files with 7,138 additions and 19,287 deletions.
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
75 changes: 34 additions & 41 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,59 +29,52 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
r-version: [4.1]
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
run: |
La_library()
extSoftVersion()["BLAS"]
install.packages('reticulate', repos = "http://cran.us.r-project.org")
library('reticulate')
shell: Rscript {0}
- name: Install reticulate 2

- 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 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")
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')
use_condaenv("r-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
if: matrix.os == 'macos-latest'
run: |
library('reticulate')
use_condaenv("r-reticulate")
py_config()
covr::codecov()
shell: sudo -E Rscript {0}

shell: Rscript {0}
4 changes: 3 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 Expand Up @@ -32,3 +31,6 @@ tests/testthat/*.txt
tests/testthat/*.vcf
/doc/
/Meta/
vignettes/*.npy
docs/*.npy
docs/reference/*.npy
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Package: netZooR
Title: Integrate methods: PANDA, LIONESS, CONDOR, ALPACA, SAMBAR, MONSTER, OTTER, EGRET, and YARN into one workflow
Version: 0.99.85
Date: 2021-09-20
Authors@R: c(person("Tian", "Wang",
Title: netZooR integrates tools for the inference and analysis of gene regulatory networks
Version: 1.0.11
Date: 2022-06-20
Authors@R: c(person("Marouen", "Ben Guebila",
email = "benguebila@hsph.harvard.edu", role = c("aut","cre")),
person("Tian", "Wang",
email = "tian.wang@bc.edu", role = c("aut")),
person("Marouen", "Ben Guebila",
email = "marouen.b.guebila@gmail.com", role = c("aut","cre")),
person("John", "Platig",
email="john.platig@channing.harvard.edu",role="aut"),
person("Marieke", "Kuijjer",
email = "marieke.kuijjer@ncmm.uio.no", role = "aut"),
person("Magha", "Padi",
person("Megha", "Padi",
email = "mpadi@email.arizona.edu", role = "aut"),
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 model to reconstruction 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.
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.
Depends: R (>= 4.1.0),
igraph,
reticulate,
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(alpaca)
export(alpacaCrane)
export(alpacaExtractTopGenes)
export(condorCluster)
export(condorCoreEnrich)
Expand All @@ -9,8 +10,11 @@ export(condorModularityMax)
export(condorPlotCommunities)
export(condorPlotHeatmap)
export(condorQscore)
export(craneBipartite)
export(craneUnipartite)
export(createCondorObject)
export(createPandaStyle)
export(elistToAdjMat)
export(lioness)
export(lionessPy)
export(monster)
Expand Down
31 changes: 14 additions & 17 deletions R/ALPACA.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,29 @@ alpaca <- function(net.table,file.stem,verbose=FALSE)
print("Computing node scores...")
louv.Ascores <- NULL
louv.Bscores <- NULL
louv.Anames <- NULL
louv.Bnames <- NULL
for (i in seq_len(max(louv.memb)))
{
print(i)
print(i)
this.comm <- names(louv.memb)[louv.memb==i]
this.tfs <- this.comm[grep("_A$",this.comm)]
this.genes <- this.comm[grep("_B$",this.comm)]
if (length(this.tfs)>=1){
if (length(this.tfs)>1){
if (length(this.genes)==1){
gene.sums <- sum(dwbm[this.tfs,this.genes])
tf.sums <- dwbm[this.tfs,this.genes]
}else if (length(this.genes)>1){
tf.sums <- apply(dwbm[this.tfs,this.genes],1,sum)
gene.sums <- apply(dwbm[this.tfs,this.genes],2,sum)
}
} else if (length(this.tfs)==1) {
tf.sums <- sum(dwbm[this.tfs,this.genes])
gene.sums <- dwbm[this.tfs,this.genes]
}
this.denom <- sum(dwbm[this.tfs,this.genes])
louv.Ascores <- c(louv.Ascores,tf.sums/this.denom)
louv.Bscores <- c(louv.Bscores,gene.sums/this.denom)
if (length(this.tfs)>0 && length(this.genes)>0)
{
dwbm.submat <- array(dwbm[this.tfs,this.genes],dim=c(length(this.tfs),length(this.genes)))
tf.sums <- apply(dwbm.submat,1,sum)
gene.sums <- apply(dwbm.submat,2,sum)
this.denom <- sum(dwbm[this.tfs,this.genes])
louv.Ascores <- c(louv.Ascores,tf.sums/this.denom)
louv.Bscores <- c(louv.Bscores,gene.sums/this.denom)
louv.Anames <- c(louv.Anames,this.tfs)
louv.Bnames <- c(louv.Bnames,this.genes)
}
}

louv.scores <- c(louv.Ascores,louv.Bscores)
names(louv.scores) <- c(louv.Anames,louv.Bnames)

if (!is.null(file.stem)) {
write.table(cbind(names(louv.memb), as.vector(louv.memb)),paste(c(file.stem,"_ALPACA_final_memb.txt"),collapse=""),col.names=FALSE,row.names=FALSE,quote=FALSE,sep="\t")
Expand Down
Loading

0 comments on commit 417c16c

Please sign in to comment.