Skip to content
Permalink
Browse files

Bugfix in getLinkList: diag <- NA

  • Loading branch information
vsc31245 vsc31245
vsc31245 authored and vsc31245 committed Jan 24, 2019
1 parent ed78b0b commit 8e68b5072fbf3c51f5f0b627e740cd291d9fa714
Showing with 23 additions and 19 deletions.
  1. +3 −3 DESCRIPTION
  2. +2 −0 NAMESPACE
  3. +14 −13 R/getLinkList.R
  4. +3 −2 man/GENIE3.Rd
  5. +1 −1 vignettes/GENIE3.Rmd
@@ -1,8 +1,8 @@
Package: GENIE3
Type: Package
Title: GEne Network Inference with Ensemble of trees
Version: 1.5.0
Date: 2018-04-27
Version: 1.5.1
Date: 2019-01-24
Author: Van Anh Huynh-Thu, Sara Aibar, Pierre Geurts
Maintainer: Van Anh Huynh-Thu <vahuynh@ulg.ac.be>
Description: This package implements the GENIE3 algorithm
@@ -13,7 +13,7 @@ Imports: stats, reshape2
Suggests: knitr, rmarkdown, foreach, doRNG, doParallel,
Biobase, SummarizedExperiment, testthat, methods
NeedsCompilation: yes
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
VignetteBuilder: knitr
biocViews: NetworkInference, SystemsBiology, DecisionTree, Regression,
Network, GraphAndNetwork, GeneExpression
@@ -1,4 +1,6 @@
useDynLib(GENIE3)

export(GENIE3)
export(getLinkList)
exportMethods(GENIE3)
importFrom("stats", "sd", "setNames")
@@ -29,17 +29,18 @@ getLinkList <- function(weightMatrix, reportMax=NULL, threshold=0) {
}

# Only process weights off-diagonal
diag(weightMatrix) <- NA
linkList <- reshape2::melt(weightMatrix, na.rm=TRUE)
colnames(linkList) <- c("regulatoryGene", "targetGene", "weight")
linkList <- linkList[linkList$weight>=threshold,]
linkList <- linkList[order(linkList$weight, decreasing=TRUE),]

if(!is.null(reportMax)) {
linkList <- linkList[1:min(nrow(linkList), reportMax),]
}

rownames(linkList) <- NULL

return(linkList)
diag(weightMatrix[rownames(weightMatrix), rownames(weightMatrix)]) <- NA

linkList <- reshape2::melt(weightMatrix, na.rm=TRUE)
colnames(linkList) <- c("regulatoryGene", "targetGene", "weight")
linkList <- linkList[linkList$weight>=threshold,]
linkList <- linkList[order(linkList$weight, decreasing=TRUE),]

if(!is.null(reportMax)) {
linkList <- linkList[1:min(nrow(linkList), reportMax),]
}

rownames(linkList) <- NULL

return(linkList)
}

Some generated files are not rendered by default. Learn more.

@@ -34,7 +34,7 @@ colnames(exprMatr) <- paste("Sample", 1:5, sep="")
head(exprMatr)
```

This matrix contains the expression data of 20 genes from 5 samples. Note that the expression data do not need to be normalised in any way.
This matrix contains the expression data of 20 genes from 5 samples. The expression data does not need to be normalised in any particular way (but whether it is normalized/filtered/log-transformed WILL affect the results!).

## How to run GENIE3

0 comments on commit 8e68b50

Please sign in to comment.
You can’t perform that action at this time.