sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3b34710ff061a7a4cc436a73af277133cdf1e0db5db18e2c47d5388ca8e2c74d
R
14,584
569
#' Compute the activity score of each TF based on the observed activity of its targets. #' (Similar to ChEA3; it is based on a meta-analysis using 4 separate datasets) #' #' @param scores Matrix of genes x cell type/state #' #' @return Matrix of TF x cell type/state indicating inferred TF activity scores #' #' @example...
34746dacf86fb513a21fa1375bb8bbc2016d94af9d35c9d720a9fe293ea1acf8
R
14,613
456
colTypes <- cols( .default = col_double(), `...1` = col_character()) table_tmp <- read_delim("/groups/umcg-bios/tmp01/users/umcg-pdeelen/nod2genotypes_1000g.txt.dosages.txt", delim = "\t", quote = "", col_types = colTypes) dosages1000g <- as.matrix(table_tmp[,-1]) rownames(dosages1000g) <- table_tmp[,1][[1]] rm(tabl...
89c68fac1e04974f18d28ae1518a1c2f9642c346da1f9642daf323abdc4fd4d1
R
14,670
365
#this code sees if upregulated DEGs and increased centrality can be comparable and draws Venndiagram for each #there are very small DEGs...lets just see if these gene are actually in the non zero pos or neg diff ranked genes of networks df.rank.cond <- read.table('/home3/junhacha/HumanNetv3/Velemeshev2019/condition_me...
336e3ce19ad0e50d335ea9ce9a91c4cfb5da602ca42a2db609fa6403dba5951a
R
14,681
368
# TF expression and binding to the DHS, particularly intron #load libraries libs<-c("tidyverse","cowplot","GenomicRanges","data.table","reshape2", "broom", "ape", "ggtree", "readr","geiger","nlme","phytools","org.Hs.eg.db","DESeq2","flashClust","topGO", "biomaRt","vsn","GGally","pheatmap","RColorBrewer") sapply(libs,...
b4f239a9577f136b7dabaf54591bc6c1986d2216c2b3ea8a7df08037f36a9fb8
R
14,687
385
# uses marker lists downloaded from Panglao and CellMarker library(biomaRt) human = useMart("ensembl", dataset = "hsapiens_gene_ensembl") mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl") # fix the table------------ # mgenes<-getBM(attributes = c("mgi_symbol"),mart = mouse) # h2genes<-mgenes$mgi_symbol[gr...
47d137d4332383303eef13475b9f3d445331fce42b4a86012130958d8c123b59
R
14,697
440
library(MungeSumstats) library(tibble) library(tidyr) library(readr) library(purrr) library(plyr) library(dplyr) library(stringr) library(forcats) library(tabulizer) library(fuzzyjoin) data(sumstatsColHeaders) # Snakemake input & output lambert.path <- snakemake@input[['lambert']] kunkle.path <- snakemake@input[['kun...
6da9a805d387defcf2dad6b75c60e35ba4f355018673ae35b0cdf13e22eeb0f0
R
14,751
303
library(plyr) library(ggplot2) library(reshape2) library(lme4) library(lmerTest) library(plotrix) library(coin) ## read data file cb.df = read.csv('data_pnas_chengetal2023.csv',header = TRUE) cb.df$ROI.hm = paste(cb.df$ROI, cb.df$hemisphere,sep = "") ## calculating individual summed adjusted volume, cortical thickn...
c1910a60462bc188f71fd7b08e32a6b816648cff71b3dc887fc54dc0bd3fac2e
R
14,858
221
--- title: "Understanding the HCP ICA-FIX Pre-processing Pipeline" author: "Damon Pham" date: "1/01/2021" output: html_document --- ```{r} source("../analysis/0_SharedCode.R") stopifnot(SharedCode_version == c(10,0)) scan_dir <- "/N/dcwan/projects/hcp/103818/MNINonLinear/Results/rfMRI_REST1_LR" ``` __Goal: to unders...
7c3bf6eda3188a986eb448d524eb1f9c1aace8a1b411459d751aa7f101271944
R
15,206
317
# Bayesian Data Analysis on Steady State Rates in OH family of tasks # Based on code and analysis from "Doing Bayesian Data Analysis, 2nd Edition", # John Kruschke, 2014. # Copyright (C) 2022 Richard Hugh Moulton # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
5e55a6eafee18a0ca3963e861b18071af9cfc24c24fd3a74b844b58d37819179
R
15,214
360
###-------- ### r.a.aguirre.gamboa ### DeconCell ### Functions #' Pre-process RNASeq based expression data. #' \code{dCell.expProcessing} Performes a TMM normalization, log2(counts+1) and scaling. #' #' @param count.table A table of quantified gene expression, samples by columns and genes by row. #' @param trim boolea...
2d13a101785cf04c1be4529edded8d80ea2403b5a5f9ef5c57f6ab0e046090d7
R
15,317
513
#' A wrapper function to call all main functions of the ACTIONet #' #' @param ace Reduced `ACTIONetExperiment (ace)` object (output of reduce.ace() function). #' @param k_max Maximum depth of decompositions (default=30). #' @param min_specificity_z_thresh Defines the stringency of pruning nonspecific archetypes. #' The...
99105b7da5734be7272c4bf7f0c0dbc9f54d3fbe7c597fe3c038dde768c1b100
R
15,349
330
--- title: "Models with Mixed Response Types" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Models with Mixed Response Types} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, ...
3d0331b11ba9c1db89a73b275cc8f899ada623d94ed30bd0a2cbb0a9f36dfab3
R
15,355
386
# Tests for visualization functions # library(SingleR); library(testthat); source("setup.R"); source("test-heatmap.R") colnames(test) <- sprintf("cell_%i", seq_len(ncol(test))) pred <- SingleR(test=test, ref=training, labels=training$label, genes="de") test.exp <- assay(test,1) training.exp <- assay(training,1) test_...
af10c85ef0e0157c058df5d5095a5bfd1e550558edb1a4a7caff45cd554616c7
R
15,357
407
--- title: "Semiparametric Latent Variable Modeling" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Semiparametric Latent Variable Modeling} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8...
bfd5816985ea287d872a3bd84c0368c0275152a6996acdad074b92ee02449867
R
15,406
442
--- title: "Generalized Linear Mixed Models with Factor Structures" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Generalized Linear Mixed Models with Factor Structures} %\VignetteEngine{knitr::rmarkdo...
1b05326788acad9c14de5c7198d177932e863c4d7cf5012441c1686cded98dfc
R
15,424
513
#remoter::server(verbose = T, port = 55556, sync = T) remoter::client("localhost", port = 55556)#55556 55501 setwd("/groups/umcg-fg/tmp01/projects/downstreamer/depict2_bundle/") library(readxl) read.depict2 <- function(path, potential_traits=NULL) { if (is.null(potential_traits)) { potential_traits <- ...
62ec97264ae72448a3090f1f982d86da780c208c1d3f935a54d7d9556203fd1f
R
15,460
368
################################################################################################################### #This script is based on and modified from Jeremy Miller's "Meta-analyses of data #from two (or more) microarray data sets" tutorial #Miller's tutorial and related files can be found at: #https://...
41caa9db0e2d5740d33efe0e4e99b2827769ec5c7884215c010e93a3b6135027
R
15,548
596
map.clusters <- function(Labels, clusters) { N = length(Labels) cluster.ids = sort(unique(clusters)) if (is.factor(Labels)) Label.ids = levels(Labels) else Label.ids = sort(unique(Labels)) W = sapply(Label.ids, function(label) { idx1 = which(Labels == label) n1 = length(idx1) ...
829a5ccb841e3b8100545980b1c009ddcaaafb02f61086b90092a1bea1d549ba
R
15,645
421
getGenes <- function(out_file_name, segmentation, pval_threshold, baf, ensembl_dataset, mart_database, html, correction){ ## This function generates the html file reporting the list ## (with the respective details) of each gene overlapping a significant region eps <- 0.00000001; message("Connecting to ...
17f0b8f936920dd482c4ba264d1746009f9dbf55771ef00184a56a5f6ea34b18
R
15,697
516
--- title: "Customized_upset_plot" author: "Chenxin Li" date: "01/19/2023" output: html_notebook: toc: yes toc_float: yes --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Introduction This is a workflow to generate upset plots with custom aesthetics. # Dependencies ...
acc587719701a35972fdc4f94be0a2a9e3f3f452944191efe2b92e6555802288
R
15,701
311
--- title: "08_PRSxGREx.Brain" output: html_document: df_print: paged --- ## Install packages # ```{r} rm(list = ls()) options(stringsAsFactors = FALSE) library(tidyverse) library(lme4) library(lmerTest) library(ggseg) library(sjPlot) library(interactions) ``` ## Load data # ```{r} ## Load data load("ABCD.Rele...
0ed30666752415296454ad06782e8699343b9f9b7520922461c0069fac89838e
R
15,738
543
#' @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...
04f5b0b77d0ec8e44f335248d3fa81fafc73f0453fc27f2178250781b5de16b9
R
15,990
461
#' Gets the logged journal of events for a future #' #' _WARNING: This function is under development. It can change at any time. #' For now, please, do not depend on this function in a published R package._ #' #' @param x A [Future] object. #' ## @param baseline (POSIXct; optional) A timestamp to server as time zero ##...
f41cc6f0fc1ef888ca5e14239c95ec9e4844bb3a1adcaa6a55f630fc438c5c7e
R
15,993
195
#!/bin/env Rscript library(vegan) library(foreach) library(data.table) library(coop) write("Defining function distribution feature methods", stderr()) cosine_similarity = function(vec1, vec2){ num = sum(vec1 * vec2) denom = sqrt(sum(vec1^2)) * sqrt(sum(vec2^2)) value = num/denom return(value) } get_unique_c...
9b34c11e29c7118a23eebbb09a4e7275d4d5c97b82a44b13469eb04564b1e879
R
16,042
517
#' Computes feature (i.e. gene) specificity scores for each cluster #' #' @param ace ACTIONet output object #' @param clusters Cluster #' @param output_slot Name of the output in rowMaps(ace) to store results #' @param renormalize.logcounts.slot Name of the new assay with updated logcounts adjusted using archetypes #' ...
4519cc1cadd24bfc723daa81a3be6cf22f6d61e3cb68799c334d57e7b4a662ed
R
16,188
505
isFALSE <- function(x) { is.logical(x) && length(x) == 1L && !is.na(x) && !x } isNA <- function(x) { is.logical(x) && length(x) == 1L && is.na(x) } assert_no_positional_args_but_first <- function(call = sys.call(sys.parent())) { ast <- as.list(call) if (length(ast) <= 2L) return() ast <- ast[-(1:2)] dots ...
17a83b7e03f1888286f484e59829efa6d0995e32b30644bb21009003a11781ea
R
16,216
466
#START_OF_LICENSE_TEXT ###################### #License # ###################### # Copyright (c) 2020-2021 National Technical University of Athens # Contact C. Gousiadou, email:cgousiadou@gmail.com #################################### #https://opensource.org/licenses/BSD-3-Clause #Redistribution and...
6c8ef1bb50d6b51baa065fcbf23e2cecc9c9904972cf927cfa2a9aac9255e149
R
16,220
479
--- title: "Interactions Between Latent and Observed Covariates" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Interactions Between Latent and Observed Covariates} %\VignetteEngine{knitr::rmarkdown} ...
e356d061dfbc341e29004bbd99dad8d97d13e3d9c4c371e71aad4e41fa1ab38d
R
16,371
445
--- title: "Linear Mixed Models with Factor Structures" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Linear Mixed Models with Factor Structures} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding...
0491a93f0947b1994437cc0c9577195bb27b463a13be9c60832b4418197466ed
R
16,414
436
################################################################################################################### #This script has been modified from Jeremy Miller's "Meta-analyses of data #from two (or more) microarray data sets" tutorial with only minor additions made #Miller's tutorial and related files (inc...
a3fd35c5f8dea96a82805b52a6749c5d36c1e553a6ce854b1699b6fe8d8d0d2e
R
16,478
464
#srun --cpus-per-task=20 --mem=200gb --nodes=1 --qos=priority --time=168:00:00 --pty bash -i #remoter::server(verbose = T, port = 55556, sync = T) remoter::client("localhost", port = 55001)#55556 library(DESeq2) library(parallel) library(viridisLite, lib.loc = .libPaths()[2]) library("havok") setwd("/groups/umcg...
2020b557deb62116f8ef0af80e2d39fbe1d8b4d8fc14f5ae3d55941384c236c6
R
16,521
264
--- title: "Misc TRAP analyses" 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(ggrepel) librar...
de98452a989641815bd0e5f432a529bb5d979d93e66139464e48cf1584c75a3d
R
16,683
540
rm(list=ls()); options(echo=TRUE) options(stringsAsFactors = FALSE); library(WGCNA); allowWGCNAThreads() library(flashClust); library(gplots) library(RColorBrewer) setwd(dirname(rstudioapi::callFun("getActiveDocumentContext")$path)) # load networks or start with input below load("../Colon/processed_data/inputData....
d61ea659754ebd83293296366bf1566400e393fe9e29b06e60cd5cfd56477f4e
R
16,697
378
setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(readr) table_tmp <- read_delim("pheno_9_66/pheno_9_geneMaxSnpScores.txt", delim = "\t", quote = "") geneMaxSnpZscores <- as.matrix(table_tmp[,-1]) rownames(geneMaxSnpZscores) <- table_tmp[,1][[1]] rm(table_tmp) table_tmp <- read_delim("pheno_9_66/pheno_9_geneP...
0743340442abc33b3c6e52859a6776d3cd8c449f15af9085812a52d490fd4853
R
16,920
533
--- title: "Customized_upset_plot" author: "Chenxin Li" date: "01/19/2023" output: html_notebook: toc: yes toc_float: yes --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Introduction This is a workflow to generate upset plots with custom aesthetics. This workflow use...
28e8dca843c1afc606803ff367e882b311be6cf39ac7d9d322791315a63033b8
R
16,998
519
#create an observed over expected matrix obs.exp.matrix <- function( mat, correct=F, outlier.correct = 0.995, lowess = F ){ pos <- which(mat$z > -1, arr.ind=T) val <- mat$z[mat$z > -1] d <- abs(pos[,1]-pos[,2]) if(correct){ norm.factor <- tapply(val, d, function(x) mean( x[x < quantile(x, outlier.correct)] ) ) }...
9a2ea6c2ec23ba87314aa953556118b3e300569aa81dda98080440339c23ac61
R
17,061
300
library("optparse") library(ggplot2) library(ggpubr) library(gridExtra) library(matrixStats) library(plyr) library(data.table) library(stringr) # Get command line arguments option_list = list( make_option(c("-c", "--cisQTLs"), type="character", help="eQTLProbesFDR0.05-ProbeLevel.txt.gz of cis-eQTLs", m...
be696521c413a6bf3defe91f1799ed464d217f954f68fac6411aa435adf06f7c
R
17,250
368
library(oro.nifti) library(neurobase) library(dplyr) library(readr) library(stringr) library(plotly) library(AnalyzeFMRI) library(oce) library(R.matlab) library(data.table) library(reshape2) library(ggsignif) library(RColorBrewer) library(boot) library(limma) setwd("/Users/philippehabets/Dropbox/Endo/fMRI.transcriptom...
f0b398a792c5dbae188e9d9dee8192160c92279dd232e0db2a54c13b4393311c
R
17,256
462
library(here) library(tidyverse) library(lme4) library(car) library(emmeans) library(performance) library(ordinal) library(RVAideMemoire) # global settings options(contrasts = c("contr.Sum", "contr.poly")) theme_set(theme_bw()) font_theme <- theme( axis.title.x = element_text(size = 20, face="bold"), axis.title.y...
2d60f23f33aec6ab8d55eb2b80a6bee74b11078f46bedff2b93ab6eb9cdb6641
R
17,535
430
```{r} library(tidygraph) library(ggraph) source("downstreamer_functions.r") setwd("network_plots") source("data/source_olivier.r") ensembl <- read.table(ensembl.file, sep="\t", header=T, stringsAsFactors = F) ensembl <- unique(ensembl[,c(1, 5)]) rownames(ensembl) <- ensembl[,1] ngwas <- 100 nhpo <...
3722edb8de830f8c48d74264905269a6f6072653683f1595cbd0fcba0c50750b
R
17,582
432
--- output: html_document editor_options: chunk_output_type: console --- # Results **Word limit**: `r wordcountaddin::word_count("03-results.Rmd")` of 1000. The DCNN architecture with the highest top-1 accuracy `r df %>% pull('accuracy') %>% head(1) %>% signif(digits=3)` in the test set was `r df$Architecture[1]`...
0fd1130e2e2a0ee99abec567226b797e328948b30473173dad05eff8154a2c39
R
17,637
581
#' Resolve one or more futures synchronously #' #' This function provides an efficient mechanism for waiting for multiple #' futures in a container (e.g. list or environment) to be resolved while in #' the meanwhile retrieving values of already resolved futures. #' #' @param x A [Future] to be resolved, or a list, an ...
aaf401e78943a15adbef00dd8b70bca5def21ae8e313c5232293d3fbfecc4b6e
R
17,741
660
--- title: "Colon Crypt Respirometry" output: html_vignette: df_print: "kable" vignette: > %\VignetteIndexEntry{Colon Crypt Respirometry} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, ...
72e47c50fc19d5b80455e867edfa86b9d932fd3851cfd49a856345defc557432
R
17,787
473
library(lme4) library(report) library(texreg) library(stargazer) citation() citation("report") citation("texreg") citation("stargazer") # read the data MVCs <- read.csv("MVCs.csv", header=TRUE, colClasses = c("integer","factor","factor", "numeric","factor","fac...
81790b85fb2d05ecbc72913599d92d09d359229edb9805d335c17e318fa3f399
R
17,894
473
# n.b. issue with biomaRt is preventing full reproducibility from raw data. The work-around which sets host = "https://dec2021.archive.ensembl.org/ results in one gene that is mapped from human to mouse differently (ENSG00000255439, VKORC1 And PRSS53 Readthrough is not mapped to mouse Vkorc1). The original annotation...
95dcabdf7dfaccecba42f620059490695985ae80eddccf4e531385cb9ff92fd4
R
17,894
478
#' A condition (message, warning, or error) that occurred while orchestrating a future #' #' While _orchestrating_ (creating, launching, querying, collection) #' futures, unexpected run-time errors (and other types of conditions) may #' occur. Such conditions are coerced to a corresponding FutureCondition #' class to ...
adab73419cb93397aea3bfc5fd906b223e3b83c89518c2ae331c301f71a5970b
R
17,954
507
# reticulate::use_python("/usr/local/bin/python3") # <-- this was necessary on my local system (disambiguates due the multiple versions of python installed) require(tensorflow) require(keras) # re-train PCA models using specified gene lists present in target sample: retrain_autoencoder_gtex = function(gene_list = NUL...
a0a36b93d1852fabd0ca66b44a52fb3be5c6a4e26dc4263db0008c33b4172a94
R
17,985
441
#this code reads GRNboost2 PIDC and SAVER output and compare them with HumanNet BC celltype network library(igraph) library(dplyr) library(RColorBrewer) library(UpSetR) library(enrichR) library(viridis) library(grid) library(ggplot2) #Tcell t.grnboost2 <- read.table('/home3/junhacha/HumanNetv3/Benchmark/GRNboost2/Tcel...
992f7a5b27553049f6fb9e7f4746d6478c2495ccb7fe1b083bf8e0f220c4a485
R
18,079
282
#!/bin/env Rscript # # Author: Alex Eng # Date: 1/18/2018 ############################################################################### suppressPackageStartupMessages(library(argparse)) # Defining arguments and parser for command line arguments parser = ArgumentParser(description = "Generate tables of measures sum...
7e8777cd8fb98de53e6847c8d89dc1ad858c1bc0106874651ab0abed3f65d126
R
18,209
505
## AD Genetic Architecture for Neuron review library(dplyr) library(tidyr) library(purrr) library(janitor) library(tibble) library(glue) library(stringr) library(readr) library(forcats) library(glue) library(ggrepel) library(plotgardener) `%nin%` = negate(`%in%`) ## Snakemake ### Input # setwd("~/Dropbox/Research/Po...
a78d49ccac1d11979b85835d94fcc18baebdae8f217a14facd62a57859b79433
R
18,212
449
#' SortAddLLS #' #' @description Sort SCINET output edges alphabetically and add LLS weight derived from HumanNetv3 reference interactome #' #' @param Celltype.specific.networks SCINET output from function run.SCINET.clusters(). #' @param reference.network reference network input, default is HumanNetv3. #' #' @return L...
34c513a8a95a3cf80aba68758df292e639cae23bd428c4e8504a9da9c1ce5c28
R
18,218
327
#' buildref #' #' Function to build a RefCDS object from a reference genome and a table of transcripts. The RefCDS object has to be precomputed for any new species or assembly prior to running dndscv. This function generates an .rda file that needs to be input into dndscv using the refdb argument. Note that when multip...
86d301cec5f09f10e51caa59a9fe492cdc5e225fc5d5176fae9e66753a12ef11
R
18,234
403
commonfactor <-function(covstruc,estimation="DWLS"){ time<-proc.time() #function to create lavaan syntax for a 1 factor model given k phenotypes write.Model1 <- function(k) { Model1 <- "" for (i in 1) { linestart <- paste("F1"," =~ NA*",colnames(S_LD)[i], sep = "") if (k-i > 0) { ...
c48e246c12d4720c15f92ffc6bb02a9bfc16a31456d2ee6fca5bdb078220c0a3
R
18,246
293
#' codondnds #' #' Function to estimate codon-wise dN/dS values and p-values against neutrality. To generate a valid RefCDS input object for this function, use the buildcodon function. Note that recurrent artefacts or SNP contamination can violate the null model and dominate the list of codons under apparent selection....
4c772e9af543455afe6efac9395009a68dea19281b757b64eddda3ae09b38336
R
18,329
597
load("regInputData.rda") source("myMultivarFunctions.R") library(sjPlot) library(easystats) library(report) library(limma) library(MASS) library(ggplot2) library(corrplot) library(knitr) library(broom) library(flextable) # Striatum -------- mod.age<-NULL for(mod in names(str.MEs)){ s.aso<-summary(lm(str.dat[,mod...
11654563cdcbd5866cdeba086b5437b46953113923abd0866c0a15940c8856d0
R
18,511
644
--- title: "AmpSeqR report" date: "`r date()`" output: html_document: code_folding: "hide" toc: true toc_depth: 3 --- ```{r setup, include=FALSE} #knitr::opts_chunk$set(echo = TRUE,warning=FALSE) knitr::opts_chunk$set(warning = FALSE, message = FALSE) knitr::opts_knit$set(eval.after = 'fig.cap') ``` ...
29cbdc6af9881183a014008fb0d3cba56dfbfaffa5be27a1f24f3f64580ac861
R
18,592
669
--- title: "10X_clk856_TH_20210928" author: "Dylan" date: "10/1/2021" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # laod libs, setup ```{r} library( tidyverse ) library( gtools ) library( magrittr ) library( ggrepel ) library( cowplot ) library( patchwork ) library( Se...
66275b0e89deeb5daf8d4fd2c93a74649b2e3502e0da91817cc7ee41b3811eb9
R
18,764
548
setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(plotfunctions) sampleUmap <- read.delim("Umap/umap2.txt") ensg <- read.delim("ensgR75_protein_coding.txt", stringsAsFactors = F) row.names(ensg) <- ensg$Ensembl.Gene.ID str(ensg) exp <- readRDS("31.07.pc1.illumina.wantedgenes.DESeqNorm_log2.duplicatesRemoved....
1a5fd68810e5c6cc8c4cbe1cf88118566b35faf95d3fb3bff71f7fdf24e35c68
R
18,768
735
#' @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. In addition, #' dataset "sleepstudy" from lme4 package is also used here. #' @srrstats {G5.4} It h...
f5ec8992a1763f7d4ce753513a4badaa6c8babfef88f10b940aac54493672e4a
R
18,878
469
## HubMAP ## David Degnan, Pacific Northwest National Laboratory ## Last Edited: 10/06/2022 # Load libraries library(dplyr) library(purrr) library(tibble) setwd("~/Git_Repos/spatially-resolved-TDP/") ###################################################### ## STEP 1: Collapse down TopPIC and TDPortal Output ## #######...
74abc0fd82835a04dcc4014a1ffacf4fa67558f9fc6dca8de05fa895c87af0d9
R
18,942
598
# setup --------- library(Biobase) library(limma) library(edgeR) library(DESeq2) library(matrixStats) library(MASS) library(pheatmap) library(tidyverse) library(gridExtra) library(grid) library(WGCNA) # setup directory structure --------- dirSetup<-function(out.name){ # outname is the name of the main directory ...
6326e6476dbf1e397a4e78f47ddc6efc927bbe5284dc2b5f7d665677fa48fa32
R
18,988
532
#################################################################################### #' The Pre-processing Data. #################################################################################### #' #' After input data, RISC preliminarily filter datasets by using three criteria: #' first, discard cells with too low...
9cfbabdf8fbb6c119d109d121254a9e834e8f53f89809c16f2d00090b2451db7
R
19,020
615
#' Imports data from a 10X experiment folder and constructs an `SingleCellExeriment` object #' #' @param input_path Folder containing input files. #' @param mtx_file Count file in Matrix Market format (default='matrix.mtx.gz'). #' @param feature_metadata Table of the same size as number of rows in the count matrix (def...
a0eb89186099023fde6d7d0f4470e1312f8367c943c6eca8ac37cc69cd25714c
R
19,583
575
#remoter::server(verbose = T, port = 55557, password = "laberkak", sync = T) remoter::client("localhost", port = 55557, password = "laberkak") setwd("/groups/umcg-wijmenga/tmp04/projects/depict2/") setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(gatepoints) #if(FALSE){ # #don't run by accident # table_t...
60b75e2dc783c19b16fef66bd49830a165adff1f6bc26533cd9526f2d11fd2e4
R
19,916
566
library(ggplot2) library(gridExtra) library(readxl) library(pheatmap) library(RColorBrewer) library(gridExtra) library(data.table) # Function definitions # ------------------------------------------------------ # NPG friendly ggplot theme theme.nature <- function(p, base_size = 11, base_family...
09a95e84ba6311e18237bdbe5a38a97c98b007400dd0ba704747ab757dd57999
R
19,958
532
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_coregulation")} else {setwd("../evaluating_coregulation")} source("../downstreamer_functions.r") source("data/source_olivier.r") library(UpSetR) library(tidygraph) library(ggraph) library(clusterProfiler) library(org.Hs.eg.db) library(ReactomePA) ...
5ccfc036810323fe108939e144c203ca9b6798ed677217706868e302cbe54d04
R
20,140
564
library(MungeSumstats) library(tidyverse) library(tabulizer) library(fuzzyjoin) library(plotgardener) data(sumstatsColHeaders) setwd("/Users/sheaandrews/Dropbox/Research/PostDoc-MSSM/ADGenetics/") #Chang 2017 # chang_raw <- extract_tables("resources/Chang2017.pdf") # # chang_munged <- bind_rows( # chang_raw %>% #...
86850d63f5d5d6b88b804becc628f2d711200b3c7b1dd9a0097c14e1344b1f36
R
20,203
510
library(parallel) setwd("/groups/umcg-fg/tmp01/projects/genenetwork/recount3/") load(file = "Metadata/combinedMeta_2022_09_15.RData", verbose = T) load(file = "Recount3_QC_2ndRun/PCA_Patrick/pcs.RData", verbose = T) load(file = "Recount3_QC_2ndRun/PCA_Patrick/eigen.RData", verbose = T) #save.image("predictionSession...
dda5df19d3954620cbbd8f89c6bb3ab2d440d102cfdfd73472738ed9de9f8fdf
R
20,523
483
## --------------------------- ## ## This script was created with R version 4.2.1 (2022-06-23) ## ## ## Title: Patient-specific identification of genome-wide DNA-methylation differences between intracranial and extracranial melanoma metastases ## ## Purpose of script: Helper functions for script MainScript.R ## ## Auth...
9197d5e58b769a0a7f7e83e1fcee61d4e309a5dc6b660963a28ab4cd3191ef40
R
20,541
520
#srun --cpus-per-task=20 --mem=100gb --nodes=1 --qos=priority --time=168:00:00 --pty bash -i #remoter::server(verbose = T, port = 55556, sync = T) remoter::client("localhost", port = 55508)#55506 library(DESeq2) library(parallel) library(viridisLite, lib.loc = .libPaths()[2]) library(preprocessCore) setwd("/gr...
c7a464952c17ad71343617df06ef2569f5d57a1f1542fa02bba63e14b39a3b32
R
20,595
415
--- title: "Optimization" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Optimization} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ``` r library(galamm) ``` The purpose of th...
1bb25632720dcf4ce0b8e0943202b7f9ee853814e37a00167353c275469636c9
R
20,636
550
```{r} if (basename(getwd()) == "downstreamer_main") {setwd("evaluating_coregulation")} else {setwd("../evaluating_coregulation")} source("../downstreamer_functions.r") source("data/source_olivier.r") enrichments <- read.downstreamer.enrichments("../data/final_paper_cov_correct/enrichments/", ...
e3807884cbbc3e30c3fc9b0f55845de217a538938c480789a6e4fd356462a69d
R
21,394
626
# Genetic Architecture of Alzheimer's disease library(dplyr) library(tidyr) library(purrr) library(janitor) library(tibble) library(glue) library(stringr) library(readr) library(forcats) library(glue) library(ggrepel) library(plotgardener) `%nin%` = negate(`%in%`) ## Snakemake ### Input adgwas_loci.path = "results/a...
d8a0a5c1049ab3800960c1d8b865e39f4c333fc12c85f07deec2e429d8ede3fb
R
21,420
546
library(tidyverse) library(glue) library(ggrepel) library(plotgardener) `%nin%` = negate(`%in%`) setwd("/Users/sheaandrews/Dropbox/Research/PostDoc-MSSM/ADgenetics/") ad_loci <- read_csv("/Users/sheaandrews/Dropbox/Research/PostDoc-MSSM/ADGenetics/intermediate/ad_loci.csv") adgwas <- read_csv("/Users/sheaandrews/Drop...
086d56d25ab3cf7a65086ccc7c01978a34116745c93fe49c47620a49836f0a8f
R
21,461
520
library(readr) library(rlang) library(tidyverse) library(reshape2) library(ggthemes) library(rgdal) library(spatstat) library(nabor) ##A function, for images imaged at 40x obj, 3.5x digital zoom, 1-micron z-step size, ##to compile puncta detected by SynapseJ v.1 ##input is the label of the image as a s...
0b32708bca50a5f8a2cbce3775abe35a11745ef9c85059f1f3ad8e8ce8d357ad
R
21,575
570
#!/usr/bin/env R #This script is designed to create a bubble plot of the proportion of predicted reads >95% cutoff #per class from PACIFIC summary.txt files. It also plots data from Wesolowska-Andersen et al. 2017 #using PACIFIC and BWA-MEM. #Load required libraries library(tidyverse) library(reshape2) library(gridE...
5e8601f889ff79f518420072ea452c1024ce9620fcc6bf2960dd57b96a01065c
R
21,636
579
ldsc <- function(traits, sample.prev, population.prev, ld, wld, trait.names = NULL, sep_weights = FALSE, chr = 22, n.blocks = 200, ldsc.log = NULL, stand = FALSE,select=FALSE,chisq.max = NA) { time <- proc.time() begin.time <- Sys.time() if(is.null(ldsc.log)){ logtrait...
63b8bed9643b658e09697634761cd6cdd0818c130500471b68eeb4c4b3b639c1
R
22,303
607
## Prelim ---------------------------------------------------------------------- source("0_SharedCode.R") source("0_Analysis_helper.R") stopifnot(SharedCode_version == c(11,0)) ## Load mean FD----------------------------------------------------------------- meanFD_fname <- file.path(dir_data_misc, "HCP_meanFD.rds") if...
940d555a4864957ae43e2ba7399b9746208f315b40153e0ca1d619a5f4d12f00
R
22,409
627
.reverseRows = function(Matrix) { ind = seq(from=dim(Matrix)[1], to=1, by=-1); Matrix[ind,]; #Matrix } .extend = function(x, n) { nRep = ceiling(n/length(x)); rep(x, nRep)[1:n]; } # Adapt a numeric index to a subset # Aim: if 'index' is a numeric index of special entries of a vector, # create a new inde...
fb7b9918b691f3bf7463b403ca179db1c93bb982740e713a13edaf5f99efccce
R
22,467
680
setwd(dirname(rstudioapi::callFun("getActiveDocumentContext")$path)) # NanoStringNorm needs to be installed from source install.packages(pkgs="NanoStringNorm_1.2.1.1.tar.gz", type="source", repos=NULL) library(NanoStringNorm) ## load data load("NSraw.rda") Nano_SampleInfo<-readRDS("NanoSampleInfo.rds") ns.dat...
a2f07f4a7530ca4857cae8f188e0c892b2ce3e1cbd2e0d5ca61a8bb0520b3e64
R
22,609
350
#' withingenednds #' #' This function uses Poisson and Negative Binomial regression models at single-site level to study selection across different regions (coding and non-coding) within a gene. #' #' @author Inigo Martincorena (Wellcome Sanger Institute) #' @details Martincorena I, et al. (2017) Universal patterns o...
a566ca02259fcfce183bded11613f517cbcdf91c955b35b5b59f41d890028527
R
22,938
702
#remoter::server(port = 55556, sync = T) #remoter::server(port = 54001, sync = T) #ml R/4.2.1-foss-2022a-bare remoter::client("localhost", port = 55556)#55556 55501 54104 54001 setwd("/groups/umcg-fg/tmp01/projects/downstreamer/") setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(readxl) read.depic...
a80bb5703e43e510daa2ac4c26b615cd80b4dd5ffd3f7ef4b1ae7731352e3c73
R
22,958
563
require(treeio) require(ggtree) require(dplyr) source("clean_functions.R") # contains no_() beast218 <- read.beast("./BEAST2_analysis/beast_218_tree_asterophryinae.nex") iqtree218 <- read.iqtree("./IQTREE2_analysis/iqtree_218_timetree_asterophryinae.contree") d <- read.csv("Table1.csv") if(dir.exists("out")!=T...
93f762a9ee686c2f40289a30703e37d4def06c1ae52e15aa731333510d3b9dab
R
23,112
699
#remoter::server(port = 55556, sync = T) #remoter::server(port = 54001, sync = T) #ml R/4.2.1-foss-2022a-bare remoter::client("localhost", port = 54001)#55556 55501 54104 setwd("/groups/umcg-fg/tmp02/projects/downstreamer/") setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(readxl) read.depict2 <- fu...
fcaaf3063c5599cf0b884a9a6a78eb7e6e6bdbdf6eb309066236bcb6d2f923bd
R
23,121
607
# Utility programs for use with the book, # Kruschke, J. K. (2015). Doing Bayesian Data Analysis, Second Edition: # A Tutorial with R, JAGS, and Stan. Academic Press / Elsevier. # This file contains several functions that are called by other programs # or can be called directly by the user. To load all the functio...
5dfb2e9a0696204d81968d4e41796c1245d79e69c0d1212cabac5741a75725c3
R
23,334
633
--- title: "Linear Mixed Models with Factor Structures" output: rmarkdown::html_vignette: fig_width: 6 fig_height: 4 bibliography: ../inst/REFERENCES.bib link-citations: yes vignette: > %\VignetteIndexEntry{Linear Mixed Models with Factor Structures} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding...
497e63942212a168806af6046c2da8e70b966dcca224a8969d87a78c1f46250c
R
23,335
711
#remoter::server(port = 55556, sync = T) #remoter::server(port = 54001, sync = T) #ml R/4.2.1-foss-2022a-bare remoter::client("localhost", port = 54001)#55556 55501 54104 setwd("/groups/umcg-fg/tmp02/projects/downstreamer/") setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") library(readxl) read.depict2 <- fu...
5597eebb9784fdf167b807888e3be8b17a581b99a512ab025d1588cd7938d398
R
23,337
598
######### rm(list = ls()) library(ggplot2) library(pheatmap) library(RColorBrewer) ##### generate a list of all 72 2-node circuit motifs (including redundant ones) generate_motif_list <- function() { motif_list = list() motif_list[[1]] <- matrix(c(0,1,0,0), nrow = 2, ncol = 2) motif_list[[2]] <- matrix(c(1,1,0,0)...
e041dd92fe59acdad0d8fb1d562982d0ba15c1f4f58b1a2d38416ddad2973141
R
23,457
602
######### rm(list = ls()) library(ggplot2) library(pheatmap) library(RColorBrewer) ##### generate a list of all 72 2-node circuit motifs (including redundant ones) generate_motif_list <- function() { motif_list = list() motif_list[[1]] <- matrix(c(0,1,0,0), nrow = 2, ncol = 2) motif_list[[2]] <- matrix(c(1,1,0,0)...
00f9cf152d9bf3dcc6bca4664b2c0498ea984619a8647e013f56d3e6f834eb32
R
23,604
603
######### rm(list = ls()) library(ggplot2) library(pheatmap) library(RColorBrewer) ##### generate a list of all 72 2-node circuit motifs (including redundant ones) generate_motif_list <- function() { motif_list = list() motif_list[[1]] <- matrix(c(0,1,0,0), nrow = 2, ncol = 2) motif_list[[2]] <- matrix(c(1,1,0,0)...
10384473e8bf0a1819c44cf2e4ba51eaeb15c1200f63bcbf058d0810ca61ebca
R
23,624
554
#' Main trait pair analysis using LHC-MR #' #' @param SP_list List resulting from calculate_SP. Contains the filtered dataset (by every 'SNP_filter'th SNP), the starting points to be used in the pair trait optimisation, the traits' intercepts, #' the traits' polygenicity if nStep = 2, as well as some extra parameters l...
e797670c89f4723af7e9ec7a2c2e82b2a02fb725e15675b0c8e62f45fb420da2
R
23,811
491
#' Train the SingleR classifier #' #' Train the SingleR classifier on one or more reference datasets with known labels. #' #' @param ref A numeric matrix of expression values where rows are genes and columns are reference samples (individual cells or bulk samples). #' Each row should be named with the gene name. #' I...
0f437f1efcbb7ba138a7858865e29bc319a84ccbb457604d81eb3cad3377bf56
R
23,842
612
######### rm(list = ls()) library(ggplot2) library(pheatmap) library(RColorBrewer) ##### generate a list of all 72 2-node circuit motifs (including redundant ones) generate_motif_list <- function() { motif_list = list() motif_list[[1]] <- matrix(c(0,1,0,0), nrow = 2, ncol = 2) motif_list[[2]] <- matrix(c(1,1,0,0)...
3b2d2d811474275a328b119c8e1996a1d087aeef21c7815cd3942a4cac74bb6a
R
23,871
616
############ stats for 2d enrichments ############ ######### rm(list = ls()) library(ggplot2) library(pheatmap) library(RColorBrewer) ##### generate a list of all 72 2-node circuit motifs (including redundant ones) generate_motif_list <- function() { motif_list = list() motif_list[[1]] <- matrix(c(0,1,0,0), nrow = ...
740fc43df8120c7a93bcb5a7dbb412ee306d695981f04ff9a7faadd7f1dfac0b
R
23,938
805
# Documentation ----------------------------------------------------------- #' @title Quantification of results #' @name quantify #' #' @description A good amount of \code{discovery} objects can be quantified. #' What exactly is to be quantified differs per \code{discovery} type. #' \describe{ #' \item{saddle diso...
1020e6125bebc5f5114f74b49ce4deaf7281450929eafaefb44d363440b095ce
R
23,956
728
#MULTIVARIATE LOGISTICAL REGRESSUION##################### # Load required libraries library(readxl) library(tidyverse) library(ggplot2) library(gridExtra) library(reshape2) library(FactoMineR) library(factoextra) library(dplyr) library(ggeffects) library(gtsummary) library(flextable) # Set directories setwd("DIR") da...
5ec14a5d4b5e78f09099ee399ef6a965331a157008d1f2e6e065feec50b2155d
R
24,108
475
# For importing resultsanscript estimates. library(tximport) library(tximportData) # For differential expression analysis. library(edgeR) # Import seqinr for editing fasta files. library(seqinr) # Load pheatmap. library(pheatmap) # For importing resultsanscript estimates. library(tximport) library(tximportData) # For ...
db1e5dc0c8259cbe8a3d1960aea410b81ddc2bff7fa31b193caf439914d83af1
R
24,268
569
enrich <-function(s_covstruc, model = "",params,fix= "regressions",std.lv=FALSE,rm_flank=TRUE,tau=FALSE,base=TRUE){ time<-proc.time() ##determine if the model is likely being listed in quotes and print warning if so test<-c(str_detect(model, "~"),str_detect(model, "="),str_detect(model, "\\+")) if(any(test) !=...
048ab1b1677f704a79797bfda26556c4fcf960bed9dd47681782e78ce61fe826
R
24,276
647
##--------------------------------------------------------------- ## clean up and cluster variants based on allele frequency ## sciClone <- function(vafs, copyNumberCalls=NULL, regionsToExclude=NULL, sampleNames, minimumDepth=100, clusterMethod="bmm", clusterParams="no.apply.ov...
4a0e60b8a387dcb20e1a63664f25f2990c20e706f95db7171e4c46ec0698b2db
R
24,391
561
#' Retrieves global variables of an expression and their associated packages #' #' @inheritParams globals::globalsOf #' #' @param expr An \R expression whose globals should be found. #' #' @param envir The environment from which globals should be searched. #' #' @param tweak (optional) A function that takes an expre...