sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
7d10ff78f6e11cb25bfaaef89c723974b881ec922356578772c4db93f9cc7612
R
3,488
118
--- title: "MicrogliaDensity_Analysis" author: "Jenn Kim" date: "`r Sys.Date()`" output: html_document --- # load libraries ```{r} library(tidyverse) library(cowplot) library(ggplot2) theme_set(theme_cowplot()) library(nlme) library(lsmeans) ``` # load data ```{r} data <- read.csv("MicrogliaNumbers-Density.csv") %>% ...
159fe19020204141d1bcf4ad9806764f89b4bf700e9c2a7009c799d3989eb396
R
3,489
66
options(stringsAsFactors = FALSE) library(limma) library(edgeR) library(plyr) library(data.table) library(cit) library(doParallel) library(pbapply) library(WGCNA) library(parallel) # Read in Oligo snRNAseq expression, aggreagted to sample level ------------------------------------------------- exprCounts <- fread(in...
a594af674a32c56c4424ca9c845c5e6638cbbdfb6d3ad4f3c7bcc6cf396d956c
R
3,503
47
library(data.table) library(dplyr) #RBP for(dir in c("m6A2me", "me2m6A")){ RBP_enrichment <- fread(paste0("~/Downstream_analysis/Regulators/Lung.m6A_peak_RBP.", dir, ".txt"), sep = "\t", header = FALSE, col.names = c("RBP", "signif", "background")) %>% mutate(prop_signif = signif/sum(signif), prop_background = back...
bf120f4b980783718e3e02d98a75ea872b2c09ee2784fdb8d21b7b67e994104e
R
3,503
78
## ---------- Script ----------------- ## ## Purpose: input variables for differential analysis of Iso-Seq targeted mouse transcriptome datasets ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ---------- packages ----------------- suppressMessages(library("dplyr")) suppressMessages(library("stringr")) suppr...
fcb36ecb46485431640bf8c076c56c438eae17b9cde2d8bbca5fcd143be4580c
R
3,506
125
#' @name DEPRECATED-spc.loess #' @concept deprecated #' #' @title (DEPRECATED) #' LOESS smoothing interpolation for spectra #' #' @description #' These \pkg{hyperSpec} functions are **deprecated** and not maintained any #' more. You should not use these. #' Currently they are present due to back-compatibility re...
e03b22de6e306be2327f204960d65c04178a217751c8a313842c9ee315312510
R
3,507
145
# libraries library(readxl) library(tidyverse) library(ggpubr) library(rstatix) library(emmeans) library(sjstats) library(lme4) library(lmerTest) library(MuMIn) library(multcomp) library(nlme) library(r2glmm) library(ggplot2) library(ggthemes) library(svglite) library(sjPlot) # prepare --------------------------------...
603770f11cc1824c36198074ea5fa4d0b0e45e0f05b580efadec4255d70d85f0
R
3,519
91
require(data.table) require(mldata.export) main_dir <- "./data_raw/glass_identification" write_dir <- main_dir dataset_name <- "glass_identification" #### Data preparation ---------------------------------------------------------- data <- data.table::fread(input=file.path(main_dir, "data", "glass.data.csv")) # Set...
eab9e05c9799a7334828ea5bb45b998f9f3e4e8e9631d2893256ace8556f4322
R
3,523
106
library("tidyverse") library("clusterProfiler") library('data.table') library("BiocParallel") # prepare from GMT files download from gprofile ReadGMT_GSEA <- function (gmt.file) { pathwayLines <- strsplit(readLines(gmt.file), "\t") pathways <- lapply(pathwayLines, tail, -2) fetchName <- function(x){ unlist(...
a4e0c641c08a509c5b83d8645498a372f6ceff350adee5aa6681cd65510a614d
R
3,530
108
#!/usr/bin/R # -------------------------------------------------- # Get the GO term enrichments for external datasets: # Updated 12/01/2023 # -------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } ...
ececbf381129bf2d83f768f443b85420c6056434b72cf1e647e4af28f7f6062c
R
3,534
73
## ----------Script----------------- ## ## Purpose: Generate post-sqanti plots for summary of Iso-Seq targeted mouse transcriptome datasets ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ## ---------- Source function and config files ----------------- # source all general scripts related to long-read sequen...
cd954e718796f85dd1f984eda41ee257f4e0dad6658b7d26ef5b57f00e90d66e
R
3,541
89
#!/usr/bin/R # ---------------------------------------------------------- # Enrichments on aggregated differential expression results: # Updated: 11/25/21 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')...
4c56b4c422e646bf342f5aa61bffae1911c1a977aa7072661b23e3ac6390d6ad
R
3,543
112
#!/usr/bin/R # ------------------------------------------------------ # Calculate metadata statistics for the reviews response # - stats on amyloid / nft burden # - stats on staging # - stats on pathol diagnosis # - comparison to Montine ABC score # (all of these on ours vs. full ROSMAP cohort) # Updated 09/19/2023 # ...
bb77c130e843622a8a2ae895df1196d91c0f20e7164cbda6777dd15c1a285a8c
R
3,544
102
library(here) suppressPackageStartupMessages({ library(tidyverse) library(NanoStringQCPro) require(Biobase) }) # all RCC files should be in a single folder rcc_files <- dir(here("data/rcc_files"), full.names = TRUE) # RLF file is NanoString panel specific and is required to load RCC files RLF_FILE <- here("ref/Hawki...
e146ceb8f7a99b833c6be6a1e8e0d73fa2ad780e226a61633c5177aef377c430
R
3,554
94
setwd("/media/hansruedi/3b32f153-0651-4d56-b863-9b070ac7dd55/home/hansruedi/Brain_region_final") library(ggplot2) library(Seurat) pbmc <- readRDS(file = "In_raw_mscores_integrated2.rds") addition=read.table("Inh_Metadata_addition_cell_type_highres.txt",header=TRUE,row.names=1,sep="\t") pbmc=AddMetaData(pbmc,ad...
b89e88a67a6afdcf6fa90fa7e9b913ba906120a32d64039b1effc97e14ab3bfd
R
3,561
87
# helper functions for UI #' Round and format the mean, min, and max as a single character string #' @param x the numeric variable to summarize #' @param digits the number of digits to use in rounding #' @param prespace An integer indicating the number of spaces to include at the beginning of the string. Default: 0 #'...
078dad0efbafab71d8efc4469e644967470c83c71d5722b7bb724faa4cab7795
R
3,563
56
#################################################################################################### ### ### File: 06_coordinates_results_data.r ### Purpose: Loading the results data to obtain the statistics ### and get differences among the work. ### Authors: Gabriel Rodrigues Palma, Rafael Moral ### Date:...
2cfbccd5d32c028c061dd6809e342cdbfb73a7bf02c528eef75bc3c4cb812643
R
3,566
103
test_that("spm_l1_model enforces per-run vs concatenated confound expectations", { tmp_dir <- tempfile("spm_l1_expect_") dir.create(tmp_dir, recursive = TRUE) nifti1 <- file.path(tmp_dir, "run1.nii.gz") nifti2 <- file.path(tmp_dir, "run2.nii.gz") file.create(nifti1) file.create(nifti2) gpa <- create_mock...
6afb33d7e472e849fa85f4f36d4cf876b74e558ff39202bd691d6a58acc03a1e
R
3,572
106
stage <- c("40","70","115","168") tissue <- c("Br", "Li", "Mu", "Pl") POE <- read.csv("F:\\RNA_20221101\\02_ModifiedGenome\\C_POEgeneSelection\\result\\POE.list.csv", header = T, row.names = 1) library(customLayout) library(dplyr) ##Set canvas layout lay <- lay_new(matrix(c(1,2,3,4,5,6,7,8,9,10,11,0,12,13,1...
bd007aa61c4656a42f84e0713afaa8d13f3a4d5e032fb915dda6bb55abfc0c1e
R
3,572
178
rm(list=ls()) data_crtscp<-read.delim("/Users/cazaledl-admin/Library/CloudStorage/OneDrive-UniversityofBirmingham/Post_doc/XP/data/courtscape/.txt",h=T,sep="\t",na.strings = "NA") str(data_crtscp) attach(data_crtscp) ###### EXTRACTION DATAS ###### { ET <- subset(data_crtscp,threat=="ET") LT <- subse...
6f6b3d039322686d96f385bec2070538f99d08c9ec35f79b7bed38709197f03b
R
3,581
119
# Function ------------------------------------------------------------------- .Compare_hh <- function(e1, e2) { validObject(e1) validObject(e2) callGeneric(e1[[]], e2[[]]) } #' Comparison of `hyperSpec` objects #' #' @description #' The comparison operators `>`, `<`, `>=`, `<=`, `==`, and `!=` for `hyperSpec...
78db2ed47ff4f539ebbd9dd3c637a76445bbb8b095327a196d5772e37678cedc
R
3,581
116
#!/usr/bin/R # --------------------------------------------------------- # Script to load proportion data for plotting + composition # Updated 11/04/2021 # --------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(bindir, '...
12e9e4620d5e2614866b75f7de792a5fb7e59aa943672e01285c4c56ce431d79
R
3,588
117
library(here) suppressPackageStartupMessages({ library(tidyverse) library(Biobase) }) ESET_RDS <- here("results/eset_raw.rds") eset <- readRDS(ESET_RDS) fdata <- fData(eset) pdata <- pData(eset) edata <- exprs(eset) %>% as_tibble() row_names <- filter(fdata, CodeClass=="Endogenous")$Hgnc_Symbol # FUNCTIONS -------...
fd34d952df5b42b0a2ea515edeb3ec46c211adfde30699bf0e58ee1725587345
R
3,592
88
# This script creates a ped file with all families >3 into trios # to match desired input for de novo SV filtering # Define args and load libraries args = commandArgs(trailingOnly=TRUE) require(plyr) library(data.table) library(tidyverse) input_ped <- args[1] # Read input ped ped <- fread(input_ped,header = TRUE) #...
cf5d93bea2d7154a9c84f3672dffd0095ddf04629b501667ac177edf50d15ffe
R
3,603
109
library(dplyr) celltype_list = c("Exc","Inh","Ast","Oli","OPC","Mic") celltype_list2 = c("Ex01","Ex02","Ex03","Ex04","Ex06","Ex07","Ex08","Ex10","Ex13") region_list = c("AG","EC","HC","MT","PFC") for (i in 1:length(region_list)){ region=region_list[[i]] Marker_genes_list <- list() Marker_genes_list2 <- l...
6a5c913a584e4d1de00089491203ef0acd2b2d257d2a8559c257ae20d99b6f1d
R
3,605
109
library(dplyr) celltype_list = c("Exc","Inh","Ast","Oli","OPC","Mic") celltype_list2 = c("Ex01","Ex02","Ex03","Ex04","Ex06","Ex07","Ex08","Ex10","Ex13") region_list = c("AG","EC","HC","MT","PFC") for (i in 1:length(region_list)){ region=region_list[[i]] Marker_genes_list <- list() Marker_genes_list2 <- l...
1bdb11a3faad2e66f65b9270e5bac5d586bc3f9fd4e7a0f5aa2a3ca845956c3b
R
3,620
89
setwd("D:/Brain_region_project/Brain_region_final") library(ggplot2) library(Seurat) pbmc <- readRDS(file = "In_raw_mscores_integrated2.rds") addition=read.table("Inh_Metadata_addition_cell_type_highres.txt",header=TRUE,row.names=1,sep="\t") pbmc=AddMetaData(pbmc,addition) Idents(pbmc)<-"cell_type_high_resolu...
a9345d1231040581318ab1101fef9d8a8de6223870cddc2731d3738dd1c6defd
R
3,637
145
# For the specified k and cognitive variable, find the correlations with # the idiosyncrasy metrics and the corresponding uncorrected p-values. # Output: # olab,'.csv' Correlation, p-value, and p < 0.05 thresholded versions. #Set libraries. library(tidyverse) #Catches arguments. args = commandArgs(trailingOnly=T) k <...
8dab1fdb94ec2a2b5b8037cc8000cb0c2f1b02e94b18ce28cfef399a0af2ba99
R
3,639
93
library(tidyr) library(dplyr) library(purrr) exp_name = snakemake@params[['exp_name']] phenotype_suffix = snakemake@params[['phenotype_suffix']] linear_model_res_path = snakemake@params[['linear_model_res_path']] outlier_mode = snakemake@params[['outlier_mode']] extreme_quantile = as.numeric(snakemake@params[['extre...
26667d7526e09fb712b02db439e8415bbf38ce7cad0bfb1302fbabda751bd28f
R
3,645
114
#!/usr/bin/env Rscript # Helper script to titrate proband variants & de novo rate given a minimum GQ ###Set master parameters options(stringsAsFactors=F,scipen=1000) svtypes <- c("DEL","DUP","INS","INV","CPX","BND") ########################### ###GENERAL HELPER FUNCTIONS ########################### #Read & clean t...
e44df585918d0d27d9dc7e37a961b0fbd66aa0776bbfd6bd93c3f1c105675215
R
3,657
58
library(Seurat) library(dplyr) library(tidyverse) library(magrittr) library(liana) setwd("F:/Brain_region_project/Brain_region_final_12TB/Data_for_Connectome") pbmc=readRDS("HC_merge_major_cell_type.rds") Idents(pbmc)<-"cell_type_high_resolution" pbmc=subset(pbmc,idents=c("Ast DPP10","Ast GRM3","Ast DCLK1",...
17d9bde314fa1ad99b2bb165f0867605c2530a26e40ab538beb6d9a76cdc3809
R
3,667
99
## ---------- Script ----------------- ## ## Script name: ## ## Purpose of script: ## ## Author: Szi Kay Leung ## ## Email: S.K.Leung@exeter.ac.uk ## ## ---------- Notes ----------------- ## ## ## ## ## ## ---------- Source function and config files --------------- # Specific analysis related SC_ROOT <- "/gpfs/...
f651e89c40adc577694340e9899c0731dddd8464eb5b8a38a4759dea58a6124c
R
3,670
101
#' @importFrom checkmate assert_data_frame assert_string assert_file_exists assert_character #' @importFrom oro.nifti readNIfTI writeNIfTI #' @importFrom dplyr bind_rows filter select #' @importFrom doParallel registerDoParallel #' @importFrom parallel makeCluster stopCluster #' @importFrom iterators iter #' @importFro...
47cb18764b91e9ed18a1b344ff72b3405c0a4176687346024389031c7a01e0ef
R
3,676
86
rm(list=ls()) library(data.table) load("CPM_exp.RData") CPM_exp -> PDGC_CPM_exp ############################################################# step 0 mads <- apply(PDGC_CPM_exp,1,mad) ## calculate MAD value exp_by_mad <- PDGC_CPM_exp[rev(order(mads)),] ## sort MAD from high to low library(NMF) nmf(exp_by_mad[1:4500,...
ce6610df7687abb72eff4312b33c38b256f708757afc005119c453592f5a1428
R
3,677
146
# For the specified k and cognitive variable, find the correlations with # the frequency metrics and the corresponding uncorrected p-values. # Output: # olab,'.csv' Correlation, p-value, and p < 0.05 thresholded versions. #Set libraries. library(tidyverse) #Catches arguments. args = commandArgs(trailingOnly=T) k <- a...
5db0f7309ea85633c659b57936e65e5be19da9d75e91c8e348b8b911ee9b1432
R
3,678
90
# Doublet Finder registry source("Analysis/util.r") library(DoubletFinder) library(Seurat) library(ggplot2) library(magrittr) library(dplyr) library(data.table) x <- readRDS("Data/Processed/alphasyn-triplication-initial-integrated.rds") x$orig.ident <- factor(x$orig.ident, paste0('BU-SNCA-', 1:24)) x_list <- SplitObje...
098c672e7c462b20f5a4598587baa655246f5423d130ee5dc39794c0875c602e
R
3,691
78
library("tidyverse") library("gprofiler2") library("data.table") library("BiocParallel") # load the DEG datasets setwd("./Projects/SNCSynuclein") # load the DEG files DEGFileCombind <- readRDS("Step6.DEG/DEGs/DEGFileCombind.rds") Cluser <- names(DEGFileCombind) ## Filter and only show the significant pathways for (...
e3eceb25cccdf57b291ba05e6a3dfc4bdf214c57f872ed69dc4e910b2a62a241
R
3,694
146
# Function ------------------------------------------------------------------- .cov_h_ <- function(x, y, use, method) { validObject(x) cov(x@data$spc, use = use, method = method) } #' Covariance matrices for `hyperSpec` objects #' #' @rdname cov #' #' @param x `hyperSpec` object. #' @param y Not supported. #' @p...
86d2c4ba45095fa9a49364079867123c2b8743125087d5c40d289f4fda06513b
R
3,696
94
#analyze data #conda activate /mnt/analysis-psp/users/timchang/programs/miniconda/R3.6.3 #conda install r-ggforce rcolorbrewer .libPaths('/mnt/analysis-psp/users/timchang/programs/R/3.6.3/') library(ggforce);library(ggplot2);library(RColorBrewer) options(stringsAsFactors=F) geno_path='/mnt/analysis-psp/users/timchang/...
ec33ab99ebf8121590fae88ca8e6dfad9bf53cb54b62dd8a543b772b559d455d
R
3,697
125
#!/usr/bin/R # -------------------------------------------------------- # Gather tables for RELN validation, compare to RELN list: # Updated: 07/25/2022 # -------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidy...
efc383842de527979fc72f9f428e5075e2eb2e9600a2b1563e55d8b7f16bc057
R
3,697
131
#!/usr/bin/R # ----------------------------------------------- # Plot module genes on its top KEGG pathways: # TODO: pathview > SBGNview (updated w/ reactome) # Updated 12/21/2022 # ----------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(p...
f835f51ac7f57a1f09b3d594f8695fae74b7cfdffed1e68dd152e54c4698a2bf
R
3,700
120
ae_encoder <- nn_module( "Encoder", initialize = function(vae_dim, n_batch, n_covariate) { self$n_layers = length(vae_dim) self$layers <- nn_module_list() self$layers[[1]] <- nn_linear(vae_dim[1] + n_batch + n_covariate, vae_dim[2]) if (self$n_layers > 3) { for (i in 2:(self$n_layers - 1)...
db4ce473c490477bcfa298dd17936b117eb34c800c2cd57a871054f49c6514bf
R
3,702
87
#' @title Function to obtain LASSO estimates of a regression problem given summary statistics #' and a reference panel (without PLINK bfile) #' @details A function to find the minimum of \eqn{\beta} in #' \deqn{f(\beta)=\beta'R\beta - 2\beta'r + 2\lambda||\beta||_1} #' where #' \deqn{R=(1-s)X'X/n + sI} #' is a shru...
accd1f0924ddc3deb1cf3f9e15943ac67d29bcfa0be106e877280894e6c2c8f1
R
3,706
61
## ----------Script----------------- ## ## Purpose: Generate post-sqanti plots for summary of ONT targeted mouse transcriptome datasets ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ## ---------- Source function and config files ----------------- # source all general scripts related to long-read sequencing...
e0675418c940c8694cbef2e85a49371e860e35e26a4adf7e5975ee9fe0033acd
R
3,709
131
#' @name DEPRECATED-read.txt.Horiba #' @concept moved to hySpc.read.txt #' #' @title (DEPRECATED) #' Import Horiba Labspec exported ASCII files #' #' @description #' These data input functions are **deprecated** and they will be removed in #' the next release of \pkg{hyperspec} package. #' Now functions in packa...
7dc1123b5ba5068b813c7aaf357b4cdecb7e3151ce377d26167b142e61dfec47
R
3,716
94
library(dreamlet) library(muscat) library(zenith) library(scater) library(Seurat) library(dplyr) library(ggplot2) library(limma) library(purrr) library(readxl) setwd("/New12TB_HD1/F/PFC_429_final_Spring2021/Data/Data_Batches/DecontX_data/Grouped_by_cell_class") pbmc=readRDS("Inh_decontX.rds") #Add offic...
4235dc5c7c25ea498de240bd1d1482892954f313f2b807a087f735321f053612
R
3,730
130
#!/usr/bin/R # ------------------------------------------------------------- # Replot the modules representations for extended data figures: # Updated 03/18/2022 to standardize sizes # ------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta...
75fdbd87fe892721aa43862bdc9d6abd99349b55acc3fccdc01be26c829ded66
R
3,738
124
### models the A+T- to (A+)T+ conversion ### # run analysis_clean.R before! ############################################ print_figures <- F sensitivity <- F ##extract participants with A+T- profile tmp <- unique(subset(longATN, ATN=="A+T-")$RID) longApTm <- subset(longATN, is.element(RID, tmp)) #build data for survi...
8af0614c3de045279f3e45c9ad890d1f12322ce92e4929df997948a7fa76b1bb
R
3,746
100
# Modified function from SeqNet package: plot_network_diff <- function (network_1, network_2, as_subgraph = TRUE, node_color = adjustcolor("orange", 0.5), node_scale = 5, node_weights = NULL, edge_weights = NULL, edge_scale = 1, coords = NULL, main = "Untitled", include_vertex_labels = F...
2940096ed0dc8ffd0c0dbdcbeb2ed07dfd8a9752657746d839c8fd51764bab1d
R
3,751
126
#!/usr/bin/R # ------------------------------------------ # Print the GWAS genes in the modules / DEGs # Updated 12/16/2021 # ------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } source(paste0(sbindir, ...
b960658576db23e6221fedeab5ccfc6dd929c287b39532b15e70c6f172df1e3a
R
3,751
62
library(Seurat) library(dplyr) library(tidyverse) library(magrittr) library(liana) setwd("F:/Brain_region_project/Brain_region_final_12TB/Data_for_Connectome") pbmc=readRDS("EC_merge_major_cell_type.rds") Idents(pbmc)<-"cell_type_high_resolution" pbmc=subset(pbmc,idents=c("Ast DPP10","Ast GRM3","Ast DCLK1",...
fd99a97a33dcc6596cb644ff477328ecb98f9cbf48deebe6069f5fa9cb5eda04
R
3,756
91
##the result of tissue-specific gene expression and chromatin accessibility intensity are visualized with heat maps to see if the same cluster can be found ## setwd("F:\\Manuscript\\ATAC\\figure\\ori_RNA_ATAC_heatmap") library(dplyr) GeneOpen <- read.csv("TisSpeGeneGroupbyPeakintensity_tisMean_promoter.CSV", ...
1123136f4d13e7d6cdb98f64ec70dccea2b5695b1bd037b59fca5f03ce8fb9bd
R
3,757
91
library(dplyr) library(Seurat) library(ggplot2) options(java.parameters = "-Xmx16000m") library("xlsx") library(svDialogs) ref<- read.xlsx(file="Zebrafish_SC_Cell type marker_database_081022_v4.xlsx", sheetName = "zebrafish_genes") #getting total number of markers available in the dataset for each celltype ...
0c5ae80d58ea6bb3e7d8a6943b6662b4233ca025f92e6433de6bbcd7da75641e
R
3,759
83
library(coloc) library(dplyr) library(pbapply) library(data.table) library(liftOver) library(GenomicRanges) #system("wget -P . https://ctg.cncr.nl/documents/p1651/PGCALZ2ExcludingUKBand23andME_METALInverseVariance_MetaAnalysis.txt.gz") AD_dat <-fread(input = "PGCALZ2ExcludingUKBand23andME_METALInverseVariance_MetaAn...
5f6f96d7456f575192f1034e6be88ef4421ee4893c5deb22b0330a727795671a
R
3,760
102
# input: # data/04_DS1.ssce.Rdata # # output: # data/07_DS1_pseudot_umap.Rdata: pseudotime assignment options(bitmapType = 'cairo') library(SingleCellExperiment) library(igraph) library(scater) library(slingshot) bsave <- TRUE # (1) Loading data ---- (load("data/04_DS1.ssce.Rdata")) #OJO con NB1/NB2/GCimm1 sce <...
69cd0672b7328db85d07def26bf3a1af258331098759b38414c269d2c4a6d0b5
R
3,760
133
#!/usr/bin/R # ------------------------------------------ # Plot results for Nebula on e4 interaction: # - Used for Oli-M7 + Opc-M9 test # Updated: 06/27/23 # ------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) library...
7ba8de575855765c466cd30300314af481ec218201195fa24c97ead53ee211c5
R
3,778
158
library(testthat) library(dplyr) library(sccomp) library(rlang) test_that("warnings when symbols are provided for key columns", { skip_cmdstan() # Create test data test_data <- tibble( donor = rep(c("sample1", "sample2", "sample3"), each = 3), cell_group = rep(c("A", "B", "C"), times = 3), coun...
a7308eef37ce3fd144e655a69ba98133552fbf2a55070d2990d9e05213dc171c
R
3,780
117
# genPresynCSVsFlyWire.r # # Script that generates CSV files of presynaptic neurons given starting FlyWire ID # Will return 2 layers of inputs: direct and their inputs # Writes CSV files, named by current FlyWire ID, into specified directory # Set threshold of minimum number of synapses # make sure fafbseg library...
e766c71a88793e6121ed48da8343ac3d6beebaf5c77312fb3c36a3ed9a4c0715
R
3,780
111
#!/usr/bin/R # ------------------------------------------------------------------------- # Determine consistent up / down patterns for each covariate # Determine unique subtypes of DEGs for each pathology / AD measurement # Plot coeff. + clusters of these DEGs across EC neurons # Updated: 12/06/2021 # -----------------...
9e8bc13b132af2bc6907157fcec1ddf9565fba9fa2887a721bb8bea1e26ba6ed
R
3,781
89
## ---------- Script ----------------- ## ## Purpose: perform differential analysis on mouse rTg4510 ONT and Iso-Seq targeted datasets using linear regression ## Transcript level separate analysis ## Gene level separate analysis ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) # https://hbctraining.github.io/DGE_wo...
23f9e18980fc1e463e061a88169bd83a745175ddb390f412b6eca263fea005ae
R
3,782
53
library(spacexr) library(spASE) library(Matrix) myrctd <- readRDS('results/rctd_hippo_1.rds') writeMM(myrctd@originalSpatialRNA@maternalCounts, 'hippo_1_slideseq_CAST.mtx') writeMM(myrctd@originalSpatialRNA@paternalCounts, 'hippo_1_slideseq_129.mtx') write.table(data.frame(gene_id = seq(1,nrow(myrctd@originalSpatialRN...
61f94d554a796f6ec7e46bff0a6cc7bb168da5906181b0061b6ac65c00403761
R
3,782
114
library(tidyverse) library(tidyseurat) library(sccomp) library(job) library(patchwork) prior_overdispersion_mean_association = list(intercept = c(5, 5), slope = c(0, 5), standard_deviation = c(5,5)) job({ load("data/counts_obj.rda") counts_obj |> mutate(is_benign = type=="benign") |> rename(cell_t...
a73f8e826b0af8fb195204f84b11961f766625695dee0268ea3ce4bbc3562b40
R
3,782
71
test_that("get analyser object", { ana = get("Auc_Analyser")$new() expect_equal(ana$ana_name, "AUC") expect_equal(length(ana$plots), 0) }) test_that("two keywords, two stimuli, paired data", { yaml = get_testyaml_object("dir", analyser = "Auc", changes = "DataSettings$PairedData = TRUE") ana = get_analyser_o...
fe47f78a9a67cbba56ae614496a938e5f7101c59c14d78121929f44d1dc150f8
R
3,783
107
#!/usr/bin/R # ----------------------------------------------------------- # Aggregate and plot chunked runs of MAST + RE for DGE # Plot the comparison between regressions on different pathologies. # Updated: 02/11/2021 # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') s...
d67a0eae4e035b1c88973f8fa5004320bfb3c1954f868d7398ae7c6f321b175b
R
3,786
134
# Set generic ---------------------------------------------------------------- #' @importFrom lattice latticeParseFormula setGeneric("levelplot", package = "lattice") ### --------------------------------------------------------------------------~ ### levelplot.R - everything that has to do with levelplot-like plotti...
94b0b4058bf875ba030035d7ea31733345ce756388e2289c2444542b1cb2b354
R
3,791
119
# For the specified k, find the correlations between reconfiguration variables # and plot. # Output: # predcorr.csv Correlations between reconfiguration variables. # predcorr_round.csv Correlations between reconfiguration variables, rounded. # predcorr.jpg Correlations between reconfiguration variables, visualized. #S...
90ee5ec470dd1b53f2ef6eec65d1145d8a901e467a9c0c51d9c0a45d0557ef62
R
3,794
122
#!/usr/bin/R # ------------------------------------------------------ # Compare OPC fraction to OPC genes at pseudobulk level: # Updated 02/17/2021 # ------------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) libr...
e0befd48076ba7dfc32dae9cf64eebcbb184becd7809467ca23c1b6e127611b3
R
3,799
134
#!/usr/bin/R # --------------------------------------- # Quantify the cross-module correlations: # Updated 04/02/2022 # --------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } library(tidyr) library(ggpubr) l...
88d90051fb549866e298075eb381f0f17014012676363e80eaead42d7efe5884
R
3,801
147
#### Setup options and resources #### ## ---------------------------------- CardinalResources <- list2env(list(logger=simple_logger())) CardinalNamespace <- environment(NULL) CardinalEnv <- function() CardinalNamespace # set up Cardinal defaults .onLoad <- function(libname, pkgname) { setCardinalBPPARAM() setCar...
b99933a31557d5d8c317c58a742947a24d1b50a85e24570e3072f5f9337d265f
R
3,801
104
##fixing plotting of Schoenfeld residuals #instructions here: https://stats.stackexchange.com/questions/560975/how-to-interpret-schoenfield-residual-plot # ggcoxzph_fixed <- function (fit, resid = TRUE, se = TRUE, df = 4, nsmo = 40, var, point.col = "red", point.size = 1, point.shape = 19, point.alpha = 1, cap...
de4b8153024a499e68d954ed20e3ae640e13a7f634cadaf64b968d5c2dd913db
R
3,803
110
library("tidyverse") library("batchtools") library("Seurat") library("data.table") library("future") library("MAST") library("SingleCellExperiment") ## use the bath tools for RNA contamination detection and doublet removal setwd("./Step5.FinalClustering") # load the seurat object reg <- makeExperimentRegistry("FindMa...
89a2d502029d8a5f4109fd64395c2006de17d825974e00d1ac9e3cff39af245f
R
3,808
154
#' Sequence generation along spectra or wavelengths #' #' This function generates sequences along the spectra (rows) or wavelengths of #' `hyperSpec` objects. #' #' Note that [wl2i()] generates sequences of indices along the wavelength axis. #' #' [seq()] had to be implemented as S3 method as the generic has only \dot...
287e4e786e7075727a9d5a46721b16e526b98c548be669ae62f147b9de714b4a
R
3,811
67
#' archstabms__plot_growthrate_violins #' #' Plot growth rate violins. #' #' @param input_dt data.table with fitness estimates (required) #' @param report_outpath output path for scatterplots (required) #' @param dataset_name dataset name and suffix for output files (required) #' @param trait trait name and suffix for...
a33c8a6ca85be3e6be392254f5eef019b207ade20c2c715d7bfa8bafa8a08781
R
3,811
145
#### Summarize features #### ## -------------------------- summarizeFeatures <- function(x, stat = "mean", groups = NULL, verbose = getCardinalVerbose(), chunkopts = list(), BPPARAM = getCardinalBPPARAM(), ...) { if ( "FUN" %in% ...names() ) { .Deprecated(old="FUN", new="stat") stat <- list(...)$FUN } if ( !...
86b75d08d459e7e16cb0bc7d898b71e5653bb639b75399f6b3e539da86d9c6d3
R
3,813
97
#' Create enhanced Volcano plot from Seurat DE #' #' @param seurat_object integrated Seurat object. Containing ref_ident and vs_ident in Idents(seurat_object) #' @param seurat_DE Seurat DE result, from a FindMarkers() function #' @param ref_ident reference sample name, pct.1 in Seurat DE result #' @param vs_ident versu...
f2f856a7119f1ea93698d7a54319a25a99df575ce03779243323bdaa2b2e7629
R
3,814
94
#!/usr/bin/R # ------------------------------------------ # Load metadata for the multiregion project: # ------------------------------------------ library(cbrbase) library(RColorBrewer) library(tidyr) set_proj('DEVTRAJ') # Arguments: args = commandArgs() if (length(args) > 0){ project = args[1] } else { proj...
c0ec54aed09e49482a4b7de47be43d33682435178242a0715cceca4656235754
R
3,817
115
adni_ct_dataset <- dataset( name = "adni_ct_dataset", initialize = function(input_list, data_type = c("train", "test", "all"), insert_new_batch = FALSE, new_batch = NULL) { self$insert_new_batch = insert_new_batch if (!data_type %...
23d868fd7298a8a8c64acd307715ecdf1b9e2e8513616171de77b256474c7839
R
3,820
129
#!/usr/bin/R # ----------------------------------------------- # Auxiliary functions for contour plots on UMAPs. # Updated 01/23/2023 # ----------------------------------------------- library(cbrbase) library(tidyr) library(soundgen) options(width=170) source(paste0(sbindir, 'auxiliary_plotting_settings.R')) # Calc...
bcd4da85891ffcbe23cb87402c96e428148dd29d3a0797e2aaa78a012d8d3ad1
R
3,824
103
# ******** # 2c-reint-markers.r # Code for computing marker genes for initial integration results. source('Analysis/util.r') library(Seurat) library(presto) library(data.table) library(magrittr) library(dplyr) library(ggplot2) library(MAST) # Compute marker genes for the initial integration (SCT.seurat_snn_res.0.1 clu...
d2833a2f1354586698cea67d49ebce2ce5276fe22bdbd59f1a5eaf7e7dbe4fe7
R
3,824
116
# Read in the cds holding all cells source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") library(monocle3) # print(modStatus) library("optparse") library(dplyr) library(ggplot2) library(RColorBrewer) monocle_theme_opts <- function() { theme(strip.back...
c0d4faf2f443949ed8fa1578e23c340733f9448396fdae29323900cb9ac23994
R
3,828
117
scheduler_safe_token <- function(x, fallback = "job", max_chars = 120L) { if (is.null(x) || length(x) == 0L || is.na(x[1L]) || !nzchar(x[1L])) { x <- fallback } x <- as.character(x[1L]) x <- gsub("[^A-Za-z0-9_.-]+", "_", x) x <- gsub("_+", "_", x) x <- gsub("^_+|_+$", "", x) if (!nzchar(x)) x <- fallb...
0d7f039608be6aff9a67022c5fbca6f48cb54a04b930336f976842c6d8d7abf4
R
3,832
61
library(Seurat) library(dplyr) library(tidyverse) library(magrittr) library(liana) setwd("F:/Brain_region_project/Brain_region_final_12TB/Data_for_Connectome") pbmc=readRDS("MT_merge_major_cell_type.rds") Idents(pbmc)<-"cell_type_high_resolution" pbmc=subset(pbmc,idents=c("Ast DPP10","Ast GRM3","Exc L2-3 CB...
80265fe113e03f3e3bdbd408027b4e109bce24b1eac45f3bf26ccc94a1af6728
R
3,834
153
# For the specified k and cognitive variable, find the correlations with # the transition distance metrics and the corresponding uncorrected p-values. # Output: # olab,'.csv' Correlation, p-value, and p < 0.05 thresholded versions. #Set libraries. library(tidyverse) #Catches arguments. args = commandArgs(trailingOnly...
6102d9f84ae3cd5c9a944e4128ed4d7c3272d1fd152343120fb741ffc9b5b7bb
R
3,835
127
--- title: "Using PMLB Python interface" --- ```{r message=FALSE} message("Current working directory: ", getwd()) message("Contents of working directory: ", paste(dir(getwd()), collapse = ", ")) ``` ```{r setup, include=FALSE} library(reticulate) knitr::knit_engines$set(python = reticulate::eng_python) knitr::opts_...
60e759fba60b26a7dd400beed92a41960f6de9419ca21247670c73e54c22ff30
R
3,839
140
library(testthat) test_that("get_l1_confounds fails clearly when requested confound columns are missing", { tdir <- tempfile("confound_validation_") dir.create(tdir, recursive = TRUE) sqlite_db <- file.path(tdir, "cache.sqlite") run_nifti <- file.path(tdir, "run.nii.gz") confounds_tsv <- file.path(tdir, "co...
1964df06f0f1d6398195ec57a311f99260711a21c27ea13dd419b095555e3cfe
R
3,842
64
library(Seurat) library(dplyr) library(tidyverse) library(magrittr) library(liana) setwd("F:/Brain_region_project/Brain_region_final_12TB/Data_for_Connectome") pbmc=readRDS("AG_merge_major_cell_type.rds") Idents(pbmc)<-"cell_type_high_resolution" pbmc=subset(pbmc,idents=c("Ast DPP10","Ast GRM3","Ast DCLK1",...
e6ebc9aadcf95db5fc71e473b84884e20c545837ad774b3a1ea077f4fed53579
R
3,843
108
#!/usr/bin/R # ------------------------------ # Estimate depletion quantities: # Updated: 12/06/2021 # ------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) library(viridis) library(ggplot2) library(ggrepel) library(ggpubr) library(...
227992d4a691c6d14a241e08aa51e725294c2cb5561c754fb301ad2997d96cd7
R
3,845
61
library(Seurat) library(dplyr) library(tidyverse) library(magrittr) library(liana) setwd("F:/Brain_region_project/Brain_region_final_12TB/Data_for_Connectome") pbmc=readRDS("PFC_merge_major_cell_type.rds") Idents(pbmc)<-"cell_type_high_resolution" pbmc=subset(pbmc,idents=c("Ast DPP10","Ast GRM3","Ast DCLK1"...
7cc3a353fc483028dd0d0cc56b6abc286fa4b4c8741fcc6e6fa117f44032c015
R
3,854
116
#!/usr/bin/R # ------------------------------------------------------------------------ # Plot the base region proportions figures for the atlas part of the paper # Updated 11/04/2021 # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir...
954417fe58d993c6361bba76fd065004dd5a77bf22ef868a6c11162561cde6da
R
3,861
104
#' archstabms__plot_additive_trait_binding #' #' Plot folding additive trait. #' #' @param mochi_outpath path to MoCHI thermo model fit results (required) #' @param input_dt data.table with model free energy estimates (required) #' @param RT constant (default:0.001987*(273+24)) #' @param report_outpath output path for...
e551bd2f6405cc403a4668284c63a7f94e97b65d021eb21253151ef3fbe14025
R
3,868
117
--- title: "Python interface" output: html_document: toc: true toc_depth: 3 toc_float: collapsed: false css: custom.css --- ```{r message=FALSE} message("Current working directory: ", getwd()) message("Contents of working directory: ", paste(dir(getwd()), collapse = ", ")) ``` ```{r setup, inc...
e6c70b73846dad68bcc0e78dc5bc41a4a828f3acbf2f790b58baad391a37ab37
R
3,868
139
#!/usr/bin/R # ------------------------------------------------------ # Compare our microglia definitions to Tuddenham markers # Updated 11/17/2023 # ------------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) libr...
68238bd55ef5d59b12b64774a82716c24be73447a5e7b29b33f2b2511e3a164c
R
3,879
106
library("batchtools") ## use the bath tools for RNA contamination detection and doublet removal setwd("./Step8a.SubClusterAnalysis") reg <- makeExperimentRegistry("Reclustering.Registry", conf.file = "./Projects/snRNAseq/Step12.SubclusterAnalysis/batchtools.conf.R", ...
39287855f1664b4c1d4d04a08877a833319a9ada389bba02bd11c997494dee58
R
3,881
115
#!/usr/bin/R # ---------------------------------------------------------- # Score all samples (psbulk) based on shared degs (01e) # Updated: 01/09/23 # -------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) ...
cc44338ab98a717928877ec369c7ecd7c518d9baea5960402ac85d33a474071d
R
3,883
90
setwd("F:\\RNA_20221101\\02_ModifiedGenome\\C_POEgeneSelection\\figures_tables\\03_POE基因热图展示") library(dplyr) library(edgeR) library(ggplot2) library(stringr) library(magrittr) library(pheatmap) ### generate the bias score matrix grouping by stage data_filter <- read.csv("F:\\RNA_20221101\\02_ModifiedGenome\\A_...
36df9daeaa4d2c009c38d6b70275b20877c4df5faefeb31e73f65fb8fb3a1cea
R
3,890
122
# genPostsynCSVsFANC.r # # Script that generates CSV files of postsynaptic neurons given starting FANC ID # Will return 3 layers of targets: direct, their targets, and their targets # Writes CSV files, named by current FANC ID, into specified directory # Set threshold of minimum number of synapses # make sure fanc...
053bab49c33692ceb852f2e7cfd3591bfaca9f0a8272bad71eec6f4ff165a60d
R
3,892
67
library(Seurat) library(dplyr) library(tidyverse) library(magrittr) library(liana) setwd("F:/Brain_region_project/Brain_region_final_12TB/Data_for_Connectome") pbmc=readRDS("HC_merge_major_cell_type.rds") Idents(pbmc)<-"cell_type_high_resolution" pbmc=subset(pbmc,idents=c("Ast DPP10","Ast GRM3","Ast DCLK1",...
ee1f6f9c6a26f4ea854e0608be0f56eea1f8ca994ab9bbadb5a96790f7729036
R
3,900
69
library(data.table) library(dplyr) library(coloc) library(foreach) library(doParallel) coloc_abf <- function(i){ Phe1_coloc_dat <- Phe1_dat %>% filter(Phenotype == coloc_pairs[i,exposure]) Phe2_coloc_dat <- Phe2_dat %>% filter(Phenotype == coloc_pairs[i,outcome]) coloc_dat <- inner_join(Phe1_coloc_dat, Phe2_colo...
ff52e050166c54977da8684273aaaf909268e71712f132be664ecd7355512259
R
3,905
120
#!/usr/bin/R # ------------------------------------------------------------------------- # Plot pseudobulk matrices vs. DE genes from subtypes in entorhinal cortex: # Updated: 12/06/2021 # ------------------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') sourc...
17d177eb30313db3fac2f30a9bb710282258ba6a41388f7551aa47206ed48162
R
3,910
90
# ******** # 3-pseudode.r # Code for running pseudobulk DEG analysis. # In addition, we filter DEG's with the results of 3-de.r, MAST model DEG results. source("Analysis/util.r") library(scuttle) library(edgeR) library(Seurat) library(dplyr) library(magrittr) library(ggplot2) #x <- load_integrated() DefaultAssay(x) <-...
c7eace38fcb291fe1030668751eb05e8a08752b77643816a362165d0f51aeae1
R
3,920
98
### Ref links # http://tuxette.nathalievilla.org/?p=1696 # https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/ ## ----------------------------------------------------------------------------- # get the input passed from the shell script. args <- commandArgs(TRUE) ## -----------------------------...