sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
39710a46ba99cbdfea0a87cdee6806265634ad934515668e8156a2e20cd326bc | R | 3,060 | 68 |
#' @title viewMotifs
#' @description Shows the motif information table as HTML using DT::datatable()
#' @param tableSubset Motif information table to show
#' @param motifCol Column name containing the motif logo ID (to pass to RcisTarget::addLogo). If NULL the logo is not added.
#' @param dbVersion Database version (... |
5d15f5b29aef98d011e469f1bd73cb56d036d29b5c7fb798dba869af3f8eefa4 | R | 3,066 | 83 | #!/usr/bin/env Rscript
#-------------------------------------------------
# Title: Make PCA with DESeq2 helper functions
# Author: Amanda Zacharias
# Date: 2023-11-30
# Email: 16amz1@queensu.ca
#-------------------------------------------------
# Notes -------------------------------------------
# module load nixpkgs/1... |
d462e2ea25f8986267b78c1583c233745b767aac9f9170a8aaec4c44cdea6f8b | R | 3,070 | 89 | #' banc-sjcabs-upload — Sync exported BANC/maleCNS/MANC connectomes to GCS.
#'
#' @section Reads:
#' - `/n/data1/hms/neurobio/wilson/connectomes/{banc,malecns,manc}/`
#'
#' @section Writes:
#' - GCS `compiled_data/`
#'
#' @section CLI:
#' [datasets...] subset of `banc malecns manc` (default all)
###############... |
c96e00a0c2bf64f801ceb3a129bafcc6bb03626c56eb29c40f4cb629c4777cce | R | 3,076 | 82 | library(Giotto)
library(anndata)
library(Matrix)
library(Seurat)
library(scran)
library(reticulate)
args<-commandArgs(trailingOnly = TRUE)
sc_path <- "/data/narein/ST_deconvolution_Tanush/Data/MERFISH_Ileum/SC/SC.h5ad"
st_path <- "/data/narein/ST_deconvolution_Tanush/Data/MERFISH_Ileum/ST/ST.h5ad"
output_path <- "/data... |
e5d45a4a743a2b6d79ec4f9395c94bedd0094674806099cf7e15caaae05d05d7 | R | 3,081 | 130 | ---
title: "2_gene_symbol_annotation"
output: html_document
date: "2026-01-01"
---
```{r}
BiocManager::install("biomaRt")
```
```{r}
library(dplyr)
library(readr)
library(tibble)
library(readxl)
library(purrr)
library(biomaRt)
```
# load data
```{r}
counts_df <- read_tsv("/path/to/raw_counts_gene_id.tsv")
stopifnot(... |
dcfd3e796b511cc6778b71e79157a0908d05bd9a9e16fb26cf38ca115125e2dd | R | 3,083 | 73 | library(DESeq2)
library(ggplot2)
library(pasilla)
### Choose one matrix to analyze ###
coldata_df_R_PPS_A_AC <- coldata_df_R %>% filter(TYPE_2 == "R_PPS_A_AC" | TYPE_2 == "PPS_CTL")
filtered_samples_R_PPS_A_AC <- rownames(coldata_df_R_PPS_A_AC)
adjusted_df_R_PPS_A_AC <- adjusted_df_R[, colnames(adjusted_df_R) %in% fi... |
70c07e6eb3f4769f2cc92b58db33e9fb2e27b2a865717f7a550660dacbdd6b98 | R | 3,085 | 122 | ---
title: "Check donor information"
author: "Wei Sun"
date: "`r Sys.Date()`"
output:
html_document:
theme: journal
highlight: tango
toc: true
toc_depth: 3
toc_float:
collapsed: true
smooth_scroll: false
number_sections: false
df_print: paged
---
```{r setup, include=FALSE}
knit... |
c9caf37aee910e492eb16a9362a0befaf311988f750b453f94d71694ea56d1ba | R | 3,087 | 123 | ---
title: "seurat_hypo_dev_integration"
output: html_document
date: "2025-10-25"
---
```{r}
library(Seurat)
sessionInfo()
```
```{r}
library(Seurat)
options(future.globals.maxSize = 8000 * 1024^2)
sobj = readRDS('Data/mouse_dev_merge_processed.rds')
sobj = subset(sobj, !(original_annotations_low %in% c('NPC (gliog... |
e72934c263b94383cfab7f683c39d0300f8f71e6c43f8d59e58406e85e7f80af | R | 3,089 | 96 | #!/usr/bin/env Rscript
# conda activate peer
# 2023-10-02
# conda activate peer
# expression matrix must be n x e
# covs_pc_gender_age_num must be n x (5+1+1)
# -------------------------------------------
# SETUP
library(peer)
library(data.table)
library(dplyr)
# print usage
usage <- function() {
cat(
'usage: ... |
7215a29251555c6d00e684635cd1c3278dd8bf4814fda29d95526ab20fea0847 | R | 3,090 | 102 | # This script is used to map a volcano for single-factor cox analysis
library(dplyr)
library(ggplot2)
library(stringr)
library(openxlsx)
library(patchwork)
library(ggrepel)
attrTitleVsName <- "D:\\work2\\t2dAndComplicationsUkb\\data\\vs\\attrTitleVsName.xlsx" %>%
read.xlsx(., sheet = 1)
attrTitleVsName$f... |
a1ad1ad60c38ecb1e6e923f55a5571bcc9d8b7d9040484f99e51c932bc9d885f | R | 3,097 | 105 | library(dplyr)
library(ggplot2)
library(lme4)
library(rstatix)
library(tibble)
data <- readxl::read_excel("data/sjTREC_150kcells_21112024.xlsx") %>%
mutate(
log10age = log10(Age),
SNP_merged = if_else(SNP == "AA", SNP, "GA/GG")
)
m <- glm(sjTREC ~ log10age + SNP_merged + Gender, data = data)
... |
437f25d552ce99568442e3250071985082d7de4d654cdaecffc7c3e4250b01d6 | R | 3,100 | 94 | #!/usr/bin/env Rscript
suppressPackageStartupMessages(library("argparse"))
# create parser object
parser <- ArgumentParser()
# specify our desired options
# by default ArgumentParser will add an help option
parser$add_argument("-i", "--input", required=TRUE, help="load loom")
parser$add_argument("-o", "--output", re... |
8f3da9d781acc6267f48ca81f3f35d5247ecbf879537bed59ab26225089b1efd | R | 3,101 | 82 | summarize_metadata = function(base_path, subfolder, col_index, included_file_ID){
## check for each file in sub_folder, whether there exist any columns in col_index with all zeros
## summarize nrow, any NA
# read each .1D file in the sub-folder
all_files = list.files(file.path(base_path, subfolder),
... |
f9317a20af1a4d2ff8da9f6ff0637e668266d1f5a5af67724322666021ee39ae | R | 3,101 | 64 | # Moderate effect size genes project
# Author: Madison Caballero
# Desription: Removing variants that are Mendelian errors.
library(stringr)
args = commandArgs(trailingOnly=TRUE)
chr = args[1]
# SPARK families (a variation on a ped file). Header:
# family_ID father mother siblings sibling_sexes sibling_as... |
780698d16dbdeb61595caf3e1a3ee46c50848ef6a8a3b9ef17b33f73c6f255b3 | R | 3,102 | 107 | #' Soma locations for all intrinsic neurons of the ventral nerve cord
#'
#' These were generated as neuroglancer annotations by Chris Ordish of the FlyEM
#' team and
#' \href{https://flyem-cns.slack.com/archives/C01BT2XFEEN/p1614781577010700}{passed
#' to Greg Jefferis on 3rd March 2021 by Pat Rivlin}. These have been ... |
127b7dc60dc7d6ea515a2cc3bacaa3b93294dd66c734ef91b7bf5c9ab48fdc61 | R | 3,106 | 81 | #' Read L2 skeleton or dotprops for FANC neurons using fafbseg-py
#'
#' @description \code{fanc_read_l2skel} reads one or more neurons as simplified
#' L2 skeletons.
#'
#' @description \code{fanc_read_l2dp} reads one or more neurons as simplified
#' dotprops format. See \code{\link[fafbseg]{read_l2skel}}.
#'
#' @pa... |
1dd8c46ef0480c1ef9e0139101975563994e9208a4b51fd76c16ba6c98e0e280 | R | 3,106 | 78 | # Function used to split data, keeping only clusters of interest
#' Split clusters according to symmetric AUROC similarity.
#'
#' This function computes hierarchical clustering to group similar clusters,
#' interpreting the AUROC matrix as a similarity matrix, then uses a standard
#' tree cutting algorithm to obtain g... |
3e2c4c77d61318e158f2ce4fd7611d1e92ea3821fd2c2eff78e74495e8a8b02e | R | 3,106 | 118 |
cleantrack.rfunc=function(s,a) ({
if (a=="nose") ({
colmatchx=4
colmatchy=5
})
if (a=="center") ({
colmatchx=2
colmatchy=3
})
tscan=s
#fr=a
#tscan=tscan[1:nrow(tscan),c(c(1,3,4,13),seq(15,19))]
#tscan=data.frame (rbind (tscan),stringsAsFactors=F)
#colnames(tscan)=c("ttime","posx","posy","... |
9e58271ad5a5a5b864998933644023ce5d7237735f911e85209f8c99837cca9e | R | 3,107 | 66 | library(MetaNeighbor)
library(MetaMarkers)
library(dplyr)
library(here)
library(readr)
library(tibble)
library(conflicted)
conflicts_prefer(base::setdiff)
conflicts_prefer(base::intersect)
conflicts_prefer(dplyr::filter)
conflicts_prefer(dplyr::rename)
conflicts_prefer(dplyr::count)
Sys.setenv("VROOM_CONNECTION_SIZE"=1... |
40a0a709791fa419524af61c80a40f002e108847c3dcde57624a1202a6182171 | R | 3,110 | 86 | # Summarized topics with SNPs-3 types
library(ComplexHeatmap)
library(dplyr)
library(ggplot2)
library(data.table)
library(colorRamp2)
library(ggplotify)
library(patchwork)
library(gridExtra)
outp <- "/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318/cisTopic"
add <- theme_set(theme_bw())+
th... |
ebf94a6e0d05ec68ffaa8a3681ecb22fffdde37d5a183297e990914fe870f214 | R | 3,110 | 74 | #' Prepare stitched data for plotting
#'
#' Given a \code{SpatialExperiment} built with \code{visiumStitched::build_spe()}
#' <http://research.libd.org/visiumStitched/reference/build_spe.html>, drop
#' excluded spots (specified by \code{spe$exclude_overlapping}) and compute an
#' appropriate spot size for plotting with... |
3e2436dd54564a31169747da399ced78bd4cabcd20efd037152ff75de5e0fa88 | R | 3,111 | 78 | # 1. 加载必备包(若已加载可跳过)
library(dplyr)
library(readr)
# 2. 读取输入文件(同超几何检验,确保字段名一致)
df <- read_csv("overlap_data_up_regulated_fisher.csv", show_col_types = FALSE)
# 3. 定义Fisher精确检验函数(核心:构建列联表+检验)
# 输入参数:N=背景基因数,K=DEGs数,n=DAGs数,k=观察重叠数
fisher_test <- function(N, K, n, k) {
# 处理特殊情况(无DEGs/DAGs/重叠时,无法构建列联表)
if ... |
28b0fc23108735df323d4300252113a56bca2343f648affd630efcbb780c5e10 | R | 3,115 | 78 | # 1. 加载必备包(若已加载可跳过)
library(dplyr)
library(readr)
# 2. 读取输入文件(同超几何检验,确保字段名一致)
df <- read_csv("overlap_data_down_regulated_fisher.csv", show_col_types = FALSE)
# 3. 定义Fisher精确检验函数(核心:构建列联表+检验)
# 输入参数:N=背景基因数,K=DEGs数,n=DAGs数,k=观察重叠数
fisher_test <- function(N, K, n, k) {
# 处理特殊情况(无DEGs/DAGs/重叠时,无法构建列联表)
i... |
fb930f6657dfaa5e57252fadc47277e560ccc0c532823a042d3e24af50cf4ad2 | R | 3,116 | 86 | #!/usr/bin/env Rscript
suppressPackageStartupMessages(library("argparse"))
# create parser object
parser <- ArgumentParser()
# specify our desired options
# by default ArgumentParser will add an help option
parser$add_argument("-i", "--input", required=TRUE, help="load atac RData with gmat")
parser$add_argument("-a"... |
4882b631fc9e77a66b436cce99603fe67afc568dcf40f1c462fed95ceb2df117 | R | 3,119 | 91 | library(here)
library(tidyr)
library(stringr)
library(org.Mm.eg.db)
library(MetaMarkers)
library(magrittr)
library(dplyr)
library(zellkonverter)
library(SingleCellExperiment)
library(readr)
library(conflicted)
conflicts_prefer(base::setdiff)
conflicts_prefer(base::intersect)
conflicts_prefer(dplyr::select)
conflicts_pr... |
0c8157d64e168f3695a1f51973f863b6df0fa3da622b5e13a35b0251e3b43a63 | R | 3,130 | 134 | test_that("Test RunLimmaDE", {
coords <- readRDS(system.file("extdata", "MouseBrainCoords.rds",
package = "SpNeigh"
))
logNorm_expr <- readRDS(system.file("extdata", "LogNormExpr.rds",
package = "SpNeigh"
))
cells_ref <- subset(coords, cluster == 0)$cell
cells_tar <- subset(co... |
b14f2a507a7f7e31d5b306582bebab8bfc136420b3fb27bd0e87639483d81d01 | R | 3,131 | 92 | library(dplyr)
library(ggplot2)
# Define list of data names to process
data_names <- c(
# '02.' prefix - intersection and unique between M_KAI_IH and R_PPS
'intersection_M_KAI_IH_IPSI_R_PPS_A_up',
'unique_M_KAI_IH_IPSI_A_up',
'unique_R_PPS_A_up',
'intersection_M_KAI_IH_IPSI_R_PPS_A_down',
'unique_M_KAI_IH_... |
2247024fea2f9905252df2b170636c6705772908804de658a8fa38ef450f2354 | R | 3,134 | 153 | ---
title: "Normalize imputed values of autosomal probes"
subtitle: "We only run BMIQ normalization, without prior quantile normalization"
author:
- David lukacsovich^[University of Miami]
- Lily Wang^[University of Miami]
date: "`r Sys.Date()`"
output:
rmarkdown::html_document:
highlight: pygments
theme... |
c520214248d600d1d897f83d6947ba3566c51388d95be218962460acd9b28d27 | R | 3,134 | 91 | library(Seurat)
library(ggplot2)
library(dplyr)
library(cowplot)
library(reshape2)
library(MAST)
library(EnhancedVolcano)
library(SCP)
library(scCustomize)
library(BiocParallel)
library(RColorBrewer)
register(MulticoreParam(workers = 8, progressbar = TRUE))
##### LG815C MG clustering
DefaultAssay(MG) <- 'integrated'... |
e4847566b9c417ff7f2f1eecca9ac4261b702f69ae54ab2a502fb1c0d19abff2 | R | 3,135 | 109 | rm(list = ls())
############################################
# Packages
############################################
pkgs_cran <- c("ggplot2", "openxlsx", "tidyverse", "reshape2", "rstatix")
for (pkg in pkgs_cran) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg, dependencies = TRUE)
}
l... |
c889a67191d344b26fc76120662dc6f13fa9bf07429453a24c1ab4f04103340f | R | 3,136 | 78 | library(SingleCellExperiment)
library(zellkonverter)
library(parallel)
library(magrittr)
library(dplyr)
library(here)
library(readr)
library(conflicted)
conflicts_prefer(base::setdiff)
conflicts_prefer(base::intersect)
conflicts_prefer(dplyr::filter)
conflicts_prefer(dplyr::rename)
conflicts_prefer(dplyr::count)
#IMPO... |
648a887445f772c96b2c70ab1432300b011c6266521bd3e1176921f4a5808bd3 | R | 3,137 | 58 | #' Create random modules
#'
#' Creates a matching random module for each actual module.
#'
#' The function outputs a random module for each module in \code{pruned_modules}. The random modules have the same regulators and contain the same number of target genes as the original modules, but these target genes are randoml... |
2aa77dc347a6f1ce9118792ed51c21538a24f52c5bc8e30211e0f8e7b862f63d | R | 3,141 | 80 | ---
title: "Fig_S4C_tumor_annotation_dotplot"
output: html_document
date: "2026-02-17"
---
```{r}
library(Seurat)
library(tidyr)
library(ggplot2)
library(ggpubr)
library(dplyr)
library(harmony)
library(purrr)
library(cowplot)
library(rstatix)
library(ggbeeswarm)
library(ggbreak)
```
# Set up and adjust metadata
```{... |
664b1b24e57a99cf9b2c8aaee9ca9e5c2946479e7970b4660a54f872729c6c9a | R | 3,143 | 81 | ---
title: "Integrating RNA-seq and ATAC-seq with conos"
output:
rmarkdown::html_vignette:
vignette: >
%\VignetteIndexEntry{"Integrating RNA-seq and ATAC-seq with conos"}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
This tutorial walks through an example of RNA-ATAC-seq integration based o... |
bae7772dc68645268c9047b7af6bd051af32fcf3b9a1cc5a43b2b4c61d5e938a | R | 3,145 | 67 | ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
# Parameter settings
##### ##### ##### ##### ##### ##### ##### ##### ##### #####
setwd(file.path(getwd(), "R"))
source("00_directorySettings.R") # load baseDir, xeniumDir
source("00_settings.R")
dataDir <- file.path(baseDir, "data")
outDir <- file.path(baseDi... |
20499f6c1e52fbd59bd7d8eff35eb4c5670800dd22da20a6a522c4465d22f449 | R | 3,150 | 81 | ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
# Parameter settings
##### ##### ##### ##### ##### ##### ##### ##### ##### #####
setwd(file.path(getwd(), "R"))
source("00_directorySettings.R") # load baseDir, xeniumDir
source("00_settings.R")
dataDir <- file.path(baseDir, "data")
outDir <- file.path(baseDi... |
717eeb19912f3ec512a5e3359f54e4ada2d5879cdd8d05eba97ca2fe3d6606c4 | R | 3,150 | 72 | # This script creates a summerised transcript per gene per sample table using .bam files created in STAR alignments and saves the output as a .csv file
# Osmia bicornis
bamFiles <- list.files(pattern="*.bam",
path = "~/2023-osmia_bicornis/results/2023-04-star") # List of BAM files
bamFil... |
8d4032f2e8f80960e9e737395cd22e90db84a077f973044c8a18112e9bc20055 | R | 3,150 | 97 | nginfo <- function(ids, values=NULL, sep='_') {
if(is.data.frame(ids)) {
if(ncol(ids)>2)
values=do.call(paste, c(ids[-1], sep=sep))
else
values=ids[[2]]
ids=ids[[1]]
}
l=list(`@type` = "neuroglancer_segment_properties",
inline = list(
ids = as.character(ids),
prope... |
139f100f51cef22f54783e264359f7e4941f7615bf464ce63e8473a44e3cd64b | R | 3,151 | 89 | library(edgeR)
library(dplyr)
process_rnaseq_data <- function(counts_file, metadata_file, annotate = FALSE) {
# Read count matrix with proper header handling
counts <- read.delim(counts_file, check.names = FALSE, stringsAsFactors = FALSE, header = TRUE)
# Set gene IDs as rownames and remove the Geneid column
... |
b11c6d7a035a1c2e22b9c07b8ba954355d194d179c09e52f800ab3b5ad13581d | R | 3,158 | 74 | image <- universalmotif::read_homer("/data/share/htp/perturb-seq/TF_selection_gRNA_design/TF_motifs/IMAGE/utils/Collection.motif")
jaspar_unvalid <- universalmotif::read_jaspar("/data/share/htp/perturb-seq/TF_selection_gRNA_design/TF_motifs/JASPAR2022_UNVALIDATED_non-redundant_pfms_jaspar.txt")
jaspar_valid <- univers... |
42894dce8c8c0ea2ca2cf66d67536942db0eb21738b2d9e09f6c641eda779c43 | R | 3,160 | 105 | wd <- dirname(rstudioapi::getActiveDocumentContext()$path)
setwd(wd)
if(!require("pacman")){install.packages("pacman")}
p_load(here, R.matlab, stringr, plyr, ggplot2)
#####################################
# read data
filenames <- list.files(here::here(wd, "Results", "Multiverse_Loop"))
# number of repeats and fol... |
4dabb68c3f27d2f3c60af088e05fefe011d304245953311350a4f17e83290959 | R | 3,160 | 106 | #!/usr/bin/Rscript
args <- commandArgs()
# print(args)
dir <- args[6]
Name <- args[7]
Cutoff <- as.integer(args[8])
Genome1 <- args[9]
libtype <- args[10]
Name1 <- paste(Name, Genome1, sep=".")
File1 <- paste(Name1, ".unfiltered.counts.csv", sep="")
File2 <- paste(Name1, ".filtered.counts.csv", sep="")
# print(pas... |
4eb54bcfe2c7dcae5a695c1a3535861d9a954f09b3bd361b91f211f1a6bf5c65 | R | 3,170 | 74 | # Moderate effect size genes project
# Author: Madison Caballero
# Desription: Testing comorbidities for MES gene carriers without ASD
options(tidyverse.quiet = TRUE)
library(tidyverse)
args = commandArgs(trailingOnly=TRUE)
#MES genes
GENES = read.delim(file = "MES_genes.txt", header = FALSE)
# SPARK metadata
FAM = ... |
3d850313793f0514e6c0a323fdb46157e12324a3000b19777e480fc61dd02d96 | R | 3,171 | 75 |
###
genome_version <- "hg38"
temp_dir <- "~/tmp/mhcbinding/"
txt_path <- "data/TCGA_driver_mutations_annovar_input.txt"
annovar_path = "~/software/annovar/"
comm_annotate <- paste0(annovar_path,"/annotate_variation.pl -out ",temp_dir,"/test -build ",genome_version," ",txt_path,
" ",annovar_pat... |
2c31982356c1040f9beab0f0ff53755c85e4d75fdbd3aaf8877e3f55cef46663 | R | 3,180 | 106 | test_that("l2cache_data_to_tibble preserves ids and expands columns", {
x = list(
"720575940600000001" = list(
size_nm3 = 10,
rep_coord_nm = c(1, 2, 3),
pca = matrix(1:9, nrow = 3, byrow = TRUE),
pca_val = c(4, 5, 6),
chunk_intersect_count = matrix(11:16, nrow = 2, byrow = TRUE)
... |
c7c92b11f75779f2944ccf2a7b3a7da6bc274db7b6096cbc2ad55bae91836448 | R | 3,181 | 97 |
#################################################
## Script to prepare genotype data and map SNPs to gene coexpression modules
##
## This script performs:
## 1. Maps SNPs to gene co-expression modules:
## - Loads gene coexpression module from file and SNP annotation data
## - For each brain region:
## ... |
103a8ae138c6ac9ec86f21830908b9c045f22d991279ab86f694c938a9c1da70 | R | 3,182 | 74 | library(DESeq2)
library(ggplot2)
library(pasilla)
### Choose one matrix to analyze ###
coldata_df_M_PILO_IP_A_HA <- coldata_df_M %>% filter(TYPE_2 == "M_PILO_IP_A_HA" | TYPE_2 == "CTL")
filtered_samples_M_PILO_IP_A_HA <- rownames(coldata_df_M_PILO_IP_A_HA)
adjusted_df_M_PILO_IP_A_HA <- adjusted_df_M[, colnames(adjust... |
65080f54b6b7300aa4607e0db9969902e9ba897711b0ef726d6400830cd181fb | R | 3,182 | 92 | find_dna_channel <- function(fcs) {
return(grep("Ir193", flowCore::parameters(fcs)$name))
}
find_bead_channels <- function(fcs, bead.type = c("Fluidigm", "Beta","XT")) {
bead.type <- match.arg(bead.type)
grep.string <- switch(bead.type,
Fluidigm = "Ce140|Eu151|Eu153|Ho165|Lu175",
Beta = "La... |
c99e217cf3e0c4b3992aa82b590dde689a04b086fb2bd528bfaaf90fd9f7d953 | R | 3,182 | 56 | here::i_am("scripts/2.validations/2.5.expression_pattern_divergence/2.5.2.expression_pattern_divergence_VS_network_divergence.R")
library(tidyverse)
library(here)
library(ape)
library(ggbeeswarm)
wd <- here("data/validations/expression_pattern_divergence/")
fig_dir <- here(wd, "figures/")
dir.create(fig_dir)
# load... |
e2a9cb323a9b4e493114b43d7dab33b69d08a06e2403b5c5ea110195e4022dba | R | 3,185 | 84 | #20250502
# Format tpm matrix for MAGMA
# open R
srun -n 10 -p interactive --pty /bin/bash
module load cluster/gsl/1.15
module load cluster/htslib/1.9-devel
module load cluster/build_tools/llvm/8.0
module load cluster/util/gcc/8.2
module load hdf5_18/1.8.21
conda activate r_env
#conda deactivate
R
# Load required ... |
04d1faf0a9ae4667ca523dff64917a1aa5dee7cc0163f6cc08996cc91acb4ac3 | R | 3,187 | 79 | #!/usr/bin/env Rscript
# Received from Fred Varn.
# install.packages(pkgs="/projects/verhaak-lab/USERS/johnsk/misc/SofWar/R/ssgsea.GBM.classification/",repos=NULL)
#######################################################
library(odbc)
library(DBI)
library(ssgsea.GBM.classification)
####################################... |
c64f34f0439cfb355012e9b378bfef0b6a8ab6df1248a580bc17e32324085be4 | R | 3,187 | 76 | # R script for identifying stable, converter, and unsure MCI subjects based on longitudinal ADNI data
# Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi)
# Last updated: 21-Feb-2025
#
# Description:
# This function loads baseline and longitudinal ADNI data, identifies stable MCI subj... |
754639457cdc9afb23f5d807a023e66e07150c30121a08d834b636d3145065d9 | R | 3,188 | 86 | ## Need to run the following script first
### 'Fig1.SideChain_2.invitro.studies.R'
setwd(rstudioapi::getActiveProject())
rm(list = ls())
library(tidyverse)
library(ggpubr)
library(ggrepel)
load("./Output_Data/SC.2outof2LC.invitro.Padj.Sig.features.Rdata")
load("./Output_Data/Invitro.SC.analysis.Rdata")
Invitro.SC ... |
35ce952786058735a4f36ea10d2671927774d1db6b36722b136f0f98bd7bbf1c | R | 3,189 | 88 | require(data.table)
require(readxl)
# Set base directories
# base_dir = "path/to/conditional/results/"
# predictions_dir = "path/to/predictions/"
base_dir = "./result/conditional.results/"
predictions_dir = "./result/predictions/"
##### load Loci
load(file.path(base_dir, "Loci.RData"))
##### set relative... |
0d9f36debd1e28a0ad371421b00e2b27c6377088a1d5a6a195c836dce82f7722 | R | 3,193 | 82 | path = "/media/StorageOne/zurbzh/Projects"
file.names <- dir(path)
project_name = c()
identified_viruses = c()
original_sequence_number = c()
identified_average = c()
not_identified_average = c()
whole_unknown_viruses_rate = data.frame()
whole_known_viruses_rate = data.frame()
for (i in 1:length(file.names)) {
... |
64c162de81dac5747eb32f893d0b67693f8be6b9c22ec088552bb9359ef7e3b8 | R | 3,194 | 86 | library(enrichR)
setEnrichrSite("Enrichr")
# Set up the database
dbs <- c("DisGeNET")
# Specify the folder containing the files
input_folder <- "/Users/jks6575/Dropbox/Jiawan/Analysis/Genetic_enrichment/DEGs_for_fisher/test_gene/fam3" # Replace with your folder path
output_folder <- "/Users/jks6575/Dropbox/Jiawan/An... |
9552f3db7f75344273f01fad99b9f679c82be038ddd9eaa1ac91c2d8c1e771dc | R | 3,195 | 90 | #' Plot cells located within spatial boundaries or ring regions
#'
#' Visualizes cells that fall within defined spatial regions
#' (boundaries or rings), typically obtained using
#' the `GetCellsInside()` function. The cells are colored by cluster,
#' and the function offers two plotting modes: using `geom_sf()`
#' (wi... |
02bec298950813a3b8f45e5de76bf821573194c752166c097938049efcdb2736 | R | 3,199 | 76 | # R script for identifying stable, converter, and unsure CN subjects based on longitudinal ADNI data
# Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi)
# Last updated: 21-Feb-2025
#
# Description:
# This function loads baseline and longitudinal ADNI data, identifies stable CN subjec... |
6d312e8c26725782bffe2df7cf2cbbff94a3d2db9326ced4f104c496b1931c12 | R | 3,201 | 76 | ### ----------------------------------------------------------------------
rm(list = ls())
library(tidyverse)
library(ggthemes)
library("scales")
library(ggpubr)
library(ggbeeswarm)
## -------------------------------------------------------------------------------------------------------------------------
rm(list = ls... |
a8502c93694002c766c02299fb636e54cb1145799b901578a56f03a26d11a302 | R | 3,204 | 48 | rm(list = ls()); setwd('/sc/arion/projects/DiseaseGeneCell/Huang_lab_project/ADASE/ASE_individual')
### Load in related information
# clinical information
clinicals <- as.data.frame(readxl::read_xlsx('../data/SampleClassification/SampleClassification.xlsx'),stringsAsFactors=F)
colnames(clinicals)[match('Sample',c... |
9f77e553af3c113db2741cfe9823abe94d0fec7af4e07335ca978c8529f96dc2 | R | 3,210 | 100 | #' A ggplot2 layer for visualizing the Visium histology
#'
#' This function defines a [ggplot2::layer()] for visualizing the histology
#' image from Visium. It can be combined with other ggplot2 functions for
#' visualizing the clusters as in [vis_clus_p()] or gene-level information
#' as in [vis_gene_p()].
#'
#' @para... |
becd2c1f4e10f2487808d3a6394f70804bff75e9b8ddbea969cf2694f8f25d38 | R | 3,213 | 63 | ########################################################################################################
#### Trial dataset for this R script can be downloaded from ####
#### https://data.mendeley.com/datasets/454s2vw255/1/files/faae5be7-e32d-4b7e-8c7d-1c3970fc86d0 ####
##... |
35a0326244dd1711d4d92b5b760e450212e6502acc913a945838e628d85897c0 | R | 3,215 | 104 | # ===============================================================
# Visualization Module — Descriptive Statistics (Dispatcher)
# ===============================================================
visualize_descriptive_ui <- function(id) {
ns <- NS(id)
sidebarLayout(
sidebarPanel(
class = "ta-sidebar",
... |
d63c08eded6fb71c0f82558591acef2deda08b4c291f9315635726d301b623c2 | R | 3,217 | 74 | ``` {r}
#Track-modifying function. Nothing changes until a worm track first appears, but then each subsequent gap in the data is filled by duplicating the last observed value. One consequence is that a worm “freezes” at the boundary once it leaves the arena.
fill_last_value <- function(x) {
for(i in 2:length(x)) {
... |
bbe35919e8a9b0ff60f69b026ca4b74abb47c0fddaf7be080f4fced936c3236e | R | 3,227 | 52 | setwd("data-raw/intermediate_files/")
# download JASPAR2024 vertebrate core
download.file("https://jaspar.elixir.no/download/data/2024/CORE/JASPAR2024_CORE_vertebrates_non-redundant_pfms_jaspar.txt", "JASPAR2024_CORE_vertebrates_non-redundant_pfms_jaspar.txt")
# download JASPAR2024 vertebrate unvalidated
download.fil... |
f5f761010d0029bdf53c932043ba66d0c0a31e7c2f5fe377150deb8f52fe0a61 | R | 3,228 | 104 | # ===============================================================
# 🏠 Table Analyzer — Home Module
# ===============================================================
home_ui <- function(id) {
ns <- NS(id)
fluidPage(
div(
class = "home-simple-wrapper px-3",
div(
class = "hero home-simple mx... |
693b28e61209a96f876635b90cf27181cd59d509ab4bf0b96bf965174822e2ed | R | 3,229 | 88 | library(methods)
library(Seurat)
names = list(
"../../data/293t_jurkat/293t_table.txt",
"../../data/293t_jurkat/jurkat_table.txt",
"../../data/293t_jurkat/jurkat_293t_50_50_table.txt",
"../../data/293t_jurkat/jurkat_293t_99_1_table.txt",
"../../data/brain/neuron_9k_table.txt",
"../../data/macro... |
b8f84c9ed2ea9c25c9754c53a6ffda8f34b19b7a486076610565331de1481ae7 | R | 3,232 | 59 | ids <- read_tsv("~/perturb-seq/TF94_combined/download_from_tuebingen/ids.txt", col_names = FALSE)[[1]]
# load the species demultiplexing results for the hg38 mapping
species_assignment_hg38 <- foreach(id = ids,
.combine = bind_rows) %do% {
... |
b95a3898dcec90dc5398a1d74401e5ba55418fd0c2d0ae01f4ebce64623139bd | R | 3,236 | 73 | ### Visualize the effect of young PM lipid supplementation by category in pie chart
### Based on the effect size comparison between young and old GPMV, as well as effect size between cells with or without young PM lipid supplementation
setwd(rstudioapi::getActiveProject())
rm(list = ls())
library(tidyverse)
library(... |
b6a1b89ad08fe55349f2a7d06d6a4009091a86058352865fc5641c9652d832ec | R | 3,241 | 82 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
print("************************************ Starting ************************************")
library(Matrix)
## Test parameters:
# in_path <- "/vast/palmer/pi/verhaak/kcj28/care_idh_mut/processed_data/nmf_input/Undifferentiated/"
# mat_index <- 1
# out_pat... |
dcc5cf0748cd9eefe73ae9d17ac12d913dff129bebe25b727ce28d00743bc97d | R | 3,248 | 104 | # source ~/load_modules.sh
library(Seurat)
library(Matrix)
library(ggplot2)
library(plyr)
library(tidyverse)
library(tidyr)
library(dplyr)
library(ggpubr)
library(reshape2)
library(rio)
library(data.table)
library(harmony)
library(GeneOverlap)
library(readr)
library(DESeq2)
library(SingleCellExperiment)
library(apeglm)... |
5157c461c800f7f81ffc6437eb24ddd8aa003c12f3f766cfe9289b9b54a46844 | R | 3,249 | 167 | ---
title: "Get beta-values for significant probes"
author:
- David lukacsovich^[University of Miami]
- Lily Wang^[University of Miami]
date: "`r Sys.Date()`"
output:
rmarkdown::html_document:
highlight: pygments
theme: lumen
toc: true
number_sections: true
df_print: paged
code_download: ... |
c10dc2e46077e1c26a8d2d3e8714a793921dbc8199d58b8efc40c357e9dd992e | R | 3,249 | 69 | # Load necessary libraries
library(coco)
# Set base directory for conditional analysis results
# base_dir = "path/to/conditional/results/"
base_dir = "./result/conditional.results/"
##### load Loci
load(file.path(base_dir, "Loci.RData"))
to.keep = names(table(Loci$Region))[table(Loci$Region) > 1]
check = gs... |
1174335ecd49621af99881c6fa912ba492338b294c536d65cb323b349f2ea142 | R | 3,250 | 103 | library(ggplot2) # plots
library(brms) # Bayesian lmms
library(tidyverse) # tibble stuff
library(SBC)
library(bayesplot)
# set options for SBC
use_cmdstanr = getOption("SBC.vignettes_cmdstanr", TRUE) # Set to false to use rstan instead
options(brms.backend = "cmdstanr")
# using parallel proce... |
95fdd1096a2eb5ff4b38283349233a7e2ea7506565d6005aacdfa4639f98eb71 | R | 3,259 | 93 | # 03_differential_expression.R
# Differential expression between AD and HC, age comparisons, overlaps
rm(list = ls())
library(car)
library(ggplot2)
library(openxlsx)
source("scripts/utils.R")
data <- read.csv("data/峰面积表达谱_填充_排序.csv", row.names = 1)
dat <- as.matrix(data)
dat[dat == 1] <- 0 # 1 indicates ... |
4ed1559534dca7e9780f2fdff8ee2b67d5fe0539ff931672952a1d49d9140409 | R | 3,260 | 113 | #============================================================
# Function microsacc() -- Microsaccade Toolbox 0.9
# (R-language Version)
# Authors: Ralf Engbert, Petra Sinn, Konstantin Mergenthaler,
# and Hans Trukenbrod
# Date: February 20th, 2014
# MODIFIED BY RICHARD SCHWEITZER to make the function deal with NaNs
#=... |
45097039dec5d40952350d20ad0b14591c6eb72542694c67a7879695453a1ba8 | R | 3,264 | 107 | #!/usr/bin/env Rscript
#-------------------------------------------------
# Title: Write GFF Compare Scripts
# Author: Amanda Zacharias
# Date: 2023-07-20
# Email: 16amz1@queensu.ca
#-------------------------------------------------
# Notes -------------------------------------------
# module load nixpkgs/16.09 gcc/7.3... |
3397b6a057f1dcd123aff71ba611404b8d0780434816292e73b82088475e3240 | R | 3,269 | 73 | ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
# Parameter settings
##### ##### ##### ##### ##### ##### ##### ##### ##### #####
setwd(file.path(getwd(), "R"))
source("00_directorySettings.R") # load baseDir, xeniumDir
source("00_settings.R")
dataDir <- file.path(baseDir, "data")
outDir <- file.path(baseDi... |
36798219c0408cbcd0926de622328d54072ea0d6592e86b9f2801a6af0e4187a | R | 3,270 | 81 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
print("************************************ Starting ************************************")
library(Matrix)
## Test parameters:
# in_path <- "/vast/palmer/pi/verhaak/kcj28/care_mut/processed_data/nmf_2026/Malignant/"
# mat_index <- 1
# out_path <- "/vast/... |
feed1d28c29d11b00d7c35b6e6d822bb79c164dd90b7b3b49ca7eb6f61b41f6c | R | 3,271 | 159 | ---
title: "Check DMR and CpGs data against MIAMI-AD"
subtitle: "Check MIAMI-AD for AD Patterns"
author:
- David Lukacsovich^[University of Miami]
- Lily Wang^[University of Miami]
date: "`r format(Sys.time(), '%d %B %Y')`"
output:
rmarkdown::html_document:
highlight: breezedark
theme: lumen
toc: true... |
c8d080e2fca8653a50193520808d2dbdd1fa77523835d61d56ffaf2bcd46a308 | R | 3,277 | 112 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# sliced off function for testing and added additional arguments
# see `strhet_mvmr.R`
qmin_test <-function(a, m, r_input, gencov){
print(a)
# input
exp.number<-length(names(r_input)[-c(1,2,3)])/2
delta... |
9c7097d5b04188fe9cce4508268b53dbddbf394179abfb90f9b2dad79176d371 | R | 3,278 | 67 | # ==============================================================================
# Script 20: Figure 3D - Circos Plots for Selected Samples (BCK4, 600MPE, HCC2185, ZR7530)
# ==============================================================================
# Description: Generates circos plots for 4 selected ICLE cell line... |
74f02603df151b3cae67054c5c8cc014b12f4231163bf7744634dd74eea27c8d | R | 3,281 | 62 | #' Use two PANDA network to generate an ALPACA result
#'
#' \strong{ALPACA}(ALtered Partitions Across Community Architectures) is a method for comparing two genome-scale networks derived from different phenotypic states to identify condition-specific modules.
#' \href{https://www.nature.com/articles/s41540-018-0052-5}{... |
0bf005910f786b02535e76e7b01e0e64d0dfd411794860dca7b1f25836139240 | R | 3,282 | 108 | library(ggplot2) # plots
library(brms) # Bayesian lmms
library(tidyverse) # tibble stuff
library(SBC)
library(bayesplot)
# set options for SBC
use_cmdstanr = getOption("SBC.vignettes_cmdstanr", TRUE) # Set to false to use rstan instead
options(brms.backend = "cmdstanr")
# using parallel proce... |
c394cecac197a5152b25679c95ad3a57fd4c37da55cf2f194ee1a04a1dc37d40 | R | 3,282 | 98 |
# ###Compare NodoMap with Kupari dataset ----------------------------------
###Compare NodoMap with Buchanan dataset
library(Seurat)
library(ggplot2)
library(dplyr)
library(stringr)
#Load data
data <- readRDS("../data_objects/diet_nodomap_metadata_updated_2510.rds")
#Read in Kupari annotations
kupari<-read.delim('.... |
ec7c0a547ede1b01c167509c995ea22b5dc30853e09811330215c558b43d83b4 | R | 3,282 | 81 |
setwd(rstudioapi::getActiveProject())
library(tidyverse)
library(ggrepel)
rm(list = ls())
source("./Scripts/Function_scripts/Pre-processing_functions.R")
source("./Scripts/Function_scripts/Effect_size_functions.R")
load("./Output_Data/Exp2_SC.es.by.KO.in.old.compare.to.CTRL.Rdata")
load("./Output_Data/KO_LUT_paper.o... |
ef0213c7ac18278d20a1f8cef210af9bec90b1df41109eec81c8c00a889c5bed | R | 3,285 | 72 | #m6A number in a single transcript
library(ggplot2)
data <- read.table("1transcript_num_m6a", header = FALSE)
colnames(data) <- c("Species", "Tissue", "Number")
species_names <- c("Monkey", "Mouse", "Rat", "Tree shrew", "Cattle", "Sheep", "Llama", "Dog", "Cat", "Horse",
"Ferret", "Four-toed hedge... |
1d67c575a1bf37d7856d445a1d5e055d178388d2cc18a7b848c27e903eb2aae1 | R | 3,290 | 123 | context("test COBRA")
test_that("cobra() returns correct structure with pearson method", {
skip_if_not_installed("rARPACK")
set.seed(42)
g <- 20
n <- 8
q <- 2
X <- cbind(rep(1, n), rbinom(n, 1, 0.5))
expressionData <- matrix(rnorm(g * n), nrow = g, ncol = n)
result <- cobra(X, expressionData, method =... |
886ed3b2ee844dfba7dc62fe5f6f902ab1410cc4e5637d5bed94ffe0ba9527bc | R | 3,293 | 89 | # Hai Wang
# Identify all cis-eQTLs
library(GenomicFeatures)
library(GenomicRanges)
library(dplyr)
library(data.table)
args <- commandArgs(trailingOnly=T)
tissue <- args[1]
# Load V3 genome annotation
txdb <- makeTxDbFromGFF('~/Desktop/DATA/1_PROJECT_TPM_MODEL/0_genomes/0_Zmav3_genome/Zea_mays.AGPv3.3... |
c5afd58f532d9aeb9678494d5d1579ec1bb08d8e774e2f59c3b7dafc01537ae5 | R | 3,294 | 90 | #' @title Chi square tests for symptom mapping
#'
#' @description
#' Lesion to symptom mapping performed on a prepared matrix.
#' The behavior must be a binary vector.
#' Chi square tests are performed at each voxel. By default
#' the Yates correction is performed, use \code{correct=FALSE}
#' if you need to disable it.... |
af9aed2e92caa9e0dd38a12ca05e0b45494ce5766b6f518fdca9a5fcfd59e3ff | R | 3,295 | 74 | #' Add non-standard images with the same dimensions as current ones
#'
#' This function re-uses the `SpatialExperiment::scaleFactors()` from current
#' images when adding new images. This is useful if you take for example a
#' multi-channel VisiumIF image and break into several single-channel images
#' that all have th... |
51f094600bb085b023d022e7ca48cea007184ee7c316841a0ac82edda2feaf5f | R | 3,298 | 134 | # pooled SD of x by groups "Clinical" and "Healthy"
sdPool <- function(x, group){
d1 = x[group == "Clinical"]
d2 = x[group == "Healthy"]
n1 = length(d1)
n2 = length(d2)
v1 = var(d1)
v2 = var(d2)
sdPool = sqrt(((n1-1)*v1 + (n2-1)*v2)/(n1+n2-2))
return(sdPool)
}
# center on mean and standardize... |
ca8f19690cd03cc7320eeb04561b80f4b2736a01fd3ec5314cc00028ca44bd21 | R | 3,299 | 111 | context("Model h2o")
setup({
h2o::h2o.init()
})
idx <- withr::with_seed(3809, sample(nrow(iris)))
prediction <- "Species"
predictors <- setdiff(colnames(iris), prediction)
train <- iris[idx[1:100], ]
test <- iris[idx[101:nrow(iris)], ]
model <- h2o::h2o.randomForest(
x = predictors, y = prediction, training_fram... |
5ad7771e77ba162ab3c7084b6cd187321bb2e8a591f16d8c8f3de00d7b323700 | R | 3,300 | 118 | ### -----------------------------------------------------------------
### Legacy exploratory analysis by a member of the Wilson Lab.
### Historical record only — not part of the bancpipeline release.
### -----------------------------------------------------------------
### take code from neck_connective_neuropils_an.R... |
d4b5f8a0ff9570913673cf3729a6f7c979138a6debee6b3b1b2e58c6df397db1 | R | 3,303 | 89 | library(ggplot2)
rm(list=ls())
options(digits = 4) # by default, print results to four decimal digits
set.seed(1823) #for replication - the year Trinity College was founded!
#replace the empty quotes with the file path to the location where you downloaded the files from Dropbox below
path = ""
screenRes = c(2559,1439... |
a7648444f3b51ab9eca85f53de3474182e36e46b88dbf2dadc3c32f964a979fa | R | 3,304 | 79 | ### Extract internal standards from all samples of _In vitro_ Experiment #2 lipidomics
##------------------------------------------------------------------------------------------------------
rm(list = ls())
library(tidyverse)
library(ggthemes)
library("scales")
library(ggpubr)
library(ggbeeswarm)
library(stringi)
libr... |
0763f2fbd4b67b4e8c2e28d953fba1c47bc50dba7e5711ddae87054bcad14626 | R | 3,306 | 80 | library(stats4)
library(scales)
library(HDInterval)
### PLOT EMPIRICAL
add_geochrono <- function(Y1,Y2){
polygon(-c(259.1,259.1,251.9,251.9), c(Y1,Y2,Y2,Y1), col = "#f9b4a3", lwd = 0.5) # Lower Permian
polygon(-c(251.9,251.9,247.2,247.2), c(Y1,Y2,Y2,Y1), col = "#a05da5", lwd = 0.5) # Upper Triassic
polygon(-c(247... |
413ac86982a5760becbaa3f8619d7c451a2db34aa0901e5ebb6c86ea5e9037dd | R | 3,307 | 97 | make_gene_sumstats <- function(n_genes = 120, n = 1000) {
genes <- paste0("gene", seq_len(n_genes))
fixed_gene_index <- 7
gamma_sq <- rep(1e-5, n_genes)
gamma_sq[fixed_gene_index] <- 0.05
burden_score <- rep(0.01, n_genes)
sample_size <- n + seq_len(n_genes)
list(
sumstats = data.frame(
gene = ... |
b997826930bfc0536ba79225922a19ccc36d499b55310d22eb15987606ba057a | R | 3,314 | 125 | ---
title: "3_normalization_cpm"
output: html_document
date: "2026-01-01"
---
```{r}
library(dplyr)
library(readr)
library(tibble)
library(readxl)
library(purrr)
library(limma)
library(edgeR)
library(ggplot2)
```
# load data
```{r}
counts_df <- read_tsv("/path/to/raw_counts_gene_symbol_dedup.tsv") # get from GEO
meta... |
901d658449917c68ccf3bea160776b713f458f2249d21e3f205f61b30200d4f0 | R | 3,315 | 108 | #' Create a factor with natural (human-friendly) ordering
#'
#' Converts a character or numeric vector into a factor where the levels are
#' ordered naturally (e.g., `a1`, `a2`, ..., `a10` instead of
#' lexicographically as `a1`, `a10`, `a2`, ...).
#' This is useful for plotting or labeling grouped data where numeric
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.