sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
070e2682ca55787d5ef126e1ed93497d031f783a3c637e89e71b1df8113af6fd
R
5,364
197
#' A SequentialFutureBackend resolves futures sequentially in the current R session #' #' @inheritParams FutureBackend-class #' #' @details #' The `SequentialFutureBackend` is selected by `plan(sequential)`. #' #' @seealso #' For alternative future backends, see the 'A Future for R: Available Future #' Backends' vignet...
1998a7ba7701ca5295bc4e53ac37c049453f768ae3fa94e69568fdbd48814da2
R
5,369
140
library(ggplot2) # library(ggbeeswarm) source("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/config.r") source("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/utils.r") # default input ploting csv file data <- read.csv("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/...
53fb7b34693ed148a67e4e3d9d4db278cd22fb6621c3a108d8c5b1306ca8f690
R
5,376
170
#' @tags worker-broken #' @tags detritus-files #' @tags cluster library(future) options(future.debug = FALSE) message("*** cluster() ...") message("Library paths: ", commaq(.libPaths())) message("Package path: ", sQuote(system.file(package = "future"))) types <- NULL if (!covr_testing) types <- c(types, "PSOCK") if...
259bef250ce82038f2cb6cdac884cf657ee74c3b6759cf3a151cc26aaa47dca7
R
5,388
131
library(tidyverse) library(galamm) library(lme4) library(memoise) library(Matrix) library(mgcv) library(gamm4) dat <- readRDS("data/cognition_model/dat.rds") # Reference levels for identifiability of factor loadings. # The corresponding loadings are set to 1. test_ref <- c("cvlt_a1", "digitspan_bwd", "stroop_time_1"...
208766f5056e9cb8195f00192b31c2f3e7ed0ace8656852f95c6e73fc03fa9ad
R
5,390
161
setwd('/home/alkallr/Documents/book_chapter/REMBRANDTS/') # ### RUNNING REMBRANDTS #### # library(DESeq2); library(gplots); library(tibble); # library(magrittr); library(data.table); # # ### Prepare sample metadata #### # metadata <- data.table( # Label = NA_character_, File = list.files(path = './examples/MMB_mat...
10642f7656701d101221a822e8b9b681156ecff61b94757fbba2a07af10ac3dd
R
5,393
156
#' Scatterplots of PCA and Gene expression from any 4-node circuit #' @param rset The sRACIPE object of the simulated circuit #' @return list(g,p) #' @import sRACIPE #' @import SummarizedExperiment #' @export plot_RACIPE <- function(rset){ gex = log2(t(assay(rset))) gex.1 = ggplot(data = as.data.frame(gex), aes...
2a616a76e3857ddd39090ee0ce2668ffa6e1cab5c53dadce7af0796b0d624d4c
R
5,400
161
#' @tags backend sequential multisession cluster #' @tags detritus-connections library(future) SequentialFutureBackend <- future:::SequentialFutureBackend MultisessionFutureBackend <- future:::MultisessionFutureBackend ClusterFutureBackend <- future:::ClusterFutureBackend MulticoreFutureBackend <- future:::MulticoreF...
7d887e86b5e40f593e4ae9321e6b08816e5661d565c33a170a102162d8efc6ff
R
5,428
138
library(ggplot2) # library(ggbeeswarm) source("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/config.r") source("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/utils.r") # default input ploting csv file data <- read.csv("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/...
c15fc70c143326f944226e829287de22cafa7f3eaafd5099df215ba9ddaca62b
R
5,429
153
##' @importFrom mgcv s ##' @export s ##' @name s ##' @rdname sl NULL ##' @importFrom mgcv t2 ##' @export t2 ##' @name t2 ##' @rdname t2l NULL #' @title Set up smooth term with factor loading #' #' @srrstats {G1.4} Function documented with roxygen2. #' @srrstats {G2.3,G2.3b} Argument "factor" is case sensitive, as is ...
e05a1ee733199c526afc51bd744250058e9cae2b4ac91dc76dd7cb217769f7ed
R
5,430
166
library(data.table) library(ggplot2) library(ggbeeswarm) library(grid) library(ggpubr) source('../config.r') source('../utils.r') # text grob text_annotation <- function(label, x, y, size, color) { gtext <- grid.text(label, x = unit(x, "npc"), y = unit(y, "npc"), gp = gpar(fontsize = size, col = color)) ret...
c417baa1e6d454321a6d6450983baaa264fd2997afd8e732b0e547956f992e7f
R
5,435
155
## -------------------------------------------------------------------------------------------------------------------------------------------------------------------- # This script shows how to compute scrubbing measures directly from the HCP data # (without using pre-computed CompCor, etc.). It was just used for a...
900599e911b536fcd352d4097e622901910fcfa554b003a5bc769fb6c4242f8a
R
5,455
154
#' Results from resolving a future #' #' @param value The value of the future expression. #' If the expression was not fully resolved (e.g. an error) occurred, #' the the value is `NULL`. #' #' @param visible If TRUE, the value was visible, otherwise invisible. #' #' @param conditions A list of zero or more list eleme...
4c8286bde2146bb05fa035d00f15383b75099c2ea57bcd3df5d2f86de86e5b40
R
5,468
130
library(RISC) library(irlba) library(umap) library(ggplot2) library(RColorBrewer) PATH = "/Path to the data/GSE131181" ################################################################################### ### Prepare data ### ################################################################################### library(d...
f99e326bd45dd686a8c8ce56dcfffab72d33ae3c8ae1ba19ccb18e630f454120
R
5,479
182
rm(list = ls()) # the libraries needed and the actual code for this section is within convenience functions in QCfunctions.R source("QCfunctions.R") grp="str" outname<-grp # set wd to QC if needed # setwd(list.dirs(recursive = F)[grep("C_QC",list.dirs(recursive = F))]) # setup directory structure dirSetup(out.n...
e16af87cea1ab7b75182af31f7396e52f4e190974cb28e88bed73e21eff7d1a2
R
5,481
134
library(dplyr) library(ggpubr) library(reshape2) library(grid) library(scales) library(ggrepel) library(stringr) #install.packages("remotes") #remotes::install_github("LCBC-UiO/ggseg", build_vignettes = FALSE) library(ggseg) theme_set(theme_classic()) args <- commandArgs(trailingOnly = TRUE) if(length(args) > 0) { ...
470dd8d9c60265d072c60ad8397d357aeda61b3a1353d99d260da65f85d3fdfd
R
5,502
135
library(RISC) library(irlba) library(umap) library(Matrix) library(matrixStats) library(ggplot2) library(RColorBrewer) PATH = "/Path to the data/GSE96583_PBMC" ################################################################################### ### Preparing RISC Objects ### ##########################################...
d5aaa93107fa667bf4993eadc6f4f1b74f856611a0f78558329de821babbd746
R
5,515
139
#!/usr/bin/env Rscript # Get all the different covariate/samplesheet/phenotype files and merge them all together # while harmonizing column names options(warn=1) library(data.table) library(plyr) library(optparse) initial.options <- commandArgs(trailingOnly = FALSE) file.arg.name <- "--file=" script.name <- sub(file....
bc6f595e7ab59f0593516fa8387ebb6fd8c4560e9a1a730f398339fe0573a23b
R
5,518
116
install.packages("PhyloOrchard", repos="http://R-Forge.R-project.org") BiocManager::install("ggtree") install.packages("phylobase") library(PhyloOrchard) library(phylobase) library(ggtree) library(ggplot2) #load in phylogenetic trees data(BinindaEmondsEtAl2007) bestmammaltree <- BinindaEmondsEtAl2007[[1]] bestmammal...
e43a22fc585a7a57cd9de50c10d51bec480b08adeb97b8133add49a38732f2c9
R
5,532
171
# this creates scripts that can be run as jobs on a computing cluster library(Biobase) library(biomaRt) setwd(dirname(rstudioapi::callFun("getActiveDocumentContext")$path)) load("WGCNA/cons/inputData.rda") dc.expr<-t(scale(multiExpr$dc$data)) str.expr<-t(scale(multiExpr$str$data)) metadata.dc<-metadataList$dc rowna...
b728ab5f5a816724656ff00eff2024cfbb72ae49f0993a7d6dc85a7788545cc8
R
5,561
125
# # create.tstat.matrix.R # # Copyright (c) 2013-2013 GBIC: Danny Arends, Harm-Jan Westra, Lude Franke and Ritsert C. Jansen # last modified Jul, 2013 # first written Jun, 2013 # setwd("~/Github/systemsgenetics/eqtl-mapping-pipeline/src/main/scripts") source("helper.functions.R") setwd("~/Github/Juha/") # Load the Z s...
a97d19a80293836764d549c931d2e0c21e57364d9dd0b0cfb5ec15e9b4673415
R
5,563
208
### script to count reads and generate plot for calibration of the reads # load libs library(foreach) library(doParallel) source('functions.R') # load parameters conf <- load_mapping_config() # load tool locations tool_path <- load_tool_location() # set max cores max_cores <- get_max_cores() # from functions.R # re...
b97bb950223570bca2a2eb2d5e1458292f81f191e5a6c00ec5283770b4ac11a7
R
5,563
205
--- title: "Permutation testing for META for dFC Metrics - COBRE RAW" author: "Fran Hancock" affiliation: Department of Neuroimaging, Institute of Psychiatry, Psychology and Neuroscience, King's College London, London, UK date: "`r format(Sys.time(), '%B %d, %Y')`" fontsize: 14pt output: html_document --- ```{r setup...
e1a717b31442bf4248440f06b8fd84277547a3d8fb659c8a6d42ec5406ffc918
R
5,568
169
library(data.table) library(ggplot2) library(GGally) library(ggrepel) library(optparse) library(ggExtra) library(RColorBrewer) main <- function(){ options <- get_options() if (!dir.exists(paste0(options$output,'/figures/'))){ dir.create(paste0(options$output,'/figures/')) } if (!dir.exists(paste0(options...
b4e95a4744cc0c96b0ef2b70b97bb3af5496ced9b49c99f3676e977b84762ac6
R
5,571
168
--- title: "R Notebook" output: pdf_notebook --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, warning = F, message = F) ``` ```{r warning=FALSE, message=FALSE} library(tidyverse) library(randomForest) library(cowplot) library(gridExtra) ``` ```{r} rents <- read.csv('./data/rent.csv') glimpse(rents...
8be2690a4b8285c36a2377844b1ff63676e5acf8f6024ab3f9cb0dc3136b718f
R
5,579
157
library(Biobase) library(pheatmap) library(RColorBrewer) library(ggplot2) library(grid) library(gridExtra) setwd(dirname(rstudioapi::callFun("getActiveDocumentContext")$path)) datlist<-readRDS("data/FinalProcessedData.rds") an<-fData(readRDS("data/rawCountEset.rds")) hasEGID<-rownames(an[!is.na(an$NCBI.gene.ID),])...
d12cde89adf5f0faa16fe66ca08ad1aa37b72c4e4c3010da8f9481fdd5cdae39
R
5,579
162
#' Tornado plot for aggregated discoveries #' #' Takes the bins parallel to the Hi-C diagonal through the anchor locations #' and perform k-means clustering on these. #' #' @param discovery One of the following \code{discovery} objects: \itemize{ #' \item{An \code{APA_discovery} object} #' \item{A \code{CSCAn_disc...
ea008b7b2c1624fa40b3efb8f96a873a08f2112e87375f53965bba89c8e9b4e8
R
5,605
186
rm(list = ls()) # the libraries needed and the actual code for this section is within convenience functions in QCfunctions.R source("QCfunctions.R") grp="dc1m" outname<-grp # set wd to QC if needed # setwd(list.dirs(recursive = F)[grep("C_QC",list.dirs(recursive = F))]) # setup directory structure dirSetup(out.n...
8ae79a8ef38a10b25a111f906e1025bd7574272f688374cbbfd74364b0e94e1a
R
5,606
204
#' @srrstats {G5.0} Datasets from PLmixed package are used for testing, and #' results from the functions in this package are precomputed for comparison, #' in cases where PLmixed and galamm support the same models. #' @srrstats {G5.4} It has been confirmed that PLmixed returns the same results. #' PLmixed is not...
e9c6c8d169bc3efac3bda6e0fd5adcaf89fb958c0f4cc083182566460c640e86
R
5,617
205
--- title: "Permutation testing for VAR in modes COBRE RAW" author: "Fran Hancock" affiliation: Department of Neuroimaging, Institute of Psychiatry, Psychology and Neuroscience, King's College London, London, UK date: "`r format(Sys.time(), '%B %d, %Y')`" fontsize: 14pt output: html_document --- ```{r setup, include=...
0657e1482ef00ae29e05b5a5acc0c92bd6f4bef55ea9324ae1aeefb04aaa3863
R
5,648
165
library(igraph) library(SCINET) library(ACTIONet) #load entire HNv3 data('HNv3_XC_LLS') #add LLS to all networks ################################# cancertype <- 'BC' ################################# setwd(paste0('~/HumanNetv3/XC_nobatch/',cancertype,'/')) Celltype.specific.networks <- readRDS(paste0('....
63ff9bb2b2f436890ecdf74af9c7c42ea9a290962351214deb1e56185437926a
R
5,693
148
#library(tidygraph) #library(ggraph) library(data.table) # IO args args <- commandArgs(trailingOnly=TRUE) bundle.dir <- args[4] input.path <- args[1] phenotype <- args[2] output.path <- args[3] input.prefix <- paste0(input.path, "/", phenotype) # Args edge.threshold <- 2 edges.within.cols....
de5ba06f9d4f0ba9ff86bcc8e3a6aa3bd5a107bddeca23fd2d1f62efeb4d4678
R
5,698
147
#check out and subset the good alignments aln_QC<-readr::read_tsv("protein/other_protein_alignments/prank_out/Coevol_proteins_aln1 - protein_list_all.tsv") good<-aln_QC %>% filter(decision=="use") %>% filter(!notes %in% c("short","sus_gap")) write_tsv(good[,"protein"],"protein/other_protein_alignments/prank_out/goo...
e22b50023ff05cde7e34c223fee23b03f59f975b9156e1ab8502084c7ebda5d7
R
5,710
159
library(tidyverse) library(ggtree) library(Biostrings) library(readxl) library(nlme) library(ape) library(geiger) library(stringr) # put all the results together # CCDS IDs #CCDS<-read_delim("protein/other_protein_alignments/CCDS/CCDS.current.txt", delim="\t") trnp1_ccds<-"CCDS41289.1" source("protein/scripts/summ...
c8c4f88b13fb860086b2e70f2b76c1aac25963394d4db549bd0deb98d7d6522a
R
5,719
174
#' @tags FutureCondition conditions sequential library(future) plan(sequential) message("*** FutureCondition() ...") ## A plain message c1 <- FutureCondition("some message") stopifnot(inherits(c1, "FutureCondition"), inherits(c1, "condition")) stopifnot(grepl("some message", conditionMessage(c1), fixed = TRUE)) ##...
6fd7417f5aebd6dff5e3e38d36b668c1e64012de24469e72021eda7c0a8231bc
R
5,725
187
--- title: "Heteroscedastic Linear Mixed Models" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Heteroscedastic Linear Mixed Models} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ...
32054a5fe4da5d2fd529a50c6419093ef604c95a1b7639f62dc5a0679c97abf2
R
5,774
103
# This script contains the commands used to identify the longest contig per species, which covers the coding sequences. The input of this script has not been uploaded due to limited git space. But the output of this script can be found under protein/fastas/resequenced_promexon1_primates.fa # SETTINGS ----------------...
3ead7302cb44eca9c407f8b3fda6eb1ead35b71480c3dfea19eff8091073e27c
R
5,793
187
#get B anc T cell specific gene set from GO term #readdata data.tcell <- read.table('~/HumanNetv3/gene2go_tcell.tsv', header = F, sep = '\t') data.bcell <- read.table('~/HumanNetv3/gene2go_bcell.tsv', header = F, sep = '\t') #filter data by human first data.tcell <- data.tcell[data.tcell$V1 == '9606', ] data.bcell <-...
03c41277bb3518dfa1b58cd1d49fff159f646db811654818e8c38d98f42d8d5d
R
5,799
198
#' @tags utils-internal options library(future) setOption <- future:::setOption update_package_option <- future:::update_package_option ## A dedicated, non-existing option and its environment variable name <- "future.test.myoption" env <- "R_FUTURE_TEST_MYOPTION" reset <- function() { opts <- list(NULL) names(o...
b715ecb4f68fc56d6729d3bc6b6cc5f9eddbb8338d7952aa065d3c2a9e54c3ad
R
5,830
162
#!/usr/bin/env Rscript ## COMMAND LINE PARSE ###### library("optparse") # specify our desired options in a list # by default OptionParser will add an help option equivalent to option_list <- list( make_option(c("-i","--input_dir"), default=NULL, help="Path to gene count files (.tsv); input files must be tsv fi...
76a10d865cb97ccb16ab93badc353645b1f34420c0551d513ec5e408b15c4eae
R
5,837
190
```{r} setwd("../downstreamer_collaborations/biogen/") source("../../downstreamer_main/downstreamer_functions.r") # Read excel files base <- read.downstreamer.batch("/home/work/Desktop/depict2/collaborations/biogen/hand_grip_strength/2021-02-11/") new <- read.downstreamer.batch("/home/work/Desktop/depict2/collaboratio...
17f181633c78958a023ff2d85d8bc49981c4dbd19da8d67d0778121bdcdb4177
R
5,849
178
#' @tags value futures sequential listenv library(future) library(listenv) plan(sequential) mkfutures <- function(n = 4L) { fs <- lapply(seq_len(n), FUN = function(i) future(i)) names(fs) <- letters[seq_len(n)] fs } message("*** value() - 'reduce' validation ...") ## A 'reduce' function given as the name of ...
e9735f40f20a5ac27ed701e6ec82d8785d8958be63c7564754c1552b84e077a6
R
5,945
167
smartSeq <- read.delim("smartseqSamples.txt")[,1] str(smartSeq) defaultCol <- adjustcolor("grey", alpha.f = 0.3) pcsAndMeta$colSmartseq <- defaultCol pcsAndMeta$colSmartseq[pcsAndMeta$Row.names %in% smartSeq] <- "darkslategray" pcsAndMeta$colSmartseq[pcsAndMeta$Row.names %in% qseq] <- "orangered" pcsAndMeta$colSmarts...
c0a1fa92b67c5e3cb7bf5ce1f7f48535c939b4d7d34dc9dc61a1cd0e063b8099
R
5,946
175
#' @title Diagnostic plots for galamm objects #' #' @description This function provides diagnostic plots for models fitted with #' [galamm()]. See the [residuals.galamm()] function for definition of the #' residuals being used. #' #' @param x An object of class \code{galamm} returned from \code{\link{galamm}}. #' @...
f5cc4b1ab013d6fb6683ad74282541362e2fc1dcb3836eada6c0aaf84c21cc15
R
5,948
195
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_coregulation")} else {setwd("../evaluating_coregulation")} source("../downstreamer_functions.r") source("data/source_olivier.r") library(pROC) library(data.table) library(scales) # Cached 2021-04-28 datasets <- read.downstreamer.batch...
916cf312d5514dce65af75ddc7d3937b698c0950cf39ebc33da6ac4f8e061855
R
5,965
197
#'--- #'title: "Score models on test set" #'author: "Denis A. Engemann" #'date: "7/17/2020" #'output: #' html_document: #' code_folding: #' hide #' md_document: #' variant: #' markdown_github #'--- #' First execrise: Load all relevant data: #' 1. Predictions for all targets fr...
1ca8edb3205ab1a2923278b23ae9a384fdbc3e9047312b1577a292326dac361f
R
5,968
166
```{r} setwd("evaluating_coregulation") source("../downstreamer_functions.r") source("data/source_olivier.r") cur.data <- read.depict2("~/Desktop/ibd_sub_network_coregulation//inflammatory_bowel_disease_2017_29906448_hg19_enrichtments_exHla.xlsx", potential_traits = c("Coregulation", "Coregulation_eqtlGen")) cur.data...
c033b22657e587ada09b89c68352f7184966f51c28f5d6681b09715d3df91c64
R
5,980
162
library(ggplot2) # library(ggbeeswarm) source("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/config.r") source("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/utils.r") # default input ploting csv file data <- read.csv("~/Documents/Personomics_Research_Group/WAPIAW_2/figure_plotting/...
4a6b3d028404eaf687d5214146cd9eede30dbb91ed1f15ce696b54d9b5995110
R
5,996
160
#' Chromosome matrix #' #' Computes sums of chromosome interactions genome-wide along with expected #' values, making it easier to identify enriched trans-contacts that may #' indicate translocations. #' #' @param explist Either a single GENOVA \code{contacts} object or a list of #' GENOVA \code{contacts} objects. ...
2af4a854f5a415b6958fd94d3347ff9565c81c6b42b90ec0f0bdba61854daf3f
R
5,997
134
library("optparse") library(ggplot2) library(ggpubr) library(gridExtra) library(topGO) library(ALL) library(dplyr) library(data.table) # Get command line arguments option_list = list( make_option(c("-f", "--fdrQTLs"), type="character", help="DER-08a_hg38_eQTL.significant.txt of psychEncode", metavar="...
86fa26f63dd7f30955fbd03bfe52daa2b4deea22c7d1879cd40ece9f42580609
R
6,000
160
options(warn=-1) #'# Class definitions #' @importFrom methods setClassUnion #' @importClassesFrom Matrix dgCMatrix library(Matrix) setClassUnion(name = 'AnyMatrix', members = c("matrix", "dgCMatrix","data.frame")) setClassUnion(name = 'AnyFactor', members = c("factor", "list",'character')) my.sapply <- ifelse( te...
78e5a9a3bea59f2f4383aaf59fe690ef5b626dfb83b5b91a8e99b7c7453f238e
R
6,001
149
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_coregulation")} else {setwd("../evaluating_coregulation")} source("../downstreamer_functions.r") source("data/source_olivier.r") library(Hmisc) #datasets <- read.downstreamer.batch(main.downstreamer.output.path, USE.CACHE = T) datasets...
7d11629cfd0f01221e09f1c97bd50b975834088b5bcaf11b79002df84edaea95
R
6,004
202
#' Trans matrix plot #' #' This function plots a matrix of contacts data for the intersection of two #' regions. Using two regions on different chromosomes plots trans data. #' #' @param exp1 A GENOVA \code{contacts} object. #' @param exp2 A GENOVA \code{contacts} object compatible with \code{exp1} #' (optional) or...
5cc482f72b94da71acd6942c0041c4ed1ba80144c6c6e85600b6421c7a85539c
R
6,008
195
--- title: "Terence Parr Feat Imp" author: "Christopher Csiszar" date: "3/22/2018" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, warning = F, message = F) ``` ## Biases in RF importance calculations Simple RF Classification done in R to see how biases their RF feature impor...
64fc5f6153ea599b4e16d5124e728e614facaf1bd884491d51c0dcf1c37938cc
R
6,025
226
#' @tags rng #' @tags listenv #' @tags sequential multisession multicore options(future.debug = FALSE) library(future) library(listenv) message("*** rng ...") okind <- RNGkind() ## A valid regular seed f <- Future(42, seed = 42L) print(f) stopifnot(identical(RNGkind(), okind)) ## A valid L'Ecuyer-CMRG RNG seed se...
7c75d9f51fef6ff89da5c33048d171683a238807c19b53a52bb9200ee5b72c6a
R
6,039
134
# Function for plotting gene module heatmap from seurat 10x object # col_order is a single element or a vector element. By default cells are ordered by the first element of the metadata variable. # User can specify col_order as a vector, with cell order prioritised based on the order of the col_order variable. # A cu...
885fda463643c61328e90b1cfcf40b624e43bb31faac0440de704f9b87573d0a
R
6,050
177
#=======================# # 2.Format results # #=======================# ## Set up ---- filepath <- "" setwd(filepath) ### Load libraries ---- library(dplyr) library(magrittr) library(openxlsx) library(purrr) library(tidyr) ## Format results (Module) ---- ### Brain volume ---- brainvol_mod <- read.csv("results/...
64c240cf90c030561d686a383ca163098e95e659214cfba88289353ca6d80544
R
6,052
223
#' @tags utils-internal library(future) isFALSE <- future:::isFALSE isNA <- future:::isNA assert_no_positional_args_but_first <- future:::assert_no_positional_args_but_first stop_if_not <- future:::stop_if_not trim <- future:::trim comma <- future:::comma commaq <- future:::commaq hexpr <- future:::hexpr envname <- f...
799e57e72e28348a28a671e018b969bea6075099a89e1179e6e31bfd7cc3f151
R
6,053
142
sumstats <- function(files,ref,trait.names=NULL,se.logit,OLS=NULL,linprob=NULL,N=NULL,betas=NULL, info.filter = .6,maf.filter=0.01,keep.indel=FALSE,parallel=FALSE,cores=NULL,ambig=FALSE,direct.filter=FALSE){ if (is.list(files)) { wrn <- paste0("DeprecationWarning: In future versions a list of...
3d167fa37db19a25a8358e872166fc7ddf3a32155307034b42da695593f82cd6
R
6,058
184
options(echo=TRUE) options(stringsAsFactors = FALSE); library(WGCNA); allowWGCNAThreads() library(flashClust); library(gplots) library(RColorBrewer) setwd(dirname(rstudioapi::callFun("getActiveDocumentContext")$path)) # striatum----- outdir="CSstr" dir.create(outdir) load("Striatum/processed_data/inputData.rda")...
a3783807e8ab3f9a8550a2a7f7146759ab9548f0f6c0d7f8039166b459bf33e5
R
6,058
151
#' summarySE #' #' stats for time repeated measures #' @param data data frame #' @param measurevar character #' @param groupvars character #' @param data a data frame. #' @param na.rm a boolean that indicates whether to ignore NA's #' @param conf.interval the percent range of the confidence interval (default is 95%) #...
2891f3e521d9d856acb7b7111ce46918b821c3e5e96ca7f89051364da58315da
R
6,068
168
setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs\\Height_test") library(readxl) read.depict2 <- function(path, potential_traits=NULL) { if (is.null(potential_traits)) { potential_traits <- excel_sheets(path) potential_traits <- potential_traits[grep("Overview", potential_traits, invert=T)] } output ...
8184c9ce01ad9582e2ef0dcfd61ffb8447f149731599c3de2cc4b101421f2ea5
R
6,078
211
loadJuicer = function(juicerPath, resolution, scale_bp = 1e9, scale_cis = F, balancing = T){ try_require("strawr", "loadJuicer", "github") juicerPath <- normalizePath(juicerPath) # get metadata of juicer-file juicer_metadata = get_juicer_metadata(juicerPath) # check if resolution is found! if(!any(re...
2404519fcde6d429d5dd2834147e778ee3f191d57abc277a5b4d32c72174f3bf
R
6,092
174
#' Calculate insulation scores #' #' Insulation scores are calculated by sliding a square along the diagonal of #' the Hi-C matrix and averaging the values in that square. #' #' @param explist Either a single GENOVA \code{contacts} object or list of #' GENOVA \code{contact} objects. #' @param window An \code{integer}...
e0bccc8ef14b0d56a20a8a83c5b2b064eae290431bf52a502e51b8f746ec87c0
R
6,102
203
--- title: "Permutation tests for dFC Mode Metrics - VAR HCPEP RAW" author: "Fran Hancock" affiliation: Department of Neuroimaging, Institute of Psychiatry, Psychology and Neuroscience, King's College London, London, UK date: "`r format(Sys.time(), '%B %d, %Y')`" fontsize: axtxtpt output: html_document --- ```{r setu...
018f205b038ed58f5e4d73432ad5fc5e84060e0cb65962525bb8f23b06ae62f8
R
6,105
138
## ------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) stopifnot(COMPUTER == "MPro") # Load list of S1200 subjects. subjects <- readRDS(file.path(dir_data_misc, "HCP_subj...
e8c29b14c4cf690bac09f584c1324cd424ef488ab1a1e0be478b5c3501042606
R
6,133
202
#' @tags plan tweak #' @tags sequential cluster message("*** Tweaking future strategies ...") message("*** y <- tweak(future::sequential) ...") sequential2 <- future::tweak(future::sequential) print(args(sequential2)) stopifnot(identical(sequential2, future::sequential)) stopifnot(!inherits(sequential2, "tweaked")) ...
786a3fbc959ec1a72a9f6895a9d182f843be9561fec1e064970557023ca1557d
R
6,135
203
--- title: "Permutation tests for dFC Mode Metrics - META HCPEP RAW" author: "Fran Hancock" affiliation: Department of Neuroimaging, Institute of Psychiatry, Psychology and Neuroscience, King's College London, London, UK date: "`r format(Sys.time(), '%B %d, %Y')`" fontsize: axtxtpt output: html_document --- ```{r set...
b61107061a92a9e626b10259522e23dd44e9920b8f0cb6ef532bcbe35cab1254
R
6,135
188
```{r} setwd("coregulation_clustering") source("../downstreamer_functions.r") library(apcluster) library(tidygraph) library(ggraph) # Parameters z.threshold <- 5 phenotype <- "CeD_2011" # Read the coregulation data coreg.matrix <- fread(paste0("data/", phenotype, "/", phenotype, "_coreg_genes....
4c1ab1ceb85ce523126343a10234b007d3f83fb76af4364c1dbc1a3d756933f7
R
6,149
112
library(RISC) library(Matrix) library(R.matlab) PATH = "/Path to the data/GSE110823" ################################################################################### ### Prepare Data ### ################################################################################### ## All Cells dat0 = readMat(paste0(PATH, "/...
5fe280c5e1ab2fc98b490e0f2b598c500e78984927c110cdf6ef11409ca6d000
R
6,155
176
--- title: "Permutation tests for dFC Mode Metrics - META HCPEP RAW" author: "Fran Hancock" affiliation: Department of Neuroimaging, Institute of Psychiatry, Psychology and Neuroscience, King's College London, London, UK date: "`r format(Sys.time(), '%B %d, %Y')`" fontsize: axtxtpt output: html_document --- ```{r set...
834179a0e578888ce1aaaf7bda3bc4458cb27b837134a6b0af510b4f63670cfd
R
6,164
170
rm(list = ls()) #### to run #### Rscript DBSCAN.EHdn.parallel.R --infile /hpf/largeprojects/tcagstor/users/btrost/papers/STRs/Qatar_ASD/output_regions.min2.1000G+SSC+MSSNG+QASD.txt #### --outpath output/ --a1000g /hpf/largeprojects/ccm_dccforge/dccdipg/Common/annotation/ExpansionHunterDenovo/1000G.samples.txt --sample...
cc07b88f685a806d446ea23f7b12fdd1396d70eb8041397787af7442d2be8c89
R
6,190
185
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_coregulation")} else {setwd("../evaluating_coregulation")} source("../downstreamer_functions.r") source("data/source_olivier.r") library("ontologyIndex") library("ontologyPlot") library("ontologySimilarity") library(tidygraph) library(ggraph) libr...
403794afcc6f60a1839a184727d48a714f9d10649b01c6ea9ba4ce7a574699af
R
6,195
155
#write a new summarization function #1) blast back to the respective region in the respective species to know the exact positions covered by each chunk #2) make a decoder that spits out per base coverage, aka for each base which chunks that are present in the library are covering and what was their per base activity #...
3aa1f8161522d0dd36d8b9b39bad4f29a607b9b47133bd10ef11f177fdb727d8
R
6,202
218
#' Get rowNets #' #' @param object ACTIONetExperiment object #' @param ... other parameters #' #' @exportMethod rowNets setGeneric("rowNets", function(object, ...) standardGeneric("rowNets")) #' Get colNets #' #' @param object ACTIONetExperiment object #' @param ... other parameters #' #' @exportMethod colNets #' @exp...
d21994cb263b83036bd64bb3f2b16d78347c17641a6410d1f7458ebf5b83ab9a
R
6,224
195
#' @tags rng rng-utils utils-internal library(future) make_rng_seeds <- future:::make_rng_seeds with_stealth_rng <- future:::with_stealth_rng parallel_rng_kind <- future:::parallel_rng_kind is_valid_random_seed <- future:::is_valid_random_seed next_random_seed <- future:::next_random_seed is_lecyer_cmrg_seed <- futur...
3de0c35cdaa90095b656bfee86474575dc3d6985be61205aeb72ae6740304b45
R
6,229
181
## ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) # Run this script twice, first without all subjects,...
5879707649c3b46c6b8ca8b673a9305c8ddb5ab4d87d5acd765ddeca8e30d284
R
6,254
209
#' Mandelbrot convergence counts #' #' @return Returns an integer matrix (of class Mandelbrot) with #' non-negative counts (\eqn{C}). #' #' @examples #' counts <- mandelbrot(xmid = -0.75, ymid = 0, side = 3) #' str(counts) #' \dontrun{ #' plot(counts) #' } #' #' \dontrun{ #' demo("mandelbrot", package = "future", ask ...
3e4f35c564bf074bb07d08730b0d24c60360572ec92899ca58e8814fc05a25f0
R
6,272
247
--- title: 'Analysis of effects of cortical inactivation on vowel discrimination in noise using logistic regression ' output: pdf_document: default html_document: df_print: paged word_document: default html_notebook: default --- Version History: * Created: 2021-09-09 Stephen Town * Ported to notebook:...
d6bc6abe9b20dc2eea82d5e71303ba116f474c0850c3ae9911e81bb6769f876d
R
6,274
166
get1000Freq <- function(outlier, fam.1000g){ outlier <- strsplit(outlier, ";")[[1]] count <- sum(unique(outlier) %in% fam.1000g) return(round(count/length(fam.1000g) * 100, digits = 2)) } mergeLoci <- function(loci, mergeAny = T){ cnv.tmp <- loci firstIt <- T olap <- data.frame() while(nrow(olap) ...
6ca1eedd0ab78ddfa1955b88713110456cb275df395f4bc2669a8943b36e84dd
R
6,298
202
my_quants <- function(x) { r <- quantile(x, probs = c(0.025, 0.25, 0.5, 0.75, 0.975)) names(r) <- c("ymin", "lower", "middle", "upper", "ymax") r } my_ggsave <- function(fname, plot, dpi = 300, ...) { ggsave(paste0(fname, ".pdf"), plot = plot, useDingbats = F, bg = "#FFFFFF", ...) embedFonts(file =...
e1b005d68f75b8ffb39d5f9640f87bdf1c15f6d117188648816c49a7b3432450
R
6,320
139
--- title: "motif4node Tutorial" author: "Benjamin Clauss & Mingyang Lu" date: '2023-01-23' output: rmarkdown::html_document: toc: true theme: readable number_sections: true vignette: > %\VignetteIndexEntry{motif4node Tutorial} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r...
b0ea59ff92b8e3f2bf4aa3375682a2aec4007161874354d6290e6a2104a2cdf0
R
6,337
204
my_quants <- function(x) { r <- quantile(x, probs = c(0.025, 0.25, 0.5, 0.75, 0.975)) names(r) <- c("ymin", "lower", "middle", "upper", "ymax") r } my_ggsave <- function(fname, plot, dpi = 300, savepdf = F, ...) { if (savepdf) { ggsave(paste0(fname, ".pdf"), plot = plot, useDingbats = F, bg = "#FFFFFF", ...
2e96f71f6b82f2482b15a3869cace21b71747b97fa7c4ccdf5bdc29dd2734318
R
6,344
211
rm(list = ls()) # the libraries needed and the actual code for this section is within convenience functions in QCfunctions.R source("QCfunctions.R") grp="dc3m" outname<-grp # set wd to QC if needed # setwd(list.dirs(recursive = F)[grep("C_QC",list.dirs(recursive = F))]) # setup directory structure dirSetup(out....
67accb003fb52e0b8a28e691a898a03b607d97b476ea9a72096c0216ded5f114
R
6,377
191
compute.RNA.archetype.to.RNA.archetype.alignment <- function( reference_ace, query_ace, reference_slot_name = "unified", query_slot_name = "unified", deflate = FALSE, reduced_dim = 50, specificity_filter_threshold = 1 ) { reference_profile = rowMaps(reference_ace)[[sprintf("%s_feature_specificity", ...
17e6a07b5295f82226288927ade08dad947b1c31656b6b15d3aa059492eabb0f
R
6,380
281
setwd("D:\\UMCG\\Genetica\\Projects\\GeneNetwork\\compareDecomposeMethods") load("testExpression.RData", verbose = T) str(expSub) genes <- sample(nrow(expSub), 1000) samples <- sample(ncol(expSub), 2000) expSub2 <- expSub[genes, samples] write.table(expSub2, file = "testData.txt", sep = "\t", quote = FALSE, c...
a8745cffbd614edaef1320528f594c8988bb2488bbc027fa3d6b4a6acd7ff72d
R
6,407
132
library(tidyr) library(dplyr) library(reshape2) source("utils_Florian.R") behaviours <- c("rest", "forward_walking", "antennal_grooming", "eye_grooming", "foreleg_grooming", "hindleg_grooming", "abdominal_grooming", "PER_event") n_repetitions <- 5 base_folder <- paste(root_dir, "Ascending_neuron_screen_analysis_pipeli...
93f682d7eeeb970237d030e17733b7c2f95a20a81725754b2264d41e59c6335e
R
6,432
185
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("coregulation_clustering")} else {setwd("../coregulation_clustering")} source("../downstreamer_functions.r") library(apcluster) library(tidygraph) library(ggraph) library(igraph) nodes <- fread("data/networks/ibd_for_paper_2021-20-04/ibd_for_paper_2021-20-0...
0ecb4c9426af706e91eec4b8611695925b22de3aaabb9da2166f9fcd419fbf50
R
6,465
186
## -------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") source("0_Analysis_helper.R") stopifnot(SharedCode_version == c(11,0)) library(abind) library(tidyr) ## --------------------...
7a393963b676fd418f3ad0e1f1623c05f699370c96154cfb41fcad1fe698b400
R
6,495
178
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_coregulation")} else {setwd("../evaluating_coregulation")} source("../downstreamer_functions.r") source("data/source_olivier.r") library(ggsignif) # Cached 2021-04-26 #datasets <- read.downstreamer.batch(main.downstreamer.output.path, USE.CA...
222636c492a9facfad96558603aeb008bd3d4f01612db04173242f3468d2e360
R
6,562
251
test_that("Mixed response works", { dat <- subset(mresp, id < 100) mod <- galamm( formula = y ~ x + (0 + loading | id), data = dat, family = gfam(list(gaussian, binomial)), load_var = "itemgroup", lambda = matrix(c(1, NA), ncol = 1), factor = "loading" ) expect_error( predict(mod, t...
9c32fde31d12a70124ce3f92d923cbacfda53d8e32c3bfcfd695652bd566ff09
R
6,572
172
library(readxl) library(readr) library(dplyr) library(org.Hs.eg.db) library(EnsDb.Hsapiens.v86) library(reshape2) library(plyr) library(DescTools) library(abind) setwd("/Users/philippehabets/Dropbox/Git/fMRI-transcriptomics-cortisol/data") #Read in DEGs DEG <- read_csv2("differential_expression_results.csv")[,-1] DEG...
ffcb5841ea086290f8380eb51e4a0576583dae223b866e153b4a81bd806c23b5
R
6,573
196
## ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) # Run this script twice, first without all subjects,...
d80e35a6599067c7f0953d05054863149ed924c536c6562cf8af2ac9df35cb34
R
6,575
183
########################################################################################## ## GTEx tissue enrichment analysis ## ## Author: Kalliopi Tsafou, Yu-Han Hsu ########################################################################################## rm(list=ls()) library(dplyr) library(ggplot2) # ----------...
112fd479676fe61ace6b206904cedffc5000a253e89cae2c4c4f147e401ce15d
R
6,584
177
#' annotateGenes Annotate genes with genomic coordinates with reference to hg38 using Ensembl based annotation package #' #' @param mtx Count matrix with genes on row names (Ensemble or Symbol) #' #' @return Annotated matrix #' #' @examples #' count_mtx_annot <- annotateGenes(count_mtx) #' @export annotateGenes <- func...
ba4f1df9f23916fcd818e3760f9e49c4f1004ce153ff55ba531e89e70fa7d8dc
R
6,590
171
select.sub <- function( data, start, end ){ # Restrict data.table core usage dt.cores <- data.table::getDTthreads() on.exit(data.table::setDTthreads(dt.cores)) data.table::setDTthreads(1) x <- rep(start:end, end-start+1) y <- rep(start:end, each=end-start+1) data.sub <- data[list(x,y)] data.sub <- da...
45933cf4109089b520e85e362b3f001388d3c9aa52480e0ecfddeb3fda32ca04
R
6,601
256
rm(list = ls()) setwd(dirname(rstudioapi::callFun("getActiveDocumentContext")$path)) options(stringsAsFactors = FALSE); library(WGCNA); allowWGCNAThreads() library(flashClust); library(gplots) library(RColorBrewer) source("../mylabeledHeatmap.R") #plotpars------- mar.eigennet=c(1.5,7.5,0,0.5) oma.eigennet=c(0,0,1,0)...
618ef0b7a7525083857bdcca7ed7d950b26fb9c471fd896f3f582d4771a20260
R
6,624
177
#' @title Control values for galamm fit #' #' @description This function can be called for controling the optimization #' procedure used when fitting GALAMMs using \code{\link{galamm}}. #' #' @srrstats {G1.4} Function documented with roxygen2. #' @srrstats {G2.3,G2.3a} match.arg() used on "method" argument. #' @srrstat...
5a68e630f06bb5f60b6a730d235c333e76913fa99ff2435c7d480def2c59ec47
R
6,626
258
#' @tags nested-futures #' @tags listenv #' @tags detritus-files #' @tags sequential multisession multicore library(future) library(listenv) options(future.debug = FALSE) ## WORKAROUND: R CMD check --as-cran on Windows will report ## ## * checking for detritus in the temp directory ... NOTE ## Found the following fi...
f092f377c118cd48f51eba14f70118c455f0647c9060d27bd5cedbe0635d3cf5
R
6,642
219
#'--- #'title: "Score models on test set" #'author: "Denis A. Engemann, Kamalaker Dadi" #'date: "7/18/2020" #'output: #' html_document: #' code_folding: #' hide #' md_document: #' variant: #' markdown_github #'--- #' #' First execrise: Load all relevant data: #' 1. Predictions...
b6f71d777982a57c5a6c2dcbb4aa66f2fd8e53eaa31ce433bded922eaa6da973
R
6,647
194
########################################################################################## ## Compare and plot co-expression z-scores between bait-interactor pairs vs. other ## gene pairs, using co-expression data derived from 4 transcriptomic datasets: ## Stickels2021, Maynard2021, Velmeshev2019, BrainSpan ## ## Autho...