sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
82aa9f21ccdb2ccb8b43bd5abe267580ea3b878a436ed4302a362dbc49378a00 | R | 2,182 | 68 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import enrichment ----
enr <- readRDS("db/motifs/revision_motif_enrich_atac_vista_designed_vs_rdm_genomic.rds")
enr[, sig:= padj<0.05 & log2OR>0 & set_hit>=5]
setorderv(enr, c("sig", "log2OR"), -1)
# Sel... |
8e9ac0ecb399b12a06c51d6644b655cee941327e919c620da500ab92503571aa | R | 2,187 | 57 | #!/usr/bin/env Rscript
## 06_pbmc_ifnb_de.R — generated from notebook spec
## Run: Rscript 06_pbmc_ifnb_de.R
## ============================================================
## # 06 — IFN-β treatment context (PBMC)
##
## R/limma rerun of stratum `label_context_case_control_pbmc_ifnb` from
## `Stratified_Analyses/Ex... |
05f8e7e88fe932caaccc814d4bf7cc6a8ef2b9bcd21f97f740eb707188988abb | R | 2,190 | 69 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import metadata ----
meta <- readRDS("Rdata/paper_metadata_v3.rds")
meta <- meta[dataset=="accessibility" & ID=="model1_bulkATAC_tsx3Aug_2xBal_noW" & set=="test"]
# Plotting parameters ----
Cc <- c("grey... |
11a58034d88133e5acf569260818f5fd0ea3ba313d626c6623f9d34baf63cfc6 | R | 2,198 | 44 | # Open a connection to a log file
logfile <- file("*PLACEHOLDERPATH*/logfile.log", open = "a")
# Redirect both output and messages to the file and console
sink(logfile, append = TRUE, split = TRUE)
require("limma")
design_matrix <- read.table("tests/test_files/test_design_matrix_advanced.csv", header=TRUE, sep= ",")
... |
899df6ccf4e86540268136fa30258aa266b36d72d81664316937ed07e7c9e384 | R | 2,202 | 59 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Selected sequences object were created in:
# file.edit("git_deepATAC/subscripts/create_clean_list_sequences.R") # Clean list of designed sequences (different EVO/LEDIDI designs...)
# file.edit("git_deepAT... |
89d05b455e834752eba5241f6ba2eae3652d647ee2d0e7814a9545c58decb4b2 | R | 2,203 | 69 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import metadata ----
meta <- readRDS("Rdata/paper_metadata_v3.rds")
meta <- meta[dataset=="accessibility" & ID=="model1_bulkATAC_tsx3Aug_2xBal_noW" & set=="test"]
# Plotting parameters ----
Cc <- c("grey... |
d9a0daec2c320fd5a614bcb2634e766f258da143500ff131f77964c567cea491 | R | 2,204 | 55 | segregation_individual_systems <- function(M=NULL, Ci=NULL, diagzero=TRUE, negzero=TRUE) {
# DESCRIPTION:
# Calculate single system's segregation.
#
# Inputs: M, Correlation matrix
# Ci, Community affiliation vector (e.g., system labels)
# diagzero, Boolean for setting diago... |
5f27942745dbf43fabc53f275342c7f70a3690dc33154fd7d3a55f74f90613b7 | R | 2,210 | 67 | # Segment grobs should be underneath text and label grobs.
#
context("grob-order")
library(grid)
test_that("for geom_text_repel, all segment grobs come before text grobs", {
dat1 <- mtcars
dat1$label <- rownames(mtcars)
# Make a plot with no seed and get the label positions.
png_file <- withr::local_tempfile... |
8bfe897e1cf08a6eb92e3a5d04dda84f761a43904b163197b32e348518dd2041 | R | 2,213 | 65 | library(arrow)
library(dplyr)
library(GenomicFeatures)
library(GenomicAlignments)
library(rtracklayer)
library(readr)
library(ggplot2)
library(patchwork)
#-----------------------------------Prepare data-----------------------------------#
# Add "detected" column to the peptide mapping
peptide_mapping <- read_parquet... |
e92388e6553a965ac7ef7d4c3b9a7cbb617f8c724b4cc6fee41e22e09b224d24 | R | 2,219 | 70 | #Fig. 4h
# Perineural layer quantification
# Violin plot comparing perineurial layers between control and obese animals
library(tidyverse)
library(patchwork)
library(Seurat)
library(ggplot2)
# Load spreadsheet from the data/ folder
data_path <- "data/perineurium_EM_quantification.xlsx"
if (!file.exists(data_path)) {... |
d9613a5dae99cb94cee78f3c31343529692db647e535467fcabc3f790267abc3 | R | 2,226 | 44 | # Open a connection to a log file
logfile <- file("*PLACEHOLDERPATH*/logfile.log", open = "a")
# Redirect both output and messages to the file and console
sink(logfile, append = TRUE, split = TRUE)
require("limma")
design_matrix <- read.table("tests/test_files/test_design_matrix_advanced.csv", header=TRUE, sep= ",")
... |
25ea21d1c83b5f1ee6481dbaee1614571b3d48032224157c4ab7a15e9b8fe2fb | R | 2,227 | 85 | ---
title: "Amos mutants antennal RNAseq"
output: html_notebook
---
```{r}
library(tidyverse)
library(magrittr)
library(ggrepel)
```
```{r}
amos_DEG_2019 <- read_csv("Menus2019_EdgeR.csv") %>% as.data.frame()
genes <- read_tsv("genelist_beat-side.txt") %>% as.data.frame() %$% gene
```
```{r}
amos_DEG_2019[amos_DEG... |
8252e14a120e5fe1c48627b5889577eefc20155c3ad455723641ea5629d94147 | R | 2,255 | 50 | # brain-maintenance-lgcm: trivariate latent growth curve model and brain
# maintenance index, companion code for Menze et al. (2026).
#
# Copyright (C) 2026 The authors of Menze et al. (2026).
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License... |
04118cd97a0eb68ffc066cb9f1e93d7b66ae23e44d7d64204e2b950f7cc8887a | R | 2,261 | 55 | library(Seurat)
pbmc <- Read10X("pbmc3k_10X/outs/filtered_feature_bc_matrix/")
pbmc <- CreateSeuratObject(counts = pbmc, project = "pbmc3k", min.cells = 3, min.features = 200)
pbmc[["percent.mt"]] <- PercentageFeatureSet(pbmc, pattern = "^MT-")
pbmc <- subset(pbmc, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & pe... |
2a166f68f5a989db449db11b7c06dd25270a0bfe51d42c19d73c64a3912ef115 | R | 2,276 | 46 | library(tximport)
library(GenomicFeatures)
library(jsonlite)
library(purrr)
txdb <- makeTxDbFromGFF(paste0(Sys.getenv("GENOMIC_DATA_DIR"), "Ensembl/Human/Release_103/Raw/Homo_sapiens.GRCh38.103.gtf.gz"))
tx2gene <- select(txdb, keys = transcripts(txdb)$tx_name, columns = "GENEID", keytype = "TXNAME")
files <- Sys.glob... |
931c2adfd21d956937988e9a5ef55d7be8c4e295c749a5ae1c679592896dc410 | R | 2,278 | 40 | #!/usr/bin/env Rscript
# DIFFERENTIAL ABUNDANCE (cell-type composition), analysed SEPARATELY from differential state.
# Question: does the PROPORTION of a cell type differ between MS and HC? (propeller-style:
# variance-stabilising transform of proportions + limma with the paired design.)
# This is conceptually distin... |
3af5ca88ebcaf3242c150fe46db2b72d9cfceb2373a6dc5b99844761a5c7bdbe | R | 2,284 | 45 | #!/usr/bin/env Rscript
# mCSEA on the NEW ComBat-corrected, IDAT-reprocessed 8-dataset M-values
# Input : Methylation_Data/AllMeth_ComBat_M.csv + AllMeth_ComBat_Metadata.csv
# Method: mCSEA promoter + gene-body GSEA on MS-vs-HC ranked probes
# Compare vs old combined-cohort mCSEA (06_mCSEA_promoter.tsv)
suppressP... |
2e29a2c5a2cd7f055594a948fadf6f68735c711ff61df6dcd86db6da2c625f6b | R | 2,313 | 135 | ---
title: "R Notebook"
output: html_notebook
---
This script creates ROC curves for publication and permutation testing for ROC curves.
```{r}
library(tidyverse)
library(plotly)
library(pROC)
source("rocFunctions.R")
```
```{r}
probs <- read.csv("PrLwinsROC.csv") %>% mutate(prob = probSHANK3)
conf <- read.csv("PrLw... |
7a70b5ded61104448b15c490a2eed49d184023fe665cfd973485540d2d23fa19 | R | 2,313 | 63 | # DESCRIPTION:
# The degree to which edges are more dense within communites and more
# sparse between communities, which quantifies the segregation of a
# weighted network (Chan et al. 2014).
#
# Inputs: M, Correlation matrix
# Ci, Community affiliation vector (e.g., system labels)
# Optiona... |
dfe0097c11514dc1bbe06167d0f88b2f52ec43ee36921b396f07ec1ed1957ece | R | 2,318 | 73 | #!/usr/bin/env Rscript
# scripts/99_run_all.R
# Run the full analysis pipeline for the scRNA-seq analysis repository
# ---------- helpers ----------
msg <- function(...) cat(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), "-", ..., "\n")
find_project_root <- function() {
wd <- normalizePath(getwd())
while (TRUE) {
... |
7dee5b463a72f78d0155a640f5b2aa531b3da7fe64c996dc092f15e925038cb9 | R | 2,321 | 61 | library(ggplot2)
library(dplyr)
library(arrow)
library(rtracklayer)
my_theme <- theme_classic() +
theme(
axis.title.x = element_text(size = 13),
axis.title.y = element_text(size = 13),
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
legend.posit... |
f463f98e83206cede450543604f9f43b0d764e3ddf04a6c633823261da07260e | R | 2,325 | 76 | ## module load conda_R/3.6.x
## ----Libraries ------------------
library(parallel)
library(SummarizedExperiment)
library(Matrix)
library(RColorBrewer)
library(pdist) # for dist
library(
## load rse list
load("Human_DLPFC_Visium_processedData_rseList.rda")
## filter to expressed genes, lets be liberal
exprsMat = sappl... |
ff5478e449523254758c57dbea2f3cf74c663fff7854f3c921f4c2238c33fd2b | R | 2,325 | 93 | ---
title: "PrL_SB Data Wrangling & Exploration"
output: html_notebook
---
# Reading in the data
```{r, message=FALSE, warning=FALSE}
library(openxlsx)
library(tidyxl)
library(tidyverse)
library(plotly)
wb <- loadWorkbook(file = "/Data/PrL_SB1-5_June28_2021.xlsx")
prlsb <- read.xlsx(wb, sheet = 1)
```
# Data wrangli... |
97983c7461eeba59bab60c2fd4833aad1817daec4cfe8ba15d00c3d6e5d4dc59 | R | 2,332 | 90 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Kirti Biharie; implemented LISI score
suppressPackageStartupMessages(library(optparse))
option_list <- list(
make_option(
c("-l", "--labels"),
type = "character", default = NULL,
hel... |
2cdf96176d8c8b4224ad89dc4429780d05d9728180db4a8edfe718d7776a2204 | R | 2,345 | 58 | test_that("run_eqtl_finemapping derives dataset from the directory basename and delegates to run_eqtl_finemapping_files", {
dir <- local_temp_dir()
fx <- make_synthetic_dataset(dir)
outs_a <- out_paths(local_temp_dir())
outs_b <- out_paths(local_temp_dir())
set.seed(99)
res_a <- run_eqtl_finemapping(
d... |
63e6057e390632fed7a81d135be4670ef05e41da609309b48885573e0bbb4e40 | R | 2,369 | 84 | #fig. 6d
# ------------------------------------------------------------------------------
# Title: Analysis of Adipose Tissue Endothelial Cells (Lean vs. Obese)
# Data Source: GSE155960 / PRJNA656213
# Publication: Hildreth et al. (2021) "Single-cell sequencing of human white
# adipose tissue identifies n... |
b5e908623bb269157fc8c16301390c016ea596274bdefd9da4cda6b64cf06c9e | R | 2,369 | 81 | ###
## module load conda_R/3.6.x
## ----Libraries ------------------
## ----Libraries ------------------
library(tidyverse)
library(ggplot2)
library(Matrix)
library(Rmisc)
library(ggforce)
library(cowplot)
library(RColorBrewer)
library(grid)
library(SummarizedExperiment)
library(jaffelab)
library(parallel)
## load rs... |
99343dbacaf74d0bf77aa7e62b7cbc587acf50fc0d5fe7348d97c9bdb0c246a8 | R | 2,375 | 66 | library(synthpop)
library(dplyr)
library(ggplot2)
library(ggpubr)
adni_train <- read.csv("~/R/data/DDLS/adni_plus_train.csv")
a4_train <- read.csv("~/R/data/DDLS/a4_train.csv")
vars <- colnames(adni_train)[-1]
seq <- sample(1:length(vars), replace=FALSE)
adni_train |> select(-RID) |> syn(method="cart", seed=1, visit.... |
fb7ddd510486f4008e3ce7c500bd09345e3de0c2212379b011935437d6b3b409 | R | 2,423 | 97 | ##Bioconductor version 3.12 (BiocManager 1.30.10), R 4.0.4 (2021-02-15)
## Installing package(s) 'edgeR'
library(edgeR)
library(ggplot2)
plot_volcano <- function(results_edgeR, gene, threshold)
{
results_edgeR.df <-as.data.frame(results_edgeR)
results_edgeR.df$log10FDR <- -log10(results_edgeR.df$FDR)
results_e... |
6e2e7fb1924da9ae9a01c83b7df09610e1cc63309c5f73f4cd18e9a3b04f19af | R | 2,427 | 77 | library(Gviz)
library(biomaRt)
library(rtracklayer)
library(GenomicFeatures)
library(readr)
library(dplyr)
library(arrow)
# Read input files
orfanage_gtf <- import("nextflow_results/V47/orfanage/orfanage.gtf")
final_expression <- read_parquet("nextflow_results/V47/final_expression.parquet") %>%
mutate(mean_expres... |
97d1c003459b79a9a178f0013fa7accc1451b9a9172b43ff59120e91b974afcb | R | 2,431 | 70 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite-dev/")
# Import metadata ----
meta <- readRDS("Rdata/paper_metadata_v3.rds")
meta <- meta[dataset=="activity" & ID=="model1_bulkATAC_tsx3Aug_2xBal_noW" & tissue %in% c("heart", "limb", "midbrain")]
meta <- met... |
86b5dd9f350e9d351b2c2bd3df004b438e04b87bd9c9e6f9b81040e857f3c943 | R | 2,438 | 76 | #Fig. 2a
# Dot plot showing the expression of perineurial markers and Lepr gene in different cell clusters
library(Seurat)
library(magrittr)
library(tidyverse)
library(future)
library(ggplot2)
library(patchwork)
##Load integrated data using relative path
data_path <- "data/ganglia_seurat_object.rds"
if (!file.exists... |
f9fac393f08c5a375deaf567c70386077c20e801968d3e194ca0c9cd8a8995c6 | R | 2,438 | 78 | #Fig. 1d
# Dot plot showing the expression of endothelial markers and Lepr gene in different cell clusters
library(magrittr)
library(tidyverse)
library(Seurat)
library(future)
library(ggplot2)
library(patchwork)
##Load integrated data using relative path
data_path <- "data/ganglia_seurat_object.rds"
if (!file.exists... |
63368bd3de1f05a46fda15fb9175a96d8ca236674d10601090b51c25c1a4963b | R | 2,446 | 68 | library(dplyr)
library(ggplot2)
library(rtracklayer)
library(patchwork)
annot_peptides_hybrid <- import("nextflow_results/V47/orfanage/annot_peptides_hybrid.gtf") %>%
as_tibble()
annot_peptides_hybrid %>%
distinct(transcript_id) %>%
summarise(len = n())
known <- annot_peptides_hybrid %>%
distinct(t... |
bc1809a9df7dc16a4ad2d66870a36c464dab913bb548372b972fbf3cf64b7653 | R | 2,447 | 75 | process_data <- function(data, layers_keep, exclude_sub = "none", modality, noddi = FALSE, swm = FALSE) {
# Extract subject number
# data[, subject := sapply(strsplit(subject, "-"), function(x) x[2])]
data$subject <- as.numeric(data$subject)
# Convert columns to factors
data$hemi <- as.factor(data$hemi)
... |
2d6bb3243b61789c74758bc9996cf0fc1942c875d5436b93deb088550aa035f0 | R | 2,452 | 74 | library(dplyr)
library(ggplot2)
library(readr)
library(stringr)
library(rtracklayer)
library(reticulate)
use_condaenv("/scratch/nxu/SFARI/envs/r_env")
py_run_string("
from src.utils import collapse_isoforms_to_proteoforms, read_gtf
import polars as pl
tx_classification = pl.read_parquet('nextflow_results/V47/final_c... |
6bc8b54c4fe5e21aae2f9c2f9b313d098f7707e1fb7653e528e0a1d86b6651b6 | R | 2,452 | 92 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Mark D. Robinson; coded the domain-specific F1
suppressPackageStartupMessages(library(optparse))
# TODO adjust description
option_list <- list(
make_option(
c("-l", "--labels"),
type = "... |
eca21bdc4f9d1d25941f493afdc336e58f55e0bbaf7f2bf24b6b87d611aa1548 | R | 2,452 | 105 | ---
title: "Outlier analysis"
output: html_notebook
---
OutlierAnalysisWinsorize.Rmd winsorizes the subset of variables used for ML. This script will focus on winsorizing all variables (including highly correlated variables) before checking for multivariate outliers.
# Reading in the data
```{r, message=FALSE, war... |
77b9b7fbd1be03bd64a6622e2f7db2ecc4b5404671442fc5ee36a3fb32f5e238 | R | 2,455 | 70 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite-dev/")
# Import metadata ----
meta <- readRDS("Rdata/paper_metadata_v3.rds")
meta <- meta[dataset=="activity" & ID=="model1_bulkATAC_tsx3Aug_2xBal_noW" & tissue %in% c("heart", "limb", "midbrain")]
meta <- met... |
7f9acae84a524e5d01b523245bf4ca9344bfecfc38d40c0241645441ec725376 | R | 2,464 | 53 | # GNU General Public License v3.0 (https://github.com/IanevskiAleksandr/sc-type/blob/master/LICENSE)
# Written by Aleksandr Ianevski <aleksandr.ianevski@helsinki.fi>, June 2021
#
# Functions on this page:
# auto_detect_tissue_type: automatically detect a tissue type of the dataset
#
# @params: path_to_db_file - DB file... |
b6040cbdea0ad222924c134272ad749b5ef14fdba7017244458351517abdcbad | R | 2,470 | 66 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
require(vlfunctions)
# Randomly sample chromosome 18
rdm <- GenomeInfoDb::seqlengths(BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10)
rdm <- as.data.table(rdm, keep.rownames= "seqnames")
rdm <- rdm[seqnames=="chr18"]
set.seed(1)
rdm <- rdm[, .(star... |
e88051d35addad0ce4dd59d61fe6eac8674ad256ca0fdfe5c72b33e6b80bca91 | R | 2,472 | 88 | #####################################
# Example of hierarchical metacognitive efficiency (Mratio)
# at the group level
# exemple of trace plots and posterior distribution plots
# using the Function_metad_group.R
#
# AM 2018
#####################################
## Packages ------------------------------------------... |
503c9adf20f7477064f5aea18011b6ef7f322a2e58e3cf1961fd1ac860d6fc5d | R | 2,492 | 89 | #!/usr/bin/env Rscript
# Author_and_contribution: Jieran Sun & Mark Robinson; Create the script
suppressPackageStartupMessages(library(optparse))
option_list <- list(
make_option(
c("-i", "--input_file"),
type = "character", default = NULL,
help = "Input containing the aggregated labels."
),
make_o... |
80d94947f0904eaacfc4eb9a1d854095a4f0578b546f379fe0ef55e904ba7add | R | 2,492 | 89 | # helper files for the main script
load_csv_summarize_columns <- function(file_path, verbose = TRUE) {
# Read the CSV file
df <- read.csv(file_path, stringsAsFactors = TRUE)
# Build and print the summary data frame
if (verbose) {
# Build the summary data frame
summary_df <- data.frame(
Column ... |
05547f9871bceeb386c43e4b22569c999f4fbd95688b441f085dba6929fa0123 | R | 2,496 | 68 | library(ggalluvial)
library(readr)
library(dplyr)
colorVector <- c(
"FSM" = "#009E73",
"ISM" = "#0072B2",
"NIC" = "#D55E00",
"NNC" = "#E69F00",
"Other" = "#000000"
)
structural_category_labels <- c(
"full-splice_match" = "FSM",
"incomplete-splice_match" = "ISM",
"novel_in_catal... |
b9ceb79abaaedcabd10695268dce2aa6da1c6659cf1e1b883dea3d1e589832f9 | R | 2,498 | 100 | #' Nudge labels a fixed distance from points
#'
#' \code{position_nudge_repel} is useful for adjusting the starting
#' position of text labels before they are repelled from data points.
#'
#' @family position adjustments
#' @param x,y Amount of horizontal and vertical distance to move. Same units
#' as the data on th... |
9cb1d5fa4da40aa3c4b83cfc1018f64e9627f33382bd32b73cf7de27e693d018 | R | 2,511 | 61 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# We found the following examples on IGV ----
coor <- c(
"chr18:3,637,665-3,694,606", # Heart
"chr18:62,159,828-62,186,459", # Heart + globally open
"chr18:3,825,318-3,854,833", # Midbrain
"chr18:60... |
7c1ba2f997f7ef8e1574f90077e548e756d7f54f89576ffcc6491ad888945053 | R | 2,520 | 100 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite-dev/")
# Import mean contrib per motif per rep/fold
dat <- readRDS("/groups/stark/shenzhi.chen/projects/mouse_enhancer_paper/1st_revision/Rdata/all_motif_contri_score.rds")
# Z-score
dat[, zscore:= scale(cont... |
d5f0b4c9f2f7dc2b827df35e0263012c177c7f248ca43e884af7fa3600c21057 | R | 2,520 | 60 | library(admixtools)
library(tidyverse)
library(readr)
read_table2 <- read_table
sink("Adaptive_f3_50k.txt")
for (i in seq(1, 50000000, by = 50000)) {
print(paste("sed -n '1,3p;",i+3,",",i+50002,"p' ../Adaptive.vcf > TEST.vcf",sep=''))
system(paste("sed -n '1,3p;",i+3,",",i+50002,"p' ../Adaptive.vcf > TEST.vcf",sep='')... |
81429378f6fbe2fe475afd22b04bf0eaba71580b463071d3aa5c22d998194ad2 | R | 2,545 | 77 | ##
library(RColorBrewer)
library(spatialLIBD)
## read in data
man = read.csv("/dcl01/lieber/ajaffe/Maddy/RNAscope/20x_Kristen_Visium_paper/Subject3_AQP4570_RELN520_TRABD2A620_BCL11B690_20xtile_Linear unmixing_Stitch_Image.csv",
as.is=TRUE)
dat = read.csv("/dcl01/lieber/ajaffe/Maddy/RNAscope/20x_Kristen_Visium_paper/S... |
923f136fcd389a43b6603d7251eaddcce4dba563239f64aa3e00da56b88a0da7 | R | 2,574 | 103 | #' Name ggplot grid object
#' Convenience function to name grid objects
#'
#' @noRd
ggname <- function(prefix, grob) {
grob$name <- grobName(grob, prefix)
grob
}
with_seed_null <- function(seed, code) {
if (is.null(seed)) {
code
} else {
withr::with_seed(seed, code)
}
}
.pt <- 72.27 / 25.4
"%||%" <... |
ce68e23306820f490f3da2fe7c7ecda52fa117f7f17d92591952941827fb99d1 | R | 2,574 | 114 | ###
###
## module load conda_R/3.6.x
library(tidyverse)
library(ggplot2)
library(Matrix)
library(Rmisc)
library(ggforce)
library(cowplot)
library(RColorBrewer)
library(grid)
library(SummarizedExperiment)
library(jaffelab)
library(parallel)
## load rse list
load("Human_DLPFC_Visium_processedData_rseList.rda")
## add ... |
f1f6fc04b0edf88b8a17f8cc997eda129bfc84a5e71b1c9f074bd6aebd3749cc | R | 2,579 | 54 | # GNU General Public License v3.0 (https://github.com/IanevskiAleksandr/sc-type/blob/master/LICENSE)
# Written by Aleksandr Ianevski <aleksandr.ianevski@helsinki.fi>, June 2021
#
# Functions on this page:
# gene_sets_prepare: prepare gene sets and calculate marker sensitivity from input Cell Type excel file
#
# @params... |
403c671df3d631b34a60fe9c9abfcd3cfa669f7bc2bc3639872ba5f6efed91d5 | R | 2,604 | 60 | library(dplyr)
library(readr)
library(ggplot2)
library(tidyr)
library(patchwork)
library(stringr)
my_theme <- theme_bw() +
theme(
axis.text.x = element_text(size = 20, vjust = 0.5, angle = 45, hjust = 1, color = "black"),
axis.text.y = element_text(size = 20, color = "black"),
axis.title.y ... |
a7049bc368d78c58fcb3791da25744b5c7dc96c8ade4b1bc6b964554e3fd80d0 | R | 2,606 | 92 |
#' Title Association test using linear, logistic and ordinal regression
#'
#' @param pheno : data frame phenotype
#' @param covars_prs : covariates to adjust
#' @param exposure : exposure
#' @param outcome : outcome to test
#'
#' @return (data frame of association test)
#' @export
#'
#' @examples
run_ordinal_regress... |
c3ca49ec2a6278fdc32504a81c3f659c3453d9e4e54ca8a8173e6a2c0ced7c0c | R | 2,608 | 68 | ### Prepare analysis of motion parameters
#########################################################
Cohort <- as.character(2) # which cohort? (1 or 2)
Timepoint <- 1 # which timepoint? (1 or 2)
#########################################################
### (A) Required libraries
#######################... |
e95262d934d12f50463d0a576700b2ecccc8cdc9ee84aa54a4331b9980a7d81f | R | 2,615 | 72 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
require(orthogene)
# Import clustered TFs ----
TFs <- readRDS("Rdata/motif_clusters_paper_3_tissues.rds")
TFs <- TFs[, .(mouse_id= unlist(mouse_id)), cluster]
TFs <- unique(na.omit(TFs))
universe <- readRDS... |
1c1938510abbbb6eed02125daa2011f6b119a0f52bff0e71474a5e48bdf7f4aa | R | 2,630 | 67 | ############################################################
# Plot Predicted Brain vs Behavioral Scores
# Author: Yuan Zhang
# Date: 2025-07-25
#
# Description:
# This script visualizes the correlation between predicted brain
# CCA scores and predicted behavioral CCA scores for both
# math- and reading-related CCA m... |
c2f22c2f495bca175776edd6aa251fc2280c775527bcfdf8cf11ac6fb0fd3d06 | R | 2,637 | 111 | #####################################
# Estimate metacognitive efficiency (Mratio) at the group level
#
# Adaptation in R of matlab function 'fit_meta_d_mcmc_group.m'
# by Steve Fleming
# for more details see Fleming (2017). HMeta-d: hierarchical Bayesian
# estimation of metacognitive efficiency from confidence rati... |
894565f56a2b918fdad018c18aee02883083f47ec955f99f5c2f5f0a8369c523 | R | 2,639 | 66 | <!--
================================================================================
file_sorting__r_scripts_41d6a5fd.R — (panel mapping pending)
================================================================================
What this file does: File-organization utility. Two G:\ variants merge into one helper (one... |
c68bcdeed4d616c6bf4fa8553a7a2fbc6ff943f11b26b33fa7455128ae84e711 | R | 2,644 | 77 | subSV <- function(LDSC_OBJECT = NULL, SMATRIX = NULL, VMATRIX = NULL, INDEXVALS, TYPE = "S"){
#WARNINGS:
#Checks for either an LDSCobject or and S and V matrix
if (!is.null(LDSC_OBJECT) & (!is.null(SMATRIX) | !is.null(VMATRIX))) {
stop("You must include either an LDSC object OR an S and V matrix, not both.... |
ebb534d9eb7c517094e3aa3d01fe90a0694bd765ee1bada983335926d53cd555 | R | 2,646 | 91 | ###
library('SingleCellExperiment')
library('here')
library('jaffelab')
library('scater')
library('scran')
library('pheatmap')
library('readxl')
library('Polychrome')
library('cluster')
library('limma')
library('sessioninfo')
library('reshape2')
library('lmerTest')
## Load data
load(here(
'Analysis',
'Human_DL... |
f7ac798e8cb5f6556f57d6d97163ff41ba229b93cc8b6eb52bfbdb5d5d2dc64f | R | 2,649 | 95 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import metadata ----
meta <- readRDS("Rdata/paper_metadata_v3.rds")
meta <- meta[dataset=="activity" & ID=="model1_bulkATAC_tsx3Aug_2xBal_noW"]
meta <- meta[set=="test" & tissue!="CNS"]
meta <- melt(
me... |
23defe689e6d57bfeb721a8c1d49491e68a967c563b1bde7f82fa5238d7346fb | R | 2,652 | 71 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import ATAC peaks ----
peak.files <- list.files("db/peaks/ATAC/", full.names = T)
peaks <- lapply(peak.files, importBed)
names(peaks) <- unlist(tstrsplit(basename(peak.files), "_", keep= 1))
peaks <- rbin... |
580e46e1923d2278d2a51e6c69195b3001fb381e4a0966a77fc64f89f627a8de | R | 2,680 | 78 | #!/usr/bin/env Rscript
library(dplyr)
library(GenomicFeatures)
library(GenomicAlignments)
library(rtracklayer)
library(readr)
args <- commandArgs(trailingOnly=TRUE)
annotation_gtf <- args[1]
predicted_cds_gtf <- args[2]
peptides_gtf <- args[3]
peptides_output <- args[4]
# Splice junctions
peptide_SJ <- makeTxDbFrom... |
d58cc4c79e6d5bc983429905a3ad117850c14d43e930d8cd0c84476be64bbdfb | R | 2,680 | 75 | library(omixerRpm)
# Ensures correct number of modules and samples is returned
test.moduleMapping <- function (){
# Test for data.frame, KO only annotation
dat <- read.table("test/matrix.tsv", header=T, sep="\t")
mods <- rpm(dat, minimum.coverage=0.3, annotation = 1)
checkEquals(nrow(mods@coverage), 96)
checkEqu... |
729f7fb88a7953ff746c0467e5b9112a7231e7890ec395d0fb94a16317ed05e4 | R | 2,685 | 93 | plot_predictive_positive <- function(label,
predicted,
xlim= NULL,
ylim= NULL,
plot= FALSE,
...) {
# Create a data table with observe... |
bac8394f8e8f9d9046d28877dd9f146846f56ae31a2c7f18abe6097738638e7f | R | 2,701 | 70 | <!--
================================================================================
file_sorting__r_scripts_24420cbb.R — (panel mapping pending)
================================================================================
What this file does: File-organization utility. Two G:\ variants merge into one helper (one... |
e919a99605a6500eb2cd665e961711a59ce6afaa29dce1faade5d3fd99827f05 | R | 2,704 | 54 | # Open a connection to a log file
logfile <- file("*PLACEHOLDERPATH*/logfile.log", open = "a")
# Redirect both output and messages to the file and console
sink(logfile, append = TRUE, split = TRUE)
require("limma")
design_matrix <- read.table("tests/test_files/test_design_matrix_advanced.csv", header=TRUE, sep= ",")
... |
db3d0af3231658a1bc3123d1c65dec521a5b4640b08c475502abf84748858f8a | R | 2,719 | 74 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# For each tissue and dataset ----
output.file <- "db/contributions/mean_contrib_per_motif_instance.rds"
if(!file.exists(output.file)) {
# Metadata
meta <- data.table(contrib.file= list.files("db/con... |
6e6718f42d19b736c5b2f89ce68ced64250a0c37a35069635a7a6f4fa0c1c49d | R | 2,744 | 63 | # -------------------------------------------------------------------------
# Compute FDR-corrected p-values for neurotransmitter regression results
# across all datasets: CMI-math, CMI-reading, Stanford-math, Stanford-reading
# Author: Yuan Zhang
# Date: 2025-07-25
# ---------------------------------------------------... |
b945199f26d4c71d5ea0937e29ccfa610a2bcce0ec8144e146560d9f92626ef1 | R | 2,790 | 69 | ################################################################################
### Modifier Interval Candidate Gene Pipeline Part 6: Supplemental Figure 7
### Gopinath et al., 2016 Sox10 binding motif candidate gene expression in
### Zhao et al., 2022 neural crest cells
###########################################... |
55fc276029c75b16b1e4d8ce72e516ca72de9d3895989df073e0fa626afa5768 | R | 2,820 | 79 | rm(list=ls())
library(tidyverse)
library(mgcv)
library(emmeans)
mist_df <- read.csv("C:/MIST.csv")
round(mean(mist_df$overall_acc_1, na.rm = TRUE), 2)
round(mean(mist_df$overall_acc_2, na.rm = TRUE), 2)
round(mean(mist_df$overall_acc_3, na.rm = TRUE), 2)
round(mean(mist_df$overall_acc_4, na.rm = TRUE), 2)... |
c4ac723051909012622036206cb06e899780a23027acbe6dd488deaa3bb3f866 | R | 2,823 | 80 | ###Fig. 5b
library(magrittr)
library(tidyverse)
library(Seurat)
library(future)
library(ggrepel)
library(patchwork)
library(ggplot2)
library(EnhancedVolcano)
apoptic_DEG_obese<-read.csv(file = "data/apoptic_DEG_obese.csv")
#change the rownames with the 1st column as they have the gene names y reaasigning
DEG_endo_a... |
b8c13dff7c7dbf5021e963ca2031eefb891528ad7cff6520edb7d63c30f64af8 | R | 2,828 | 55 | setwd("/groups/stark/shenzhi.chen/projects/transferLearningMammalianEnhancerDesign202408/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import prediction scores ----
seq.info <- readRDS("Rdata/subbrain_ledidi_design/all_sequence_information.rds")
# Import prediction scores ----
dat <- melt(
seq.info,
i... |
bb38beda44bc66b1ee03919040e00ced43df2693a5e30b0eb74e98552191ea41 | R | 2,846 | 78 | ################################################
## funtion to parse parse and update parameters
## - cmd line
## - yaml file
## parameters in yaml file will be updated with
## parameters specified on cmd
parse_param_ssgsea <- function(cmd_option_list, yaml_section='panoply_ssgsea'){
## ##################... |
ff72f9af535f79190f0a3ac2fd46a48bde3c05e9c90108d5416cf1308464c06a | R | 2,846 | 103 | #####################################
# Example of hierarchical metacognitive efficiency (Mratio) calculation
# for two domains and correlation coefficient
# exemple of trace plots and posterior distribution plots
# using the Function_metad_groupcorr.R
# The same function allows also the calculation for 3 and 4 doma... |
6501bbd4acfaf371fefd7e64f7d9eec2f630262e1428b6e918837bf048716c82 | R | 2,848 | 80 | library(dplyr)
library(biomaRt)
library(stringr)
library(edgeR)
library(arrow)
ensembl <- useMart("ensembl", dataset = "hsapiens_gene_ensembl")
ensembl <- getBM(attributes = c("ensembl_gene_id", "external_gene_name"), mart = ensembl)
gene_counts <- read_parquet("proc/pacbio_count_matrix.parquet")
gene_info <- gene_c... |
9496c28dd3db494481c9bbcd30ae9e3a2429e9aa002bc43dc82fd3367d6271b1 | R | 2,850 | 63 | #!/usr/bin/env Rscript
library(GenomicRanges)
library(GenomicFeatures)
library(rtracklayer)
library(dplyr)
library(tidyr)
library(readr)
# This is for Jimmy's Ribo-seq stuff. I think he needs a gtf file that has, for each transcript, novel CDS regions (i.e. not in a GENCODE CDS).
# So this would contain overlapping CD... |
55ba15bcf34a97eb22863549775304799ae5b5e10b01841a8a8b4823c6c9b216 | R | 2,855 | 76 | library(dplyr)
library(ggplot2)
library(arrow)
library(scales)
library(patchwork)
library(arrow)
colorVector <- c(
"FSM" = "#009E73",
"ISM" = "#0072B2",
"NIC" = "#D55E00",
"NNC" = "#E69F00",
"Other" = "#000000"
)
structural_category_labels <- c(
"full-splice_match" = "FSM",
"incompl... |
589041f9f01bc7d6e32740f8f876baf6fde43d31763f2cafc787b706aa38bf1a | R | 2,878 | 70 | #!/usr/bin/env Rscript
## 00_run_all.R — execute every notebook in order (R-script form)
##
## Run each .R produced by _build_ipynb.py end-to-end. Outputs go to
## ../processed/META/ *.tsv
## ../figures/ *.png + *.pdf
##
## Re-running is idempotent (overwrites).
##
## Notebook execution order matte... |
4664bd0b67ae106b61179e3b6cc7133fbf59d41846f47067357d0ea6c19951f8 | R | 2,886 | 76 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite-dev/")
require(stringdist)
# Import initialization and designed enhancer sequences
heart <- readRDS("Rdata/final_designed_enhancer_sequences_heart.rds")
heart <- heart[id %in% c(311, 726, 834, 890, 845) & labe... |
970c4f3492d0fc3becc897d3aa92d21cd9e2af464aed8870278fbae70ca8eff8 | R | 2,888 | 93 | library(dplyr)
library(arrow)
library(ggplot2)
library(readr)
my_theme <- theme_classic() +
theme(
axis.title.x = element_text(size = 12),
axis.title.y = element_text(size = 12),
axis.text.x = element_text(size = 10),
axis.text.y = element_text(size = 10),
legend.position = ... |
2eed1b7784f8aa98defea313ab34bee1f8e4990c00544001033f49563213baa3 | R | 2,896 | 85 | test_that("element_text_repel positions are interpreted correctly", {
# Unit calculations require an active device
tmp <- tempfile(fileext = ".pdf")
pdf(tmp)
withr::defer({
dev.off()
unlink(tmp)
})
columns <- c("x", "y", "nudge_x", "nudge_y")
examplar <- calc_element("text", theme_get())
elem... |
8df238b663f51d41e9db838861a5f4978635ad33bb68ad58d22b74b726455a27 | R | 2,902 | 69 | # GNU General Public License v3.0 (https://github.com/IanevskiAleksandr/sc-type/blob/master/LICENSE)
# Written by Aleksandr Ianevski <aleksandr.ianevski@helsinki.fi>, June 2021
#
# Functions on this page:
# sctype_score: calculate ScType scores and assign cell types
#
# @params: scRNAseqData - input scRNA-seq matrix (r... |
884c85d4647034705d95da7df30c87a3423b15d1fc49bb264c88583d7c9a3945 | R | 2,904 | 70 | library(data.table)
library(stringr)
args = commandArgs(trailingOnly=TRUE)
filnm = args[1]
tt= fread(filnm, header = TRUE)
tt$gene <- str_remove(tt$gene, '\\..+')
ttt <- data.table()
for(tm in unique(tt$training_model)){
tt2 <- tt[training_model == tm,]
tt2$bhpval = p.adjust(tt2$pvalue, method = 'fdr')
... |
944b4a46a10d758ff8fe02b416f2f1a502686032a8aac8448f44872a243eeea6 | R | 2,905 | 92 | #!/usr/bin/env Rscript
# Author_and_contribution: Jieran Sun & Mark Robinson; Create the script
suppressPackageStartupMessages(library(optparse))
option_list <- list(
make_option(
c("-i", "--input_file"),
type = "character", default = NULL,
help = "Input containing the aggregated labels."
),
make_o... |
a3ccb28dd0f45f9ced3926008c23d5e0dbfbff3026fb8641e27f20158d3063e2 | R | 2,909 | 94 | #!/usr/bin/env Rscript
# Author_and_contribution: Jieran Sun & Mark Robinson; Create the script
suppressPackageStartupMessages(library(optparse))
option_list <- list(
make_option(
c("-i", "--input_file"),
type = "character", default = NULL,
help = "Input containing the aggregated labels."
),
make_o... |
b6bb5106389c0816d5363cebef660d4e53fddd52ac4accc37eedaac1466cb08a | R | 2,912 | 94 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite-dev/")
# Import vista sequences ----
vista <- readRDS("db/peaks/vista_tiles_clean.rds")
vista[, c("seqnames", "start", "end", "strand", "name"):= importBed(ifelse(genome=="hg38", coor_hg38, coor_mm10))]
vista ... |
9dcaa37c9405abcba622cbd0d5a13b6559588a9af0b4907af505c20410168796 | R | 2,914 | 82 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import metadata ----
meta <- readRDS("Rdata/paper_metadata_v3.rds")
meta <- meta[dataset=="activity" & ID=="model1_bulkATAC_tsx3Aug_2xBal_noW" & set == "test"]
meta <- meta[tissue %in% c("limb", "heart", ... |
0f69f25016890e7a08b90b798ad3d39b0187f1fd7cf799abfbcd6cb736c5f64c | R | 2,924 | 85 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import ATAC peaks ----
peak.files <- list.files("db/peaks/ATAC/", full.names = T)
peaks <- lapply(peak.files, importBed)
names(peaks) <- unlist(tstrsplit(basename(peak.files), "_", keep= 1))
peaks <- rbin... |
2b9dc58bee698ecac34ccdc9513ad64d5161d015acded927e9082e699486b825 | R | 2,939 | 109 | ---
title: "Visualizing beat/side expression in bulk PNs"
output: html_notebook
---
```{r}
library(tidyverse)
library(magrittr)
#library(gplots)
#library(RColorBrewer)
```
```{r}
df <- read_csv("GSE140093_df_PN_VT_Bulk_36h_adult_LogCPM.csv") %>% as.data.frame()
genes <- read_csv("genelist_beat-side.txt") %>% as.data.... |
2a8dbef6c6f70c142c3fd57324f6f468e00126749c5a71cb263fc41cdb1a7752 | R | 2,968 | 174 | ---
title: "R Notebook"
output: html_notebook
---
```{r}
library(tidyverse)
library(plotly)
library(pROC)
source("rocFunctions.R")
```
```{r}
probs <- read.csv("PrL_Savg_TCthresh_winsROC.csv")
conf <- read.csv("PrL_Savg_TCthresh_winsConfMatrix.csv")
```
# ROC
```{r}
# Set high as the positive class
probs$trueClass ... |
9ff98a45edf27bf83dcc55ec8e818e0889025d002afbf7ba8837bce3f8e4f0d0 | R | 2,969 | 90 | library(dplyr)
library(readr)
library(arrow)
library(rtracklayer)
source("src/utils.R")
# Load datasets
transcript_classification <- read_parquet("nextflow_results/V47/final_classification.parquet")
peptide_mapping <- read_parquet("nextflow_results/V47/orfanage/peptide_mapping.parquet")
# Novel splice-junctions
pepti... |
b164e64087b843aea949f42dedf8c9ebda603cefe32ebc4e16162a9d5fa07f87 | R | 2,993 | 177 | ---
title: "R Notebook"
output: html_notebook
---
```{r}
library(tidyverse)
library(plotly)
library(pROC)
source("rocFunctions.R")
```
```{r}
probs <- read.csv("PrL_Savg_TCthresh_NNonly_winsROC.csv")
conf <- read.csv("PrL_Savg_TCthresh_NNonly_winsConfMatrix.csv")
```
# ROC
```{r}
# Set high as the positive class
pr... |
ac396df4b03ddf26c734765b757939bc1d227ef25730bec670e78f2c89ea1f8b | R | 2,995 | 100 | context("Rcpp utility functions")
test_that('row_mean_grouped runs and returns expected output', {
skip_on_cran()
suppressWarnings(RNGversion(vstr = "3.5.0"))
set.seed(42)
grouping <- as.factor(sample(c('a','b','c'), size = ncol(pbmc), replace = TRUE))
means <- sctransform:::row_mean_grouped_dgcmatrix(matri... |
70239ed4e194c6ee6647f5f3ba64389832440018ebca5090b032a90fb01eb752 | R | 2,997 | 104 | library(readxl)
library(readr)
library(dplyr)
library(tidyr)
library(ggplot2)
library(GenomicRanges)
de_novo_variants <- read_excel("data/mmc2.xlsx", sheet="Table S2C", skip=1)
novel_exonic_regions <- readRDS("export/variant/novel_exonic_regions.rds")
# novel_splice_sites <- read_csv("export/variant/novel_splice_sites... |
a766d591f878777ec95aa4b33d75e011c2fec5bdfe16f03e305452e998ad9bd2 | R | 3,020 | 88 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import annotation ----
if(!exists("annot")) {
annot <- rtracklayer::import("/groups/stark/shenzhi.chen/projects/accessibility_model_enhancer_design_17112025/annotation/mm10/gencode.vM21.annotation.gtf.g... |
bbd7d3c51787f30e3943af018838baf0862be42933da7d6d45574b9828cc59fe | R | 3,045 | 105 | #####################################
#Trial 2 Count function
#
# Convert trial by trial experimental information for N trials into response counts.
#
# INPUTS
# stimID: 1xN vector. stimID(i) = 0 --> stimulus on i'th trial was S1.
# stimID(i) = 1 --> stimulus on i'th trial was S2.
#
# response:... |
c19e235e84488dde5e3a1e8aa224db82dbb913db58e343cbcdcf4eae7fe6888f | R | 3,045 | 92 | ### This script creates an R function to generate raincloud plots, then simulates
### data for plots. If using for your own data, you only need lines 1-80.
### It relies largely on code previously written by David Robinson
### (https://gist.github.com/dgrtwo/eb7750e74997891d7c20)
### and the package ggplot2 by Hadley W... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.