sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
22aa1067716d5f835e6ca9998f5ae7299bd951ba223b7afbc9efa9118f5bae90
R
1,951
57
##################################### ## Write TITAN segments to database ## Author: Kevin Johnson ## Updated: 2022.02.25 ##################################### library(tidyverse) library(DBI) library(odbc) ## Current project. projdir <- "/projects/verhaak-lab/USERS/johnsk/glass4" setwd(projdir) ## Connect to the cor...
4c4bd1a90ddbe4920a70cfb1063340d75c4a37f8295ef14d051f6ed7d52a5f8a
R
1,951
84
context("test-merge-groups") test_that("find agglomeration groups for google segmentation", { skip_if_not_installed('fafbsegdata') skip_on_os("mac") # confirmed by Peter Li Sep 2018 # see https://fafb.slack.com/archives/GCSHW2YFK/p1537818312000100?thread_ts=1537809139.000100&cid=GCSHW2YFK peterli_segs <- ...
d7ecacdffa3b74886d6d81afbc27ba16248385dd9006ad3f2730ecf1bdb6378b
R
1,951
69
# =============================================================== # 📏 Submodule — Subplot Size Controls # =============================================================== subplot_size_defaults <- function() { list( width = list( label = "Subplot width (px)", value = 400, min = 200, max = ...
55b9663c137070fb6b776909121e13cd076551cff1af2dbe9d85e90b00d6892f
R
1,952
49
library(dplyr) library(ggplot2) inverseLogitFn = function(score) { v = 10.0^(-score/10.0) v / (1.0 + v) } args <- commandArgs(TRUE) verbose = TRUE variant_eval_filename <- args[1] output_basename <- tools::file_path_sans_ext(args[2]) sample <- args[3] make_sample_df = function(filename, sample) { df = ...
4be1c0ca4f4c16364b1d9e9728fb4a5709daf18c1327e623e755e2577ab360c8
R
1,954
52
# Call marker peaks for disaeses within each subC library(GenomicRanges) library(ArchR) library(parallel) addArchRThreads(threads = 20) addArchRGenome("hg38") library(ComplexHeatmap) library(ggsignif) library("RColorBrewer") library(ggplot2) library(ggpubr) Dxs <- c("Control","AD","bvFTD","PSP_S") majorCs <- c("ast","...
c5fb097a16079b944ee040c71a64f62596329063fb6f81f0100c730414a394e2
R
1,955
48
--- title: "Detecting differential modules using ALPACA" author: Megha Padi date: "2017-10-19" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Detecting differential modules using ALPACA} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- Install and load netZooR package ```{r,eva...
304faede464d2e1abf5374a3af1bdec087cda51afeb1833338dfc323ce8b55ff
R
1,956
96
--- title: "05_signif_probes" author: "David Lukacsovich" date: "2024-04-08" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Set Up ## Define Directories ```{r} library(dplyr) base_dir <- "~/TBL Dropbox/David Lukacsovich" analysis_dir <- file.path(base_dir, "AD-Aging-...
c0c8ed9ef30265b428d742fe857ee71bb56cad1dec9b8668400979f4f69aea45
R
1,957
45
library(tidyverse) library(tximport) library(DESeq2) library(readr) # Prepare your data annot <- read_tsv("nv2.func-04.04.23.tsv") tx2geneFile <- "Trinity.fasta.gene_trans_map" tx2gene <- read.table(tx2geneFile, header = FALSE, col.names = c("gene_id", "transcript_id")) tx2gene <- select(tx2gene, c(2,1)) samples <- li...
fcc2ac9b040769642e2d84443d95b79fed4c10f5e24243f1320c18e28a772394
R
1,959
76
## Ensure reproducibility of example data set.seed(20220907) ## Generate example data sce <- scuttle::mockSCE() ## Add some sample IDs sce$sample_id <- sample(LETTERS[1:5], ncol(sce), replace = TRUE) ## Add a sample-level covariate: age ages <- rnorm(5, mean = 20, sd = 4) names(ages) <- LETTERS[1:5] sce$age <- ages[...
60f7fbf9dfe2bf82b98d2ccf834e21daf9aa4d9797b3f427810a819d9e77124f
R
1,960
63
#!/usr/bin/env Rscript suppressPackageStartupMessages(library("argparse")) # create parser object parser <- ArgumentParser() # specify our desired options # by default ArgumentParser will add an help option parser$add_argument("-i", "--input", required=TRUE, help="load clustered RData") parser$add_argument("-c", "--...
f9b29997cb61fbbed730ee1a9ad7fb46153c41f1326e911a1610182877c75802
R
1,964
56
### PCA analysis on lipidomics of qNSC Mboat2 overexpression in vitro rm(list=ls()) library(tidyverse) setwd(rstudioapi::getActiveProject()) source("./Scripts/Function_scripts/Effect_size_functions.R") load("./Output_data/M2PM_MsD.Norm_Impt_log2_conc_397_lipids.Rdata") #### ==== PCA of Mboat2 overexpression samples...
e1c5d5e457860749f9a8908652895472ab1d0620cc9278fbf2e91db6af42fa5c
R
1,967
53
#' Marker Richness Function #' #' This function calculates the richness of markers within clusters, either using all genes or a specified set of variable features. #' #' @param ann An object containing annotation data. #' #' @param varfeat A vector of variable features (genes) to consider. If NULL, all genes are used....
8af05bb43b582e502fd5ca9ba4df84ebbe5f67c6981518352d68e691f1aaaa63
R
1,973
48
test_that( "multi_gene_z_score", { # With two good columns but 1 zero-variance column, the zero-variance # column should be dropped with a warning cont_mat <- matrix(c(1, 0, 3, 3, 2, -5), ncol = 3) colnames(cont_mat) <- c("good1", "bad", "good2") expect_warning( ...
218421af0d5684bc935e1337f72b00fe86984ddfd704178cc43beaad5f9acee1
R
1,975
43
# Load necessary libraries library(dplyr) directory_path <- "/home/joonho345/1_Epilepsy_RNA/RNA_Human/09.Deconvolution/06.DEG_02DESeq" cohort_GSE160189_186538_Integration <- c("Astro_H", "ExN_H", "InN_H", "Oligo_H", "Micro_H", "OPC_H", "Endo_H") cohorts <- list( "GSE160189_186538_Integration" = cohort_GSE160189_186...
ebb21650c79062f9b454d0b1a06e788769d8a3893d9e433184292e49ce3cfec9
R
1,975
46
################################################################ # Plot AUC histograms & default tsne #' @title plotTsne_AUCellHtml #' @description Wrapper for the 'AUCell_plotTSNE' function: plots the regulon activities on the t-SNE. #' @param scenicOptions Fields used: aucell_regulonAUC, aucell_thresholds (int), and...
711e05e4b0193958be238acc4b5434ac13bc6ea5d6222681c5f7d0ec988b967f
R
1,976
46
#' Compares gene expression between query cluster and database cell type #' #' Generates a scatter plot comparing gene expression levels between a specified query cluster #' and a database cell type. Highlights top expressed genes and outliers. #' #' @param ann An object containing normalized gene expression data in `a...
8bcf40e12f9b95bc3b6e3b1621ea6564e2470cb85959ef1b208e353405dabd1b
R
1,976
59
library(ggplot2) library(forcats) # V2 data_countsV2A <- data.frame( Category = c(">2.0m", "1.6-2.0m", "1.2-1.6m", "0.8-1.2m", "0.4-0.8m", "<0.4m"), # Count = c(5.69, 0.38, 11.66, 4.31, 2.66, 275.28) Count = c(1.9, 0.13, 3.89, 1.44, 0.89, 91.77) ) data_countsV2B <- data.frame( Category = c(">2.0m", "1.6-2.0m"...
9f45a68f5133f57cfea14a9a7fdfe5496963cb29b01b473e6d74ecdfebd254e6
R
1,981
52
library(DESeq2) library(ggplot2) library(pasilla) ### Choose one matrix to analyze ### coldata_df_M_KAI_IP_A_HA <- coldata_df_M %>% filter(TYPE_2 == "M_KAI_IP_A_HA") filtered_samples_M_KAI_IP_A_HA <- rownames(coldata_df_M_KAI_IP_A_HA) adjusted_df_M_KAI_IP_A_HA <- adjusted_df_M[, colnames(adjusted_df_M) %in% filtered_...
cd68bdf0e94a14b4d24549efa6cbd73566a71769e32c4eb05619247e6cf7d65c
R
1,982
53
library(DESeq2) library(ggplot2) library(pasilla) ### Choose one matrix to analyze ### coldata_df_R_KAI_IP_A_CR <- coldata_df_R %>% filter(TYPE_2 == "R_KAI_IP_A_CR") filtered_samples_R_KAI_IP_A_CR <- rownames(coldata_df_R_KAI_IP_A_CR) adjusted_df_R_KAI_IP_A_CR <- adjusted_df_R[, colnames(adjusted_df_R) %in% filtered_...
32d4490c98e9ea32a9a12d132d4724c4d97ae2b425614a5cb0d7e7b59b42d298
R
1,984
56
here::i_am("scripts/1.neural_differentiation_dataset/1.1.mapping_and_QC/1.1.3.filter_liftoff_gtfs.R") library(tidyverse) library(plyranges) library(here) # helper function to get transcript length get_transcript_length<-function(gtf) { gtf %>% as_tibble() %>% group_by(transcript_id, gene_name) %>% ...
9aefaeee9bb9150a9b56dc6cafab6d36ee4da3b0c627262b5d50d8b1080dff99
R
1,985
56
## ------------------------------------------------------------ ## Compute the genomic interval to visualise for one gene ## • gene_id – gene (or cluster) to plot ## • end_type – "TSS" or "TES" ## • clusters_dt – data.table with the columns used below ## Returns a named list: seqnames, strand, start, en...
36bb7a701222569c02cdb1ebc1f02b6ec1d8ae47989bef96d8b5cc6fec44ac36
R
1,986
54
here::i_am("scripts/2.validations/2.1.regulator_interactions_and_module_overlaps/2.1.2.calculate_module_overlaps.R") library(tidyverse) library(foreach) library(doParallel) library(here) dd <- here("data/neural_differentiation_dataset/CroCoNet_analysis/") wd <- here("data/validations/regulator_interactions_and_module...
81dd58f2718ef3f44ac286f3741a4fcd04150ebd304d9712f7097586fa6357d4
R
1,989
53
library(DESeq2) library(ggplot2) library(pasilla) ### Choose one matrix to analyze ### coldata_df_R_PILO_IP_A_CR <- coldata_df_R %>% filter(TYPE_2 == "R_PILO_IP_A_CR") filtered_samples_R_PILO_IP_A_CR <- rownames(coldata_df_R_PILO_IP_A_CR) adjusted_df_R_PILO_IP_A_CR <- adjusted_df_R[, colnames(adjusted_df_R) %in% filt...
f911acd5dc4cdd721b1cdd3752ad075e17ef7548c3bb71a8e20254a6ca1d2da3
R
1,991
51
library(epicalc); #read HPV.csv from input args<-commandArgs(TRUE) hpv_csv = sprintf("%s", args[1]) HPV<-read.csv(hpv_csv) ######################################################################### #Now select HPVs and correct accorring to stop codons and chimeric redas# #WARNING: stop codon presence here are only app...
df5d9eaaa34cac1f3fd2158cf51a118236b30d82cb50492321ca3e528eb95f1c
R
1,992
52
library(DESeq2) library(ggplot2) library(pasilla) ### Choose one matrix to analyze ### coldata_df_R_KAI_SUB_I_IM <- coldata_df_R %>% filter(TYPE_2 == "R_KAI_SUB_I_IM") filtered_samples_R_KAI_SUB_I_IM <- rownames(coldata_df_R_KAI_SUB_I_IM) adjusted_df_R_KAI_SUB_I_IM <- adjusted_df_R[, colnames(adjusted_df_R) %in% filt...
9432c80a50fd53982dee78eb519e2159e212d7e1970a4cba96135ac423f567e3
R
1,995
43
here::i_am("scripts/4.paper_figures_and_tables/suppl.figureS8.R") library(CroCoNet) library(tidyverse) library(patchwork) wd <- here("data/neural_differentiation_dataset/CroCoNet_analysis/") tree_stats_jk <- readRDS(here(wd, "tree_stats_jk.rds")) lm_overall <- readRDS(here(wd, "lm_overall.rds")) lm_human <- readR...
9bfa4e84d074d44ab0984a5287f23e02d7171b38e71ffbc682ef29e71764705d
R
2,000
51
# R 4.4.2 # install.packages("lme4") # install.packages("Matrix") # install.packages("lmerTest") # install.packages("mediation") library(lmerTest) library(lme4) library(Matrix) library(mediation) data <- read.csv("/data/summarydata_ahahmmreinst.csv") df <- data.frame( subject = as.factor(data$subject), parcel = as...
aa94ed1325e9bdc3a0502438b199b5a26c1188fec85fb16e10f88c14c8f42f57
R
2,003
52
library(DESeq2) library(ggplot2) library(pasilla) ### Choose one matrix to analyze ### coldata_df_R_TBI_IPSI_A_CR <- coldata_df_R %>% filter(TYPE_2 == "R_TBI_IPSI_A_CR") filtered_samples_R_TBI_IPSI_A_CR <- rownames(coldata_df_R_TBI_IPSI_A_CR) adjusted_df_R_TBI_IPSI_A_CR <- adjusted_df_R[, colnames(adjusted_df_R) %in%...
2fc4d59609865871e9094b104befbd6ce766eeb2acd47165ef50d4758b339731
R
2,006
50
#------------------------------------------------- # Title: Helper: Determine whether 'marked' outliers actually should be removed # Author: Amanda Zacharias # Date: 2022-12-31 # Email: 16amz1@queensu.ca #------------------------------------------------- # Notes ------------------------------------------- # module load...
a05c2bb3aef44abafb4f497830ee59222b7c48984b3b51a567428a22b4dcb21c
R
2,006
63
library(ggplot2) library(dplyr) library(readr) library(ggpubr) library(EnhancedVolcano) library(rstatix) library(tibble) data <- read_csv("data/TREC_KREC_combine_Baby_4.csv") subtype_names <- colnames(data)[23:36] protein_names <- colnames(data)[37:124] data %>% filter(!is.na(Neutrophils)) %>% dim() # check t...
3f4c99043b624ef7b097c2b55f7bec85eae96d199d931d8c951113d9c521cf3f
R
2,007
55
here::i_am("scripts/2.validations/2.7.POU5F1_LTR7_enrichment/2.7.6.get_POU5F1_motifs.R") library(tidyverse) library(universalmotif) # POU5F1 motifs pou5f1_motifs <- readRDS(here("data/validations/motifs/motif2TF.rds")) %>% dplyr::mutate(SYMBOL = toupper(SYMBOL)) %>% dplyr::filter(SYMBOL == "POU5F1") %>% pull(mo...
50bb8fb633288143c4766eb74caf53690def31d718e2edf1a816af0ef6639942
R
2,007
72
#!/usr/bin/env Rscript suppressPackageStartupMessages(library("argparse")) # create parser object parser <- ArgumentParser() # specify our desired options # by default ArgumentParser will add an help option parser$add_argument("-p", "--pmat", required=TRUE, help="load pmat in cnt, cpm, ra") parser$add_argument("-n",...
39cd85105aed3335f1aafdbcceb5f07b95e4e80082714fc830502233ff7f023b
R
2,010
52
# 04_trend_clustering.R # Temporal expression trend clustering, LOESS fitting, GO/KEGG rm(list = ls()) library(openxlsx) library(ggplot2) library(dplyr) source("scripts/utils.R") dat <- read.csv("data/峰面积表达谱_填充_排序.csv", row.names = 1) # Fix specific rownames rn <- rownames(dat) rn[rn %in% c("P01756_","P06...
55beedb95f29a7c2b468957b0411a2caa05a186e53cd0e707a49b5e5dea4e969
R
2,010
55
### PCA analysis on lipidomics of qNSC with young plasma membrane lipid supplementation in vitro setwd(rstudioapi::getActiveProject()) library(tidyverse) rm(list=ls()) load("./Output_data/M2PM_MsD.Norm_Impt_log2_conc_397_lipids.Rdata") PM.sup.Lipid <- M2PM.log2.impt.norm.conc.MsD %>% select(matches("_meth|lpd")) #...
9a07aba7af15a53b176a1744586d253dab2762a48e8967e5f4f4eca63340479b
R
2,012
53
library(DESeq2) library(ggplot2) library(pasilla) ### Choose one matrix to analyze ### coldata_df_R_AMG_IPSI_A_CR <- coldata_df_R %>% filter(TYPE_2 == "R_AMG_IPSI_A_CR") filtered_samples_R_AMG_IPSI_A_CR <- rownames(coldata_df_R_AMG_IPSI_A_CR) adjusted_df_R_AMG_IPSI_A_CR <- adjusted_df_R[, colnames(adjusted_df_R) %in%...
e8c1e94f3f3ad7daafa9a6494737bf343c573441f1b0a47560d2b3c80752e93c
R
2,013
71
#Filter the aligned Curio nodose spatial transcriptomic data library(Seurat) library(ggplot2) library(patchwork) library(dplyr) #load the data ##F1R1 F1R1 <- readRDS("../nodose_st_230918/F1R1_seurat.rds") DefaultAssay(F1R1) = "RNA" summary(F1R1@meta.data$nCount_RNA) SpatialFeaturePlot(F1R1, "nCount_RNA", stroke = 0) ...
ac4ddfe8969d7b6557db054636d1c731100b27aec74d5721418b2d6f887864fa
R
2,017
85
--- title: "Process binomial independent data" author: "Joonatan Palmu" editor_options: chunk_output_type: console --- ```{css, echo = FALSE} .page-inner, #content{ max-width:1920px !important; } ``` ```{r options, include = FALSE} knitr::opts_chunk$set(include = TRUE, echo = TRUE, message = FALSE, results='asi...
b75cdb15740bb445bf3da4875c53a7758d081febcd77dda0e0c088d3a612923e
R
2,020
55
library(Seurat) library(Matrix) setwd('/home/joonho345/1_Epilepsy_RNA/scRNA_Human/') GSE <- 'TLE_GSE160189' ######################################################### #### Create Seurat Object #### raw_counts <- read.csv("/data/project/1_Epilepsy_RNA/scRNA_Human/Raw_Data/TLE_GSE160189/GSE160189_Hippo_Counts.csv", row....
cbded7451ca8aa8a6089961a1424c79ad75d4cc134a4777595a4530cf5ce17db
R
2,022
33
# script for getting ratio of major cell type and subtype labelling in our iterative clusters suppressMessages({ library(dplyr) library(Seurat) }) source('ClusterPlotFunctions.R') process_table <- function(obj, major, sub){ table1 <- calculate_ratios(obj, order = levels(obj@meta.data$iter.clustering), majo...
975cf9d2c5a252eb5ff116f29affa65103e9231d5ee07b3d8334e883332e98a4
R
2,023
59
# ============================================================== # PCA baseline module (comparison method) # - Input: x1, x2 (screened test matrices), Y (centered test outcome), # lasso_model_omnibus() must be available (already sourced). # - Output: list(res_lasso_pca, num_PC1_pca, num_PC2_pca, PX_pca, PC...
0371c532e7d71d539892b14092ae8ba13644e8f1f186750fa8cdc14ec84ac54a
R
2,025
46
##### Unifying Tany-seq and Hypomap Column Names ##### tanycyte <- combined #Before everything else we should fix column names. tanycyte$orig.ident <- tanycyte$Sample_ID tanycyte$orig.ident[tanycyte$Sample == "Blackshaw_Chow_1"] <- "Blackshaw_Chow_1" tanycyte$orig.ident[tanycyte$Sample == "Blackshaw_Chow_2"]...
c866ed364d8d2040ee9532aad4f3eff64605d032255018b9038bf8f2cb1bfb3a
R
2,029
45
rm(list=setdiff(ls(),c('params','fname'))) basedir <- params$basedir # make this whatever you like, end with / setwd(basedir) source('code/aba/aba_fxns.R') abadir <- 'data/aba/' dir.create(paste0(abadir,'expression'),recursive = T) load(file=paste0(abadir,'ontologies/keys.RData')) load(paste(params$opdir,'processed/con...
47fb346a064d1e8903e0498176002f0725b2e15fd2057a9a1a0cf0cfd0eee06e
R
2,034
55
#' Summarize cell counts and proportions inside spatial regions #' #' Computes the number and proportion of cells from each cluster #' inside boundaries or ring regions. #' This function is useful for downstream visualizations such as bar plots or #' pie charts showing the spatial composition of cell types per region. ...
09c526d7d76db15267a57af10ae17303f5e9d8a2977a40135593301bcb539dc1
R
2,038
68
#' shapes: shape data used to setup Venn plot #' #' a collection of geometric shapes, which defined the edge and label of sets in a Venn plot. #' use `plot_shapes()` to see some of them. #' #' @format a list with several slots #' see "?VennPlotData". #' #' @source #' - The `venn` datasets authored by Adrian Dusa (<htt...
2c6f35def81ddea1945c7b2d90e48a63393b8ea80997cb9b1a30e31ab2fbb6aa
R
2,043
64
#' Import cluster results #' #' This function imports previously exported clustering results with #' `cluster_export()` and adds them to the `colData()` slot of your #' [SpatialExperiment-class][SpatialExperiment::SpatialExperiment-class] #' object. #' #' @inheritParams cluster_export #' @param prefix A `character(1)` ...
f96672493367d4ab5c5925012680afce442c6bc3d7cf60041f89f5131c901fb9
R
2,044
43
## ---- message=FALSE, warning=FALSE-------------------------------------------- install.packages('conosPanel', repos='https://kharchenkolab.github.io/drat/', type='source') ## ---- message=FALSE, warning=FALSE-------------------------------------------- library(conos) library(pagoda2) library(parallel) library(ggplot...
18b68f8ad462a6917e22c40ad4c7c37fd858d9b49dfdce85778f50b5eb625318
R
2,047
17
#' Generate the Dunedin Methylation Pace of Aging Scores! #' #' The \code{PoAmProjector} function has been deprecated! Please use \code{PACEProjector} instead. #' #' @param betas A numeric matrix containing the percent-methylation for each probe. Missing data should be 'NA's. The rows should be probes, with the probe...
cb8c055b49c3822612a84ba87441e3d54c00fb281997c61e8c95e7e82a269d3e
R
2,047
38
################################## # Plot the difference in genetic distance (private mutations) versus pseudobulk state-controlled transcriptional distance # Author: Kevin Johnson ################################## library(tidyverse) library(ggpubr) library(EnvStats) proj_dir <- "/vast/palmer/pi/verhaak/kcj28/car...
49ec9f092ca7626cc4094f102cb01b5154bf3189841077c4316a3ecae94126c5
R
2,048
61
### PCA plot on In vitro and In vitro Experiment #2 together rm(list = ls()) library(tidyverse) source("./Scripts/Function_scripts/Pre-processing_functions.R") load("./Output_Data/zscore.lpd.Exp2CTRL.for.cmb.PCA.MsD.frmt.Rdata") load("./Output_Data/zscore.lpd.Invitro.for.cmb.PCAMsD.frmt.Rdata") z.Invitro <- z.Invitro ...
fcb8a2ef67976cc16a48b541fec463fa0ddf395e71d89e70d4ca0a515fbf8fdb
R
2,050
99
# Tests for functions in src directory # change in random number generation in R3.6, this ensures tests will pass under older and newer Rs # (this was implemented in Seurat's testthat) library(ArchR) library(testthat) library(Matrix) suppressWarnings(RNGversion(vstr = "3.5.3")) set.seed(1) #Context context("test_cpp"...
94afe1db2f668e26752b051171c84ed780ea45ec64f0eda0df4f396a93a033fc
R
2,053
25
library(Matrix) library(Seurat) # counts = readRDS("preprocessed.rds") #read in preprocessed count matrix (genes x cells) meta.data = readRDS("preprocessed_meta.rds") #read in preprocessed meta data (cells x variables) # seurat_obj = CreateSeuratObject(counts = counts, meta.data = meta.data, project = "seurat_obj...
ebfa76ed301b2f114dfca3debec4bc2f93cb3fbffe50a128570fad3e40fd61b3
R
2,066
58
#' SynGO Running Sum Plot (DEPRECATED) #' #' This function is deprecated and maintained only for backward compatibility. #' Use `gsea_running_sum_plot()` from the RNAseq-toolkit instead, which now #' works correctly for all databases including MSigDB, SynGO, and MitoCarta. #' #' @param gsea_obj SynGO gseaResult object ...
d2223998630d7d8f8bde5687f28210f51d53133c0db58b3bce8446bbbf4e1197
R
2,067
52
#!/usr/bin/env Rscript suppressPackageStartupMessages(library("argparse")) # create parser object parser <- ArgumentParser() # specify our desired options # by default ArgumentParser will add an help option parser$add_argument("-i", "--input", required=TRUE, help="load preprocessed RData") parser$add_argument("-o", "...
fade3fcccc0a73b32e8334dc439954718d558b319deb3b06a5beea8bb8519e12
R
2,070
57
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) ``` # `CroCoNet` <img src="man/figures/logo.png" align="right" width="1...
0f7239e89c32df0f6ef391585d129d6a39c3e82e8a9df8f9d33b315d09241ed7
R
2,073
60
##################################### ## Write TITAN GLSS-LX segments to database ## Author: Kevin Johnson ## Updated: 2023.03.20 ##################################### library(tidyverse) library(DBI) library(odbc) ## Current project. projdir <- "/projects/verhaak-lab/USERS/johnsk/glass4" setwd(projdir) ## Connect to...
24f960e18468b163b31fe24ea48f11abd2069a9597a291bb9d3b44c08477cfbf
R
2,073
60
##################################### ## Write TITAN segments to database ## Author: Kevin Johnson ## Updated: 2022.07.06 ##################################### library(tidyverse) library(DBI) library(odbc) ## Current project. projdir <- "/projects/verhaak-lab/USERS/johnsk/glass4" setwd(projdir) ## Connect to the cor...
f47f2471c169f62d6809ee9bd9f3f508d95fc8614f357fd00c51a6157feebfad
R
2,073
60
####################################################### # Enumerate cumulative coverage per aliquot for WGS/WXS # Date: 2022.03.01 # Author: Kevin Johnson ####################################################### options(scipen=999) ## Parse snakemake if(exists("snakemake")) { files = snakemake@input[["metrics"]] ...
f8eff3809f0b6e5b953f46264c02cbd91a31c076189784b9736364bf0d71aa8f
R
2,075
58
#!/usr/bin/env Rscript # Load required packages require(furrr) require(data.table) require(purrr) # Load configuration and utilities source("config.R") source("utils.R") # Parse command line arguments args <- commandArgs(trailingOnly = TRUE) if (length(args) != 1) { stop("Usage: Rscript 1.coTWAS_prep...
9b106d0403da2d1bc9435ff59a5681918e7e5bf566d82b41fb4962dc98154389
R
2,082
46
rm(list=setdiff(ls(),c('params','fname'))) basedir <- params$basedir # make this whatever you like, end with / setwd(basedir) source('code/aba/aba_fxns.R') abadir <- 'data/aba/' dir.create(paste0(abadir,'expression'),recursive = T) load(file=paste0(abadir,'ontologies/keys.RData')) load(paste(params$opdir,'processed/con...
8a178c29783596da6cbd151b883e4eb55443ffd402e5e2ff5955b8d0dd629ee2
R
2,083
54
## TAU - Topomaps ## Load the files -------------------------------------------------------------- tablepath = "Desktop/Tau_data/" cohorts = c('exploratory', 'validation', 'adults') for (cohort in cohorts) { if (cohort != "adults") { if (cohort == 'exploratory') { taudata = readr::read_csv("Desk...
0ba0476ae6c86b998260db637bb093af0f8465c402a6551694269c46bc26d94a
R
2,084
71
asd_sfari <- utils::read.csv( system.file( "extdata", "SFARI-Gene_genes_01-03-2020release_02-04-2020export.csv", package = "spatialLIBD" ), as.is = TRUE ) asd_sfari_geneList <- list( Gene_SFARI_all = asd_sfari$ensembl.id, Gene_SFARI_high = asd_sfari$ensembl.id[asd_sfari$gene....
604dc35a3579eb8369173882dfad9201ade69eecfbcd95e23ce1b2bfc23d94b9
R
2,085
53
# ============================================ # Script: 2_subset_and_save.R # Purpose: Remove NGN5 update metadata # ============================================ # Load required packages ---- library(Seurat) library(ggplot2) library(stringr) # Set up paths and config ---- data_dir <- '/cephfs/scratch/bruening_scratc...
65ab7cc8756736aac60285dbf9721a24db0d248dc5ff8187942f6f93a4f0c07f
R
2,087
57
library(ggplot2) library(reshape2) library(viridis) library(forcats) # Create the data for light attenuation sensitivity analysis data_exp2 <- data.frame( Zone1 = c(6, 7, 6, 5, 7), Zone2 = c(0, 0, 0, 0, 0), Zone3 = c(5, 4, 2, 14, 19), Zone4 = c(0, 5, 26, 15, 13), Zone5 = c(1, 79, 266, 266, 261), Zone6 = c(...
b009d91167af1d39eceef12f3453ef430eb8841bc7a7667fdb224b53eb0e7064
R
2,088
54
##################################### ## Write GATK segments to database ## Author: Kevin Johnson ## Updated: 2022.02.25 ##################################### library(DBI) library(tidyverse) ## Current project projdir <- "/projects/verhaak-lab/USERS/johnsk/glass4" setwd(projdir) ## Connect to the correct* internal d...
5ef34f882c523c6d496d559b6ba9c0abc62bb82aed1e2a7e5381c2890408eb9b
R
2,089
63
library(Biostrings) library(rtracklayer) library(BSgenome.Mmusculus.UCSC.mm10) setwd("./SpaDC/GRN") get.seqs <- function (org, regions, no.cores=1) { ## Function for chromosome get.seq.chr <- function (chr) { seq <- org[[chr]] if (class (seq) == 'MaskedDNAString') seq <- unmasked (seq) ## Get ...
9df61710b0947b6026943f7dd4eabbd186caebf33c0fa3fc616cd908b6656c6a
R
2,091
37
#' Retrieves plot data from a SAHA analysis object #' #' This function returns plot data based on the specified plot type and data type. #' If `data_type` is not provided, it attempts to determine the data type from the `ann` object. #' #' @param ann A SAHA analysis object containing results. #' @param plot_type A char...
a2f7ecb4da45d2c3ca74f2fd71c755d83db35fbf8dda9a68288b1693c76d7a42
R
2,095
57
#QC1 #Aim: draw a line plot with the average of asw at each resolution from each PCs #Calculate the overall average and SD of the asw at different PCs and resolutions setwd("/home/rstudio/2023_April_Integration/asw_2023_Jun") name <- c("Run", "ASW", "PC_Res") data <- list.files(path = ".", pattern = "[0-9].asw.txt") ...
ecc99b1e7858e42d9751089af99f9f15f50fabc921ff376cfd771ecbbce997b2
R
2,095
75
################################################################################ ###############----------- CONVERGENCE CHECK FUNCTION -----------############### ################################################################################ ## Computes multiple model convergence checks ------------------------------...
13a8b53195817b4e20e56a9fab5ac0a6988b8531c965ee2c8896860e2575685c
R
2,096
62
#!/usr/bin/env Rscript #------------------------------------------------- # Title: Filtering helper funcions # Author: Amanda Zacharias # Date: 2023-02-27 # Email: 16amz1@queensu.ca #------------------------------------------------- # Notes ------------------------------------------- # module load nixpkgs/16.09 gcc/7.3...
d809760d62dc8eabf5a1f6755518d4545008bdefacbbaf683d84e8ba0c594b2f
R
2,097
43
################################## # Inspect the longitudinal differentially accessible peaks across major cell types # Author: Kevin Johnson # Date Updated: 2026.04.07 ################################## library(tidyverse) library(ggpubr) library(EnvStats) proj_dir <- "/vast/palmer/pi/verhaak/kcj28/care_idh_mut" f...
e965b2d507bc8103fd6ba9cd0cad56830ed70310790e74ca3861edcf55314209
R
2,099
56
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir, xeniumDir source("00_settings.R") dataDir <- file.path(baseDir, "data") outDir <- file.path(baseDi...
adbbda3cab6be52142f6347b420d9e1103ab69883dd669b47b17a7406c18ec94
R
2,101
49
library(SpatialDecon) library(anndata) library(Seurat) library(scater) h5adpath <- "./simulated_gene_expression_average.h5ad" dlpfc <- read_h5ad(h5adpath) st_count <- t(dlpfc$X) st_count <- round(st_count) andersson_g1 = CreateSeuratObject(counts = st_count, assay="Spatial") pos <- dlpfc$obsm$spatial andersson_g1@...
73a793c775fc3ac05017da5609fb164c9dae43b207f3776d4779197339476f2d
R
2,105
49
setup_environment <- function(requirements_file) { # Stop if no requirements file is provided if (missing(requirements_file)) { stop("No requirements file provided. Specify the path to R_requirements.txt") } # heck if requirements file exists if (!file.exists(requirements_file)) { stop("Requirement...
c97fcf0817d89580ca4f72c4f50b5e269a795f82a289e8fbe4faa1ca07d61e1b
R
2,106
57
context("Cast utils") test_that("cast_string works correctly", { expect_equal(cast_string("test"), "test") expect_equal(cast_string(123), "123") expect_equal(cast_string(TRUE), "TRUE") expect_equal(cast_string(NA, allow_na = TRUE), NA_character_) expect_error(cast_string(NA, allow_na = FALSE)) expect_er...
75483219f870596d1acae16b99d9c3c05097493c0022e7fc6a3ab4a5c4053bcf
R
2,114
52
### Effect size calculation on lipids and double bond composition ### Mboat2 overexpression and plasma membrane lipid supplementation setwd(rstudioapi::getActiveProject()) rm(list=ls()) source("./Scripts/Function_scripts/Effect_size_functions.R") source("./Scripts/Function_scripts/Pre-processing_functions.R") library(...
ca7009f77a8e3d818d60ce4080c32d51a9990064683be4f8c3877d42e9bdfccc
R
2,116
49
cv.nodewise.bestlambda<-function (lambdas, x, K = 10, parallel = FALSE, ncores = 8, oldschool = FALSE, verbose = FALSE) { n <- nrow(x) p <- ncol(x) l <- length(lambdas) dataselects <- sample(rep(1:K, length = n)) if (oldschool) { message("doing cv.nodewise.error oldschool") totalerr <- num...
bd8ce7ea2fe3d73c99957a54c2ecb4b32e79eea1a22323c21c3cdc8ff2fb1e5a
R
2,117
87
library(testthat) library(dplyr) library(janitor) source("../R/module_upload_helpers.R") # contains preprocess_uploaded_table() test_that("preprocess_uploaded_table cleans column names and orders factors", { df <- tibble( "ID " = c("b", "a"), "Group Name" = c("Low", "High"), "Value 1" = c(1...
0dbf48ee5d455b618e4a6eb99b67aa68a606ff897cfba2c41e435cbc0575d36f
R
2,120
63
#If version conflicts between anndata and giotto python environments: # .rs.restartR() # # reticulate::use_python("/usr/bin/python3.8", required = TRUE) library(Giotto) library(DescTools) library(anndata) st_path <- "./ST.h5ad" ST<- read_h5ad(st_path) ST$var_names_make_unique() st_adata <- t(as.matrix(ST$X)) x<- ST$...
cccfc20dd17ef5a761dff6ddc0a0b3e590d36a9008679ca76a81a4f8aa899fd5
R
2,120
55
############################## # Set working directory and base directory # setwd("path/to/project/root") library(purrr);library(limma);library(dplyr);library(tidyverse) regions = c("dlpfc","dACC","sACC","caudate","hippo","amygdala") walk(regions, function(region){ ## Performance and Predict...
c6287eb6589039ec3d5f98ae8b8752bde6879ff6b7103656344b0e0e9893c805
R
2,125
47
#' @importFrom magrittr %<>% %$% %>% #' @export Read10x <- function(path, feature.name="features") { cm <- Matrix::readMM(file.path(path, "matrix.mtx")) %>% as("dgCMatrix") colnames(cm) <- data.table::fread(file.path(path, "barcodes.tsv"), header=F)[[1]] rownames(cm) <- data.table::fread(file.path(path, paste0(f...
e3024d7a2662b76dec05df975304d6bfeffdbeb311d34311e7acd9ac0259593b
R
2,127
61
####################################################### # Enumerate cumulative coverage per aliquot for WGS/WXS # Date: 2023.03.22 # Author: Kevin Johnson ####################################################### options(scipen=999) ## Parse snakemake if(exists("snakemake")) { files = snakemake@input[["metrics"]] ...
6bddf929df0973f1b5d661a486f9f1227d1b9812e3e1825c51c189f6dbd3c187
R
2,129
66
# Building a Prod-Ready, Robust Shiny Application. # # Each step is optional. # # 1 - On init # ## 1.1 - Fill the descripion & set options ## ## Add information about the package that will contain your app golem::fill_desc( pkg_name = "spatialLIBD", # The Name of the package containing the App pkg_title = "LIB...
15a02118e660abc86275a02844abdb7fb607f94bf9463b84cb69c1e7020c30a4
R
2,132
70
#' Run OTTER in R #' #' Description: #' OTTER infers gene regulatory networks using TF DNA binding #' motif (W), TF PPI (P), and gene coexpression (C) through #' minimzing the following objective: #' min f(W) #' with f(W) = (1-l...
4e844136bbece2b2d9c8f24165ac36ef091165aa4534ad0d458d4a9edb2eb185
R
2,135
52
library(ggpubr) library(MOFAdata) library(MOFA2) library(tidyverse) setwd("/pastel/Github_scripts/ROSMAP-MOFA") load("/pastel/projects/MOFA/model/standart_50f.RDATA") phenotypes = readRDS("/pastel/resources/data2share/basic_Apr2022_selected_list_Jul2024.rds") phenotypes$projid = rownames(phenotypes) load("/pastel/res...
6d4a856b369475b23248fc51a7c4d568249c67be7fe06647034b1828dd593ac8
R
2,135
65
single_out_joint <- function(joint_samples_list, i){ single_samples_list <- lapply(joint_samples_list, return_single_sampler, i) attr(single_samples_list[[1]]$prior, "design") <- get_design(joint_samples_list)[[i]] class(single_samples_list) <- "emc" return(single_samples_list) } get_joint_names <- function(e...
75f65524c34567d0fe8c3f7630f3029a378127a5379526581ced1e4743c3dab4
R
2,136
59
library(dada2) library(dplyr) library(readr) gtdb.for.dada <- "../references/gtdb/sbdi_16s_gtdb_database/gtdb-sbdi-sativa.r07rs207.1genome.assignTaxonomy.fna.gz" datasets <- c("JACOBS_IBD_FAMILIES_2016","HE_INFANTS_MFGM_2019","KIM_ADENOMAS_2020","KOSTIC_INFANTS_DIABETES_2015","POYET_BIO_ML_2019","KANG_AUTISM_2017","WA...
1ef0787803f2da8f9edd6da5f432a25d7bea18d957d808f84d190a980e378623
R
2,138
80
library(data.table) library(stringr) # ------------------------------------------------------------------------ # read in file information # ------------------------------------------------------------------------ sdrf = fread("E-MTAB-9357.sdrf.txt") dim(sdrf) names(sdrf) sdrf[1:2,1:30] w_data_file = which(names(sd...
3aa32ce8de4eba167e712f7bd77189ffa784508d348ceabd3d7a9c8bdfef9ed3
R
2,138
53
############################################## # Plotting total variance explained by views # ############################################## library(MOFA2) library(ggplot2) library(dplyr) library(ggsci) # Retrieving MOFA load("C:/Users/User/Documents/Drive_PC/Lucas/GitHub/ROSMAP-MOFA/MOFA_real/Raw_data/mofas/...
003c0f57fda69599592caa320baa7697430d04cb509264f502bba6da4c9a8334
R
2,147
55
## This script produces the mean area and mean volume of all cells of a specific animal. # Specify your working directory and the length of the animal names below: wd <- "your_working_dir" animal_name_length <- c(4) library(writexl) library(readxl) library(dplyr) library(stringr) library(tidyr) setwd(wd) all_files<...
9386fb12a1b6e57cc989cd4e35fa3671edcfcace34a584e1e4dc42337fd7cc46
R
2,147
82
############################################################ # MS-DAP analysis of DIA-NN output # eGRASP hippocampal synaptosome proteomics # # This script performs the primary differential expression # analysis using the MS-DAP pipeline. # # Required input files (place in data/): # - diann_output.tsv.gz # - sample_met...
27c31880af342ad0f2d023b4ccd65f56206bc125da256b74e2ab52107e8a647c
R
2,149
63
#' Identify cells located within spatial boundaries or ring regions #' #' Returns the subset of cells from the input data that fall spatially #' within a given boundary or ring. #' The boundary can be provided either as raw boundary points #' (from `GetBoundary()`), as polygons (from `BuildBoundaryPoly()`), #' or as ri...
74bab9546246db0d0e8540463ab6f2c9f81e8b52fd5c169b6966e11997b34b6c
R
2,151
65
#' Evaluate Lattice Kriging Model Performance #' #' Computes R^2 and correlation between observed and predicted values. #' If new data is provided, predicts and evaluates on that data; otherwise, evaluates on training data. #' #' @param LKfit Fitted LKrig model object #' @param locations_new Optional matrix of new spat...
2b6107f93fa90e780ca04f1e99c60c87a969248791a69dfa35a1acc071a26ea9
R
2,155
71
context("reading") test_that("get kallisto path", { dir_name <- "small_test_data/kallisto" # the standard case file_name <- file.path(dir_name, "abundance.h5") result <- get_kallisto_path(dir_name) expect_equal(result$ext, "h5") expect_equal(result$path, file_name) # user gives the full path result <...
8976b53d3f900efcd3bc9701b0c638acfd33a21e404df4a0524779b63e3700ac
R
2,157
95
--- title: "WeightedCluster_Analysis" author: "Michael Colwell" date: "2025-09-20" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## Weighted cluster analysis Pre-processing and analysis script for the weighted cluster analysis ```{r cars} library(metafor) library(dplyr...
9510c8d68ee78cf32fc1f31e9905d71aaff31500e37b46df22d0eef8f14866bc
R
2,157
64
# This script checks the convergence of the MCMC runs using the Geweke diagnostic. It creates a dataframe with the z-scores of the Geweke diagnostic for all sites library(coda) # version 0.19-4.1 folder_datasets="Local/path/to/BayesTraits/datasets/" # Path to output of script 14.2 folder_out="Data/14.BayesTraits/out/"...
b764d5718f26e115e1e899d168ee0464831d87992b518fd6358d0d833356b1ec
R
2,157
58
## Figure S7 Tga20 expression level #### tell_user('done.\nCreating Figure S7...') resx=300 png('display_items/figure-s7.png',width=resx*3.25,height=3.5*resx, res=resx) par(mar=c(1,3,1,1)) rbind_files('data/','21[46].tsv') %>% mutate(plate = as.integer(substr(file,1,3))) -> elisa_raw rbind_files('data/','21[46]_su...
23cc5a68a286b77dcd5177290c5564c1dc2732efeb824563a8e6550595a1c1f8
R
2,160
76
library(MOFA2) library(MOFAdata) library(data.table) library(ggplot2) library(tidyverse) rna <- read.csv("MALT10k_rna_scaled.csv", header=TRUE, row.names=1) protein <- read.csv("MALT10k_adt_scaled.csv", header=TRUE, row.names=1) rna <- data.matrix(rna) protein <- data.matrix(protein) data<- list(rna,protein)...
7b17208435ad93e8fcf09dae549663a4fc6adccfb9632ced550606b250ea3461
R
2,165
55
#!/usr/bin/env Rscript #------------------------------------------------- # Title: Prep bulk data for deconvolution # Author: Christina Meier # Date: 2025-06-23 # Email: 19cm51@queensu.ca #------------------------------------------------- # Notes ------------------------------------------ # # module load StdEnv/2023 r/...
c4a882cb2e0adc279e1e77bb23bb4aa7dbd25b236668eec3234e6d62f7fcacf2
R
2,166
57
library(dplyr) library(ggplot2) library(ggsankey) library(readxl) ### use already defined coldata_df_1 coldata_df_1_MTLE <- coldata_df_1 %>% filter(Diagnosis != "NL") ## coldata_df_1_MTLE <- coldata_df_1_MTLE %>% mutate(ip_group = case_when( IP == 'HT(Head Trauma)' ~ "Initial precipitating injury (Other)", IP...
e39e3ed0bf48fbb1120d784cf961d837bbd1b9772e7393cf856a514992840363
R
2,166
67
#' banc-nblast-share-gcs — Publish per-dataset NBLAST feathers + reviewed CSVs to GCS. #' #' @section Reads: #' - `banc_<target>_<ver>_nblast.feather` (FAFB, MANC, FANC, hemibrain, maleCNS, lr, native) #' - reviewed match CSVs #' #' @section Writes: #' - GCS `nblast/` #' #' @section Invoked by: #' production v8...