sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
3b279c23e3153bd661297ae842165cee8725239f82ebac491e3e8c0ff22dda03
R
6,805
142
#!/usr/bin/env Rscript library("optparse") library(data.table) library(tidyverse) library(DESeq2) run_standard_deseq = function(folder_of_featurecounts, base_grep = "Ctrl", contrast_grep = "TDPKD", grep_pattern = "", ...
02ac6be6bc737ae6c3d1b0cdc80c2b254d9997b469c2a0bfb8748c276ab92457
R
6,806
153
```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(WVPlots) library(clue) library(tidyverse) library(dplyr) library(tidyr) library(ggplot2) library(ggExtra) library(cowplot) theme_set(theme_cowplot()) library(corrplot) library(visreg) library(ggcorrplot) library(ggseg3d) library(ggseg) library(ggseg...
e20c82bd75a83674e1074e20b5fbcc55e90f485f1908c90591fd16a33add2f8e
R
6,807
228
#3 # primary and secondary cortex correlation check From previous results, we know that only cluster1 and cluster2 have correlations detected. In this section, I am going to analyze the 1000 iterations result: (1) check with pvalue (2) check the idea range of coefficient (3) overlapped the results with ChIP-exo. Then ...
289973d9ab70f598d8eec8b07125782d2ebe58312fde280b43ba730d61b6340f
R
6,809
170
#null simulation: take input data set #1: expression data sets #2: (cell) seed file, with each rows indicate the index of cells to be sampled as the fake cell type #3: gs file #4: gwas raw file #5: process file: print out process of the program #6: number of thread #7: output file #8: output directory: for temporary FU...
5b7fbefb89d515ef9f14ef3784fc9721847a2c25e47e4960f922e88a21c64e78
R
6,812
250
### RegionsFlow Class Definition ### #' S4 class for intron annotation data for a specific annotation version #' #' @slot FlowRegion A GRanges object. The intron ranges annotated with the #' promoter information. #' @slot introns A GRanges object. intron coordinates #' @slot exonFlow A GRanges object. exon coordinate...
cb3d25a2a1ae5de1bf57d46ad2020ffcee8157235e3757c2807f2301c2e72942
R
6,812
229
#S3B #3 # primary and secondary cortex correlation check From previous results, we know that only cluster1 and cluster2 have correlations detected. In this section, I am going to analyze the 1000 iterations result: (1) check with pvalue (2) check the idea range of coefficient (3) overlapped the results with ChIP-exo. ...
718d25469e8dc40afb2a3449d9ac810000194f30273c958732221775661b4a36
R
6,819
185
# use Ensembl/BioMart, COSMIC and CellRanger annotation # add EnsgID, chrom coordinates, chr.band, synonyms, # description, phenotype description, COSMIC information about mutation # and cell types where gene is diff. expressed or signature genes # for all 17500 analysed genes options(java.parameters = "-Xmx32g") #...
43faa811df8be11c62905e02055e28f33c4b784cd2ef3e3135d14e939c9ddedb
R
6,822
206
library(scPagwas) library(rtracklayer) library(dplyr) library(Seurat) library(patchwork) ##Enrichment between traits and cell types within tissues #prepare sc data str <- "~/dat/cattle_scdata/Global atlas/All_rds/annotation_rds/" setwd("~/dat/cattle_scdata/Global atlas/All_rds/annotation_rds") list0 <- list....
cf4cbc090ff37bc558bdf56f32586c5fb5acffac660cab253afd5e4df24b744b
R
6,823
147
suppressPackageStartupMessages(library(optparse)) option_list = list( make_option(c("-c", "--dexseq.targets"), type='character', help="circRNA targets (ciri2)"), make_option(c("-g", "--genes"), type='character', help="Prepared gene database (bed)"), make_option(c("-i", "--introns"), ...
737c2f4ca4554c884e6c6264e30a384dc5e98a593140009eacd0220c26a56ac8
R
6,835
199
# ncUCR overlapping lncRNA prognosis in glioma # check the association of differential exp ncUCR genes and survival setwd(dir = "D:/R_project/UCR_project/") options(stringsAsFactors = FALSE) rm(list = ls()) library(tidyverse) library(forestplot) library(ezcox) library(grid) # df <- read.delim( # file = "01-data/51...
52e5f0b6072cc136dbb7d4c58175a4afa69cde7b95b0d32ea87c9f08a30e7b95
R
6,843
121
# library(tabulizer) # library(data.table) # library(purrr) # library(zoo) # # dataPath <- "50_Data/MHLW/pcrByRegion.csv" # # location <- list( # "20200324" = "https://www.mhlw.go.jp/content/10906000/000612050.pdf", # "20200325" = "https://www.mhlw.go.jp/content/10906000/000612830.pdf", # "20200326" = "https://...
6fd6be1d04e29fde231eda14ea8de0a457241147da89178346aa3d294b4f3109
R
6,851
243
# Siwei 26 Jul 2023 # Adjust vcf tranches to 99.9 to solve rs2027349 absence # in new sequencing output issue # Siwei 21 Jun 2023 # Process all NGN2s (FASTQs trimmed and the original NGN2-20 # + from 2019) # note the sample names are complex, need processing (NGN2 and R21) # Jun 2023 # init library(readr) library(vc...
16e9365cb16190d69d3f012123db00ae78d383e8bccbc0416fbd801c0a4ccd2d
R
6,853
200
# ---------------------------------------------------------------------------- # Libraries and setup ---- library("argparse") library("ComplexHeatmap") library("ggplot2") library("tidyverse") library("Seurat") library("PCAtools") # Command line arguments ---- parser <- ArgumentParser(description = "Volcano plot for f...
213bc09fc4fc8b9028c0fcf2e366b0adcc9d07915bc3f273cd296bf55a532a24
R
6,859
190
library(Seurat) library(Signac) library(BPCells) library(ggplot2) object_sub <- readRDS("merged_object10/merged_object10.rds") #ASTROCYTES astro <- subset(object_sub, cell_type=="Astro") astro <- FindVariableFeatures(astro) astro <- ScaleData(astro) astro <- RunPCA(astro) astro <- FindNeighbors(astro,...
1fb9c61234336302c6ebc4d70a3cce629f0b4e88bdcb23480a9c096344789669
R
6,871
162
--- title: "FPN_CAP_EIB_neurometabolites_12s" author: "Asia Ferrari" date: "2024-10-25" output: html_document --- ```{r} # This R script analyzes the relationship between neurochemical data (GABA, Glx) and behavioral data (EIB) # in relation to network variables (INDegree, OUTDegree, Resilience, etc.). It inc...
12f31da1204441feeed0d1ad848b3e23428bb4013acbcaa545d7a8b5df3d8b88
R
6,901
162
--- title: "aline-propensity-score" author: "Alistair Johnson, Jesse Raffa" date: "May 15, 2017" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## Analysis of arterial line dataset This notebook creates a propensity score using a dataset of patients with indwelling arte...
49482a9f802f3268ddb9670721cf53f4b8ac2dc75e0a5d042db5d6c87a33c5ed
R
6,902
135
#' Map query dataset to the fetal whole brain atlas #' #' Wrapper function to map a query dataset onto the fetal whole brain atlas. #' This function uses the Seurat algorithm to project the query dataset onto #' the reference. Upon projection, the whole brain celltype annotation is then #' predicted and the correspondi...
dd72630c9ca713d1db678a1a5e40f02b74ff8938357c938109f6ed06b7179f99
R
6,911
181
--- title: "OD histogram analysis" author: "C-M Svensson" date: "2023-02-23" output: pdf_document --- ```{r setup, include=FALSE} rm(list = ls()) knitr::opts_chunk$set(echo = TRUE, fig.width = 12, fig.height = 12) library(dplyr) library(latex2exp) library(tidyverse) library(ggplot2) library(readxl) lib...
57b82a87a0a0fbf56724210c19f704e67f5b8d55fb5aacc4cbf12f2af7b7b5a3
R
6,912
244
# Siwei 02 Feb 2025 # plot new S 7a-b # 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 #### ...
5f39c0d5749a7d737a5fabc1f9d3c2e13643ea4c20410e260895fce1dbbfe199
R
6,918
211
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) source(file.path(general_scripts_folder, "RNA", "create_seurat_from_cr_h5.R")) library(ggplot2) library(Seurat) library(qs) library(tidyverse) library(Signac) library(GenomicRanges) librar...
357197d147204a984c5d9fd6191f4f6351f233730e8e1e9a2090a3ecd4fdeeae
R
6,923
140
# Load Packages ------------------------------------------------------------------- library(tidyverse) library(tximport) library(readr) # Load data ------------------------------------------------------------------------ tau1 <- read_table("/Volumes/big_dog/Direct_RNA_Sequencing/nanocount/counts_transcript_te/dmel-al...
402caa240be88cd4d3319c4aeeae2dcbc61bd382423ee51302bd20ffda7091df
R
6,924
186
library(DESeq2) library(ggplot2) # plot C3 expression difference astro_dds <- readRDS("DESeq2/filtered2/objects/Astrocytes_dds.RDS") astro_counts <- counts(astro_dds, normalized=TRUE) astro_counts <- astro_counts[,order(colnames(astro_counts))] c3_counts <- astro_counts[rownames(astro_counts) == "C3",] ...
673738842de9dd03d6f112fd7c6b264a272fbc88e642443985e5a2e029cc6547
R
6,936
130
## Comparison of bulk fetal "linear" and "non-linear" probe lists ## library(data.table) library(ggplot2) library(cowplot) library(gridExtra) library(VennDiagram) #1. Load results ================================================================================================================ reg <- readRDS(paste0(...
4186121f2eb323d266d0f49a37404acc9fc51cc3f45230bed38c28e5ab7f4929
R
6,937
215
# 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 # run MAST for exact exp. values # adapt from Lexi's scDE code # init #### { library(Seurat) library(Signac) library(edgeR) library(future) ...
c1f5b0eeeddb9f4af08c7dfa2786bd624deb257f60cb3ae839a09e8e055ed407
R
6,948
215
library("SummarizedExperiment") library("tidyverse") library("ComplexHeatmap") library("sessioninfo") library("here") ## prep dirs ## plot_dir <- here("plots", "06_marker_genes", "01_example_plots") if (!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) set.seed(3042023) #### prep example data #### n_ct <...
b6c3e508d98baabe89f2367e73d2951ff64b14fd54a482443e4a48e101a43eb9
R
6,950
166
library(tidyverse) source("scripts/fncs_plot_peka.R") dbrn_tbl <- read_tsv("processed/peka/papa/2023-11_27_papa_cryptics_kmer6_window_250_distal_window_500_relpos_0.cleaned_6mer_distribution_genome.tsv") # map comparison names to cleaned event types & region types plot_clean_names <- tibble(comparison_name = c("blee...
cd84f2966440b4eecb90493918d1393a29cfb733822252baaa52c01db548d9fc
R
6,956
184
# script for null simulation if (!require("here")) { install.packages("here") library("here") } if (!require("magrittr")) { install.packages("magrittr") library("magrittr") } if(!require("tidyverse")) { install.packages("tidyverse") library("tidyverse") } if (!require("scran")) { if (!requireNamespace("Bi...
be3225217fe09699b8fdff2184269bc4f3e1ad63035636df6dbb01d34fd32639
R
6,958
195
# This tests the cluster-based doublet discovery machinery. # library(scDblFinder); library(testthat); source("test-findDoubletClusters.R") set.seed(9900001) ngenes <- 100 mu1 <- 2^rexp(ngenes) mu2 <- 2^rnorm(ngenes) counts.1 <- matrix(rpois(ngenes*100, mu1), nrow=ngenes) counts.2 <- matrix(rpois(ngenes*100, mu2), ...
d0c434e7b78ceb4b3a21abdf91199bcf07c917273ef1115cbce0063793e1ef58
R
6,981
174
#' clusterStickiness #' #' Tests for enrichment of doublets created from each cluster (i.e. cluster's #' stickiness). Only applicable with >=4 clusters. #' Note that when applied to an multisample object, this functions assumes that #' the cluster labels match across samples. #' #' #' @param x A table of double statist...
b3374572f58865c186a6f0def9ab2486df9986217138e06d33145feb78996be1
R
7,006
152
observeEvent(input$sideBarTab, { if (input$sideBarTab == 'aomori' && is.null(GLOBAL_VALUE$Aomori[[1]])) { # GLOBAL_VALUE <- list(Aomori = list( # summary = NULL, # patient = NULL, # callCenter = NULL, # contact = NULL, # updateTime = NULL # )) # TEST fi...
6bc2e08d3fcf5d86031e116d51e9821e992652f0eda48a31517cf27981c09f72
R
7,026
193
# Siwei 21 Oct 2023 # Transform raw input, calculate P val from 95% CI, and plot SE+P # init ##### library(ggplot2) library(RColorBrewer) library(readr) library(stringr) library(dplyr) # load data ##### # df_raw <- # read_table("sum_2_plot_b4_transform.txt", # col_names = FALSE) df_raw <- read_table...
e9aa9bb7dc4d329a3e735034ae94b4544d8edbf5c1c43818d6673eb66e3a9b53
R
7,033
174
library(tibble) library(tidyverse) library(Biobase) library(SummarizedExperiment) library(DescTools) library(readxl) multiplesheets <- function(fname) { sheets <- readxl::excel_sheets(fname) tibble <- lapply(sheets, function(x) readxl::read_excel(fname, sheet = x)) data_frame <- lapply(tibble, as.data.fr...
0ac987542dc9793021aa2d6045323b45b3c88eb13245d1f3a574e040edcb94ed
R
7,046
139
# AIM --------------------------------------------------------------------- # try to run harmony by merging the matrices from the individula objects. this will allow the skipping of the regular integration. the regular integration is needed as to run harmony the matrices should have the same number/order of the genes. ...
c3e01c273464ff8180dd16193383c281f0b1ddf48205234582ad7efa62a42a5e
R
7,051
191
rm(list=ls()) source('load_libraries.R') source('aux_functions.R') cohorts=c("CMC","UCLA_ASD","Urban_DLPFC") centrality="betweenness" grn_path = "data/PEC2_NetMed_GRNs/" # Read autism gene data asd.risk = read.csv("data/SFARI-Gene_genes_01-23-2023release_03-02-2023export.csv", sep = ",") %>% filter(gene.score == 1...
2dd20029d5ea2093187ac7ec0ddb3937f85f61a817e7b95c6704f8aa477aa0bd
R
7,059
184
#' Retrieve introns from annotation #' #' @param refAnnotation.path path to reference annotation in gtf format #' #' @return regionFlow-class #' @export #' @import dplyr #' @import GenomicRanges #' @import IRanges #' @import BiocGenerics #' @importFrom magrittr %>% #' @importFrom dplyr filter #' @importFrom GenomicFeat...
221af25209847c4af72e108a385a84b05d83dd6c3e651a8cdf8cbf0916e580e1
R
7,063
138
--- title: "Smoothed heatmaps for Figure 2B-2D, and S3B and S3D" output: html_notebook date: '2023-06-20' --- ```{r, include=FALSE, echo=FALSE} library(Signac) library(Seurat) library(dplyr) library(tidyverse) library(RColorBrewer) library(ComplexHeatmap) library(qs) library(circlize) library(magick) library(GenomicRa...
3ff788134f699d39827702b20dd26a17cc13a55359a5053217df3c9f0b85c073
R
7,065
246
# Siwei 09 Jun 2023 # Process all DNs (FASTQs trimmed + previous ones from 2019/21) # Jun 2023 # init library(readr) library(vcfR) library(stringr) library(ggplot2) library(parallel) library(MASS) library(RColorBrewer) library(grDevices) # load the table from vcf (the vcf has been prefiltered to include DP >= 20 o...
248a31f8c291479bc0bb0539d4bcb98d7e579d518b051f8ab5b9f3d1cf9a009b
R
7,078
132
# function for plotting plot_anywhere <- function(chr, start, end, gene_name = "", SNPname = "", SNPposition = 1L, mcols = 100, strand = "+", x_offset_1 = 0, x_offset_2 = 0, ylimit = 800) { cell_type <- GRanges(seqnames = Rle(chr), ...
a53beaaa11ce7c6d999acc6c7f12eec57ac78e0aa6e9dfe72c7774988c95527d
R
7,085
161
```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(WVPlots) library(clue) library(tidyverse) library(dplyr) library(tidyr) library(ggplot2) library(ggExtra) library(cowplot) theme_set(theme_cowplot()) library(corrplot) library(visreg) library(ggcorrplot) library(ggseg3d) library(ggseg) library(ggseg...
9dafb6974ba528f7a254b0c51942588f965db8c31e44517b7b7810a6b5905149
R
7,086
127
library(tidyverse) library(here) library(jaffelab) data_dir <- here("processed-data" , "08_bulk_deconvolution", "07_deconvolution_CIBERSORTx_prep") list.files(data_dir) #### Example with sce_test #### first_line <- readLines(file(here(data_dir, "sce_counts_test.txt"), "r"),n=1) first_line_top25 <- readLines(file(he...
af7b4508e8b9f3ac46425e54e1df286d87d123617f3222046b2417097e9fa112
R
7,094
127
library(GenomicRanges) ###functions exonsToIntrons_v3 <- function(exons) { exons_df <- as.data.frame(exons) exons_df <- exons_df[order(exons_df$transcript_id, exons_df$start, exons_df$end), ] exons_df$intron_start <- exons_df$end exons_df$intron_end <- dplyr::lead(exons_df$start) rm <- ...
8cf3cf66df313553b29c1a2bf6846245780940a453147afdd7c6df08257bb55a
R
7,109
166
# Given the output of CIBERSORTx analysis for Chen et al. and Kraft et al. # create plots of cell type fraction and heatmap with gene expression fold-changes dataPath = "data/CIBERSORTx-output/" figurePath = "Figures-and-Tables/" # cell fraction files: kraftMBMcellFractionFile = paste0( dataPath, "Kraft_MBM_ImputedC...
ecad970800625f81fa7fb41a728d8bb6a61413170d658edb90d1c8b3c1107dde
R
7,111
184
library("tidyverse") library("sessioninfo") library("DeconvoBuddies") library("here") ## prep dirs ## plot_dir <- here("plots", "07_GTEx", "03_deconvo_plots") if (!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) ## load colors load(here("processed-data","00_data_prep","cell_colors.Rdata"), verbose = TRU...
95ec1b6171a5537d382aa64032952aecfbe10576b9140732bfa2a6ac0a2dbf5f
R
7,116
220
library(DESeq2) library(UpSetR) library(tidyverse) theme_set(theme_minimal(base_size = 14)) # Read Data --------------------------------------------------------------- # imprinted genes from Tucci et al tucci <- readxl::read_excel("data/external/tucci_et_al_sup1_imprinted_genes.xlsx", she...
969640048e744c6d69998d4717ed59b513d54fedd1f843a46c73415c70d7cd23
R
7,128
243
# Siwei 11 Mar 2025 # plot for Nature appeal letter # init #### { library(readxl) library(stringr) library(ggplot2) library(scales) library(reshape2) library(RColorBrewer) library(ggpubr) library(dplyr) library(data.table) library(DescTools) library(multcomp) } rm(list = ls()) set.seed(42)...
d3e1086f41ab1ab8c57e0c492206f211273a72dd042a56763d8ba072207960f9
R
7,138
69
library(tidyverse) library(here) library(sessioninfo) sample_info_path = here('processed-data', '01_SPEAQeasy', 'data_info.csv') design_description_text = paste( "Assays were completed using 22 individual blocks of postmortem human DLPFC tissue collected across anterior (Ant), middle (Mid), and posterior (Post) po...
05be0f9e490545c58da7a4c6ef759be18390c6b4751fbc87bd4ede59b0ffb7f5
R
7,140
218
library(ggplot2) library(Seurat) library(bulkAnalyseR) library(ComplexHeatmap) library(dplyr) source_folder <- expr_folder <- file.path(source_folder, "07.Expr_matrix") bulk_folder <- file.path(source_folder, "08.Bulkanalyser") output_folder <- file.path(source_folder, "09.Figures") if (!dir.exists(output_folder)) { ...
042393a86f654f294e3b99abfcda7dd866c67cd1617ba04dd20b3ddbb3846916
R
7,160
115
# this script's purpose is to summarise the results of our models run on only observed data library(tidyverse) # version 2.0.0 library(gratia) # version 0.10.0 library(qvalue) # version 2.38.0 "%not_in%" <- Negate("%in%") # define not in operator path = "/data/pt_life/ResearchProjects/LLammer/gamms/Results/observed_o...
4f7e813baca8f968fef29fcaa25519614d4f24465ee3de064a0fd3b63e80ea68
R
7,160
183
library(ggplot2) library(twice) data(hg19rmsk_info) pbd_obj <- readRDS("data/pbd_obj.rds") y_kznf <- kznf_infer %>% filter(age=="young") overlaps <- readRDS("data/pbd_kznfs_tes_overlap.rds") hsc1 <- pbd_obj$hmc1_corr %>% filter(!pair %in% pbd_obj$ptc1_corr$pair) %>% filter(!pair %in% pbd_obj$ppc1_corr$pair) %...
ac79027e6e97fbe09aa552124f1a1737ee67c036b8f90c01044b9355cf40d38a
R
7,163
179
#Data from Blankenship 2011, assumed to be in same directory as this file source("processing_functions.R") dt=0.1 #Store data separately by phenotype- can be done in one big data frame, but this is more readable WT_files=c("Blankenship2011_WT_01","Blankenship2011_WT_02","Blankenship2011_WT_03","Blankenship2011_WT_04"...
5f5d596a601e5cb543d13a77f37b5dd717c51e354602f9a487d97400678113e9
R
7,186
175
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(gprofiler2) library(foreach) library(future.apply) # 50 GB options(future.globals.maxSize = 50 * 1024^3...
633e4aebb3c54f28e2592fcb0e43d0b950ea0f18cf3fd47b07e331a819c56a64
R
7,186
131
library(dplyr) library(Seurat) library(ggplot2) library(clusterProfiler) library(org.Mm.eg.db) library(readxl) # Set up directory setwd("/sfs/gpfs/tardis/project/Campbell_Lab/yl7mfw/Data Analysis/20240730_NewPlot/Fig7") # Load HTM dataset sSC.integrated <- readRDS("/sfs/gpfs/tardis/project/Campbell_Lab/yl7mfw/Data An...
6559eeaf554c1e22304105dc2ad5ffebf114300a3cd7a012bf23d68eca68c29c
R
7,189
273
#Computing species richness and diversity. # Definitions from http://www.flutterbys.com.au/stats/tut/tut13.2.html and http://www.metagenomics.wiki/pdf/definition/alpha-beta-diversity #and http://www2.uaem.mx/r-mirror/web/packages/vegan/vignettes/diversity-vegan.pdf and https://grunwaldlab.github.io/analysis_of_microb...
54d073167c30eb6caafaa6782f4f01ec5a8a9f3928ed2d0c6eff18f09067b5c8
R
7,190
145
################################################ ################################################ ### Volcano Plot of Genes in Top Term (Mito) ### ################################################ ################################################ # Load required packages if (!require("BiocManager", quietly = TRUE)) {ins...
2fbef526893e6d544dae9b194256f4ece3d6172d4593a75e40ec4f0fbd1c6e04
R
7,192
204
# Siwei 14 Jul 2023 # Use DiffBind to identify the most accessible peaks of the three # neuronal types # for the maximum separation power # init ##### library(readr) library(DiffBind) library(stringr) library(RColorBrewer) library(factoextra) # make the input sample sheet df_sample_sheet <- data.frame(bamReads = ...
39d05407c01099e3f813a8a194270a24bd3240181d653ddeadb32b03b0df59b5
R
7,195
168
```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(WVPlots) library(clue) library(tidyverse) library(dplyr) library(tidyr) library(ggplot2) library(ggExtra) library(cowplot) theme_set(theme_cowplot()) library(corrplot) library(visreg) library(ggcorrplot) library(ggseg3d) library(ggseg) library(scale...
581479be0fee820f91d2e1bde8d05f3dc6c4b8958a3de91dcdf607eb363cbf26
R
7,196
157
## Load plink before starting R # module load plink/1.90b6.6 # R ## Now run R code library('data.table') library('SummarizedExperiment') library('sessioninfo') library("tidyverse") # system("wget https://www.dropbox.com/s/f60w61ifky3wkwh/20116_0.gwas.imputed_v3.both_sexes.tsv.bgz?dl=1") # system("mv 20116_0.gwas.impu...
65f0b851b739034d5e71815c218975f57b9eecd802bb0262b53b971eacfac9b1
R
7,196
186
## WGCNA - associate networks with traits # last change: LZ 2023-11 library(WGCNA) library(data.table) library(dplyr) library(readr) library(missMethyl) library(clusterProfiler) library(org.Hs.eg.db) library(enrichplot) library(ggplot2) DF <- data.frame setwd("/path/to/WGCNA") options(stringsAsFactors = FALSE) ...
8bfef54ea55438cb0b1e20e2e411224249b49a8a9bf5e8f42647667d48948ecc
R
7,219
127
library("SingleCellExperiment") library("iSEE") library("shiny") sce_small <- readRDS("sce_{{regionlower}}_small.rds") cell_colors <- readRDS("cell_colors_{{regionlower}}.rds") stopifnot(packageVersion("iSEE") >= "2.4.0") ## Related to https://github.com/iSEE/iSEE/issues/568 colData(sce_small) <- cbind( colData(...
4ce5df47e567aec7385e5558f03e3afc44dd81dc67307addc2c7ef2eb914c876
R
7,223
141
options(stringsAsFactors = FALSE) library(ggplot2) library(reshape2) library(dplyr) library(stringr) library(lme4) library(lmerTest) library(RColorBrewer) library(ggpubr) #### PTA SNV burden vs. age #### df <- read.table("data/TableS3_PTA_burden.tsv", header=T, sep="\t") df$Case_ID <- as.character(df$Case_ID) mycols ...
d94d765ec1a815cd97380195e306f61b431739afbe908926e609543aa2d70629
R
7,230
182
explore_sce_original <- function(sce_original) { print("Dimensions:") print(dim(sce_original)) print("Number of unique cell names:") print(length(unique(colnames(sce_original)))) print("Repeated cell names:") col_tab <- table(colnames(sce_original)) print(col_tab[col_tab > 1]) print("Num...
9227a4b614305223ec87f9da664a2156dea60d19b8500f817c9098a7c47cda66
R
7,234
180
# Quality metrics and filtering using Seurat # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # January 2022 # Based in the Seurat Tutorial by the Sajita Lab # activate conda environment in ITHACA # conda activate use_seurat_r4 # Open R...
2e9fe23fcd5d0cb117a0bf5d567cc0cfff24fe945ffa2b4fa60a222494699153
R
7,257
182
plot_type_egc_scatter <- function(mcatac, cell_types, const_threshold = NULL, limits = c(-17, -12), pointsize = 2, plot_ablines = TRUE, plot_const_line = FALSE, const_line_value = -14.5, use_theme = TRUE, log_transform = TRUE, base_type = "Epiblast") { mc_egc <- as.matrix(mcatac@egc) if (log_transform){ ...
062ea10798449cb695c9331831f737792ac0b1dc66243b4908e4d7306f14e7ab
R
7,272
199
## ## Perform gene set enrichment analysis from a data frame of genes and ranks. ## gse_fgsea = function(stats_df, gene_col, rank_col, species, title = "", pos_label = "Pos", neg_label = "Neg", file_prefix = "gse") { suppressPackageStartupMessages({ library(magrittr) library(dplyr) library(tidyr) l...
1420fdeb41f5435172a9bfc8f63dd519ab1075a18ec2d662a80fad66c1020676
R
7,273
200
# ²é¿´UCRºÍRFµÄ»ùÒòµÄ×éÖ¯ÌØÒìÐÔ # tau¼ÆË㹫ʽÀ´Ô´£º # https://academic.oup.com/bioinformatics/article/21/5/650/220059 setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(stringr) library(ggview) GTEx_exp <- read.table(file = "01-data/22-Tissue_specificity_across_different_organs/GTEx_...
0f7e253d62f75491260b2afb9ac46f29663d7c5c5b583c4a58f72943eb9bf758
R
7,293
274
--- title: "DP02 Annotating Spatial Clusters" author: "DanielZucha" date: "2024-12-30" output: html_document --- Hi, Having created the Seurat object, we use BayesSpace clustering to introduce spatially-aware clustering. This process is only applicable to the Visium-based [Alsema et al. 2024](https://www.nature.co...
a46846d35de79b2393821e10a5d3a3a243d4430863ca0fae87e7687f2e9ff163
R
7,295
251
# Siwei 26 Jan 2025 # plot Fig. 3e # init #### { library(readxl) library(stringr) library(ggplot2) library(scales) library(reshape2) library(RColorBrewer) library(ggpubr) library(ggridges) library(dplyr) library(data.table) library(DescTools) library(multcomp) library(gridExtra) libr...
d4713e910fbcc66f25f099ec26fcc3417e5d32b5b28d4b1fc73281b9fd9faea6
R
7,298
119
###ÕûÀí½á¹û library(tidyr) library(tidyverse) library(openxlsx) out_all_res <- data.frame() out_null_res <- data.frame() inputpath <- "/mnt/data/lijincheng/mGWAS/result/04replication/Kunkle/pathways/" outlist <- list.files(inputpath) ##ÌÞ³ýÒÔÏÂpathawyÒòΪֻÓÐÒ»¸öSNP(empty 1,2,4,5) #COLANSYN.PWY..colanic.acid.buildin...
7f1818a6ddb09efc29e6684e7913e7e84998f42c4dcacf1c93daf7a54614be65
R
7,302
148
### Author: Dr Ricardo De Paoli-Iseppi. Creation date: 26/02/2021 ### ### Short script to count risk gene data from curated GWAS Catalog data ### # Requires: GWAS Catalog of MHD of interest (.csv) and validation gene lists (.csv) e.g. MAGMA, TWAS, SMR (optional). # Validation evidence lists require minimum colnames 'P...
e403214c4ced1411043bd2919285695665bb3cc12a286148203f0669814bd49d
R
7,303
148
### Author: Dr Ricardo De Paoli-Iseppi. Creation date: 26/02/2021 ### ### Short script to count risk gene data from curated GWAS Catalog data ### # Requires: GWAS Catalog of MHD of interest (.csv) and validation gene lists (.csv) e.g. MAGMA, TWAS, SMR (optional). # Validation evidence lists require minimum colnames 'P...
e5cf7ec230c80f0870dd2467521b05374b459b2ac66d55fda525bdfca83732c5
R
7,316
227
#' Print R object contents to python expression #' #' @param object with names attribute names(object) will be written as python assignments #' @param prefix string string that is prepended to the variable names #' @param blacklist list of strings names that are in the blacklist are ignored #' @param trans named list (...
0ce2bf8b092bd5816cd6af8e2cf956aa4952a39f680bee503315fe68ce840163
R
7,328
268
library(org.Hs.eg.db) library(openxlsx) library(clusterProfiler) library(dplyr) library(clusterProfiler) library(diffEnrich) kegg_hsa <- get_kegg('hsa') source("disease_specific_genes_function.R") cells=c("Astrocyte","Neurons") neuropro=read.table("neuropro_v1.txt", sep="\t", header=T, fill=T) df_neuropo=as.dat...
3ad38ced3e7d3fd393aa03eee27f71861eab5329200a4bd240fa112fb0784703
R
7,328
137
--- title: Scoring potential doublets from simulated densities package: scDblFinder author: - name: Aaron Lun email: infinite.monkeys.with.keyboards@gmail.com date: "`r Sys.Date()`" output: BiocStyle::html_document vignette: | %\VignetteIndexEntry{4_computeDoubletDensity} %\VignetteEngine{knitr::rmarkdown} %...
1cc0bc8a96a3440b87d642ec287fc63b826c03c604f46db29c663c514b9fb17a
R
7,331
203
# devtools::install_github("Danko-Lab/BayesPrism/BayesPrism") library("BayesPrism") library("SingleCellExperiment") library("here") library("sessioninfo") plot_dir <- here("plots" , "08_bulk_deconvolution", "06_deconvolution_BayesPrism") if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) #### load DLP...
bf06e359370151f5d489c7c16d1fef09a35fe6086fadb0acd7f96a049cdaf70e
R
7,336
186
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) library(Seurat) library(Signac) library(ClustAssess) library(qs) library(rhdf5) library(dplyr) library(future) library(doParallel) library(ComplexHeatmap) library(ggplot2) marker_path <- ...
6c7744731a6be0f35ca61a3c7686a4fb7d08c61d8f811ef6805d3b8ddca323c9
R
7,339
262
# Siwei 02 Feb 2025 # plot new S 7c-d # 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 #### ...
1631d1bdf0d69051a3bc22c472dd12beb39fd1c9dfbf41ad0046a69eced63d71
R
7,350
219
require(optparse) require(tidyverse) require(ggpubr) require(cowplot) require(ggvenn) require(extrafont) require(scattermore) # variables # formatting LINE_SIZE = 0.25 FONT_SIZE = 2 # for additional labels FONT_FAMILY = "Arial" PAL_SINGLE_DARK = "darkgreen" # Development # ----------- # ROOT = here::here() # RAW_D...
149f86c94f9e5ea9da116851f5ff60e16cef9d5c776c8b02ed575a3e9f5edd01
R
7,352
145
options(stringsAsFactors = FALSE) library(ggplot2) library(reshape2) library(dplyr) library(stringr) library(lme4) library(lmerTest) library(RColorBrewer) library(ggpubr) #### PTA Indel burden vs. age #### df <- read.table("data/TableS3_PTA_burden.tsv", header=T, sep="\t") df <- df[df$Clinical!="AD",] df$Case_ID <- a...
2408bf96534607cba7772911a047ba57896e0127c6cd8a5107513784870e89c1
R
7,355
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
36f6ef9483699db7951b22983d4b755e60e38d8af262e75747048df08a2b3030
R
7,355
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
3d06aea19694e3063b555c63d9d2444274dc745bc4ffb00e1d410a5dcb78b45c
R
7,360
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
9dd8e80bc2cff420aa68e87887d37d9f4cbf1f05bf06defba0cfe4fef33c0990
R
7,360
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
19657850a917b8a7208db727c01efc77ae3961130a6a5571b7f070ec987de235
R
7,364
149
library("SingleCellExperiment") library("iSEE") library("shiny") sce_small <- readRDS("sce_amy_small.rds") cell_colors <- readRDS("cell_colors_amy.rds") stopifnot(packageVersion("iSEE") >= "2.4.0") ## Related to https://github.com/iSEE/iSEE/issues/568 colData(sce_small) <- cbind( colData(sce_small)[, !colnames(c...
9387d4ef86812dc32caee0819f38e5c5e7fe2ef70119aa6db1a9f3d1b56fe6f3
R
7,364
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
9c0ca94c8e2c6f15eaa58127ffc15ca6985de3f6730593492fae4a4ee7ad121c
R
7,364
149
library("SingleCellExperiment") library("iSEE") library("shiny") sce_small <- readRDS("sce_hpc_small.rds") cell_colors <- readRDS("cell_colors_hpc.rds") stopifnot(packageVersion("iSEE") >= "2.4.0") ## Related to https://github.com/iSEE/iSEE/issues/568 colData(sce_small) <- cbind( colData(sce_small)[, !colnames(c...
bae923336ca66394c19ed2941261a0ac44cb4ef6f227977e95b480b649072676
R
7,364
149
library("SingleCellExperiment") library("iSEE") library("shiny") sce_small <- readRDS("sce_nac_small.rds") cell_colors <- readRDS("cell_colors_nac.rds") stopifnot(packageVersion("iSEE") >= "2.4.0") ## Related to https://github.com/iSEE/iSEE/issues/568 colData(sce_small) <- cbind( colData(sce_small)[, !colnames(c...
6c275bb5d22a613062bb1d6df951e266fd08b76faf21b143081ba0fd36c766c5
R
7,365
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
ba7e16e0032bf11fd26f113ece347e0e2f551cf4b3577aac442bff44774efc17
R
7,365
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
a5cc3e02cf2651416985ac964a1bff264f584ef03511354886225da21693363a
R
7,367
149
library("SingleCellExperiment") library("iSEE") library("shiny") sce_small <- readRDS("sce_sacc_small.rds") cell_colors <- readRDS("cell_colors_sacc.rds") stopifnot(packageVersion("iSEE") >= "2.4.0") ## Related to https://github.com/iSEE/iSEE/issues/568 colData(sce_small) <- cbind( colData(sce_small)[, !colnames...
d0c603eac298d65d111fe4e220211d2305d8ba67d787738603ca73f8747abcb8
R
7,367
194
#5B library(twice) library(dplyr) library(tidyr) library(ggplot2) library(ggpubr) load("data/mayoTEKRABber_balance.RData") # cerebellum expression data load cbe_gene <- mayoTEKRABber$cbeDE$normalized_gene_counts %>% data.frame() cbe_kznfs <- cbe_gene[kznf_infer$external_gene_name, ] cbe_TE <- mayoTEKRABber$cbeDE$norm...
60448fa07e99afc2d0c62a3db25473cf0fcfe7750bda29a79b805dac8d73191e
R
7,370
149
library("SingleCellExperiment") library("iSEE") library("shiny") sce_small <- readRDS("sce_dlpfc_small.rds") cell_colors <- readRDS("cell_colors_dlpfc.rds") stopifnot(packageVersion("iSEE") >= "2.4.0") ## Related to https://github.com/iSEE/iSEE/issues/568 colData(sce_small) <- cbind( colData(sce_small)[, !colnam...
f19b5566d48c3e864fcdfca46b4f4e628a51afbd325059b4c8b64a2644debc64
R
7,370
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
e2d864cbc762925dae67472dd378de8fea378bea6cb7092ee7c42bf0f60fbbae
R
7,375
164
# Run CellChat to explore cell-cell communication - major cell types # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # March 2024 # https://github.com/sqjin/CellChat ## Tutorial: https://htmlpreview.github.io/?https://github.com/jinwork...
e0891fda223128a00e2986ba8d8c4f9ed81e77e272957cf139774b4f1e831529
R
7,380
232
#' Get required genomic tools ready for use #' #' @return NA #' #' @author Luke Pilling #' #' @name prep_tools #' #' @noRd prep_tools <- function( get_plink=FALSE, get_plink2=FALSE, get_bgen=FALSE, get_tabix=FALSE, verbose=FALSE, very_verbose=FALSE ) { # check tools directory exists if (! dir.exists("~/_ukbr...
a13f1667b773b3543ba5272b2c00782c859d209b96a816a2c3507c312628bfea
R
7,419
243
#' Prepare Standardized Missingness Data #' #' Extracts relevant columns from a peptide dataset and annotates with a source label (e.g., "LFQ", "LBQ"). #' #' @param data A data frame with peptide data. #' @param sample_col Column representing the sample or run (unquoted). #' @param peptide_col Column representing the p...
2dc6a06f3ef68fa55b4c63d6b57b020301c37045e2d3654cf0d17306d25c11a2
R
7,441
147
## 4. WGCNA - extract hub probes ## library(WGCNA) library(data.table) library(tidyverse) library(magrittr) library(cowplot) #1. Load data used in GPMethylation ============================================================================================= load(paste0(dataPath, "FetalBrain_Betas_noHiLowConst.RData"...
775e0bba87fc82471bb1bb715530d70529a7f5594454c688864ca8581e06266b
R
7,452
187
# Load required library library(dplyr) # ------------------------------------------------------------------------- # Compare overlapping DEGs and pathways between: # - Brain organoid study # - Post-mortem tissue study (Molecular Neurology article) # ---------------------------------------------------------------------...
a4fd14fa79b6ffc638af2a2a232f3d8a5a86df2b2c36ca985127f24f76feb37e
R
7,476
122
#library(magrittr) library(tidyr) library(data.table) library(biomaRt) library(org.Hs.eg.db) source_folder <- "/servers/iss-corescratch/am3019/250220_SP_alex_bulk/X204SC25013974-Z01-F001" expr_folder <- file.path(source_folder, "07.Expr_matrix") bulk_folder <- file.path(source_folder, "08.Bulkanalyser") output_folder ...
1a894438bb4771033bef9363c0c7f0c9ea5e90e9a0add70fcb9c1ab3f725dee5
R
7,485
182
library("tidyverse") library("sessioninfo") library("BayesPrism") library("here") ## prep dirs ## data_dir <- here("processed-data", "13_PEC_deconvolution", "04_get_est_prop") if (!dir.exists(data_dir)) dir.create(data_dir, recursive = TRUE) #### data details #### ## dataset properties dataset_lt <- tibble(Dataset =...
a066939aed2b7775229a258e8be22f33efd771e130863780b8027e055dbed3b2
R
7,509
234
# ============================================================================= # 深度学习特征整合分析脚本 # ============================================================================= # 功能:结合深度学习特征重要性与DGE结果,筛选关键基因 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf <- list.files("....