sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b0efce91c5f285510730e8f568f17efebc4b5551daa4799c8239f6cc6e8d0613
R
3,474
59
### DTS script to extract the PI learningscore values for the period specified in the dataset yaml file (and some other important PIs) if(PIs_present & !is.null(learningscore)){ PIstat <- list() CatStat <- list() for(x in 1:NofGroups){ PIstat[[x]] <- grouped.PIprofiles[[x]][[learningscore]] CatStat[[x]] <...
e254c38a6f606acec7f68a54f9af81126d12dc895619619a799a47c87ed4bcdf
R
3,474
95
#' Multivariate multilevel imputation using \code{jomo} #' #' This function is a wrapper around the \code{jomoImpute} function #' from the \code{mitml} package so that it can be called to #' impute blocks of variables in \code{mice}. The \code{mitml::jomoImpute} #' function provides an interface to the \code{jomo} pack...
974333df7ee1ea6e57afc3366cd7d7d42f48436064e2703d9f4cf23c04071a05
R
3,480
96
--- output: github_document --- # hBayesDM [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![R](https://github.com/CCS-Lab/hBayesDM/actions/workflows/R.yaml/badge.svg...
aba78270486f455d31647b5fb137b031886d6a9a1d8cda9c778822a949590c18
R
3,481
111
--- title: "Add external networks to HuMMuS object" author: "Trimbour Rémi" date: "2023-05-16" output: html_document: css: pkgdown/extra.css github_document: default pdf_document: default --- ```{r setup, include=FALSE} knitr::opts_chunk$set(eval = TRUE) #devtools::install_github("cantinilab/HuMMuS") ``` ##...
da2cf0324a361aa2f937dc10564da6544cd1c841a73b9eb04b3eabbba0cf9f88
R
3,492
109
--- title: "Weight analysis" output: pdf_document: default html_document: default date: "2023-10-21" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` Loading data ```{r} library(pacman) p_load(tidyverse, ggsignif, multcomp, broom, emmeans, DescTools, readxl) setwd("~/Documents/Systemic ESY...
fd5d490c82cde29b2175729d997cc1108f4de8ae98ce9054c82f1380fe78c573
R
3,492
96
library(data.table) library(devtools) load_all() # copied from MotrpacRatTraining6mo list_available_data = function(package=NULL){ res = utils::data(package=package) obj = res$results[,3] # remove objects that can't be called directly obj = obj[!grepl("\\(", obj)] return(obj) } # list all available data obj...
95165a565676080ac0d6b31733811a2c28c7ab3cf8742cde32e78aa4ffee0659
R
3,498
68
#!/usr/bin/env Rscript --vanilla #load the libraries library(proBatch) library(readr) library(dplyr) library(tidyr) source('transition_fragment_conversion.R') #load the data essential_columns = c('peptide_group_label','filename','aggr_Fragment_Annotation', 'aggr_Peak_Area') cols_to_get <- rep(list(col_guess()), lengt...
4c5be65bfe4a235af408a9699d7c4e50b6aeae20ef19d5a73b250b9a7c8f19ec
R
3,500
60
#' @templateVar MODEL_FUNCTION pstRT_rlddm1 #' @templateVar CONTRIBUTOR \href{https://github.com/hydoh/}{Hoyoung Doh} <\email{hoyoung.doh@@gmail.com}>, \href{https://github.com/sanghoon-kang/}{Sanghoon Kang} <\email{sanghoon.kang@@yale.edu}>, \href{https://jihyuncindyhur.github.io/}{Jihyun K. Hur} <\email{jihyun.hur@@y...
068637f1ebf3aac7b4d9f5b5f0afaf427fd3caa367640061abe5232ac18e3029
R
3,508
119
--- title: 'Saldana, Montano, et al. -- ATAC-seq: Additional plots and tables' author: 'Florian Halbritter' date: '`r format(Sys.time(), "%B %d, %Y %H:%M:%S %Z")`' output: html_document: toc: yes toc_float: yes code_folding: show highlight: pygments df_print: paged --- # Intro In this noteboo...
e7cb29ce3a55a1ec88f49a2b36ea34c650b1c383d8d4a8340734182130e6162c
R
3,508
81
#! /usr/bin/Rscript args1 <- commandArgs(trailingOnly=TRUE)[1] # sample.txt args2 <- commandArgs(trailingOnly=TRUE)[2] # target2gene.txt dir.create('output') # sleuthパッケージを読み込む library("sleuth") # サンプル情報を読み込む s2c <- read.table(args1, header=T, stringsAsFactors=F, sep="\t") s2c$condition <- gsub(" ","_",s2c$conditio...
f5e1427ff0becf264d5b9ba74423d141000ff3433bde5f219be39c8527191e68
R
3,517
113
#' Imputation of unordered data by polytomous regression #' #' Imputes missing data in a categorical variable using polytomous regression #' #' @aliases mice.impute.polyreg #' @inheritParams mice.impute.pmm #' @param nnet.maxit Tuning parameter for \code{nnet()}. #' @param nnet.trace Tuning parameter for \code{nnet()}....
ea9e01194b8ff87710c7177759dd7c7bf0d8d9ab14cdac40de1ab922ae4be12f
R
3,526
94
#' @title Calculate length of tree using MorphyLib #' #' @description Uses the MorPhy library to calcuate the length of a phylogenetic tree #' #' @param \list { #' \item{tree} A tree in \code{PhyDat} format; #' \item{data} A object of class phyDat containing sequences #' \item{site} return either 'pscore' or 'sit...
e5df638bbdc5cc139c6e863cfeede40d239394917955bea9455deb32367004ad
R
3,528
30
library(pheatmap) library(ggplot2) library(RColorBrewer) library(ggrepel) setwd("/Users/timothymartin/Desktop/Screens/U2OS Khurana Lab CRISPR screen/E3K screen june 2019/edgeR") #For the heatmap I made cutoffs where the log2 foldchange difference (WT-E3K) was <-1, the E3K FDR<0.25, and log2 foldchange in GFP and...
6595030bbc89518d0e1692be3a5a915924d8e27c534490b385983d7e77c14285
R
3,539
61
### DTS script to collect data from each group in their respective lists and empty the variables after all group evaluations are done #### -- Period sequence design meta-data -- #### #### -- Dwelling times -- #### #### -- Performance Indices -- #### #### -- Categories for plotting -- #### #### -- Power spectra -- #### ...
d1eda6ca59649a6783348fc59129e147f6e03a147f3ac561591872854ba30a85
R
3,539
78
################################################################################ # Written by Loïc Labache, Ph.D. # # Holmes Lab, Department of Psychiatry - Rutgers University # # February 7, 2024 ...
56d836212adced0b5f01ff8f88f2d0a7450e542cdf0ee9a6a12edd412a45d83e
R
3,566
114
#' Relative importance #' @title Relative importance #' @param spec,env a data.frame object. #' @param type one of "lmg", "last", "first", "betasq", "pratt", "genizi" or "car". #' @param family a link function to be used in the model, see \code{\link[stats]{family}}. #' @param na.action a function which indicates what...
a4f625cf9d1fb13100762abab6a155086b0cdf990ef7713c4378b7fe5340a31f
R
3,569
104
--- title: "RNAscope validation plots" author: "Yuvarani Masarapu" date: "2023-11-01" output: html_document --- ```{r load-libraries} library(ggplot2) library(readr) library(ggpubr) library(readxl) ``` # For channel green, No. 488, gene id Adcy1 * Detected in ST data, upregulated for spaceflight in Hippocampal CA3 ...
a96315ac6cd37ba62be97b5a99b59b55f775205c180b99681ad46aa73d320cee
R
3,570
85
# The following test was contributed by jawitte # https://github.com/amices/mice/issues/226 set.seed(1) A <- rnorm(100) B <- 0.1 * A + rnorm(100) fit1 <- lapply(1:5, function(m) lm(B ~ A)) fit0 <- lapply(1:5, function(m) lm(B ~ 1)) # hardcoded lrtest() result to avoid lmtest dependency x1 <- structure( list( `#D...
2f541631c1610581384545076d3481d2251b4cc2d128acb8805c30411354eb91
R
3,571
114
#' Enlarge number of imputations by combining \code{mids} objects #' #' This function combines two \code{mids} objects \code{x} and \code{y} into a #' single \code{mids} object, with the objective of increasing the number of #' imputed data sets. If the number of imputations in \code{x} and \code{y} are #' \code{m(x)} ...
bd8c1c2f6596aa151e8e87de592278358f8d53bdf0fef53d3a9f9a52b77d3171
R
3,571
86
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 <- "popDR_QN" MODEL_TYPE <- c("popDR_QN") COV_TYPE <- c("canonical_and_dataDriven") ## folders INPUTS...
63e3def358d0e5167454a206d1713d9293072893756b0b266c6cc6bcd3eb0bfc
R
3,586
82
# Laura Aarnos 190515 # Plotting burst detection results # attach packages from library #library(IGM.MEA) library(Hmisc) library(meaRtools) #attach meaRtools after IGM.MEA to get right parameter names # import data # location of RDS file (e.g. 'Z:\Public user documents\User\Folders between\Analysis\R objects\Filena...
47ccf5825da43b5214459b6054fb07ed7b65be89a533cadab75aa79623ccccb6
R
3,611
74
library(dplyr) library(data.table) library(getopt) library(phenoscanner) command<-matrix(c( 'help', 'h', 0,'logical', 'help.', 'coloc_res', 'r', 1, 'character', 'susie coloc result.', 'exp_ma_file', 'e', 1, 'character', 'input GWAS .ma file.', 'ce...
18931ebe62093ac57594de1645e3750a31d712478e09be20f59a6f03483c4c5d
R
3,618
73
#!/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/bernardo/processed/04.deseq2/genes_annotated_results_M_vs_F.tsv', sep="\t") ## Load datasets for differ...
f99654d9851d023265a4a11ac0380ce5fbc12d3ea787ba5a98463716becd85fb
R
3,618
90
miceadds::load.Rdata(objname = "imp", "/data/pt_life_whm/Results/Tables/CVR_WMH_progression/imputed_data_6.12.23/imputed_data_6.12.23.Rdata") i=1 comp_imp=mice::complete(imp, "long") tmp=comp_imp[comp_imp$.imp==i,] #generate quantiles DBP_cutpoints = quantile(imp$data$DBP_base, probs = c(0,.33,.66,1), na.rm = TRUE) ...
614318bf819a08274b0312aaf557c6b1f5689e7fb83003d35dca024e8dc682ce
R
3,628
86
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 <- "popDE_continuousAncestryModel_QN" MODEL_TYPE <- c("popDE_continuousAncestryModel_QN_combined") COV...
b2cd5fde7843dcee97dd53b63492a918a5d74e3ebe63f2537f7dc115dcc21f5b
R
3,629
104
#!/usr/bin/env Rscript ############ # load data ############ e.keep = readRDS('filtered_expression_matrix.rds') keep.genes = readRDS('keep_genes.rds') meta = readRDS('cayo_bulkbrain_combined_metadata.rds') meta = meta[order(match(meta$LID, colnames(e.keep))),] library(BRETIGEA) library(biomaRt) library(expss) libra...
26d00f01eddceb1ff2ed6d7e11c37392e85306169bfe7eefb4d880e05817df9c
R
3,638
73
#!/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/bernardo/processed/04.deseq2/genes_annotated_results_M_vs_F_no_intron.tsv', sep="\t") ## Load datasets ...
8d32ee3c428abb037c5b33b8035de193d0bf06ac927cd00a1b201d8858b90d13
R
3,644
97
## Taken from https://github.com/nloyfer/meth_atlas ## To run: ## Rscript process_array.R {idat directory} {output csv path} {path to ref_sample.RData} ## Note: Requires minfi package. ## To install minfi: ## try http:// if https:// URLs are not supported ## source("https://bioconductor.org/biocLite.R") ## biocLite("m...
a68f6b3fe19c3c5125229a3fd0d9769a8d3a3b5f03759b57dfc7c5f82ffa4728
R
3,654
86
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 <- "popDE_continuousAncestryModel_QN_cisRegressed" MODEL_TYPE <- c("popDE_continuousAncestryModel_QN_c...
fd20f3a6006d02cb624dda86a954f88ee2984aa321fa65485fa5af1d8444bb77
R
3,659
97
--- title: "Help for old friends" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Help for old friends} %\VignetteEngine{knitr::rmarkdown} \usepackage[utf8]{inputenc} --- <!-- oldfriends.md is generated from oldfriends.Rmd. Please edit that file --> ```{r, echo = FALSE} ...
f0db1445e0d86c306d0520a427c87e487aea6fe1ec99e59345c4fb42367cf16c
R
3,661
74
--- title: "BMI_Pulit_README" author: "William Bone" date: "3/24/2022" output: html_document --- ## date: September 01, 2020 This is the documentation for how the Pulit et al. BMI data was modified to be compatible with ColocQuiaL I downloaded this file from: https://zenodo.org/record/1251813#.X06L-hNKhTZ #### adding...
6fbdb48d54955bc411f3676e9d65c8b3c185361d530766148faeca4793fdc564
R
3,667
62
#this R config file allows you to set the paths to all the dependency file you need to run the ColocQuiaL pipeline #this config file is required for running the colocalizer pipeline on one locus #provide the path to plink reference files to be used for plink commands plink_bfile = "/project/voight_selscan/ksiewert/Car...
52f40aef2e7c6644addeac210551bbb7490174c10753c3fabdc44ac8dc517efe
R
3,679
117
library(data.table) library(PRROC) edges <- fread("C:/STUDIES/RESEARCH/neural_ODE/ground_truth_simulator/clean_data/edge_properties_350.csv") edges <- edges[, .(from, to, activation, EC50, n)] withhold_perc <- 0 num_rows_to_change <- round(nrow(edges) * withhold_perc) rows_to_change <- sample(1:nrow(edges), num_rows_...
88ee5a3d5eccc045dbf695f6740b6babad7d4d54029fa8f05d7d8c82bc56e128
R
3,684
97
#'################################################################################# #'################################################################################# #' Evaluate biological relevance of NetActivity weights #'################################################################################# #'##########...
2ec302b2a4c73373980085c15cbeca9a8e205000ef559ceba83324a61b6c8e10
R
3,685
109
library(org.Mm.eg.db) library(org.Hs.eg.db) library(tidyverse) library(argparse) source(file.path("src","shared","WGCNA","perform_WGCNA_functions.R")) get_args <- function() { # create parser object parser <- ArgumentParser() parser$add_argument("--dataset-name", type = "character", default = NULL, help =...
f4fb42b768e03f66fce2152352e45526c6dbb68b6a534c92e9632ba2e088c8aa
R
3,692
100
library(ggplot2) library(tidyr) library(reshape2) library(plyr) library(dplyr) library(grid) library(gridExtra) library(resample) current = getwd() folder = "2_calculate_residuals_and_DE_analyses" setwd(current) system(paste0("mkdir -p outputs/",folder,"/2_1_DE_infection_results/")) celltypes <- c("B","CD4_T","CD8_T"...
3f12d35a44f4b5aa183cd8f4a7b00fd7be9e00748d5154285172c554663420c1
R
3,694
110
context("Test user-facing API (plots, diagnostics, IC, HDI helpers)") library(hBayesDM) skip_if_not_installed("cmdstanr") skip_on_cran() # Fit one small hierarchical model and reuse across assertions to avoid # repeated cmdstanr compile cost. fitted <- suppressWarnings(suppressMessages( dd_hyperbolic(data = "examp...
0ac822b483c9b89fb48d605dbf3ade918556a83a1d93cc28bc257210568169e6
R
3,699
119
#' @title WaveICA2.0 #' @description Removing batch effects for metabolomics data without #' using batch information #' @author Kui Deng #' \email{dengkui_stat@163.com} #' @param data Sample-by-Peak matrix untargeted metabolomics data. #' @param wf wavelet functions. The default is "haar". #' @param Injection_Order I...
1236bc3964b51f27182a06eca1a7e28194695ee16372256b025a83a4bda2cf7c
R
3,707
118
#' @noRd draw_key_square <- function(data, params, size) { if (is.null(data$size)) { data$size <- 0.5 } grid::rectGrob( x = 0.5, y = 0.5, width = grid::unit(data$r0, "npc") - grid::unit(data$size, "mm"), height = grid::unit(data$r0, "npc") - grid::unit(data$size, "mm"), gp = grid::gpar(col...
8bbd646506b1eb00d0acb3cfd89417a6e454ce9337d26b0303962e74ca5303c1
R
3,713
99
# To identity DEG in cell-type corrected data # using Mann Whitney Wilcoxon test (a.k.a Mann Whitney U test and Wilcoxon Rank Sum test) rm(list = ls()) library(tidyverse) library(optparse) # Loading global variables ------------------------------------------------ option_list <- list( make_option(c('--br'), help ...
ee518913b0916c6f9bd2727c62e5b82508de99525ad84c99badfd35853eee8eb
R
3,718
100
#Trying to get GeneWeaver API to work: #my API key is in this code - for public release I've replaced it with [MyAPIKey] https://geneweaver.org/api/get/publication/byid/[MyAPIKey]/26/ https://geneweaver.org/api/get/geneset/bygenesetid/8/ #Not found #adding geneset->genesets doesn't help https://genew...
d046d72c611654eabdc43b717aa640ba6627c0272515746227c7bf77c1c7abb7
R
3,720
64
#Example usage of Brain.GMT: #Example Code written for R 4.3.3. using fgsea v.1.2.1 #Link to the fast gene set enrichment analysis (fGSEA) documentation: # https://bioconductor.org/packages/release/bioc/html/fgsea.html #installing the R package fast Gene Set Enrichment Analysis (fGSEA): if (!require("BiocManager", ...
d37ed21be23a7a5e206d62e0f0ec9536f8ad6b0a1909fb427cd4e5c69ef38741
R
3,725
72
################################################################################ # Written by Loïc Labache, Ph.D. # # Holmes Lab, Department of Psychiatry - Rutgers University # # January 26, 2024 ...
d7ca3dcec999241735fe42bcdb2a364b615dd811e40f517fcd5c74f0e62f7880
R
3,730
152
# Marker terms ---- imm=c("myeloid cell differentiation T cell activation response to interleukin-1 response to lipopolysaccharide response to interferon-gamma response to tumor necrosis factor antigen processing and presentation response to virus response to type I interferon regulation of innate immune response regu...
8b7b4edff3b78e8be93a9702d69e8feec6448fb477381bfca953a933f5576f74
R
3,731
73
#!/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/bernardo/processed/04.deseq2/genes_annotated_results_AD_vs_CT.tsv', sep="\t") ## Load datasets for diff...
c4a7b85ee31af733efe082c797a9b0a371952f867af361ca78ddd9db5a87f25c
R
3,731
57
HumanPsychiatricGeneSets_HumanOrthologs_JustSymbols_NoNA HumanPsychiatricGeneSets_RatOrthologs_JustSymbols_NoNA HumanPsychiatricGeneSets_MouseOrthologs_JustSymbols_NoNA HumanPsychiatricGeneSets_Mouse_Temp<-list() HumanPsychiatricGeneSets_Rat_Temp<-list() HumanPsychiatricGeneSets_Human_Temp<-list() names(table(Human...
e98de7210e501bb1bcd92fb35dc7093c1acca753d2e7026d02ac05aade0339c3
R
3,731
151
library(Signac) library(Seurat) library(tidyverse) # Ref: https://stackoverflow.com/a/5577647/4638182 load_multiomics_rdata <- function(file_path) { mo_env <- new.env() mo_obj_names <- load(file_path, mo_env) stopifnot(identical(mo_obj_names, c("seurat_multi"))) mo_seu <- mo_env[["seurat_multi"]] return(mo...
4e976febf90ee12046710d79e024f5758f073dbd15a35eea4b0d9b45e6e11369
R
3,734
77
################################################################################ # Written by Loïc Labache, Ph.D. # # Holmes Lab, Department of Psychiatry - Rutgers University # # March 28, 2024 ...
6481139660a5b71b34f12316549cccbcabeaf0678978673b5562d5575ad9134e
R
3,738
96
#4 Compare Young vs Elderly # Setup--------------------------------------------------------------- rm(list = ls()) ; gc() ; gc() set.seed(1234) wdir <- 'set your working directory' setwd(wdir) save.path <- 'object folder path' # load library easypackages::libraries(c('Seurat','tidyverse','fgsea','msigdbr','escape','...
17b3924eaf1fe73f9c82fc6c7056e7e2f3315c959e95a0189d274d6fe35a24dc
R
3,746
98
# Sconda conda activate TensorFlow_CPU_01; cd /mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN/traditional_ml_methods; R #!/usr/bin/R # All.vs.All.R wkdir="/mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN/traditional_ml_methods/" setwd(wkdir) library(ggplot2...
2ceac94dbd1c349129e0c576cc31977c11861fbe0a0fd674c7587b2887ed25a1
R
3,746
105
#'################################################################################# #'################################################################################# #' #' Prepare mCRPC PROMOTE vis2 SummarizedExperiment object #' with updated gene SYMBOL names ...
21da794fb2203532630d0919d8865086923329630a711601909e9c5922e2d805
R
3,752
99
#'################################################################################# #'################################################################################# #' Analyze PRAD #'################################################################################# #'##############################################...
71d7c2b194949838fbd52baea71f62ebc02aa92c43e329cfeabeac532f38a112
R
3,759
88
# This is an example to show how to normalize T2 template with Allen Brain Atlas data. # # ANTsR requires us to use the same data geometry (x,y,z) and same orientation. # Therefore, you need to work with resampling (resampleToTarget) provided by ANTsR and re-orientation by # itksnap -> Tools -> Reorient image... # # ...
5303c151d4057d3c415f561f776d3b1f438bd2fef9fde78348bcf8c7e2c607b0
R
3,762
73
library(readr) library(proBatch) library(reshape2) library(ggplot2) library(dplyr) # Load "%>%" sample_annotation_AgingMice = read_csv("data_AgingMice/3_data_for_plots/sample_annotation_AgingMice.csv") color_list_AgingMice = readRDS("data_AgingMice/3_data_for_plots/color_annotation.rda") loess_fit_75_df = read_csv(fi...
ef791e80823a964e137374b606191c3addba9f496a08293f11f2dc670d31acc8
R
3,765
116
#!/usr/bin/env Rscript ######################## ## choose data to upload ######################## # gene level data (primary analyses) e.keep = readRDS('filtered_expression_matrix.rds') keep.genes = readRDS('keep_genes.rds') meta = readRDS('cayo_bulkbrain_combined_metadata.rds') meta = meta[order(match(meta$LID, col...
6b3ba6d7cdfbd925e6dccb34a80c5172fdf4a53b50625df76748e6681e036c6e
R
3,766
142
xname <- c("age", "hgt", "wgt") br <- boys[c(1:10, 101:110, 501:510, 601:620, 701:710), ] r <- stats::complete.cases(br[, xname]) x <- br[r, xname] y <- br[r, "tv"] ry <- !is.na(y) wy1 <- !ry wy2 <- rep(TRUE, length(y)) wy3 <- rep(FALSE, length(y)) wy4 <- rep(c(TRUE, FALSE), times = c(1, length(y) - 1)) test_that("MI...
8a7af53855f3cba27afad732a25e1a0817d90c906931e06ebf42ae8ea29c7593
R
3,771
95
# script for running WGCNA on biocluster args <- commandArgs(trailingOnly = TRUE) library(WGCNA) # The following setting is important, do not omit. options(stringsAsFactors = FALSE) ############################################################################### #### STEP 2. Automatic construction of the gene netwo...
1d64b48bdf27708840dde1552797df4bafe2d3f370d04201c8a657d4bd6a24ca
R
3,779
195
################################################### # ~~~ FramebyFrame package ~~~ # STATISTICS UTILITIES # small functions statistics-related # Francois Kroll 2022 # francois@kroll.be ################################################### # function mad2(...) ------------------------------------------------------ # ...
3dec5bac57fc915fdca8f4249e9ff6a523d9a8263436ef267411c41c75cf0171
R
3,784
101
#### This script generates boxplots for permutation analysis #### (male downsampling to female levels) suppressPackageStartupMessages({ library(dplyr) library(ggpubr) }) save_ggplots <- function(p, fn, w=6, h=6){ for(ext in c('.svg', '.png', '.pdf')){ ggsave(p, filename=paste0(fn, ext), width=w, h...
d57b6ef242e04b20db1355d45f8dd7517a66d9391f48a8e643eba1e0ee02f53a
R
3,787
160
#### Code for plotting survival curve in Lam, Ndayisaba et al 2024 Neuron - FIGURE S7E #### Graph contains data from IL-HCNT61-A53T # 2/8/21: Re-plotting survival curves for manuscript figure # HCNT61-A53T library(survival) setwd("~/Desktop/20210208-Survival_plots_for_Figures") ####################################...
5201fd16911af4c4c6f516ab8ca5aed888b01c6202a8ad06ef4569c0ef6fbad6
R
3,791
132
#' Wrapper for VennDiagram with basic customization and command line functionality #' #' WARNING: This script is work-in-progress #' #' Example usage: #' #' cgat sc-counts2counts --counts-filename=featurecounts.tsv --phenotypes-filename=phenodata.tsv --factor=group,mouse_id,collection_date,slice_depth,slice_number,pi...
a9eac1698b8c9016dd4c96b10cd3dcb5da096e7d7746aa40d403b7b882de8d41
R
3,798
93
#' Convert to cor_tbl based on input type.convert #' @description The fortify_cor function is a deep encapsulation of #' the \code{as_cor_tbl} function and also supports converting raw #' data into cor_tbl objects by calculation. #' @param x any \code{R} object. #' @param y NULL (default) or a matrix or data frame with...
c6a7c9b1ded0176a0c92e9e6e2467587c9d7d9d97cfd933e2de946ddf885b6ae
R
3,803
140
#' Summary of a \code{mira} object #' #' @rdname summary #' @param object A \code{mira} object #' @param type A length-1 character vector indicating the #' type of summary. There are three choices: \code{type = "tidy"} #' return the parameters estimates of each analyses as a data frame. #' \code{type = "glance"} return...
2ace5dbdffd46bb1ae78e403ca4088c2d4d404d74283af7fd7ec017bacc0873d
R
3,807
100
library(dplyr) # Glia Glia <- read.csv('/mnt/data0/projects/biohub/hassan2022/output/omicsintegrator/csv/Glia.csv') colnames(Glia) #idx <- is.na(Glia$geneSymbol) #grep("NA",Glia$geneSymbol) #allgenes <- Glia$geneID #Glia$geneID[2] #allgenes[idx] #Glia$geneSymbol[idx] prize <- Glia$avg_log2FC prize <- as.data.frame(pri...
be6dc065acde6736d9a82a1ee5c496a4ab3126c1e71c68a94ceb82af97294565
R
3,809
114
TipCol <- function (tip.label) { pal <- palette.colors(pal = "Tableau 10") blue <- amber <- red <- teal <- green <- gold <- lilac <- pink <- brown <- grey <- character(0) # List taxa against their desired colours here blue <- c("taxon_1", "taxon_2") amber <- c("taxon_3", "taxon_4") red <- ...
83ee63641bc2eaa1a06d1f2b6cbf6dd44611b2101557d77d4fccc4f1cd142ea7
R
3,811
100
#' Graphical parameter for missing data plots #' #' \code{mdc} returns colors used to distinguish observed, missing and combined #' data in plotting. \code{mice.theme} return a partial list of named objects #' that can be used as a theme in \code{stripplot}, \code{bwplot}, #' \code{densityplot} and \code{xyplot}. #' #'...
9c650eae57f196f31e87487dcc132627141ad973884f27f988a54ea137996d3e
R
3,811
103
library(ggplot2) library(scales) library(ggthemes) library(patchwork) library(kableExtra) source('utils.r') # fig 1 results_fnames <- list.files('results/', full.names = T) results_fnames <- results_fnames[!grepl('ys.csv', results_fnames, fixed = T)] results <- do.call(rbind, lapply(results_fnames, read.csv)) results...
ae7c3c3cd7ce40d98f91e903d1ea6c48a20bad24734bd6b3c79e116b29f94bfa
R
3,820
96
#6 Deconvolution analysis # Setup--------------------------------------------------------------- rm(list = ls()) ; gc() ; gc() set.seed(1234) wdir <- 'set your working directory' setwd(wdir) save.path <- 'object folder path' # load library easypackages::libraries(c('Seurat','tidyverse','spacexr','escape','msigdbr'))...
e53c0bb23f6b76d128f5faa085c32945eeb3f37fccba3132b8e29586a0e78a87
R
3,821
116
--- title: "ncnb_coverage_plots" author: "Peter Zoescher" date: "12/15/2023" output: html_document --- ```{r libraries, echo=F, warning=F} # to be run in ccribioinf/dockrstudio:4.0.3-v1 # dockerhub manifest digest: sha256:055a81938337a3fc2a15039476094058f5691e02b529578041af508352264323 suppressPackageStartupMessages(...
11331820e1cd37cca1ad3c843b0439e870c565fe03ca05c74c63849778d12c74
R
3,822
123
suppressPackageStartupMessages({ library(clusterProfiler) library(enrichplot) library(DOSE) library(org.Mm.eg.db) library(org.Hs.eg.db) library(ggplot2) library(pathview) library(tidyverse) }) make_kegg_gsea = function(genelist, folder, organism, pvalueCutoff, pAdjustMethod, scoreTy...
d63f31cc53b4701d5ba87ea76c3d8eb9f69dcb21cb48cdbf239449ae58434121
R
3,828
110
test_that("TALON mult-sample", { file <- "../test_data/example_talon_read_annot_multiSample.tsv" gene_id <- "SIRV1.1" perc_As <- 0.80 abundance_file_type <- "TALON" min_exp_perSample <- 0 min_exp_mean <- 0.3 min_sample_perc <- 0 x <- read.table(file, header=TRUE, sep="\t") x.gene <- x %>% ...
f40911579c7952a3972ea4ba55cc1ab673e2cb3caecb003307aa1c071f9a4a15
R
3,832
95
#' Self-reported and measured BMI #' #' Dataset containing height and weight data (measured, self-reported) from two #' studies. #' #' This dataset combines two datasets: \code{krul} data (Krul, 2010) (1257 #' persons) and the \code{mgg} data (Van Keulen 2011; Van der Klauw 2011) (803 #' persons). The \code{krul} datas...
caab22e3e429947b5ff3200a82624581f1b6857e7f633913707baf6b5f44c40b
R
3,833
61
############################################################################################ # Copyright (c) 2022 - Respiratory Immunology Lab, Monash University, Melbourne, Australia # # Author: Matthew Macowan # # This script is provided under the MIT l...
eca7b1e6e6c3ac4cd06a86196d84be00b55eb1d7ffc614c4de1a8213872ea5b0
R
3,834
63
#' @templateVar MODEL_FUNCTION pstRT_rlddm6 #' @templateVar CONTRIBUTOR \href{https://github.com/hydoh/}{Hoyoung Doh} <\email{hoyoung.doh@@gmail.com}>, \href{https://github.com/sanghoon-kang/}{Sanghoon Kang} <\email{sanghoon.kang@@yale.edu}>, \href{https://jihyuncindyhur.github.io/}{Jihyun K. Hur} <\email{jihyun.hur@@y...
3df2c0fb930d7dac027306adddd5fcc534646a3ac10382aa65da5159045c1db1
R
3,837
115
ncs = length(oldprops) oslopes = matrix(nrow = nrow(SpeciesMat), ncol = ncs) oslopes = as.data.frame(oslopes) colnames(oslopes) = c(paste0("OldSlope",oldprops)) oslopes$m0 = oslopes$M = NA yslopes = matrix(nrow = nrow(SpeciesMat), ncol = length(props)) yslopes = as.data.frame(yslopes) colnames(yslopes) = c(paste0("Yo...
fe6fafb420bdc243b0d15ef131d4ff7d3d1bc68341a666d4763b92c80ec7e27d
R
3,840
126
--- output: github_document --- ```{r, include = FALSE} knitr::opts_chunk$set( message = FALSE, collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", fig.align = "center", out.width = "100%" ) ``` # ggcor The goal of `ggcor` is to provide a set of functions that can be used to visualize a co...
4c5ec6ced1d5aa5dde3d588e7f1356c42314618db5deafc95e8a3040d88fa94b
R
3,841
96
source('~/scripts/single_cell/de.R') source('~/scripts/single_cell/atac.R') source('~/scripts/perturbator/de.R') library(Pando) library(destiny) library(dtw) library(doParallel) registerDoParallel(20) filter <- dplyr::filter select <- dplyr::select setwd('~/projects/cutntag/') mark_colors <- c('H3K4me3'='#CB9ACA',...
74b4f5450fcab90659804eaa6a0cf2c6b88cd506d1d5408b91d40c899326a09c
R
3,844
83
#!/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")) library(dplyr) settings <- get_settings(omic = "integration", stage = "rnaseq_srna_intersection", dataset_name = NULL) # dataset_name="c9" message("Reading srna de res...
38969721659f8138f64ee309d9575071151305a27f07cf6ce0a7f584fce24089
R
3,845
81
library('phangorn') dyn.load("../src/RMorphyEx.dll") source("../src/Morphyex.R") 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', ...
b83544300e313ae6a174d584475e2d062e7524e0ac0b03ffe50756756fc147bc
R
3,848
113
# Load libraries ---------------------------------------------------------- library(tidyverse) library(GenomicRanges) library(plyranges) library(here) library(rtracklayer) library(patchwork) # Load data --------------------------------------------------------------- load(here::here("results", "pseudogenes", "pseudog...
4a6a2bc0994c75703ddbb52ddca5ca1fb82406c16a8ab615b9d76ad8315eb1ea
R
3,855
109
requireNamespace("jsonlite") requireNamespace("tibble") requireNamespace("dplyr") requireNamespace("limma") limma_analysis <- function( x, col_data, limma_settings, output_directory, results_callback = NULL ) { # x has samples in rows, proteins in columns dir.create(output_directory, showWarnings = FALS...
deb74caf23f473bb2f498c3c1d070cfdd89c13b9511b957c14ca490e0b777d96
R
3,855
95
slopes_mat[SpeciesMat$MammalNumberHorvath=="10.1.3" & SpeciesMat$Tissue =="Skin", 11:13] = NA slopes_mat[SpeciesMat$MammalNumberHorvath=="8.7.9", 1] = 2*slopes_mat[SpeciesMat$MammalNumberHorvath=="8.7.9", 2] slopes_mat[SpeciesMat$MammalNumberHorvath=="8.7.10",11] = NA slopes_mat[SpeciesMat$MammalNumberHorvath...
b106f9aaf8746bf41da7881b07516aec228f97d33b812fa956bd9c2e91a768a6
R
3,862
106
# Create synthetic data for publication library(mice) library(dplyr) library(miceadds) #Starting with the original dataset wml_long_excl_a=read.csv("/data/pt_life_whm/Results/VRF_cSVD/imputed_data/imputed_data_6.12.23/full_dataset_long_excl_a.csv") #Prepare data frame for imputation test = wml_long_excl_a %>% mut...
6550dc3ae115e10a9e42fbbc625c758e2893c49a29c523f1701dcfb7572fd00f
R
3,883
122
#' Ring Geom #' #' @param remain.fill the fill colour of the remaining area. #' @param start.radius inner circle radius. #' @param end.radius outer circle radius. #' @param steps radians per step. #' @inheritParams ggplot2::layer #' @inheritParams ggplot2::geom_polygon #' @section Aesthetics: #' \code{geom_ring()} unde...
2d389a25650d14625936e22dbd77bd1dc6a394fa4796e0464ead9a5b5f87c8a9
R
3,888
173
######################### # TEST 1: Simple problem # ######################### set.seed(123) # generate data n <- 1e3 y <- rnorm(n) x <- y * .3 + rnorm(n, 0, .25) x2 <- x + rnorm(n, 2, 3) x <- cbind(x, x2) # make missingness y[sample(1:n, n * .3)] <- NA ry <- !is.na(y) # Use univariate imputation model set.seed(123)...
60a4d96535bcd081d82904179eda51adfb5c821275a70413a79937895ad4af70
R
3,891
104
# Load libraries ---------------------------------------------------------- library(tidyverse) library(here) library(rstatix) library(ggpubr) # Load data --------------------------------------------------------------- GCase_activity <- read_tsv( here::here("results", "biochem", "GCase_activity_formatted.txt"),...
58b0cdd1ebf32eb90ac20fa21b4f2f14700d81107c6dfe0e9967bf8cfe4ddd9f
R
3,895
137
--- title: "**Idx Stats**" --- This section of the report details all of the stats that have been collates from the running **samtools idxstats**. ## **Mapped reads per contig from samtools idxstats** <br> This section will provide information from the output of **samtools idxstats** tool. It outputs the number of ...
0249c1b3ebf96557f2dfcf7db5b514a367fb69a218d29a8de99d1a9ebd05da38
R
3,907
74
GeomSplitViolin <- ggproto("GeomSplitViolin", GeomViolin, draw_group = function(self, data, ..., draw_quantiles = NULL) { data <- transform(data, xminv = x - violinwidth * (x - xmin), xmaxv = x + violinwidth * (xmax - x)) grp <- data[...
d67f0ceed05aa705a829f49f2d0295bf29e7b22ea9832b40d8cff6bdfe2e5953
R
3,907
98
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") library("ggplot2") ## Import counts matrix cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id")) cts_gene <- as.matrix(read.csv("../../../data/bernardo/process...
a445895da9836ebc1d61561f64d3db5077001f8c4c7f16a6cf802ecb1e232231
R
3,931
82
################################################################################ # Written by Loïc Labache, Ph.D. # # Holmes Lab, Department of Psychiatry - Rutgers University # # January 26, 2024 ...
ee6cf5ce8cc1aa56c5ac74b8d256e2ab05d3ac753ea4a4dd7d09db79eb07078b
R
3,933
110
test_that("SQANTI multi-sample", { file <- "../test_data/sqanti_classification_multiSample.txt" gene_id <- "ENSG00000TEST" perc_As <- 80 abundance_file_type <- "SQANTI" min_exp_perSample <- 0 min_exp_mean <- 0.3 min_sample_perc <- 8 x <- read.table(file, header=TRUE, sep="\t") x.gene <- x %>%...
e97d2a44689728d1e4eab3adafa1817fc7efae97e65347bd00917662e1fef81d
R
3,934
105
# Load libraries ---------------------------------------------------------- library(tidyverse) library(here) library(rstatix) library(ggpubr) # Load data --------------------------------------------------------------- GCase_activity <- read_tsv( here::here("results", "biochem", "GCase_activity_formatted.txt"),...
43bb88d29b6c4c30f5becd3c1228a15582a860f262d70d473376894b748649fb
R
3,947
120
## This script analyzsis gene set enrichment with permutation suppressPackageStartupMessages({ library(DOSE) library(here) library(dplyr) library(biomaRt) library(org.Hs.eg.db) library(clusterProfiler) }) get_biomart <- function(){ ensembl <- useMart("ensembl", dataset = "hsapiens_gene_ense...
50b80e72c865d87ee33575674302db7d82ed939a616c952db0cbf17d44a8053b
R
3,947
114
#' Imputation by classification and regression trees #' #' Imputes univariate missing data using classification and regression trees. #' #' @aliases mice.impute.cart cart #' #' @inheritParams mice.impute.pmm #' @return Vector with imputed data, same type as \code{y}, and of length #' \code{sum(wy)} #' @param minbucket ...
b8929cbe3141b91e7e50c71b1498c673ac98cc1fc3ed1990179b69dfe65dcd49
R
3,948
112
#' Pools R^2 of m models fitted to multiply-imputed data #' #' The function pools the coefficients of determination R^2 or the adjusted #' coefficients of determination (R^2_a) obtained with the \code{lm} modeling #' function. For pooling it uses the Fisher \emph{z}-transformation. #' #' @param object An object of clas...
9f9fb012d4e569191a1826a044ab5ed17344ac15cb65cbb2d846c8a52b73a209
R
3,953
98
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") library("ggplot2") ## Import counts matrix cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id")) cts_gene <- as.matrix(read.csv("../../../data/bernardo/process...
3b27a7859dcbfc5ddf0c7d1e3cf80a20af0492598f61cbc7cfe2cf26fa396b3f
R
3,967
77
library(dplyr) library(data.table) library(getopt) library(phenoscanner) command<-matrix(c( 'help', 'h', 0,'logical', 'help.', 'coloc_res', 'r', 1, 'character', 'susie coloc result.', 'exp_ma_file', 'e', 1, 'character', 'input GWAS .ma file.', 'cells','c',1,'ch...
0b93f6f4e1869f296134032566e617aa993c6e0e2a3f7e82ff846b4094331ea4
R
4,010
112
description <- "consistent logging and command line interface for R scripts" library("futile.logger") library("optparse") library("uuid") library("yaml") suppressMessages(library("jsonlite")) EXPERIMENT_ENV <- new.env() experiment_start <- function(option_list, description="", automount...
a951e032ba91cdbcc25f2fa39be5d3c5ce794752ccf1b84ecb1a347d482cd2a5
R
4,012
76
## R-Script to read ASCII performance index data and plot them library(ggplot2) library(reshape2) #read data file PIprofile <- read.csv(file=choose.files(), header=TRUE, sep="\t") #identify sorting columns, use them to define plot colors and then remove them if("genotype" %in% colnames(PIprofile)) { #Define colors...
bee1090017363862bd0e3e5c5f2cc87a209f2b677582ccb0229725fe774d4093
R
4,021
172
keep.in.model <- function(y, ry, x, wy) { (complete.cases(y, x) & ry) | (complete.cases(x) & wy) } impute.with.na <- function(x, wy) !complete.cases(x) & wy check.df <- function(x, y, ry) { # if needed, writes the df warning message to the log df <- sum(ry) - ncol(x) - 1 mess <- paste( "df set to 1. # o...