This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pacman::p_load(igraph,data.table,magrittr) | |
mergeGraphs <- function(...,desiredEdgeAttributes = c("from","to","edge_type"), omitNAnodes = TRUE){ | |
graphList <- list(...) | |
tryCatch({ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pacman::p_load(igraph,stringr,data.table,utils,ensurer,magrittr) | |
#' Write an igraph object to file in graphML format | |
#' | |
#' A frustrating feature of igraph is the lack of ability to affect the nodeID field of an output graphML file. | |
#' I ended up becoming so frustrated that I just wrote my own. | |
#' | |
#' @param graph2Write An igraph object containing a uniquely labelled 'name' vertex attribute (which is used as nodeID) | |
#' @param filename The filename to write out the graphml file to | |
#' @return filename The filename of the graphML file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Including arch is useful for times that one might be running two versions of R on different architectures. e.g. on new M1 Macs | |
libDirectory <- paste(c("~/Rlibs/", R.Version()$minor, "/", R.Version()$arch, "/"),collapse="") | |
.libPaths(libDirectory) | |
#Taken from bioconductor. This removes the need for using biocLite to install packages, which would be at the top of my list of "Bad Things About R" | |
biocVersion <- "3.12" | |
biocMirror <- getOption("BioC_mirror", "https://bioconductor.org") | |
biocPaths <- c(BioCsoft = "bioc", BioCann = "data/annotation", BioCexp = "data/experiment") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set command prefix to be like screen | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
#Set up the status bar | |
set -g status-right '#[fg=green][#[fg=blue]%Y-%m-%d #[fg=yellow]%H:%M#[default]#[fg=green]]' | |
set -g status-bg black | |
set -g status-fg white | |
set -g status-left '#[fg=green]#(echo `whoami`)#[fg=white]@#[fg=magenta]#H' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgDeps <- remotes::local_package_deps('.', dependencies=TRUE); | |
pkgDeps <- setdiff(pkgDeps, .packages(all.available = TRUE)); | |
debCRANpkgs <- tolower(paste('r-cran-', pkgDeps, sep = '')); | |
debBIOCpkgs <- tolower(paste('r-bioc-', pkgDeps, sep = '')); | |
debPkgsAvailable <- RcppAPT::hasPackages(c(debCRANpkgs,debBIOCpkgs)); | |
binariesToInstall <- names(debPkgsAvailable)[which(debPkgsAvailable)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import copy | |
import timeit | |
import pandas as pd | |
import polars as pl | |
#%% | |
# Use pandas, but no need to make a defensive copy |