sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
9342219cd1d608b6a6fd9f5391d7e16dff572bf36bdf9c347d5700c19b86eba8
R
8,346
260
# Siwei 11 Mar 2024 # Plot a list of genes from Alena's iMG expression data # init #### { library(edgeR) library(readr) library(readxl) library(Rfast) library(factoextra) library(dplyr) library(stringr) library(ggplot2) library(RColorBrewer) library(ggpubr) library(reshape2) library(sva) }...
ba95057885e3552c8dbb3f32fed230b9b131b3748d93f1b76e6d02ba28cf54df
R
8,350
185
fluidRow( column( width = 2, descriptionBlock( number = " ", header = tagList(icon("torii-gate"), i18n$t("国内事例")), text = i18n$t("チャーター便を含む") ) ), column( width = 1, id = "domesticPCR", descriptionBlock( number = countup(sum(mhlwSummary[日付 == max(日付) & 分類 %in% 0:2]$...
51ac0f51d65ed9611a8a813ca09998d76d7c2c49649da545f09c67cbd6ee051a
R
8,354
208
library(sesame) library(readxl) library(dplyr) library(data.table) library(tidyr) library(parallel) ### Generate betas using SeSAMe IDs <- read_excel("~/Downloads/scripts/MouseArrayMaster.xlsx", sheet = "Data") %>% dplyr::select(Prep, IDAT) pfxes = searchIDATprefixes("/path/idats/") ## IDAT files location (GSE290585...
353ad2718cc08017691aefb8d0382b9610433d5f98f2e0aafe632da9445cf308
R
8,364
177
# ============================================================================ # # Script: PCA and Correlation Analysis for MOCA/IADL Data with Demographic Merging # # Description: # This script performs a principal component analysis (PCA) on patient cognitive # data extracted from imaging records and merges it w...
c4fba8629a532ed47f3607d986a23baf4f76f96ea0152da2d98fc41f4167ffc0
R
8,366
185
library(limma) ########################## ## Define a subroutine ## ########################## limmaTest <- function(inputData, outputLevel, fdrMethod, saveDir, suffix, comparison, comparisonName, columnNames, selColNames, design, contMatrix) { fit = lmFit(inputData[, which(colnames(inputData) %in% selColName...
6b93de01dd3aa404667dbfd892e50002cb84d785cbbe523ae3693931e6d88411
R
8,374
329
#' Workbench Paths and Definitions #' #' Get workbench path depending on the host #' #' @description This function asks for the hosts and returns the appropriate path to wb_command binary #' #' @param par This is a test #' #' @return The path to workbench command #' #' #' @keywords internal #' #' @export #' V = functi...
603c947e81c1f610c7c2e2fb4d1f540eb88eae88ffd695dd57e0ce15d3d1c641
R
8,383
254
rm(list = ls()) library(EnhancedVolcano) # Here is the differential expression table res1 <- read.csv("output/DEGenes_bulk/ADvsResilient.csv") colnames(res1) res2 <- read.csv("output/DEGenes_bulk/ADvsControl.csv") res3 <-read.csv("output/DEGenes_bulk/ResilientvsControl.csv") sel_labs <- (res1[ res1$adj.P.Va...
d3e5207c278d453b66d0ab225cad536dbefb7742c611409938777da81767fd04
R
8,401
252
# Siwei 02 Jul 2024 # Import scRNA-seq data of previous microglia to identify potential samples # use all PFC samples, check PICALM-AD expression, disregard genotype # init #### { library(Seurat) library(Signac) library(edgeR) library(future) library(stringr) library(harmony) library(MAST) library(...
5b761c2b45fffa067f9057e241ec8610b787a7ac4f01195c7e536745e1fd7589
R
8,427
189
library(MuSiC) library(SingleCellExperiment) library(BisqueRNA) library(Biobase) library(hspe) library(rlist) library(HiDecon) load("Mathys23all.RData") source("random.R") set.seed(123) reference.id <- sample(colnames(sim$Mathys23bulk),size=40) ref.list.select <- sim$Mathys23ref[reference.id] cell.counts <- sim$Mathys2...
769c38cb04bf55144a44db6d8bac86b883e86fdde4fd5c731dc2c75690320f68
R
8,427
185
# plot expression over all cell types of the cancer-relevant signature gene # Figure 5 and Suppl Figure 5 options(java.parameters = "-Xmx32g") # to write/read big excel sheets library(ggplot2) library(xlsx) figurePath = "Figures-and-Tables/" cancerGenesMainPlot = paste0(figurePath, "Figure-5-cancer-gene-expr-perc-MB...
8739c555721712b00643f5646876585cec05b5ce12d982b7072a61e4208aae40
R
8,434
230
--- title: "DP04 Gene Signature Enrichment" author: "DanielZucha" date: "`r Sys.Date()`" output: html_document: toc: TRUE toc_float: collapsed: FALSE toc_depth: 3 df_print: paged params: n_cores: 16 editor_options: markdown: wrap: 72 chunk_output_type: inline --- Hi, In this mar...
8365638b064024726a501a2bb346fdeae03ef039f13c64a1e69e1c9c9c5d7418
R
8,448
200
# 02 Normalize Impute.R # 02 Normalize Impute.R ########################################################## ## Add batch info # ########################################################## od1$batch <- "d1" od2$batch <- "d2" #########################################################...
1649acc49961a0a578b78ca1812b99b0a6167cce9fbdb4eca1095118639101c1
R
8,451
243
setwd("~/Documents/mixOmics/") ##### Upload Libraries library(readr) library(mixOmics) library(dplyr) library(readxl) # Import dataset of groups -> Sample ID, Genotype, Diet, and Genotype-Diet interaction and define rownames groups <- as.data.frame(read_excel("~/Documents/mixOmics/Tablas/Groups_full.xlsx", ...
2d316b740132e1b7d99787c565f91d3d3cf37f91a0f813dca52d36b0ab934858
R
8,466
234
# ÓÃÊý¾Ý¿âµÄÊý¾Ý̽Ë÷coding UCRÏà¹Ø»ùÒòµÄ±í´ïģʽ setwd(dir = "D:/R_project/UCR_project/") options(stringsAsFactors = FALSE) rm(list = ls()) library(dbplyr) library(pheatmap) library(readxl) library(stringr) library(tidyverse) library(biomaRt) library(curl) # human brain rpkm human_rpkm <- read.table(file = "01-data/...
a4ec596e771dacf601257dc0e4d0c44d69a1092748050898667592f35d5cbba7
R
8,467
177
# FFERREIRA 12/11/2024 # BEPE - Nina Colaboration / Neanderthals project # MAKE BUBBLE PLOTS FOR GENE ONTOLOGY BIOLOGICAL PROCESS (GO:BP) ## ShinyGO + REVIGO + chatGPT # COMPARISON: NOVA1-ArAr-CTRL vs NOVA1-HuHu-CTRL # Loads LIBs library("RColorBrewer") library("ggplot2") library("ggtext") library("tidyverse") libra...
bc91f717e8e34f721a28006cded690339525f99ed78f37488743a471dca9a49d
R
8,469
374
# Load required libraries library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(dplyr) library(ggplot2) library(enrichR) library(xlsx) # Function to perform pathway enrichment analysis perform_pathway_enrichment <- function(de_genes, pathway_type, sig_threshold = 0.05) { if (pathway_ty...
801e12e956e11a4fe3f700ee888c5844f8422bb5e03880797387d9951dbc7b77
R
8,472
316
# Siwei 18 Sept 2023 # Analyse Alena's RNASeq results in-house # init #### { library(edgeR) library(readr) library(readxl) library(Rfast) library(factoextra) library(dplyr) library(stringr) library(ggplot2) library(RColorBrewer) } # load data #### # ! Novogene "xls" files are actually tab-delimite...
49fcad0e5771be1ed32214fc26332b32bafc14fd608089814c05d96b2d55026f
R
8,498
199
# Authors: Lauren Rylaarsdam, PhD; Andrew Adey, PhD # 2024-2025 ############################################################################################################################ #' @title dimEstimate #' @description Estimate the nv value needed for singular value decomposition with irlba #' #' @param obj Ame...
af55f27858b0db61c76018014d63bcd322f47c030597aa793034af1f62fa9cf8
R
8,512
264
# Siwei 29 Feb 2024 # Make circos plots for Alena's PICALM paper # init #### library(readxl) library(circlize) library(RColorBrewer) library(colorRamps) library(viridis) library(colorspace) library(colorRamps) library(stringr) library(ggplot2) # library(RColorBrewer) ## make line-dot plot ##### df_pathways_2_genes...
37d3e270da6d272be6a07775f4d04f34df5c18915c4a76125fa0433f5be22b38
R
8,596
160
options(stringsAsFactors = FALSE) library(ggplot2) library(reshape2) library(dplyr) library(stringr) library(lme4) library(lmerTest) library(RColorBrewer) library(ggpubr) library(pheatmap) library(grid) # load META-CS indel count matrix metacs.ds <- readRDS("data/indel_counts.metacs.ds.rds") metacs.ss <- readRDS("dat...
bfa983aa41c470a59860be971ddae88a686bdcd52ec2ae90ffc4fdb642db1510
R
8,619
197
## ## Calculate DESeq2 results, generate tables, heatmaps, and gene set enrichment. ## deseq2_compare = function(deseq_dataset, contrast = NULL, name = NULL, genome = NULL) { suppressPackageStartupMessages({ library(magrittr) library(dplyr) library(tidyr) library(glue) library(DESeq2) libra...
d7aec401d762cb04438a4fadec03ccb20f89b8487950db4a5a0d11fe708c13f4
R
8,667
238
library(KFAS) options(digits=10) # should run this from the statsmodels/statsmodels directory dta <- read.csv('datasets/macrodata/macrodata.csv') obs <- diff(log(data.matrix(dta[c('realgdp','realcons','realinv')])))[1:9,] T <- t(matrix( c(-0.1119908792, 0.8441841604, 0.0238725303, 0.2629347724, 0.4996718412, -...
8829bb1302eba7c842e92aa339d14d3c213bd9d1a2215724f646b59033d5f37c
R
8,669
238
library(scrattch.vis) library(feather) library(tidyverse) library(colorspace) options(stringsAsFactors = F) # Setting working directory ----------------------------------------------- # this.dir <- dirname(parent.frame(2)$ofile) # setwd(this.dir) # Extract expression data for selected genes and t-types ------------...
14c2045d39b6828e98ccf9a5a9d5ae34b344d9119b62f772195ec0c305ac7352
R
8,679
288
# 10 Jan 2024 Siwei # use is.nan instead of is.infinite as the value of div/0 is now NaN # 19 Oct 2023 Siwei # Write a loop to walk through all ready-made BAM files # SplitCigarNReads skipped, should not cause major problem # 06 Jan 2024 Siwei # add a few lines so the code can run independently (i.e. multiple instanc...
7ebded87ad12bd8b5e4d8eba4e49d5eab7ca8144fe86ab7e6ef62c29a40f00af
R
8,692
237
library("tidyverse") library("data.table") library("stringr") library("openxlsx") library("grDevices") library(readxl) library(dplyr) library(MRcML) library(MendelianRandomization) library(TwoSampleMR) library("doParallel") #¼ÓÔØdoParallel°üÓÃÓÚÖ®ºó×¢²á½ø³Ì library("foreach") #µ¼Èëforeach°ü ##02 mibio ku...
d7b501300e8d623ccf71e49222870b6e2ecdf73dec4eab69f8b5a08961ad58bf
R
8,692
303
#' PlotGenome #' #' Plot Allelic ratio along the genome for duplication detection. #' @param orderedTable The variable containing the output of the MajorMinorCalc function #' @param Window an odd number determining the window of the moving average plot, usually 151 #' @param Ylim the plot y axes maximal limit, usually ...
7e302f848ed3f249bf75219643a7e29e7afcb5d4be170da1fbde52aae980dd0b
R
8,693
154
# The tximport pipeline. # So this code has these following input that can be uptaken: # (1) necessary: the father direcotry where all the salmon files folder locate + metadata that has sample_name column containing the name of each salmon folder. # (2) necassary: specify the species. mouse/human will lead to the usa...
cf6840d6be35c08742771309f7f45721adb339c9f76993ed18589f0934cf32ab
R
8,698
192
--- title: "Additional Utilties" output: html_document: default pdf_document: latex_engine: xelatex date: "2024-11-13" author: "Lauren Rylaarsdam" --- Some Amethyst utilities were not covered in the brain and pbmc vignettes for the sake of clarity. In this vignette, we will cover those additional functions us...
d4ca2d9d64762405a41a3de620929a7cfef27a83ea13bca1f3482dfd15e345ca
R
8,726
209
## Test enrichment of gene lists within EWAS results ## epicAnnotGeneList <- read.csv(paste0(refPath, "EPIC_annot_SFARI_SCHEMA.csv"), row.names=1) sfari <- unique(epicAnnotGeneList$SFARI.Gene[-which(is.na(epicAnnotGeneList$SFARI.Gene)|epicAnnotGeneList$SFARI.Gene=='')]) schema <- unique(epicAnnotGeneList$SCHEMA.Gen...
6896b7d769338810608fcafde1d487fb34e76522188c3118b0aba85ed8a261ab
R
8,731
262
#OPEN LIBRARIES ```{r} library(kronos) gg_kronos_sinusoid_noNA <- function(kronosOut, fill = "unique_group"){ requireNamespace("ggplot2") d <- merge(kronosOut@input, kronosOut@to_plot, by="row.names", all=TRUE)[,-1] d_noNA <- na.omit(d) x_obs <- paste0(kronosOut@plot_info$time, ".x") x_pred = paste0(k...
229156ccff252bb881e60cbcdc272f2dca712159c6086d58f353e1cbe78d8d8f
R
8,738
263
library("tidyverse") library("sessioninfo") library("DeconvoBuddies") library("here") library("viridis") library(spatialLIBD) library(ggrepel) # library("GGally") ## prep dirs ## plot_dir <- here("plots", "08_bulk_deconvolution", "14_deconvo_plots_layer") if (!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRU...
732482eb78728e3584b273fbd0951eca18120091007d0539c9e984b7ea9bf488
R
8,749
270
#!/usr/bin/env Rscript print("##################################################") print("# Contamination estimation with decontX #") print("##################################################") library("argparse") parser <- ArgumentParser(description='Identifies contamination from factors such as ambient RN...
4fac08a02835389f919fb3f7379e3c2d735ef18c647932d5d2eba6732a2be9f5
R
8,762
235
--- title: "R Notebook of E12R1 scATAC processing at clade level with pre-defined joitn feature space" output: html_notebook --- ```{r Libraries, include=FALSE} load.libs <- c( "Signac", "tidyverse", "dplyr", "BSgenome.Mmusculus.UCSC.mm10", "RColorBrewer", "future", "GenomicRanges", "EnsDb.Mmusculus.v7...
4def7222b014c4fe02a700c6fff4dbcd6b9bb5db005cb23ab56b584ca825aca8
R
8,763
198
#' Plot statistics for the first-tier mapping using \code{ComplexHeatmap} #' #' Plot statistics for the first-tier mapping using \code{ComplexHeatmap} (Fig 3) #' #' @param inpMat A matrix from \code{getWBstats()}, or a list of multiple matrices. If names detected in the list, they are shown in the legend as study nam...
c96f949c8b9905cc493e256096e99dcaea2572c1eb2c42cf324ef0e5febfd314
R
8,769
262
#OPEN LIBRARIES ```{r} library(kronos) gg_kronos_sinusoid_noNA <- function(kronosOut, fill = "unique_group"){ requireNamespace("ggplot2") d <- merge(kronosOut@input, kronosOut@to_plot, by="row.names", all=TRUE)[,-1] d_noNA <- na.omit(d) x_obs <- paste0(kronosOut@plot_info$time, ".x") x_pred = paste0(k...
1d8b53ff148680f97241c98333ec91139e98e0e6596d9d4c9deba3c99915c973
R
8,782
198
#' Plot statistics for the first-tier mapping using \code{ComplexHeatmap} #' #' Plot statistics for the first-tier mapping using \code{ComplexHeatmap} (Fig 3) #' #' @param inpMat A matrix from \code{getWBstats()}, or a list of multiple matrices. If names detected in the list, they are shown in the legend as study nam...
6b43787b23222042ea7baa7540c6b77a1161014019ec1d31ed60fd1912b03f80
R
8,814
305
# make disease/gene group plots for LDSC enrichment # peaks enriched from bulk ATAC-seq Ast, MG, GA, NGN2 # focus on the enrichment of Als and Alz # Siwei 26 Jun 2023 # init library(ggplot2) library(readr) library(RColorBrewer) library(stringr) # load data ##### raw_df <- read_delim("combined_output_Ast_MG_GA_NGN2_...
8dbf0057e14060f4415d8fd1fa309320128f30e3c461464518c5c0528bad2dd5
R
8,818
173
################################################################################ # Script to plot from .csv files the regional brain maps of: (1) MIND networks # and (2) effect sizes of MIND degree after stratifying by cognition and symptoms #########################################################################...
295c145f4efdc19212b3ac7c4b4c292214f67e52d1912ceb9ca1c53d708b312b
R
8,824
216
library("SummarizedExperiment") library("tidyverse") library("EnhancedVolcano") library("here") library("sessioninfo") library("ggrepel") library("jaffelab") library("UpSetR") #### Set up #### ## dirs plot_dir <- here("plots", "09_bulk_DE", "11_GO_analysis") if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive =...
adca947daabe294418a0ff71ffba7c7d98f4271ff6e65ccde4cd1ec7fdcdd697
R
8,857
274
## Load plink before starting R: # module load plink/1.90b6.6 ## Also load twas fusion code # module load fusion_twas/github library("SummarizedExperiment") library("jaffelab") library("data.table") library("sessioninfo") library("getopt") library("BiocParallel") library("tidyr") library("here") ## For styling this s...
0c6084614d7016998c9f68d867a24402fde43c35d72161328932cac0779d6b81
R
8,859
248
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) library(ComplexHeatmap) library(circlize) #genes that are relevant across drugs? sensitivity gen...
ca344a751f2ebecb9e1173e84e0fa6a65aff52b7fbe76b325eaa3534022a618b
R
8,864
221
#' utils.r #' #' Utility functions for the dhcp dataset #' #' #' Make thresholded t-statistic maps. #' #' Performs one-sample t-test and writes tmap rds, cifti, and png for reporting #' # SAVE ACTIVATIONS (BIN MASK) AS CIFTI NOT CURRENTLY WORKING (templateICAr 0.2.3) #' #' @import ciftiTools #' #' @param ses_pair DHCP...
48c52beb6525e212bc619e62fac5aae6128f7cce2ca75f7ec37ad0ec11004e86
R
8,884
289
# 19 Dec 2023 Siwei # Reconstruct the Velmeshev raw object from scratch (mtx files) # Will integrate as instructed in their github code # https://github.com/velmeshevlab/dev_hum_cortex/blob/main/snRNAseq_integration # init #### { library(Seurat) library(Signac) library(readr) library(future) library(parallel...
d2ecc64e53d7a2f5a5561cda9107a8e024d63d9068d4e94f3d1da4f45764f699
R
8,894
283
rm(list = ls()) library(EnhancedVolcano) # Here is the differential expression table res1 <- read.csv("output/DEGenes_bulk/ADvsResilient.csv") colnames(res1) res2 <- read.csv("output/DEGenes_bulk/ADvsControl.csv") res3 <-read.csv("output/DEGenes_bulk/ResilientvsControl.csv") sel_labs <- (res1[ res1$adj.P.Va...
df41433ee382c06f58b421be0a7dee2d607fbb4b2775a76ed2c460eda556f223
R
8,927
220
library(tidyverse) library(glue) library(zoo) #' convert peka _distribution table to long format with one row per position and kmer peka_wide_to_long <- function(df, kmers, first_posn_idx = 14) { # all remaining columns after first are the position cols coord_cols <- colnames(df)[14:length(colnames(df))] df ...
334e9affc2c82bd42208e3fff9862f99d1f88683d193628fcaae0bb26ecfc7da
R
8,953
244
# ============================================================================= # 细胞注释脚本 # ============================================================================= # 功能:对细胞进行注释和差异表达分析 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf <- list.files("./") for (file in...
798ff0c0a368d63cdf254735b2771126a67ded4c76e6561384dec75c0d90f2cb
R
8,959
241
library("tidyverse") library("data.table") library("stringr") library("openxlsx") library("grDevices") library(readxl) library(dplyr) library(MRcML) library(MendelianRandomization) library(TwoSampleMR) library("doParallel") #¼ÓÔØdoParallel°üÓÃÓÚÖ®ºó×¢²á½ø³Ì library("foreach") #µ¼Èëforeach°ü blood_doubl...
f2ddd33980e73727060dd006190d714aa7e473554adbe9e9eeef0fe8db3bcd82
R
8,962
159
#Make plots (part 2) ############################################################################################### #Libraries library(Seurat) library(tidyverse) library(RColorBrewer) #Load mapped Seurat data with reductions df = LoadSeuratRds("3_integrated_samples/integrated_with_reductions.rds") #Create column wi...
639abebee7a2026c44b2640693c657eb41cc58bf724e1e162eb82febee27d4ea
R
8,986
238
library(AnnotationDbi) library(gprofiler2) library(dplyr) library(xlsx) library(parallel) library(ggplot2) library(stringr) # for str_wrap to wrap labels library(gridExtra) library(grid) library(rrvgo) # for TreeMap library(png) dataPath = "data/" figurePath = "Figures-and-Tables/" figure4file = paste0(figurePath,"Fig...
6a117726622cae412d81928166707e6e79a8681ffdf46715233b800affd0a8fa
R
8,988
250
#### library(readxl) library(jaffelab) library(readr) library(pracma) dir.create("star_pdfs") options(width=100) ## read in reference data ref = read_excel("raw_data/Star_expected_expression_revisionMNT.xlsx") ref = as.data.frame(ref[,1:5]) ref_mat = as.matrix(ref[,2:5]) rownames(ref_mat) = ref$Population ## read in...
f0b1975843cf80493bfe64e26eb61ac040417cc91c40657236c8b1cbe0b41984
R
8,993
221
# Author: Somnath Tagore, Ph.D. Title: Running KINOMO for performing Non-negative Matrix Factorization using gene expression data # Script Name: kinomo_run.R # Last Updated: 01/24/2022 #Instructions #The KINOMO repsository can be accessed via https://github.com/IzarLab/KINOMO.git #Convert the gene expression data (ra...
2af764ce26304faaff5b3586933d157c1f965626f8873a9ca2c2f9db054798be
R
9,026
172
#' Run differential rhythmicity analysis #' #' The differential rhythmicity analysis is run with a call to this function. To #' execute this function, the three necessary ingredients are the timeseries #' data, the experimental design and parameters to choose and tune the method. #' #' @param data A matrix of log2 expr...
86e287dbd0f1424af591d3f57ee614f7b4d3d0b403c688ce3c202800d7c2fb52
R
9,043
193
library(tidyverse) # Script to re-process PAPA results tables and add additional output # 1. Combined df containing results for all experiments (alogn with per-experiment) # 2. De-duplicating gene name values (due to a stupid design decision on my part) # 3. Re-annotating bleedthrough events if called as novel extensi...
f189610b3f8c3c7ad8be2ee1c02b22a5927ded6715d6989b1aafd907aeb95595
R
9,043
214
library("tidyverse") library("sessioninfo") library("BayesPrism") library("here") ## prep dirs ## data_dir <- here("processed-data", "08_bulk_deconvolution", "03_get_est_prop") if (!dir.exists(data_dir)) dir.create(data_dir, recursive = TRUE) #### data details #### ## dataset properties dataset_lt <- tibble(Dataset ...
7f9dc33de9961ce1d11b1f709073b4997cb03dc818f20e23f4c1aaddd34e34e9
R
9,059
224
--- title: "APA x iCLIP" output: html_notebook --- ```{r} library(ggsci) library(ggplot2) theme_Publication <- function(base_size=14, base_family="Helvetica") { library(grid) library(ggthemes) (theme_foundation(base_size=base_size, base_family=base_family) + theme(plot.title = element_text(fac...
453fb5df5709778c5f60349eabf44956dcc826a10c8e48136b732cff89c8c5f6
R
9,061
300
# Functions and plot themes for autopsy SARS-CoV-2 analyses: # lists: PlotTheme = theme_bw() + theme(axis.line = element_line(colour = "black"), axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1), panel.grid.major = element_blank(), panel.grid.minor = el...
de57e4f5a21647d794407aec56e2064c7beade24effa1b656fe4b029b15fa72a
R
9,079
257
# Load required packages library(data.table) library(dplyr) library(stringr) library(purrr) library(ggplot2) library(ggrepel) library(readr) # -------------------------- 1. Set Up Working Environment -------------------------- # Replace these paths with your actual directories gwas_path <- "[Path to your GW...
c3e6edb4c73e93dda930d19df75b8bb70d30320c67d0b28b4b9530abfe79a917
R
9,086
264
require(optparse) require(tidyverse) require(ggpubr) require(cowplot) require(scattermore) require(extrafont) # variables SETS_MAIN = c( 'experimentally_derived_regulons_pruned_w_viper_networks-EX', 'experimentally_derived_regulons_pruned-bulkgenexpr', 'experimentally_derived_regulons_pruned-bulkscgenexpr'...
158efaa107d0d0ad7ba4b674c8bc3eed6ee33524af75bb57095c7dddf6b7e65d
R
9,088
220
library(dplyr) library(Seurat) library(ggplot2) library(clusterProfiler) library(nichenetr) library(org.Mm.eg.db) library(readxl) # Set up directory setwd("/project/Campbell_Lab/yl7mfw/Data Analysis/20250317_Integrating birds OT with mammalian SC") # Load HTM data HTM.integrated <- readRDS("/sfs/gpfs/tardis/project/C...
ab3154fd559b2443cb066351ca11cbaa6c0c904bd08fa54c743ae05c65e4bf41
R
9,090
208
library(tidyverse) library(fgsea) source("../riboseq/helpers.R") # load in get_ranked_gene_list set.seed(123) dbrn_tbl <- read_tsv("processed/peka/papa/2023-11-27_papa_cryptics_kmer6_window_250_distal_window_500_relpos_0.cleaned_6mer_distribution_genome_simple.tsv") # remove bleedtrhough events, too low n to be reliab...
5a89bb1acdbea9336673c32bad50e77c5d8e056632c5f449db4974cc70945bd8
R
9,098
240
library("tidyverse") library("SummarizedExperiment") library("here") library("sessioninfo") #### Plot Setup #### plot_dir = here("plots","00_data_prep","02_update_experiment_tile") if(!dir.exists(plot_dir)) dir.create(plot_dir) pos_df <- tibble(Position = c("Anterior", "Middle", "Posterior"), pos =...
69115f74820e8d7b9fe76bb5f13ea75b01c1d51cbee14945b5fe09f07e9ed8ca
R
9,106
173
```{r} # BAR-seq coronal data # data is shrunk by removing image stitching-related artefacts (cf. Xiaoyin's email) # data is quality controlled by keeping cells with genes/cell >= 5 and reads/cell >= 20 # data alongside CCF and slide coordinates are saved and can be used for analysis # load libraries suppressPackageS...
687d2e94731ab0e6c26f3b0dbc9ed2b300548cff393d5bc6ae10cedb020b96c2
R
9,114
270
# Analysis of QC metrics library(tidyverse) library(patchwork) theme_set(theme_minimal() + theme(text = element_text(size = 16))) cell_colours <- RColorBrewer::brewer.pal(6, "Dark2") names(cell_colours) <- c("adipocytes", "basal", "endothelial", "luminal differentiated", "luminal progenitors", "stromal") # Read da...
7d33c51a697b8230b7376e6964beae68764a00a7148efbd094e0c82b669d2c69
R
9,121
240
# Plot relevant pathways from CellChat results - cell subtypes # 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.com/jinworks/Cell...
1ae7bc5e400a50fd44bba3448e1128053c0377dd9bfbb4803298e865617244a1
R
9,131
231
library("tidyverse") library("data.table") library("readxl") library("dplyr") library("TwoSampleMR") library("stringr") library("openxlsx") library("grDevices") library(readxl) library(dplyr) library(MRcML) library(MendelianRandomization) ###loop library("doParallel") #¼ÓÔØdoParallel°üÓÃÓÚÖ®ºó×¢²á½ø³Ì library("for...
0fef44d004d9247d01ce0766bc4d0aebcd544036bfe2ee15a93f3ebf11597092
R
9,137
219
library(limma) library(MASS) library(FNN) ################## ## Data loading ## ################## # Input file is a "raw_..._scan.txt" file generated from itraq.pl main script ## Extract a suffix from the input file name suffix = tail(unlist(strsplit(inputFile, "/")), 1); suffix = gsub("raw_", "", suffix) ...
334443a5f8bc4f918e366198a56efdd48da34189884377730d8872aa99dcf11c
R
9,176
195
# Differential expression analysis was performed on GEO2R portal. setwd("from_GEO2R_portal/") # R version 4.2.2 library(ggplot2) # version 3.4.2 library(EnhancedVolcano) # version 1.16.0 # GSE165595, expression of serine-related genes and neurotransmitters ---- # read norm counts glioma = read.delim(file = gzfile('GSE1...
d9af17ff5f8fd7570c25d362abd62fdf5cdca91fa4afa63c79e51d2469b5e4ff
R
9,178
221
.libPaths("/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library") library(ggplot2) library(parallel) library(gamlss) library(tidyverse) library(rcompanion) fit_braincharts_model <- function(roi, dat, sw_dir, out_dir, plotting, ncores = 1){ #' fit_braincharts_model(roi, data, sw_dir, out_dir) #' ...
7c731cfbc929ada5deb622bb817485832836b578d2e96e2346ff9b81dd0c0373
R
9,183
305
observeEvent(input$sideBarTab, { if (input$sideBarTab == "route") { # GLOBAL_VALUE <- list(signateDetail = NULL) # TEST GLOBAL_VALUE$signateDetail <- fread(file = paste0(DATA_PATH, "resultSignateDetail.csv")) GLOBAL_VALUE$signateLink <- fread(file = paste0(DATA_PATH, "resultSignateLink.csv")) ...
02ccfdac99d28a53fbe6364b9b5d7192ba1ab25bcdac1cdb275ac7799fe94db4
R
9,193
197
--- title: "FPN_CAP_behavior_12s_36s" author: "Asia Ferrari" date: "2024-11-10" output: html_document --- ```{r} # Load necessary libraries library(dplyr) library(ggplot2) library(readr) library(readxl) library(MASS) library(knitr) library(kableExtra) library(car) library(multcomp) library(stats) li...
ea902df8e86065081723aed23df04ed2a148bdd565a40e0d845c3c936e94f804
R
9,204
331
rm(list = ls()) library(stringr) library(ggplot2) library(RColorBrewer) library(patchwork) library(dplyr) library(DirichletReg) library(tibble) library(car) #cell_counts <- read.csv("Qupath_DLPFC/pourya_reannotated.csv") cell_counts <- read.csv("Qupath_DLPFC/annotations_processed_V2.csv") temp <- as.data.frame.matr...
310410cd9dec6e79fb84f711dd35766a45cdceaf8286abadcf12e348d898b465
R
9,235
163
#generate plots for results of the Tabula sapiens data set ##### load packages and results from scdrs/ours/fuma/magma ##### if (!require("here")) { install.packages("here") library("here") } if (!require("tidyverse")) { install.packages("tidyverse") library("tidyverse") } if (!require("magrittr")) { install.p...
c07dc29b0ad47d814678bdf9483a9122e05aee8054bbf2da87ec1d838502c8e8
R
9,236
312
# 20 Dec 2023 Siwei # Will integrate as instructed in their github code # https://github.com/velmeshevlab/dev_hum_cortex/blob/main/snRNAseq_integration # Subset the reconstructed Velmeshev object into Ex and IN subsets # Need to make the plots separately # init #### { library(Seurat) library(readr) library(fut...
6f127886348a7808d1a2666ff94ff63edcff96508e3c092d69d6ceed891d1d8f
R
9,253
196
--- title: "FPN_CAP_behavior_12s" author: "Asia Ferrari" date: "2024-11-10" output: html_document --- ```{r} # Load necessary libraries library(dplyr) library(ggplot2) library(readr) library(readxl) library(MASS) library(knitr) library(kableExtra) library(car) library(multcomp) library(stats) librar...
b018bae32868b749404f84ab9b67e58f5694ce755b8c178f72670cb1cdeb8c54
R
9,274
249
# fig 3A and figure S5 # check the 1000 iterations of KRAB-ZNFs (with random gene sets) to TEs library(dplyr) library(purrr) library(ggplot2) library(tidyr) library(foreach) library(doParallel) get_count_parallel <- function(dir_path){ # Create a vector of file names file_names <- paste0(dir_path, 1:1000, "_...
59dff67d98c293b62a7455a5bb56ed5637aa480f20a37be833ceed57da2d5fae
R
9,275
253
# ---------------------------------------------------------------------------- # Libraries and setup ---- library("hdf5r") library("rhdf5") library("scRepertoire") library("Seurat") library("SeuratDisk") library("tidyverse") library("argparse") set.seed(7620) # Command line arguments ---- parser <- ArgumentParser(de...
1334e3090ab916433a02b229f26addbfbd34f229b1c4a019adb9d44ef40f90ed
R
9,286
233
# prep combined TCGA and Tempus data frame ------------------------------------ # R version 4.2.2 library(biomaRt) # version 2.54.0 library(rtracklayer) # version 1.58.0 library(dplyr) # version 1.1.2 ## read Tempus data ---- P1 = read.delim(file = 'read_counts/htseq_P1.txt', header = FALSE, row.names = 1) P3 = read.de...
f2b542e1b9a2070db3ba9ab2f7be4dca3cac505adefcce1b3ac39f3ec7d4af88
R
9,286
302
# Siwei 03 Jul 2023 ##### # plot a large PCA include MG, Ast, GA, and possibly NGN2 # ATAC-Seq data using the count matrix of Kosoy et al. (syn26207321) # (microglia regulome) # init ##### library(readr) library(edgeR) library(Rfast) library(factoextra) library(Rtsne) library(irlba) library(stringr) library(dplyr)...
19c5ca4c6a4fdb7568e927f15cae5ec61df1e993d86ed8a0c253b0257dba2c98
R
9,290
175
# ¶ÔGRCh38»ùÒò×éµÄ»ùÒò×é×¢ÊÍÎļþ½øÐÐÕûÀí£¬ÓÃÓÚÖ®ºóµÄGO¸»¼¯·ÖÎö rm(list = ls()) setwd(dir = "D:/R_project/UCR_project") library(tidyverse) library(data.table) GRCh38.gtf <- fread(input = "02-analysis/07-UCR_Classification/Homo_sapiens.GRCh38.110.gtf", sep = "\t") colnames(GRCh38.gtf) <- c("Chrom"...
8c62d0a535820fb15e4b41cde4c4962aa3bf8614d600bbcdd5c4ac4e5a9dd4f9
R
9,306
221
library(Seurat) library(harmony) library(future) library(BiocParallel) library(scDblFinder) library(igraph) library(leidenAlg) library(reticulate) Sys.setenv(RETICULATE_PYTHON="/usr/bin/python3") library(reticulate) sc<-import("scanpy") set.seed(1234) snRNA<-readRDS(file="objects/snRNA/snRNA_merged_only.RDS") snRNA.l...
30216eccc2c030a98bef34e500845475932153bc494aabe3afbf530dcd41c159
R
9,319
283
# Siwei 19 Sept 2024 # Import scRNA-seq data of GSE254025 # found another source of raw_h5ad, claimed to be annotated # Check the expression of PICALM in risk vs non-risk cells # also compare Alena's iMG snRNA-seq with GSE254025's HOMEO, LDAM, DAM populations # run hierachical clustering # init #### { library(Seurat...
b3f424336fcf19f6ebbd3be1b840a0250a6b71fb3af1e5f78ee0ef7dd2db867e
R
9,329
263
#### library(readxl) library(jaffelab) library(readr) library(pracma) library(RColorBrewer) options(width=100) dir.create("triangle_pdfs") ## read in reference data ref = read_excel("raw_data/Triangle_expected_expression_revisionMNT.xlsx") ref = as.data.frame(ref[,1:5]) ref_mat = as.matrix(ref[,2:5]) rownames(ref_mat...
0136bdcc1940294acc2929a4b8c60f00bf86bfb4cda641094cb68956cac4e02c
R
9,343
311
source( file = "global.R", local = T, encoding = "UTF-8" ) shinyUI( dashboardPage( skin = "red", title = i18n$t("新型コロナウイルス感染速報"), options = list(sidebarExpandOnHover = TRUE), header = dashboardHeader( title = paste0("🦠 ", i18n$t("新型コロナウイルス感染速報")), titleWidth = 350, controlbar...
954684860db2548bbfcb4d27a22cb84d9c0ef8ca09c044a2a77882dc9db44094
R
9,349
148
# this script produces plots for analyses that relied on observed data only library(tidyverse) # version 2.0.0 library(gratia) # version 0.10.0 library(patchwork) # version 1.3.0 library(MetBrewer) # version 0.2.0 # this script produces composite plots of the partial effects of LSNS on our outcomes comparing them to ...
c396d9d85eec3b0c528864be1efa6fba19f185697ef98295e603357f8930cc4d
R
9,365
187
library(ggplot2) library(corrplot) library(psych) library(plotrix) perf_data = read.delim("mechanical_perfusion_donor_data.tsv", sep = "\t") perf_data$Age = as.numeric(perf_data$Age..Private.) perf_data$PMI = as.numeric(gsub(" hours", "", perf_data$Total.PMI)) perf_data$`Amount Perfused` = as.numeric(gsub("L", "", pe...
f4f183862218fb6cefd7f91760af587493ca446d7206caa8ab17a2a5ac1fdc2a
R
9,367
220
--- title: "2. A quick application of coloclization analysis" date: "2023-05-01" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Quick_start} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} lang: en-US --- ```{r, include = FALSE} knitr::opts_chunk$set( echo=TRUE, progress =FALS...
119245e3c11739faca9c09996e7ca8999984e1049e49c577e97ae6e1bf6d7dfc
R
9,415
189
# function for plotting with interactionTrack # Siwei 25 Dec 2019 plot_anywhere_interact_seg <- function(chr, start, end, gene_name = "", SNPname = "", SNPposition = 1L, mcols = 100, strand = "+", x_offset_1 = 0, x...
8aa9bc990d49a8a8d993ce69f360f92c58861b356fad41e330adfb2015598817
R
9,415
207
```{r} # MERFISH brain receptor map 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", ...
b2b0548188156201f68cdc294641aeabf1c394435bccac70029ae8680f78efe8
R
9,415
177
# function for plotting rs2027349 site # revised from plot_anywhere # Use OverlayTrack to combine data tracks plot_AsoC_composite <- function(chr, start, end, gene_name = "", mcols = 100, strand = "+", x_offset_1 = 0, x_offset_2 = 0, ylimit = 400, ...
cd603213c033b8a8bfe836e6faf358fc1f88705fdc7bb402979d96a807325895
R
9,425
262
#!/usr/bin/env Rscript ### calculate diversity ### # install required packages required_pkg <- c("optparse", "ape", "rbiom", "compositions", "BiocManager") a <- sapply(required_pkg, function(x) { if (!requireNamespace(x, quietly = TRUE)) install.packages(x, repos = "http://cran.us.r-project.org") }) if (! "microb...
47024f64970d6ab0b7b8a48dbeecbdee2c2f1122e9869b4f801e48226515d664
R
9,426
238
--- title: "LP label transfer annotation" author: "Yuanming Liu" date: "2024/7/17" output: html_document --- # Enter commands in R to install Seurat rm(list = ls()) # load them up into R library(dplyr) library(Seurat) library(ggplot2) library(hdf5r) library(googleVis) # Set up directory setwd("/project/Campb...
65c70bb4795c9b7d5f4533c1e57e19d4e974c908357c6e0d751635ea8e2c010d
R
9,445
226
--- title: "Convert tree shrew orthologous genes to mouse genes" author: "Yuanming Liu" date: "2024/4/14" output: Orthl_document --- # R version 4.3.1 (2023-06-16 ucrt) # Platform: x86_64-w64-mingw32/x64 (64-bit) # Running under: Windows 11 x64 (build 22631) # Matrix products: default ...
c1afcc1668a3cbef88b618cbe397140fda3f708a38a7df0aca7d88fa7868b195
R
9,453
210
#!/usr/bin/env Rscript ### title: Counting number of IG combinations in B cells ### authors: Jana Biermann,PhD; Yiping Wang, PhD library(Seurat) library(destiny) library(dplyr) library(ggplot2) library(cowplot) library(scater) library(SingleCellExperiment) library(gplots) library(viridis) library(ggvenn) library(ggal...
8e62e6a17db74d62664db9d54db6d8c405db42aeca00561be07f3aee04efa9c8
R
9,455
221
library(tidyverse) library(ggprism) # Calculate a group-wise empirical p-value # Null hypothesis = no difference in values between the control group and the treatment group i.e. they come from the same distribution # test statistic = number (fraction) of times control samples are further from the control mean (absolut...
4ce0e360801098e25c95f6b3997432806e4607f19d4c44238997be078b115296
R
9,470
305
# Siwei 16 Jan 2025 # reshape Alena's new batch 2 data and plot { library(stringr) # library(Seurat) library(parallel) library(future) # library(glmGamPoi) # library(edgeR) library(data.table) library(readr) library(readxl) library(dplyr) library(tidyr) library(reshape2) library(scales...
15212b30b9aa4468ec3a5ef94c3ab959c8a93ec1e637f3a25bcb2a8c9063046d
R
9,473
218
#' Create a polygenic score #' #' @description Use user-provided list of genetic variants with weights for a trait to create a polygenic score. Uses the imputed BGEN files (field 22828) or WGS DRAGEN BGEN files (field 24309) data and load as data.frame #' #' Uses plink2 to create the score (https://www.cog-genomics.org...
cc7d595b6d4308f7d624ea92b5fbf6e0b2fda69fe8e29fb15e67c3c6901e5f4b
R
9,495
215
library(tidyverse) #' run bedtools slop on a BED file to extend interval by user-specified distance extend_bed <- function(bed, chromsizes, flank_interval, outfile, bedtools_path = "/home/sam/mambaforge-pypy3/envs/pybioinfo/bin/bedtools") { if (!dirname(outfile) == ".") { system(paste("mkdir -p", dirname(outf...
0dcb4d1fba49c4352cdebb68e3f143a7a96b33ba094add4cafd7aaad1ab70e18
R
9,523
202
library(matrixStats) # 1.3.0 library(dplyr) # 1.1.4 # functions to calculate the fold of IQR cal.fold <- function(x, Q1, Q3, IQR) { if (x > Q3) { return((x - Q3) / IQR) } else if (x >= Q1) { return(0) } else { return((x - Q1) / IQR) } } cal.folds.rowwise <- function(a.ro...
1f14313dd47acad7a4b47c73ae2fcf6da382d2517f46a175e05f8335635a56fa
R
9,531
270
library("SummarizedExperiment") library("tidyverse") library("sessioninfo") library("here") library("jaffelab") library("recount") # library("viridis") library("ggrepel") library("GGally") # library("vsn") ## prep dirs ## plot_dir <- here("plots", "10_bulk_vs_sn_DE", "02_explore_sn_v_bulk") if (!dir.exists(plot_dir))...
b9a1af8847b673e4b62aa256f39bb1db20f267791b2b4e1ebfb2cf822bafa105
R
9,540
303
# Siwei 03 Jul 2023 ##### # plot a large PCA include MG, Ast, GA, and possibly NGN2 # ATAC-Seq data using the count matrix of Kosoy et al. (syn26207321) # (microglia regulome) # init ##### library(readr) library(edgeR) library(Rfast) library(factoextra) library(Rtsne) library(irlba) library(stringr) library(dplyr)...