sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
95e987fef6408886d17e690d0ac4e859847ecaef2a8e280876ce854eabf21ea9
R
6,648
192
#' @tags utils-internal marshalling non-exportable #' @tags detritus-files library(future) find_references <- future:::find_references reference_filters <- future:::reference_filters assert_no_references <- future:::assert_no_references message("*** marshalling ...") ## A connection is a non-exportable reference, w...
b173a520312a54e6702115f35d3654b9d5618c35ede44818b57ad14027fba856
R
6,694
196
#' @tags immediateCondition utils-internal library(future) immediateConditionsPath <- future:::immediateConditionsPath readImmediateConditions <- future:::readImmediateConditions saveImmediateCondition <- future:::saveImmediateCondition save_rds <- future:::save_rds fileImmediateConditionHandler <- future:::fileImmed...
e6516fef352d2d02c74005884447f32b91490aa391ce75c0baf9e7897c044121
R
6,741
189
rm(list=ls()) #### parameters #### to run #### Rscript mergeExpansions.R --rscript ~/crg2/scripts/str/ExpansionAnalysis.R --ehdn /hpf/largeprojects/tcagstor/users/btrost/papers/STRs/Qatar_ASD/output_regions.min2.1000G+SSC+MSSNG+QASD.txt #### --outlier dbscan.tsv --outpath output/ --trf /hpf/largeprojects/ccm_dccforge...
dae6a880c4c2c6bf7b2d1bece2057e4b1983435638caae06e25b926a2605df26
R
6,751
153
library(tidyverse) setwd("/Users/philippehabets/Dropbox/Git/fMRI-transcriptomics-cortisol/data/") # read in DEG results DEG <- read_csv2("differential_expression_results.csv")[,-1] # read Gene Expression by Cell Type, as medians and trimmed means (source: https://portal.brain-map.org/atlases-and-data/rnaseq/human-mu...
aa94b6e72df76f9aced4d175ae4358db0e48de8d65e820970e3a8fb0990aa90d
R
6,752
169
.libPaths(c("/home/che82/R/x86_64-pc-linux-gnu-library/4.1","/usr/local/lib/R/site-library","/usr/lib/R/site-library","/usr/lib/R/library" )) library(rdist) library(SCORPIUS) library(Rmagic) library(pheatmap) library(Linnorm) #######on alignment########## set.seed(1000) library(reshape2) Sys.setenv(RETICULAT...
887f57f9d02be171b5651c69caf12b49ab4e4c1773c382027773e8d507bd6bcc
R
6,753
181
library(dtwclust) library(dplR) library(TSdist) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) # Import combined fluorescent data Data = read.csv('AllDeidentified081921.csv') Data = Data[1:4799,] Data = Data[-c(1)] DataT = t(Data) ##################### # Data preprocess ##################### # ---...
9cfed78422244c77483835f8e17d2be4794af4b5cfe7668cd4ff1e3c6ce61a17
R
6,756
231
--- title: "Time Series Clustering on Fluorescence Data from In Vivo Imaging" author: "Shan Xu" date: "3/30/2022" output: pdf_document --- ```{r setup, include=FALSE} library(dtwclust) library(dplR) library(TSdist) library(knitr) knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE, tidy.opts=list(widt...
a4278885b2cfb5ba083f150818acc2d5ed0eddd69f889d0dcb24023b51a964c1
R
6,775
149
--- title: "RSC: robust integration of single-cell RNA-seq datasets using a single reference space" author: - name: Yang Liu, Tao Wang, Deyou Zheng affiliation: Albert einstein college of medicine, Bronx, NY, United States date: "2021" output: rmarkdown::html_vignette package: RISC vignette: > %\VignetteIndexEntry...
5b32324e204d77eab581ea35105fb23fc0c9ae2885082f9d7ace899e0dd948cd
R
6,822
220
# this code reads top toplogically important Genes and and find the percentile rank of these genes in DEGs library(Seurat) library(future) #save each data as seperate Seurat Object (version3) count <- Read10X("~/public_Data/lambrechts_TME/10x_counts/OvC_counts/") meta <- read.table('~/public_Data/lambrechts_TME/OvC_m...
b9c54fd4a8beb78e02dee4e5d4de5d5518f1d2c8fde5cae209f6b7544f922c50
R
6,826
192
## ## Perform gene set enrichment analysis from a data frame of genes and ranks. ## gse_fgsea = function(stats_df, gene_col, rank_col, species, title = "", pos_label = "Pos", neg_label = "Neg", file_prefix = "gse") { suppressPackageStartupMessages({ library(magrittr) library(dplyr) library(tidyr) l...
fb997de4a0a595f0bf1c7cad9d4074dda6402040525a68d51d15eae6e26ad694
R
6,826
196
source ("Library.R") #####melanogaster#### data= NULL for (i in 1:8) { sname <- paste("Fly",i, sep="") .data = read.xlsx("raw_data_imaging_3E_melanogaster.xlsx",sheetName= sname) %>% dplyr::mutate(Fly = paste(i)) %>% tidyr::gather(key = Frequency, value = response, -Frame, -Fly) .data$Frequency = str_s...
a859034535584679901a5b2887223b924c5fb8308ad5ab4969e066f9ab9ac8be
R
6,878
120
#' Prune out low-quality assignments #' #' Remove low-quality assignments based on the cell-label score matrix returned by \code{\link{classifySingleR}}. #' #' @param results A \link[S4Vectors]{DataFrame} containing the output generated by \code{\link{SingleR}} or \code{\link{classifySingleR}}. #' @param nmads Numeric ...
e4eac29942e74dbaaacd0d3060b8455fed90b5a8e07db1e38a4bfb002acd9cb3
R
6,889
217
source(paste0("C:\\Users\\patri\\Documents\\GitHub\\systemsgenetics\\Downstreamer\\src\\main\\r\\downstreamer_main/downstreamer_functions.r")) setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") mapping <- read.delim("ukbBurden/mapping.txt", stringsAsFactors = F) ensg <- read.delim("ensgR75_protein_coding.txt", strings...
831f80a5310175d7b9d3f6f5e5f5bee5f83d532283b5885c5b64f1c9441236d4
R
6,897
154
library(RISC) library(Matrix) library(irlba) library(umap) library(ggplot2) library(RColorBrewer) PATH = "/Path to the data/GSE132044" ################################################################################### ### Prepare Data ### ############################################################################...
40199ff312aa48f414606808b667d10b8597a8bc20139568eff1bc62f26639fa
R
6,912
187
#' 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...
06c37797b83cb9bce44554901587bf971404c4aa1d4532d5c02b511a8980e947
R
6,913
234
#' @tags futureCall #' @tags sequential multisession multicore library(future) options(future.debug = FALSE) message("*** futureCall() ...") message("- futureCall() - sequential + lazy ...") f1 <- future(do.call(rnorm, args = list(n = 100)), seed = NULL, lazy = TRUE) f2 <- futureCall(rnorm, args = list(n = 100), se...
89a1754ade83b95eef5b623d0d9fccd0af7124f463a8045ba820a35219043c48
R
6,931
144
--- title: "DeconCell quick start and tutorial" author: "Raúl Aguirre-Gamboa and Niek de Klein" date: "`r Sys.Date()`" output: rmarkdown::github_document vignette: > %\VignetteIndexEntry{DeconCell quick start and tutorial} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ## Introduction DeconCel...
f1262070b006ed371bca96a57e6298fa2a6f44a33817a2fe042fdd3c4de6fb1b
R
6,932
144
--- title: "DeconCell quick start and tutorial" author: "Raúl Aguirre-Gamboa and Niek de Klein" date: "`r Sys.Date()`" output: rmarkdown::github_document vignette: > %\VignetteIndexEntry{DeconCell quick start and tutorial} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ## Introduction DeconCel...
b171a842744f415aabcc51440d63f30a63a249de16da39b53bf2494953d0a2c0
R
6,938
188
#' Compartment versus compartment scores #' #' Produces a compartment score quantile versus quantile analysis in which #' observed over expected contacts are compared between the different quantiles #' of the compartment scores. #' #' @param explist Either a single GENOVA '\code{contacts}' object or a list of #' GENO...
22aa3b9664229ffb4610a509f80f53e6f2a0d0a34ce9715cbcc41d4ca4b648ea
R
6,941
114
setwd(paste0(figureDirectory, "Figure5-genome-wide-candidates" ) ) library(ggplot2) library(cowplot) library(RColorBrewer) library(grid) load("numCand.RData") load("compositionPathDF.RData") load("compositionCancDF.RData") load("enrichdf2.RData") numCand <- numCand[numCand$Level == "Gene",] enriched <- enrichdf2[en...
dc10e09119237726afb9dc36a6c2ae5a5af1e7a7251692f59fad6cce7e54e40f
R
6,945
216
#' @importFrom utils file_test #' @keywords internal immediateConditionsPath <- local({ .cache <- list() function(rootPath = tempdir()) { rootPath <- normalizePath(rootPath, mustWork = FALSE) path <- .cache[[rootPath]] if (is.null(path)) { path <- file.path(rootPath, ".future", "immediateCondit...
7654168823dc84a5b8447b26a5cb3183765971d989658099ff1af36bcb50b3c4
R
6,954
261
#' Perform batch correction on `ACTIONetExperiment` and `SingleCellExperiment` objects. #' @export reduce.and.batch.correct.ace.fastMNN <- function( ace, batch_attr = NULL, assay_name = "logcounts", reduced_dim = 50, MNN_k = 20, return_V = FALSE, reduction_slot = "MNN", V_slot = NULL, BPPARAM = Serial...
ab4d2ef5dd0dbf973e72366666e4e4689eb67742e81dcb5e8a12cda247019ce6
R
6,980
210
```{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/final_paper_gfr_network/final_paper_gfr_network...
e69abb5e2461a8ebab300fb45bdc339c03ecc474087767e8c093f7975db190c8
R
6,980
248
--- title: "Permutation testing for dFC Metrics -without subjects with high FD COBRE" 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_documen...
2817ff9ba42fb7148f936794c7c9745ea545a799d37de5eac64327b7696fee0e
R
6,988
271
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)...
5cf158e6f60a1c592bf8b1c16f35574dc0c32582406d85db036bdd04571e6a4d
R
7,009
236
--- title: "(Post-)Preprocessing of proteomics and RNA" author: "Fiona Dick" date: "`r Sys.Date()`" output: html_document toc: true runtime: shiny --- ```{r} library(ensembldb) library(ggbiplot) library(tibble) library(ggpubr) library("DESeq2") require("ggplot2") library(preprocessCore) require("kableExtra") require(...
5c4c43527ed751be21f518a0c6779180e906c9293062b1b53140bab40d386846
R
7,019
207
suppressMessages({ library(tidyverse) library(progress) }) theme_set( theme_minimal() ) options(scipen=15000000) options(dplyr.summarise.inform = FALSE) read_data <- function(filename) { read_tsv(filename, col_types = cols()) |> filter(FDR < 0.01 & abs(IncLevelDifference) > 0.2) |> mutate(event_in_kd ...
4d03c3929ca71ab18df57f60ff001577d1a9cd5f5ac091d94ed9f35951d8019d
R
7,031
230
# This script downloads and preprocesses gene-level data and metadata from # all samples in recount3 # # Output: # A tsv file containing an array of gene expression data, and a metadata file # R version used: 4.1.0 # Some conda issue causes the installation of GenomeInfoDbData to fail silently, preventing # recount3 ...
fe2a824405c9de1c5e6c522878276d505ccc12053aa90c16976b6b169249d756
R
7,038
155
#!/usr/bin/env Rscript ################################################ ################################################ ## LOAD LIBRARIES ## ################################################ ################################################ library(optparse) library(ggplot2) library(reshape...
6f6fd39310e1425bf32c1ddbe8ed6dd270ecda036a6625ef6e6f3aa77796882c
R
7,076
155
#!/usr/bin/env Rscript ################################################ ################################################ ## LOAD LIBRARIES ## ################################################ ################################################ library(optparse) library(ggplot2) library(reshape...
71abeb0e8a83e0632fbaee8fac415bdaf1238c0792fd472f4c36de3dad62a1b1
R
7,081
178
--- title: "02_Exploratory.Data.Analysis" output: html_document --- ## Install packages # ```{r} rm(list = ls()) options(stringsAsFactors = FALSE) library(tidyverse) library(ordinal) library(ggridges) ``` ## Load data # ```{r} ## Load the data load("ABCD.Release.3.0.C4.Merged.Data.PhewasVars.Rda") ``` ## Filter to ...
bdee9d6e70a8c29f9d4a2b4e0e0b0f0cdeb57dbed442e794fc5af3b2b6826891
R
7,086
216
#' Tweak a future function by adjusting its default arguments #' #' @param strategy A future backend or the name of one. #' #' @param penvir The environment used when searching for a future #' function by its name. #' #' @return a future function. #' #' @seealso #' Use [plan()] to set a future to become the #' new defa...
a8da34c9e26148f9a7350fafc4ffc8b4dab22d90a8466d85eee3ea6197ad809b
R
7,090
350
#' @tags plan %plan% #' @tags listenv #' @tags sequential cluster library(future) options(future.debug=FALSE) message("*** plan() ...") cl <- parallelly::makeClusterPSOCK(1L) print(cl) pid <- Sys.getpid() message("R session PID: ", pid) message("*** Set strategy via plan(sequential)") oplan <- plan(sequential) pr...
99a1fa3a14d9a73e5b8de64f0624ee7b68f79e6bef99af5554fe8ed893423b72
R
7,092
225
rm(list = ls()) # the libraries needed and the actual code for this section is within convenience functions in QCfunctions.R source("QCfunctions.R") grp="dc" outname<-grp # set wd to QC setwd(list.dirs(recursive = F)[grep("C_QC",list.dirs(recursive = F))]) # setup directory structure dirSetup(out.name = outname)...
932102ec6063907880831b982b7bc66ac0877743abfeb81650f55e06de93f67f
R
7,133
213
# Genelength and normalized gene scores ```{r} library(ggplot2) library(gridExtra) library(readxl) library(pheatmap) library(RColorBrewer) library(gridExtra) source("../downstreamer_functions.r") # Read reference datasets ensembl <- read.table("~/Documents/data/reference/ensembl/ensembl_gene_position_b37_biotype.txt"...
1afbd4a2d4cc809915b23b40ce94883e961e05bc58f5479d070749d49eb7c508
R
7,140
215
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...
fdc05553a7053dd70e253d41db2cd2c24a6f390170d172e56c49730844212f6e
R
7,146
169
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_coregulation")} else {setwd("../evaluating_coregulation")} source("../downstreamer_functions.r") source("data/source_olivier.r") library(ggsignif) datasets <- read.downstreamer.batch(main.downstreamer.output.path, USE.CACHE = T) mr.data ...
58484646d38760b73a90c9ffe798d09a6f87a0b608710a7924305151c47c6d11
R
7,162
213
# Robin's colours --------------------------------------------------------- #' @name GENOVA_colours #' @title Colours in GENOVA #' #' @description GENOVA comes with a few built-in colour palettes. The gradients #' in GENOVA's palettes have been carefully chosen to be perceptually linear, #' which is great for Hi-C vi...
6bf6b12cf8b84fde103ee863f8661fa491615f8b2d9c5a39b12b96e01d952a5e
R
7,184
216
```{r} setwd("coregulation_clustering") source("../downstreamer_functions.r") library(apcluster) library(tidygraph) library(ggraph) # Parameters z.threshold <- 5 phenotype <- "immune_disease_bonf" # Read the coregulation data coreg.matrix <- fread(paste0("data/", phenotype, "/", phenotype, "_c...
d53d318d0e93ad4804d4284a583e91f264b1abe4b2259bb2eb89faa1dabb46db
R
7,190
155
source ("Library.R") #####Figure 1##### RMTL = NULL data <- read_excel("copulation_rate.xlsx") %>% dplyr::mutate(ctime=ctime/60) %>% dplyr:: mutate(event=ifelse(ctime>30, 0, 1)) %>% dplyr:: filter(ctime > 0) mel1535 <- data[(data$species == "mel" & (data$IPI ==15 | data$IPI ==35)),] %>% dplyr:: mutate(soun...
36a8f9ae0bb647ff9fa1dcf2eea7e522707d85ac02788475db1c65fa6678fce9
R
7,198
269
CPal_default = c( "#1F77B4", "#FF7F0E", "#279E68", "#D62728", "#AA40FC", "#8C564B", "#E377C2", "#B5BD61", "#17BECF", "#AEC7E8", "#FFBB78", "#98DF8A", "#FF9896", "#C5B0D5", "#C49C94", "#F7B6D2", "#DBDB8D", "#9EDAE5", "#AD494A", "#8C6D31", "#E31A1C", "#FFD700", "#771122", "#777711", "#1F78B4", "#68228B", "#AAAA44",...
6fa50e6129f4bc5ceaf4fb3340abf9b81a8b7949b6b82023bd62819edcba3f70
R
7,231
173
#' Fast run #' #' High-level wrapper for all functions, can easily get all the results #' #' @param reads_1 (Required). The file path to the forward fastq file from paired-end sequence data. Compressed file formats such as .fastq.gz are supported. #' @param reads_2 (Required). The file path to the reverse fastq file fr...
76033c9120d8cc4189a357f8129de046b817e499290a1544c0250f559c8d91b1
R
7,324
245
# Upset plot of AD Loci library(dplyr) library(tidyr) library(purrr) library(janitor) library(tibble) library(glue) library(stringr) library(readr) library(forcats) library(glue) library(ggrepel) library(plotgardener) library(GGally) `%nin%` = negate(`%in%`) ## Snakemake ### Input ad_loci.path = "results/adgwas_loci...
28b47e465a18c9ce59e6b4d2a43020045d40051b3666f3065043f4b499d23ad1
R
7,335
188
#!/usr/bin/env Rscript library(data.table) library(simGWAS) library(mvtnorm) library(corpcor) # Function definitions #--------------------------------------------------------------- # Function to read haplotype block gethap <- function(i) { y=fread(ldd$comm[i], skip="#CHROM") ha <- simGWAS:::vcf2haps(as.matrix(y[,...
7a4d92bba6c46421a0cf08c527c5b98d5d815e1442c2479506a3c19260ac0237
R
7,370
197
# SETTINGS ---------------------------------------------------------------- libs<-c("tidyverse","GenomicRanges","data.table","Biostrings","microRNA", 'reshape2') sapply(libs, require, character.only=T) system('mkdir -p output/mpra_chunk') # READ IN SEQUENCES ------------------------------------------------------- ...
5d614fc9d8940265988cd723b6c64db6e643ceb44900fdfe04183f9fcd32d5d6
R
7,385
138
.munge_main <- function(i, utilfuncs, file, filename, trait.name, N, ref, hm3, info.filter, maf.filter, column.names, overwrite, log.file=NULL) { if (is.null(log.file)) { log.file <- file(paste0(trait.name, "_munge.log"),open="wt") on.exit(flush(log.file)) on.exit(close(log.file)) } else { .LOG("\n\...
d286212488e7f06a453ec09d558f6af843871c562276e789e3c955ca3802fbe4
R
7,401
226
source ("Library.R") #####melanoagster##### data= NULL for (i in 1:12) { sname <- paste("Fly",i, sep="") .data = read.xlsx("raw_data_imaging_4B_melanogaster.xlsx",sheetName= sname) %>% dplyr::mutate(Fly = paste(i)) %>% tidyr::gather(key = IPI, value = response, -Frame, -Fly) background = .data %>% ...
6d11332172043da1989bd3c4624df5441c312d4ff222defa0195190ad600d7e7
R
7,403
182
#!/usr/bin/env Rscript require(optparse) option_list <- list( make_option(c("--ref2bit"), type="character", default=NULL, help="genome 2bit file of", metavar="character"), make_option(c("--other2bit"), type="character", default=NULL, help="genome 2bit file of", metavar="charact...
5f328c5a935eaa3a84db5fc7f80341481d96fc64665bcd2cd6fa1782ebfee940
R
7,431
303
#Code to generate matrix from: http://r.789695.n4.nabble.com/Re-Generate-a-serie-of-new-vars-that-correlate-with-existingvar-td822187.html # create the initial x variable x1 <- rnorm(100, 15, 5) # x2, x3, and x4 in a matrix, these will be modified to meet the criteria x234 <- scale(matrix( rnorm(300), ncol=3 )) # p...
5fbe1e134bc6d9152cbbf64096acc531920d6b9620aa3f4bc04e322bd23e1823
R
7,446
167
#' Annotate scRNA-seq data #' #' Returns the best annotation for each cell in a test dataset, #' given a labelled reference dataset in the same feature space. #' #' @param test A numeric matrix of single-cell expression values where rows are genes and columns are cells. #' Alternatively, a \link[SummarizedExperiment]{S...
f85abae3bb716591dce13d07dc50ae57e634b8b2d072c2928ded1d6bf5866620
R
7,498
188
library(tidyverse) library(sf) library(rlang) library(reshape2) library(ggthemes) library(patchwork) ##function for data processing using imagej cell counter over an image z stack ##you need to know: #the pixels per micron #the file path to the folder with 1) manual counts with the ImageJ Cell Counter plug...
74d786570414b91b28cd42c3b7630f75f9ab6023e1521a8c7acb861ac0ee9375
R
7,499
185
library(readxl) # Loading data ensembl <- unique(read.table("~/Documents/data/reference/ensembl/ensembl_gene_position_export.bed", stringsAsFactors = F)[,c(4,5)]) rownames(ensembl) <- make.names(ensembl[,2], unique=T) # Function definitions simpleQQPlot = function (observedPValues) { plot(-log10(1:length(observedPV...
df9390440a76fdd2a2abd3b6631fed6c0d7d6040f8f31211ee98db9f7c963aed
R
7,513
215
--- title: '-' output: html_document: css: ~/my_lab/my-lab_folder/resources/rmark.css date: '' --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) knitr::opts_chunk$set(warning = FALSE) library(tidyverse) library(hrbrthemes) library(ggtext) theme_set( # theme_ipsum_rc(grid = 'XY') + theme_...
3bbdbbdd151b9ddd2de8892499a76059c69ac76b5d60bb39d3271b86aaddc8a2
R
7,523
170
library(readr) library(rlang) library(reshape2) library(tidyverse) library(readxl) ##this function is for compiling auditory physiology assessed by ##the Eaton-Peabody Laboratory Cochlear Function Test Suite, where ##the ABRs have been thresholded and peaks selected with ##ABR Peak Analysis Version 1.5.5.56...
627491c9cfe4eee9ae1208aa586270349a6ceb1d9819b555248af2c1b4887da1
R
7,548
238
setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(readr) eqtl <- read_delim("2019-12-11-cis-eQTLsFDR0.05-ProbeLevel-CohortInfoRemoved-BonferroniAdded.txt.gz", delim = "\t", quote = "") #eqtlFull <- read_delim("2019-12-11-cis-eQTLsFDR-ProbeLevel-CohortInfoRemoved-BonferroniAdded.txt.gz", delim = "\t", quo...
cfccd2d873f4b5a82845f602a4170db7ea4600a1c3b52bcf065fa6c9a2e7177b
R
7,565
233
#################################################################################### #' Utilities Subset data #################################################################################### #' #' The "Subset" function can abstract a data subset from the full dataset, this #' function not only collect the subset ...
237727ec1e2f993af434e64a2a9043d1fad153a1aaf84391f6cd59a76a717aa5
R
7,572
172
#Generate boxplots for s steps backwards up to maxstepsback across all attrs in all 28 networks # Plot number of predecessors M/2^netsize # Get mean/median/SD/IQR for each step across nets if(!require("BoolNet",character.only = TRUE)) install.packages("BoolNet") if(!require("gtools",character.only = TRUE)) install.pa...
8e91073a250343a18fec91acef68897179ec54d5c687c3a95c0f51b559291705
R
7,614
196
library(igraph) net.bc <- readRDS('~/HumanNetv3/XC_nobatch/BC/BC_celltypeNet_list_LLS.rds') net.lc <- readRDS('~/HumanNetv3/XC_nobatch/LC/LC_celltypeNet_list_LLS.rds') net.crc <- readRDS('~/HumanNetv3/XC_nobatch/CRC/CRC_celltypeNet_list_LLS.rds') net.ovc <- readRDS('~/HumanNetv3/XC_nobatch/OvC/OvC_celltypeNet_list_LLS...
35e47418512fbf0930586dabffb88b3c6f1a564fb84c1742cf6e673dedd4aa70
R
7,617
162
convert.en2eg <- function() { require(org.Mm.eg.db) require(biomaRt) xx <- mappedkeys(org.Mm.egENSEMBLTRANS2EG) print(length(xx)) print(xx[1:5]) mart <- useEnsembl(biomart = "ensembl", dataset = "mmusculus_gene_ensembl", mirror = "useast") mart <- useD...
3d9e8a120937ab4d3a788822dee5125a82a035827b099793dd164de058f9bca2
R
7,621
162
#!/usr/bin/Rscript library(optparse) library(ggplot2) library(data.table) library(reshape2) library(grid) library(gtable) library(ggpubr) library('scales') option_list = list( make_option(c("-e", "--eqtlGenReplication"), type="character", help="File containing the replication of MetaBrain in eQTLgen a...
c87217c90739bb10809354ea2e77545751e3dc6bce10b1cf2c247e3e0155fc3d
R
7,630
204
```{r} setwd("umap") source("../downstreamer_functions.r") source("data/source_olivier.r") library(umap) #pc.file <- "zcat /groups/umcg-wijmenga/prm02/data_projects/Gado/GeneNetwork_V2_01-02-2018/Covariates/PCA/pc-scores1588.txt.gz" pcs <- fread(pc.file, data.table=F) rownames(pcs) <- pcs[,1] pcs ...
ad1ed464e946c379b3c44ab5b129447aa6fc36cf18a46833600b33608d611807
R
7,655
211
--- title: "Quick_start.Rmd" author: "Chenxin Li" date: "2023-01-20" output: html_notebook --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Introduction This is a workflow for set/intersect visualization using [UpSet plots](https://github.com/hms-dbmi/UpSetR). The upstream segme...
deefd9820ceb4b6f8f8d3df19a4ce8f64449025e2ed70d1526ffe9512e7bc3ca
R
7,669
350
#' @tags globals #' @tags manual #' @tags sequential multisession multicore library(future) options(future.debug=FALSE) message("*** getGlobalsAndPackages() ...") FutureGlobals <- future:::FutureGlobals globals <- structure(list(a = 1), where = list(a = globalenv())) globals <- FutureGlobals(globals, resolved = TRU...
63dd8b167d01583a082db2bd7560a26a37703a22ba25681f22bf1d84c1100d7a
R
7,775
161
#!/usr/bin/env Rscript ################################################ ################################################ ## LOAD LIBRARIES ## ################################################ ################################################ library(optparse) library(ggplot2) library(reshape...
a71acf10ff0abbe5d14996efe3ecf365e96b13afa032c32d67f15ac5a945ed0e
R
7,825
225
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_pathways")} else {setwd("../evaluating_pathways/")} source("../downstreamer_functions.r") # Cached 2021-01-07 15:15 datasets <- read.downstreamer.batch("../data/final_paper_cov_correct", USE.CACHE = F) datasets.raw <- read.downstreamer.batch("...
a6ba5aacab984967b4b0f3fae33f03c916b8c0fa5aade03e28e0673413dd2a4a
R
7,852
232
## -------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) subjects <- readRDS(file.path(dir_data_misc, "HCP_S1200_LargeBalancedSample.rds")) it...
430c84b83a041cbb8dd45a5d2adfb484ff35640249e93533d19493876140dfe9
R
7,859
183
# Organize (re-order, rename, group) the cortical and subcortical labels. source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) ### `ParcMat` ------------------------------------------------------------------ # Read in Kong parcellation parc_cii <- read_cifti(parc_cii_fname) nVox <- nrow(parc_cii)...
b2675809369c404bee0f081dff358c9220e581e6796ee6a0beb64d8a188eaac1
R
7,876
228
#' Insulation matrix plot. #' #' Display a Hi-C matrix with insulation scores annotated in the margins. #' #' @param exp1 A GENOVA \code{contacts} object. #' @param exp2 A GENOVA \code{contacts} object compatible with \code{exp1} #' (optional) or \code{NULL}. If not \code{NULL}, the \code{exp2} argument #' will ...
77b743f4b4bcfd44a5dbd9d4e8709fbe6f02c46d2c6760e9bf8bfa447d6892b8
R
7,886
206
#' Plot delta distributions #' #' Plot the distribution of deltas #' (i.e., the gap between the assignment score for the assigned label and those of the remaining labels) #' across cells assigned to each reference label. #' #' @inheritParams plotScoreDistribution #' @param chosen.only Logical scalar indicating whethe...
e518965500ac37c73a15d2b5c5f07554dde04adf28d90008c142b20d859461cb
R
7,922
194
setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(eulerr) set.seed(1) humanSkeletal <- read.delim("heightVenn/humanSkeletal.txt")[,1] mouseLethal <- read.delim("heightVenn/mouseLethal.txt")[,1] mouseGrowth <- read.delim("heightVenn/mouseGrowth.txt")[,1] ehlersDanlos <- read.delim("heightVenn/EhlersDanlos.tx...
02158cd6d508e60b0d731fa0b60da2cb9a7d3dcd4df2c5b611fea65edb0e1085
R
7,936
220
# This tests that combineRecomputedResults works as expected. # library(testthat); library(SingleR); source("test-recomputed.R") library(testthat); library(SingleR); set.seed(10000) # Making up data (using an uneven distribution to avoid symmetry masking problems). ref <- .mockRefData(nreps=8) ref1 <- ref[,1:4%%4==0...
31d4e311096ce9b1a433bedae067661713d901899ebafa70f739192e0a183815
R
7,941
195
library(tidyverse) library(xtable) #function summarize_cor_output<-function(path_to_cov_file){ L <- readLines(paste0(path_to_cov_file)) #get the included parameters params1<-which(grepl("entries are", L)==T) params2<-which(grepl("covariances", L)==T) params<-L[(params1+1):(params2-2)] #correlations & ...
824c20a2c72182d4c29ce7957436d996128d819a7730499a6b7bfcb47fccef73
R
7,944
272
library(tidyverse) theme_set(theme_bw()) theme_update( panel.grid = element_blank(), strip.background = element_blank() ) library(patchwork) library(ggrepel) dat <- readRDS("data/cognition_model/dat.rds") files <- list.files("results/cognition_model/simulation/summaries/", pattern = "theta0.rd...
e08ade651ebbbac462f7a9ad5e513db173f386b1235379b47ca7ffe688d0753a
R
7,946
211
########################################################################################## ## Rare variant risk enrichment analysis of ASD PPI networks ## using gene-based scores and KS test ## ## Author: Yu-Han Hsu ########################################################################################## rm(list=ls()...
f735a841ef6ffb3899eaf7efc7e2f699f1f9b0b00ac887329dcdf58b96e6b56c
R
7,981
253
#' @title Summarizing GALAMM fits #' #' @srrstats {G1.4} Function documented with roxygen2. #' @srrstats {G2.1a} Expected data types provided for all inputs. #' @srrstats {RE4.11} Goodness-of-fit and other statistics associated such as #' effect sizes with model coefficients. #' @srrstats {RE4.18} Summary object. #' ...
741b1f754f604595f3e725d6e9d1a20019842ef3e1d332d4f0b16eded7488bb1
R
8,038
273
--- title: 'Analysis of effects of unilateral cortical inactivation on sound localization using logistic regression ' output: pdf_document: default html_document: df_print: paged html_notebook: default --- Version History: * Created: 2021-09-11 Stephen Town * Ported to notebook: 2022-05-16 Combine data...
3d32cdfd26aaf0ba79aa617dc4c7610eae461d78168afe18b106f9e68c29bef4
R
8,043
166
library(RISC) library(irlba) library(umap) library(ggplot2) library(RColorBrewer) PATH = "/Path to the data/GSE114727" ################################################################################### ### Raw Data ### ################################################################################### # BC09 rep1 c...
2c01fc89d7e13b20d2bd23498dde9a5461cdee439d1e81f95a8d9b93228bf921
R
8,050
233
# Get the expression matrix # Sys.setenv(RETICULATE_PYTHON = "/home/rkawaguc/anaconda3/envs/BICCN/bin/python") library("pROC") library("reticulate") py_config() suppressPackageStartupMessages({ library("ggplot2") library("SingleCellExperiment") library("Seurat") }) source_python("read_pickle_data.py") l...
325d065792c6729a10cf38d2f293a35ae9840ab24fedccb3caf046de642628b4
R
8,056
205
#' DeconvoluteNet #' #' @description Deconvolution of geneset connectivity for each scHumanNet constructed #' #' @param network.list network list of edgelist, this is the output of SortAddLLS #' @param geneset character vector of geneset it can also be a list of multiple geneset #' #' @return dataframe of that stores a...
f91d43dc9bdcaca34e7e561e0664f989dce8447361b04ba695c5ec3677988821
R
8,136
242
#################################################################################### #' Dimension Reduction. #################################################################################### #' #' Based on highly variably expressed genes of the datasets, RISC calculates the #' principal components (PCs) of the cel...
d4beb7a882732d7e2de7ab898970b31c15b5cf52a84f0c21bd794f471589fd2e
R
8,140
249
library(data.table) library(arm) source('../config.r') source('../utils.r') extra_path <- file.path('..', 'figure-2', 'inputs') new_path <- file.path('..', 'figure-S2', 'inputs') #' Get together all input files. #' First the extra data files. We'll write a function for that. #' stack_wide2 <- function(DT) { DT_w...
354abcb5eedc306fb9e1659268047dedcb7536f00e1d5ba8b57db8c26c8934d4
R
8,158
254
--- title: 'Analysis of effects of bilateral cortical inactivation on sound localization using logistic regression ' output: pdf_document: default html_document: df_print: paged html_notebook: default --- Version History: * Created: 2021-09-11 Stephen Town * Ported to notebook: 2022-05-16 Combine data ...
9c8a743f48b5e576edcf910d2eefac0403a8ec9e54fc292f3b08c5816582d67b
R
8,160
148
#' Aggregate reference samples #' #' Aggregate reference samples for a given label by averaging their count profiles. #' This can be done with varying degrees of resolution to preserve the within-label heterogeneity. #' #' @param ref A numeric matrix of reference expression values, usually containing log-expression val...
9b48c8571b832a7dbd2f555a9b161419480c7a5cfeb3050d5ca2ab933e41c8bb
R
8,169
288
#' @tags relaying immediateConditions #' @tags sequential multisession multicore library(future) options(future.debug = FALSE) f_try <- function(f, ...) { res <- tryCatch(..., error = identity) if (inherits(res, "error")) { label <- sQuote(f$label) if (length(label) == 0) label <- "<none>" msg <- spri...
13f346e7ccf30e192bd761e39e72b27084f42e0d48c3ec46f8b7340afc1cd2e1
R
8,170
192
--- title: "Understanding Kurtosis-based PC selection" author: "Damon Pham" date: "1/20/2021" output: html_document --- # Setup ```{r} source("0_SharedCode.R") stopifnot(SharedCode_version == c(6,1)) library(ggplot2) ``` ```{r} # Parameters --------------------------------- nCC <- c(2, 5)[1] withCblm <- c(TRUE, FAL...
a9e94a4d192536b7050188b424e3a6e157a99c1d8693cf757ea3b7e0b79f2426
R
8,191
201
library(MASS) library(cowplot) library(data.table) source("/nfs/users/nfs_o/ob7/tools/rscripts/plotting_functions.r") #source("downstreamer_functions.r") output.prefix <- "../analysis/simulated_data/sim_data_300_genes" dir.create(output.prefix, recursive = T) # -------------------------------------------------------...
bbbeff78520e2951c91b8294e5a6806338b2ff4258e431b3bf1eea03006e1d35
R
8,200
197
#load libraries libs<-c("tidyverse","cowplot","data.table","reshape2", "broom", "ape", "ggtree", "readr","geiger","nlme","phytools","GGally","RColorBrewer","rr2","purrr") sapply(libs, require, character.only=T) setwd("/data/share/htp/TRNP1/paper_data/") source("regulation/scripts/MPRA/MPRA_helper_functions.R") ####...
292731d8be76d6872d97ba472f7f0ef128ea4af93b0cfe076d31adba984f4033
R
8,216
187
--- title: "Shuffled ranked genes of RRHO" output: html_notebook --- This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. #load libraries ```{r} library(tidyverse) library(ggplot2) library(ggfortify) library(ggrep...
00f4cb925a0ad2b0af489795793a83ea8883a9bef48928b9d4352cd8ae4f7a63
R
8,217
221
library(tidyverse) library(furrr) library(patchwork) library(latex2exp) library(gghalves) options(bitmapType = "cairo") theme_set(theme_bw()) library(mgcv) sim_params <- readRDS("data/ses_model/sim_params.rds") files <- list.files("results/ses_model/simulation/summaries/", pattern = ".rds", full.na...
56b4008ace34c34e498b4c6c6b146f04b301758299da328ec84681d2518166a8
R
8,217
228
library(MungeSumstats) library(tidyverse) library(tabulizer) library(fuzzyjoin) library(plotgardener) data(sumstatsColHeaders) setwd("/Users/sheaandrews/Dropbox/Research/PostDoc-MSSM/ADGenetics/") chia_ss.raw <- read_tsv("~/Downloads/GCST90001390_buildGRCh38.tsv.gz") # ~/Dropbox/Research/PostDoc-MSSM/ADGenetics/reso...
44a1a399419126f5cc205d2b958850adff9a9f05f30b3043f8427fcc02ef5edb
R
8,346
191
## ## Calculate DESeq2 results, generate tables, heatmaps, and gene set enrichment. ## deseq2_compare = function(deseq_dataset, contrast = NULL, name = NULL, genome = NULL) { suppressPackageStartupMessages({ library(magrittr) library(dplyr) library(tidyr) library(glue) library(DESeq2) libra...
224457e98bc3f3f5b37091cbee38b6981bc11cc3ed3a8923ef1d3a0fd84b2e14
R
8,354
193
if(!require("BoolNet",character.only = TRUE)) install.packages("BoolNet") if(!require("ggplot2",character.only = TRUE)) install.packages("ggplot2") library("BoolNet") library("ggplot2") starttime <- Sys.time() every_nth = function(n) { return(function(x) {x[c(TRUE, rep(FALSE, n - 1))]}) } update_geom_defaults("poin...
96e4579c239fcc8460bbffe89bd3c5c4f991f5d1d27f7ce308ea0f22616a0610
R
8,413
291
getCorrelationCN <- function(CNVref, CNVcomp){ df_1 <- as.data.frame(approx(CNVcomp$Pos,CNVcomp$Mean, seq(min(CNVref$Pos,CNVcomp$Pos),max(CNVref$Pos,CNVcomp$Pos), by = 1), ties = "ordered")) df_2 <- as.data.frame(approx(CNVref$Pos,CNVref$Mean, seq(min(CNVref$Pos,CNVcomp$Pos), max(CNVref$Pos,CNVcomp$Pos), by = ...
448e3c2b6902f7efcb66f2ca9fd86445c5846421bd652dace99be86d442eb5cf
R
8,414
251
## -------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) ## ---------------------------------------------------------------------------------...
e794b0fe0b13392b089e6d5b6bbf7be12892574f8162e182b285c9b766ed08f6
R
8,428
186
# Jags-Ymet-Xnom1grp-Mnormal-OHOHA.R # Based on code accompanying the book: # Kruschke, J. K. (2015). Doing Bayesian Data Analysis, Second Edition: # A Tutorial with R, JAGS, and Stan. Academic Press / Elsevier. # Adapted for steady-state rate specific analysis for the OH family of tasks. source("../DBDA2E-utili...
6fc95a6a2856ed292ab32ec59ee961f8c357c384cea9d2347a620a9d514bc7ab
R
8,444
251
## -------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) ## ---------------------------------------------------------------------------------...
d76daeb4a7a61c6ac909c8773df9d7d44c6bbedc2be2581f986ec0a5703129f6
R
8,465
193
library(RISC) library(irlba) library(umap) library(ggplot2) library(RColorBrewer) ################################################################################### ### Prepare Data ### ################################################################################### PATH = "/Path to the data/GSE85241_GSE81076_GSE...
5c0bf79655cfad8c78a7db7f9ba23d99efe9e86ae177da446555435fcb2b7f2b
R
8,479
252
## -------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_SharedCode.R") stopifnot(SharedCode_version == c(11,0)) subjects <- readRDS(file.path(dir_data_misc, "HCP_S1200_LargeBalancedSample.rds")) it...
92fe0870b8b2ea279aa674a40776afa0b76cf89fd7b1226efac8900d87a5c196
R
8,492
283
compute.pairwise.alignment <- function( reference_profile, query_profile, reduced_dim = 50, log_transform = FALSE, deflate = TRUE, seed = 0 ) { set.seed(seed) if (log_transform == T) { if (max(query_profile) > 100) { query_profile = log1p(query_profile) } if (ma...
a3ee02806578d28fd2b4f4b38bf9819650b75deb64e946601e6723938ea8f8ed
R
8,516
321
#' @tags resolve #' @tags list listenv environment #' @tags sequential multisession multicore library(future) library(listenv) options(future.debug = FALSE) sleep <- function(n) Sys.sleep(0.01*n) strategies <- supportedStrategies() message("*** resolve() ...") message("*** resolve() for default ...") x <- 1 y <- ...