sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
da70cb38445835d1ac577498167473c4297e28b8819addb04c419dc6430d5489
R
3,325
44
gene.band = read.table("E:/project/embryo/data/database/gencode.v19.chr_patch_hapl_scaff.annotation_gene_info.add.UCSC.hg19.chromsome.band.txt",header = F,sep = "\t",stringsAsFactors = F,fill = T) gene.band = gene.band[grep("chr",gene.band$V1),] colnames(gene.band) = c("chr","star","end","ensembl.id","gene.name","band...
ed8424b7f3aab4fc0b5a80ef7585d1afa23fa3ff7ebfe95ca658ab649927767d
R
3,326
81
#!/usr/bin/env Rscript #### Generate non-tumor subsets for cell type annotation #### Author: Jana Biermann, PhD library(dplyr) library(Seurat) library(ggplot2) library(gplots) cohort <- commandArgs()[6] # Read-in object seu <- readRDS(paste0('data/MBPM/', cohort, '/data_', cohort, '_anchor2000_dims30.rds')) seu <- ...
ae5162ae1df62993e68129a9671dd27688893b6114a8d2dad07dfe828bc360b2
R
3,329
88
# Siwei 21 Mar 2019 # init library(Gviz) # data("cpgIslands") library(rtracklayer) library(BSgenome) library(BSgenome.Hsapiens.UCSC.hg38) library(TxDb.Hsapiens.UCSC.hg38.knownGene) library(ensembldb) library(org.Hs.eg.db) library(grDevices) library(gridExtra) library(GenomicRanges) ### options(ucscChromosomeNames = F)...
37295f456fb3c8c38e08fdb142418ff2f5c74449c57643720652395e4883c497
R
3,331
136
# Siwei 02 Feb 2025 # plot new Ex 9e # init #### { library(readxl) library(stringr) library(ggplot2) library(scales) library(reshape2) library(RColorBrewer) library(ggpubr) library(dplyr) library(data.table) library(DescTools) library(multcomp) library(gridExtra) } # load raw data #### s...
01c53c081ea940510430ff30466a62b089e32559026562481724a49d8c0136c7
R
3,338
64
options(stringsAsFactors = FALSE) library(ggplot2) library(reshape2) library(dplyr) library(stringr) library(lme4) library(lmerTest) library(RColorBrewer) library(ggpubr) #### PTA burden association analysis #### # 1. Playing years, Age at death, Age Sx onset #### meta <- read_table("data/sample_info.tsv", header=T, ...
b454da102f865ec03a1cb4e146425d5081f1ad8ec18f97d5d7bd8c8d32247f57
R
3,347
91
# **************************************************** # Preprocessing steps for Tabula sapiens dataset # **************************************************** if(!require("Seurat")){ install.packages("Seurat") library("Seurat") } if (!require("here")){ install.packages("here") library("here") } if (!require("m...
7826952b04db337df0476f73015ca9b3094b3b02292f4d4d7aa5d81c9d9c9f24
R
3,350
132
#This file contains the processing functions which are common to all Figures require(sjemea) require(rhdf5) library(gdata) dyn.load("correlation_index.so") dyn.load("spike_time_tiling_coefficient.so") #This reads in the hdf5 file and calculates the ci and sttc for each pair of electrodes run_measures_on_hdf5=functi...
f569dea58f29f52d879ccb84ca0c91bae6afa03e22dad0a7f3bfbb4f38b37a4e
R
3,350
87
#!/usr/bin/env Rscript #### Fine cell type annotation of B cell subset for MPM_sn #### Author: Jana Biermann, PhD library(dplyr) library(Seurat) library(ggplot2) library(gplots) library(viridis) '%notin%' <- Negate('%in%') path.ct <- 'data/cell_type_DEG/MPM_sn/bcells/' filename <- 'MPM_sn_bcells' seu <- readRDS('da...
9237129aec3169df383f6befcc63ad4bb4a90eb98c3703c2ccbd759cfb0b170a
R
3,365
89
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) library(Seurat) library(qs) library(future) library(foreach) library(dplyr) library(AnnotationDbi) library(EnsDb.Hsapiens.v86) library(gprofiler2) objects_folder <- file.path(project_fol...
7fbb521e53ea351d69cc2d7b9ea6e68d9d66cfafd7c39f998d079ae8ddd2eaf2
R
3,366
84
#Run differential gene expression analyses between cell populations #################################################### #Load libraries library(Seurat) library(tidyverse) #Create directory to store plots dir.create("5_diff_exp_mixed_1.5_2M", showWarnings=T) #Load mapped Seurat data with reductions df = LoadSeuratRd...
f2a613bced454ea49d84980d1dda9fc485d0f58b44b3d99208c15f867963e1e9
R
3,372
80
```{r} # load packages suppressPackageStartupMessages(library(xfun)) pkgs = c("SingleCellExperiment","tidyverse","data.table","dendextend","fossil","gridExtra","gplots","metaSEM","foreach","Matrix","grid","spdep","diptest","ggbeeswarm","Signac","metafor","ggforce","anndata","reticulate","scales", "matrixStats...
0852fe888615c5b45e84c348fc54782f0d94bf2c963c74ca2339854541547ae5
R
3,384
59
#generate plots for results of the varied window size plot ##### load packages and results ##### if (!require("here")){ install.packages("here") library("here") } if (!require("tidyverse")){ install.packages("tidyverse") library("tidyverse") } if (!require("magrittr")){ install.packages("magrittr") library(...
90e6850094a420ee1288041b5547374e66ce4d9941ea3c5df589890fb0084dd2
R
3,384
78
#' SpliceFlow calculate splicing efficiencies #' #' @param se_counts : counts from exons and introns #' @param regionsFlow: regionFlow-object containing exons and pairs #' #' @return SpliceFlow calculations #' @export #' @importFrom DEXSeq DEXSeqDataSetFromSE #' @importFrom DEXSeq DEXSeq #' @import dplyr #' @examples S...
39905f20bfbb0d0ddc5d6f96da9424177719f9f9b5325fdc4ce7d827199527a3
R
3,385
110
library("SummarizedExperiment") library("here") library("tidyverse") library("jaffelab") library("sessioninfo") #### Round 2 version 40 #### output_dir <- here("processed-data", "01_SPEAQeasy", "round2_v40_2023-04-05") rse_fn_v40 <- list.files(here(output_dir, "count_objects"), pattern = "rse*", full.names = TRUE...
d15d0f8801f0ac003401e443621799ba42d996027dbd6af503e4297e2f023c38
R
3,386
86
#' dmrff.cohort #' #' Identify differentially methylated regions #' within an individual dataset with a `pre` object. #' #' @param object Object generated by \code{\link{dmrff.pre}} for the dataset. #' @param p.cutoff Unadjusted p-value cutoff for membership in a candidate DMR #' (Default: 0.05). #' @param maxgap Maxi...
3d6194dd8c4ec6fe388170f82b889ca693427167a0ab042966378fa4ff13d87e
R
3,388
104
# Siwei 14 Mar 2022 # make .gene_loc files # init library(stringr) library(readr) df_NCBI_37.3 <- read_delim("~/NVME/VPS45/organoids_SETD1A_hg19/MAGMA_annotation/NCBI37.3/Rev.NCBI37.3.gene.loc", delim = "\t", escape_double = FALSE, col_names = FALSE, trim_ws = TRUE) df_NCBI_37.3$X6 <- NU...
7594588ff408c8e082fca6610a30fa2c628ed7f96613ca63158360ba18f4f14e
R
3,390
102
library(Seurat) library(patchwork) library(ggplot2) sample_info <- read.delim("../COGA_Caudate_HT_scRNA-seq_Pool-sample_infor.txt") pool_line <- "start" pool_num <- 0 skipped_samples <- c("BTRC_288_BTRC_288", "BTRC_140_BTRC_140", "BTRC_68_BTRC_68", "BTRC_141_BTRC_141", "BTRC_23_BTRC_23", ...
32ec4020d45afc73a722db619b2b8a884db30c1090fc71d952d3118254906da2
R
3,395
104
# Load packages library(tidyverse) # clear global environment rm(list=ls()) setwd("/home/emba/Documents/EMBA/VMM_analysis/00_input") dir.in = getwd() # get all directories subs = list.files(pattern = "sub-*") # loop through them for (subID in subs) { tryCatch( { # check if the file exists ...
7de4203a70d3af02f46b1fa924899129410b4aa04d7b1abb0fd79e41912d74b1
R
3,397
151
#library(remotes) library(Seurat) library('glmGamPoi') source("IKAP_function.R") #renv::status() #renv::snapshot() #renv::activate() #renv::hydrate() #devtools::install_github('immunogenomics/presto') setwd('data_AD_organoid_GSE164089/') files = sapply(dir()[grep("mtx",dir())], function(x) strsplit(x,"matrix...
7db4194ed4286225ffad33c030947d4dc9ece16f522978e630413c0e1a1cf332
R
3,401
108
library(magrittr) library(data.table) library(dplyr) library(tidyr) library(ggplot2) library(ggrepel) library(Hmisc) library(cowplot) library(pROC) library(stringr) library(RColorBrewer) library(netresponse) library(igraph) #genes that are relevant across drugs? sensitivity genes? essentiality? setwd(dirname(rstudi...
8b99f9b043fd58d401ff2c4cdb0f229a9d8a1011278fce24a9f9886dbb6f2340
R
3,402
89
library("DeconvoBuddies") library("SingleCellExperiment") library("tidyverse") library("ggrepel") library("here") library("sessioninfo") #### prep dirs #### data_dir <- here("processed-data", "13_PEC_deconvolution", "01_find_markers_PEC") if(!dir.exists(data_dir)) dir.create(data_dir) plot_dir <- here("processed-data...
99e3275f9f6dec212a780a7ac551d96d969d1f0242f6dccdafafed16948d1aa8
R
3,403
116
# fig 3C # Jaccard Index Statistical test comparing with ChIP-Exo library(dplyr) library(twice) library(ggplot2) library(ggpubr) data("hmKZNFs337") data("hg19rmsk_info") # chipexo chipexo <- read.csv("data/kznfs_TEs_ChIP_exo_modified.csv") chipexo <- chipexo %>% mutate(pair=paste(teName, ":", geneName)) # clust...
c42ad961375095385ef1fa3ab501a22381c7230ec42c0c0677e2e2b153cc38dd
R
3,404
91
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) library(Seurat) library(qs) library(future) library(foreach) library(dplyr) library(AnnotationDbi) library(EnsDb.Hsapiens.v86) library(gprofiler2) library(ComplexHeatmap) objects_folder ...
310b5c71b80f6834c6cde05e5929476857c057ae2eadbc4da4365b336bf38317
R
3,419
106
library(magrittr) library(data.table) library(dplyr) library(tidyr) library(ggplot2) library(ggrepel) library(Hmisc) library(cowplot) library(DescTools) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) read_dat_no_embedding <- function() { files <- list.files(paste0('../results_without_compound_embeddin...
edeac447e4559ca5990ccc59ac0bb05742892aa282b561e6f128babc23b12dc7
R
3,420
80
#' Calculate cell type-trait associations #' #' @param sscore A dgeMatrix of seismic specificity scores where #' each column is a cell type and row names are gene identifiers. #' (Note: the identifiers used should match those used in the MAGMA input) #' @param magma A data.frame or file path to MAGMA output for a parti...
a258b2daef01073a72fcfddf08b30ff9bde1c48431e84b0562326793027f9f3a
R
3,423
87
#' Jiayi rewrite Sep 2024 #' CreateVCF #' #' #' Create the VCF (Variant Call Format) file #' @param bamdir The Path of to the BAM Directory #' @param Genome_Fa Path for whole genome FASTQ file #' @param DIR_Genome_DICT #' @param Picard_Path Path to the Picard directory, with all the JAR files #' @param CMD_gatk #' @par...
9b5bc032a7bf4d245a33d0978b85e630427dd8a2cb6e0a564c8c4d78791cc671
R
3,424
102
#!/usr/bin/env Rscript # ========================================================================= # Script: atac_te_diff_analysis_in_r.R # Author: Alireza Ghahramani # Contact: aghahram@uwo.ca # # Purpose: # Quantify transposable elements (TEs) in ATAC-seq BAMs using featureCounts # (with a RepeatMasker SAF annota...
7d7e5495700a4c7238e820a63d6963448c57be3aebf1a3a2eec291e6ab5d7e3d
R
3,425
87
## Singh AK et al: Proteins with amino acid repeats constitute a rapidly evolvable and human-specific essentialome ##This file contains all scripts for statistical analysis. #1. Computing enrichment using permutation testing: 10000 random sampling ##Note: The following example is to test whether human essential genes ...
6909177e2aecd0eade655b1311378103103aefc15079730ad3d122c75e84bb74
R
3,427
99
## Heatmap of ATAC-seq peak enrichment for each nonlinear module ## library(reshape2) # for melt() library(ggplot2) library(RColorBrewer) #1. Load enrichment results - nonlinear ========================================================================================= modules <- c('All', 'turquoise', 'blue', 'brown'...
1501e272a9205b8afbd94d8c7c2bbd3507fec7fb51910a0e644949a02b15a1d9
R
3,430
91
library(tidyverse) library(ggridges) library(EnhancedVolcano) #data <- read_csv('xpore_out_fb/diffmod.table') ######################################### load data data_maj <- read_csv('xpore_out_fb/majority_direction_kmer_diffmod.table') mod_key <- read_csv('mod_key.csv')#load in modifcation key mod_key <- mod_key %>%...
07bee560e4ac72b50500ea90176d401eedb9f8cd4045ee91cdb9e53aad808e43
R
3,432
91
#----------------------------- # get top 1000 markers by type #----------------------------- markers <- get(load("markerlist_celltypebroadk_dlpfc-ro1.rda")) names(markers) # [1] "Astro" "EndoMural" "Excit" "Inhib" "MicroOligo" "Oligo" "OPC" n <- 1000 # get top n marker genes by type genev <- uniqu...
38e9aaabb2e189f6dfd18c911bb05ee8760f7127dbd7aa6c035b7e5ec208afdb
R
3,433
100
fluidPage( fluidRow( column( width = 5, style = "padding:0px;", userBox( title = userDescription( title = i18n$t("福岡県"), subtitle = i18n$t("九州地方"), type = 2, image = "Pref/fukuoka.png" ), width = 12, status = "navy", colla...
978b6c56778a3a2d97276f0c3b9955da2ecea25532256284e8dadb6aa24dcc9a
R
3,440
95
#!/usr/bin/env Rscript # ======================================================================== # Script: te_featurecounts_differential_expression.R # Author: Alireza Ghahramani # Contact: aghahram@uwo.ca # # Purpose: # Differential expression analysis of transposable elements (TEs) using # featureCounts (SAF, Re...
40b6d90fa84c53b81e1ddd3c7feb4acc1be15a3bd4f8748029b8475f2dbd5dbf
R
3,446
90
#### Figure S5A #### #### Upset plot for astrocytes #### library(stringr) library(ggplot2) library(UpSetR) library(here) # pairwise comparisons: # human vs chimp: h_c <- read.table(here("data/astrocytes", "Astro_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) h_c <- h_c[h_c$padj<0.01 & (h_c$log2FoldChange<(-0....
95fc0830fbd8b3c13bcdf82599a432dcd9de16ad947437be544de9c5ae763df3
R
3,450
91
#' Save and Display a ggplot Object in Both PNG and PDF Formats #' #' Saves a ggplot object to both PNG and PDF formats and displays the PNG version inline. #' Useful for analysis workflows where both high-quality vector output (PDF) and inline visualization (PNG) #' are desired. #' #' @param filename A character strin...
e7caa316bdaeab71a3027ba85a4369f08d3e488790de0069caa577ad5a718440
R
3,455
97
# ============================================================================= # 正常样本质控脚本 # ============================================================================= # 功能:读取正常样本(normal_fascia)的10X数据,创建Seurat对象,进行质控过滤 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf...
fec5b1076a53200b2cea754c06dc642103d40e02af0c1d28bf98ba06b3ef2419
R
3,456
97
library(data.table) # ====準備部分==== source(file = "01_Settings/Path.R", local = T, encoding = "UTF-8") # 国内の日報 domesticDailyReport <- fread(paste0(DATA_PATH, "domesticDailyReport.csv")) domesticDailyReport$date <- as.Date(as.character(domesticDailyReport$date), "%Y%m%d") setnafill(domesticDailyReport, type = "locf") ...
71883b44839e3d3cd665d1d5d87987b5530e3bb2dd28678ce6f32a342e933f26
R
3,465
93
# ===================================================================== # For compatibility with Rscript.exe: # ===================================================================== if(length(.libPaths()) == 1){ # We're in Rscript.exe possible_lib_paths <- file.path(Sys.getenv(c('USERPROFILE','R_USER')), ...
08f499ea5e6109023afe379b4c77e207132b90bce4b9c562f0175e76a12c6ee2
R
3,466
115
# Siwei 14 May 2021 # ASoC analysis of 17 Microglia lines ATAC data # init library(readr) library(plyr) library(dplyr) library(stringr) library(Rfast) library(ggplot2) library(RColorBrewer) # load data ASoC_df_raw <- read_table2("DP20_data_files/non_500bp_intersected/MG_28_lines_merged_peaks_filtered_03Jun2022_DP_...
7e2f01ed6c6f77d29ad5793d9b91209bc197ff58cb8395810b46ff77b16bf87e
R
3,472
73
#' Adversarial Debiasing #' @description Adversarial debiasing is an in-processing technique that learns a classifier to maximize prediction accuracy #' and simultaneously reduce an adversary's ability to determine the protected attribute from the predictions #' @param unprivileged_groups A list with two values: the c...
1aa6bb197a3508913a505364f97e6133f7fce347df6ef422b1bf006f382d5b8e
R
3,479
86
## Barplots of DMP distribution within genelist genes ## library(viridis) epicAnnotGeneList <- read.csv(paste0(refPath, "EPIC_annot_SFARI_SCHEMA.csv"), row.names=1) glistFile <- read.csv(paste0(refPath, "GeneList_SFARI_SCHEMA.csv"), row.names=1) #1. Load EWAS results =============================================...
54fe7c88791b8049139776d9bd55b1be5cc5e15d9b76e846bdeefbaa817cc2a0
R
3,484
112
# 実効再生産数 tabPanel( title = tagList( icon("chart-line"), i18n$t("実効再生産数"), boxLabel("New", status = "warning") ), value = "rt_line", fluidRow( style = "margin-top:10px;", column( width = 8, pickerInput( inputId = "regionRtLinePicker", label = i18n$t("地域選択"), ...
fd4e9dad99d39a4549c8d4201e81ceba8ebd711bc76e4482373ae1da6634df8a
R
3,487
139
output$RtLine <- renderEcharts4r({ input$generateRtLine isolate({ # parameters mean_si <- input$RtLineMeanSi std_si <- input$RtLineStdSi selectedPref <- input$regionRtLinePicker incid <- as.incidence(rowSums(byDate[, selectedPref, with = FALSE]), dates = byDate$date ) # handling ...
cdd279a301e3a57c0dc08d057b33bc47fad2decdbe9af0890264ff97bbbb6511
R
3,494
90
#### Figure S6A #### #### Upset plot for microglia - primates #### library(stringr) library(ggplot2) library(UpSetR) library(here) # pairwise comparisons: # human vs chimp: h_c <- read.table(here("data/microglia", "Micro-PVM_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) h_c <- h_c[h_c$padj<0.01 & (h_c$log2F...
4538cb1784428f3d2982a3ce01ae585f6b12a50b323bed4a9eb23638715de694
R
3,495
59
context("compareRhythms_deseq2") load("test_data_rnaseq.rda") exp_design_batch <- cbind(exp_design, batch, stringsAsFactors=TRUE) test_that("DESeq2 analysis works for default params", { results <- compareRhythms(countsFromAbundance, exp_design, method = "deseq2") expect_s3_class(results, "data.frame") expect_n...
bd397c389c020af28547c260f6c8fd48ec5be0999ec7af53b2229c7ba54e1fdc
R
3,508
88
# Describe microbiome abundances and create figure # Figure 1a: boxplots of phylum abundances # Figure 1b: Ordered boxplots of the most abundant species # Figure 1b: # 1: Calculate the mean abundance of each species # 2: Sort by abundance # 3: Filter on the top X species # 4: Visualise # Save species abundances sp...
114d30a782780902c92989ee331b40c42585664f71ca342e1eb4842c29755d29
R
3,510
124
# get and analyse how many cCREs overlap with coding UCRs and ncRNA UCRs setwd(dir = "D:/R_project/UCR_project/") options(stringsAsFactors = FALSE) rm(list = ls()) library(tidyverse) library(stringr) library(VennDiagram) # cCREsOverlapCodingUCRs -------------------------------------------------- cCREsOverlapCodingU...
05b51e5a4c40574decdea050699dafc9107cd805bd317d6e2bf96461b1419e84
R
3,515
119
# exonicµÄgo¸»¼¯·ÖÎö½á¹û # barplotչʾ¸»¼¯·ÖÎö½á¹û£¬ÍøÖ·ÈçÏ # https://mp.weixin.qq.com/s/fVIRX8ieyWRRVdArwOHQvg setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(ggplot2) library(readxl) library(stringr) library(dbplyr) intronic_UCR <- read_xlsx(path = "01-data/10-GO_enrichment_ana...
32bd3f236099b4df8960bfd85925f9731bdc15a4f714ef6081d648dcebde840f
R
3,519
80
# load packages require(tidyverse) require(monocle3) require(Seurat) # load cell_data_set objects cds <- readRDS('cds_downsampled_all.rds') # subset CDS by time point cds_E12 <- cds[, cds$time_point == 'E12.5'] cds_E14 <- cds[, cds$time_point == 'E14.5'] cds_E16 <- cds[, cds$time_point == 'E16.0'] cds_E17 <- cds[, cd...
a0623d2068de84d7dd13f09de8edadd78add659762109d3d04bd0104146db823
R
3,531
90
#### Figure S6H #### #### Upset plot for oligodendrocytes - primates #### library(stringr) library(ggplot2) library(UpSetR) library(here) # pairwise comparisons: # human vs chimp: h_c <- read.table(here("data/oligodendrocytes", "Oligo_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) h_c <- h_c[h_c$padj<0.01 & ...
0836ddc3a626083027ddf18871e75b065495352363d6403ff20098776b936dc8
R
3,533
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
da1c4d02c5123b9e8df0897a7d38af13397f585750e9a07cff2bf1e2e447028d
R
3,533
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
deeccf3bd926891d467e79b292549cb082216d87425786ebea394d584767fdf1
R
3,533
91
#!/usr/bin/env Rscript #### Fine cell type annotation of CNS and stromal cell subset for MBM_sc #### Author: Jana Biermann, PhD library(dplyr) library(Seurat) library(ggplot2) library(gplots) library(viridis) path.ct <- 'data/cell_type_DEG/MBM_sc/cns/' filename <- 'MBM_sc_cns' seu <- readRDS('data/cell_type_DEG/MBM...
edd53045e3c478cfa3071b4b561cf905ff43064c5f7799aad0b03c7a331d9d3e
R
3,534
73
res <- read.csv(file="CrossData_exp2bulk (1).csv") Mathys_Fujita <- res[1:5,-1] colnames(Mathys_Fujita)[1] <- "Method" Fujita_Mathys <- res[6:10,-1] colnames(Fujita_Mathys)[1] <- "Method" method_colors <- c("#e56b6f", "#fec89a", "#895737", "#0077b6", "#9f86c0" ) names(method_colors) <- c("BLEND", "BayesPrism", "MuSiC",...
2b1bb1a9072499d6efaa47f6a785a7772197076ed6f0852b081650b60c7a49f8
R
3,536
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
bd1440b0ff9518c9003d73df4ce10027e364f422a3c5ff4d1a4147246db29275
R
3,536
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
4c538d60f9829d25416f9ea10478d8988c0ad5c1a5f402b9ea5eef50033f7b9d
R
3,538
79
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
2edce6c8f7a593eabf5cef728ee4a409d2752a23938c05dad68d5c809227e1a2
R
3,539
86
library("tidyverse") library("sessioninfo") library("here") ## prep dirs ## data_dir <- here("processed-data", "08_bulk_deconvolution", "12_get_est_prop_MuSiC_cell_size") if (!dir.exists(data_dir)) dir.create(data_dir, recursive = TRUE) #### data details #### ## dataset properties dataset_lt <- tibble(Dataset = c("2...
6cf9e7b04fe5c17df7026ce9024e02e698e7c1ac3423427efeb2b82847e0317c
R
3,539
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
ef7511f3e7c66e23e00173dfce3200f4fae26eec96580343d2954e9df8c91cfb
R
3,540
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
bf4f9ffd51414b539f96c011569a1fe2331e8c1bcac2b747a9ca264aa4af3de6
R
3,541
88
#!/usr/bin/env Rscript #### Fine cell type annotation of stromal cell subset for MPM_sn #### Author: Jana Biermann, PhD library(dplyr) library(Seurat) library(ggplot2) library(gplots) library(viridis) path.ct <- 'data/cell_type_DEG/MPM_sn/stromal/' filename <- 'MPM_sn_stromal' seu <- readRDS('data/cell_type_DEG/MPM...
dd1fe7442599fb81859620d34250a36fb54cc537a380c814146749d0f72e0045
R
3,543
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
9be83ae1685655f93e1cea2ef6524895de0d3ed84491b907372142fb65bf197b
R
3,545
89
#Code to split Allen Brain atlas transcriptomic data from excitatory neurons. library(stringr) library(dplyr) samps = readRDS("samps.RDS") prot_df = readRDS("prot_PSD_df.RDS") annot = readRDS("annot.RDS") annot_CA1 = annot[grep("CA1$",annot$cluster_label),] samples_CA1 = as.vector(annot_CA1$sample_name) samps_CA1 = ...
92facb8d14f50326ee05ceacb88d1e3ae477f71ed643ec2906b58dc28690ff3e
R
3,546
80
# Run CellChat to explore cell-cell communication - cell subtypes (continued) # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # April 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.co...
9bbb3dfc32702e4f7d04d6644c5bf59fc163c53e1614d96d1e81564788a67c61
R
3,547
63
## Leave-one-out (LOO) Z-score outlier removal ## # Calculate Z-score for each sample by removing the sample from the dataset and calculating a Z-score for the remaining samples. # Samples that create a large Z-score when they are removed from the dataset suggest they have a large influence on the distribution. # O...
85bb3c6a0ae54809e262aaff67dbd5c2c5a91f38ac6c602c320a6b40d1f2fc94
R
3,552
60
#### Figure 4A - inset plot #### #### Highly divergent genes in astrocytes #### library(stringr) library(dplyr) library(here) library(ggplot2) # astrocyte DEG data: astro_h_c <- read.table(here("data/Astrocytes", "Astro_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) astro_h_c <- astro_h_c[astro_h_c$padj<0.01 ...
665e1a2ef32317673c58477a936a27fd7f015a035024fa7347f95dcfdffa868f
R
3,569
58
library(RIdeogram) library(rCGH) library(Biobase) human_karyotype.hg19 = hg19 human_karyotype.hg19$star = 0 human_karyotype.hg19 = human_karyotype.hg19[,c(1,6,2,3,4)] colnames(human_karyotype.hg19) = c("Chr","Start","End","CE_start","CE_end") human_karyotype.hg19[23:24,1] = c("X","Y") human_karyotype.hg19$Chr = paste0...
a7b65641dbae981c8cccf312870b334496417b735a534b9034791dbb20b73acf
R
3,574
111
```{r} library(kronos) library(tidyverse) library(ggplot2) ``` Import dataset ```{r} library(readxl) bigdata_yjl_ht_new_othergenes <- read_excel("C:/Users/U177202/PhD/Experiments_thesis/Youth_Jet_Lag_Experiment_2/YJL_Exp2_Microarrays/YJL_Exp2_KRONOS/YJL_Exp2_circadian_clock/YJL_Exp2_circadian_clock_ht_extra...
c138b7ab9464dbe763260d29c54f5791979b74caef4ff0eb2241a17cbe6c764c
R
3,574
62
#### Figure S6B - inset plot #### #### Highly divergent genes in microglia #### library(stringr) library(dplyr) library(here) library(ggplot2) # microglia DEG data micro_h_c <- read.table(here("data/microglia", "Micro-PVM_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) micro_h_g <- read.table(here("data/microg...
bd86866f06037f038bd1476516440ef597333d128b9049bf9d611bf5caa7ba28
R
3,584
89
regressFluxesAgainstMicrobes <- function(fluxesPruned,microbiome) { #' regressFluxesAgainstMicrobes - Regresses microbe abundances against metabolic fluxes. #' This function performs linear regressions between microbe abundances and metabolic #' fluxes for each microbe and each flux. The R-squared values from these...
e7430f4e74a664abe3010b48b542d2dff9c5cebb8c7b927e78113f5474dce909
R
3,584
77
RelRankEnrich <- function(exp, genelist){ if (!is.matrix(exp) || is.null(rownames(exp)) || length(genelist) == 0) { stop("Invalid input. 'exp' must be a non-empty matrix and 'genelist' must be a non-empty list.") } row_names = rownames(exp) num_genes = nrow(exp) num_samples = ncol(exp) R = matrixStat...
1c2813e91df67c28b5f80eb69c598fb4e2295c5c00817f22c154cb4588af1817
R
3,585
105
## Loading libraries library(tidyverse) library(MatchIt) library(optmatch) library(gridExtra) ## Loading data ## There are 3 tissues amy_base.a <- readRDS(paste0(directory, "ROSMAP_DLPFC_PhenoCov_Cross_070524.rds")) ## complete data for variables that are being used to match nomiss <- amy_base.a %>% select(proji...
3e8125380d159ed7094042f3ff2a0cfb34a99a53fb507db2bd47d2b06559ac09
R
3,591
80
# function for plotting rs2027349 site # revised from plot_anywhere # Use OverlayTrack to combine data tracks plot_AsoC_peaks_rev <- function(chr, start, end, gene_name = "", mcols = 100, strand = "+", x_offset_1 = 0, x_offset_2 = 0, ylimit = 400, ...
15cf1e18a265e7e2eeddf8cfb596f4604570b9d286d7326102a4e600c5b0ab7f
R
3,599
95
microbiomePhylumSummaryStats <- function(rawMicrobes, fluxAll){ ## Step 1: Process the raw read counts # Filter on flux samples processedTotalReads <- rawMicrobes %>% # Convert wide format data to long format # Retains all columns except 'Taxon', pivoting others into 'ID' and 'value' columns. pivot_longer(co...
1c305dfeb3a55e15ce1fee0efceed8a60ea55223dae2cc697aa2ce2e5cf557e5
R
3,601
91
library(tidyverse) # Create a final table of manually validated cryptic bleedthrough events i3_mv <- read_tsv("data/PAPA/riboseq_manual_verification_of_i3_cortical_cryptic_bleedthroughs.tsv") other_mv <- read_tsv("data/PAPA/cryptics_summary_bleedthrough_manual_validation.tsv") complex_mv <- read_tsv("data/PAPA/crypt...
8ef1010e1abedb70a1c71a9998cec71f19a69adfa9af9ed23c3082251f73151b
R
3,608
82
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) library(Seurat) library(ClustAssess) library(qs) library(ggplot2) options(future.globals.maxSize = 2 * 1024^9) metadata_folder <- file.path(project_folder, "metadata") seurat_folder <- f...
ccdd2f8591cccea265a744f6fc37f2848a58fcba72ce1f737fc9b594257be4fb
R
3,611
99
#!/usr/bin/env R # Author: Sean Maden # # Compare parameter priorities from HALO settings files, across slides/samples. # # #---------- # load data #---------- # source helper functions fpath <- file.path("read-halo-settings_functions.R") source(fpath) # concat settings flat tables dpath <- file.path("HALO", "Export...
b935c1b929e0d6b1115c0cf36966350c54f86e64a43f57d298efa8c8ceee4dbb
R
3,622
52
fluidRow( box( width = 12, closable = F, title = tagList(icon("chart-line"), i18n$t("COVID-19 重症患者状況 日本COVID-19対策ECMOnet集計")), tags$p(i18n$t("このページは、"), tags$a( icon("external-link-alt"), i18n$t("COVID-19 重症患者状況 日本COVID-19対策ECMOnet集計"), href = "https://...
1866616a12b9d67cabd86b36ca6bcd414654e060df4e4fe243be906f80e73f7e
R
3,625
75
#!/usr/bin/env Rscript ## Modified version of perm.t.test from GmAMisc ## Original version: https://CRAN.R-project.org/package=GmAMisc ## Modified by: Jana Biermann, PhD perm.t.test.mod <- function(data, format, sample1.lab = NULL, sample2.lab = NULL, B = 999, pathway,plot) { #options(scipen = 999) if (format == ...
275e7fc658ace08d3f1612f87d4d78d2e39a9c1ca833f417d14b33eb074577ae
R
3,626
111
# ÓÃmetascapeÍøÕ¾×öµÄGO¸»¼¯·ÖÎö½á¹û»æÍ¼ setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(ggplot2) library(readxl) GO_result <- read_xlsx(path = "03-results/10-GO_enrichment_analysis/meatscape_coding_UCR_genes_GO/metascape_result.xlsx", sheet = 2) GO_result <...
74fbeeeb5ad7fe3a3f24fe5fd460476423db7c4106f3bd9047517affb725a73f
R
3,626
120
#!/usr/bin/env Rscript print("################################################################################################################") print("# Estimation and removal of cell free mRNA contamination in droplet based single cell RNA-seq data with SoupX #") print("#############################################...
95b5bb6a7bf87c35ef8af1e56b950b3b1826b423f5e54942f81a0dcc2c587137
R
3,633
79
--- title: "Lvar Cell Culture Growth Plots" output: html_document date: "2024-01-03" --- ```{r } # Load Libraries library(ggplot2) library(dplyr) ``` ```{r } ##Make line/scatter plot for cell culture population doubling (PDL) and cell viability (CV) ##Figure 1 PDL <- read.table("PDL.txt", sep="\t", heade...
0c231d867df1518053887ae414f683f2434046658b412f6944fbda9cd7634b83
R
3,637
126
#rm(list=ls()) source('load_libraries.R') library(GSEABase) # for ex neur Exsub=c('L2.3.IT', 'L4.IT', 'L5.IT', 'L5.ET', 'L5.6.NP','L6b','L6.IT','L6.CT','L6.IT.Car3') # DI scores #scz=read.csv("tables/Urban_DLPFC_BPD_delta_influence_gt3.csv") scz=read.csv("tables/CMC_SCZ_delta_influence_gt3.csv") #scz=read.csv("tables...
a7eca65d98957db8da66844f0c84da2f1b8c69797f9afb7fc8e6db605386d1f4
R
3,659
115
# run magma before this and store all .out files to data/ rm(list=ls()) source('load_libraries.R') source('aux_functions.R') safri=read.table("data/UCLA_ASD_ASD_micro_safri_enrichment_results.txt",header=T) deg1=read.table("data/gandal_asd.fc-UCLA_ASD_ASD_micro.zscore.mat",header=T) deg2=read.table("data/41586_2022_5...
5ecdeaf735aac1349605de5705739486ac7a99e549ff7240fd826178fbdd7483
R
3,663
90
suppressPackageStartupMessages(library(optparse)) option_list = list( make_option(c("-b", "--iclip_bedgraph"), type='character', help="iCLIP bedgraph (iCount)"), make_option(c("-g", "--intron_set"), type='character', help='mapped introns'), make_option(c("-i", "--intron_db"), type...
8f44904a805bd21668508ba63faab62261798a44c6f91e39d3e92a12996135f4
R
3,667
68
## Filter non-variable probes and probes with constant DNAm >0.9 or <0.1 ## #1. Load data =================================================================================================================== load(paste0(PathToBetas,"fetalBulk_EX3_23pcw_n91.rdat")) #pheno fil...
3f004c5b27e943003a5edc3370ad4f948c3b633d1ceecacb6ac79cba6a19c840
R
3,672
79
#' Map query dataset to the fetal midbrain subatlas #' #' Wrapper function to map a query dataset onto the fetal midbrain subatlas. #' This function uses the Seurat algorithm to project the query dataset onto #' the reference. Upon projection, the midbrain detailed celltype annotation is #' predicted. Furthermore, a ve...
9de9ac8d2ba8f66190fb33d3e7d90192c883eac15e1183f12ab716da4135b397
R
3,684
145
--- title: "QC & filtering" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2023/02/23" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$set...
b967b497f85befd5be276efc78d2bd8d1fe122c5a47d42f179e3439d86c3ed19
R
3,693
76
### library(Seurat) setwd("/projects/ps-renlab/chz272/transposon/05.Paired-ChIP/20.NovaSeq/04.Single_cell_All/04.RNA_Proc/01.RNA_seurat") #pt.seu<-Read10X(data.dir="/projects/ren-transposon/home/chz272/transposon/05.Paired-ChIP/20.NovaSeq/04.Single_cell_All/03.filtered_matrices/RNA_filtered_matrix") #pt.seu<-Read10X(d...
cff7382ef1f6d1eeb48a05df3c6fdadfb780ee489d02fcab271e08be5b2422c9
R
3,693
69
context("compareRhythms_cosinor") load("test_data_ma.rda") test_that("cosinor analysis works for default params and independent sampling", { results <- compareRhythms(expr, exp_design, method = "cosinor") expect_s3_class(results, "data.frame") expect_named(results, c("id", "category", "rhythmic_i...
9dac81da7b42e09e05352f514cf99d0f6c93d9be14d5b0c60ab703f2d2c209b3
R
3,696
85
seurat_process <- function(seurat_object, workers1 = 5, workers2 = 10, maxmem = 32, do_harmony = TRUE){ library(Seurat) #library(monocle3) library(tidyverse) library(patchwork) library(harmony) library("parallel") makecore <- function(workcore, memory){ if(!require(Seurat)) install.packages('Seurat...
8395372aff0719a6a2b20d97791e631d47a2f930413bf0a3ca6c0732cf616d8e
R
3,700
94
pred.vizA <- function (cur_pat){ # Design A: No ystar distribution, only error bar. # Arguments: # <cur_pat> an integer specifying the patient number # Requires: # <pred_xgb> data frame with bootstrap prediction results (output predict.XGB) # <dat_plot> long format data frame with all available me...
838803270eb0ba9948a364170cf257a8dcf948b4175c647a0b21cbe4898fc456
R
3,703
93
library(tidyverse) library(data.table) source("/mnt/data/lijincheng/mGWAS/result/02MRBMA/get_each_MVinput.R") #--------------------{1.getMVinput}----------------------- ##-------------{01 MiBioGen}--------------------------- get_MVinput_for_MRBMA(exposure="mibio", outcome="LOAD", ...
f98298292bf57c0785352cb5f16c83baec55ed73626693069fbb3e8300296227
R
3,707
99
#!/usr/bin/env Rscript #### Title: Scoring markers from our MBM/ECM tumor signatures on bulk patient samples #### Author: Jana Biermann, PhD library(dplyr) library(ggplot2) library(gplots) library(singscore) library(DESeq2) '%notin%' <- Negate('%in%') colBP <- c('#A80D11', '#008DB8') colSCSN <- c('#E1AC24', '#288F5...
2edb63ce2ed93d76bb3620f8102194577e4499c8c37a27ba3a25704ef3e7dc79
R
3,716
76
#### Data analysis - Xuan's EM data #### ## Loading required info library(ggplot2) library(car) library(openxlsx) library(dplyr) #devtools::install_github("coolbutuseless/ggpattern") library(ggpattern) library(coin) set.seed(0) #### Comparison of myelinated axons per area - CA1 #### as.data.frame(read.xlsx...
8b89b90b999367bdc260d8f193802a760cad16d481aeab8d22d16ac3d6922ec5
R
3,723
94
#' Prepare PCA Data from LFQ or LBQ Dataset #' #' This function prepares the PCA input data from either LFQ or LBQ quantitative proteomics data. #' It reshapes the data, performs PCA, and merges sample-level annotation metadata. #' #' @param df A data frame containing the input proteomics data. #' @param annotation A d...
662be0ac518aabf27439cf0492924b53e8229a3c66d7ada345ae9b0b273c0247
R
3,729
75
# Load libraries #### library(DESeq2) library(plotrix) library(ggplot2) library(beeswarm) # Load DESeq2 results #### load("../data/chu/chu_deseq2_results.RData") # Generate plots foldchange plots #### # Panels A and B pdf(useDingbats = F, "../figs/Fig5_A_B.pdf", width = 8, height = 4.5) par(mfrow = c(1, 2...
b97a117965eec622b0e5daa71f6f6d4aa98727ef3178c92b76efa4072b345414
R
3,736
108
# Get pubmed abstracts for DEGs and signature genes with the keywords "Melanoma" and "Tumor" # This script is just for the download, processing is done in extract-pubmed-abstracts.r.ipynb # We set timeouts to not overload NCBI servers library(rentrez) library(dplyr) dataPath = "data/" # DEGs: DEGres = readRDS(paste0...
b0fffe5d98145c00b4f22aefeecc412ac35e81af42f65da98553f1cf2fb7bf3c
R
3,741
86
## 03_doublet_removal.R library(Seurat) library(scDblFinder) library(BiocParallel) set.seed(1234) # Process Li2023 dataset li_obj <- readRDS("li2023_integrated.RDS") li_sce <- as.SingleCellExperiment(li_obj) li_sce_rand <- scDblFinder(li_sce, samples="sample", BPPARAM=MulticoreParam(3)) li_rand <- as.Seurat(li_sce_ra...
17e7637a1a1cdaf652f432311b738d77c557a5c9c5f241fcede3d2672743aa00
R
3,744
113
library(tidyverse) library(MAST) library(Seurat) library(magrittr) library(future) set.seed(1234) # Function to run MAST analysis run_MAST <- function(snRNA, selected_cluster, selected_disease_1, selected_disease_2, output_dir = "results/MAST") { message(sprintf("Processing %s: %s vs %s", sele...