sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
44ee3356d938d1889cc81997f2b16ff1af9f44495f04130584496ae5ffbdff2f
R
2,920
65
#### load packages #### targetPackages <- c('tidyverse','gtools','arrow') newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])] if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org") for(package in targetPackages) library(package, character.only = ...
eb1e1f3d3f95c94802a4b269fae65dfc7fa5a8fe3ed38ba8b4321240c685feec
R
2,921
112
######read files suppressPackageStartupMessages({ library(MatrixGenerics) library(Seurat) library(dplyr) library(SingleCellExperiment) library(aricode) library(mclust) library(scater) }) ################################ Drop out #################################### #drop out function dropout_sampling <...
246d6cda4ece85bbcedf91a8325c6f1dae633fe530266aa7e2bb977ebae43c67
R
2,951
63
library(Seurat) library(tidyverse) library(parallel) library(magrittr) library(ggtree) library(ape) library(patchwork) library(scrattch.hicat) setwd("~/cortex/SnRNA/3_mergingDatasets//") seu <- qs::qread("~/cortex/SnRNA/3_mergingDatasets/SnRNA_seurat.qs") # seu <- qs::qread("~/cortex/SnRNA/1_SnRNA_preprocessing/SnRNA...
33257639c2415bfcba6ec342a5bbfe1912d5e1d96b41e5bf918f6ecf69361e90
R
2,955
101
--- title: Data Processing Flow Charts output: rmarkdown::html_vignette: toc_float: true vignette: > %\VignetteIndexEntry{Data Processing Flow Charts} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} Sys.setenv(LANGUAGE = "en") library("sbcdata") sb...
e6b75a582d910371efa25584a1ece677243598664821dc0d26bbceceebf96351
R
2,958
94
library(SingleCellExperiment) library(scDHA) library(aricode) args<-commandArgs(TRUE) print(args) csv_root_path = args[1] dataset_name = args[2] save_path = args[3] print(dataset_name) #print(save_path) # csv_root_path = "/home/yanhan/cjy/Single-Cell-Dataset/raw_rds/" csv_count_path = paste(csv_root_path, dataset_nam...
67e2382ef4d9923cc398f35c445144d19f36f52279a7ce825ce6844d5d1e1976
R
2,968
65
library(tidyverse) library(Seurat) library(pvclust) library(ggtree) library(magrittr) library(dendextend) library(patchwork) setwd("~/cortex/fig1/") subclass_color <-c(AST = "#665C47", ENDO = "#604B47", ET = "#CEC823", CHANDELIER = "#E25691", `L2-L3 IT LINC00507` = "#07D8D8", `L3-L4 IT RORB` = "#09...
d437899cc72fa241d00b77773f5bf2fa6b289fa6ff2aa5e9507babe6d9af88ec
R
2,975
109
# Suppress R CMD check notes about NSE variables utils::globalVariables(c( "annoy.metric", "bind.feature", "bp_add", "bp_cum", "dx", "dy", "gene", "label", "max_bp", "med", "name", "nn.method", "padj", "pos", "qval", "strand", "type", "x", "xmax", "xmin", "y", "ymax", "ymin" )) # codes edited from tidyverse/R/...
ca747a0b24584e50ec53cb07dda642be3a85304a7e827e5e5b8352995303be5c
R
3,000
82
# heatmaps library(colorspace) library(ggpattern) # TODO, concatenate the data in the pipeline data = data.frame() i <- 0 for (experiment in c("ERN", "LRP", "MMN", "N170", "N2pc", "N400", "P3")){ i <- i + 1 tmp <- tar_read(eegnet_HLM_exp_emm_means, branches=i)[[1]] # normalize to zero for each experiment to have...
e58a8249a991b59826fbe247eaa43692584d3fa6ff76715fcd06eb33e5d6ae12
R
3,014
113
dnorm.mix = function(x,alpha,xi,tau,p){ n = length(p) nu = c(0:(n-1)) mu = (1-alpha)*nu/2 + alpha + xi sdt = sqrt(tau) z = sapply(1:n,FUN=function(i){return(p[i]*dnorm(x,mean=mu[i],sd=sdt[i]))}) return(sum(z)) } alpha = 0.322357 xi = -0.226514 tau = c(0.00515209,0.0135272,0.0107974,0.00887801,0.0121268,0.00...
6f87d3d9ce157c50ac989b9e340df02a3768ca2e46f2a18f0faabd3b918b48e9
R
3,023
121
library(purrr) library(magrittr) library(tidyverse) library(Seurat) library(harmony) library(ape) library(uwot) library(ggtree) library(treeio) library(ggtree) library(treeio) # library(future) setwd("~/cortex/SnRNA/3_mergingDatasets/") qsFiles <- list.files(".", "merge.qs", full.names = T) x = qsFiles[[1]] datasets ...
ed84efacab013d8e00c4c9bd150ae4aafac3ea74efc5d3008725a5cf24f3a76a
R
3,062
95
# R code to generate Fig3 fig suppl3 of the Platynereis connectome paper # Gaspar Jekely 2023 # load natverse and other packages, some custom natverse functions and catmaid connectivity info source("code/libraries_functions_and_CATMAID_conn.R") # define a list of anatomical annotations to search for annot_to_search <...
8a74b2d20b8775e93ae679c86608ebd9e0429ca72d0595d6b912ab95738c6f57
R
3,069
117
--- title: "st_overlay" output: html_notebook --- Written by Aunoy Poddar May 23rd, 2022 # Process the puncta quantified raw data ```{r eval=FALSE} current_file <- rstudioapi::getActiveDocumentContext()$path output_file <- stringr::str_replace(current_file, '.Rmd', '.R') knitr::purl(current_file, output = output_file...
bba789a5ac853575b941b0ba4b41766dc56cefa0bdca43c5a81599f71f12d255
R
3,076
84
library(DESeq2) library(ggplot2) library(viridis) library(magrittr) library(pheatmap) library(DescTools) library(pdfCluster) library(RColorBrewer) library(SummarizedExperiment) start_time <- Sys.time() OUT_DIR <- "/home/burkhart/Software/reticula/data/aim1/output/" kmeans_maj_vote <- function(expr_matrix,k){ km_...
9ad4da0a851cc5997712f2a20ad93c888981be9d7df966c60dae43bd2606f1c3
R
3,077
63
## Co-Binding according to scenicplus network ## library(ggplot2) library(Seurat) library(UpSetR) library(igraph) library(rcartocolor) library(ggvenn) ## load data: eRegulon_md <- read.table("Processed_Objects/eRegulon_metadata_filtered.tsv", h = T, sep = "\t") cfse_seurat <- readRDS("Processed_Objects/CFSE_sub.rds")...
22c831d88fc8f477f4c82eb5b3581e4904705a3047ae2cca9d135350fe76492a
R
3,090
81
## NFIB CUT&RUN ## ## heatmaps created using "fluff-heatmap" library: ################################################## ## Figure 3c: #fluff heatmap -f peakCalling/MACS_set2/NFIB_R1R2_pvalue_peaks.narrowPeak -d $project/NFIB_R1R2.bw $project/H3K4me3_R1R2.bw $project2/filtered_E12_sort.bw $project2/filtered_E16_sort...
33c9aa5730c143445f7c6a017b86221387a4199693525d30064b4b54968c2952
R
3,096
98
library(catmaid) library(tidyverse) source("~/R/conn.R") labels <- catmaid_get_label_stats(pid = pid) gold <- labels %>% filter(str_detect(labelName, "gold")) %>% select(labelName, skeletonID) neuropeptides <- c("ATO", "FMRFa", "FVa", "FVRIa", "leucokinin", "luqin", "MIP", "PDF", "proenkephalin", "RGWa", "RYa"...
32138472225b054c7d95b887e6e58d0bb255b8fdcafa807febc5aae37b180965
R
3,113
82
# READ IN DATA: ---------------------------------------------------------------- # Load CSV file of DESeq2 results, ordered by padj and containing gene symbol and entrez id's. res_df <- read.csv(csv_deseq2_results) # MAKE VOLCANO PLOT WITH SPECIFIC GENES LABELED: ------------------------------- # filter the deseq2 res...
5945d7762b922bdb37531a83eb1ba1cec0f341ce367b21ee09a0eb06dd0ca57a
R
3,134
72
suppressMessages(library(Seurat)) suppressMessages(library(dplyr)) suppressMessages(library(tidyr)) suppressMessages(library(caTools)) suppressMessages(library(ROGUE)) suppressMessages(library(colorRamps)) suppressMessages(library(tidyverse)) #-------------------------------------------------------------- # Load own m...
9fbff47ac45055571705dd60926a9476c0bee712a37ab85ec3216e01fbb080f8
R
3,134
85
# READ IN DATA: ---------------------------------------------------------------- # Load CSV file of DESeq2 results, ordered by padj and containing gene symbol # and entrez id's. res_df <- read.csv(csv_deseq2_results) # MAKE VOLCANO PLOT WITH SPECIFIC GENES LABELED: ------------------------------- # filter the deseq2...
8ad55450d1e0c057264971790d2d68955f7181725ac8103caecd2e4e43822375
R
3,135
85
# READ IN DATA: ---------------------------------------------------------------- # Load CSV file of DESeq2 results, ordered by padj and containing gene symbol # and entrez id's. res_df <- read.csv(csv_deseq2_results) # MAKE VOLCANO PLOT WITH SPECIFIC GENES LABELED: ------------------------------- # filter the deseq2...
abc31e47178567fe4958edc74204dd2e8546a293794a853f2586f62dfaaa3fdf
R
3,151
136
######read files suppressPackageStartupMessages({ library(SC3) library(SingleCellExperiment) library(scater) library(aricode) }) ########### #FACS data# ########### #dataset <- 'Bladder' #countspath <- paste0('~/R Scripts/rna_clustering/dataset/',dataset,'_counts.csv') #labelspath <- paste0('~/R Scripts/rna_c...
00c250e62d676a6cb74a720b5fd2386f7badd6df223795d5497df4945881159e
R
3,154
122
require(rphast) require(ape) require(dplyr) require(parallel) require(Biostrings) require(ggpubr) require(seqinr) require(phangorn) require(msa) require(readr) require(VennDiagram) source('SCRIPTS/Functions.R') args = commandArgs(trailingOnly = TRUE) for (arg in args) { split_arg <- strsplit(arg, "...
8680e85a11d769b7e93d500c11d07827e90a920d823782076eb4fa27d0e76b06
R
3,170
83
library(DESeq2) combined.df <- readRDS("~/combined_df.Rds") tissue.vec <- readRDS("~/tissue_vec.Rds") datasource.vec <- readRDS("~/datasource_vec.Rds") study.vec <- readRDS("~/study_vec.Rds") #minimum shrinkage, leaving max() == integer max scale.factor <- (.Machine$integer.max - 1) / max(combined.df) combined.scaled...
903271095e17a454504543e864b0e88d423b3f278c7318af2d8987d0c3389ce0
R
3,170
94
--- title: "Simple FLIC Output" author: "Kayla Audette" date: "2023-11-06" output: html_document --- ### 1. R Environment - **Setting Up Environment:** - The first chunk configures the presentation options for the R code. - It hides the code and result outputs, such as messages and warnings. - The workspace is ...
7fe6e53d3b6c61625fcf451467923b8fdd0b183f1e7b70c265e3036fec3d902d
R
3,174
78
## GRN description ## library(ChIPseeker) library(TxDb.Mmusculus.UCSC.mm10.knownGene) txdb <- TxDb.Mmusculus.UCSC.mm10.knownGene library(clusterProfiler) library(EnsDb.Mmusculus.v79) edb <- EnsDb.Mmusculus.v79 seqlevelsStyle(edb) <- "UCSC" library(ggvenn) ## SF10 b-d eRegulon_md <- read.table("Processed_Objects/eRegu...
63f294d3e1eac87db134853c2665c7c2069e9520e98c060ee110d172bfed719d
R
3,179
93
## use the data from Mitchell et al. and generate pseudo-bulks library(ggplot2) library(ggpubr) library(phangorn) library(RRphylo) folders <- list.files("./Published_data/Mitchell_et_al/", pattern = "00") folders <- setdiff(folders, "KX007") # no data available snvs <- list() for(i in folders){ mut.file <- li...
ff2a8aaa899033c7a76f28869862940c76b305d2fa96d60e4d7d0cdb46bf88c8
R
3,183
98
library(magrittr) TCGA_OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/tcga/output/" TCGA_IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/tcga/input/" X <- readRDS(paste(TCGA_OUT_DIR, "zsl_tcga_rxn_pca_nls.Rds", sep = "")) Y <- readRDS(paste(TCGA_OUT_DIR,"zsl_tcga_tissue_vec_train.Rds",sep="")) tissue_a...
2f4b5686ec7298495531804ea3b734f93718db210d702d15554fd5bf0a3d3eca
R
3,189
87
# READ DDS OBJECT FOLLOWING DESEQ2 ANALYSIS FROM RDS FILE: --------------------- dds <- readRDS(rds_deseq2_results) # Store results in res res <- results(dds) # ANNOTATE DESEQ2 RESULTS WITH GENE SYMBOLS AND ENTREZ IDS: -------------------- ensembl_ids <- rownames(res) # annotate with gene symobols using org.Mm.eg.db ...
9d08af9c95e84c6503d117770e83cc94c559c76dfd1bac63421d77717583d8c8
R
3,202
97
#' @export setGeneric("sc3", signature = "object", function(object, ks = NULL, gene_filter = TRUE, pct_dropout_min = 10, pct_dropout_max = 90, d_region_min = 0.04, d_region_max = 0.07, svm_num_cells = NULL, svm_train_inds = NULL, svm_max = 5000, n_cores = NULL, kmeans_nstart = NULL, ...
1bb833fc958f03c78779f03d47635f50e9b089db763889e9c480a763450422b0
R
3,208
64
library(qs) library(parallel) library(magrittr) library(tidyverse) library(Seurat) library(org.Hs.eg.db) library(rrvgo) setwd("~/data/STEREO/AnalysisPlot/") seu <- qread("./Seu_merge.qs") genes <- read.csv("../../ensemble93gtf_rmXY.csv") seu <- seu[rownames(seu) %in% genes$gene_name,] colorPallete <- c(ggsci::pal_aaa...
9f75b07f4a8764ee8793b85f2ead89ae875546aae8e0bd591dad4337fbce814c
R
3,221
82
# READ DESEQ2 RESULTS RDS FILE: ---------------------------------------- dds <- readRDS(rds_deseq2_results) # STORE DESEQ2 RESULTS: -------------------------------------------------------- res <- results(dds) # ANNOTATE RESULTS WITH GENE SYMBOLS AND ENTREZ IDS: --------------------------- ensembl_ids <- rownames(res)...
c3e0727df6b43245f18a19b45d53d2e30db0955f04005cc8884391a0c45a7558
R
3,221
73
#install.packages library(Seurat) library(ggplot2) library(DoubletFinder) library(dplyr) library(ggplot2) library(cowplot) library(reshape2) library(MAST) setwd("/athena/ganlab/scratch/lif4001/Mouse_pgrn_mertk/integration_with_Axl") # remove cluster 14 (no significant marker genes), cluster 15 and 16 (doublets) PGRN <...
10e06af086c927e7b42820b8b06f22bb7304b13f1bf049e0c1e4cb836f454175
R
3,225
112
# single-cell analysis package library(Seurat) # plotting and data science packages library(tidyverse) library(cowplot) library(patchwork) # co-expression network analysis packages: library(WGCNA) library(hdWGCNA) # using the cowplot theme for ggplot theme_set(theme_cowplot()) # set random seed for reproducibility ...
d9f35060adc90896dfa98e53cbad2ad09645c772edbd6c28c36a3ab2ce6b94c4
R
3,239
112
library(tidyverse) library(qs) library(parallel) library(BPCells) library(SeuratObject) library(SeuratDisk) library(magrittr) library(Matrix) library(RANN) devtools::load_all("~/seurat/") setwd("~/cortex/STEREO/GEM/") cortexMeta <- read.delim("../cortex") %>% column_to_rownames("chip") qsFiles <- list.files("bin200/"...
3706fc76a1a36bf2f1555ecd792be283f87dcfb0feac6eb22d63677a85f2fc1a
R
3,255
112
#load data###### #summarized AUCell score of GO terms in each one of twenty tumor bins load('~/Axonal-Injury/RData/FigS2h-o/LIST_MEDIAN.RData') #summarized AUCell score of GO terms in each one of twenty tumor bins (control data, pseudo spot, see Method) load('~/Axonal-Injury/RData/FigS2h-o/LIST_MEDIAN_CONTROL.RDat...
15fd7f635ea98d0fe41bb7ab7d678f6c773f35af76159345492a7021456b05b7
R
3,256
81
# required external packages for SIMLR library("Matrix") library("parallel") # load the igraph package to compute the NMI library("igraph") # load the palettes for the plots library(grDevices) # load the SIMLR R package source("./method/SIMLR/R/SIMLR.R") source("./method/SIMLR/R/compute.multiple.kernel.R") source("...
07cb38a5754e693e3e4c7bcf16f8f1f482fec9d0c21e57d21d978bfa92138aa4
R
3,257
74
# R script to download selected samples # Copy code and run on a local machine to initiate download # Check for dependencies and install if missing packages <- c("rhdf5") if (length(setdiff(packages, rownames(installed.packages()))) > 0) { print("Install required packages") source("https://bioconductor.org/bio...
b022616a6842e57194308aa287e7b2d5a5ba2672017cff793002bc37168a163f
R
3,259
84
--- output: html_document editor_options: chunk_output_type: console --- #Libraries & Source Files ```{r load libraries and source files, message=FALSE} library(tidyverse) library(Seurat) library(viridis) source("~/OHSU Dropbox/Saunders Lab's shared workspace/arpy/manuscripts/2023_Thai2P4M_FeigeYoung/ms_analyses/1...
9af37e7bd89abb9e3d1cf7a1c390b35acee42597104040322b02cc73ba687b1d
R
3,287
85
# Run 'analysis/03_deseq2_e17.R' and 'tables/scripts/tableS6.R' if you haven't already # READ DESEQ2 RESULTS RDS FILE: ------------------------------------------------ dds <- readRDS(rds_deseq2_results) # STORE DESEQ2 RESULTS: -------------------------------------------------------- res <- results(dds) # ANNOTATE RE...
c91346ec1e67d9355429040c389ae6b4bf7b34552a6e226f987ff474a6bfb5b1
R
3,298
74
# R script to download selected samples # Copy code and run on a local machine to initiate download # Check for dependencies and install if missing packages <- c("rhdf5") if (length(setdiff(packages, rownames(installed.packages()))) > 0) { print("Install required packages") source("https://bioconductor.org/bio...
b7db87e67d690ee595a0a4e1973c018a03e18fc088c313705b1ef7e8a9cc338a
R
3,314
94
```{r, echo=FALSE, message=FALSE, include=FALSE} if (!requireNamespace("pacman")) install.packages("pacman") packages_cran <- c("here") pacman::p_load(char = packages_cran) if (basename(here::here()) == "zoo"){ path_root = here::here("zoo-bids") } else { path_root = here::here() } ``` ## Conversion of data to the...
35ea31deda2b6cf1a459015a7b986256b34f79e8d9e9fa7a90d7fc4933f51bcb
R
3,315
49
# returns diffTable containing top two most up-/down-regulated genes based on log2FC getDiffTop <- function (complete, alpha = 0.05) { diff.table <- list(); for (name in names(complete)) { complete.name <- complete[[name]] sample.ref <- gsub("[^0-9a-zA-Z]","",strsplit(name,'vs')[[1]][2]) sample.treat <...
44515ddb324776ebc2478b6ac8df35641653c5576d68624171667bf2cde38463
R
3,315
87
# READ DESEQ2 RESULTS CSV FILE: ---------------------------------------- dds <- readRDS(rds_deseq2_results_e17) # STORE DESEQ2 RESULTS: -------------------------------------------------------- res <- results(dds) # ANNOTATE RESULTS WITH GENE SYMBOLS AND ENTREZ IDS: --------------------------- ensembl_ids <- rownames(...
0ac9881528a2c38ffdaba3b925c6020263b2806360737c949b42f765b36b50fd
R
3,319
110
library(plyr) library(dplyr) library(tidyverse) library(tidyr) library(Seurat) library(patchwork) library(Matrix.utils) library(ggpubr) library(reshape2) library(data.table) library(rio) library(scran) library(scater) library(SingleCellExperiment) library(EnsDb.Hsapiens.v86) library(edgeR) library(DESeq...
9c4547fc72ab0c278398d6438393f83c7905b3487ef021b4aa4ff005f832ea1d
R
3,329
80
library(Seurat) library(tidyverse) library(parallel) devtools::load_all("~/ClusterGVis-main/") setwd("~/cortex/fig3") merge_seu <- readRDS("../SnRNA/SnRNA_seurat.RDS") IT_seu <- merge_seu[,merge_seu$subclass %in% c("L2-L3 IT LINC00507", "L3-L4 IT RORB", "L4-L5 IT RORB", "L6 IT") ] IT_markers <- mclapply(IT_seu$subcla...
a08399aee5f278d9df81b61f70a9a1a5b13e2622bc3695adfec61763555396ad
R
3,329
71
#' Function to transform fdr into scores according to log-likelihood ratio between the true positives and the false positivies and/or after controlling false discovery rate #' #' \code{oFDRscore} is supposed to take as input a vector of fdr, which are transformed into scores according to log-likelihood ratio between th...
f1829869064a6425f9282ba00f2e8bc5972b4ab1e1c12c7b8edfb0848cdd8414
R
3,345
93
library(tidyverse) library(qs) library(parallel) library(magrittr) library(RANN) library(ggridges) library(dendextend) library(ggpubr) devtools::load_all("~/spacexr-master/") setwd("~/cortex/STEREO/2_Deconvolution_and_QC/") chipList <- read.delim("~/cortex/STEREO/cortexMeta.txt") %>% {setNames(nm = .$chip,.$region)} ...
d22100044822d13d4b8d6611e0c426793ae0eabfec266da4039897be368f0bf4
R
3,346
100
#This code was used to generate the full connectivity matrix of the 3 day old Platynereis larva described in Veraszto et al. 2021 #Gaspar Jekely 2021 Feb rm(list = ls(all.names = TRUE)) #will clear all objects includes hidden objects. gc() #free up memrory and report the memory usage. Sys.setenv('R_MAX_VSIZE'=80000000...
09664b07dc2d0f65481063748787aba3ce67c33569808d182c719c4b49e155b8
R
3,356
87
# modified 2021/02/02 by CT to determine nsub and avoid error in vst PCAPlot <- function (object, group=NULL,counts.trans,varInt,typeTrans, ntop = min(500, nrow(counts.trans)), col, batch=NULL,outfile = TRUE,batchRem=FALSE) { if (typeTrans == "VST") { # calculate the number of rows with counts...
9868d2eb21226a83bea19bc3a6c56e050769ffc1a3513e00a3d237766beaf045
R
3,368
77
library(qs) library(tidyverse) library(Seurat) library(magrittr) setwd("~/cortex/fig4/") sst <- qread("sstRNA.qs") Idents(sst) <- "depth_cluster" geneID_name <- read_csv("../SnRNA/1_SnRNA_preprocessing/gene_kept.csv") %>% {setNames(object = .$gene_uni,nm = .$gene_id)} clusterMarkers <- FindAllMarkers(sst,only.pos = T)...
57efdf717adf18e8ce4ab6b6c6689678c121f4af98d28a79090d5df8d600c980
R
3,381
88
library(org.Hs.eg.db) library(Seurat) library(magrittr) library(tidyverse) library(clusterProfiler) library(enrichR) setwd("~/cortex/figS1-6/") devtools::load_all("~/ClusterGVis-main/") # add cell type geneid_name <- read.csv("../SnRNA/1_SnRNA_preprocessing/gene_kept.csv") %>% {setNames(.$gene_name,.$gene_id)} region...
63cb224560a952f8af38737bbb4af340d3574b31cd38f0e60303da7a61636887
R
3,400
77
IN_DIR <- "/home/burkhart/Software/reticula/data/aim2/input/" PWAY_EDGE_DIR <- paste(IN_DIR,"PathwayHierarchyEdgeWeights/",sep="") ALPHA <- 0.05 tissue2idx.df <- data.frame(read.table(paste(IN_DIR,"pathway_hierarchy_inverted_targets.txt",sep=""), stringsAsFactors = FALSE), ...
bf216c42f422b2340130eb0ca55f0997a2fdedfbd34fefd45d34e69bb91d4233
R
3,402
65
tcrGroupsProj <- function(pseud.coord.lst, obj.sc, obj.sp.lst) { obj <- obj.sc obj.tcr <- tcrSubgroup(obj) tcr.subtypes <- c("TRA-TRB+TRD+", "TRA+TRB+TRD+", "TRA-TRB+TRD-", "TRA+TRB+TRD-") res.lst <- lapply(pseud.coord.lst, function(xx) { yy.names <- gsub("SC_", "", xx$sc) lapply(tcr.su...
ae3a36dfe3fb4c2033edb4397f3848d48e02da5656c8f3353291b7c104fbcd51
R
3,417
102
--- title: "Seurat Microglia Basics Seurat Workflow" author: "Arpy" date: '2024-11-12' output: html_document --- # Adapted code from K. Young's 7_astrocytes.rmd for the 2P4M project G.Chin 06/21/24 ```{r} library(tidyverse) library(Seurat) library(Libra) ``` #0. Data Load ```{r load data, echo = F} main.path <- "/Us...
55c334116299bff3bd30b459dc4ce2737ef2116472572fdcc861b016ff965699
R
3,419
103
# archive functions luckfps <- data.frame( experiment = c('ERN', 'LRP', 'MMN', 'N170', 'N2pc', 'N400', 'P3'), emc = c('ica', 'ica', 'ica', 'ica', 'ica', 'ica', 'ica'), mac = c('ica', 'ica', 'ica', 'ica', 'ica', 'ica', 'ica'), lpf = c('None', 'None', 'None', 'None', 'None', 'None', 'None'), hpf = c('0.1', '0....
ac877d1a34b12025ea009643e02e87beddc1d56e8f3da93734a84adc56afd264
R
3,423
104
# READ DDS OBJECT FOLLOWING DESEQ2 ANALYSIS FROM RDS FILE: --------------------- dds <- readRDS(rds_deseq2_results) res <- results(dds) # ANNOTATE RESULTS WITH GENE SYMBOLS AND ENTREZ IDS: --------------------------- ensembl_ids <- rownames(res) # annotate with gene symobols using org.Mm.eg.db package res$symbol <- m...
29944c8dcba1e9a3d17725662d9f0dd89c102fdb68781ed9df7629fe5a77dabd
R
3,433
136
############################################################################### ## Please source the `2-ukg.R` first (needed for labdesc etc.) if the dataset ## should be regenerated. ############################################################################### library("data.table") devtools::load_all() ## read out...
1e50dd795afee4aca66f29ff34a78dfad7a3004225b00419d10521a1d6cb5e28
R
3,441
110
library(plyr) library(dplyr) library(tidyverse) library(tidyr) library(Seurat) library(patchwork) library(Matrix.utils) library(ggpubr) library(reshape2) library(data.table) library(rio) library(scran) library(scater) library(SingleCellExperiment) library(EnsDb.Hsapiens.v86) library(edgeR) library(DESeq...
f8b519a2f575c327b83b4c0425af579f8243726075474d829fc619004cf1a452
R
3,460
90
#' Function to create a sparse matrix for an input file with three columns #' #' \code{oSparseMatrix} is supposed to create a sparse matrix for an input file with three columns. #' #' @param input.file an input file containing three columns: 1st column for rows, 2nd for columns, and 3rd for numeric values. Alternativel...
cfe3dea69ff24076c4e5d4b12a7dda3ccf0d777bc3cb66ab45f3a79617e0d5fa
R
3,477
111
# code to generate synapses Fig supplement of the Platynereis 3d connectome paper # Sanja Jasek & Gaspar Jekely 2024 source("code/Natverse_functions_and_conn.R") dir.create("synapse_tiff_stacks") # get all synapses from CATMAID all_syn_connectors <- catmaid_fetch( path = paste(pid, "/connectors/", sep = ""), bod...
145f417d2220c679269b4673725febfe79d810f2a1532343ecaf3a86b074f7ef
R
3,490
104
## Standard import & preliminary analysis script for multiple results files from ImageJ ## ## ## Results in .csv-format, additional Group-identifying txt-file (Groups.txt) ## ## best used in an RStudio Project in the results-folder ## ## ## requires tidyverse, beeswarm and vroom packages ## ## example: Filopodia densit...
ce53feadefdde4cb41c3d200eb96548ba3ac46dfe47f42e05ba527b36e447ce3
R
3,507
99
library(parallel) library(magrittr) library(tidyverse) library(rtracklayer) library(anndataR) library(Seurat) setwd("~/cortex/SnRNA/2_codePreprocessingExternalData") gtf <- readRDS("../1_SnRNA_preprocessing/geneSym_to_geneID.RDS") files <- list.files(".","_subclass.h5ad") subclasses <- files %>% str_remove("_subcl...
d8bd7ae9d4f0e6cac8cd58729adc10cc4d2c2b3bf47ec45e41da0a62e993bfe5
R
3,529
103
## use the data from Fabre et al. and generate pseudo-bulks library(ggplot2) library(ggpubr) library(phangorn) library(RRphylo) library(cgwtools) library(phytools) source("Simulated_data/Tree_post_processing.R") ## source modalities to extract information from trees folders <- list.files("./Published_data/Fabre_et_al...
cf02e37e234a577461691a6f13681710fcadc767a2e6070b4d8882f4535d62d8
R
3,581
99
# List of required libraries required_libraries <- c("ggplot2", "tidyr", "forcats", "tidytext", "dplyr") # Check if each library is installed; if not, install it for (lib in required_libraries) { if (!requireNamespace(lib, quietly = TRUE)) { install.packages(lib) } } # Load the libraries lapply(required_libr...
fee8dc8e2d1de66c61f904ae3d0d9a6f6ce869d37a4ca88e1ee3a4f0186c3b2f
R
3,585
56
#' Test for Multiplicative Batch Effects #' #' \code{multTest} function will test for multiplicative batch effects in the residuals for each feature after fitting a linear mixed effects model. Uses Fligner-Killeen method for significance testing. Data should be in "long" format. Depends on \code{lme4} package. #' @par...
d8b3e8bb241560cfdf90c93eeed82d921eb4f138964cf484ea9aa445aaf2c0f4
R
3,616
89
library(qs) library(tidyverse) library(vegan) library(ggrepel) library(cowplot) library(ggh4x) library(magrittr) setwd("~/data/STEREO//AnalysisPlot/") output_n = "." region_color <- c(FPPFC = "#3F4587", DLPFC = "#8562AA", VLPFC = "#EC8561", M1 = "#B97CB5", S1 = "#D43046", S1E = "#F0592B", PoCG = "...
29626cec021c8c7d660a817987e25e13d4c5e210a5dfdd0f100de107f2c15110
R
3,701
131
###### load observed data ## specify the VAFs at which model and data are compared; min.vaf must be given in the Run_model.script or defaults to 0.05 if(!exists("min.vaf")){ min.vaf <- 0.05 } ## should the sensitivity model be used? if(!exists("use.sensitivity")){ use.sensitivity <- T } ## what lower limit for the ...
9a2809b9b5d26f5ac65a86fc43e97297a68c0e61803b03b5a9d38ce866e12e18
R
3,701
76
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, echo = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) # Please put your title here to include it in the file below. Title <- "Whole-body connectome of a segmented ...
58748b24d9532f85ede8307ad88831d7e3fe535a28613830dae3b2993bc2340a
R
3,707
99
require(dplyr) require(reticulate) #----------------------------------------------------------------- # Load own modules source("modules/utils.R") source("modules/global_params.R") source("modules/seurat_methods.R") source("modules/visualization.R") source("modules/findMedullaClusters.R") source("modules/trajectory_m...
7d0cc1c8ee5ca5112df94e9a562c38965ca1a97aae890ec50ea456fea05e4e0e
R
3,707
164
--- title: "prestate_LMM" output: html_document date: '2023-10-10' --- #load libraries ```{r} library(dplyr) library('lme4') library('lmerTest') library('arrow') library('gtsummary') library('emmeans') library('effectsize') library('olsrr') library('ARTool') ``` #load data from cardiac ```{r} #df<-read.csv('/Volumes/...
52b8b0817702f76bf3443755ecc2bd2d22b6be6823d3f5831430f16aa1943d76
R
3,709
101
library(patchwork) # sandbox r2/aic new plot version # test <- tar_read(r2aic_table) test2 <- test %>% filter(metric %in% c("R2", "AIC")) %>% # capitalize interactions mutate(interactions = ifelse(interactions == "false", "Absent", interactions)) %>% mutate(interactions = ifelse(interactions == "true", "Pre...
2d26158c768fca4860a514f5bb5da194d614404fb041a5e361e4f530e56e3557
R
3,729
129
--- title: "Prepare GWAS summstats" author: X Shen date: "`r format(Sys.time(), '%d %B, %Y')`" output: github_document --- ## **Annotate CHR:BP format to RS format** ------------------------------------------------------------------------ ### **Download annotation file** Check [this requiry](https://...
7e827f17c08d1972b8778efb9ebe48e68bde7e6ba26d682ab63f6bf8ed4a1af5
R
3,744
103
library(DESeq2) library(ggplot2) library(magrittr) library(ggfortify) library(SummarizedExperiment) start_time <- Sys.time() IN_DIR <- "/home/burkhart/Software/reticula/data/aim1/input/" OUT_DIR <- "/home/burkhart/Software/reticula/data/aim1/output/" gtex_tissue_detail.vec <- readRDS(paste(OUT_DIR,"gtex_tissue_detai...
0172a6973527698a540fba982790e2464d874f96089e5533d639fa1e928c1ec5
R
3,747
76
#' Normalize input data matrix #' #' Mean centers each column of an input data matrix so that it has a mean of zero. #' Scales the entire matrix so that the largest absolute of the centered matrix is equal to unity. #' #' @param X matrix; Input data matrix with rows as observations and columns as variables/dimensions. ...
1fd7570325658881cb5cfe6efddd95bc4985a659fc610a97b5d79c798793af63
R
3,774
81
set.seed(88888888) library(magrittr) library(ggplot2) OUT_DIR <- "/home/burkhart/Software/reticula/data/aim1/output/" toi_summary.df <- readRDS(file=paste(OUT_DIR,"toi_summary_df.Rds",sep="")) # reaction accuracy X tissue vst_count.mtx <- as.matrix(readRDS(file=paste(OUT_DIR,"vst_count_mtx_train.Rds",sep=""))) # tran...
e0aa6532ffaf2b031f066e812c75ed628a9e4793d4c7b5d432f240d2d1da90d7
R
3,784
130
# required external packages for SIMLR library("Matrix") library("parallel") # load the igraph package to compute the NMI library("igraph") # load the palettes for the plots library(grDevices) library(aricode) # load the SIMLR R package source("./method/SIMLR/R/SIMLR.R") source("./method/SIMLR/R/compute.multiple.ke...
9c96a780f5f69f911e33bb65d99615494cd82000e57c89a6f5ac3b0978ea2710
R
3,794
132
#load deconvolution resultst LIST_DECON<-readRDS('/home/clustor2/ma/w/wt215/Axonal-Injury/RData/LIST_DECON_GITHUB.rds') #load myelin labels##### load('/home/clustor2/ma/w/wt215/PROJECT_ST/R/LABEL_MYELIN.RData') spots_myelinhigh<-names(LABEL_MYELIN)[which(LABEL_MYELIN=='Myelin high')] spots_myelinlow<-names(LABEL_MYE...
542f53617837631d45d6e08fe39899543880fae0a7f4ac1ed1c132ee88abac98
R
3,801
92
args = commandArgs(TRUE) TUMOURNAME = toString(args[1]) RUN_DIR = toString(args[2]) PRESET_RHO = as.numeric(args[3]) PRESET_PSI = as.numeric(args[4]) library(Battenberg) ############################################################################### # 2015-05-01 # A pure R Battenberg v2.0.0 SNP6 refitting pipeline im...
997aecc0a0f55997f055cf06dd072b0131d7a7f0a06b7007efcea91b99c28f92
R
3,813
49
# R script to download selected samples # Copy code and run on a local machine to initiate download # Check for dependencies and install if missing packages <- c("rhdf5") if (length(setdiff(packages, rownames(installed.packages()))) > 0) { print("Install required packages") source("https://bioconductor.org/bio...
3d5a75209525c5611c4b567a12ba00e66bd66d5ea4bf2574d1da13e27da3a279
R
3,816
85
library(qs) library(parallel) library(magrittr) library(tidyverse) library(org.Hs.eg.db) setwd("~/cortex/figS1-6/") devtools::load_all("~/ClusterGVis-main/") devtools::load_all("~/seurat/") seu <- qread("../STEREO/st_domain_seu_44slides.qs") genes <- read.csv("../STEREO/ensemble93gtf_rmXY.csv") colorPallete <- c(g...
ab1bada40d2af21bc065e85a29f90ae9932eb8b39e4815dc23cf48f442019e26
R
3,823
57
#' Test for Additive Batch Effects #' #' \code{addTest} function will test for additive batch effects in the residuals for each feature after fitting a linear mixed effects model. Uses Kenward-Roger method for significance testing. Data should be in "long" format. Depends on \code{lme4} and \code{pbkrtest} packages. #...
c0e0babddafc70b414dc1f3da14198112aee2ccbcf658dfa7ceea4ca28d85aed
R
3,846
105
# Script to generate reference models. The reference models are used to test backward compatibility # of saved model files from XGBoost version 0.90 and 1.0.x. library(xgboost) library(Matrix) set.seed(0) metadata <- list( kRounds = 2, kRows = 1000, kCols = 4, kForests = 2, kMaxDepth = 2, kClasses = 3 ) X ...
4bb76ac1c4fadac09c7ab4637db91ca10e41c06d0dedcd25905f75581ce76f63
R
3,848
135
# required external packages for SIMLR large scale library("Rcpp") library("Matrix") library("pracma") library("RcppAnnoy") library("RSpectra") # load the igraph package to compute the NMI library("igraph") # load the palettes for the plots library(grDevices) library(aricode) # load the SIMLR R package source('./m...
953659a5b502cf82b8bbdb82039832203fa9e09d450bb11f11f40a56023e7f27
R
3,863
87
# Fig4_cellchat_analysis.R # Load required libraries suppressPackageStartupMessages({ library(CellChat) library(patchwork) library(Seurat) library(SeuratObject) }) options(stringsAsFactors = FALSE) future::plan("multisession", workers = 4) # Define helper function run_cellchat_pipeline <- function(seurat_obj...
ba068058d658f4a6173bcde65316eb2d68d78993ffa40a3ac1e59a218b4457de
R
3,873
127
--- title: Analysis Script for Study 3 of 'Perceived community alignment increases information sharing' author: "Elisa Baek" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(warning = FALSE, message = FALSE) ``` This is the custom code that was used for the main a...
947e0f3572e986a02d0ca22fae142a45fd9c51c7bd6af84df83e067bb9b7fc19
R
3,918
92
############################################################################################################################################ ### load libraries library(openxlsx) library(wesanderson) library(bedr) library(ggplot2); theme_set(theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), t...
70d939e60cea89e44f802cc7ec3ac22f06e05151a689706e2394d06a2432761b
R
3,925
83
suppressMessages(library(Seurat)) suppressMessages(library(dplyr)) suppressMessages(library(tidyr)) suppressMessages(library(caTools)) suppressMessages(library(future)) suppressMessages(library(DoubletFinder)) #-------------------------------------------------------------- # Load own modules source('modules/utils.R')...
5a2bd0aa3b572660ca701075ddf4cd781e2d593346ea925a536bcc44cc964da4
R
3,963
93
# setting directory local_dir = "~/Downloads" wd = "/RNA_seq_bioinfo_analysis" source(paste0(local_dir, wd, "/wd_and_libraries.R")) # The following code is performing a DE analysis using the DESeq2 package in R. # The analysis is based on the Negative Binomial distribution, # which is a common choice for modeling ...
49f20fd5460cb609390f564de52002042b5fbb5bbdf6cdb7e9b8193933e46e14
R
3,971
118
#### merge the neigboring bins whose log2 copy ratio are very close bin.merge.chr = function(segs,min_diff=0.1,adjust=0) { copy.diff = diff(segs$log2.copyRatio) indx = which.min(abs(copy.diff)) seg.tmp = segs min.diff.tmp = c() k = 0 while(nrow(seg.t...
6c0fe5c638dadeadeed8239de3b39d8b3d9ad32e9e84f4d7cf75a8a22cf5432b
R
4,007
96
context("Models from previous versions of XGBoost can be loaded") metadata <- list( kRounds = 2, kRows = 1000, kCols = 4, kForests = 2, kMaxDepth = 2, kClasses = 3 ) run_model_param_check <- function(config) { testthat::expect_equal(config$learner$learner_model_param$num_feature, '4') testthat::expect...
e9222014120e9fd51e135d470ee64e268cd9bf9e05445e59b63b1206d62b2158
R
4,073
119
#' Function to combine networks from a list of igraph objects #' #' \code{oCombineNet} is supposed to combine networks from a list of igraph objects. #' #' @param list_ig a list of "igraph" objects or a "igraph" object #' @param combineBy how to resolve edges from a list of "igraph" objects. It can be "intersect" for i...
9d219e3b8504de8d6be7df911665860f9b2417297fb1e524fe692b51ca215c14
R
4,080
104
library(Seurat) library(CellTrek) library(CARD) require(future) options(future.globals.maxSize = 500000 * 1024^2) plan("multiprocess", workers = 20) #' -------------------------------------------------------------- #' By Seurat projBySeurat <- function(obj.sc, obj.st.lst) { ovp.genes <- intersect(rownames(obj.sc...
6c87d10e690e43d41515f4ef44cba3d8547cbdf1851fdb9e60e54d5c7a18c806
R
4,101
171
## try plot with significances data <- tar_read(marginal_means) sign <- tar_read(stats_all) library(ggplot2) library(ggdist) library(ggsignif) #mean_accuracy <- aggregate(accuracy ~ experiment, data, mean) # https://rpubs.com/rana2hin/raincloud ggplot(data, aes(x = factor, y = accuracy)) + # add half-violin f...
a6d889a903390f740e20c0c02395f711e5d8e3d26ad6a3ec2cb22f944a3c2b10
R
4,110
97
suppressMessages(library(Seurat)) suppressMessages(library(dplyr)) suppressMessages(library(tidyr)) suppressMessages(library(caTools)) suppressMessages(library(colorRamps)) suppressMessages(library(tidyverse)) suppressMessages(library(writexl)) suppressMessages(library(clusterProfiler)) suppressMessages(library(reshape...
5ce4880f38db74819b7fe2ef522857453f33c4510512b86f855e44d18c852212
R
4,121
64
--- title: "Introduction to Tocky and Data Preprocessing Methods" author: "Dr. Masahiro Ono" date: "`r Sys.Date()`" output: rmarkdown::html_vignette bibliography: TockyPrep.bib link-citations: TRUE vignette: > %\VignetteIndexEntry{Introduction to Tocky and Data Preprocessing Methods} %\VignetteEngine{knitr::rmarkdo...
cb0a8b82261bb054e121843b24a4c3371926fa51869af976a646e7786c2e161d
R
4,135
119
#' Function to obtain a projected graph from a bipartitle graph #' #' \code{oBiproject} is supposed to obtain a projected graph from a bipartitle graph. #' #' @param g an object of class "igraph" (or "graphNEL") for a bipartitel graph with a 'type' node attribute #' @param verbose logical to indicate whether the messag...
9935fcd6ed844a8198ef2233d1a60e16cab77bc6142ad6612dab01b8139fa46b
R
4,149
140
load('~/RData/PSEDUOBULK_MYELINHIGH.RData') load('~/RData/MYELIN_PDX_LATE.RData') load('~/RData/MYELIN_PDX_EARLY.RData') #all genes allgenes<-Reduce(intersect,list( results_NSG$gene,results_PDX$gene,results_PDX_E$gene )) #Select DE genes #NSG de_nsg<-results_NSG$gene[which(abs(results_NSG$log2FoldChange)>=0.5 & re...
8ff59eb55f15e8eec574d28cf739ff848b1fcdcaef245bc260b26c145d23ed55
R
4,175
174
#' Convenience function that orders edges or squares #' @author dw9, kd7 #' @noRd orderEdges = function(levels, l, ntot,x,y) { nMaj1 = NULL nMin1 = NULL nMaj2 = NULL nMin2 = NULL # case 1 or 2a: if(l>levels[3]) { #LogR criterion: ntot < x+y+1 if(ntot < x+y+1) { # take the six options, sorte...
dfedc385e15ac6d6f862371ac6ba82b4fa1adc0f6e84f693667592baf1c42f52
R
4,200
60
library(tidyverse) library(qs) library(parallel) library(magrittr) library(RANN) library(ggridges) library(dendextend) library(ggpubr) # fig i ast_distribution <- spatialCellMeta %>% filter(subclass == "AST") countByRegion <- ast_distribution %>% filter(str_detect(cluster,"5|4") )%>% group_by(chip,region,cluster) %>...
75a12fa37d92055caf6dbe2c3463887b273e0a20bd56defac0769d764f086001
R
4,201
156
```{r setup} library(ggplot2) ``` ```{r} se = readRDS('../data/transcriptome_analysis/STACAS_integrated.rds') se = add.spacet(se) se ``` ```{r} stacked_bar_plot = function( obs_ann, var_ann, var_name, reduction_df, output_folder, custom_pal=c() ){ reduction_df = reduction_df[, var_ann] ...