sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
77cfe0ec06ebdb41e04d7bbbf3291edbb6b3c8cc61898bb5b1220aa7125ea6df
R
4,552
137
--- title: "EPM" output: word_document: default html_document: default pdf_document: default date: '2022-12-05' --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` Load data ```{r} setwd("~/Documents/Systemic ESYT1 project locomotion, behavior, survival, anatomical data/Behavioral paradigms da...
fe716ef880f7da0dcfbd8d632ca4115feb95240146c8bf8b80fcf0d0fff30a9b
R
4,559
115
# Load libraries ---------------------------------------------------------- library(tidyverse) library(here) # Load data --------------------------------------------------------------- # GTEx gene level expression data gtex_filtered <- readRDS("/home/egust/Projects/GBA_GBAP1/results/gtexv8_GBA_GBAP1_tpm.Rds") %>%...
00847f1dd6397ad7ddbea1ef32134fddc31046c0587a37240a62e4dcedd95be3
R
4,571
168
--- title: "Spectral reflectance curves and flower colors in perceptual color spaces" author: "Martin Dessart" date: "11/09/2023" output: html_document: toc: true theme: united pdf_document: default word_document: default --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE,fig.width=15,fig....
28d9e25ba030d2c9401b03d640b147182d11d591b3e5928bf43c088a6616590f
R
4,572
80
#!/usr/bin/Rscript # Source: https://github.com/opain/Calculating-FUSION-TWAS-weights-pipeline/ options(verbose=TRUE) library("optparse") option_list = list( make_option("--PLINK_prefix", action="store", default=NA, type='character', help="Prefix of PLINK files for the target sample [required]"), mak...
b3bd92ee061202ae71930c50d952e3ad5aad78bce537cdf943e2c6d18117ebee
R
4,580
129
### Frame-by-Frame package ### ### sleep parameter ### # function sleepParameter(...) -------------------------------------------- # it expects dn, i.e. frame-by-frame data splitted by day/night in a list # first, detectNaps(...) converts each element of dn into booleans asleep/not asleep, called ffz for zzz (for a...
90c29879c0a5e09547a0d9f9067741f1f885d45ab7053b1ba3741da9bce77146
R
4,583
118
library(ggpubr) library(ggplot2) library(scatterpie) library(RColorBrewer) library(grDevices) library(Seurat) library(viridis) library(tibble) library(data.table) set.seed(1234) library(dplyr) library(stringr) file_path = '/Users/cao/Desktop/PDAC/' #----------------------------------------------------------- # inpu...
da75c8f2fa8d03c543de169aca7d4f13f3736056bb4dbc98f6cd3dd72f38f455
R
4,585
92
--- title: "README" author: output: github_document date: "`r Sys.Date()`" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Altered Glia-Neuron Communication in Alzheimer's Disease Affects WNT, p53, and NFkB Signaling Determined by snRNA-seq Peer-reviewed manuscript: [![DOI](https://img.shie...
b9293a13d78f4d065ab69902ec395e47e0836352f393e53a86e05ec24dbb5ada
R
4,590
136
## Plotting RXE after removing specific XCI status genes. library(here) library(dplyr) library(ggpubr) save_ggplots <- function(p, fn, w=7, h=7){ for(ext in c('.svg', '.pdf')){ ggsave(p, filename=paste0(fn, ext), width=w, height=h) } } get_pheno <- function(){ fn <- here("input/phenotypes/_m/phe...
28c2691cc0fec7d812a83675632a7236d95f474f9205a42a866858ed3892c246
R
4,606
119
library(dplyr) library(gridExtra) library(ggplot2) library(plyr) library(reshape2) library(tidyr) library(limma) current = getwd() setwd(current) folder = "6_calculate_cisRegression_effect/predicted_population_differences" ## outputs system(paste0("mkdir -p outputs/",folder,"/")) results_dir <- paste0("outputs/",fold...
1b9373cb18fb35b0db81b4b4f6a8d4959e99727692b19564e3bd531a0a214c68
R
4,610
145
rm( list=ls(all=TRUE ) ) # Load and install necessary packages load_required_packages <- function(packages){ new.packages <- packages[!(packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) invisible(lapply(packages, library, character.only = TRUE)) } requ...
4861e6125d4fa3a2e5dba9b7af29d9ddc77a2bbd89918181a69aba1c636e3e91
R
4,610
145
rm( list=ls(all=TRUE ) ) # Load and install necessary packages load_required_packages <- function(packages){ new.packages <- packages[!(packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) invisible(lapply(packages, library, character.only = TRUE)) } requ...
451421a1d9656a7b82f229d7a1a444459f1fb6d7ad903edad615d142066c3a2c
R
4,612
128
###### # Parameters # path_home <- './' # Working directory with temperature data setwd(path_home) # Libraries to use library(readr) library(tidyr) library(purrr) library(ggplot2) library(lubridate) library(jsonlite) library(dplyr) library(stats4) library(gridExtra) library(grid) library(stats4) library(bezier) libra...
a741255a8f4cf869ae561f24b01e7ba5f2bfac011fb0526eaa96c9b5a9a2649d
R
4,633
139
##------------------------------------------------------- ## GEO UPLOAD ##------------------------------------------------------- # module purge && module load shared slurm python/3.7.x-anaconda # module load gcc/8.3.0 # module load hdf5_18/1.8.17 # module load R/4.1.1-gccmkl ##---------------------------------------...
9308592b91492fb2286c0d8476a1dbcb223949ff8b3811563881ebc29bba745e
R
4,636
123
############################################# ## ## mash modeling in R ## Author: Kynon J Benjamin ## ############################################# suppressPackageStartupMessages({ library(mashr) library(dplyr) library(ggpubr) }) save_img <- function(image, fn, w, h){ for(ext in c(".svg", ".pdf")){ ...
84cc3acb6ff1cdb42efbe241623c76cb44afd20688a8199367223e4a2aa36bf1
R
4,641
167
# this script is for selecting out 5 or 3 samples of the same sex for a given # and seeing if DTU genes detected changes much library(tidyverse) library(IsoformSwitchAnalyzeR) library(ComplexHeatmap) library(viridis) library(org.Mm.eg.db) library(gprofiler2) library(styler) library(lintr) library(here) source("src/dt...
f012e8079263e3be5530cd921d69c2511f0750f1d022cef3cb5296ad3f9cd79c
R
4,641
97
#' Multivariate amputation based on discrete probability functions #' #' This function creates a missing data indicator for each pattern. Odds probabilities #' (Brand, 1999, pp. 110-113) will be induced on the weighted sum scores, calculated earlier #' in the multivariate amputation function \code{\link{ampute}}. #' #'...
1127d346cf76106694e8f9d66233d1866859514540a535d6726be682093e6fb1
R
4,653
134
#### This script explores sex steroid hormone levels #### in the brain suppressPackageStartupMessages({ library(dplyr) }) get_expression <- function(region){ fn <- here::here("differential_expression", tolower(region), "_m/genes/voomSVA.RData") load(fn) return(v) } memVOOM <- memo...
d646cde7612f738fa70c6a0117b28da58c9bc62a626c2f6fd0da5652ddf7d426
R
4,658
109
# Sconda conda activate TensorFlow_CPU_01; cd /mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN/results/deeplift_analysis; R workdir = '/mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN/results/deeplift_analysis/' file_data = paste0(workdir,"deeplift_scores.RD...
4839f863b1ee11c5ead32c2724a94cc16191d86b57852f384afe3dd273e88cb3
R
4,660
160
#' Coerce to a cor_tbl object #' @description Functions to coerce a object to cor_tbl if possible. #' @param x any \code{R} object. #' @param extra.mat any other matrix-like data with same dimmsion as \code{x}. #' @param byrow a logical value indicating whether arrange the 'spec' columns on y axis. #' @param ... extra ...
a577545779a22d0c346b3b75c5096d4f7d0e439ba06107e78db5bc6ca7be18a0
R
4,677
96
#!/usr/bin/env Rscript --vanilla #load the libraries library(readr) library(ggplot2) library(dplyr) library(proBatch) # load data sample_annotation_AgingMice = read_csv("data_AgingMice/3_data_for_plots/sample_annotation_AgingMice.csv") normalized_df_AgingMice = read_csv(file = "data_AgingMice/3_data_for_plots/normal...
a92e83418f9c2ae935416280e221af1e212418cbc709ad003e6505316060ebb8
R
4,684
102
library(ashr) library(mashr) library(gplots) library(viridis) library(ggplot2) library(corrplot) library(rmeta) set.seed(2020) current = getwd() setwd(current) folder = "5_mashr" CORR_TYPE <- "withCorr" MODEL_FOLDER <- "eQTL_QN" MODEL_TYPE <- c("eQTL_QN_combined") COV_TYPE <- c("canonical_and_dataDriven") ## folders...
7d08a8d804f37e009174c30052d55b6c921c088fd1628cd3a5272de18f4c87cb
R
4,694
127
#' Age transformation function #' #' This function performs age transformation used in epigenetic clock calculations. #' #' @param x Numeric vector of ages to transform #' @param offset Numeric offset value (default: 0.06) #' @param adult.age Numeric adult age threshold (default: 1.2) #' @return Numeric vector of tran...
23941477db7a037ce8927fab8bf9849e82bc8486d6b7197935494cf8de23feaa
R
4,699
151
library(colorspace) require(RNOmni) require(glmnet) require(caret) library(plyr) library(RColorBrewer) # library(WGCNA) library(tidyverse) library(readxl) outfolder = 'out_AROCM_0.1L' freq = 5 ##### to include lemurs anAge <- read.csv("/Users/feiz/Dropbox/MammalianMethCombined/StuffCaesar/anAgeUpdatedCaesarVersion51.c...
5a39248f9bcc5f2176d8aee74fa3933ce71c8c1e1bda67b03447f082230417cc
R
4,704
157
expect_warning(imp1 <- mice(nhanes[1:13, ], m = 2, maxit = 1, print = FALSE)) test_that("RBIND-001: Constant variables are not imputed by default", { expect_equal(sum(is.na(complete(imp1))), 6L) }) expect_warning( imp1b <- mice( nhanes[1:13, ], m = 2, maxit = 1, print = FALSE, remove.constant =...
13e6a95a816d5c7d06a69d3042c6bd94e4997f72b81785a4a05791ccb257be2d
R
4,721
111
#!/usr/bin/env Rscript source(here::here("src/shared/R-helpers/get_settings.R")) suppressPackageStartupMessages({ library("dplyr") library("tidyr") library("readr") library("tibble") }) settings <- get_settings(omic = "phosphoproteomics", stage = "organize_samples", dataset_name = NULL) # dataset_name = "c9"...
cc86647bf5553cdf4d3610f504acc5c4d7b24d70314b21837ce8e85687476803
R
4,728
139
library(data.table) library(ggplot2) resultsDir <- function(...) { paste0(config$out_root, "/atac/", ...) } pipelineDir <- function(...) { paste0(config$out_root, "/pipe/", ...) } getBamPath <- function(pipe_name, genome_ver = basename(config$genome_chromatin)) { return(pipelineDir("out/", pipe_name, "/align...
11358e2c384d84c7b34e331c6e7a65a4cbaa979606a37e437bbb3e2e85634d36
R
4,732
123
## Generating eQTL boxplots suppressPackageStartupMessages({ library(here) library(dplyr) library(ggpubr) }) save_ggplots <- function(fn, p, w, h){ for(ext in c('.pdf', '.png')){ ggsave(paste0(fn, ext), plot=p, width=w, height=h) } } plot_eqtl <- function(variant_id, gene_id, gene_name, eq...
4a73e1f53c92e9163e8ee6c367967c0d30579b684fd9aeac2a5dbdd1980b23ae
R
4,732
116
## This script generates the upset plot for mash sig results. library(ComplexHeatmap) get_sig_genes <- function(){ fn <- paste0("../../summary_table/_m/", "differential_expression_schizophrenia_", "by_sex_4features.sig.txt.gz") return(data.table::fread(fn) |> dp...
3ec02679af6b7a1e069e39a41921e49f556613d07e706f6670021dd4d5f1b6f1
R
4,734
128
#' Tidy co-occurrence network data #' @description The function calculates correlation coefficient, statistical #' significance level and filters according to conditions. #' @param x a cor_network object. #' @param corr correlation matrix. #' @param p.value significant matrix of correlation. #' @param directed log...
5176d1b67ce895052d1472bb1b5e703bad51ba432c7e342e0f872275836fa9b4
R
4,755
132
#' @importFrom dplyr filter #' @export dplyr::filter #' Subset rows of a \code{mids} object #' #' This function takes a \code{mids} object and returns a new #' \code{mids} object that pertains to the subset of the data #' identified by the expression in \dots. The expression may use #' column values from the incomplet...
d252d0d9ab01f030c8fb07dee0e5d7ace6501203a0471b2be5b2237f07318802
R
4,758
112
library(Seurat) library(SeuratWrappers) library(ggplot2) library(velocyto.R) library(dplyr) library(ggpubr) ## AstroNeurontest - seurat object with defined clusters # filtering out N-stage7,A-stage5,6,7 small_data <- subset(AstroNeurontest,idents = c("NSC-stage1","NSC-stage2","RG-like","N-stage1", ...
c5022f9f5831150c95ef5831fbb21513dda6eb1662b9e4b3e8802e8af8ac60e7
R
4,760
136
source('~/scripts/single_cell/de.R') source('~/scripts/single_cell/atac.R') source('~/scripts/perturbator/de.R') library(Pando) setwd('~/projects/cutntag/') #### Read data #### marks <- read_rds('data/all_marks_list_v3.3motifs.rds') rna <- read_rds('data/RNA/RNA_all_srt_v2.2matched.rds') drugs <- read_rds('data/dru...
aa8c171e4c36a0f565ebc50105141c34381c72514d1b4be6f905e4c18f8c952b
R
4,766
111
#!/bin/R # Nicole Gay # 15 May 2020 # Fix and merge ATAC-seq QC #Usage : Rscript src/merge_atac_qc.R -w ~/test_mnt/PASS/atac-seq/stanford/batch4_20200928/Output/final/sample_metadata_20200928.csv -q ~/test_mnt/PASS/atac-seq/stanford/batch4_20200928/Output/final/qc/atac_qc.tsv -m ~/test_mnt/PASS/atac-seq/stanford/bat...
943071cbb5cab6558b82ff4bb2b3863fffb8f8dd14fc58880e22443789f2c72b
R
4,777
129
#' Significant marks Geom #' #' @param digits integer indicating the number of decimal places (round) or #' significant digits (signif) to be used, the default value is 2. #' @param nsmall the minimum number of digits to the right of the decimal #' point in formatting real/complex numbers in non-scientific form...
c5a2c19f6d44e19287a404754a2fa3e16ebae6814d15fcb44249a6fa42773d98
R
4,777
93
#!/usr/bin/env Rscript ## Load libraries library(ggplot2) library(EnhancedVolcano) ## Load datasets for differential expression results in genes with and without covariates gene <- read.csv(file = '../../data/processed/deseq2/genes_annotated_results_AD_vs_CT_no_intron.tsv', sep="\t") ## Load datasets for differenti...
e71603bf9e2c4017c310b6f597eed73ffffc1ff717ccd5f314f5add46884778b
R
4,781
111
library('phangorn') dyn.load('../src/RMorphy.dll') tree <- read.tree(text="(((a, b), c), (d, (e, f)));") matrix_as_grid <- t(matrix(c('0', '0', '1', '1', '0', '0', '0', '0', '-', '-', '-', '1', #'0', '+', '?', '-', '1', '1', '0',...
2d36aade292c83b8ad1ac17c8fb71589e0a888582945be762da5041e8807a230
R
4,808
126
### Frame-by-Frame package ### ### import behaviour parameters ### # function importBhvParams(...) ------------------------------------------- # to import parameter tables from directory(ies) bhvparams # returns a list, each element is one parameter table #' Title #' #' @param paDir #' @param poolExp1 #' @param pool...
4f9720759d19fa4979ae383f2ea2ce0461004c75fd1396ab92116bf09bc9ab4b
R
4,811
137
rm( list=ls(all=TRUE ) ) # Load and install necessary packages load_required_packages <- function(packages){ new.packages <- packages[!(packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) invisible(lapply(packages, library, character.only = TRUE)) } requ...
4485e0cb036013693f6eaa286df2f532d6d189ee6b920327a9852ea3b22850b3
R
4,814
137
rm( list=ls(all=TRUE ) ) # Load and install necessary packages load_required_packages <- function(packages){ new.packages <- packages[!(packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) invisible(lapply(packages, library, character.only = TRUE)) } requ...
5d560a5a47c979e784fd4196628729cb786f4489768dbd135f0926b4a395dc28
R
4,814
137
rm( list=ls(all=TRUE ) ) # Load and install necessary packages load_required_packages <- function(packages){ new.packages <- packages[!(packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) invisible(lapply(packages, library, character.only = TRUE)) } requ...
1d4c513ff132f2e115dea22e210d284f4a9ffb65fbced5b7562e84f5b405d67c
R
4,826
128
#### This script explores sex steroid hormone levels #### in the brain suppressPackageStartupMessages({ library(dplyr) library(ggpubr) }) get_expression <- function(region){ fn <- here::here("differential_expression", tolower(region), "_m/genes/voomSVA.RData") load(fn) return(...
abc5bed6481b21f77bb458f2303448a64aa9e75b863d5a5643d1ae8d4ca3c6af
R
4,846
119
library("gamlss") library("mgcv") x <- read.csv('global dispersion.csv') centile <- data.frame( age = seq.int(8, 89, length.out = 1000) ) quantiles <-c(0.25,0.5,0.75) centile_names <-c("low","mid","high") min_age <-min(x$age) max_age <-max(x$age) ############################################################...
51ee5129d7af535f46c48afb79b092783ed996e6cbb9e1a2242f496627ea56e1
R
4,849
98
library(mixOmics) library(stringr) require(caret) set.seed(1) args<-commandArgs(TRUE) matrix1 <-args[1] matrix2 <-args[2] matrix3 <-args[3] label_path <-args[4] dataset<-args[5] save_path<-args[6] datasets<-paste('dataset',dataset,sep='_') message('read count matrix: ', matrix1) mat1 <- read.table(matrix1, header ...
2c5a253c4e48444e34aa919edea9a3a4d96bb436486b69cf978c3ecb177f88ed
R
4,857
186
#' Creates a \code{method} argument #' #' This helper function creates a valid \code{method} vector. The #' \code{method} vector is an argument to the \code{mice} function that #' specifies the method for each block. #' @inheritParams mice #' @return Vector of \code{length(blocks)} element with method names #' @seealso...
5e1246cf85e8a82b014da426189061f3054ff68f65b498062d93ad362d9e3679
R
4,863
161
suppressPackageStartupMessages({ library(tidyverse) library(Seurat) library(openxlsx) }) setwd('/cluster/tufts/slonimlab/rbator01/covid-placenta-edlow/') source('scripts/00_get_started.R') # load data ----- so_file="analysis/seurat_object/seuratobj_subset_integrated_HBCs_USETHISONE.rds" so = readRDS(so_file) re...
9462378a6060cec5ab5e47e4c7d41800f2718106c80f6cf4a21e7d5d0ac24c6c
R
4,865
132
#' Computes convergence diagnostics for a \code{mids} object #' #' Takes an object of class \code{mids}, computes the autocorrelation #' and/or potential scale reduction factor, and returns a \code{data.frame} #' with the specified diagnostic(s) per iteration. #' #' @param data An object of class \code{mids} as created...
2d104fc28fd143af04686676121d8ee03c2dcb4338db5a6941251f13881c6806
R
4,885
138
#'################################################################################# #'################################################################################# #' PROMOTE vis 2 results with NetActivity #' Used in Figure 5; Supp. Fig 14 and Supp. table 6 #' #'...
27c5b3c9b8092ca88ea79dd2e431a9eed004fb2750f372e715f3002f5ed7fedf
R
4,887
101
library(limma) library(edgeR) library(tidyr) library(reshape2) library(plyr) library(dplyr) library(grid) library(gridExtra) current = getwd() folder = "2_calculate_residuals_and_DE_analyses" setwd(current) system(paste0("mkdir -p outputs/",folder,"/2_2_popDE_results/")) ## inputs meta_data_file <- paste0("inputs/",f...
d1f84c2eaedfcf63f41d8342f034f93a9f821d4e9e036199feb8b88a1b024ffe
R
4,893
117
## This script generates the upset plot for mash sig results. library(magrittr) library(ComplexHeatmap) get_sig_genes <- function(){ fn <- paste0("../../summary_table/_m/", "differential_expression_analysis_4features_sex.txt.gz") return(data.table::fread(fn) %>% dplyr::filter(Typ...
730817696ea42915da3ad76aecf14572fa9077cfe2962a1fe5d60ed1ea5e8608
R
4,898
117
library("mlxR") project.file <- "./all_groups_104/loglogistic_logmu.mlxtran" Te_pop <- 32.31109058 beta_Te_mu <- -0.06604329 s_pop <- 17.87627025 omega_Te <- 0.11431745 mu_10 <- 3.992731e-06 mu_90 <- 0.0001186991 mu_5 <- 2.144331e-06 mu_95 <- 0.0001649904 res1 <- simulx(project = project.file, ...
1113a5ec8ea752852cb8be866ba5f43f19305c7ed53e5306ca7ac42b2b441fc6
R
4,931
158
# This script plots expression of several gene modules from published data, Fig 3E LIB='/cluster/tufts/patralab/rbator01/R_libs/4.0.0' .libPaths(c("",LIB)) suppressPackageStartupMessages({library(org.Hs.eg.db) library(tidyverse) library(Seurat) library(clusterProfiler) library(org.Hs.eg.db) }) source('script...
a0125e83fe7335fd674d893f7fea725d9ed49a5e1640966fa89d0472409cbd6a
R
4,948
110
--- title: "Figure 6. Ro/e tissue distribution analysis of glial subtypes (STARTRAC)." date: "2026/9/16" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) # Clean workspace rm(list=ls()) # Load setting and functions source("../script/stat_plot_functions.R") # Set output directory...
c9c1fdfd6e0647cac3c20038122543b3aa12eb6a65cefd89edc7e48aabf4a7ad
R
4,948
113
# set working directory setwd("~/Desktop") maindir <- getwd() datadir <- file.path("~/Desktop/") # load packages library("readxl") library("ggplot2") library("ggpubr") library("reshape2") library("emmeans") library("hrbrthemes") library("umx") library("interactions") library("car") # import data data_ppi <- read_exce...
aa72e37b9cee63500185f7a1a3cfde6440c401a3d5f0e47fe723e1f682d925a4
R
4,957
150
#!/usr/bin/env Rscript source(here::here("src/shared/R-helpers/get_settings.R")) source(here::here("src/shared/R-helpers/remove_ensembl_version.R")) source(here::here("src/shared/R-helpers/gseGO_memoise.R")) suppressPackageStartupMessages({ library("AnnotationDbi") library("biomaRt") library("clusterProfiler") ...
5ca5719e7f94f73fa4dc3a739f8a421779a3c39d4ccc86ba74c6f85620b2f6e9
R
4,968
188
rbind.mids <- function(x, y = NULL, ...) { call <- match.call() if (is.mids(y)) { return(rbind.mids.mids(x, y, call = call)) } # Combine y and dots into data.frame if (is.null(y)) { y <- rbind.data.frame(...) } else { y <- rbind.data.frame(y, ...) } if (is.data.frame(y)) { if (ncol(y) ...
ab58d132e3636a738f10844d1a2a17b14f50f1824bbfe43b4be50a57dfab7b4c
R
4,969
123
--- title: "Figure 3. Differential expression analysis (MMT_D30 vs GF_D30) and volcano plots per tissue." date: "2026/9/16" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) # Clean workspace rm(list=ls()) # Load setting and functions source("../script/stat_plot_functions.R") # S...
94a5ffcf2b414bc37595d024a9716a50625dbebc383d89cd00d9f15c647f9b7c
R
4,979
109
############################################################################################ # Copyright (c) 2022 - Mucosal Immunology Lab, Monash University, Melbourne, Australia # # Author: Matthew Macowan # # This script is provided under the MIT l...
24e51667d9b268e87dea565fe6f3e2ca5a0b475fea7d89b17e9520fd7218c4f5
R
4,985
138
library(limma) library(edgeR) library(tidyr) library(reshape2) library(plyr) library(dplyr) library(grid) library(gridExtra) current = getwd() folder = "2_calculate_residuals_and_DE_analyses" setwd(current) system(paste0("mkdir -p inputs/",folder,"/corrected_expression_QN/")) ## inputs meta_data_file <- paste0("input...
62beb88525abc6e10830d2ca9481e33fb8fd0d708a4b229be1045883589b29a4
R
4,986
103
--- title: "Overview" date: "`r Sys.Date()`" output: rmarkdown::html_vignette bibliography: refs.bibtex vignette: > %\VignetteIndexEntry{Overview} %\VignetteEngine{knitr::rmarkdown} \usepackage[utf8]{inputenc} --- <!-- overview.md is generated from overview.Rmd. Please edit that file --> ## Software 1. [`mice`...
27550628f625b741033cae51a02c9498d30c4225f42a37984310ca2d5035f367
R
4,988
168
#' Coerce to a cor_network object #' @description Functions to coerce a object to cor_network if possible. #' @param x any \code{R} object. #' @param directed logical value, whether or not to create a directed graph. #' @param simplify logical value (defaults to TRUE) indicating whether to #' delete nodes without ...
799aedafe93577e9958439dfabe010008a70b02ee37944614f0dafac8b45a792
R
5,003
139
## ## anticipation/experienced improvements ## library(ProjectTemplate) load.project() d<-antexp[complete.cases(antexp),] d %>% select( AAntDirection, BAntDirection, AExpDirection,BExpDirection ) %>% gather(variable, direction) %>% separate(variable, c("condition","question",'trash'),c(1,4)) %>% mutate(condition=...
18703ea771d53087b3eac8f35b86bf72f992e4465dc9393324fcddf601ee0664
R
5,010
138
# general settings, package loading library(lme4) library(tidyverse) library(dplyr) library(ggplot2) library(meta) #' @param x outcome which should be min-max-normalized #' @return min-max normalized outcome min_max_norm <- function(x) { (x - min(x)) / (max(x) - min(x)) } #' performs a metaanalysis of all scores ...
46c1b76a14d8a8860d1ca58c9d84f17fbcce77456b44bed738159c09b6b773a3
R
5,011
147
# Internal functions used to define parameters and column descriptions. # Please add functions in alphabetical order. # # To render: # tissue character, tissue abbreviation, one of [MotrpacRatTraining6moData::TISSUE_ABBREV] # assay character, assay abbreviation, one of [MotrpacRatTraining6moData::ASSAY_ABBREV] # ...
a67ba4425e28087716c462527bc00b30ff6a9de5e221ba584f42073066fa23c7
R
5,019
96
#' \pkg{mice}: Multivariate Imputation by Chained Equations #' #' The \pkg{mice} package implements a method to deal with missing data. #' The package creates multiple imputations (replacement values) for #' multivariate missing data. The method is based on Fully Conditional #' Specification, where each incomplete vari...
f41617a5581c4f068adec2e662c98bc74ca1f91f4e02b9b5422cbc8161d6b763
R
5,019
111
library(tidyverse) library(readr) library(GenomicRanges) library(plyranges) library(diffloop) library(rtracklayer) # Arguments --------------------------------------------------------------- args <- list( path_to_GENCODEv10 = here::here("data", "gencode.v10.annotation.gtf.gz"), path_to_OMIM = here::here("re...
c206e297ab0e20da02ad89d3433f9c28bd9acb89e255cf5fc56c11db4aba42f1
R
5,044
167
ordered_cp_dotplot <- function(ck, marker_term_select_combine, showCategory){ ck_select=ck %>% dplyr::filter(Description %in% marker_term_select_combine) #ck_select@compareClusterResult$Description = factor(ck_select@compareClusterResult$Description, # level...
443df1112e83c7cb696ffbefe9ad48b4363ce79d003b4ba60a9122dde282e71c
R
5,047
59
library(DiagrammeR) all_wMRI_fu=nrow(LST_overview[!is.na(LST_overview$LPA_long_complete),]) all_complete=length(LST_overview[!is.na(LST_overview$LPA_long_complete)&LST_overview$LPA_long_complete==1,"LPA_long_complete"]) missing_baseline_MRI=8 missing_fu=2 procissue=1 grViz("digraph flowchart { node [shape = rectangle,...
baa9d0bcd9d739e68aea09a0fc571d3f7831a9c360dec4a549ded4f4938eb1a1
R
5,050
174
#' Creates a \code{predictorMatrix} argument #' #' This helper function creates a valid \code{predictMatrix}. The #' \code{predictorMatrix} is an argument to the \code{mice} function. #' It specifies the target variable or block in the rows, and the #' predictor variables on the columns. An entry of \code{0} means that...
3329a6e811dceb1457f4543b2cbc524d64e461502067892c6c21508ba23b7bd1
R
5,053
134
library(limma) library(edgeR) library(ggplot2) library(cowplot) library(tidyr) library(reshape2) library(plyr) library(dplyr) library(grid) library(gridExtra) current = getwd() folder = "7_WOS_effects" setwd(current) system(paste0("mkdir -p inputs/",folder,"/pseudobulk/")) system(paste0("mkdir -p outputs/",folder,"/7_...
605ab70a99bad0b459db3c835f8b5dd55ce024168bee9a1a81567950b84ed517
R
5,068
161
library(readxl) library(dplyr) library(DESeq2) library(ggplot2) library(EnhancedVolcano) library(ggpubr) ###################################### # Read meta data MetaData = readxl::read_xlsx("meta_data.xlsx") ############################################## options(digits = 3) # Format MetaData3 to have distinct indi...
a6a221f722aaf70722964d1df7c9d0d2a79416dd8f9fcc2ee3c25d32f56cc5e8
R
5,068
175
unbiased_stICA <- function(X,k=10,alpha) { # # [A B W] = unbiased_stICA(X, k,alpha) # # Compute factorization of X =A*B' using Jade algorithm # # Inputs: # - X (matrix p*n) is the matrix to factorise # - alpha (scalar between 0 and 1) is the trade-off between spatial ICA (alpha = 0) et temporal ICA...
fa8ff69e9bcd1c80354f165f56d283dd23cdb5574baf72d1df046fcc4fe963d0
R
5,081
117
#'################################################################################# #'################################################################################# #' Explore hsa00430 #'################################################################################# #'##########################################...
db85cc18870bea3838a6fad577049d62c91f9ab98e077a06b7a2bbd27e400528
R
5,093
136
# #Universal mammalian clock2 of age # #author for developing clock2: Ake T. Lu #author for developing clock1 and clock3: Zhe Fei # rm(list=ls()) options(stringsAsFactors = F) # myinput.list=readRDS('mydata_GitHub.Rds') # The following labels the coefficient values of the three universal clocks beta.name=c('beta_clock1...
eb71fdffe172c1e06e7e5278514ff7b313e494b158bf94b43f65d27fdd310c25
R
5,105
144
source('~/scripts/single_cell/atac.R') source('~/scripts/single_cell/wrapper.R') source('~/scripts/single_cell/markers.R') source('~/scripts/single_cell/celltype.R') source('~/scripts/single_cell/de.R') source('~/scripts/single_cell/graphs.R') source('~/scripts/grn/models.R') setwd('~/projects/cutntag/') #### Read s...
165133edc6db5adb12de46bf10904f4c50167b5e63f6fddb3252c7b3a2a11dce
R
5,124
177
library(tidyverse) source('~/scripts/single_cell/de.R') source('~/scripts/single_cell/wrapper.R') source('~/scripts/single_cell/atac.R') source('~/scripts/perturbator/de.R') library(Pando) library(doParallel) library(BSgenome.Hsapiens.UCSC.hg38) registerDoParallel(24) rename <- dplyr::rename filter <- dplyr::filter ...
bcc09dbc41c85cb8c31b2bb3f29184760e4dfc574c7d07a8f418b2ba3aca3d37
R
5,138
149
--- title: "Untitled" output: pdf_document: default html_document: default date: '2023-04-18' --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} library(pacman) p_load(tidyverse, readxl) spinalcord <- read_excel("~/Documents/Systemic ESYT1 project locomotion, behavior, survival, anatomi...
5ab02de5c56c9a81d3304deba40b0f25a3c21779d3101e251afd457fd3d432b0
R
5,175
110
#'################################################################################# #'################################################################################# #' Analyze PRAD #'################################################################################# #'##############################################...
da170ee4f6d5f4847894c6a6530cf1b9c07269d4b438b26406ba9f2d4850f9c7
R
5,181
129
##------------------------------------------------------- ## SEURAT ANALYSIS | MODULES & LIBRARIES ##------------------------------------------------------- # module purge && module load shared slurm python/3.7.x-anaconda # module load gcc/8.3.0 # module load hdf5_18/1.8.17 # module load R/4.1.1-gccmkl ##-------------...
46f81c0472c7ea2c41db71df6bf23f0e72adb9c87b81b4cc59ccafa1f6757e5b
R
5,184
137
#' Imputation at level 2 by Bayesian linear regression #' #' Imputes univariate missing data at level 2 using Bayesian linear regression #' analysis. Variables are level 1 are aggregated at level 2. The group #' identifier at level 2 must be indicated by \code{type = -2} in the #' \code{predictorMatrix}. #' #' @aliase...
03b9e5d36d2bc5a5497d923f4292fdae8d3ff08f8854d500349791d0813180ea
R
5,190
172
--- title: "Question 2: Are pollinators able to discriminate invasive flowers species from native flowers species?" author: "Martin Dessart" date: "11/09/2023" output: html_document: toc: true theme: united pdf_document: default word_document: default --- ```{r setup, include=FALSE} knitr::opts_chunk$set...
ce810ec64473992a13456f4c5fa5d3c5d68cad18e4c941f94c473adf7d553a46
R
5,202
98
#What's in GeneWeaver: setwd("~/Documents/SideProjects/BrainGMT/GeneWeaver") GeneWeaver_GeneSets<-read.delim("publications2symbols.dat", sep="\t", header=FALSE, stringsAsFactors = FALSE) str(GeneWeaver_GeneSets) head(GeneWeaver_GeneSets) # 'data.frame': 693 obs. of 4 variables: # $ V1: chr "Differential effects i...
e69bd946a8fd4f49c57d4f2f7b29a5f739207bf0bcf11ce20ff243c2f0b22bb5
R
5,226
138
--- title: "sc2marker with HCA-BM (Human)" author: "sc2marker" date: "`r format(Sys.time(), '%d %B, %Y')`" output: html_document: toc: yes toc_depth: 3 toc_float: collapsed: false smooth_scroll: false --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # load data You can...
1def3624c9a2aef5f1a83b4f645fd07f64fb011f516b9520a5a3d1856211e4d3
R
5,241
126
#' Combines estimates from a tidy table #' #' @param w A \code{data.frame} with parameter estimates #' in tidy format (see details). #' @param dfcom A positive number representing the degrees of freedom of the #' residuals in the complete-data analysis. The \code{dfcom} argument is #' used for the Barnard-Rubin adjustm...
66ac5bcbd47456402ede868982ccb73585436809f742b455b5f81d44a0e6dcd2
R
5,252
165
#!/usr/bin/env Rscript source(here::here("src/shared/R-helpers/get_settings.R")) source(here::here("src/shared/R-helpers/gseGO_memoise.R")) source(here::here("src/shared/R-helpers/gseKEGG_memoise.R")) suppressPackageStartupMessages({ library("AnnotationDbi") library("dplyr") library("purrr") library("ggplot2...
0abf64e52007e48fd3ca4a928eefd1627b0e6425531ec74ff4d6c21ee9912bf3
R
5,253
119
#!/usr/bin/Rscript library("optparse") option_list = list( make_option("--RDat_dir", action="store", default=NA, type='character', help="Directory where FUSION LD reference files are stored [required]"), make_option("--coordinate_file", action="store", default=NA, type='character', ...
111053a138f11e98f1ad1b415d5ea5d08606b3e02325f3f81092f3b2346166af
R
5,260
183
######################### # TEST 1: Simple problem # ######################### set.seed(123) # generate data y <- rnorm(10) x <- y * .3 + rnorm(10, 0, .25) x2 <- x + rnorm(10, 2, 3) x <- cbind(1, x, x2) # make missingness y[5:6] <- NA ry <- !is.na(y) set.seed(123) svd <- .norm.draw(y, ry, x, ls.meth = "svd") set.see...
5ff75a87957787ff1ad73dffeebd7412c39c44dadb6098efb10e5259c3cac512
R
5,261
130
library(mixtools) library(ggplot2) library(tidyr) library(reshape2) library(plyr) library(dplyr) library(grid) library(gridExtra) library(ggrepel) library(stringr) current = getwd() folder = "2_calculate_residuals_and_DE_analyses" setwd(current) system(paste0("mkdir -p outputs/",folder,"/2_0_bimodal_proportions/")) #...
88496e033cca3fc1d6fad1b1e055e5fbca086f39784eaac499088b76fa301d89
R
5,293
135
#'################################################################################# #'################################################################################# #' Process TCGA gene expression for deep learning #'################################################################################# #'################...
bed97b3211d4245e6493bc11ce33688dd5ca57b39592eace4bbd812e983c4331
R
5,293
142
## Prepare covariates for FastQTL / tensorQTL analysis suppressPackageStartupMessages({ library(here) library(argparse) library(tidyverse) library(SummarizedExperiment) }) #### Functions getRPKM <- function(rse, length_var = "bp_length", mapped_var = NULL) { mapped <- if (!is.null(mapped_var)) colD...
ee3f66e7a386cb9a636aa908ff9838f24252c612a7891b825b39fec7e4486804
R
5,311
229
# Load libraries ---------------------------------------------------------- library(tidyverse) library(ggtranscript) library(patchwork) library(rtracklayer) library(plyranges) library(here) # Load data --------------------------------------------------------------- Filtered_tx <- list( GBA = read.table(here::h...
8f656ce0d20f012b83b36c2f878796984ee199a29dbd458ad66f961e2d000187
R
5,339
126
# Load libraries ---------------------------------------------------------- library(tidyverse) library(here) # Arguments --------------------------------------------------------------- args <- list( ENCODE_files = list.files(here::here("data", "ENCODE_LR"), full.names = TRUE, recursive = TRUE), path_to_pse...
4fe1b705f5b12ffdacf48e9400e484a782d26c9a3c6232d07fa0dfaa77af7bb1
R
5,368
118
#'################################################################################# #'################################################################################# #' PROMOTE vis 2 Differential gene expression analysis and enrichment #' Used in Figure 5; Supp. Fig 13 and Supp. table 7,8 and 9 ...
0a9cd228372a5655841f4bc5f1eadc63e6f67b2717d42408a382af5c5d553260
R
5,374
103
library(mixOmics) library(stringr) require(caret) set.seed(10) args<-commandArgs(TRUE) matrix1 <-args[1] matrix2 <-args[2] matrix3 <-args[3] label_path <-args[4] dataset<-args[5] save_path<-args[6] datasets<-paste('dataset',dataset,sep='_') message('read count matrix: ', matrix1) mat1 <- read.table(matrix1, header ...
aa78150510cc8305c6b1db0743cdfaf4a6f88502a07f37c36fd9ae94155a9818
R
5,380
137
.findAS <- function(object) { gtf <- slot(object, "transcriptome") gtf <- c(gtf[gtf$type != "AS"], .runAS(gtf[gtf$type == "exon"])) slot(object, "transcriptome") <- gtf object@sets$AS@rowData <- as.data.frame(object@transcriptome) %>% dplyr::filter(type %in% "AS") %>% dplyr::mutate(coord = ...
4e6d75adee3964e1acf8c5fbbd5dbc40c239452dfa2b3dd6ea8cc8e8014e8ba3
R
5,414
170
--- title: "R Notebook" output: html_document: df_print: paged --- # #Universal mammalian clock2 of age # #author for developing clock2: Ake T. Lu #author for developing clock1 and clock3: Zhe Fei # ```{r} rm(list=ls()) options(stringsAsFactors = F) setwd('/Users/alu/Desktop') myinput.list=readRDS('mydata_GitHub....
bd24e85bfc2a47835e0ed3079e057516f00bddfabb95a06db851a8fdb8594697
R
5,435
86
run_LME<- function(dv, data, model, n_it){ # runs the model either with simple or extended set of covariates if(dv=='log_ll'|dv=='asinh_ll' && model=="covariates"){ res <- lmerTest::lmer(formula = paste0(dv, '~ age_base + age_change + SBP_base + age_change:SBP_base + SBP_...
be583feaec5041efe9c7f426971288411ca28f1553815a8d89fff1ab3087e017
R
5,439
108
## As described in Li. C. Z. et. al. (2024), filter CpGs by detection p-values ## This code takes in all Mammalian 40K Array detection p-value output from Sesame normalization pipeline ## And take the median p-value (FDR adjusted) of each probe per species, and keep those with 85% of species Median value >= 0.05 ## ...
75a525b4b6691c5e6fecf12084a9346db698b9dc5fcbb466840dcb810e029602
R
5,449
163
# Load libraries ---------------------------------------------------------- library(tidyverse) library(here) # Load data --------------------------------------------------------------- gtex_filtered <- readRDS(here::here("results", "GTEx", "gtexv8_GBA_GBAP1_tpm.Rds")) %>% dplyr::mutate(Organ = gsub("Brain - ",...
92b0368b8dce6e38a95f20e03488d34e999d3f01271f8ead7c069d4d3bfd634d
R
5,465
223
######## ADD DOCUMENTATION FOR ZENODO # 2/8/21: Re-plotting survival curves for manuscript figure 6J # (1) HCNT60-3K library(survival) setwd("~/Desktop/20210208-Survival_plots_for_Figures") #### (1) HCNT60-3K input combined wells B02, C02, D02 inclusion plus data = read.csv("HCNT60-3K_B02C02D02_inclusionplus.c...
e5bd23bedfadd0ca37d064f6688754226c6456f3553a35b9e7e027be484d919a
R
5,465
121
library(data.table) library(parallel) simple_dot_prod <- function(i, this_path_binaries, this_phoenix_influence_scores){ (as.matrix(this_path_binaries) %*% this_phoenix_influence_scores[sample(.N, replace = F), influence])[1,1] } ecdf_fun <- function(x,perc){ ecdf(x)(perc) } ...