sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
b2e9903692b66c24f2b5d073dbbb528ffa7f47d7700183b4a2fc418c6a3e7e2e
R
2,848
72
#' @title Get inputs from MRIcron/npm file #' #' @description #' Function to load data from a previous analysis #' in MRIcron/npm in a ready format for use in lesymap #' #' @param valfile mricron filename with extention *.val. The function #' will search for images in the same folder where valfile #' is located, unle...
cb246165bb7be3de85fd128cb524350ab6b1e2b35fa9011a4e98c343022dac7a
R
2,852
73
library(dplyr) train_dt <- read.csv("/home/data/sda/wt/Neodb_model/raw/train_data_iedb_2.csv") all_weight <- data.table::fread("model/all_weight_mean.csv",data.table = F) all_edge <- data.table::fread("model/all_edge_index.csv",data.table = F) train_dt <- train_dt %>% mutate(pep_len = nchar(pep), hla_len = ...
fefd15eb921306ae2c8cf98092f7452fd4079efe2595c82c6634834b3360b51c
R
2,853
71
#' @rdname createFolds #' @title Create folds for k-fold validation #' #' @description Used to create balanced folds with respect to y input #' for k-fold validation. #' #' @param y split sample by balancing y #' @param k number of folds #' @param list logical whether to return folds in a list #' @param returnTrain log...
65c45430e6fabe83f64d49a70e64f70cd964263651ffed5b19a1277d970a77dc
R
2,855
84
# fedfast_marker_supp_table ----------------------------------------------- df <- fedfastmarkers map <- c("0"= "EC1 Cldn5/Ly6c1/Ly6a", "1"= "SGC1 Mmd2/Ednrb/Fabp7", "2"= "SGC2 Cxcl10/Acsbg1/Phgdh", "3"= "MGC1 Ncmap/Fam178b/Cldn19", "4"= "SGC3 Bcan/Fbln2/Fbln5", "5"= "NGN1 ...
6ba3e22c31f57019ad3b623f7d9e1dfde9fbc6f1de0850e15619f4030349f922
R
2,855
77
library(dplyr) library(purrr) # Set base directory for conditional analysis results # base_dir = "path/to/conditional/results/" base_dir = "./result/conditional.results/" ##### load Loci load(file.path(base_dir, "Loci.RData")) filter1 = names(table(Loci$Region))[table(Loci$Region) == 1] filter2 = gsub("\\.R...
adc413589302a5d5a6767dd1f39c05590a1eba064a17d298e56ba0628403de9a
R
2,855
66
library(Seurat) library(dplyr) #Use the markers identified by Wilcox (Seurat_Findallmarkers) markers <- read.delim("251019_nodose_markers.txt") markers$prop <- markers$avg_log2FC*(markers$pct.1 + 0.01)/(markers$pct.2 + 0.01) markers$genesymbol <- gsub("\\..*","", markers$genesymbol) top3 <- markers %>% group_by(clu...
7b2e954cf5e42f64c739beb8b4b32cfe103a5434e3c2413dfb924ac872afc391
R
2,856
55
#' Creates output dataframes from a Seurat object #' #' This function generates variable features, average expression, and/or marker genes from a Seurat object, depending on the specified output option. #' #' @param obj A Seurat object. #' #' @param output A character string specifying the desired output. Options are ...
e1cdf605b135d9433d09f553fe436a1ca2c7628ad564d35b9940985485dac095
R
2,861
73
# 02_secretory_protein_venn.R # Venn/Euler plots, protein specificity, point plots, GO enrichment rm(list = ls()) library(openxlsx) library(ggplot2) library(eulerr) library(clusterProfiler) library(org.Mm.eg.db) source("scripts/utils.R") # Load preprocessed sample lists samples <- readRDS("data/samples_li...
d980fa709ebf701d88b27056c152a1153d358e16f93c73a67daadfd47961f62d
R
2,863
117
test_that("Test PlotExpression", { df <- data.frame( x = c(rnorm(100, 1), rnorm(100, 5)), y = c(rnorm(100, 1), rnorm(100, 5)), cell = 1:200, cluster = rep(1:2, each = 100) ) exp_mat <- data.frame( gene1 = c(runif(100, 4, 6), runif(100, 0, 2)), gene2 = c(runif...
1445812e4062e3d8a351428726c2aa8e496e63f97d1c6c36e4bc0fa90b9ea7ba
R
2,868
97
library(scales) get_thresholds <- function(prior_pr){ prior_odds = (prior_pr/(1-prior_pr)) BF = c(10,6,2) A = exp(BF/2) * prior_odds thr = A/ (A+1) return(thr) } plot_mte <- function(logfile,color_trait=c(),prior_prob = 0.05){ pdf(file=paste(sub(".log","",logfile,fixed = T),".pdf",sep=""),width=10, height=7)...
68871ac89548402188bee30dd9cbb656310ddb61e99077366f603e835d1268b6
R
2,869
73
# When working with lM it is useful to design an "average and difference" # contrast matrix, which for binary responses has a simple canonical from: ADmat <- matrix(c(-1/2,1/2),ncol=1,dimnames=list(NULL,"d")) # We also define a match function for lM matchfun=function(d)d$S==d$lR dat <- forstmann[forstmann$subjects %i...
53ab9f611cab84b1fe84ed0ffff6a787a42a9300069eeeb8e1b11e48e9e129d9
R
2,870
89
suppressPackageStartupMessages({ library(ggplot2) library(ggrepel) library(ggpubr) library(UpSetR) library(RColorBrewer) library(tidyverse) library(VennDiagram) library(ggVennDiagram) library(clusterProfiler) }) # Gene Onto d2 <- read.table("dge/Both_Dge_MouseID.txt",header=T) d2 <- d2 %>% filter(Direction == "Both"...
8d0ea00a5a658333029c5a1f3d00bb9f187e39aa635478cf81b9e22d669f790b
R
2,871
83
# open R srun -n 10 -p interactive --pty /bin/bash module load cluster/gsl/1.15 module load cluster/htslib/1.9-devel module load cluster/build_tools/llvm/8.0 module load cluster/util/gcc/8.2 module load hdf5_18/1.8.21 conda activate r_env #conda deactivate R library(dplyr) library(stringr) # --- Setup --- disease...
ea4c70046ec78d0cfbc2f7ff00fdfa25543fe218d3b7ad04605f87c940dd7f95
R
2,872
68
library(DESeq2) library(ggplot2) library(pasilla) ### Choose one matrix to analyze ### coldata_df_M_KAI_IA_IPSI_A_AC <- coldata_df_M %>% filter(TYPE_2 == "M_KAI_IA_IPSI_A_AC") filtered_samples_M_KAI_IA_IPSI_A_AC <- rownames(coldata_df_M_KAI_IA_IPSI_A_AC) adjusted_df_M_KAI_IA_IPSI_A_AC <- adjusted_df_M[, colnames(adju...
c0dabb16319432fcaa6ef812e4af02b93189c459cd1509b15e4b0a456e8e3a64
R
2,873
58
suppressMessages({ library(scrattch.hicat) library(dendextend) library(dplyr) library(Seurat) library(DESeq2) }) parser = argparse::ArgumentParser(description="get DESeq2 normalised matrix") parser$add_argument('-I','--input', help='input seurat object amniote/vertebrate and ortholog/metagene') par...
960d0542638a6dca1248a696f90c6d48454f619e2da2c1a72226698bbbe8aecc
R
2,874
97
# ----- # UMS IPSIT BIOINFO - Licence GPL-3 # https://github.com/fdumbioinfo/moal # ----- # # moal install source("https://raw.githubusercontent.com/fdumbioinfo/rtools/main/moal-demo/0-moal-install-r-universe.r") library(moal) # DESeq install if(!require("BiocManager",quietly=TRUE)){install.packages("BiocManager")} if(...
4ace840cbd6be93190f740cba2d89a0fb7b401ea317dc605a10292a0ab393153
R
2,876
95
### ----------------------------------------------------------------- ### Legacy exploratory analysis by a member of the Wilson Lab. ### Historical record only — not part of the bancpipeline release. ### ----------------------------------------------------------------- # Script to look at top downstream targets of JO-...
f10866a94246fb2ea3efdaca738c07b1416f82652cf9cc1d61eae904fab43a7a
R
2,876
112
test_that("Test RemoveOutliers", { set.seed(123) x1 <- rnorm(20, mean = 5, sd = 0.5) y1 <- rnorm(20, mean = 5, sd = 0.5) x2 <- runif(5, min = 10, max = 15) y2 <- runif(5, min = 10, max = 15) coords <- data.frame(x = c(x1, x2), y = c(y1, y2)) new_coords <- RemoveOutliers(coords, k = 5, dista...
ee9dc5f9cda3c87c4369e689ec2601767a9590e97b270e1eb02f6696bdf6e796
R
2,882
68
### Concentration calculation setwd(rstudioapi::getActiveProject()) rm(list=ls()) library(tidyverse) library(stringi) Exp2 <- read.csv("./Input_Data/Exp2_Reintegration_values_121725.peak.color.coded.csv", stringsAsFactors = F) load("./Output_Data/Exp2.MS-Dial_IS.all.Rdata") Exp2.rmv.poor.peaks <- Exp2 %>% filter(...
3717cc3654d63e14c77b92f97b7f23b8bad517922924abef9e0e265e2b1e1f9e
R
2,886
97
library(tidyverse) library(lme4) library(lmerTest) library(ggplot2) library(patchwork) behav_long <- read.csv('C:/Users/mmatt/Desktop/Projects/NightOwls/night-owls/derivatives/data-outputs/behavioral_data.csv') #Change across all obs ##All subj pos_mood_mlm <- lmer(mood ~ obs + (1 | subj/ses), data = behav_long) summ...
14b0312f52e5e4fd9b756de6ed4a9e14d5ac43f299e273f31b30b88f5c6a27fd
R
2,887
85
# Extract bed files of cluster specific peaks for LDSC library(GenomicRanges) library(ArchR) library(parallel) addArchRThreads(threads = 20) addArchRGenome("hg38") library(ComplexHeatmap) library(ggsignif) library("RColorBrewer") library(ggplot2) library(ggpubr) projdir <- "projrmSubset_subPeak" proj <- loadArchRProje...
e0fc09818671a297bc0fdc5d28b2652e660140647816fed76bf774134b73b170
R
2,892
46
library(dplyr) #### import RAW Count matrix adjusted_1 VERSION #### adjusted_df <- read.table("/home/joonho345/1_Epilepsy_RNA/RNA_Human/02.Quantification/adjusted_merged_matrix_1.txt", sep = "\t", header = TRUE, row.names = 1) #### import TPM matrix adjusted_1 VERSION #### adjusted_df <- rea...
171dffad8700c0ff0551c3e34306210317cb1eff75c9df91b80e389841b16719
R
2,897
113
##### Converting for CellxGene Compatible Format ##### library(Seurat) library(reticulate) library(anndata) library(Matrix) library(dplyr) anndata <- import("anndata") #Load Seurat object tanybase <- readRDS("/data/pharma_macrophages/Tanybase_integrated_080525.rds") #Get normalized data (data slot) norm...
ac87616007b636c51017588cf2443037c35ff1332f089fc58770f8607352de83
R
2,898
72
# jet.colors <- function (n){ # x <- ramp(seq.int(0, 1, length.out = n)) # if (ncol(x) == 4L) # rgb(x[, 1L], x[, 2L], x[, 3L], x[, 4L], maxColorValue = 255) # else rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255) # } #' Compare a neuroglancer mesh object with a regular neuron #' #' @param x A n...
4c902aa0ca76a14e3a493d522ef3c4cfabf8e50150136666ab2f6efef88d26fb
R
2,902
127
library(MicrobiotaProcess) library(phyloseq) library(tidyverse) library(vegan) library(coin) library(ggnewscale) library(patchwork) library(ggtree) library(ggtreeExtra) data_dir <- file.path(proj_dir, "Data") qiime_dir <- file.path(data_dir, "QIIME2") micom_dir <- file.path(data_dir, "MICOM") # ---------------------...
fadf8249cca172d395f76501f28514448539cc78ed48cbe74bb1d05bf35046d6
R
2,903
73
#tissue_species_mod.plot library(ggplot2) library(dplyr) data <- read.table("all.motif.prob", header = FALSE, sep = "\t", col.names = c("Tissue", "Count", "Value")) data <- data %>% mutate(Tissue = recode(Tissue, "Li" = "liver", "Ki" = "kidney", "Br" = "brain")) colors <- c("liver" = "#82B6CE", "kidney" = "#D6B36C"...
05347764f59203f3de1c5fa1ea508acd118af4f0553b3ed46f5e97c44714a652
R
2,906
78
#Written by Yapei Xie and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md # Helper function to install and load packages personal_lib <- path.expand("~/R/library") dir.create(personal_lib, recursive = TRUE, showWarnings = FALSE) .libPaths(c(personal_lib, .libPaths())) install_if_mi...
13d00d31be99393a30dffb9cc3871587446279888a3dddf67ef8a49831fecb1a
R
2,908
112
--- title: "Fig_3J_MalignantCell_GSEA_HallmarkEMT" output: html_document date: "2026-02-17" --- --- title: "programs_of_interest" output: html_document date: "2026-01-08" --- ```{r} install.packages("msigdbr") library(devtools) install_github("alserglab/fgsea") # dependency for clusterprofiler devtools::install_gith...
2d61c16a42b0b7936db72063a347d5d75f6893dc2f2f24a520f434c0a2e593c0
R
2,909
69
##################################### ## Write GATK segments to database for GLSS-LX cohort batch 2 ## Author: Kevin Johnson ## Updated: 2022.03.21 ##################################### library(DBI) library(tidyverse) ## Current project projdir <- "/projects/verhaak-lab/USERS/johnsk/glass4" setwd(projdir) ## Connect...
8cc56111fb1be928d17d2dae87dfbc039a8166919bfc96b33ae1452a6c85649c
R
2,914
91
#' snpcov_mvmr #' #' Uses individual level genetic and exposure data to generate covariance matrices for estimated effects of individual genetic #' variants on each exposure. The function returns a number of covariance matrices equal to the number of SNPs, where SNP and #' row numbers reference ordered exposures. #' #'...
f75a0b7f3705b1dd1199f5582c1e16880afa19f8f120485c1824005a6edc812c
R
2,915
95
--- Author: Carrisa V. Cocuzza, PhD Purpose: CND project, TCP dataset, Train/Test subset, dimensional phenotyping, hierarchical clustering checks. Output: html_notebook --- ```{r} #install.packages("NbClust") ``` ```{r} # LIBRARIES library(dplyr) library(bestNormalize) library(parallel) library(tibble) library(tidy...
5b6382d083faa6afba2e004f02555d399b343f21f9d50974b448bfcba803e7e7
R
2,918
69
################################# ## Create blocklist for GLSS-LX WGS batch 2 ## Updated: 2023.03.20 ## Author: Kevin Johnson ################################# library(DBI) library(tidyverse) ## Connect to the latest version of the database that contains the GLSS-LX samples. con <- DBI::dbConnect(odbc::odbc(), "Verha...
284fa6d8ae752163c089224d7981e9088197ec4c8373f3618c26d63daf2f9850
R
2,929
80
check_meshparty_reticulate <- memoise::memoise(function() { check_reticulate() tryCatch( reticulate::import("meshparty"), error = function(e) { stop( call. = F, "Please install python meshparty module\n", "We strongly recommend doing\n", "fafbseg::simple_python('full')"...
b55c84f66491a8e30b5c695551b52096e83fa660ba85aff6990fc2611d47cf2f
R
2,929
67
#' Create Self-Similarity Visualization #' #' This function creates a self-similarity visualization based on the provided #' annotation object. It generates heatmaps for marker self-similarity or average #' expression self-similarity, depending on the specified slot #' #' @param ann An object containing annotation data...
21d42158aabd10a72b6e34041db4599cdff4f1c126c6fdf21758adf8ba99e05b
R
2,930
70
#!/usr/bin/env -S pixi run --manifest-path /app/pixi.toml Rscript options(stringsAsFactors=F) ## load R libraries #library(SAIGE, lib.loc="../../install_0.93") library(SAIGE) require(optparse) #install.packages("optparse") print(sessionInfo()) ## set list of cmd line arguments option_list <- list( make_option("--...
6cc34cc5a1677eb6e8c27d9838fc2842b6de419af903b8bd361b7a7f50e7e703
R
2,933
100
################################# # Push sequenza seg + params for GLSS-LX-WGS into db # Updated: 2023.03.20 # Author: Kevin Johnson ################################# library(DBI) library(odbc) library(tidyverse) rm(list=ls()) myDir1 <- "results/sequenza/seqzR/" mytag <- dir(myDir1) myDir1 <- paste(myDir1, mytag, se...
d7c4c2ca26a860082fa940a645a009e3fb805a33089c544755462591235ac6fd
R
2,933
93
# this is very much still WIP read_graphene_meshes <- function(segment, cloudvolume.url=getOption("fafbseg.cloudvolume.url"), dracodecode=c("auto", "dracor", "DracoPy")) { baseurl=sub(".*(https://[^/]+)/.*", "\\1", cloudvolume.url) manifesturl=sprint...
2ae2f42b2ec80455cce8599cadb6b327c2083a4d6b8ffe4efcf46863445901d0
R
2,934
82
#!/usr/bin/env Rscript #------------------------------------------------- # Title: prepare reference sequence for DRG deconvolution # Author: Christina Meier # Date: 2025-06-05 # Email: 19cm51@queensu.ca #------------------------------------------------- # Notes ------------------------------------------ # module load ...
1a5c3df416f6afee849b5f3b381302b23f791e37b0968b918e14eba7155d70cd
R
2,936
49
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir <- "/WORKING_DIR" source("00_settings.R") dataDir <- file.path(baseDir, "data", "NMF") ##### #####...
33beaf1aabb0a042612000ef279e4bdd2905b9698fdfe5efb79509bbb574edb5
R
2,936
76
library(lmerTest) library(emmeans) library(tidyr) setwd("/Users/hyx/Downloads/hyx/Network-based_Brain_Ageing_ADNI/") data <- read.csv('./adni_BA/lme_data_3group_6yr.csv', header = TRUE) features <- c('VIS', 'SM', 'DAN', 'VAN', 'LIM', 'FP', 'DMN') anova_results <- list() pairwise_results <- list() slopes_matrix <- da...
55c80ce7e3dd70151c51ef75a0283e373ce7dc2aa348622b095d3e26be9be99d
R
2,936
55
library(ggplot2) library(dplyr) library(viridis) library(treemapify) # Your data in a data frame data3 <- data.frame( MainCategory = c(rep("Coral Species and Biology", 16), rep("Reproductive Timing and Larval Release", 2), rep("Larval Development and Competency", 4), ...
8fee35e16292f8e49e624fb5b97d39ff0a9aba6f42aced913a5da0b96587780e
R
2,939
107
# 02_Analysis/Supp7.verify_fdr_impact.R # # Objective: # 1. Verify the specific statistical claims about NNAT from the manuscript. # 2. Quantify the number of DEGs at FDR < 0.05 vs. FDR < 0.1 for all contrasts. # 3. Check the significance status of key calcium-related genes at both thresholds. # # Input: # - DE...
edfcc9eadc0dbdc8588f6d403dee23469862c21984570bb6ee30cafa0f68ceac
R
2,942
100
################################# # Push sequenza seg + params into db # Updated: 2022.07.06 # Author: Kevin Johnson ################################# library(DBI) library(odbc) library(tidyverse) rm(list=ls()) myDir1 <- "results/sequenza/seqzR/" mytag <- dir(myDir1) myDir1 <- paste(myDir1, mytag, sep="") myinf1 <- ...
425815aac0ce359c120bda2a4b3d5aad3c6d9bb1214eae89fe0a1b98183eefcf
R
2,943
102
--- title: "Fig_3D_Tumor_Tcells_by_timepoint" output: html_document date: "2026-02-17" --- ```{r} library(Seurat) library(tidyr) library(ggplot2) library(ggpubr) library(dplyr) library(harmony) library(purrr) library(cowplot) library(rstatix) library(ggbeeswarm) library(ggbreak) ``` # Set up and adjust metadata ```...
d04ed9b8cfeb9d7bdda2bba653eb071f21e2994c3404e2c12f2475a4da21a5e3
R
2,944
54
print('This script would take 6 arguments, which are:') print('Conditional clump 0.01 lead csv, respective FUMA snps.tx, std sumstats for TRAIT1') print('std sumstats for TRAIT2, TRAIT1 name, TRAIT2 name') print('to produce cond_0.01_TRAIT1_vs_TRAIT2.csv') library(data.table) args <- commandArgs(TRUE) #lead1=read.csv('...
16dca418616e022e17d16ddc74d7e95515874d759b464f0298622e4ab5f869f0
R
2,946
87
library(Seurat) library(tidyverse) library(DoubletFinder) library(glmGamPoi) library(biomaRt) DLPFC <- Read10X(data.dir = "/Barcodes/", gene.column = 1) so <- CreateSeuratObject(counts = DLPFC, project = "DLPFC") #Add QC info to the metadata so$log10GenesPerUMI <- log10(so$nFeature_RNA) / log10(so$nCount_RNA) so$mito...
bfb22f313fa61cc2589967b2055d6ae6118f303e1250a9298c8cecb10dd95548
R
2,948
89
#' @title T-tests for symptom mapping (slow) #' #' @description #' Lesion to symptom mapping performed on a prepared matrix. #' T-tests are performed using each column of the #' matrix to split the behavioral scores in two groups. If #' var.equal=TRUE the Welch test is performed instead. #' #' @param lesmat binary matr...
3a25ef46be73384949171a457f3148eb454f780e78971f9b0362238a1b8e2ada
R
2,950
99
library(tidyverse) subj <- c('sub-101','sub-103','sub-104','sub-105') #Read mood rating data mood.csv <- sapply(subj,function(x) NULL) for (sub in 1:length(subj)){ dir <- paste0('C:/Users/mmatt/Desktop/Projects/NightOwls/night-owls/stimuli/mood/logs/' ,subj[sub]) #sessions <- list.dirs(dir) #f...
afc333ba6573c6062c0340fa1dd4cf299c44599edaa300afb9777ca7ae7af5c7
R
2,954
69
##### Tany-seq Data Collection and Labelling ##### #Sullivan, A.I.; Potthoff, M.J.; Flippo, K.H. Tany-Seq: Integrated Analysis of the Mouse Tanycyte Transcriptome. Cells 2022, 11, 1565. https://doi.org/10.3390/cells11091565 #Data obtained from Flippo, Kyle (2022), “Tany-Seq: Integrated Analysis of the Mouse Tanyc...
c167a899ae499a51f579ac30857898cbe5ef8c2f70513719d85c941a681c4a99
R
2,960
71
##################################### ## Write GATK segments to database for CARE-MD and CARE-PS tumor only ## Author: Kevin Johnson ## Updated: 2022.08.26 ##################################### library(DBI) library(tidyverse) ## Current project projdir <- "/projects/verhaak-lab/USERS/johnsk/glass4" setwd(projdir) ##...
9311da618273d0465acb254dac5e23a37cc4723e19202d0c8f5b8b5dc5cdb476
R
2,961
100
## code to prepare `shapes` dataset goes here rm(list = ls()) devtools::install_github("gaospecial/shapeMageR") library(shapeMageR) ## code to prepare `ggVennDiagramShapes` dataset goes here # construct a object for plotting Venn Diagram # columns in `shapes` # - shapeId: shape id, each shape has three components, a...
5f85927137ffb27bd1faf967050e95e4d5b35d740dec79bd01ee22973d0ddd28
R
2,963
88
# When working with lM it is useful to design an "average and difference" # contrast matrix, which for binary responses has a simple canonical from: ADmat <- matrix(c(-1/2,1/2),ncol=1,dimnames=list(NULL,"d")) # We also define a match function for lM matchfun=function(d)d$S==d$lR # Drop most subjects dat <- forstmann[...
f7f669bde003f7e659bc100a281b1c32bdb719621f84d9093f1485231c0095ef
R
2,968
148
--- title: "Get signif counts in correlation tests" author: - David lukacsovich^[University of Miami] - Lily Wang^[University of Miami] date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: pygments theme: lumen toc: true number_sections: true df_print: paged code_download: ...
5ec8f297b499440487943614b4ebc9d0b15595b912835447f435a718de65d2d8
R
2,971
79
library(dplyr) library(openxlsx) library(stringr) t2dCompMststy2ndEd <- "D:\\work2\\t2dAndComplicationsUkb\\data\\processed\\t2dCompMststy2ndEd.rds" %>% readRDS(.) diseaseNameVsIcd10_2nd_ed <- "D:\\work2\\t2dAndComplicationsUkb\\data\\vs\\diseaseNameVsIcd10_2nd_ed.xlsx" %>% read.xlsx(., sheet = 1) t2dCo...
c3f6221997ae51dbcb1708c604f8544b1d2b7eebe32de31787080fc2fbfae4c3
R
2,976
86
library(dplyr) library(survival) library(car) library(glmnet) library(stringr) all_file_paths <- "D:\\work2\\t2dAndComplicationsUkb\\data\\processed\\LassoCox" %>% list.files(path = ., pattern = ".*", full.names = TRUE, recursive = TRUE) compIndex <- which(str_detect(all_file_paths, "Comp.rds")) comp_path <...
fb8b4c655b68c25f00aa865f1a9b8fd4a1495b082702cb44b2d34fc833b6ba2c
R
2,978
104
#' Check input spe #' #' This function checks that the `spe` object has the appropriate structure. #' For more details please check the vignette documentation. #' #' @inheritParams sce_to_spe #' @inheritParams vis_clus #' @param variables A `character()` vector of variable names expected to #' be present in `colData(sp...
9cb066d418b88ca8f878146aae3f734d29d63b34abe279f1d2c99dabc5efc997
R
2,985
66
RNGkind("L'Ecuyer-CMRG") set.seed(123) matchfun <- function(d) d$S == d$lR d_ord_probit <- design(Rlevels = c("low", "mid", "high"), factors = list(subjects = 1, S = c("low", "mid", "high")), formula = list(location ~ 0 + S, scale ~ 1, cut ~ 1), matc...
775777025185bedf1d5ca56ef088d9cdec0da4db31514e7e84f7fcc0691a170e
R
2,989
115
test_that("Test computeSpatialEnrichmentIndex", { coords <- readRDS(system.file("extdata", "MouseBrainCoords.rds", package = "SpNeigh" )) logNorm_expr <- readRDS(system.file("extdata", "LogNormExpr.rds", package = "SpNeigh" )) bon_c0 <- getBoundary(data = coords, one_cluster = 0) ...
90d207d84985af3ee231d2018a8d8dd3cc436fa43a909d4afeb7a8ac21c16269
R
2,990
66
setwd('/sc/arion/projects/roussp01a/liting/Olf/figures/downstream_iOSN/') scdrs_outps <- list.files('./', pattern = 'scdrs_group.N_types_stage') cor_traits <- c() for (trait in scdrs_outps){ cor_trait <- read.table(trait, header = T) cor_trait$trait <- trait cor_traits <- rbind(cor_traits, cor_trait ) } mytr...
832ea46fe165f1dd61895d9cc835e8b1ea06d0a3f92749e8d0b331e3055effb2
R
2,992
81
###Compare NodoMap with Buchanan dataset library(Seurat) library(ggplot2) library(dplyr) library(stringr) #Load data data <- readRDS("diet_nodomap_metadata_updated_2510.rds") #Read Buchanan annotation buchanan <- read.csv("GSE185173_nodoseMerged.meta 2.csv") #extract metadata and cell names x <- data@meta.data x$ori...
03cd7ab3b418342da0ef02a008ca12be12a90dd88c962c5f799cb404c24aee97
R
2,994
103
#' @keywords internal "_PACKAGE" ## usethis namespace: start #' @importFrom abind abind #' @importFrom Brobdingnag as.brob #' @importFrom coda acfplot #' @importFrom coda as.mcmc #' @importFrom coda cumuplot #' @importFrom coda effectiveSize #' @importFrom coda gelman.diag #' @importFrom coda gelman.plot #' @importFro...
0a735f810b3485bf17203f4c1604e7a1940afb0a517efd2527f31179735d957e
R
2,995
112
start_parallel <- function(parallel, cores) { if (parallel && requireNamespace("doParallel", quietly = TRUE) && requireNamespace("parallel", quietly = TRUE)) { if (Sys.info()["sysname"] == "Windows"){ cluster <- parallel::makeCluster(cores) doParallel::registerDoParallel(cluster) } els...
419d4833dacf8856aad49747d95aa96a55e5895d0afe1dff436b2a6b80934b25
R
2,997
86
source("01.param.R") source("02.net_gen.R") source("03.API_extensions.R") hiv_vec <- get.node.attr(est1$newnetwork, "HIV") %>% as.numeric() status_vec <- rep("s", pop) status_vec[which(hiv_vec==1)] <- "i" init <- init.net(status.vector = status_vec) module.order <- c("setup.FUN", "resim_nets.FUN",...
a922bf24b3fd7221d34cf33c4ad88f676b4ad3660976063f9e380db2c786616a
R
3,000
76
# ========= CHCHD10 vs Age (Inhibitory neurons; AD vs NC only, no other covariates) ========= suppressPackageStartupMessages({ library(dplyr); library(readr); library(ggplot2) }) BASE <- "/home/cxy605/Synapse/ROSMAP_scRNAseq/Inhibitory_Neurons" OUT_DIR <- file.path(BASE, "CHCHD10_pathology_plots") IN_CSV <- file...
324d534f4212cab46ae8f363ca5b886a46c77d536e6095e43da2d6efd2b45f08
R
3,001
41
rm(list = ls()); setwd('/sc/arion/projects/DiseaseGeneCell/Huang_lab_project/ADASE/') # All sample in analysis clinical information clinicals <- as.data.frame(readxl::read_xlsx('data/SampleInAnalysis/SampleInAnalysis_TenReads.xlsx'),stringsAsFactors=F) #clinicals <- clinicals[clinicals$Sampleid%in%c('B18C014.hB_RN...
b6444719c5f46d3899c1528563439acce8813cb8a8e347057d1407381400efd8
R
3,003
67
################################# ## Create blocklist for batch2 of CARE ## Updated: 2022.07.05 ## Author: Kevin Johnson ################################# library(DBI) library(tidyverse) ## Connect to the latest version of the database that contains the CARE samples. con <- DBI::dbConnect(odbc::odbc(), "VerhaakDB4") ...
cfd2fb934005cd4275385adee5fe5d8e15b3a6e49beef7ec882807aab1297c16
R
3,003
82
library(ggExtra) library(ggplot2) library(tidyr) library(MetaNeighbor) library(conflicted) library(magrittr) library(reshape2) library(dplyr) library(here) library(readr) library(tmod) conflict_prefer("count", "dplyr") conflict_prefer("select", "dplyr") conflict_prefer("filter", "dplyr") conflicts_prefer(dplyr::rename)...
8422d70f8855dcc4a11d8606c97312ca1976425144e8d15351daf51ab71cb056
R
3,008
86
library(corrplot) library(igraph) library(RColorBrewer) Over_1000 <- read.csv("PHQ9_cluster_networks.csv") All_net <- readRDS("All_GTEx_DLPFC_networks.RData") df_names <- names(All_net) new_df_names <- sub("_+$", "", df_names) names(All_net) <- new_df_names process_dataframe <- function(df, df_name) { df <- df[, ...
e29d152cc161a4674a2cadc4bb261e96b9dd35ecd1a2dfc80a2bb16bb23f2c60
R
3,010
106
# Script: config.R # Purpose: Centralizes all configuration parameters for the linear modeling analysis pipeline ########################### # Base Directory Settings # ########################### # Set working directory and base path # BASE_DIR should be set to the project root directory # BASE_DIR = "path/...
e40a4f9467f22b457a09f0d6b7a0ad47e569631897a21002009efa6c0978acc7
R
3,010
86
library(ggplot2) library(dplyr) library(data.table) library(GenomicRanges) outp <- "QTL_fsVars/out" majorCs <- c("ast","mg","EX","IN","odc","opc") Dxs <- c("Control","AD","bvFTD","PSP_S") ##define MPRA fsVar by cutoff: P < 0.05 mpra_in_celltypePeaks <- read.csv(file.path(outp, "mpra_in_celltypePeaks.csv"), row.names =...
1e1bc68d3d4f2c64c31a289192d02905821208d950fec4ea053140a33387f331
R
3,012
87
#' @title Check headers of list of antsImages #' #' @description #' Function to check that all antsImages in a list have #' the same orientation, origin, and resolution. #' The function stops with an error if one of the images #' has unusual headers. This behavior can be overcome #' by setting showError=F, and using th...
0de903e33a9f62b14143b0e085961aa28cc965273ab1630c65c7617458523876
R
3,013
117
#### Error helpers #### format_safe_error_message <- function(title, details = NULL) { if (is.null(title) || !nzchar(title)) { title <- "Error" } if (inherits(details, "condition")) { details <- conditionMessage(details) } if (is.null(details)) { details <- "" } if (is.list(details)) { ...
cdbb21f3cc980ba830367596a00b377f1b61fa6507e1c3cc25ea1137692f9465
R
3,014
95
################################# # Push sequenza seg into db # Updated: 2022.03.01 # Author: Kevin Johnson ################################# library(DBI) library(odbc) library(tidyverse) rm(list=ls()) myDir1 <- "results/sequenza/seqzR/" mytag <- dir(myDir1) myDir1 <- paste(myDir1, mytag, sep="") myinf1 <- sapply(my...
4f4d3325791068de6c185d718e238f80129b8bfb756b8989a0b717a976f67f19
R
3,016
89
# # Step.00 ---------------------------------------------------------------------- rm(list = ls()) gc(reset = T) source('script/Functions/Functions.R') # unload packages pkgs[which(load.packages == F)] rpid = Sys.getpid() options(future.globals.maxSize = 1000 * 1024^3) ##################################################...
ae5bd412377ce29323aeaf33593f15fe11bd37bdd11c3670f9c7b5b59860146d
R
3,017
89
context("Run") teardown({ mlflow_clear_test_dir("mlruns") }) test_that("mlflow can run and save model", { mlflow_clear_test_dir("mlruns") mlflow_source("examples/train_example.R") expect_true(dir.exists("mlruns")) expect_true(dir.exists("mlruns/0")) expect_true(file.exists("mlruns/0/meta.yaml")) }) te...
f48051408f46b89e8a1082d53e10e39246a363e933b0f0febbfaa65212823f14
R
3,017
76
## IMPRO Imaris Sholl Analysis # Input your working directory below. # The script assumes that the samples are identified by the first numbers in the file name. # Specify the name length below for accurate results (e.g. if your samples are named "001, 002, ...", animal_name_length would be 3). # This script works ind...
210ab2556ff082f8b502c23737df0c8aee535bfce16e8a1646d503d858a50aea
R
3,018
65
library(fsbrain) library(tidyr) library(stringr) library(e1071) library(dplyr) ## Extract parcel-wise measures based on vertex data setwd('/home/huyang/Projects/HuYang/HY_20250708') fs_dir <- './PROCDATA/STATS/T1/FSDATA' sublist <- scan('./PROCDATA/LIST/t1_sublist_postqc.txt', what = '') atlas_names <- c('Schaefer.300P...
b70581fa53fbc9e10624fe04d83364f26dd5bcadfdf64e43cbc12e237cef7e60
R
3,020
85
################################################################################ ###############-- TEST-RETEST POSTERIOR PREDICTIVE PERFORMANCE --############### ################################################################################ ## Prediction session a choice data from session b parameters --------------...
81efecb95843a10e49955de408e1274dcf5592285cb42063be908c7f1c8ab25b
R
3,021
73
#' Pick the principal branch point of a neuron (useful for annotation tables) #' #' @description `key_point_from_neuron()` picks a good "key" point on an #' in-memory neuron — the principal branch point of its skeleton — suitable #' for hanging an annotation off (e.g. a point column in an annotation table). #' #' ...
e741ced6f85274028eff9c94b602d482f7d811774004d565a685c3c3c287eea6
R
3,021
75
# Moderate effect size genes project # Author: Madison Caballero # Desription: Testing SCQ question responses for MES gene carriers using X2 test options(tidyverse.quiet = TRUE) library(tidyverse) args = commandArgs(trailingOnly=TRUE) # MES genes GENES = read.delim(file = "MES_genes.txt", header = FALSE) # SPARK met...
bba825f45a57b676b51186e1e74716481d2d8a657905b0bc6187b8d518af240e
R
3,023
64
lasso.proj<-function (x, y, family = "gaussian", standardize = TRUE, multiplecorr.method = "holm", N = 10000, parallel = FALSE, ncores = getOption("mc.cores", 2L), betainit = "cv lasso", sigma = NULL, Z = NULL, verbose = FALSE, return.Z = FALSE, suppress.grouptesting = FALSE,...
e46d150c9c2dc0cae9ca9de229526691e0c9fccb9109ff6279eaaf22fe965910
R
3,026
77
############################################################ # MS-DAP analysis after filtering peptides derived from # eGRASP constructs (pre- and post-eGRASP) # # Peptides originating from the engineered constructs are # removed using in-silico trypsin digestion prior to # differential expression analysis. ###########...
4827f004dd1b25a08d223e88618e3001b91c1457712cb516e899740ff7529bf4
R
3,032
129
test_that("Test plotExpression", { df <- data.frame( x = c(rnorm(100, 1), rnorm(100, 5)), y = c(rnorm(100, 1), rnorm(100, 5)), cell = 1:200, cluster = rep(1:2, each = 100) ) exp_mat <- data.frame( gene1 = c(runif(100, 4, 6), runif(100, 0, 2)), gene2 = c(runif...
660832a1b037b2ed9cda4fc3e6528b49c9801293fa4cfccb374c946af51eae67
R
3,034
98
#' Sample spatial gene visualization grid #' #' This function visualizes the gene expression stored in `assays(spe)` or any #' continuous variable stored in `colData(spe)` for a set of samples at the #' spot-level using (by default) the histology information on the background. #' To visualize clusters (or any discrete ...
ccfa838e9a564dda2501ca7bf39fadfb7bc452d6d3058775a2bb587682973b87
R
3,035
63
here::i_am("scripts/1.neural_differentiation_dataset/1.2.network_inference/1.2.1.prepare_data.R") library(tidyverse) library(SingleCellExperiment) library(foreach) library(scran) library(scuttle) library(transformGamPoi) library(glue) wd <- here("data/neural_differentiation_dataset/network_inference/input/") dir.crea...
2109a9353152bd4c30a924a0f55b5bd18bd41559de84baadf3095fba00a3ec22
R
3,036
85
--- title: "Extract latent factor scores for continuous measures of anxiety" author: "Genevieve Morneau-Vaillancourt" output: html_document --- Load packages (install packages first by removing '#' if needed) ```{r} # install.packages('lavaan') library(lavaan) # install.packages('tidyverse') library(tidyverse) #inst...
6bb6342e5de8b6f5bfd65478cf4653d9aefeb9c203d2e03208bd1b6f1259b7fb
R
3,038
87
# Description: This script is used to plot the cumulative probability of Patient # with Q4 levela confirming T2D at four different time points after baseline library(dplyr) library(mstate) library(patchwork) library(ggplot2) msT2dComp2ndEd <- "D:\\work2\\t2dAndComplicationsUkb\\data\\processed\\integComp2ndEd...
e20ee472f9e134772d676db9bb0d9eb6172353b9bfe8b400867e0ae4a7ec1323
R
3,039
72
# Moderate effect size genes project # Author: Madison Caballero # Desription: Testing comorbidities for MES gene carriers with ASD options(tidyverse.quiet = TRUE) library(tidyverse) args = commandArgs(trailingOnly=TRUE) #MES genes GENES = read.delim(file = "MES_genes.txt", header = FALSE) # SPARK metadata FAM = rea...
bbdc4672f95ab1bf1394ffee32af3c6f6bc94c9a19ddca3c08649bc37d867636
R
3,041
106
# Script: config.R # Purpose: Centralizes all configuration parameters for the linear modeling analysis pipeline ########################### # Base Directory Settings # ########################### # Set working directory and base path # BASE_DIR should be set to the project root directory # BASE_DIR = "path/...
22a84837c5a864c12d2f63d0f1ad193ca95acaba4fbc02fedc4871f9bc381a9b
R
3,042
64
################################## ### Upload batch2 NorLux WGS data ### Author: Kevin Johnson ### Date updated: 2022.03.17 ################################## library(tidyverse) library(odbc) library(DBI) library(stringi) ## Establish connection with GLASS 4 database. con <- DBI::dbConnect(odbc::odbc(), "VerhaakDB4") ...
edd6e2fa38629cd8cc43a09a13120dfc8567db80ee6e890313967b6e7b0baf18
R
3,045
114
# evaluating part of the R coloc sensitivity.R functions # accessed the code on 07-09-2021 # loading data library(coloc) ######################################################### # test data # ### constant data # snp = paste0('snp_', seq(1,5)) # n = 1000 # sdY=2.32924174 # event_rate=0.10 # maf = c(0.1349454, 0.1178...
2d2f58f6dbc4633ab48aa1b41ee67f00e668bf9f9adf5c3d3546e8588c4bf293
R
3,047
98
# Load packages suppressPackageStartupMessages(library(Signac)) suppressPackageStartupMessages(library(Seurat)) suppressPackageStartupMessages(library(GenomicRanges)) suppressPackageStartupMessages(library(magrittr)) suppressPackageStartupMessages(library(dplyr)) suppressPackageStartupMessages(library(future)) suppre...
dcdc8a5c0294f6eac9b7a1b0e532d19c7188882a54e2d81c80446d037152c745
R
3,051
66
#' Initializes marker sets for SAHA analysis #' #' This function filters marker genes from both the query and database datasets #' in a SAHA object based on user-defined thresholds. It prepares the data for #' downstream marker-based annotation by applying cutoffs for adjusted p-value, #' fold change, sensitivity, and ...
6fab49a9bf70a92077069e083b5d148ec3fd610aa4e6d1d2577eefa5bbe851d8
R
3,053
111
######The code below is the pipeline for the spatial clustering ######on the Xenium DMD brain samples for one the slides of the ###### of the run library(Seurat) library(Banksy) library(R.utils) library(data.table) library(dplyr) library(tidyverse) library(SeuratWrappers) library(scater) library(ggplot2) ###...
be67515fba729dcf6b5f4120c368aa5c5f3d3d9eafb388beef9cdc37858099ae
R
3,055
61
################################## # Plot the malignant cell state differences across tumor grade by tumor type # Author: Kevin Johnson ################################## library(tidyverse) library(ggpubr) library(EnvStats) proj_dir <- "/vast/palmer/pi/verhaak/kcj28/care_idh_mut/" fig_dir <- file.path(proj_dir...
6d034b0346ccd55d897eeb83d65fbd2202f704e61f5a3224d2a73207e397a890
R
3,056
66
#' recombine package #' #' RECOMBINE: Recurrent Composite Markers for Biological Identities with Neighborhood Enrichment #' #' This package includes five novel algorithms for feature selection coupled with clustering. Briefly, we advance SHC (sparse hierarchical clustering) and obtain two algorithms: SHC-SSL (sparse hi...
e70318c10881f04f61089f3c0e840043b8228d5ec35880ac74b8399871907c5d
R
3,056
83
#!/usr/bin/env Rscript ## Author: Luuk Harbers ## Date: 2022-10-22 ## Script to make summary table and plots ## Load/install packages packages = c("data.table", "argparser", "ggplot2", "cowplot", "ggsci", "scales", "patchwork", "gtools") invisible(sapply(packages, function(x) suppressMessages(require(x, character.onl...
1f308f0cddb56c3a8c766ce9b92f74bf20096b291589c48cc9e68e1f226ec39b
R
3,057
68
#' Create Self-Similarity Visualization #' #' This function creates a self-similarity visualization based on the provided annotation object. It generates heatmaps for marker self-similarity or average expression self-similarity, depending on the specified slot #' #' @param ann An object containing annotation data. It s...
ce0602070acaf68c36e5b20e929ae41b5f9d5586cd8bc4f33a826043323fd999
R
3,057
71
### Concentration calculation #Mboat2 overexpression and lipid supplementation data setwd(rstudioapi::getActiveProject()) rm(list=ls()) library(tidyverse) library(stringi) M2PMdf <- read.csv("./Input_Data/M2OE_Validation_112225.csv", stringsAsFactors = F) load("./Output_Data/M2PM.IS.MsD.w.conc.Rdata") M2PM.lpd.check...
506b6201486ba3e1b3e052f9d8232eb9e4e55d5e839b89f33ad09d35397b37b9
R
3,058
75
library(tidyverse) # tibble stuff #dt.path = paste('/home/emba/Documents/EMBA', 'BVET', sep = "/") dt.path = paste('/home/emba/Documents/EMBA', 'BVET-explo', sep = "/") # load the relevant data in long format df.tsk = list.files(path = dt.path, pattern = "PAL-BV*", full.names = T) %>% map_df(~read_csv(., show...