sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
c2e47ed63bbe8f2c81609272f3a072ae9197c98972950721c8e337303c2ab804 | R | 4,545 | 104 |
## 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... |
17d445779dea42648ce8f603eb460fdbd97e8dd9f06c6afbe4be851c6146b219 | R | 4,547 | 180 | # Siwei 26 Jan 2025
# plot Fig. 2f
# 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... |
487ba40aa8b8449e6ddd896aa707814aeb3cfe97171e3a38e6e3c4ae1c3734dd | R | 4,551 | 93 | ---
title: "tables"
author: "LL"
date: "2025-02-05"
output:
html_document:
df_print: paged
pdf_document: default
word_document: default
---
## Tables
Descriptive Statistics for key variables
```{r, echo=FALSE, message=FALSE, warning=FALSE}
library(gtsummary)
library(tidyverse)
library(mice)
# load datafram... |
46d383bb1b796cf573f1dcd3974d490c8fedf802bf21a099b4f73421a9c40f4d | R | 4,560 | 120 |
library("recount3")
library("SingleCellExperiment")
library("hspe")
library("tidyverse")
library("here")
library("sessioninfo")
# library(DeconvoBuddies)
data_dir <- here("processed-data", "07_GTEx", "02_GTEx_hspe")
if (!dir.exists(data_dir)) dir.create(data_dir, recursive = TRUE)
#### Load GTEx data with recount3 ... |
5f5786e10819f6cd3b1fd8919ada3a641c5f059ebbc4a3a525fda9eb3f63e97b | R | 4,560 | 141 | ---
title: "DP03 Visium Deconvolution"
author: "Daniel Zucha"
date: "`r Sys.Date()`"
output: html_document
---
Hi,
For the Alsema et al. 2024 dataset, we needed to compute cell type proportions using [Lerma Martin's single-cell atlas](https://cells-test.gi.ucsc.edu/?ds=ms-subcortical-lesions+snrna-atlas).
For Lerma... |
3c6f70b2620610241ad83d26497a5926fa0339d44cfbd034153dd9392093913e | R | 4,562 | 132 | Calculate_chrom_ratios_and_pvalues <- function(Table, Window, Max, Max2, Organism) {
max = Max
max2 = Max2
window = Window
tbl = Table
results = data.frame(chr = integer(), part = integer(), rat = numeric(), p_value = numeric())
if (Organism == "Human") {
centromere_pos <- c(123400000, 93900000, ... |
6248c2b98e9846b10e7e45e9384380d4a7c855c73118e7f47125323886d07a14 | R | 4,567 | 127 | #!/usr/bin/env R
#
# Get marker genes for cell types using mean ratio expression (log counts).
#
# Note: uses modified version of the DeconvoBuddies function `get_mean_ratio2()`
# devtools::install_github("https://github.com/LieberInstitute/DeconvoBuddies")
library(DeconvoBuddies)
library(SingleCellExperiment)
#-----... |
6a031b2318c5da445f7eebcbe51ec857947004fba5e32a92d58b0ca01904c5db | R | 4,567 | 106 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv)
library(Seurat)
library(ClustAssess)
library(qs)
library(rhdf5)
objects_folder <- file.path(project_folder, "objects", "R")
so_folder <- file.path(objects_folder, "seurat")
ca_folder <- f... |
d48e399818c5a7cfde6829f43fc9928baec4a95a7810d2bee150622ead3a314a | R | 4,577 | 141 | # fig 3B and figure S3
# From previous results, we know that only primary and secondary cortices
# and limbic and association cortices 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 res... |
c94322c4b5452ecb8f3e991ffab1c95600f27c09ec7675ef13d42b268b792f4e | R | 4,581 | 173 | library(psych)
library(GPArotation)
library(ggcorrplot)
source("R/1_data_exploration.R")
rownames(Perso) <- Perso$ID
Perso$ID <- NULL
# scale and do the correlation matrix
Perso.s<-scale(Perso)
corr_P <- cor(Perso.s)
#ggcorrplot(corr_P)
cortest.mat(corr_P,n1=80)
cortest.bartlett(corr_P,n=80)
KMO(corr_P)
## remove ... |
13fa4b8964d132b537d005ce2b8cbc69c7a8bb47a5966c5d8ea6a40b1ebaae79 | R | 4,586 | 100 | #----01_setup_v01---------------------------------------------------------------
#-------------------------------------------------------------------------------
# Locomotor activity analysis for Reinhard et al. 2025 (10.1073/pnas.2506164122)
#
# This is the setup file for the analysis of the locomotor activity rec... |
e77a9fcf55b791d466cc62aabe75a94cc71a42d5adf5743eeda36ae403b5d0e4 | R | 4,587 | 123 | #' Calculate TMT Labeling Efficiency
#'
#' Computes the percentage of peptide-spectrum matches (PSMs) that contain TMTpro modifications,
#' as a measure of labeling efficiency.
#'
#' @param psm_originalData A data frame containing PSM-level data with an `Modifications` column
#' indicating any observed modificat... |
29a3a46581d0b5e3344ee44143b2336f82d77af1ed3aa704a161fa5d375c06db | R | 4,604 | 161 | #!/usr/bin/env Rscript
print("#############################################################")
print("# Harmony: Algorithm for single cell integration #")
print('# GitHub: https://github.com/immunogenomics/harmony #')
print('# Paper: https://www.nature.com/articles/s41592-019-0619-0 #')
print("#####... |
587cf11997a3e195c0c9db894949a0b78afc4f57f89dcbf2327ffbdb076dfda0 | R | 4,610 | 119 | # GPT social perception: Preprocess the GPT data for megaperception clip experiment
# 1. Read data for each batch and add the frame names to the dataframes
# 2. Exclude rows that have nan data in at least one dataset
# 3. Exclude columns that dont have any variation from zero in at least one dataset
# 4. Calcul... |
2f882951b2e37624bad25d9656502fd243f447c41bed47073af621b3b1101a99 | R | 4,614 | 116 | #' dmrff.meta
#'
#' Identify differentially methylated regions by meta-analysing multiple studies
#' using variance-weighted fixed effects meta-analysis.
#'
#' Warning! Ensure that the order of the CpG sites corresponding to the the rows of `methylation`
#' match the order of the CpG sites corresponding to the other va... |
ab7ee805355ec23ae41df82b3b5a268b13edc4025ec5ab995d4b008c38c24d90 | R | 4,614 | 131 | # run Fig5.R before this
# rm(list=ls())
source('load_libraries.R')
source('functions_for_network_analysis.R')
source('functions_for_drug_repurposing.R')
library(ggalluvial)
metadata = read.delim("data/LINCS_small_molecules.tsv", header = TRUE, sep = "\t", fill = TRUE, quote = "")
ASD=read.csv("tables/proximity_res... |
0d263a2a55730053a69d5c0894d21a4dffa37f08682c52574438106f0a77d6cc | R | 4,619 | 134 | snp_add_eaf <- function(dat, build = "37", pop = "EUR")
{
stopifnot(build %in% c("37","38"))
stopifnot("SNP" %in% names(dat))
# Create and get a url
server <- ifelse(build == "37","http://grch37.rest.ensembl.org","http://rest.ensembl.org")
pop <- paste0("1000GENOMES:phase_3:",pop)
snp_reverse_base <- ... |
0ba95a42abd3f034adffa2e84b694216593c9818c304f33de4a36d62eded0537 | R | 4,629 | 117 | library(tidyverse)
df <- read_tsv("processed/PAPA/2023-12-10_i3_cortical_zanovello.all_datasets.dexseq_apa.results.processed.cleaned.tsv")
#
cryptics <- df %>%
filter(padj < 0.05 & mean_PPAU_base < 0.1 & delta_PPAU_treatment_control > 0.1)
# summary info fo le_ids (aggregated across experiments)
cryptics_summ <... |
8a9ccbc43810af078ab75220ba2950987075295aac5906821617cd1eef7fa914 | R | 4,632 | 81 | #Make bubbleplots without REVIGO filtering ########################################################################
#Load libraries
library(ggplot2)
library(tidyverse)
#Read final results
df = read.delim("brain_enrichment_GO-BP.txt", header=T)
#Select relevant columns
df = df %>% select(comparison, direction, cell.p... |
ea261ce5ad9ca04669c14e81c6ec602bb7572829dcf6bc508f28898f8a110b88 | R | 4,632 | 141 | # Siwei 22 Jun 2021
# ASoC analysis of new processed GA and DN 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/DN_20_lines_merged_SNP_DP_20_10Jun2021.txt_4_R.txt")
AS... |
f12f842854c23e65fb3cb45f981b8626de09e4e8a8945aa609e60ff38d01c54e | R | 4,633 | 87 |
###ORA analysis of limma res
library(clusterProfiler)
library(reactome.db)
##in noiseq up is -ve logFC, down is +ve logFC 1st compared to second
p.thresh<-0.05
ORA.res<-list()
for(i in 1:length(lfcs.genes.results)){
entrezlist<-entrezlist_UP<-entrezlist_DOWN<-NULL
entrezlist_UP<- row.names(subset(lfcs.... |
fadd0408be070c2678e7a24e8d77b0f7d08dcda3ebbff9ddde34d4fc67f090a9 | R | 4,633 | 101 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(readr)
library(plotrix)
library(GenomicRanges)
library(scales)
library(data.table)
#### mobile element alu sub family
####################
#### mobile elements
mle <- fread("../repeatMask/UCSC_simple_repeat.txt", data.table = F)
mle <- mle[mle$repFam... |
778ed7b33f29f30a1f2daa9844577688b7d43d1e5405181e95220115263c2cee | R | 4,635 | 124 | #!/usr/bin/env Rscript
#### Fine cell type annotation of T cell subset for MBM_sn
#### Author: Jana Biermann, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(viridis)
'%notin%' <- Negate('%in%')
path.ct <- 'data/cell_type_DEG/MBM_sn/tcells/'
filename <- 'MBM_sn_tcells'
seu <- readRDS('da... |
63091500b44ade33953f0dcc7095e71d7c7bcd85cd963c40d1b58587deb04034 | R | 4,643 | 130 | # =============================================================================
# PyTorch数据输出脚本
# =============================================================================
# 功能:为深度学习准备数据,按细胞类型导出表达矩阵
print("Hello world!")
rm(list = ls())
# 加载配置文件
source("../config.R")
# 设置工作目录
setwd(ENV_DIR)
lf <- list.files("./"... |
7dce67d78501c97120cd610ef48ceec53dd2cea3b8bd21b351bd3c22c738f6ea | R | 4,649 | 122 | 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, sum_occur = FALSE, sum_group_cols = c("rel_posn")) {
# all remaining columns after first are the position cols
coord_c... |
a6622eb6e6be4ccbc0de7fa1920e8f305753a370c4af4c183c6e0b8321013d06 | R | 4,655 | 106 | library(tidyverse)
library(DESeq2)
library(data.table)
run_standard_deseq = function(folder_of_featurecounts,
base_grep = "Ctrl",
contrast_grep = "TDPKD",
grep_pattern = "",
suffix = ".Aligned.sorte... |
5fd7fdd855cbf38aef9dd615071b93cf595c4ae638a7da191cb1d846902f049b | R | 4,659 | 100 | library(tidyverse)
library(dplyr)
library(here)
library(SingleCellExperiment)
library(magrittr)
l1_similarity_normalized <- function(x, y, valid_idx = NULL) {
if (!is.null(valid_idx)) {
x <- x[valid_idx]
y <- y[valid_idx]
}
valid_pos <- which(!is.na(x) & !is.na(y) & is.finite(x) & is.finite(y))
x_valid... |
afe86574c9e71d6923197a41e6911bc9f797e2e0b01a1e7b4db3c94351a73f9e | R | 4,660 | 126 | #!/usr/bin/env Rscript
#### Fine cell type annotation of T 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/tcells/'
filename <- 'MPM_sn_tcells'
seu <- readRDS('da... |
2639c5c224982954dadf34162a2e259c546480d4b70187dbd4f6d253e287d14d | R | 4,665 | 118 | # Clustering with Harmony
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2022
# Based in the Harmony tutorial for integration with Seurat
# http://htmlpreview.github.io/?https://github.com/immunogenomics/harmony/blob/master/doc... |
56b3218b4b991d3bb9c409ce01a9a29178920023cf71581b495f01b9d7dfc2b3 | R | 4,680 | 104 | #Analysis of Saunders et al data set
##### 1. load packages and data#######
###load packages
if (!require("here")) {
install.packages("here")
library("here")
}
if (!require("magrittr")) {
install.packages("magrittr")
library("magrittr")
}
if (!require("tidyverse")) {
install.packages("tidyverse")
library(... |
331ab465c28e183807ca7a55cf6b8cc76224bd38d7814109a7a906f1fcf8691e | R | 4,681 | 137 | library(qgraph)
library(glasso)
library(bootnet)
library(mgm)
library(igraph)
source("R/1_data_exploration.R")
net.df <- Perso
id <- net.df$ID
net.df$ID <- NULL
ncol(net.df) # number of nodes
l <- labels[which(labels$Label%in%names(net.df)),]
all(l$Label==names(net.df))
# reordering
l <- l[match(names(net.df), l$L... |
3eaa5645d472da274e0710b2ae3740df2b125fa4a72f49ba05c2a30afcdb8d0d | R | 4,710 | 135 |
library("SummarizedExperiment")
library("edgeR")
library("variancePartition")
library("purrr")
library("here")
library("jaffelab")
library("sessioninfo")
#### Set up ####
## dirs
# plot_dir <- here("plots", "09_bulk_DE", "08_DREAM_library-type")
# if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE)
## d... |
b33ee0e271b6c9223d637c39a0fd6ab594c1aeed58e068a88ef90e77755fdab7 | R | 4,720 | 122 |
## Runs FANS EWASs ##
args <- commandArgs(trailingOnly=TRUE)
mod <- args[1]
age.group <- args[2]
output.file <- args[3]
#1. Load data ===================================================================================================================
print("Loading data")
print(paste0("Loading betas: ", Methylatio... |
c777f3bbdc3ffffd478057e654fd26a66022bc646dbbba397ac0fecf81fbe8ec | R | 4,730 | 138 | # Load libraries
library(easystats)
library(readxl)
library(dplyr)
library(ggplot2)
library(here)
library(gtsummary)
library(gt)
library(ggh4x)
library(ggsignif)
# Load data
base_dir = here()
data <- read_excel(file.path(base_dir, "results", "tableoutput.xlsx"))
data <- data %>% mutate(patient = as.factor(patient),... |
321135036b604fbe60d3dca5a86973aecdaed97fd2616ac7408f73819e7e84fb | R | 4,732 | 176 | # 日次都道府県別新規発生数 ====
output$confirmedHeatmap <- renderEcharts4r({
data <- melt(byDate, id.vars = "date")
data <- data[variable %in% colnames(byDate)[2:48]]
data[, variable := sapply(as.character(variable), i18n$t)]
data %>%
e_chart(date) %>%
e_heatmap(variable, value, label = list(show = T, fontSize = 5)... |
3b712c654d55e4b6ab9619ede7bdef5f599da0bdc198db613d84c28dbacca649 | R | 4,732 | 115 | #' Extract variants from bulk data and load to memory
#'
#' @description Use user-provided list of genetic variants to extract from imputed BGEN files (field 22828) or WGS DRAGEN BGEN files (field 24309) data and load as data.frame
#'
#' If selecting the DRAGEN data as the source, this assumes your project has access t... |
13a9db120ab322719cd8dfc865dc1963f8f4548c8ccfe2ccffe7104d7454eea1 | R | 4,737 | 126 | #!/usr/bin/env Rscript
# FFERREIRA 03/24/2024
# Nina Project - Neanderthal
# Filters Differentially Expressed Genes (DEGs) by:
## 1) |L2FC| > 1 (mark if > 2)
## 2) FDR < 0.05
################
# 0. SETS UP ENV
################
# Sets WD
cat(paste("Setting WD...\n", sep = ""))
wd <- getwd()
setwd(wd)
cat(paste("\tDon... |
7a56a36ba0331508d0913dd7c78c6a115ba3f77f9f09b038a185f9b46bc7aaf0 | R | 4,738 | 155 | # Siwei 26 Mar 2024
# plot Fig2G
# init ####
library(readxl)
library(stringr)
library(RColorBrewer)
library(ggplot2)
library(scales)
# load raw data ####
df_raw <-
read_excel("Fig_2G.xlsx")
df_2_plot <-
df_raw
df_2_plot$Age <-
trunc(df_2_plot$Age_raw / 10) * 10
df_2_plot$Diagnosis <-
factor(df_2_plot$Diagno... |
99be3cf47c5ce2976552cc189a4fb4f44d4c242b19780f068ee7322d0db63b13 | R | 4,738 | 137 | ---
title: "R Notebook"
output: html_notebook
---
```{r}
library(tidyverse)
library(DBI)
library(ComplexHeatmap)
library(dplyr)
library(hash)
cores<-8
```
```{r}
plan("multisession",workers=cores)
```
```{r Setting DBI options, include=FALSE}
con <- DBI::dbConnect(RSQLite::SQLite(), dbname=paste(db.path,dbname.rV2,s... |
f1217c72dd19e2cc4b9c4b4e74123e81ace17032269f0ef165b8fb69daae8226 | R | 4,749 | 125 | # GPT social perception: Preprocess the GPT4 data for frame experiment
# 1. Read data for each batch and add the frame names to the dataframes
# 2. Exclude rows that have nan data in at least one dataset
# 3. Exclude columns that dont have any variation from zero in at least one dataset
# 4. Calculate mean data... |
b42015b4c7ca3b3cb7a8b3874d6e6d9e6da3e41a71a033da30c17ea41958c4d2 | R | 4,755 | 98 | ```{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... |
460fc2d3d7413f96842ce58f48690892e3fdf843315c2ba0fc3b24e12e60c12c | R | 4,783 | 82 | ---
title: "Introduction to the scDblFinder package"
author:
- name: Pierre-Luc Germain
email: pierre-luc.germain@hest.ethz.ch
affiliation: University and ETH Zürich
- name: Aaron Lun
email: infinite.monkeys.with.keyboards@gmail.com
package: scDblFinder
output:
BiocStyle::html_document
abstract: |
An introduc... |
febd13a507dd4df4fabbec5dcc6aff7d93b322825439f62dca4ff38d656edff0 | R | 4,791 | 136 | # vertex-wise meta-analysis example, using g-volume associations. The same script structure was used for all 5 morphometry measures.
# The inputs to the cohort files had beta, SE and p values for each measure (3x5 = 15 columns), and so were read in as below.
library(robumeta)
library(metafor)
mask <- read.csv('/mask.c... |
7984549f93927b27aa56433e2d7b0f23f419d1eca7690b7307defb9c2aa146a2 | R | 4,799 | 114 | #' Classification Metric
#' @description
#' Class for computing metrics based on two BinaryLabelDatasets. The first dataset is the original one and the second is the output of the classification transformer (or similar)
#' @param dataset (BinaryLabelDataset) Dataset containing ground-truth labels
#' @param classified_d... |
0eb4c535cff3e3fc56d7e3915a7c6a1a383e978389c11f76499cb1e3c757cc04 | R | 4,810 | 99 | suppressPackageStartupMessages(library(optparse))
option_list = list(
make_option(c("-f", "--feature"), type='character',
help="Reference database (bed)"),
make_option(c("-g", "--gtf"), type='character',
help="genome annotation (gtf)"),
make_option(c("-i", "--introns"), type='chara... |
7632f7d61f81c1c8663c4d3d66af85843657c557f46f8b4737d54dc980e76747 | R | 4,813 | 102 | #' Prepare abundance‐density data for visualisation
#'
#' Combines the raw and normalised abundance tables into a single long data frame that is ready to be plotted.
#'
#' @param data_beforeNormalization A data frame **before** normalisation. Must contain at least the columns
#' given in \code{sampleColName_befo... |
a62b24d0c404f1f485916bcf93e8bf882eb984bca72cb60fe9300d7222b75b23 | R | 4,824 | 137 | # Convert .hdf5 to Seurat object
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# January 2022
## https://bioconductor.org/packages/release/bioc/vignettes/rhdf5/inst/doc/rhdf5.html
# activate conda environment in ITHACA
# conda activa... |
4eabf9aa96d4c2a857a183245641b2d80148df99984ffce51872400192ca8335 | R | 4,832 | 172 | #------------------------Preprocessing------------------------
# 1. Check sample file column names
# 2. Check that number of conditions is exactly 2
# 3. Get list of sample names and absolute paths to bam file
# 4. Get a dictionary of gene symbol to gene id from gtf file
# load libraries
if ( suppressWarnings(suppress... |
5df6389a9ddf047e978ff845a2eb70c3b6b9a02415e13a09fc71bac198314951 | R | 4,832 | 124 | # ----------------------------------------------------------------------------
# Libraries and setup ----
library("argparse")
library("ggplot2")
library("tidyverse")
library("scales")
library("Seurat")
library("ComplexHeatmap")
library("khroma")
library("RColorBrewer")
# Command line arguments ----
parser <- Argument... |
735c435f589b6d06c89e042097a911edf997a09f27e6cde883a02adf501b21fa | R | 4,833 | 119 | 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)
library(future)
... |
c870b1d2da6ef1f5f0317ad9adef904949cd638af399154e16b96c7ebd63c5b4 | R | 4,833 | 82 | ---
title: Recovering intra-sample doublets
package: scDblFinder
author:
- name: Aaron Lun
email: infinite.monkeys.with.keyboards@gmail.com
date: "`r Sys.Date()`"
output:
BiocStyle::html_document
vignette: |
%\VignetteIndexEntry{5_recoverDoublets}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}... |
ef6f50b194517d1d3846a3879c63c5c48c89bd2a2c7e546c9993b494066beaae | R | 4,833 | 128 | #!/usr/bin/env Rscript
### title: SCENIC output integration into Seurat object and downstream analysis
### author: Jana Biermann, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(reshape2)
library(viridis)
library(ggrastr)
library(ggpubr)
library(ggrepel)
colBP <- c('#A80D11', '#008DB8')
c... |
f557e824eb7ca01befd94794bf2f000ad2ca68607b3e764f0d222c40bc138926 | R | 4,855 | 127 | ############################################################
############################################################
### Identification of Striatum Enriched Protein Pathways ###
############################################################
############################################################
# load require... |
b2bb6a89f4656c6b74d79af6aecbb23f773d5cb82fc4a36407ac179f52292608 | R | 4,856 | 180 | # Siwei 17 Jun 2023
# identify which isoforms were affected in PICALM G/A/KD samples
# Re-analyse Alena's data using Kallisto pseudocounts
# init
{
library(tximport)
library(readxl)
library(EnsDb.Hsapiens.v86)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
library(stringr)
library(edgeR)
library(DESeq2)
... |
ec1c9879b3d792fb5bf6d2ee99c0a2cf189b43f6134dd4aefdaa00b6887e4bde | R | 4,857 | 125 | # load packages
require(tidyverse)
require(seriation)
require(jmotif)
# load data
bin.data <- readRDS('Polioudakis_bin_data.rds')
# load mouse metagene centers
centers.mm <- read_csv('mmCortex_metagene_centers.csv')
# scale data
bin.data.scale <- bin.data %>% select(-human_id) %>%
column_to_rownames('human_name')... |
51ed42faf204d0e1581a97dae768eb3c5aa9cfe9bee614d8eccb491a966d921b | R | 4,859 | 108 | prepareFluxes <- function(rescale, rounding) {
#' This function loads and preprocesses the flux data, including:
#' - Loading the base flux results
#' - Adding corrected bile acid fluxes
#' - Removing samples with mismatched gender
#' - Rounding fluxes to 6 decimal places
#' - Filtering on a list of metabolites of inte... |
5cac821a6a448cca1ba818dfb8da78513a382d6aaa697dcb722eeef08d8b7fa6 | R | 4,860 | 106 | #' Get UK Biobank participant self-reported illness/year data for specific codes
#'
#' @author Luke Pilling
#'
#' @name get_selfrep_illness
#'
#' @noRd
get_selfrep_illness <- function(
codes_df,
ukb_dat,
verbose = FALSE
) {
start_time <- Sys.time()
vocab_col = "vocab_id"
codes_col = "code"
# Check input
... |
5a3d4815e9dfb48c7c618249e6d564a669c3f2f17e9a2267e0845a89fac29106 | R | 4,878 | 140 | # ---
# Code to compute pairwise model correlation across different sets of models (e.g. TWAS/RWAS/CWAS)
# Sample command:
# Rscript pairs.R --pos1 TCGA-BRCA.GE.TUMOR.pos --pos2 TCGA-BRCA.GE.NORMAL.pos --chr 1 --ref_ld_chr ../../LDREF/1000G.EUR. --window 100000
# ---
local({
f = grep("--file=", commandArgs(FALSE), ... |
8262a3bb1ad36cc273065ee4bd5620d17fe8cc97e949a81a628486911aee0fd1 | R | 4,886 | 132 | #Merge technical replicates
library(Seurat)
library(Signac)
library(dplyr)
library(ggplot2)
library(EnsDb.Hsapiens.v86)
library(GenomicRanges)
library(future)
#load command line parameter for what datasets to process
args = commandArgs(TRUE)
if(length(args)==2){
Start = args[1]
End = args[2]
... |
3d774f0527c7ef2e6592893c7eb9bbf3bab99fc7cb70328cdc7b7d39ef932c73 | R | 4,901 | 130 | #' TFIDF
#'
#' The Term Frequency - Inverse Document Frequency (TF-IDF) normalization, as
#' implemented in Stuart & Butler et al. 2019.
#'
#' @param x The matrix of occurrences
#' @param sf Scaling factor
#'
#' @return An array of same dimensions as `x`
#' @export
#' @importFrom Matrix tcrossprod Diagonal rowSums colS... |
11b567ca22bdb324ddd6b4f5ef52d71632ec9223270c337b72df144f32932973 | R | 4,910 | 112 | #!/usr/bin/env Rscript
#### Main cell type annotation of integrated Seurat objects
#### Author: Jana Biermann, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
# Select one cohort
cohort <- 'MBM_sc'
cohort <- 'MBM_sn'
cohort <- 'MPM_sn'
# Set up folders
celltype <- 'main'
folder <- paste0('data/c... |
04f650706bc4974b1c7e386190f9712f9dba5ecf22010e1bb9f43556c0fbda2b | R | 4,913 | 97 | # function for plotting rs10792832 site
# revised from plot_anywhere
# Use OverlayTrack to combine data tracks
plot_AsoC_peaks <- function(chr, start, end, gene_name = "",
mcols = 100, strand = "+",
x_offset_1 = 0, x_offset_2 = 0, ylimit = 400,
... |
86d3a18260503275ee4b1a5c7c243fe410c009b8d48a333c8d347f5c09c7dae9 | R | 4,914 | 112 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(readr)
library(plotrix)
library(GenomicRanges)
library(scales)
library(data.table)
#### mobile element LINE sub family
####################
#### mobile elements
mle <- fread("../_Bank_files/UCSC_hg38_repeatMasker.tsv", data.table = F)
mle <- mle[mle$... |
41f43c388dfdc7ab4a23e0dbc25d320fe142848d95ead689df501a824a62376d | R | 4,919 | 126 | #!/usr/bin/env Rscript
# ==============================================================================
# Script: rnaseq_TEtranscripts_differential_analysis.R
# Author: Alireza Ghahramani
# Contact: aghahram@uwo.ca
#
# Methods Overview:
# - TE expression analysis was performed using **TEtranscripts** (v2.0.3) (Jin et... |
6ef3c604b240d864e5fb7987ec5349191c191fdd117e2421907da1640b291993 | R | 4,932 | 179 | #!/usr/bin/env Rscript
print("##################################")
print("# ArchR: Arrow file -> QC plot #")
print("##################################")
################################################################################
library("optparse")
parser <- OptionParser(
prog = "run_archr_qc_plot",
descr... |
cc8de0256c09e6bad921ced4eb05e9448094b240f703c9eae9ce931735d9d734 | R | 4,938 | 147 | # »æÖÆÈ¾É«ÌåºËÐÍͼ£¬Õ¹Ê¾479¸öUCRµÄ¾ßÌåλÖúÍÀàÐÍ
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(karyoploteR)
library(GenomicRanges) # ½«Êý¾Ý¿òת»»³ÉGRanges¶ÔÏó
library(tidyverse) # ûÓÐÕâ¸ö²»ÄÜʹÓÃlwdµÄÉèÖÃ
library(chromoMap)
UCR_location <- read.table(file = "01-d... |
87cfebe6e843458a5f9532333e5666a3a3514204873a715cdd5e06dee2c250a3 | R | 4,943 | 130 | ####################################################################################################
## Package : CARD
## Version : 1.0.1
## Date : 2021-1-7 09:10:08
## Modified: 2021-12-13 16:18:07
## Title : Spatially Informed Cell Type Deconvolution for Spatial Transcriptomics by CARD.
## Authors : Ying Ma
## C... |
775a431da1f24990f36b5e7233ed7abf73b984781e0b904c8346624e6466a169 | R | 4,945 | 128 | # Siwei 15 Mar 2024
# make Upset plots to show sample line overlapping between cell types
# init #####
{
library(readxl)
library(UpSetR)
library(stringr)
library(RColorBrewer)
}
# load data ####
df_raw <-
vector(mode = "list",
length = 5L)
for (i in 1:length(df_raw)) {
df_raw[[i]] <-
read_... |
90d798e33ad6e6c6007a22942d829d9d3eba95a2a9c68384800a33736d1d3877 | R | 4,956 | 147 | ################################################################################
# Function to plot from .csv files regional brain maps with their significant
# areas highlighted
################################################################################
# Copyright (C) 2024 University of Seville
#
# ... |
8b512ff9352d0d623b882ca9fbb67aa90ccac9d2cbf87c100ec02b4b8b17e8e0 | R | 4,972 | 73 |
library(dplyr)
library(Seurat)
library(ggplot2)
library(clusterProfiler)
library(org.Mm.eg.db)
library(readxl)
# For TM integrated data
setwd("/project/Campbell_Lab/yl7mfw/Data Analysis/20240730_NewPlot/Cluster and Species")
# Load TM data
sSC.integrated <- readRDS("/project/Campbell_Lab/yl7mfw/Data Analysis/2024062... |
c3318be56be75231a2ed66b0082e693fa8df6e396d2c5087aa18b7208892ced6 | R | 4,980 | 154 |
```{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)
d_noNA <- d
x_obs <- paste0(kronosOut@plot_info$time, ".x")
x_pred = paste0(kr... |
e9c3ba48982c3947fed255f4a85c12b6ae1b0a83d33b347b2ffa643ea466c2c9 | R | 4,993 | 132 | outcome <- "Long_Cogn" #Outcome name
tissue <- "DLPFC" #Tissue name
model <- "Main"
#type <- "Xchr"
# loading data
data_base <- readRDS(paste0(rerun, "rerun/DLPFC_matched_long_autosome.rds"))
genes <- data_base.a[ , grepl("^ENSG\\d+", names( data_base.a ), perl = TRUE ) ]
genes <- names(genes)[1:ncol(genes)]
# load... |
2cec4b8ec9a684a105d3a475327a652dcf56a977655609703fa2da30ae81c3aa | R | 4,999 | 88 | performRegressions <- function(flux, formula, Term, Filter) {
# Generalized function for performing regression analyses on grouped data.
#
# INPUTS:
# flux: A data frame containing the data to analyze.
# formula: A regression formula as a string (e.g., 'AgeERGO5 ~ {met} + apoe4 + BMI').
# Term: The t... |
3c6707f04629d0dca8864a0120fd8222a5cc7e7bd0a288d874625c2b5aeb8da4 | R | 5,001 | 153 | library("SummarizedExperiment")
library("purrr")
library("dplyr")
library("recount")
library("sessioninfo")
library("here")
library("jaffelab")
## prep dirs ##
plot_dir <- here("plots", "02_quality_control", "04_get_expression_cutoff")
if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE)
#### Load Data ##... |
783a886dc326c77281842b3014d5e453a05e527599500742220e9d030c4c60ec | R | 5,003 | 132 | #' Run differential rhythmicity analysis for microarray using limma
#'
#' @param eset A matrix of expression values with gene in the rows and samples in columns
#' @inheritParams compareRhythms
#' @keywords internal
compareRhythms_limma <- function(eset, exp_design, period, rhythm_fdr,
... |
b19748c3296fddea091f7aee3dff0f8189eb51a83bf00c73a5229deaa705c2f3 | R | 5,006 | 144 | #' Run differential rhythmicity analysis for RNA-seq data using edgeR
#'
#' @inheritParams compareRhythms
#' @keywords internal
compareRhythms_edgeR <- function(counts, exp_design, lengths, period,
rhythm_fdr, compare_fdr, amp_cutoff,
just_classify, jus... |
284ba24e3295a05042f6cabd42e257c3a1854826c5b13eb43701a5ff14baae5d | R | 5,007 | 123 | ## Reference values for statsmodels.tsa.vector_ar.local_proj.LocalProjections
##
## Independently replicates the LocalProjections regression construction
## (statsmodels/tsa/vector_ar/local_proj.py: _build_regressors / fit) using
## base R's lm() for OLS and sandwich::NeweyWest() for the HAC covariance,
## on the real ... |
ca8698d3e56105290e55020bfe304ff1669845a7552c0b9d7142a89b72db067a | R | 5,009 | 147 | library(KFAS)
library(plyr)
options(digits=10)
# should run this from the statsmodels/statsmodels directory
setwd('~/projects/statsmodels-0.9/statsmodels/')
dta <- read.csv('datasets/macrodata/macrodata.csv')
cbind.fill <- function(...){
nm <- list(...)
nm <- lapply(nm, as.matrix)
n <- max(sapply(nm, nrow))
... |
b2c36f61dfc00f2593a59525fee6a6575702442e46bfafff1c36e3274584e821 | R | 5,018 | 125 | #!/usr/bin/env Rscript
### title: Diffusion component (D.C.) analysis and violin plots of B cells
### author: Jana Biermann, PhD
library(Seurat)
library(destiny)
library(SingleCellExperiment)
library(dplyr)
library(ggplot2)
library(gplots)
library(viridis)
library(scales)
colBP <- c('#A80D11', '#008DB8')
colSCSN <-... |
8cde2c10fd03b78c759ed5aba18e4924ab5d30fe360196d60da324f0ef504d05 | R | 5,020 | 142 | # Generate simulated FASTQ files for testing the pipeline
# Copyright (C) 2024 Sam Bryce-Smith samuel.bryce-smith.19@ucl.ac.uk
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundatio... |
9d9ecbc4b069456d5d2bdbf9404a72210d46e31ec84b4e59807517d0a5b8ba89 | R | 5,024 | 122 | ##Reference website: https://satijalab.org/seurat/articles/get_started.html
library(dplyr)
library(Seurat)
library(patchwork)
library(harmony)
library(ddqcr)
library(doubletFinder)
library(SingleR)
library(celldex)
library(ggplot2)
library(reshape2)
ref = HumanPrimaryCellAtlasData()
setwd("{your_workspace... |
e038053812812068361456f1f34853b94d80987be69ebccd3459894ceb9472d9 | R | 5,030 | 155 | # 05 Go Gsea Analysis.R
# 05 Go Gsea Analysis.R
##############################
## GO
##############################
# Define the list of ontologies, this case run all BP, CC , MF
df <- read.xlsx("sva_batch_corrected_DE.xlsx")
pval <- 0.05
fc <- 1
# Keep only the first UniProt accession before the first semicolon
df$Un... |
64100c3ea74d577ec00b20d105ff1f9041c2c47c71528cc32ecab5e7f28f0f16 | R | 5,035 | 138 | # Figure 3: Creates volcano plots comparing metabolic fluxes and serum concentrations against cognition
#
# INPUTS:
# fluxreg - Data frame containing flux regression results
# metabolome - Data frame containing metabolomic measurements
#
# OUTPUTS:
# Fig_3.png - Combined volcano plots saved as PNG... |
cf20f52544a66f8c5f22a041502ef4dfafaaa7701e0cb157b7fc89c02b3f3f04 | R | 5,035 | 144 | tabPanel(
title = tagList(
icon("globe-asia"),
i18n$t("感染状況マップ")
),
fluidRow(
column(
width = 5,
tags$div(
fluidRow(
column(
width = 6,
switchInput(
inputId = "switchMapVersion",
value = T,
onLabel = i18n$t... |
6f141d6620ba4ae3c4f3d2a78dfcf50238b4742a01debb95b9486fdadfa682fa | R | 5,040 | 157 | #------------------------Main---------------------------
# Run APAlyzer using variables from preprocessing step
# load libraries
if ( suppressWarnings(suppressPackageStartupMessages(require("optparse"))) == FALSE ) { stop("[ERROR] Package 'optparse' required! Aborted.") }
if ( suppressWarnings(suppressPackageStartupMe... |
6847ccba7bd04b193e833e2552bd7fb9e526a9cf823fbbd422963e675596f08d | R | 5,043 | 122 | # 24 Jan 2019 Siwei
# Write a loop to walk through all ready-made BAM files
# SplitCigarNReads skipped, should not cause major problem
# Libraries
library(zoo)
library(gplots)
library(stringr)
# init environment
######
k <- 1
source_file_list <-
list.files(path = "eSNPKaryotyping/R",
full.names = T)
f... |
43d51a313be0463cdb56312744a392cbd10840e02f2d06e1931241e7b92c9c1b | R | 5,047 | 139 | library(dplyr)
library(tidyr)
library(tximport)
library(rlang)
library(DESeq2)
library(annotables)
library(tidyverse)
library(optparse)
library(yaml)
library(data.table)
run_salmon_deseq = function(salmon_quant_directory,
metadata_filepath,
tx2gene,
... |
e531c0b501cd947c791e120f01f6889494afd3956516697cfa8c73fcf7d4026c | R | 5,048 | 104 |
## Deconvolute early/mid-fetal bulk cortex samples ##
library(CETYGO)
library(ggplot2)
library(reshape2)
#1. Load testing data ===========================================================================================================
# bulk fetal
load(paste0(PathToBetas,"fetalBulk_EX3_23pcw_n91.rdat"))
betas.bul... |
cb6b64988c6cdae05be8cf86799a7ddf3e1b6cca8388e00a59b1b219ece6ad8d | R | 5,050 | 129 |
library("tidyverse")
library("sessioninfo")
library("BayesPrism")
library("here")
## prep dirs ##
data_dir <- here("processed-data", "12_other_input_deconvolution", "04_get_est_prop")
if (!dir.exists(data_dir)) dir.create(data_dir, recursive = TRUE)
#### data details ####
## dataset properties
dataset_lt <- tibble(D... |
5735b2a0fe6fd5fe2bbb71ebf521fe3b3cfd01ee55ba333c4190967e07536ac8 | R | 5,058 | 149 | 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)
# 50 GB
options(future.globals.maxSize = 50 * 1024^3)
pl... |
ddeb56b9d16f3ba87ca1e202994f408a05be88cab086194e2e5946a1faeec615 | R | 5,082 | 172 | # ÏÈÔÚGTExÀï²é¿´lncRNAÔÚÄÄЩ×éÖ¯Àï±í´ï£º¿ÉÄÜÊÇ´óÄÔºÍÉúֳϵͳ
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(pheatmap)
# ncRNA UCRÖØµþµÄlncRNA
ncRNA_UCR_lncRNA <- read.table(file = "02-analysis/16-New_classification/ncRNA_UCR(66)_ensembl_id.txt", sep = "\t")
ncRNA_UCR_lncRNA <- un... |
71a975a61d5809a97177a55e405ab2bcbc7f5f15a00fa00c33e33b042bb7127c | R | 5,087 | 79 |
context("compareRhythms_voom")
load("test_data_rnaseq.rda")
exp_design_batch <- cbind(exp_design, batch, stringsAsFactors=TRUE)
test_that("limma-voom analysis works for default params", {
results <- compareRhythms(countsFromAbundance, exp_design, method = "voom")
expect_s3_class(results, "data.frame")
expect_... |
45ff4096d05220eca519b3081a82927865a4a030d9965897581b95b03857aa60 | R | 5,089 | 95 | #### Figure S6H #####
#### Bar graphs - gene count per protein family ####
library(ggplot2)
library(reshape2)
library(here)
# human astrocyte DEGs:
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.5) | h_c$log2Fo... |
28c5581a0a48abb629b2a4eecd42de42aca47f70d4d834315aa4d182b849deab | R | 5,093 | 169 | library(ComplexHeatmap)
library(ggplot2)
library(ggpubr)
####################
#### KRAB-ZNFs #####
####################
#1. check human
c1_kznfs <- unique(HmPtC1$corrRef$geneName) #285
c1_kznfs_res <- HmPtC1$DEobject$gene_res %>%
data.frame() %>%
filter(abs(log2FoldChange) >= 1.5 & pvalue < 0.05)
select_kznf... |
2b896bf3e322538c0b29d70e4628fe5c9e2184dad0f9761e29ca952cb9592dd0 | R | 5,096 | 125 | #----06_load_data_v01_single_experiments----------------------------------------
#-------------------------------------------------------------------------------
# Locomotor activity analysis for Reinhard et al. 2025 (10.1073/pnas.2506164122)
# Requirements:
# 1)scripts:
# 01_setup_v01
# 02_variables_an... |
38bbe9c30c2613e9b14ea20bb22a38db78f92a73872f5f045c3db040e68f9d59 | R | 5,096 | 170 | library(getopt)
library(sessioninfo)
library("hspe")
library("SingleCellExperiment")
library("jaffelab")
library("tidyverse")
library("here")
library("spatialLIBD")
task_id = as.integer(Sys.getenv("SLURM_ARRAY_TASK_ID"))
set.seed(task_id)
# Import command-line parameters
spec <- matrix(
c(
c("n_donors", "... |
77b8e56258e2796d6b0fb6a8245ebef08021fc5b9026dffca51e8f120ff91df7 | R | 5,107 | 113 | #' plotDoubletMap
#'
#' Plots a heatmap of observed versus expected doublets.
#' Requires the `ComplexHeatmap` package.
#'
#' @param sce A SingleCellExperiment object on which `scDblFinder` has been run
#' with the cluster-based approach.
#' @param colorBy Determines the color mapping. Either "enrichment" (for
#' log2-... |
b7f5f684ddcdb7c332a57699d84b5b3edfb5fc3849b09b5bdb674967089cc944 | R | 5,120 | 117 | suppressPackageStartupMessages(library(optparse))
option_list = list(
make_option(c("-g", "--gene_count"), type='character',
help="count matrix for genes, feature counts tsv"),
make_option(c("-e", "--exon_count"), type='character',
help="count matrix for introns, feature counts tsv")... |
1de7038775da88ea099b88d80223039aabab5c524253a6103c7e03fe75da856c | R | 5,123 | 172 | # Extract Microglia only, of all 425 samples.
{
library(stringr)
library(Seurat)
library(parallel)
library(future)
library(glmGamPoi)
library(edgeR)
library(data.table)
library(readr)
plan("multisession", workers = 3)
# options(mc.cores = 32)
set.seed(42)
options(future.globals.maxSize... |
4a3bd91daef489e15ec624f9693e75e3573e481513524780155a2e0aea4e7c49 | R | 5,128 | 130 | # GO BP
library(clusterProfiler)
library(ggplot2)
GO_result <- enrichGO(gene = CD4_degs$gene[CD4_degs$cluster=='CD4_Trm_CXCR6'],
#universe = row.names(dge.celltype),
OrgDb = 'org.Hs.eg.db',
keyType = 'SYMBOL',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.