sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
b640fbca584ab21b0e76d68a56fc8eda72d8e1591213d56963a663bd548f1537
R
4,581
109
#!/usr/bin/env Rscript # Script to overlap public database file # # Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder. # # This file is part of Slamdunk. # # Slamdunk is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free So...
c424874021f85df0c477e5ff7d3b4781ca76587b01fd64243ac776329cac4e10
R
4,592
102
#' @title One-liner wrapper to create a MOFA2 object from multiple input objects and ready for training #' @name mofa2 #' @description #' This is a one-line wrapper that combines the use of \code{\link{create_mofa}} followed by \code{\link{prepare_mofa}}. #' Please read the documentation of the corresponding functions ...
8c9a491b4a228b4e60ac026cfda1cf4afcb64b7c83e93bd3e0a3f50ebef26375
R
4,601
121
setwd("/media/user/disk21/completeAnalysis/visium_2Jun/") library(Seurat) obj = readRDS("../visium_15Sept/visiumObj_20Sept.rds") meta = read.csv("meta_12Mar2025.csv", row.names = 1) identical(rownames(obj@meta.data), rownames(meta)) cpm = readRDS('../visium_15Sept/log2cpm.rds') orig_cpm = cpm identical(colnames(cpm...
54940ed3f7d204fbf94eb69f9d05abe47d07ba8c8616bf652675a2841b7b20f7
R
4,608
134
########################### Generate ground truth outputs ################### # # Objective: Script to generate decision outputs for ground truth # parameters; should be run after establishing the model sample size # in analysis/01_load_calibration_params.R, which ########################### <<<<<>>>>> #########...
5f37f903536f3ebb89ff53a751c4a297d98e1c58cc121b8d497d9e4bfcca7897
R
4,610
106
# Need to export R_MAX_NUM_DLLS=1000 before sourcing this script. library(sos) library(htmlTable) library(stringr) library(dplyr) # Get auc functions auc.search <- findFn("auc", maxPages=1000) auc.functions <- auc.search %>% filter(Function == "auc", Package != "pROC") %>% select(Package, Function, Description, Lin...
ca801f3ae1d137949a194cb69921a3b9518ce0044efc359174523b089b9aa9f3
R
4,611
109
#' @title Prepare Data for Volcano Plot #' @description Formats differential analysis results for volcano plotting. #' Handles numeric conversions, factor levels for 'State' (Up/Down/NS), and optional VIP scores. #' @param data Data frame containing differential analysis results. #' @return A list containing: #' ...
d9ae20a7595382e0f28d946811d9b378273502222830acd73c34f1b90b02466a
R
4,619
136
#!/usr/bin/env Rscript suppressPackageStartupMessages({ library(WGCNA) library(tidyverse) }) # ---------- CLI 參數 ---------- args <- commandArgs(trailingOnly = TRUE) # 預設參數(可在 CLI 覆寫) opts <- list( expr_csv = "RNAseq_pre.csv", # 樣本 x 基因 pheno_csv = "luad_clinical.csv", # 至少要含 sample rownames + 一個標籤欄位 label...
f54cb42dca988d08be6df638233687a7e93d75cd4122ed90db7db09198f18947
R
4,619
100
# GenT vs MAGMA Type I error # Steps: ## 1) (R) Generate simulated GWAS summary statistics under null hypothesis ## a) (R) Identify all SNP-gene pairs ## b) (R) Extract LD matrices for each gene ## c) (R) Draw effect sizes from multivariate normal distribution with known LD ## d) (R) Save file of GWAS summary stat...
6efa3b20bba62258ecbe6e0f330c9163c61d2e90bebd21eaab050149f89d59f1
R
4,620
119
### PACKAGES TO LOAD ###------------------------------------------------------------------#### library(ggplot2) library(colorspace) library(tidyr) library(dplyr) library(ggthemes) library(ggpubr) library(ggrepel) library(effectsize) library(ggthemes) library(scales) library(forcats) ### FILE/FOLDER PATHS ###-----...
2c681d543d25451b50554f7245c111ff334bd0d907d33a731e7bb47652282eaf
R
4,623
114
#' Perform a statistical test for differential prioritization #' #' Execute a permutation test to identify cell types with statistically #' significant differences in AUC between two different rounds of cell type #' prioritization (for instance, the response to drugs A and B, as compared #' to a common untreated contro...
e89ad98a7272789794ba30a624e2debfc678ef83f0dd3e837376f8a1cfe6f39a
R
4,623
150
##-------------------------------------## ## Pseudobulk TAB ## ##-------------------------------------## majority_vote <- function(x) { ux <- unique(x) ux[which.max(tabulate(match(x, ux)))] } aggregate_column <- function(x) { if (is.numeric(x)) { return(mean(x, na.rm = TRUE)) } else ...
17bf19d569ad4f12fb7ef1286e3ce808f9407a6dcef84fc3d71339b3c9cd76b6
R
4,639
153
library(lightgbm) # We load in the agaricus dataset # In this example, we are aiming to predict whether a mushroom is edible data(agaricus.train, package = "lightgbm") data(agaricus.test, package = "lightgbm") train <- agaricus.train test <- agaricus.test # The loaded data is stored in sparseMatrix, and label is a nu...
1cdfd25132a19543d5cad5b620bd2e82c495afc76deaad1c9d8b6e1e669d4fe8
R
4,640
154
# ============================================================================= # 01 --- example extraction from simulation data # Author: Marc Grünig # # Description: # This script extracts forest state transitions from a forest simulation # database. The extracted transitions serve as training data for a deep neur...
cbb2726a9269f7a7a777daeeeb7945a2d6e23d357ed4070bfdcddc5df79e0d00
R
4,640
118
## helper functions for constructing SPM calls used by targets ---- # only finds the existing smoothed data, doesn't rerun it get_smoothed <- function (bold_path, kernel = 4) { out_prefix <- glue("smoothed_{kernel}mm_") out_path <- file.path(dirname(bold_path), paste0(out_prefix, basename(bold_path))) return (ou...
82c06abf65c0fdac21afa1157341e6099aaa871e6b345df776a8992a46f31504
R
4,642
157
--- title: "00_Preprocessed" output: html_document date: "2024-08-29" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} library("Matrix") library("readr") library(Seurat) library(tidyverse) library(harmony) ``` ```{r message=FALSE} source("~/Rfunction/scTheme.R") scThemes<-scThemes() ``` ...
12803ac61954c2bf922d43e05e6caff038b819c7781c3501dff9227e7db14831
R
4,643
123
library(tidyverse) library(optparse) library(Biostrings) library(DESeq2) library(tximport) # Also need to add the deseq parts # To do/plan: # 1. Need a csv file for metadata # 2. Need a grouping/cofactors text file to match and extract group names and other metadata # order of this text file needs to be...
14a0f3d8720acc635c4b9d1b00b899e2d7c8754a1ebbf7bfebbbf2740fb8e9b9
R
4,652
121
library(pROC) data(aSAH) test_that("cov with delong works", { expect_equal(cov(r.wfns, r.ndka), -0.000532967856762438) expect_equal(cov(r.ndka, r.s100b), -0.000756164938056579) expect_equal(cov(r.s100b, r.wfns), 0.00119615567376754) }) test_that("cov with obuchowski works", { expect_equal(cov(r.wfns, r.ndka,...
03ae2b7f8adce190a119772dd96a1420516d6ff9ff65f0abb1d3455c5fda8a55
R
4,659
132
--- title: "PCA" author: "Tingting" date: "2024-05-01" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(tidyverse) library(broom) library(ggstance) library(readxl) library(ggpubr) library(...
a9e17e1102ce5f1fe436c2046fbf035dd358038abe52e19a0c5e1d19f9dccb5b
R
4,665
77
#' @description CNS tumors have subtypes as per the [WHO 2016 CNS subtypes](https://link.springer.com/content/pdf/10.1007/s00401-016-1545-1.pdf). #' However, these are not captured in our molecular data so would need to be updated by #' searching for terms in the reported pathology_free_text_diagnosis column in OpenPB...
1399f3c383fafcaad299a8133696b502c5d8b657e81136a4ac929a7ed4f9e69d
R
4,670
120
runcount=function(data,sample){ count=as.data.frame(t(data@assays$Spatial$counts)) id<-colnames(count) count$x_y=rownames(count) samplename<-paste0("^",sample,":") count$x_y <- gsub(samplename, "", count$x_y)#1_1 count %<>% separate(x_y, into = c("x", "y"),sep = "_",remove = FALSE) count$x_y <- str_replac...
14779f67f375808b18328ed1e3f1c166312a4752ada23f89088cf7e69dc7d3bb
R
4,673
122
# pROC: Tools Receiver operating characteristic (ROC curves) with # (partial) area under the curve, confidence intervals and comparison. # Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck, # Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez # and Markus Müller # # This program is free soft...
8daf8d357644eecf75a7755d7417c4e1484565babb32fc4078a5e48ab4ed99a0
R
4,677
107
library(data.table) library(ggplot2) library(ggplotify) library(cowplot) source("../Plot_theme.R") # Load color scheme colors <- fread("../Plotting/colors.csv", strip.white = F) color_v <- colors$Color names(color_v) <- colors$ID # Function to color facet strip backgrounds fill_title <- function(p, palette){ g <- g...
9784d475269d2256fe3b285c126960bcb6d40fc0f0c632be7654dda58bcec8ec
R
4,682
117
--- title: "Plotting #5: Spatial Plotting Functions" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: rmarkdown::html_vignette theme: united df_print: kable vignette: > %\VignetteIndexEntry{Plotting #5: Spatial Plotting Functions} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- *** ...
3dd714c3de9c0ecdd1373beae0de1e4ea849026e7ec82c336839753065f09cd6
R
4,685
102
# Merges methylation beta-values, m-values, and cp-values matrices for # all pre-processed array datasets. # Eric Wafula for Pediatric OpenTargets # 09/29/2022 # Load libraries suppressPackageStartupMessages(library(tidyverse)) # Magrittr pipe `%>%` <- dplyr::`%>%` # establish base dir root_dir <- rprojroot::find_...
db11ae5854c5fb164200a0c15e7c08be945ca5022277ac507baa166e5a056d68
R
4,697
129
########################### Internal Validation ######################################### # # Objective: Validate BayCANN posteriors by plotting fit of calibration outputs ########################### <<<<<>>>>> ############################################## rm(list = ls()) # Clean environment options(scipen = 999) ...
aa1a506afe3f40612470461fa74d78dfe6484f503d3d39278084a2d6f2757c3f
R
4,702
121
# CREATE QQ PLOTS AND GET LAMBA VALUES library(tidyverse) library(normentR) library(reporter) library(dplyr) # Set directories DATA.DIR <- dirname(rstudioapi::getActiveDocumentContext()$path) setwd(DATA.DIR) iwrd <- read.table("iwrd_imputed_results.txt", header = T, sep = "\t") pics <- read.table("pics_imp...
ca0281b2a2130b3b4b5f9af736a6ab711f6902678372904e58dddb6b2729158d
R
4,707
134
# Load packages ---- library(shiny) library(shinydashboard) library(dplyr) library(tidyr) library(ggplot2) library(ggprism) library(shinythemes) library(googlesheets4) # Load datasets of AIRE dependant genes AIREdep = read.csv2("data/TRA_AIRE_dependency.csv") # Load datasets of gene expression in mouse and human gene...
74f0a853f419bfd02892a79d9b29e12919e0ed338cf9b715295894f983484da1
R
4,710
162
### This script plots global results across channel densities for connectivity ### Christina Stier, 2025 ## R version 4.2.2 (2022-10-31) ## RStudio 2023.3.0.386 for macOS rm(list = ls()) install.packages("corrplot") install.packages("igraph") install.packages("qgraph") install.packages("car") install.packages("comp...
363925aef0c26acb2cf030ba0508126edab6c811f69d22b81a0575f8b54ad294
R
4,712
105
library(Seurat) library(ggplot2) library(dplyr) library(ggpubr) library(tidyverse) library(pheatmap) library(reshape2) library(tidyr) library(ComplexHeatmap) library(rstatix) library(ggrepel) source("~/PD_project_analysis/manuscript_scripts/MV_utils.R") color_palette_cluster_DaN <- c("SOX6+/CALB1- Mature" = "#006400",...
3f7d8955d5643295341271e7d57763eeb88666f80ab54b42ddf65cdf4203cdf7
R
4,713
97
# pROC: Tools Receiver operating characteristic (ROC curves) with # (partial) area under the curve, confidence intervals and comparison. # Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck, # Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez # and Markus Müller # # This program is free soft...
808d8cb6000a253a66b1aa5381d47099a7105e29ae638e173a8fea4aee45b61d
R
4,731
102
########################################################## # # This function is used to extradt the within-network # time delay estimation of visual and somatomotor, # and the visual-somatomotor time delay # # Liang Qunjun 2023/10/10 # ObtainBrainData_custom <- function(sbj_use, td_list, weight_list, net_annotation)...
2099ecb11becae1b6f63e021ea96a2400211a0bad905c2b8cf308f327507294a
R
4,744
116
#' @title Updates shinycell config to recognize a metadata as a discrete one #' @description Updates shinycell config to recognize a metadata as a discrete one. This #' function is useful when a discrete metadata only contains integers, e.g. #' unspervised cluster labels starting from 0 to (n-1) clusters. If these #...
5f7ce9ab65bf40acb8b710577779aa92aa538ea0d28f49f5cc2440f4eb885ca1
R
4,758
132
#' @title Compute Pairwise Bivariate Moran's I #' @description Calculates the bivariate Moran's I correlation matrix for all pairs of variables starting with "Metabolite" or "Gene". #' Uses a k-nearest neighbor (k=5) spatial weight matrix. #' Computations are parallelized. #' @param df Data frame containing 'x', 'y...
86e10166307c6e78e1e9ff0b02c32aae922665389d0ecca3bfaf0b3177b464b5
R
4,758
143
#' A 'ggplot2' geom to draw genomic ranges as round rectangles. #' #' `geom_roundrect()` draws ranges defined by `xmin` and `xmax` coordinates with rounded edges. #' #' This geom draws rectangle with round or sharp edges between defined start and end coordinates. #' Intended application of this geom is to visualize gen...
545c5b7283ca16014cd1a8f9827bd526579d0c2a66f269df99150687b0d8bcb4
R
4,767
161
# This script outputs the oncoprint N counts table #### Set Up -------------------------------------------------------------------- # Load libraries library(dplyr) library(maftools) #### Directories and Files ----------------------------------------------------- # Detect the ".git" folder -- this will in the proje...
f8f40ef3eb095d4341f99c842c2d1dc2b6252788f28f1767bf10394188b42b94
R
4,776
134
#' Aggregate and count values across logical membership columns #' #' For every logical membership column, aggregates a collapse column per key, #' counts the members and binds the collapsed values and counts back to the #' input. Extends \code{\link{col_agrecounter}} with an outer loop over multiple #' logical columns...
9dc5790a2b67da85371f1972f74ba97228057f883cfe2d9e9c30b24beaa35086
R
4,778
204
--- title: "richR: Functional Enrichment Analysis and Visualization" author: "Kai Guo" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{richR: Functional Enrichment Analysis and Visualization} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, in...
24a5cbb5384033700ad4237a50d69895d00d16742a69059bf5dd66d5c5c68949
R
4,792
117
#' Fit an initial MRF model #' #' @param dat.list A list containing multi-omics datasets with samples in columns and features in rows. Samples should be matched across datasets. #' @param ntree Number of trees for fitting MRF model. Default is 300. #' @param scale Whether to z-standardize each feature. Default is TRUE....
0b63fd0c7f3fe3b342136223f145d18d700d49080e75123e392200f411558b61
R
4,803
161
--- title: "Demographics" author: "HannahSavage" date: "2023-04-17" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## SET ENV ```{r, include = FALSE} library(readxl) library(dplyr) library(tidyverse) library(ggplot2) library(grid) library(reshape) library(scales) library(...
8073cb669ee261d8f48ca7fe7b3480489cd7e6736457746f30a2a960809c7374
R
4,806
122
rm(list=ls()) ## COMMON LIBRARIES AND FUNCTIONS source("100.common-variables.r") source("101.common-functions.r") source("300.variables.r") source("301.functions.r") ## SCRIPT SPECIFIC LIBRARIES ## SCRIPT SPECIFIC FUNCTIONS ## SCRIPT CODE ## ## if( 1 ){ Print.Disclaimer( ) for( lset in NOVEL.SET ) { ...
5f649c6ba9ae204c1b1c706a89f38e537153b2cbd8bfa328c86b2ab75c907297
R
4,821
135
# Code to generate Figure 2 Supplement 1 of the Jokura et al 2024 Ctenophore apical organ connectome paper # source packages and functions ------------------------------------------------ source("analysis/scripts/packages_and_functions.R") # load Subepithelial nerve net ----------------------------------------------...
19b61b6b4ae10cb68b394a3b1ea48b71d8a7ba547ed202499e8da0feadfe9487
R
4,825
172
### analysis single channel nuclear intensities by cell # go to main directory (parent directory of scripts) if (basename(getwd())== "00_scripts"){setwd("../.")} #load packages library("tidyverse") library(colorRamps) #define working directories in_dir = "./03_R input/" out_dir = "./04_intens_distrib...
a781c07be6dc112cdfe03ba59915fe26a2dbd22a9eca6d7d5e86c4c1bcb56f77
R
4,826
173
set.seed(11235) library(tidyverse) data <- read.csv("D:/Program Files/MATLAB/Joint_Perception_Project_Final/EEG/CPP_amplitude_dataset.csv") library(ggplot2) library(ggprism) library(gridExtra) library(patchwork) library(lme4) library(ggpubr) library(dplyr) library(lmerTest) library(sjPlot) l...
b0574eb8923fc6ee96e6769743f1e5bc6209905443340f3cfb72dfda63cdf468
R
4,833
137
library(tidyr) library(ggplot2) library(dplyr) library(aplot) library(scales) library(patchwork) # ---- Define manual colors for the 5 combos ---- custom_colors <- c( "FL_vs_VGC only" = "#fdae61", "FL_vs_VGC & FL_vs_HGC" = "#fb6a4a", "FL_vs_HGC only" = "#d53e4f", "FL_vs_VGC & HGC_vs_VGC"...
5a194e3341ee0b4f488823f21c3b3c51e2bdd5355c92776c5c3cf2abf3a905f6
R
4,850
166
#' @name lgb.plot.interpretation #' @title Plot feature contribution as a bar graph #' @description Plot previously calculated feature contribution as a bar graph. #' @param tree_interpretation_dt a \code{data.table} returned by \code{\link{lgb.interpret}}. #' @param top_n maximal number of top features to include into...
4162a70cc88cd61cf5f3498d0ab6e8c786d54afa587c66a44241a78273fa06e4
R
4,858
131
#' A 'ggplot2' geom to draw arcs between genomic alignments. #' #' `geom_wide_arc()` draws wide polygons between two sets of start and end coordinates. #' #' This geom is intended to draws wide arc polygons between self-alignments defined in PAF format. #' Such alignments can be directly visualized using a wrapper func...
4d283c743874917693c393db303ea8c49eeffa027e0d943e8a48c3f53f9b2fa3
R
4,860
116
####################################### ## Functions to train a MOFA model ## ####################################### #' @title Train a MOFA model #' @name run_mofa #' @description Function to train an untrained \code{\link{MOFA}} object. #' @details In this step the R package is calling the \code{mofapy2} Python pack...
6a2ba84e9fef03f345b73e7dae54b66ea6b9602f38a297a63796ac0f40dec11a
R
4,860
134
library(oro.nifti) source('~/src/R.lib/custom.ggplot.r') cos.sim=function(A, B) { return( sum(A*B)/sqrt(sum(A^2)*sum(B^2)) ) } recalculate=T RSN=T if (recalculate) { if (RSN==T) atlas=readNIfTI("data/atlas_modules.nii.gz") else atlas=readNIfTI("data/atlas_relabeled.nii.gz") atlas_labels=read.table...
e3bf1d2188a8077ba40d44e374ab0e9af61ab4a58cb11f7108228083c9e58497
R
4,864
99
############################################################################################ # Functions for performing ANOVA and Tukey HSD tests on hallmark pathway GSVA scores # # # # Stephanie J. Spielman, 2020 # Jo ...
9c7c65ef6a6ce376c32ea036a6d15fcb908388c2836b02654eeff03259db0c35
R
4,870
172
### analysis single channel nuclear intensities by cell # go to main directory (parent directory of scripts) if (basename(getwd())== "00_scripts"){setwd("../.")} #load packages library("tidyverse") library(colorRamps) #define working directories in_dir = "./03_R input/" out_dir = "./04_intens_distrib...
dbb1ee0bcc70f9ed4082629b990c813056aac0fa5f10aea9df0f70759776ce81
R
4,872
112
#' Generate code files required for shiny app (one dataset) #' #' Generate code files required for shiny app containing only one dataset. In #' particular, two R scripts will be generated, namely \code{server.R} and #' \code{ui.R}. If users want to include multiple dataset in one shiny app, #' please use \code{makeS...
50bee94dcc754f391f89cc32cb1073a1b8c85a04d145b43f7cb94e3840172f5a
R
4,881
156
--- title: "Add molecular subtype for samples that have hallmark Ewings Sarcoma fusions" output: html_notebook author: K S Gaonkar for D3b date: January 2020 --- Identify sample IDs with hallmark _EWSR1_ fusions and subtype as `EWS` ```{r} library("tidyverse") ``` ### Set directories and file paths ```{r} # to get...
699e857bcfa7a0ade802c6004d99cf373459d6d574f98d0690fda7d7675fee39
R
4,905
139
# Script by J. Taroni for ALSF CCDL # Adapted from code written by Anna R. Poetsch and Candace L. Savonen # # Given a MAF file, extract de novo mutational signatures for a range of k as # specified by the nsignatures_floor and nsignatures_ceiling arguments using # the sigfit package. # # This script is essentially a...
453bb38d372c8aa3c97d437a00b0d916ec15760c8922a254e495ce716f2c7c5f
R
4,907
119
options(Seurat.object.assay.version = "v3") # use old Seurat object version library(Seurat) library(ggplot2) library(dplyr) source("~/PD_project_analysis/manuscript_scripts/MV_utils.R") setwd("/home/ubuntu/PDSCRBNG/03_04_24_Figure_4") MLO_DA.big <- readRDS("MLO_DA") # from script Figure 2.R MLO.big_batch_2_DA <- MLO_...
35484aa8c5b0a33d0e866eff15eb43452907a23b898d29a6f3a3aa62e7d5ecdd
R
4,918
186
library(truncnorm) get_param <- function(x){ x0 <- x[x == 0] x1 <- x[x > 0] cut <- mean(x1) p0 <- length(x0)/length(x) m1 <- mean(x1[x1 < cut]) sd1 <- sqrt(var(x1[x1 < cut])) m2 <- mean(x1[x1 > cut]) sd2 <- sqrt(var(x1[x1 > cut])) list( mu = c(m1, m2), sigma = c(sd1, sd2), p = length(x1[...
b18897a575a84dd06b90ddb6b0331f4a2b38bc0f39577700b3561dd6851b9e25
R
4,932
128
#!/usr/env Rscript # # Rscript to test that we can recall all the known outliers and events # in the Kremer et. al. dataset after a successful DROP run. # ## Parameters to change suppressPackageStartupMessages({ library(data.table) library(OUTRIDER) library(FRASER) library(yaml) }) # default groups and folder...
686f7406eba541cbc2c5ae83e60beb4bc7a66de46f1b4044e451c4e83a3cfedb
R
4,950
137
source("Figure_3/util.R") library(org.Hs.eg.db) library(org.Mm.eg.db) library(RColorBrewer) library(enrichplot) library(clusterProfiler) library(msigdbr) # ==== iN ===== ## ==== GO GSEA ===== res_Wbo2 <- read.csv("Figure_3/results/iN1_neuron.csv", row.names = 1) res_I27 <- read.csv("Figure_3/results/iN2_neuron.csv",...
c1a7ce6f1685df67ef730acb57a13713ef4850e84f8f6b8021e0462a8848245f
R
4,950
105
mQTL_tables <- function(){ # Extract mQTLs for the red/blue significant sets to test for genetic colocalization table_mqtls_EPICredC = data.frame() table_mqtls_450kredC = data.frame() table_mqtls_EPICblueC = data.frame() table_mqtls_450kblueC = data.frame() chr = dir("./mQTLdb/",full.names=TRUE) ...
0899815cfbef0a3713ea18cdf3d69aa705fbda04b99fc7356b08e9f01a989fdf
R
4,951
124
library(ComBatFamily) library(data.table) library(dplyr) library(mgcv) library(rjson) library(stringr) library(tidyr) ################## # Set Variables ################## args <- commandArgs(trailingOnly = TRUE) dataset = args[1] print(paste("Processing", dataset)) ################## # Set Directories ########...
544a563b4456cfcee559975dd7705e345d6de498efbc291127894322ae63866e
R
4,951
153
#' Read Olink data in R. #' #' @description #' Imports a file exported from Olink software that quantifies protein levels in #' NPX, Ct or absolute quantification. #' #' \strong{Note:} Do not modify the Olink software output file prior to #' importing it with \code{\link{read_npx}} as it might fail. #' #' @details #' O...
f570a66e6e5f26e42443e725c8e6741f3ac97d44cfd12dc20d6d69ce36629153
R
4,955
126
#' Convert counts or proportions matrix to list object for propeller #' #' This function takes a matrix of counts or proportions, and returns a list #' object that is expected from the \code{propeller.ttest} and #' \code{propeller.anova} functions. This allows the \code{propeller} framework #' to be applied to any pro...
e93c8fb47bbcc27b088fbc7ffeddb8a40e820ca82598a3bf64236156a73d79c0
R
4,956
166
--- title: "ChIP-Seq Heatmaps" author: "AF" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` Making heatmaps for MSL1, MSL2, H3K4me1, H3K4me3, H3K27ac, H3K27me3, H3K9me3 on the MSL1-V5 control peaks which we annotated as well in a separate script. ``...
7e9c21f51ac68aa77bf09d676d915f494a853ec087fc2bb14f307e01a589dd2f
R
4,958
123
--- title: "Using WHO 2016 CNS subtypes to improve meningioma harmonized diagnosis" output: html_notebook: toc: true toc_float: true author: JN Taroni for ALSF CCDL (code) date: 2021 --- Meningiomas have subtypes per the [WHO 2016 CNS subtypes](https://link.springer.com/content/pdf/10.1007/s00401-016-1545-1...
91cbbccdd5bc5a2ab5444b4a0c1fd1a2154446efc897ceefc27226e9661851e8
R
4,960
133
splicetype="SE" #type of alternative splicing, e.g., SE, A3SS, A5SS, MXE, IR counttype="JCEC" #JCEC (junction count + exon body count) or JC (junction count only) ################## #Input parameters# ################## # inputpath="./02_PSI_value_quantification/01_Get_PSI_from_rMATS_output/example_input" ...
df7bcd72fa18dca5e2e3ea7284c4dd69cd8316309eecdc5a9d6848c320945074
R
4,966
122
# pROC: Tools Receiver operating characteristic (ROC curves) with # (partial) area under the curve, confidence intervals and comparison. # Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck, # Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez # and Markus Müller # # This program is free soft...
e9e89ebe967de69dc6d2d799dd52ee7c72c812e582f9bf264bc6bbdf5ffa1726
R
4,967
162
##-------------------------------------## ## QC - GENES ## ##-------------------------------------## calculate_gene_qc <- function(countMatrix){ print("Calculating GENE QC") average_exp <- rowMeans(countMatrix) total_exp <- rowSums(countMatrix) expr_cells <- countMatrix > 0 expr...
f5f656a1de32a2edd85fe70812f263dcf0f4502597cb300d02538fcd56c8ac02
R
4,973
119
###### Function to run LDSC ###### # #' Run LDSC # #' # #' Use GenomicSEM to perform cross-trait LDSC analysis and returns # #' the heritability of the exposure (SE) and the cross-trait intercept (SE) # #' # #' @param exposure_data xx # #' @param outcome_data xx # #' # #' @inheritParams MRlap # # #' @export # NOT EX...
b6e3dfad0eb95f8098db0939422db613c6e2865e8989fc42773debdead897def
R
4,978
126
#' Read PAF from an input file #' #' This function takes an PAF output file from minimap2 and loads the file along #' with user defined set of additional alignment tags (see PAF specification). #' #' @param paf.file A path to a PAF file containing alignments to be loaded. #' @param include.paf.tags Set to \code{TRUE} i...
24c2dafbb2e90dd608662676e6d8bd87173c7d66479d156d60e6e04f49d545d7
R
4,997
135
--- title: "High-Grade Glioma Molecular Subtyping - Fusions" output: html_notebook: toc: TRUE toc_float: TRUE author: Chante Bethell and Jaclyn Taroni for ALSF CCDL date: 2020 --- This notebook prepares putative oncogenic data for the purpose of subtyping HGG samples ([`AlexsLemonade/OpenPBTA-analysis#249`...
f613169999bd44f5ab9451544a2a2232ea1c1e83442475c61c690007e544a031
R
5,000
134
#rm(list=ls(all=TRUE)) library(data.table);library(magrittr);library(tidyr);library(dplyr);library(ggplot2) library(mvnfast,lib='/home/lorincn/Rpkgs') library(mvsusieR,lib='/home/lorincn/Rpkgs') # library(snpsettest,lib='/home/lorincn/Rpkgs') # source('/home/lorincn/Rpkgs/manual_snpsettestcode.R') library(ACAT,lib='/ho...
b2771bff546cd8d7e6696a62ea25679b74844244a8331405400944e891a69018
R
5,002
129
# Author: Komal S. Rathi # Date: 11/26/2019 # Function: # 1. summarize RNA-seq to HUGO symbol x Sample matrix # 2. tabulate corresponding gene annotations # Example run: PolyA RNA-seq # Rscript analyses/collapse-rnaseq/01-summarize_matrices.R \ # -i data/pbta-gene-expression-rsem-fpkm.polya.rds \ # -g data/gencode.v2...
7a743c4662d936bb8a4f61d7e778b331bf28dd1c5f745069bbe0b5b0224ed9a8
R
5,003
118
library(optparse) library(tidyverse) arguments <- parse_args(OptionParser(), positional_arguments = 3) sj_dir_path <- arguments$args[1] %>% str_split(",") %>% unlist() output_path <- arguments$args[2] blacklist_path <- arguments$args[3] # sj_dir_path <- "/home/jbrenton/nextflow_pd/output/STAR/align" # base_dir<- "/h...
0d0bbabb5d5d6a882e184c2341667381bfbb830a822966b46060e7ac9924aa3b
R
5,007
106
library(data.table) library(stringr) library(ggplot2) library(ggplotify) library(cowplot) source("../Plot_theme.R") # Load color scheme colors <- fread("../Plotting/colors.csv", strip.white = F) color_v <- colors$Color names(color_v) <- colors$ID # Function to color facet strip backgrounds fill_title <- function(p, p...
bb7e9f4764be99e68c422045a68777b0767b5876a6007ebc351ebcfc5dbd55c8
R
5,008
151
########################### Coverage Analysis ########################## # # Objective: Program to check coverage of targets # ########################### <<<<<>>>>> ######################################### rm(list = ls()) # Clean environment options(scipen = 999) # View data without scientific notation #### 1.L...
a22f5cb1993ec9bb807d67aad4c41dba448df1f67ebe9a89612ed40f24b8b041
R
5,019
107
library('ggpubr') stringsAsFactors=FALSE library(grid) library(optparse) ############################################### Comparing TERT and TERC expression with EXTEND Scores (Figure 2) ################################################################################################ root_dir <- rprojroot::find_ro...
f8226cdeda4ad186a9286157a3564a0848a7a806a08365a7fd940dc75aac6e70
R
5,020
151
# script for finding mistakes in the catmaid database, such as skeletons without # annotations, cilia which don't have both tip and centriole tagged, etc. source("analysis/scripts/packages_and_functions.R") # find skeletons without annotations ------------------------------------------- skids <- unlist( catmaid_fet...
91204c3697a844e471a3689bc0920a5a0c0e31a3550f47ee7c8b2fe49943869a
R
5,022
117
# plot/table of each cohort + cancer_group or cancer_group suppressPackageStartupMessages(library(tidyr)) suppressPackageStartupMessages(library(dplyr)) suppressPackageStartupMessages(library(ggplot2)) pan_cancer_plot <- function(expr_mat_gene, hist_file, map_file, analysis_type = c("cohort...
259111982113b2947e3402de65a53ab384f94833f95ceacb9614d3bd784d0b48
R
5,025
105
args <- commandArgs(TRUE) run_scmapcell <- function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){ " run scmapcell Wrapper script to run scmap on a benchmark dataset with 5-fold cross validation, outputs lists of true and predicted cell labels as csv files, as well as computa...
c28c81b236c968d0ea85c447923ad065b1b9c86fedba923032e732d105f0cd4e
R
5,028
142
#' Performs F-tests for transformed cell type proportions #' #' This function is called by \code{propeller} and performs F-tests between #' multiple experimental groups or conditions (> 2) on transformed cell type #' proportions. #' #' In order to run this function, the user needs to run the #' \code{getTransformedPro...
5e401e706fc273531e77dff986509783b109b2296a2a6abebfc4a84a2110e6da
R
5,029
176
--- title: "Fried_task_overview" author: "HannahSavage" date: "2023-04-28" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` #Set env ```{r, include = FALSE} library(readxl) library(dplyr) library(tidyverse) library(ggplot2) library(grid) library(reshape) library(scales) lib...
4c6861fbd4b26b4d1598002c5338757dbc579823472c67f5899ea891289bed1a
R
5,032
104
args <- commandArgs(TRUE) run_scmapcluster <- function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){ " run scmapcluster Wrapper script to run scmap on a benchmark dataset with 5-fold cross validation, outputs lists of true and predicted cell labels as csv files, as well as c...
8f30a444bd21fa1dc3af2b9c7fdea370ac37ef91e8e9bd4a721f6ae5f9bc7b75
R
5,046
118
library(optparse) library(tidyverse) arguments <- parse_args(OptionParser(), positional_arguments = 3) sj_dir_path <- arguments$args[1] %>% str_split(",") %>% unlist() output_path <- arguments$args[2] blacklist_path <- arguments$args[3] # sj_dir_path <- "/home/jbrenton/nextflow_pd/output/STAR/align" # base_dir<- "/h...
66c6e53f887a8c5a29cf349f86628a7910b2d95ec16abb73f1050fc940b01070
R
5,053
149
########## STEP 1.0 ########## SETUP NECESSARY FILES FOR GWAS # Clear working space rm(list = ls(all.names = T)) # Install packages if(!require(plyr)){ install.packages("plyr") library(plyr)} if(!require(dplyr)){ install.packages("dplyr") library(dplyr)} if(!require(tidyr)){ install.packa...
092d20d2ce94dcdd057b5a76ecd6463296c63919de430c0f67b128d22d85159c
R
5,055
127
--- output: github_document # output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) # install.packages('pkgnet'); packagename <- 'psychtoolbox' packageSubtitle <- "Tools for psychology research a...
e3b5885b194d08b96d7d8903b3f0e3cf3c648c31dba8deb655001c4b979b0ec5
R
5,057
138
# ------------------------------------------------------------------------- # Unit Test 03: Differential Analysis Logic # ------------------------------------------------------------------------- # Purpose: # Verify that differential expression analysis correctly identifies markers # between defined groups (Treatme...
1ab7cf578d71e81b44732c2adc798ea3834339fae1653fbc41e52dd54be2e3a9
R
5,058
177
#' Function to set plot theme #' #' @description #' This function sets a coherent plot theme for functions. #' #' @param font Font family to use for text elements. Default: "Arial". #' #' @return No return value, used as theme for ggplots #' #' @export #' #' @examples #' \donttest{ #' if (rlang::is_installed(pkg = c("s...
09a939771b47901bbf474444f74e22228d6d986bcd2d7810daf743911a9655f2
R
5,062
154
--- title: "I want to plot the MSLc primed genes showing the upregulation from NPC to Day14 Neurons" output: html_document date: "2024-06-02" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r plot saving function} plot_save_as_svg <- function(plot, file_name) { dir.create(paste0(dirname...
19c9dd9c30d51522d39563695d01c55b25cb3c868939a2372da0d378331c7664
R
5,065
204
#' Creates bargraph of top/selected enrichment terms from GSEA or ORA results #' from `olink_pathway_enrichment` #' #' @description #' Pathways are ordered by increasing p-value (unadjusted) #' #' @inherit olink_pathway_enrichment params #' @param enrich_results data frame of enrichment results from #' `olink_pathway_e...
3cab571912b49ec7a028f9b565ae631abf2dd4b82fb571ab76c53a17166a7782
R
5,071
170
--- title: "High-Grade Glioma Molecular Subtyping - Gene Expression" output: html_notebook: toc: TRUE toc_float: TRUE author: Chante Bethell and Jaclyn Taroni for ALSF CCDL, Jo Lynne Rokita for D3b date: 2020 --- This notebook prepares gene expression data for the purpose of subtyping HGG samples ([`AlexsLe...
575c63fe8482ec085a09d3e52b36340496d6ad1953c1c7522d3daef672ab3ae5
R
5,073
205
source("analysis/scripts/packages_and_functions.R") stats_synapse <- read.csv("analysis/data/stats_synapse.csv") SSN_Q1Q2 <- read_smooth_neuron("SSN_Q1Q2")[[1]] skid_Q1Q2 <- SSN_Q1Q2$skid SSN_Q3Q4 <- read_smooth_neuron("SSN_Q3Q4")[[1]] skid_Q3Q4 <- SSN_Q3Q4$skid SSN_Q1Q2Q3Q4 <- read_smooth_neuron("SSN_Q1Q2Q3Q4")[[1]]...
6561bc507a7723e3ba3d85c63fddbcb1de8f4d408fbe80feeaae970c99be938d
R
5,079
116
#'--- #' title: "Count Summary: `r gsub('_', ' ', snakemake@wildcards$dataset)`" #' author: Christian Mertes #' wb: #' log: #' - snakemake: '`sm str(tmp_dir / "AS" / "{dataset}" / "CountSummary.Rds")`' #' params: #' - setup: '`sm cfg.AS.getWorkdir() + "/config.R"`' #' - workingDir: '`sm cfg.getProcessedDataDir...
9b098258d820ebaf4eda689915cdf8d089798eb5388559374d1bc2eba31e5edb
R
5,083
112
#' @title Generate code files required for shiny app (multi datasets) #' @description Generate code files required for shiny app containing multiple datasets. In #' particular, two R scripts will be generated, namely \code{server.R} and #' \code{ui.R}. Note that \code{make_file} has to be ran prior to #' generate the n...
a4ddf34dbb93abf182c5dbb039bdf5a46a60d71ce1c44f092ef5618fd14cc23a
R
5,083
185
# Hua Sun library(dplyr) library(stringr) library(ggplot2) library(tidyr) fmd <- '' control <- '' cutoff_region_size <- 5 min_ratio <- 0.5 min_cnv <- 100 min_gene <- 20 cutoff_gain <- 1.2 cutoff_loss <- 0.8 rm_clu <- '' rm_chr <- '' icnv_exp <- '' hmm_gene <- '' hmm_region <- '' outdir <- 'out_malignant_cells'...
d9aa99197c42b41a1fec0c09b1db2d9a26758fa23174bc6156583a2ff6b03e9c
R
5,086
155
#' Example: Progressive Methylation Analysis Report #' #' This script demonstrates how to use methylkey's Phase 6 report builder #' to construct a complete methylation analysis report step-by-step. #' #' The approach is progressive: you can add steps incrementally, modify #' parameters, and rebuild specific steps witho...
3ec379f1933cf5e2e10d41498df1b1b98ae324cd8a4d9eb185fd42e785621f25
R
5,093
103
library(Seurat) library(ggplot2) library(optparse) library(dplyr) library(stringr) option_list <- list( make_option(c("-w", "--workdir"), type='character', action='store', default=NA, help="Path to the working directory"), make_option(c("-r", "--rdsfiles"), type='character', action='store', default=N...
415e4c279e20ce988858dd6d14a0341253fb69137d2f345fbe7af2c50cad51a4
R
5,093
138
# Load libraries ------------------------------------------- library(optparse) library(tidyverse) library(signature.tools.lib) # contains the signal signatures `%>%` <- dplyr::`%>%` # Set up command line options ------------------------------- option_list <- list( make_option(c("--abbreviated"), type ...
11695e1d7b50f15fc88ea5547e31e4f42c6265e60ea5ca49d8840eff2e7be929
R
5,102
167
############################ ## iTReX helper functions ## ## Author: Dina ElHarouni ## ############################ ## Generate sequence of row IDs "A", "B", ... EXCEL_COLUMN_LETTERS <- paste0( rep(c("", LETTERS), each = length(LETTERS)), rep(LETTERS, times = 1 + length(LETTERS)) ) row_sequence <- function(n) { ...
02d63774f3f039e038546db1ecad4295d00ad75e163ca0c27586e4e2f0748536
R
5,105
172
--- title: "Comparing foldchanges of 1xDensity GO terms" author: "AF" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) suppressPackageStartupMessages({ library(tidyverse) library(dplyr) library(tidyr) library(reshape2) library(ggplot2) library(rstudioapi)...
aaf21135b05429c10716bebafe4d0e2886f34f94709586e66580cc79101be880
R
5,115
128
# SMIntegration: Spatial Multi-omics Integration Platform # ============================================================================== # # Purpose: # Converts Seurat RDS objects containing spatial transcriptomics and # metabolomics data into text-based formats (long format) for compatibility # with d...
b1e2c9bb3f709bf25dedff983ab417df9658c22aba8683714a870ba983135144
R
5,116
199
test_that( "olink_ttest - works - non-paired t-test", { # Load reference results # tests are skipped if files are absent reference_results <- get_example_data(filename = "reference_results.rds") skip_if_not_installed(pkg = "broom") skip_on_cran() # tibble ---- check_log <- check_npx(d...