sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
4e57ae78601feac08a863fdc4d4a5a602893b529b117e442f4ecd61bd6f8cc63 | R | 1,865 | 69 | #' @title coxbycol
#' perform loop of cox univariate analyses among columns of dataframe
#' @param time time of follow in time unit for the Surv object
#' @param event event 0 or 1 for censoring Surv object
#' @param data dataframe with columns to test
#' @usage data(cancer)
#' @usage library(dplyr)
#' @usage ... |
0009723fafe1d3dc4bb821d626e35e52d31a6fa770d422c68478b020baf1fcff | R | 1,872 | 50 |
args = commandArgs(trailingOnly=TRUE)
if (length(args) < 2) {
stop("Usage: postprocessing.r <base.path>", call.=FALSE)
}
base.path <- args[1]
# Parts of the function is taken from Seurat's Read10x parsing function
ReadAlevin <- function( base.path = NULL ){
if (! dir.exists(base.path )){
stop("Direc... |
82443284db6610d69dcf7f8d13fc1b9d3a328d4bfa353ac006e43df0f73763a2 | R | 1,877 | 61 | #!/usr/bin/env Rscript
# This R script can be used to download the Medical Expenditure Panel Survey (MEPS)
# data files for 2015 and 2016 and convert the files from SAS transport format into
# standard CSV files.
usage_note <- paste("",
"By using this script you acknowledge the responsibility for reading and",
... |
b41aec462497695bc854258738ce35cf8ad34b8f2679f9960120b703aa08ad35 | R | 1,877 | 49 | ################################################################################
### LIBD pilot 10x snRNA-seq: Amygdala samples
### **Region-specific analyses**
### - R-batch job for detxn of optimal PC space with 'sce.amy' object
### -> see '10x_Amyg-n5_step02_clust-annot_MNT.R'
### for setup of... |
4328e563a71ce6c59afdd1a75a37511888ff27da0c4b3affebe129837592cd6a | R | 1,879 | 60 | #!/usr/bin/env Rscript
###this just craetes a zero based coverage object so that c an make some generic coverage plots later
#####set lib path to the result of calling .libPaths() in R on the same system[1]
library.path <-c("/home/arh49/R/x86_64-pc-linux-gnu-library/4.1", "/usr/local/lib/R/site-library", "/usr/lib/R... |
2a3816588ad8e7e91a163d98a84e109b75d017577be128b8d04e115c77b38a93 | R | 1,881 | 70 | # ͼ3.1չʾuc¡£18ºÍuc¡£304ÔÚ´óÊó»ùÒò×éÀïÐòÁб仯
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(Biostrings)
library(ggmsa)
library(cowplot)
fai <- "D:/A_projects/UCR/ͼ±í/uc.304_rat.mas.fasta"
fasta <- readDNAMultipleAlignment(filepath = fai)
p3... |
9ad572d803d366959a97beebcff948f0fb4e29876bc23db6c760e3d64f2a1ed8 | R | 1,881 | 34 | ###############################################################################
# If you edit this file you MUST release a new version of the gatkbase docker #
# built with the updated r dependencies #
# #
... |
df4bc24b7e2aa3d6a5e8cb935124557deb3f9417fd73f703b2c76ac43ed6b0e4 | R | 1,884 | 49 | ################################################################################
### LIBD pilot 10x snRNA-seq: sACC samples
### **Region-specific analyses**
### - R-batch job for detxn of optimal PC space with 'sce.sacc' object
### -> see '10x_sACC-n5_step02_clust-annot_MNT.R'
### for setup of th... |
ce44eb412c6588c9332bb121002a746390be5ddd5bc3cc23d698096f9e0c34f0 | R | 1,888 | 64 |
#### ================================================
#### AddModuleScore
#### ================================================
#### Load Packages
library(dplyr)
library(Seurat)
library(patchwork)
library(ggsci)
library(ggplot2)
library(ggsignif)
library(tidyverse)
library(ggpubr)
#### 1. Load Data
setwd("~/dat/imm... |
34101ce20f3192cd202d9e7803109a07fe785a5d53dd938835d5fcbdd17e243f | R | 1,891 | 40 | ######load packages needed##########
packages.toLoad <- c("GenomicRanges", "BSgenome.Dmelanogaster.UCSC.dm6", "plyranges", "TxDb.Dmelanogaster.UCSC.dm6.ensGene", "AnnotationDbi", "readxl", "readr",
"dplyr", "stringr", "stats", "tidyverse", "shiny", "Biobase")
loaded <- (.packages())
load_all <- function(list) ... |
c1b6a87322a2f2d6330ce65f12bda5f045cc4aea07d922bb9ac0892a4e0f07ac | R | 1,891 | 41 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' SpatialDeconv function based on Conditional Autoregressive model
#' @param XinputIn The input of normalized spatial data
#' @param UIn The input of cell type specific basis matrix B
#' @para... |
07f6db0a1f0753ebd0480dd9cc74ae245756f68bed64b00d593a9430a7538532 | R | 1,892 | 50 | ```{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... |
2875bd11ff23d0618e154aa0affe4f3e4ca1aee164f9088e340e9cddf63b4420 | R | 1,893 | 42 |
## Run Levene's test per DNAm site, comparing variance of early- and mid-fetal samples vs adult samples ##
library(data.table)
library(car)
library(pbapply)
'%ni%' <- Negate('%in%')
#1. Load data ===================================================================================================================
lo... |
21a673fda61be6de01856651ce0b32b86ddc49d19c3e7adad7b3a67711ad827e | R | 1,895 | 51 | library(scrattch.vis)
library(feather)
library(tidyverse)
options(stringsAsFactors = F)
# Setting working directory -----------------------------------------------
#this.dir <- dirname(parent.frame(2)$ofile)
#setwd(this.dir)
# Data paths --------------------------------------------------------------
project_path <-... |
5aacde7552f8fd20b7b22e44cf392618189939cdbea6d4c5456944d8ef008529 | R | 1,900 | 61 | # ÓÃÊý¾Ý¿âµÄÊý¾Ý̽Ë÷type I UCRsÏà¹ØµÄ¿É±ä¼ô½Ó»ùÒòµÄ±í´ïģʽ
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)
library(ggview)
## human brain rpkm
human_rpkm <-... |
85b0322a62eabfee03f6a8cf832b299ff873b546ad6119ad25b7094c2dfa5dc1 | R | 1,910 | 68 | # 21 Mar 2022
# Siwei make ldsc gene plots
# init
library(readr)
library(ggplot2)
library(RColorBrewer)
library(stringr)
result_files <- dir(path = "ldsc_results/",
pattern = "results$")
raw_df_list <- vector(mode = "list",
length = length(result_files))
names(raw_df_list) <... |
d1178aa21ab39e9d3df2012bc46c98eac219da31090a12053c19edb833b1a57f | R | 1,913 | 58 | library("SingleCellExperiment")
library("rafalib")
library("iSEE")
library("lobstr")
library("here")
library("whisker")
library("usethis")
library("withr")
library("rsconnect")
library("sessioninfo")
load(here("rdas", "revision", "regionSpecific_sACC-n5_cleaned-combined_SCE_MNT2021.rda"), verbose = TRUE)
source(here(... |
481ea238ec00fa30e3bd37b9d6180bad5601c3cf01c703b914b3ae861b668d2c | R | 1,915 | 58 | library(tidyverse)
library(ggrepel)
df <- read_tsv("processed/gene_exprn/deseq2/2023-20-11_deseq2_liu_facs_results.tsv")
outdir <- "processed/gene_exprn/deseq2"
# add ranks
df <- df %>%
mutate(abs_fc_shrink = abs(log2FoldChangeShrink),
rank_abs_fc_shrink = min_rank(desc(abs_fc_shrink)),
rank_padj ... |
e23dcde10a63c00e72ec5f95b455af1f10158fb4d0fdd33b53c2c70c2edb21e9 | R | 1,918 | 77 | # Siwei 31 Jan 2025
# plot Fig. 4e
# 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... |
0d6a91ab9a639596b4cde720a8b073e9acc02b9107525d31f9d2c6a00222a653 | R | 1,922 | 38 | # this script is used to compare the results of WMHV models with and without ICV as control variable
library(tidyverse) # version 2.0.0
library(gratia) # version 0.10.0
library(patchwork) # version 1.3.0
library(MetBrewer) # version 0.2.0
path <- "/data/pt_life/ResearchProjects/LLammer/gamms/Results/weighted/"
# load... |
e2276ea7285d0309507129fc29f1c89633596283e439dcbd37f4632c40e787fc | R | 1,923 | 63 | # ----------------------------------------------------------------------------
# Libraries and setup ----
library("Seurat")
library("tidyverse")
library("argparse")
# Command line arguments ----
parser <- ArgumentParser(description = "Filter a seurat object")
parser$add_argument('--filter', '-f', help = 'Name of fil... |
150218604bb40bc437bd4362054575b7cfbff102b834031e1c45af05a6f0b523 | R | 1,924 | 62 | library(tidyverse)
library(Seurat)
library(here)
#load data
human <- readRDS(here("data", "human_meta.RDS"))
chimp <- readRDS(here("data", "chimp_meta.RDS"))
gorilla <- readRDS(here("data", "gorilla_meta.RDS"))
rhesus <- readRDS(here("data", "rhesus_meta.RDS"))
marmoset <- readRDS(here("data", "marmoset_meta.RDS"))
... |
8bb9f7438d510419d6449b9b7bb44fe57ad2616883ae0aec9c098be20f7247be | R | 1,924 | 62 | #!/usr/bin/env Rscript
###this just craetes a zero based coverage object so that c an make some generic coverage plots later
###run in /mnt/2TBa/nanopore_work
#####set lib path to the result of calling .libPaths() in R on the same system[1]
library.path <-c("/home/arh49/R/x86_64-pc-linux-gnu-library/4.1", "/usr/loc... |
b6bfb9819cca693100132d8080fab9a36d90850adbb7234419b0187a76d7c50d | R | 1,926 | 64 | library(JASPAR2020)
library(TFBSTools)
library(BSgenome.Hsapiens.UCSC.hg38)
library(patchwork)
library(Signac)
library(Seurat)
pfm <- getMatrixSet(
x = JASPAR2020,
opts = list(collection = "CORE", tax_group = 'vertebrates', all_versions = FALSE)
)
atac_object <- readRDS("ATAC_object.rds")
atac_object <... |
a1eb4bbd271478f2e291bb84a03fa67597b90033a3e522632286f284334bf6f1 | R | 1,931 | 56 | # load functions and libraries
source("/inkwell05/ameer/functions/0_source_functions.R")
library(peakRAM)
# load data
data = spatial_QC(path_to_expression = "/inkwell05/ameer/databases/spatial/Vizgen_2022_Mouse_MERSCOPE/expression/Vizgen_2022_Mouse_MERSCOPE_brain_2_slice_2_expression.h5ad",
path_to_m... |
695307a9577ae98e00992a0e4d1461cf11519c63af65bd4874b78e516fb6bc53 | R | 1,933 | 51 |
## Apply epigenetic clock to early fetal samples aged between 6 - 23 pcw ##
# Fetal Clock function: https://github.com/LSteg/EpigeneticFetalClock
library(ggplot2)
#1. Load data ===================================================================================================================
load(paste0(PathToBet... |
be17a32c1c7f6ec465a4854de2939b7126e52c43549f0c7d580837c1c1242dde | R | 1,938 | 44 | # import misc libraries
library(tidyverse) # standard R data science package set (incl ggplot2, dplyr, tidyr, readr, purrr, tibble, stringr and forcats)
library(pacman) # easy loading and installing of additional packages:
library(usethis) # workflow optimisation
# Data preprocessing
p_load(lubridate, pracma,haven)
#... |
d8332a50370b8e5874bef4fea6436d211c41027d702787f3a244b1578d161e1d | R | 1,943 | 58 | box.plot.jitter <- function (dataframe, ID = NULL, vars = NULL, y_lim = NULL, return_outlrs = T)
# this function creates box plots with jittered outliers for columns in <dataframe>
# Arguments:
# <dataframe> a data frame with the variables of interest
# <ID> an optional name of the column tha... |
40dc4acaa82c5449483c17fa0848cbac85a9e89b12351fddd637badd5efafa5a | R | 1,948 | 49 |
## FANS heatmap ##
library(pheatmap)
library(data.table)
library(viridis)
library(RColorBrewer)
epicManifest <- fread(paste0(refPath, "MethylationEPIC_v-1-0_B4.csv"), skip=7, fill=TRUE, data.table=F)
celltype_cols <- c(plasma(4)[2],viridis(4)[3])
#1. Load data ====================================================... |
41a9298dfe4117acc716b438882d14ab1d983b7d6bc752874d0f381cf46fab70 | R | 1,951 | 50 | ---
title: "Spark functions"
description: >
Pull phenotype data from Spark environment.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Spark functions}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment... |
dcdac51b662c3be80e5d9fb0ac0855b8b179af2de5533ef6f4ae5a3c9835adbc | R | 1,956 | 70 | library("DeconvoBuddies")
library("SingleCellExperiment")
library("tidyverse")
library("here")
library("sessioninfo")
sce_path = here("processed-data", "13_PEC_deconvolution", "sce_CMC.rds")
stats_out_path = here(
"processed-data", "13_PEC_deconvolution", "CMC_marker_stats.csv"
)
markers_out_path = here(
"proc... |
e24ea7268494050acec977e777a45e6ae677d61fc03f306fe33807c947004a9b | R | 1,958 | 70 | library(tidyverse)
library(formattable)
library(docxtractr)
library(DT)
library(kableExtra)
library(webshot)
library(htmlwidgets)
# Setting working directory -----------------------------------------------
this.dir <- dirname(parent.frame(2)$ofile)
setwd(this.dir)
# Extract table from .docx ----------------------... |
7f278c8c044e1f0be59a9f1d135ba96786b0a5137c47f07ba878f53597a113ef | R | 1,962 | 56 | setwd("MERFISH_Moffit/")
library(Seurat)
library(ggplot2)
MERFISH <- readRDS("data/seurat_objects/MERFISH.rds")
Moffit <- readRDS("data/seurat_objects/Moffit_RNA.rds")
genes.leaveout <- intersect(rownames(MERFISH),rownames(Moffit))
Imp_genes <- matrix(0,nrow = length(genes.leaveout),ncol = dim(MERFISH@assays$... |
2d1287c94d2e12877f430eddd3e34152aba96159f5e3e2f65dcf3a4243d31fb1 | R | 1,963 | 49 | library(feather)
library(tidyverse)
# RNA-seq data path
data_loc = '/data/rnaseqanalysis/shiny/facs_seq/Mm_VISp_14236_20180912'
# Project path
project_path <- file.path(getwd(),'..','..','..','assets','aggregated_data')
# Annotation data
anno_feather_path <- file.path(data_loc,'anno.feather')
anno_feather_data <- re... |
873ce44d1df46137edac6acc75060d64cce9a48c6cc25222a496321987a31218 | R | 1,965 | 52 | # load packages
require(tidyverse)
require(Seurat)
# load Seurat object
sdata.align <- readRDS('sdata_align_RefF_prelim.rds')
# set Idents (resolution = 0.4)
Idents(sdata.align) <- sdata.align$seurat_clusters <- sdata.align$integrated_snn_res.0.4
# rename Idents
sdata.align <- RenameIdents(sdata.align,
... |
b41c800bab1c32f2d60ac5ae0acca93600fbb30d8fe39daf6be18df234fdab68 | R | 1,969 | 58 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv)
library(Seurat)
library(dplyr)
library(ggplot2)
library(ClustAssess)
library(qs)
objects_folder <- file.path(project_folder, "objects", "R")
ca_folder <- file.path(objects_folder, "clusta... |
b3e12fc55d5f8c359a742242374a0b96359431d6f82931996fc25fb9a57660c8 | R | 1,970 | 60 | # This script was interactively run to produce a lightweight SCE object,
# subset to the top-25 mean-ratio markers and using a dense counts assay. The
# goal is to make randomly subsetting and pseudobulking as fast as possible in
# the '05_deconvolution_hpse_random_subset.*' array job, since it gets
# perform... |
2cf0d442de60fe33aee0e44feaecfc9bcd79d245d452b8a7e08f13fe39b85ad2 | R | 1,972 | 45 | #' dmrff.annotate
#'
#' Annotate a set of regions with feature annotations.
#'
#' For example, the regions could be differentially methylated regions
#' and the features could be CpG sites.
#'
#' @param regions Data frame listing the regions to annotate.
#' Must have columns "chr", "start" and "end" to specify genomic ... |
12b5b70a7fc17b2ef058061192bbca4b4270efd72a94598c4190964685a6bcf1 | R | 1,982 | 60 | # ***************************************
# Tabula Muris window size analysis
#
# Note: MAGMA files of varying window
# sizes need to be first generated with
# tools/magma_gene_zscore_analysis.sh
# ***************************************
if (!require("here")) {
install.packages("here")
library("here")
}
if (!requi... |
3d29001aa25aafe723eb3b61f9b9abdc92b505546adad384444bdd611cf3438e | R | 1,988 | 61 | ```{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... |
84e907b02e3b55b0534d1f44bdbb21a71b5d1c94c879a4e997daac0f489429d7 | R | 1,988 | 57 | #generate magma expression data set in podaman container
#parameters:
#1: path of the sce
#2: path of the gene set directory
#3: output file directory
#4: temporary intermediate file path + header (will be removed later)
args <- commandArgs(trailingOnly = TRUE)
options(warn = -1)
#argument
data_path <- args[1]
gs_dir... |
67542dd1f7768c0d9eb1df2f2d16863aee40d2ce04875fde65fe4c94c41f6b79 | R | 1,992 | 73 |
library("SummarizedExperiment")
library("edgeR")
library("limma")
library("purrr")
library("here")
library("jaffelab")
library("sessioninfo")
#### Set up ####
## plot dir
plot_dir <- here("plots", "09_bulk_DE", "06_DE_library-combo")
if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE)
## data dir
data_... |
81b07c8adc1cb7936ac513da488ab59491fa998c8e43eb9b73faab41182f50ba | R | 1,994 | 44 | # GPT social perception: Plot the brain result similarities for each feature as a bar plot (GPT4.1 data)
# Yuhang Wu & Severi Santavirta 9.6.2025
library(readr)
library(ggplot2)
library(reshape2)
library(dplyr)
# Read the data
cor_and_threshold_results <- read.csv("/path/cor_and_threshold_results_gpt41.csv") # After... |
dae63033cae3a392303fd1c14f47047a88ba870f9b5256db1b4d7ad6aa2100c6 | R | 1,994 | 44 |
## Enrichment of ATAC-seq peaks within EWAS results ##
# Corresponding paper: Domcke et al (2020) https://www.science.org/doi/10.1126/science.aba7612
# sci-ATAC-seq data (85,261 cells) generated on 3 human fetal individuals (2 male, 1 female; 110-115 days post-conception, equivalent to 15.7-16.4pcw)
# Top 10,000 mos... |
5a8acf756379d364f3028ab4a86151177e03d680d7ce2a056466da75b79e0852 | R | 1,995 | 72 | library(fpp2)
library(forecast)
library(jsonlite)
concat <- function(...) {
return(paste(..., sep=""))
}
# get variable or NaN
get_var <- function(named, name) {
if (name %in% names(named))
val <- c(named[name])
else
val <- c(NaN)
names(val) <- c(name)
return(val)
}
# innov from np.random.seed(0); ... |
8f9d0d36a2438ba60f5a2224e2a41976aa19c7d2698c7fb254426c717fa452ed | R | 1,998 | 43 | #' Binary Label Dataset Metric
#' @description Class for computing metrics on an aif360 compatible dataset with binary labels.
#' @param dataset A aif360 compatible dataset.
#' @param privileged_groups Privileged groups. List containing privileged protected attribute name and value of the privileged protected attribute... |
9c2e115a5438357b32e606f53265aa9d32c582a00d02a8f50832c0feb2a03a1f | R | 2,000 | 55 | ```{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... |
fec5ae5900d2f936c94510c4db3d23f433626b1aa365d078dd5716e66064a18d | R | 2,001 | 59 | dev <- FALSE
if(dev){
library(fresh)
create_theme(
# main layout color
bs4dash_layout(
main_bg = "#ffffff"
),
bs4dash_status(
danger = "#db285a",
info = "#ededed",
success = "#0255e9"
),
bs4dash_sidebar_light(
bg = "#ededed", # working for bg whole sidebar
... |
e63393d8de5146739c6cab4050d0a42c7553dbf380b9a0e7af9c006b39937f17 | R | 2,002 | 54 | library(tidyverse)
set.seed(123)
cryptics_bed <- read_tsv("processed/zeng_2024/supplementary_s5.cryptic_pas.all.bed", col_names = c("chr", "start", "end", "name", "score", "strand"))
cryptics_bed
cryptics_bed <- cryptics_bed %>%
separate(name, into = c("APA_ID", "region", "gene_name", "pas_usage_control", "pas_usag... |
abc761e741f9f6d4f2f2fe52ec5ea8389e4ef23f270127517ab3b26f72fbda8d | R | 2,013 | 73 | # Siwei 08 Jun 2022
# plot h2 and enrichment for LDSC results
# init
library(readxl)
library(ggplot2)
library(RColorBrewer)
# load data
LDSC_MG_AST_h2_enrichment <-
read_excel("LDSC_MG_AST_h2_enrichment_w_Alz.xlsx",
col_names = FALSE)
df_to_plot <- as.data.frame(t(LDSC_MG_AST_h2_enrichment))
coln... |
3ab403d693a194316a67185969bfd8604a8f5f258999d4ce9b49077591b96315 | R | 2,036 | 83 | # 25 May 2022 Siwei
# test vcfR package
# init
library(readr)
library(plyr)
library(dplyr)
library(stringr)
library(Rfast)
library(ggplot2)
library(RColorBrewer)
# init
library(readr)
library(plyr)
library(dplyr)
library(stringr)
library(Rfast)
library(vcfR)
library(ggplot2)
library(RColorBrewer)
##
vcf_file... |
99faa56a1c39f9a2b9186782b4222939b271c0d274cf300f53d5ff89308ed28b | R | 2,038 | 67 | #File to identify differentially expressed genes in a class of excitatory neurons.
library(Seurat)
library(stringr)
library(dplyr)
library(limma)
library(doParallel)
library(foreach)
samps = readRDS("samps_1.RDS")
prot_df = readRDS("neuron_df_PSD_1.RDS")
annot = readRDS("annot_1.RDS")
samples_CA1 = grep("CA1$",an... |
c3b6a396e06bfa1791c22bbee3747d1ea6b67a44a96977476ca6c90f23cff3d7 | R | 2,038 | 97 | library(vars)
data <- read.csv('/home/wesm/code/statsmodels/scikits/statsmodels/datasets/macrodata/macrodata.csv')
names <- colnames(data)
data <- log(data[c('realgdp', 'realcons', 'realinv')])
data <- sapply(data, diff)
reorder.coefs <- function(coefs) {
n <- dim(coefs)[1]
# put constant first...
coefs[c(n, seq(1... |
cdc01dec89777bcd38b4a0d2b1dde876b075eac0c299acdec9a0838a03e803ad | R | 2,039 | 49 | options(stringsAsFactors = FALSE)
library(Matrix)
library(Seurat)
library(ggplot2)
library(stringr)
library(readxl)
library(ggsci)
library(dplyr)
library(reshape2)
library(readxl)
library(ggpubr)
#### Compare snATAC-seq genic region with snRNA-seq ####
group_num <- 10
neuron <- readRDS("inhouse_data_neurons.rds")
# g... |
e545b13e1fa82b3d960ac9dcc4df6cab6e19d7208eb2b17a883357103c3aec66 | R | 2,045 | 53 | library(feather)
# RNA-seq data path
data_loc = '/data/rnaseqanalysis/shiny/facs_seq/Mm_VISp_14236_20180912'
# Project path
project_path <- file.path(getwd(),'..','..','..','assets','aggregated_data')
# Annotation data
anno_feather_path <- file.path(data_loc,'anno.feather')
anno_feather_data <- read_feather(anno_fea... |
ea6737fd3a299188e93f181a9f6895ad0e84b520ad99e565ffc9fb1b6d1380c9 | R | 2,048 | 50 | #' Edit_dbSNP_Files
#'
#' Before LOH analysis, the dbSNP files need to be edited using the Edit_dbSNP_Files function (done only once):
#' @param Directory the directory were the files are, one GTF file per chromosome
#' @param File_Name the files name, without the number of the chromosomes
#' @param Organism "Human" or... |
fe8034635fe3b9b2c059a167179c84d859d05165190c50595eff4b35f2a21dff | R | 2,049 | 59 | #' Plot the top cell type associations for a given trait.
#'
#' @param trait_res A data.frame or data.table object of cell type associations
#' detected by seismic. It is expected that this data object contains a minimum
#' of three columns: cell_type, pvalue, and FDR.
#' @param fdr A Boolean value determining if FDR s... |
38763135bde9474bece3fabeb806abbb75e4e5c32f7279c3b2e62e9dcabe27f3 | R | 2,054 | 60 | #' Generate and save LBQ annotation file
#'
#' Creates a tab-delimited annotation file for LBQ (Label-Based Quantification) analysis,
#' detailing experimental design including channels, conditions, fractions, technical replicates,
#' and pseudo-biological replicates across multiple TMT experiments.
#'
#' This function... |
c0487765d4f795f0aea628a5969768e0af993334e057309e69e4f017189c4fdf | R | 2,057 | 57 | #' Load and filter proteomics quantification data
#'
#' Reads a tab-delimited text file containing protein quantification data and applies
#' filtering steps depending on the data type (`LFQ` or `LBQ`). For `LFQ` data,
#' missing precursor abundances are set to zero. For `LBQ` data, entries with high
#' isolation inter... |
f267301ce597498b624ddb00905a89eac40755373ba51a5ec44b9ada75de41f2 | R | 2,070 | 64 | length(unique(ad_genes_organoid$x))
length(unique(ad_genes_PMT$x))
length(unique(pd_genes_PMT$x))
length(unique(pd_genes_organoid$x))
list_genes=list(ad_genes_organoid$x, ad_genes_PMT$x, pd_genes_PMT$x, pd_genes_organoid$x )
names(list_genes)=c("ad_genes_organoid","ad_genes_PMT", "pd_genes_PMT", "pd_genes_organoid")... |
9a13cb9c70c356f0388b676976945044af76630a4c40223c7869707c7e88742d | R | 2,074 | 66 | library(KFAS)
options(digits=10)
# should run this from the statsmodels/statsmodels directory
dta <- read.csv('tsa/statespace/tests/results/results_wpi1_ar3_stata.csv')
matlab <- read.csv('tsa/statespace/tests/results/results_wpi1_missing_ar3_matlab_ssm.csv')
names(matlab) <- c(
'a1','a2','a3','detP','alphahat1','al... |
7931375af281685cf66b169154cde06ce93b9aba199cac0637a7177336990521 | R | 2,077 | 65 |
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
#引用包
library(Matrix)
library(tidyverse)
library(pROC)
library(ggplot2)
library(survival)
library(regplot)
library(ggsci)
library(survminer)
library(timeROC)
library(ggDCA)
library(limma)
library(rms)
inputFile="GSE104954.txt" #表达矩阵
hub="LASSO.txt" ... |
8ec9456231fc4f6cd44bf0ea77d54ab1f66619b410c124d1ecc26990da2ff8a2 | R | 2,077 | 45 | #! /work/home/sdxgroup01/00envs/anaconda3/envs/R4.2.0/bin/Rscript
#load packages
library(dplyr)
library(reshape2)
library(tidyr)
files <- list.files("~/dat/pyscenic/sex_no1day_tf",pattern="\\.csv$", full.names= TRUE)
files <- files[-c(17, 18, 21)]
ars_df <- data.frame()
all_res <- data.frame()
for (file in files) {
... |
c6ac08e55e20004dca42d550b3327c4ed02edbbc74d39952ab2a791191d34628 | R | 2,080 | 53 | library(pheatmap)
library(viridis)
data <- read.table("p01.txt", header = TRUE, row.names = 1)
#data_log <- log2(data + 0.001)
# Calculate Z-scores across all genes (normalizes across samples)
#data_zscore <- t(scale(t(data))) # Transpose, scale, and transpose back
# Alternatively, use a power transformati... |
b7cf407ea9d638890e2ac8fa106c653de9f89f4a90705e19af7bbd97a12698e6 | R | 2,086 | 56 | # http://dpmartin42.github.io/posts/Piecewise-growth
# https://www.lexjansen.com/pharmasug-cn/2015/ST/PharmaSUG-China-2015-ST08.pdf
# https://joshuawiley.com/MonashHonoursStatistics/LMM_Comparison.html#effect-sizes
# https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.13434
setwd("C:/Users/lu... |
0b5f8c8e1a688d7ca501676081c2f1893a02148a299d0f4786357652c862e4c8 | R | 2,094 | 62 | suppressPackageStartupMessages(library(optparse))
option_list = list(
make_option(c("-b", "--iclip_bedgraph"), type='character',
help="iCLIP bedgraph (iCount)"),
make_option(c("-g", "--intron_set"), type='character',
help='mapped introns'),
make_option(c('-o','--outfile'), type ... |
6919a82231b1a05745075fdd2e5540a1b2e6e0d73e37e1ec0c12c8e9ffa3e080 | R | 2,094 | 75 | setwd("STARmap_AllenVISp/")
library(Seurat)
library(Matrix)
read_data <- function(base_path, project) {
counts <- read.table(
file = paste0(base_path, "cell_barcode_count.csv"),
sep = ",",
stringsAsFactors = FALSE
)
gene.names <- read.table(
file = paste0(base_path, "genes.csv"),
... |
3b03c85d6174ae22a90dd02bf571a2c61dcacab9351a158c249d47fb183b9357 | R | 2,097 | 71 | # make disease/gene group plots for LDSC enrichment on scARC
# peaks enriched from psedobulk exp
# Siwei 28 Jul 2022
# init
library(ggplot2)
library(readr)
library(RColorBrewer)
library(stringr)
# import data
df_raw <-
read_delim("LDSC_output_4_R.tsv",
delim = "\t", escape_double = FALSE,
... |
b175106c407ba450d80715040ad4acd4178bc75eaf92bbd006f243a7de144a47 | R | 2,099 | 63 | # http://dpmartin42.github.io/posts/Piecewise-growth
# https://www.lexjansen.com/pharmasug-cn/2015/ST/PharmaSUG-China-2015-ST08.pdf
# https://joshuawiley.com/MonashHonoursStatistics/LMM_Comparison.html#effect-sizes
# https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.13434
setwd("C:/Users/lu... |
370af3994eb1cc6417830e47b8ffc77a1cca800b69fae4ec82b062441eb0c5ac | R | 2,101 | 45 | # GPT social perception: Plot the brain result similarities for each feature as a bar plot (GPT4 data)
# Yuhang Wu & Severi Santavirta 9.6.2025
library(readr)
library(ggplot2)
library(reshape2)
library(dplyr)
# Read the data
cor_and_threshold_results <- read.csv("/path/Fig5_brain_similarity_bars/cor_and_threshold_re... |
787ca0b4c5f71538da4dbe08c26ca5af1ca754c56d51d8a84e6f9633fd89fc86 | R | 2,101 | 56 | #https://github.com/thomazbastiaanssen/kronos/blob/main/R/plotting.R
#install.packages("kronos")
library(kronos)
library(ggplot2)
library(gridExtra)
library(tidyverse)
library(corrplot)
library(gprofiler2)
#
library(readxl)
setwd("/Users/mariareinacampos/Documents/00_MASTER/TFM/Resultats/Results_PD60_HPC")
bigdata_pd60... |
28f87c04bacd74bcbe43feeb26d8afc5512bbb2c724bc4fb1b41cc29370ff12d | R | 2,106 | 50 | library(tidyverse)
fish_counts <- read_tsv("data/fish_counts_cleaned.tsv")
# tidyup image & condition col (remove prefix)
fish_counts <- mutate(fish_counts,
image = as.numeric(str_remove_all(image, "^CTRL|TDP")),
condition = str_remove_all(condition, "[0-9]")
... |
16684417a1ec3078edf3fefb3fc540fe4c428bb22ffea628b942991bf32e2669 | R | 2,110 | 58 | ## Data Preparation WGCNA
# last change: LZ 2023-11
library(WGCNA)
library(data.table)
library(dplyr)
library(readr)
library(varhandle)
library(matrixStats)
DF <- data.frame
setwd("/path/to/WGCNA")
# The following setting is important, do not omit.
options(stringsAsFactors = FALSE);
# Allow multi-threading within W... |
0ec62440373c4b7ca58711a8d72ac8d9ac678f65d141e3d2886b4ab24ef7c0fa | R | 2,117 | 68 | Component.MainValueBox <-
function(mainValue,
mainValueSub,
sparklineName,
diffNumber,
text,
icon,
color) {
valueBox(
width = 3,
value = tagList(
countup(mainValue),
tags$small(paste0("| ", mainValueSub),
style... |
4a216d79e70f9f5e211c4c2be6d6f101a5941f681feb1beb0ee2242ed497a79c | R | 2,121 | 53 | # load packages
require(tidyverse)
require(Seurat)
# load Seurat object
sdata.align <- readRDS('sdata_align_RefF_label_minmin.rds')
# for each sample, count number of cells per cell type
cluster.data <- sdata.align %>%
FetchData(vars = c('sample_id', 'time_point', 'genotype', 'sex', 'cluster_label')) %>%
group_by... |
17e7478cf9c074c20ad1021cb126dac6fe8644a20c93c3add87fbbd255b4c128 | R | 2,122 | 70 | library(KFAS)
library(MARSS)
options(digits=20)
# should run this from the statsmodels/statsmodels directory
dta <- read.csv('datasets/macrodata/macrodata.csv')
obs <- data.matrix(dta[c('realgdp','realcons','realinv')])
obs[,1] <- obs[,1] / sd(obs[,1], na.rm=TRUE)
obs[,2] <- obs[,2] / sd(obs[,2], na.rm=TRUE)
obs[,3] ... |
25a8acdb5faa739c364367b2d67fdc9d5f4b04b6b8bb7e44a3ab076e844c5379 | R | 2,122 | 76 | #####
# Script for predicting methylation classes using MARLIN
# as in Steinicke, Benfatto, et al., manuscript in preparation
#
# The script takes in input multiple files (one for each sample) containing the
# methylation calls of CpGs restricted to positions of probes in our reference.
# Values are binarized and missi... |
0c0e05e2a76a6b92e9c5241a4cd904a6f3bd0fcfdcaa53bdde822855d89eb5f7 | R | 2,124 | 50 | options(stringsAsFactors = FALSE)
library(ggplot2)
library(reshape2)
library(dplyr)
library(stringr)
library(lme4)
library(lmerTest)
library(RColorBrewer)
library(ggpubr)
#### Residual plots to check LME assumptions ####
df <- read.table("data/TableS3_PTA_burden.tsv", header=T, sep="\t")
df$Case_ID <- as.character(df... |
26c5ed8a1541ff7f165bbb39f828ce568459b6e0a4bb8825f3f7152bb4678d5d | R | 2,127 | 47 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv)
library(Seurat)
library(qs)
library(foreach)
library(ggpubr)
objects_folder <- file.path(project_folder, "objects", "R", "seurat")
qc_folder <- file.path(project_folder, "preprocessing", ... |
16588a91f1385eb0094cd18effbdc60027e918e72c7036f438ded9c092eebc25 | R | 2,136 | 55 | ################################################################################
### LIBD pilot 10x snRNA-seq: DLPFC samples
### **Region-specific analyses**
### - R-batch job for detxn of optimal PC space with 'sce.dlpfc' object
### -> see '10x-pilot_region-specific_DLPFC_step02_clust-annot_MNTJan2020.R'
#... |
65d423c9c310730e9a61577de23b0b9c671c2b7cb663440e57c09e4625b29509 | R | 2,137 | 60 | # FFERREIRA 12/26/2024
# Sanford Consortium - UCSD
# Prepares table to export as SUP table
# Loads LIBs
library(tidyverse)
# Sets WD
wd <- getwd()
setwd(wd)
# OBJs to read INFILE
g1 <- "NOVA1-ArAr-CTRL" # LEFT
g2 <- "NOVA1-HuHu-CTRL" # RIGHT
ext <- ".tsv"
sep <- "\t"
dec <- "."
nas <- c(NA,"NA","")
l2fc <- 1
fdr <... |
c5308723ac0281946393e8d6b2e471ae9d2326aee8303558d501648ba4e85ca1 | R | 2,141 | 47 | # # 更新部分 =====
# library(tabulizer)
# library(gtools)
# library(data.table)
#
# dataset <- fread(file = "50_Data/MHLW/summary.csv")
# locationList <- fread(file = "50_Data/MHLW/summaryUrlList.csv")
# location <- as.list(locationList$link)
# names(location) <- locationList$date
#
# for (i in names(location)) {
# if ... |
d8c8ba5d43bf8fbf781e9ae9b12b5101343ca19f7865df1a5b0373cfdea28fc2 | R | 2,141 | 58 | library(fgsea)
# Load the pathways into a named list
GOBP <- gmtPathways(paste0(directory[1], '/GSEA/c5.go.bp.v2023.1.Hs.symbols.gmt'))
####################
#### Data Load ####
####################
b_amyloid <- read.csv(paste0(rerun, "Results/allregions_amyloid_auto_longformat.csv"))
b_tangles <- read.csv(paste0(r... |
0b09b8915372cfcc017acbd32c16d06980fc412749fd3b87775a8c3937705ddc | R | 2,144 | 66 | #!/usr/bin/env Rscript
### title: Correlation of cell line RNA-seq and scRNA-seq data for matched patients
### author: Jana Biermann, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(ggrepel)
library(viridis)
library(DESeq2)
library(ggrepel)
library(ggVennDiagram)
'%notin%' <- Negate('%in%'... |
809a22e0adfd1308bf48225186bfb1bcbfea8136e3464675ce9d302af8c85154 | R | 2,148 | 70 | #!/usr/bin/env Rscript
# check the input.csv file
library(rlang)
library(rtracklayer)
args <- commandArgs(trailingOnly = T)
input.df <- read.csv(args[1])
err <- 0
## check header
header <- c("folder_to_BAM","gtf_or_gff","polyA_bed","comparison_table",
"method","strand","SE_PE","analysis")
if (!all(colna... |
06389c230299e3800386f4aa524cdd393706f030f8f210ecbf68ee2b59a1fd88 | R | 2,157 | 66 | library(tidyverse)
library(formattable)
library(ggplot2)
# Setting working directory -----------------------------------------------
this.dir <- dirname(parent.frame(2)$ofile)
setwd(this.dir)
# Export formattable table ------------------------------------------------
library(htmltools)
library(webshot)
# This... |
fefc7a6c1fdbd0627d91fcc091624fae62b1728a61a1b7a3d3509380a2bd3482 | R | 2,157 | 61 | library(tidyverse)
library(here)
library(sessioninfo)
man_path = here('raw-data', 'bulkRNA', 'samples.manifest')
pheno_path = here('processed-data', '00_data_prep', 'sample_info.csv')
out_path = here('processed-data', '11_raw_data_upload', 'biosample.tsv')
dir.create(dirname(out_path), showWarnings = FALSE)
pheno_df... |
0fbd65ed23b380a818cff1b51387751a8fa94400b86a82291fce0450112e8793 | R | 2,163 | 69 | library(SBC)
library(tidyverse)
code = "VMM_rtc_full_int"
setwd('..')
cache_dir = "./_brms_SBC_cache"
fl.ls = list.files(path = cache_dir, pattern = sprintf("^res_%s_.*.rds", code))
tictoc::tic()
res = readRDS(file.path(cache_dir, fl.ls[1]))
stats = res$result$stats
errors = res$result$errors
outputs = res$re... |
dc5b662a691e840ecb0c2486ad151f513719d3a3482af780c6392d62acd2d1e0 | R | 2,164 | 75 | theme_arial_bw <- function(size = 8) {
theme_arial <- ggplot2::theme_bw() %+replace% theme(
panel.background = element_blank(),
panel.grid.minor = element_blank(), strip.background = element_blank(),
strip.text = element_text(
colour = "black", size = size,
family = "... |
f6587cf07126061363556506745dcb2ab3c055debf8ff40b93bee06e9234cbaa | R | 2,167 | 49 | #######################################################################
#######################################################################
### Align Raw Data to Custom Alpha-Syn Overexpressing Mouse Genome ###
#######################################################################
#################################... |
4999a8e7fd6aa8f544942872fd2b83b980c5607b7d2c3d1b31d293f737cae9c0 | R | 2,169 | 65 | # Identify cellsubtypes with low number of cells and save for future use
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2023
# activate conda environment in ITHACA
# conda activate use_seurat_r4
# Open R
# R
setwd("/data/work... |
58c8e9e8fdb197ffaaa1f0f8bdef624fce4983a218d0c47fd15255bff7e72b71 | R | 2,169 | 47 | # ±È½ÏUCRºÍÆäËû»ùÒò×éλÖõÄGCº¬Á¿
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(dbplyr)
UCR_location <- read.table(file = "01-data/UCR_raw/UCR_location.txt",
sep = "\t", header = TRUE)
UCR_location <- UCR_location[!(UCR_location$UCR_name == "uc.18" | UCR_location$UCR_na... |
705f683c5a7ae4b636b90e12d1dadae44f84467fb89e12944634c4bf6e950037 | R | 2,170 | 38 | # CSF
df1 <- data.frame(prop.table(table(sce$Celltype,sce$Sample),margin = 2))
colnames(df1) <- c("Celltype","Sample","Proportion")
df1_wide<-dcast(df1,Sample~df1$Celltype,value.var = 'Proportion')
df1_corr <- cor(df1_wide[,-1],method = 'pearson') %>% as.data.frame()
# ComplexHeatmap::pheatmap(df1_corr,border_color = N... |
65b927d20a601979ac913ae954da5c3bd9c12f42496e9c1c8ad9e9d08c37b576 | R | 2,173 | 52 | library(tidyverse)
library(readxl)
astro <- read_excel("macs_files/astrocytes_peaks_for_r.xlsx")
astro <- makeGRangesFromDataFrame(astro)
oligo <- read_excel("macs_files/oligo_peaks_for_r.xlsx")
oligo <- makeGRangesFromDataFrame(oligo)
micro <- read_excel("macs_files/microglia_peaks_for_r.xlsx")
micro <- makeG... |
d9fee191408985e549d676ef4481cad38a09274771d704d3ee22d0417899d83e | R | 2,181 | 103 | # Extract Microglia , use syn52368912
{
library(stringr)
library(Seurat)
library(parallel)
library(future)
library(glmGamPoi)
library(edgeR)
library(data.table)
library(readr)
library(readxl)
library(stringr)
library(ggplot2)
library(scales)
library(reshape2)
library(RColorBrewe... |
521edf7488e8d0c0cf48f32787db59215adfbb9f1bdcba6705ca72ae78b8df2c | R | 2,187 | 74 | # Siwei 21 May 2021
# Make PCA plot for 17 iMG samples
# init
library(readr)
library(factoextra)
library(Rfast)
library(ggplot2)
library(ggrepel)
library(gplots)
library(RColorBrewer)
library(stringr)
# load data
## load PCA raw data from featureCount output
### subsampled to 0.1 of the total reads
df_featureCoun... |
90c5f9632ed83867fd40545db9b06f07faef0083d2f6939461c5f3671855e65d | R | 2,188 | 38 | library(jsonlite)
library(purrr)
lang <- jsonlite::read_json(paste0("www/lang/translation.json"))
data <- fread(file = paste0(DATA_PATH, "Generated/resultSummaryTable.ja.csv"), sep = "@", quote = F)
ja <- lang$translation %>% map_chr(1)
cn <- lang$translation %>% map_chr(2)
en <- lang$translation %>% map_chr(3)
pre... |
832985b23504c24f6e02e5009206582513c0c9560bf58b0a42b8ff4d0bf7487f | R | 2,198 | 82 | # =============================================================================
# 细胞通讯分析脚本
# =============================================================================
# 功能:使用CellCall方法识别配体-受体对,分析细胞间通讯模式
print("Hello world!")
rm(list = ls())
# 加载配置文件
source("../config.R")
# 设置工作目录
setwd(ENV_DIR)
lf <- list.files(... |
3e801ca32050d42485638c657414e4ed6c4c2bbefe2e4cf19f8c613f22f7f7f4 | R | 2,200 | 98 | getFinalAndDiff <- function(vector) {
index <- length(vector)
return(list("final" = vector[index], "diff" = vector[index] - vector[index - 1]))
}
getFileUpdateTime <- function(file) {
fileUpdateTime <- file.info(file)$mtime
latestUpdateDuration <- difftime(Sys.time(), fileUpdateTime)
return(paste0(
round... |
b3e3acdd92c3206144e049d796a7cbec33446e7336c02b82d9406ed58b985370 | R | 2,202 | 51 |
## Compare Levene's test stats (early- and mid-fetal samples vs adult samples) ##
library(data.table)
library(scales)
library(ggplot2)
'%ni%' <- Negate('%in%')
#1. Load data ===================================================================================================================
load(paste0(MethylationP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.