sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
77362cb2849eeb047948b0758e55f7f7db2d0e2e34b5dd00e8a1af5ec396c359
R
3,258
104
# Central location for parameter aliases. # See https://lightgbm.readthedocs.io/en/latest/Parameters.html#core-parameters # [description] List of respected parameter aliases specific to lgb.Dataset. Wrapped in a function to # take advantage of lazy evaluation (so it doesn't matter what order # ...
e33cc88d26eac4350aff0efd59a219ee935c550ac709e76de158e3aeee3739a0
R
3,258
80
# Stephanie J. Spielman and Jaclyn Taroni for ALSF CCDL 2020 # # This script subsets the files required for subtyping non-MB and non-ATRT # embryonal tumors. The samples that were subset in # [`01-samples-to-subset.Rmd`](./01-samples-to-subset.Rmd), based on specific # conditions outlined in that notebook, will be inc...
c463d2e1b8591148886356fa574abb44507b3550f623bfa16c1e215646824e53
R
3,259
100
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #################### DEPRECATED FUNCTIONS #################### #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #' Deprecated functions `r lifecycle::badge("deprecated")` #' # # @description # Use [FeatureS...
8284bcede3e05ef73ec5c0fcc178e8db2e4054f919113f3047e3d15b189110e0
R
3,261
88
#!/usr/bin/env Rscript # 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 Software Foundation, either version 3 of the ...
df5f2f147dccdde0da0655bee54171c19bc53ad1fe89619cd7e7b37b846f1c9b
R
3,262
130
--- title: "Celltype_Abundance" author: "AF" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} library(Signac) library(Seurat) library(tidyr) library(dplyr) library(ggplot2) library(rstudioapi) set.seed(17) ``` Celltype abundance plots, r...
b1eec4f4bf5660303c2e6f97c52e3173aa099fd5ea79a4bc48651f5be60ffeba
R
3,270
91
#' @export pairwise_glmer <- function(clr, y = "microbe", model = "~ . + (1|ID)", metadata, posthoc.method = "BH", features.as.rownames = FALSE, CI = TRUE, verbose = TRUE){ #Generate output data.frame out_df ...
1ee2ea610e356013253d4e3695f0f34af1e5b10d9c232ecb4e1f8a600833904c
R
3,273
131
library(plink2R) library(grid) readmat <- function(f) { con <- file(f, "rb") p <- readBin(con=con, what="integer", n=1) K <- readBin(con=con, what="integer", n=1) matrix(readBin(con=con, what="double", n=p * K), nrow=p, ncol=K) } dat <- read_plink("data", impute="random") # Price 2006 standardisation X ...
a34ce896655fde75671ac6a24a7390f35e4a25fda33d9af6b7b9e93a6e7ead4f
R
3,285
92
#' Plot cell type counts means versus variances #' #' This function returns a plot of the log10(mean) versus log10(variance) of #' the cell type counts. The function takes a matrix of cell type counts as #' input. The rows are the clusters/cell types and the columns are the samples. #' #' The expected variance unde...
c510902f784ba8909a4bc01591867c336a4b07f37fccc1f975aed863c67deaee
R
3,286
92
########################### Coverage Analysis Diagnostics ########################## # # Objective: Program to check which parameter sets were in bounds # ########################### <<<<<>>>>> ######################################### rm(list = ls()) # Clean environment options(scipen = 999) # View data without s...
25dd907c37f9c395b920e4c71867c8c9c29ee7c0a6b6151918f5750a6014ff0d
R
3,290
67
##' generate network based on Enrichment results ##' @rdname richNetmap ##' @param richRes list of enrichment object ##' @param gene vector contains gene names or dataframe with DEGs information ##' @param top number of terms to display ##' @param top.display top number to display ##' @param pvalue cutoff value of pval...
5a5f77c1aaf47d973897892c065f579823c176da8976ef701438dda7271dacbc
R
3,293
127
--- title: "Domain segmentation (STARmap PLUS mouse brain)" output: BiocStyle::html_document # output: pdf_document vignette: > %\VignetteIndexEntry{Domain segmentation (STARmap PLUS mouse brain)} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( ...
dfabaea2b7b6b274163d665f79594d3a908e8adbe3738fe7ddfbd95b1c78ad37
R
3,297
127
--- title: "Temporal GO Term Analysis from NPCs to Day14 Neurons" author: "AF" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE) ``` ```{r libraries} library(clusterProfiler) library(dplyr) library(ggplot2) ``` ```{r para...
b8cb84bcf8c03145c3d32d27a7c9a1d3813c7255b603d573fa3043ba588842e6
R
3,312
77
args <- commandArgs(TRUE) run_scID<-function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){ " run scID Wrapper script to run scID on a benchmark dataset with 5-fold cross validation, outputs lists of true and predicted cell labels as csv files, as well as computation time. ...
2e2ac927f5c0e3a48ad2cc31e298069b9de235fe57623fc91a06d9b7c277f14d
R
3,326
88
suppressPackageStartupMessages(library(tidyverse)) library(tidyverse) suppressPackageStartupMessages(library(ComplexHeatmap)) library(ComplexHeatmap) library(utils) library(optparse) option_list = list( make_option(c("-f", "--interaction_file"), type="character", default="interaction_matrix.csv", hel...
dcb51f764d4be44e7add661f54429983461da915121fa54a71202ef38e9670de
R
3,330
105
############################################################### # Example script illustrating how to generate correlation # dot plots with annotated p-values. # # This script uses only simulated data. # It does NOT contain any real values or analysis from the study. ###############################################...
06d85f2439257b2029fc76b252b545be6d74d70439a6c3ff0606aeec8764c2c7
R
3,336
112
--- title: "Select pathology diagnoses for inclusion" author: "Candace Savonen for ALSF CCDL" date: "2021" output: html_document: toc: yes df_print: paged html_notebook: toc: yes toc_float: yes --- ## Background In an upcoming release, `integrated_diagnosis`, which can be updated as the result of ...
1be35c7ab7d6c5da0cf3de509d4683a6e2d7975d6b6730e23215638ae467def5
R
3,336
98
## ========================= ## Experiment I: active vs. sham TUS (amygdala) ## ========================= if (!requireNamespace("here", quietly = TRUE)) install.packages("here") source(here::here("stats","lme_models","_setup.R")) ## -------- acquisition: CS * TUS * TRIAL -------- res_acq_triple <- run_lmer_test( da...
4c6290788c62d499fae91d7d365d914d26f179dd041ffc7eeacf8d5084393033
R
3,338
66
################################# ED.Fig.13c and d #The intermediate files 'VSN_sympathetic.gct' and 'CD8.gct' are available in the TCGA folder #ED.Fig.13c: Survival probabilities of VSN+sympathetic### library(ggpubr) library(ggplot2) library(survival) #survival plot#### res.ssgsea <- as.data.frame(fread('VSN_sympathe...
7cd84894237cc9ab39b4c5100879e9da62ff86d1d6da6d3a63d664c7cd563ac6
R
3,355
72
#' @title Generate Pathway Annotation Dot Plot #' @description Creates a dot plot (bubble chart) to visualize the top annotated KEGG pathways. #' The plot displays the annotation count for both Genes and Metabolites across different pathways. #' Top 20 pathways are selected based on total feature count. #' @param d...
e6f3bd641cf572ae5217abe3eddc577567e529b4d6bdadaa7c1e3f41277fa504
R
3,368
98
--- title: "Combo_Report" output: html_document --- ## `r PID` ```{r, fig.dim=c(13, 6)} combo <- Synergy_df combo$Metric <- ifelse(combo$dcDSS_asym > 0, "dcDSS_asym > 0", "dcDSS_asym < 0") CRA_report_list <- list() d <- ggplot(combo, aes(x = reorder(.data$Drug.Name, -.data$dcDSS_asym), y = .data$dcDSS_asym, width = 0...
8a462e25c926e7f3d1ed66b830bb317ad072a407be9d631b738b775c5204e6af
R
3,370
102
#' Make Prediction on a set of CNVs #' #' This function uses a pre trained model to make a prediction on a new set #' of CNVs #' #' @param model pre trained model loaded using `luz::luz_load()` #' @param root root folder for the dataset, created using `save_pngs_prediction()` #' @param cnvs cnv data.table in the usual...
8729fc5ea1ca77b2db7f9ea79a661a2013ab1e3bd6aa439a6f459a2c1121e14e
R
3,388
104
# ============================================================================== # S1_Tutorial.R # Server logic for the Tutorial/Introduction tab. # Handles loading of built-in demo datasets (TXT and RDS formats) and download handlers for tutorial materials. # =======================================================...
449e36710fe93d9e2cfe2a25d51662572217488bb77b906e3720574c482f1aac
R
3,390
115
# Test read_npx_format_colnames ---- test_that( "read_npx_format_colnames - error - long read as wide", { withr::with_tempfile( new = "cdfile_test", pattern = "delim-file-test", fileext = ".txt", code = { # write the coma-delimited file from a random data frame dplyr::t...
408940507f8a8c2ebb481d5d763fbb7bf6f986096510ec27b2e5a4cc11fe61d6
R
3,392
88
# Import a single function from an R file without running the whole file # # Args: # - source_code_R_file: path to the source code R file that contains the # definition of the function to be imported # - function_name: the name of the function to be imported # # Returns the imported function # # NOTES: # - Only funct...
05ff8798a69b3f8e4a46613fdd056a9491f13c0367f7e0cd4bab5107af0539c3
R
3,394
83
context("Manuscript Benchmark Data Integrity") # ============================================================================== # Unit Test: Benchmark Data Integrity (Meta-Test) # ============================================================================== # Purpose: # This script performs a 'meta-test' on the ben...
833ad06d1738b9d67601188139d1fa852cb6bfa7dec7c80dde666f9264b678f8
R
3,395
107
# Heatmap of Top 30 Shared DEGs per Regulatory Pattern (Vertical View) # Description: Generates quadrant-specific vertical heatmaps (log2FC) for shared DEGs in OSNs and Fat Bod library(readr) library(dplyr) library(tibble) library(pheatmap) # Custom diverging color palette my_colors <- colorRampPalette(c("#0066CC", "...
2c2d869a53ae1e4d0e6bc42945fb6a5d52d98f8b66e01f68acbc0e41e3341778
R
3,397
99
--- title: "NE_down_genes_expr_in_NPCs_Neurons" author: "AF" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r setup} library(dplyr) library(rstudioapi) library(ggplot2) ``` I want to look at the expression of the genes which are down in Neuroec...
bd9058e50f7685f0093c7f4771a4d7aaf766f223cde36eb8b3ea6afe2471361a
R
3,397
45
# Separate post-primary targeted tier; never modifies frozen primary outputs. .libPaths(c(normalizePath('.Rlib'),.libPaths())) suppressPackageStartupMessages({library(fgsea);library(jsonlite);library(digest)}) source('src/transcriptomics/helpers.R') cfg<-fromJSON('config/targeted_redox_v1.json',simplifyVector=FALSE) f<...
e4a903cfb438a6d844dc199970c0def84c99e4def9fdbc74207dad77b9e15288
R
3,401
101
#' @export col_agrecounter<-function(inputDF, col_names, col_collapse , rows_collapse, control_col) { #example #create dataframe for aggegation and counting (A&C)### # dat1<- data.frame( # mature_miRNA=c('hsa-miR-195-5p', 'hsa-miR-195-3p','hsa-miR-195-5p', 'hsa-miR-195-5p', 'hsa-miR-4753-5p', 'hsa-miR-475...
21270f53e67314a8b94b2743162a987cb0c47642321b576c9acac93bd5210140
R
3,403
85
library(ComplexHeatmap) library(stringr) library(ggplot2) library(ggrepel) library(data.table) library(cowplot) library(patchwork) source("../Plot_theme.R") # Load color scheme colors <- fread("../Plotting/colors.csv", strip.white = F) color_v <- colors$Color names(color_v) <- colors$ID # LAR dataset volcano plots da...
a3e87e7ccfdf378382598211fe95d026362ff563ba1e7f136cb920ffe4212928
R
3,404
67
library(Seurat) library(BioVenn) library(ggplot2) library(gridExtra) setwd("/home/ubuntu/PDSCRBNG/26_03_24_Figure_1") source("~/PD_project_analysis/manuscript_scripts/MV_utils.R") color_palette_cluster <- c("DaN1" = "#0072B2", "DaN2" = "#56B4E9", "GabaN1" = "#CC79...
91beca0369f486bf3e5167ace0b8b852bdc8a972436b7e7e9e2efed6e47eda5e
R
3,405
68
#' @section Package options: #' #' scCustomize uses the following [options()] to configure behavior: #' #' \describe{ #' \item{\code{scCustomize_warn_raster_iterative}}{Show message about setting `raster` parameter #' in \code{\link{Iterate_FeaturePlot_scCustom}} if `raster = FALSE` and `single_pdf = TRUE` #' due...
68e1be4aa7d42dd12571501bc5becc517c9429e13175f6e0e83fef8f16f6ebb2
R
3,406
73
run_SingleR<-function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){ " run SingleR Wrapper script to run SingleR on a benchmark dataset with 5-fold cross validation, outputs lists of true and predicted cell labels as csv files, as well as computation time. Parameter...
c1c933b4eaa06e806373485dbacf01f3429b90f521d85f9e4c7cd97dd8262c39
R
3,407
66
#' @title Get parcel-based structural connectivity #' @description This function computes parcel-based direct structural connectivity measures using an MNI-registered #' brain parcellation and the curated HCP-842 structural connectome template described in Yeh et al., (2018 - NeuroImage) #' @param cfg a pre-made cfg st...
5b31e03aff06841817cc1d3c581f1902cc8bb57083fbff3050db85c696a58927
R
3,411
93
#!/usr/bin/env Rscript library(ggpubr) library(cowplot) library(tidyverse) library(rstatix) gene_data_file = "/Users/plezar/Library/CloudStorage/Box-Box/TIME Lab_Shared Folder/Personnel/Graduate Students/Maksym Zarodniuk/GBM ECM paper/qPCR/2025-01-11 IHA compression/targets.csv" rq_results_file = "/Users/plezar/Libra...
f663112546a24e15cb90ac541a53d8292dd5dfe2fb6514c2184ecb155a188297
R
3,416
99
rm(list=ls(all=TRUE)) library(REdaS) sub_list = 1:20 for (ith in sub_list) { result_raw_table <- read.table(paste("/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble/sub", ith,"_mri_record.txt", sep = ""), stringsAsFactors = FALSE) num_trial = length(result_raw_table[,1]) result_table <- data.frame(s...
63848d76f009e3ff1b0368007f04479b2c751c075123625ab5fd5d2853940440
R
3,417
97
# Author: Komal S. Rathi updated, 2020-07 Kelsey Keith # script to perform immune characterization using R package immunedeconv # load libraries suppressPackageStartupMessages({ library(optparse) library(tidyverse) library(immunedeconv) }) # parse parameters option_list <- list( make_option(c("--expr_mat"), t...
76bc989c9b5b3a33d9bc788a156d411185f686cb436a58179e7814d0ae0655d0
R
3,417
117
library(lightgbm) # We load the default iris dataset shipped with R data(iris) # We must convert factors to numeric # They must be starting from number 0 to use multiclass # For instance: 0, 1, 2, 3, 4, 5... iris$Species <- as.numeric(as.factor(iris$Species)) - 1L # Create imbalanced training data (20, 30, 40 exampl...
5892c12b1c725503b9f4cdc49a4795d6158a975ad0eee9b83d6e97078ff92959
R
3,419
50
setwd('/media/user/disk31/Nameeta_230810_Xenium_5samples_230816/FinalClus/') xen = readRDS('stlearn_origSlide.rds') meta = as.data.frame(fread('/media/user/disk31/Nameeta_230810_Xenium_5samples_230816/analysis_Dec/xenium_meta_24Jan_with_info.csv')) rownames(meta) = paste0(meta$sample, '_', meta$bc) info = meta[colnam...
ce75fbd2124e2deab971f30efd040ed3cefcccd05fff1d764aa3e1f138af0786
R
3,422
123
--- title: "02_S1_pharynx_epithelium" output: html_document date: "2025-04-01" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} # Load custom plotting themes and required libraries source("~/Rfunction/scTheme.R") scThemes <- scThemes() library(Seurat) library(tidyverse) # Load full datas...
e7ceef8c2a58bb02e56c1cfc7076618aad9a331128e05aeac66bfcfb29ecdd98
R
3,422
103
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) # path_sc = "/home/ubuntu/simulation_LN/sc_simu.h5ad" # path_st = "/home/ubuntu/simulation_LN/st_simu.h5ad" # params are # ID clustering # path in # path out path_in <- args[1] dir_out <- args[2] index_key = args[3] path_sc <- paste(path_in, "/sc_simu.h5a...
ee3578bbf88ea63be68a8cf725ce045b67cdbe938b4bfd2eae09f292fcadd15f
R
3,426
92
## Integration with Campbell et al. 2017 dataset, neuronal cells only library(Seurat) library(Matrix) library(data.table) library(ggplot2) library(patchwork) ref <- readRDS('ARH_NN_neurons_integrated_RPCA.rds') arh <- readRDS('GSE282955_ARH_Sex_by_Nutr_neurons_integrated_RPCA.rds') arh <- subset(arh,subset = cell_typ...
a98ac22e398958a78c41502807db8ab45516cada5e9eea9e0b7037680d6c4be0
R
3,428
172
#' Help function checking if a variable is an R6 ArrowObject. #' #' @inherit .check_params params author return #' #' @keywords internal #' @noRd #' check_is_arrow_object <- function(x, error = FALSE) { # check if input error is boolean vector of length 1 check_is_scalar_boolean(x...
3f8137e894afc809b10e74e0b52c968541e247d64063f2cd1ef6b9b34d13b3c6
R
3,430
72
### Summary stats for the cross sectional analysis # Load required libraries library(readxl) library(writexl) library(here) library(dplyr) # Load excel file file_path <- here::here("data", "megamastersheet_simulated.xlsx") data <- readxl::read_excel(file_path) print(dim(data)) # [1] 10802 36 # only keep the column...
a76116e3b5058ce8c57771947765b570a8e753d26a21c0c1588d28e0b14c0c54
R
3,430
93
#'--- #' title: "RNA Variant Calling Summary: `r paste(snakemake@wildcards$dataset, snakemake@wildcards$annotation, sep = '--')`" #' author: nickhsmith #' wb: #' log: #' - snakemake: '`sm str(tmp_dir / "RVC" / "{dataset}" / "{annotation}_RVC_summary.Rds")`' #' input: #' - data_table: '`sm os.path.join( #' ...
74dc854dad8b29e0f56dda70854eb1f6c19b5a0a394d34f23bcc93a13cf0dcb9
R
3,431
71
# The working directory is the directory that contains this test R file, if this # file is executed by test_dir # # testthat package is loaded, if this file is executed by test_dir context("tests/test_get_pcb_pot_csi.R") # import_function is defined in tests/helper_import_function.R and tested in # annotator/tests/test...
d0d8703ae2a61f359c449acfe1b20901e2990c2a23bd19e160d352d8d7213da7
R
3,438
91
library(data.table) library(ggplot2) library(lme4) library(ggrepel) library(cowplot) source("../SM/src/custom_pvca.R") source("../Plot_theme.R") set.seed(42) # Load color scheme colors <- fread("../Plotting/colors.csv", strip.white = F) color_v <- colors$Color names(color_v) <- colors$ID # Define variables and tissu...
d81d41648d08d7d9c3f8f1286f0e2fde94e3351c07aaf1811e610f9aa1a89a8b
R
3,441
90
library(MOFA2) library(data.table) # (Optional) set up reticulate connection with Python # reticulate::use_python("/Users/ricard/anaconda3/envs/base_new/bin/python", required = T) ############### ## Load data ## ############### # Multiple formats are allowed for the input data: ## -- Option 1 -- ## # nested list of...
8154f8955d5f9cde212419939233a6bd23706eaaa18d384f268f219e5c3df1cf
R
3,444
113
# Figure 4B and Supplementary Figure 4A library(tidyverse) library(ggplot2) library(ggridges) library(dplyr) library(forcats) library(viridis) library(tidygraph) library(ggnetwork) library(ggraph) library(reshape2) library(ggpubr) # Custom function to create polar coordinate system for ggplot # Acknowledgements to Et...
ab16f6c4c070aa1796ebd1732c94b29cfc4fc905b02c8f5cf948e74dfb523381
R
3,457
94
rm(list=ls(all=TRUE)) library(data.table);library(dplyr) source('/home/lorincn/isilon/Cheng-Noah/software/corefunctions/functions.R') ##### ##### tr=function(x)sum(diag(x)) xvegas=function(z,R,Z_xqtls) { z=as.matrix(z);Z_xqtls=as.matrix(Z_xqtls) m=nrow(R);p=ncol(Z_xqtls) L=matrix(0,nrow=nrow(Z_xqtls),ncol=nrow(Z_...
1e83dfa5e36e163a7d40f44fae7c4176b32a6d6c16d1d6773a3748a542c139d9
R
3,460
129
#' Easy volcano plot with Olink theme #' #' @description #' Generates a volcano plot using the results of the olink_ttest function using #' ggplot and ggplot2::geom_point. The estimated difference is plotted on the #' x-axis and the negative 10-log p-value on the y-axis. The horizontal dotted #' line indicates p-value=...
47e6750673763c0c9b6353c430836ad6daa8af57eb460d556fc681600cd6afde
R
3,462
123
set.seed(11235) library(tidyverse) data <- read.csv("D:/Program Files/MATLAB/Joint_Perception_Project_Final/Pupil/Post_Resp_Pupil.csv") library(ggplot2) library(ggprism) library(gridExtra) library(patchwork) library(lme4) library(ggpubr) library(dplyr) library(lmerTest) library(sjPlot) libra...
2c7360ab3a19fb447dd3799c88b051a9663695f50c5ff914fc6490f643b147f2
R
3,464
105
# Install required packages if not already installed if (!require("VennDiagram")) install.packages("VennDiagram") if (!require("readr")) install.packages("readr") if (!require("dplyr")) install.packages("dplyr") library(readr) library(dplyr) library(VennDiagram) # Step 1: Load the raw p-value CSV df <- read_csv("~/De...
bbd828fc196474a1fcf3e0ac09b5b8278a5d7fafefe7acb86f4c04e4d461ee1b
R
3,464
78
library(ggplotify) library(data.table) library(ggplot2) 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 # Load TERM DEG data degs <- read.csv("results_TERM/degs_TERM_formated.csv") degs$signif...
b5bd6da706cae78a61da94ffaf0c386877299a3dfac19c83172fadd0df9c2573
R
3,471
95
library(Biobase) library(GEOquery) library(Seurat) library(readxl) library(ggplot2) library(dplyr) library(harmony) library(GenomicRanges) library(Seurat) library(patchwork) library(cowplot) library(data.table) library(scales) library(org.Hs.eg.db) library(rtracklayer) library(gghighlight) library(dplyr) library(Seurat...
f3e9944d31577103fd82e4c99a14a5215899e171d94697f0214dff398872f2e3
R
3,473
89
partialPlot <- function(x, ...) UseMethod("partialPlot") partialPlot.default <- function(x, ...) stop("partial dependence plot not implemented for this class of objects.\n") partialPlot.randomForest <- function (x, pred.data, x.var, which.class, w, plot=TRUE, add=FALSE, n.pt = min(length(unique(...
181546686aaec38e465f5ee4d7a3efa845a9cca92f67586cf487eecbc2012b52
R
3,474
91
norGeneExp <- readRDS('norGeneExp.rds') # rows = genes, cols = samples phenotypeDF<- readRDS('phenotype.rds') # one row per sample safescale <- function(v) { v <- as.numeric(v) if (!any(is.finite(v))) return(rep(NA_real_, length(v))) m <- mean(v, na.rm = TRUE); s <- sd(v, na.rm = TRUE) if (!is.finite(s)...
9ea1c15e350970038dddde8917da1f7e7843b39f55e86b36caa956aff0b719a5
R
3,475
127
--- title: "Basic Walkthrough" description: > This vignette describes how to train a LightGBM model for binary classification. output: markdown::html_format: options: toc: true number_sections: true vignette: > %\VignetteIndexEntry{Basic Walkthrough} %\VignetteEngine{knitr::knitr} %\Vignette...
7f349ba9e1e90f1c267f767924751b1120523a43ef2b896944a469e4f8927769
R
3,483
132
library("UMI4Cats") library(tidyr) library("ggplot2") gene <- snakemake@params[['gene']] waldout <- snakemake@output[['wald']] fisherout <- snakemake@output[['fisher']] diffplot <- snakemake@output[['diffplot']] diffplotpng <- snakemake@output[['diffplotpng']] diffplot_fisher <- snakemake@output[['diffplot_fisher']] d...
aa6ef8eb5b9318967a1d36999a4aba12a0689b7c85cf8f19dc77224d3accd375
R
3,487
91
library(data.table) library(ggplot2) library(lme4) library(ggrepel) library(cowplot) source("../SM/src/custom_pvca.R") source("../Plot_theme.R") set.seed(42) # Load color scheme colors <- fread("../Plotting/colors.csv", strip.white = F) color_v <- colors$Color names(color_v) <- colors$ID # Define variables and tissu...
2385d63a4d625774f929d6ca61785992c52e2c6f50830439770eafb82306addf
R
3,489
99
# S Spielman for CCDL, 2023 # Create panel A for Figure S7 that shows how histologies (cancer groups) # are not balanced across RNA library preparations (polyA vs. stranded) #### Libraries ----------------------------------------------------------------- library(tidyverse) library(ggpubr) #### Directories and files...
4b94d31451580dbb44c92ecc71cea9c78731a4f3560547d9409f94b3f2f298de
R
3,490
62
# trait variants '%notin%' = Negate('%in%') library(AnnotationDbi) library(org.Hs.eg.db) # load variants from Open Targets ---- variants = read.csv('Datasets/associationByDatasourceDirect/associationAll.csv', row.names = 1) #data from open targets (ftp.ebi.ac.uk/pub/databases/opentargets/platform/24.09/output/etl/js...
2b96a73089a043353381633bba2e89f190ee78039862e2d8790d55d78332797d
R
3,499
118
# Functions for chromosomal instability calculations # # C. Savonen for ALSF - CCDL # # 2020 map_breaks_plot <- function(granges, y_val, y_lab, color, main_title) { # Given a GRanges object, plot it y valu...
4fe579a5dbf0f6ad38628f76284322a6eea2db01635fc4f22fa0750260e61e1b
R
3,499
119
#basic functions #exporting deduplicated gene lists in clipboard#### #' Copy a deduplicated gene list to the system clipboard #' #' Removes duplicates and \code{NA}s from a vector and copies the result to the #' system clipboard, for pasting into Excel, Cytoscape or the Venny web tool. #' Works on Windows, macOS and ...
d4b1f6b7b0bd879ac7b67f6d742873a111984b68576f6641e5c9d5959f98218b
R
3,506
71
####################################################### ## Functions to perform imputation of missing values ## ####################################################### #' @title Impute missing values from a fitted MOFA #' @name impute #' @description This function uses the latent factors and the loadings to impute mi...
0cd03b15ebc052f048abb6f746b95a1d130d5b9cd200a8b9e56bd1c607fd8e2c
R
3,508
119
#' PCA analysis #' #' Estimate correlation covariates vs. PCA axes #' #' @param mvals matrix of m values #' @param pdata sampleSheet of data #' #' @importFrom stats prcomp #' #' @return betas matrix #' #' @export #' makepca <- function(mvals, pdata) { tmvals <- t(mvals) # n x p required for prcomp sel <- which(app...
1b387264957c4fcc58e4ff25995747352a92e81c2bbbfefbde621dfc1078c6bd
R
3,512
74
# Author(s): Regina H. Reynolds #---Load Libraries and data--------------------------------------------------------------------------------------------------------------#### library(tidyverse) library(stringr) library(optparse) library(RNAseqProcessing) # Main ---------------------------------------------------------...
7928d20cbbf96baa7b528e0c0336bd50891e6ae2adf2dad49eece56d76cb93a9
R
3,514
102
# S. Spielman for ALSF CCDL 2022-3 # # Makes a pdf panel for the HGG Kaplan-Meier survival analysis for Figure 4 library(tidyverse) library(survival) library(patchwork) # Establish base dir root_dir <- rprojroot::find_root(rprojroot::has_dir(".git")) # Declare output directory output_dir <- file.path(root_dir, "figu...
f1b19f0967b32e57ee8bf355f5e092624de8e24b6893b484162e76728d001101
R
3,514
150
--- title: "UMAPs" author: "AF" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} library(Signac) library(Seurat) library(tidyr) library(dplyr) library(ggplot2) library(rstudioapi) library(scales) library(purrr) set.seed(17) ``` UMAP repre...
a6e2070e3cc1252e65918508ec723d2796298ba9e74181d9ad0971ea05c56a73
R
3,520
90
#' Plot cell type proportions for each sample #' #' This is a plotting function that shows the cell type composition for each #' sample as a stacked barplot. The \code{plotCellTypeProps} returns a #' \code{ggplot2} object enabling the user to make style changes as required. #' #' @param x object of class \code{SingleCe...
df3f11204f22ab5348730558597c52e534a8af9d90e554c6575dc2567e69669d
R
3,522
114
--- title: "Seurat Merge and Integration Comparison" subtitle: "`r params$project`" author: "`r params$author`" output: rmdformats::html_clean: lightbox: true number_sections: false gallery: true code-fold: true toc_depth: 3 fig_width: 10 fig_height: 8 date: "...
4d01f3b0f96fe3a95940b45c12018a52eff82b736c9d2b05fe4baa2730e0d6a7
R
3,533
133
--- title: Two brain systems for the perception of geometric shapes subtitle: MEG Behavior analysis author: - Mathias Sablé-Meyer - Lucas Benjamin - Fosca Al Roumi - Cassandra Potier Watkins - Chenxi He - Stanislas Dehaene output: rmdformats::readthedown --- ```{r echo = FALSE, cache = FALSE, message=FALSE...
dfb51dacee81ba2223cc4c7319a02b7d7769166dec438e13193be4bc6c3e434e
R
3,533
94
## Exploration of public human snRNA-Seq data (Yang et al.) and checking Fibroblast markers ## Data obtained from https://twc-stanford.shinyapps.io/scrna_brain_covid19/ library('Seurat') library('dplyr') library('gridExtra') library('scater') library("clustree") source('/home/clintdn/VIB/DATA/Sophie/RNA-seq_Sandra/CI...
302f6247a9bf5ce3d37bae43d36ff53051041124a39a97f23c4a37647966d7a9
R
3,538
125
# Install R dependencies, using only base R. # # Supported arguments: # # --all Install all the 'Depends', 'Imports', 'LinkingTo', and 'Suggests' dependencies # (automatically implies --build --test). # # --build Install the packages needed to build. # ...
ea0b5d290c2ac9c2795e8e04bf462ce60a6f3382c3838fea459ad6cf51314a6e
R
3,543
113
# ------ PARAMETERS FOR PLOTS # ------ Function definition "%||%" <- function(a, b) { if (!is.null(a)) a else b } geom_flat_violin <- function(mapping = NULL, data = NULL, stat = "ydensity", position = "dodge", trim = TRUE, scale = "area", ...
b423ac1f69f15be2ff07dfb1f8012c1fdd5b7818162f4e4ce94cbe300a57cd3f
R
3,545
124
# The working directory is the directory that contains this test R file, if this # file is executed by test_dir # # testthat package is loaded, if this file is executed by test_dir context("tests/test_helper_import_function.R") # import_function is defined in tests/helper_import_function.R and tested here # # testthat:...
2c8dda9b29e5e670f73e83e78fed1fcd27e3e619df1f7f139520184fbdaf3437
R
3,547
102
library("optparse") args = commandArgs(trailingOnly=TRUE) path_umi_count_matrix_directory <- args[1] path_output <- args[2] quantile <- args[3] # convert from string to double quantile = as.double(quantile) library(Seurat) # load my_data.htos = Read10X(path_umi_count_matrix_directory, gene.column=1) rownames(my_d...
71c50b60f5e4f2dc12146ac82445bdc8a10bb8b4370241d51b5821484c672472
R
3,547
76
#' Synchronize orientation of genomic ranges given the desired majority direction. #' #' This function takes a set of ranges in \code{\link{GRanges-class}} or \code{\link{GRangesList-class}} object #' and return the same ranges in same class object such that total length of plus (direct, '+') and minus (minus, '-') . #...
9d92394a9638ee5c51c5fe38d478ef2b6ec2e1236fc613ecb6b62bd39bf21b19
R
3,556
93
args <- commandArgs(TRUE) name <- as.character(args[1]) params <- yaml::read_yaml("../Config/eve_sim.yaml") if (!dir.exists(name)) { dir.create(name) } setwd(name) dists_pd <- params$dists_pd dists_ed <- params$dists_ed dists_nnd <- params$dists_nnd within_ranges_pd <- params$within_ranges_pd within_ranges_ed <-...
9e77643e7a3a5461adb1c9b82df54f5e5f22937cb62f6b12377f1fc096612cb1
R
3,561
158
--- title: "Criterion task analysis" author: "Marcos Moreno Verdú" date: "2024-04-05" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Load packages and data Packages ```{r} library(tidyverse) library(modelsummary) library(ggdist) theme_set(theme_ggdi...
19f09063d6153ac6afb271a0ff4e3074fc314fdff429989427c89aecae38bab9
R
3,563
120
## Density plot for frequency of observation ---- # Prepare data frame for density plot graph_data <- cbind(glm.probs$Pos, rf.probs$Pos, kernlab.probs$Pos, ridge.probs$Pos) colnames(graph_data) <- c('Logistic', 'RandomForest', 'SVM', 'Ridge') graph_data <- as.data.frame(graph_data) graph_data <- mutate(graph_data, sub...
39bcaebf8fd9851a85f2756aed051a7bd8ef09944938c1ccc268b54534e5f6ca
R
3,563
148
# Test get_df_output_print ---- test_that( "get_df_output_print - works", { expect_true( object = read_npx_df_output |> stringr::str_replace_all("arrow", "ArrowObject") |> (\(.) . %in% get_df_output_print())() |> all() ) } ) # Test get_file_ext_summary ---- test_that( "g...
c0b2683c28e5b43b57c5c8ce7c0e3fffc904cb3a9efb70cd689cb895e2f25e2a
R
3,565
73
library(devtools) library(roxygen2) library(ggplot2) library(patchwork) ggthemr::ggthemr("flat", layout = "minimal") detach("package:eveGNN", unload=TRUE) install_github("EvoLandEco/eveGNN", dependencies = FALSE) test_control <- readRDS("D:/Habrok/Data/14102023/Data/qt2/10_dsce2_0.6_0.1_0.0_0.0.rds") test_no_n <- re...
cea70953fa18a2bf5bac4c0694afb29e44da225a796a9ca9c6dd85062fd29c5f
R
3,568
107
# Script for plotting H2O2 measurements ++++++++++++++ # Authors: Meike Bielfeldt, Kai Budde-Sagert # Created: 2025/05/09 # Last changed: 2025/11/12 # Delete everything in the environment rm(list = ls()) # Close all open plots in RStudio graphics.off() # Show warnings as they appear opt...
1ad87c2ad3a58292515a5fbba16b982a3b9a9dd2832ac37353d34a819defb996
R
3,570
113
rm(list=ls(all=TRUE)) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # distribution of angle of random vector in 2d space #### library(plotly) ar1=function(n,rho) rho^toeplitz(0:(n-1)) tr=function(x) sum(diag(x)) rho=0.9 R=ar1(2,rho) lam=eigen(R)$values x=seq(1e-1,2,0....
3246c0a56ab687fc0b71977c08d437e11aaa49975a841fca50d71c4d6a904e36
R
3,578
86
# Author: Francois Aguet library(peer, quietly=TRUE) # https://github.com/PMBio/peer library(argparser, quietly=TRUE) WriteTable <- function(data, filename, index.name) { datafile <- file(filename, open = "wt") on.exit(close(datafile)) header <- c(index.name, colnames(data)) writeLines(paste0(header,...
24edf949b38e0f839272b5fcb3251a33b5de57cc4d834d633f6a8eef3e117990
R
3,580
77
run_scID<-function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){ " run scID Wrapper script to run scID on a benchmark dataset with 5-fold cross validation, outputs lists of true and predicted cell labels as csv files, as well as computation time. Parameters ----...
01683996c8b355a37dedb172611c9444485492971533ba630fade22276a8b310
R
3,587
118
################################################################################ # This plotting script pre-renders the cell type plot. The plot can be # pre-rendered because it always has all the cells and is not filtered so it # never changes. It needed to be pre-rendered because it would exceed the # shinyapps.io ...
c181395c854d351689bed17067f802c7bc733810d6a69f484afed04b934f37ac
R
3,587
106
##-------------------------------------## ## VIOLINS TAB ## ##-------------------------------------## plot_grid_violins <- function(mat, genes, metadata, var, subvar, cols, pt.size, gene_list){ #https://stackoverflow.com/questions/31993704/storing-ggplot-objects-...
0fde452de383ee48ae54c61c67b44793b56423fc3de2a7dddf46858cb46eff26
R
3,602
105
--- title: "QC independent samples" output: html_notebook: toc: true toc_float: true --- ## Load libraries ```{r load_libraries} suppressPackageStartupMessages({ library(tidyverse) library(DT) }) ``` ## Output files ```{r wgs_only} wgs_only_files <- c("independent-specimens.wgs.primary.eachcohort.tsv...
10bc49ca79bfa8f38a31623815b7a7fbaae5786940e9d0a1d10ef6197e80a72c
R
3,607
129
################## ## Factor Names ## ################## #' @title factors_names: set and retrieve factor names #' @name factors_names #' @rdname factors_names #' @export setGeneric("factors_names", function(object) { standardGeneric("factors_names") }) #' @name factors_names #' @rdname factors_names #' @aliases fac...
a26bc3645bcda4b685a691ba70cf17dc56478fc5b30821ed770beca76416b3e6
R
3,610
128
# Returns the coords as a data.frame in the right ordering for ggplot2 get.coords.for.ggplot <- function(roc, ignore.partial.auc) { df <- coords(roc, "all", transpose = FALSE, ignore.partial.auc = ignore.partial.auc) df[["1-specificity"]] <- ifelse(roc$percent, 100, 1) - df[["specificity"]] return(df[rev(seq(nrow...
b7144d6dbdbd74ae1ec2ac4e98ddad3fe2219fae185d2592aa8622d93d0e08bd
R
3,625
76
setwd("/home/pranali/Documents/glioma_manuscript/") data = read.csv("patient_info.csv", row.names = 1, check.names = F) data = data[, -c(1:3)] library(stringr) for(i in 1:ncol(data)){ if(colnames(data)[i] == 'Diagnosis'){ next } class_type = class(data[, i]) if(class_type == 'character'){ data[, i] ...
d9a5525e626fa72ac2ef2bee2c97e41df723a391af8286273ce4c0641f629345
R
3,626
95
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 ) { ## this block fits all models (and associated bfp-versions) ...
e3eb03c4d92c46ec3aa344bfb61a062e1aebfe761801b5375dc96a2286e32a98
R
3,631
117
### Summary stats for the cross sectional analysis # Load required libraries library(readxl) library(writexl) library(here) library(dplyr) library(tidyr) # Load excel file file_path <- here::here("data", "megamastersheet.xlsx") data <- readxl::read_excel(file_path) print(dim(data)) # [1] 10802 36 # only keep the c...
6899915413c8580831e1fa19fe2bf6e78f1e1ce8bd08bfc7433c680b2e9cf7dc
R
3,640
110
if (!requireNamespace("here", quietly = TRUE)) install.packages("here") source(here::here("stats","learning_models","_setup.R")) data_acq <- subset(scr_df, PHASE == "acquisition" & TUS == "active" & CS == "threat") data_acq$CS <- relevel(data_acq$CS, ref = "control") data_acq$US <- relevel(data_acq$US, ref = "unreinf...
dce530dd6c76d861382d2cd0e74a4ebc3bc611062b29a70566d1bd5978c7e392
R
3,646
108
#'--- #' title: Aberrant Splicing #' author: #' wb: #' log: #' - snakemake: '`sm str(tmp_dir / "AS" / "Overview.Rds")`' #' params: #' - annotations: '`sm cfg.genome.getGeneVersions()`' #' - datasets: '`sm cfg.AS.groups`' #' - htmlDir: '`sm config["htmlOutputPath"] + "/AberrantSplicing"`' #' input: #' ...
cd5bf338420077b9002833b6996e6b32165f9d5783f971987b99df1956d64603
R
3,650
164
### Load packages library(PMA) library(mixOmics) library(RGCCA) library(caret) library(truncnorm) # MRF sim.fn.mrf3.m <- function(dat, ...){ mrfinit <- mrf3_init(dat$X, ...) imp_init <- plyr::llply( c("filter", "mixture", "test"), .fun = function(m) { w <- mrf3_vs(mrfinit, dat.list = dat$X, me...
fe04844d16a707bf8a6254ab8ac76f4104d8fe68ca3ee6d276992a83a5da4007
R
3,650
109
## ========================= ## Questionnaires ## ========================= source(here::here("stats","lme_models","_setup.R")) #### CS ratings #### # Compute threat - control difference scores per subject and TUS, for all three variables cs_diff_df <- cs_quest_df %>% filter(CS %in% c("control", "threat")) %>% ...
fe9fc1cbc4da65f3035e750778bd7d3f668449e3bb6731582e79b1135772f392
R
3,656
143
#' Help function to read NPX data from long format parquet Olink software output #' file in R. #' #' @author #' Klev Diamanti #' Kathleen Nevola #' Pascal Pucholt #' #' @inherit .read_npx_args params return #' @param file Path to Olink software output parquet file in long format. #' Expecting file extension #' `r...