Skip to content

Commit

Permalink
Substitute tidyverse with dplyr,purr,tibble and tidyr
Browse files Browse the repository at this point in the history
- Remove the dependency of the (huge) tidyverse packages and call only the necessary (sub-)packages. This includes:
// purrr: for functional programming: https://purrr.tidyverse.org/articles/other-langs.html
// tibble: for the function 'enframe' in the tidy-format
// tidyr: for the function 'separate' in the tidy-format
  • Loading branch information
ptrairatphisan committed Apr 11, 2019
1 parent e0c73e3 commit 521b540
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Expand Up @@ -12,14 +12,15 @@ LazyData: true
Imports:
doParallel,
igraph,
tidyverse,
viper,
GSEABase,
Category,
dplyr,
purrr,
tibble,
tidyr,
ggplot2,
UniProt.ws,
tidyr
UniProt.ws
Suggests: knitr,
rmarkdown
VignetteBuilder: knitr
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Expand Up @@ -17,5 +17,4 @@ export(runPROGENy)
export(writeLPFile)
import(doParallel)
import(igraph)
import(tidyverse)
import(viper)
3 changes: 1 addition & 2 deletions R/generate_measfile.R
Expand Up @@ -6,13 +6,12 @@
#' @param topnumber If given, only the top number of measurements will be written out.
#' @param write2folder Path to outputfolder
#'
#' @import tidyverse
#'
#' @return A n*m dataframe describing the inferred TF activities, where n is the number of Tfs and m the number of conditions.
#'
#' @export

generate_measfile<-function(measurements, topnumber=NULL, write2folder="./measurements"){
library(dplyr)
if(dir.exists(write2folder)==F){dir.create(write2folder)}
drugs<-colnames(measurements)
for (i in 1:ncol(measurements)){
Expand Down
5 changes: 1 addition & 4 deletions R/genesymbol2uniprot.R
Expand Up @@ -7,15 +7,12 @@
#' @param geneID Column index of the gene symbol column in map.
#' @param uniprotID Column index of the uniprot column in map.
#'
#' @import tidyverse
#'
#' @return A vector of genes or uniprot IDs.
#'
#' @export


GeneSymbol2Uniprot=function(df, map, geneID=1, uniprotID=2){
library(tidyverse)
library(dplyr)
df$genesymbols_for_mapping<-rownames(df)
colnames(map)[geneID]<-'genesymbols_for_mapping'
colnames(map)[uniprotID]<-'uniprotids_for_mapping'
Expand Down
8 changes: 6 additions & 2 deletions R/runDoRothEA.R
Expand Up @@ -8,15 +8,19 @@
#' @param df A n*m dataframe describing the contrast t-statistics, where n is the number of genes and m the number of conditions.
#' @param write2file Path to outputfile for all TF_activities if desired
#'
#' @import tidyverse
#' @import viper
#'
#' @return A n*m dataframe describing the inferred TF activities, where n is the number of Tfs and m the number of conditions.
#'
#' @export

runDoRothEA<-function(df, regulon, confidence_level=c('A','B','C'), write2file = NULL){
library(tidyverse)
# library(tidyverse)
library(dplyr)
library(purrr)
library(viper)
library(tibble)
library(tidyr)
names(regulon) <- sapply(strsplit(names(viper_regulon), split = ' - '), head, 1)
filtered_regulon <- regulon %>%
map_df(.f = function(i) {
Expand Down
3 changes: 2 additions & 1 deletion R/runPROGENy.R
Expand Up @@ -18,7 +18,8 @@

runPROGENy <- function(df,weight_matrix,k = 10000, z_scores = T, get_nulldist = F)
{
library(tidyverse)
# library(tidyverse)
library(dplyr)
resList <- list()
if(get_nulldist)
{
Expand Down
8 changes: 4 additions & 4 deletions man/enrichCARNIVAL.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 521b540

Please sign in to comment.