sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 17k | content stringlengths 1 200k |
|---|---|---|---|---|
ac4af3a5962856c980003da9158f69cd9ef7bfbe6989a9c64a1e6a358b9ed2d8 | R | 23,851 | 540 | # On-Demand Seizures Facilitate Rapid Screening of Therapeutics for Epilepsy
# Authors: Yuzhang Chen, Brian Litt, Flavia Vitale, Hajime Takano
# DOI: https://doi.org/10.7554/eLife.101859
# Step 1: Import Libraries and Master Spreadsheet
library(readxl)
library(ggplot2)
library(ggbreak)
library(ggpubr)
library(tidyver... |
fdd57e681a445bf94dc916b25c7a2b83b669f2c52f2b29191a043eaf006bb9af | R | 24,714 | 489 | ################### ################### ################### ################### ################### ###################
#Run this script for sensitivity analyses to reproduce Section S3.1 (Pre-Injury Psychiatric Vulnerability)
################### ################### ################### ################### #############... |
e0344ba296a4de8f970aa9a1a34b692ab6f093dc540217e61bc50025a0d5c161 | R | 24,834 | 784 | ---
title: "Analysis MMRs Maturation - No posthoc"
output:
html_document: default
pdf_document: default
date: '2023-12-11'
---
## 1. Preparing the data for the analysis
First, we load some packages.
```{r}
#install.packages("foreign")
#install.packages("dyplr")
#install.packages("tidyr")
#instal... |
0e42670225a68fdde3af23976c3e47231f6e356a009f2e760eb264527a9b52d2 | R | 25,006 | 718 |
#' return msdap package version as a string
#'
#' simple wrapper around utils::packageVersion()
#' @export
msdap_version = function() {
as.character(packageVersion("msdap"))
}
#' get a value set using options(), throwing error for invalid type (boolean)
#'
#' @param x option name for `getOption()`
#' @export
get_... |
453aea0a941103fb7bd1547be38b54a7d14d75511cdc3ae56184b068438cd854 | R | 25,428 | 630 | # Load packages -----------------------------------
rm(list = ls())
library(here)
library(tidyr)
library(dplyr)
library(readr)
library(glue)
library(tibble)
library(ggplot2)
library(cowplot)
library(tidyverse)
library(readxl)
library(RColorBrewer)
library(ggpubr)
# Organize environment ------------------------------... |
c4e376d0646053e463fed15b49e58f2e34d7ba5c6090d5fb41475e3c351742e8 | R | 26,014 | 428 |
#' generate color-coding for all sample metadata
#' @param samples sample metadata table, typically; dataset$samples
#' @importFrom gtools mixedsort
#' @importFrom ggplot2 cut_interval
#' @importFrom colorspace sequential_hcl
sample_color_coding = function(samples) {
color_categorical = list(
# https://observabl... |
48a5b5607710c81c8f88d67290510c182a3bc82efc4716c361f3345e1a998e4c | R | 26,107 | 931 | # =============================================================
# ASSOCIATIONS OF INDIVIDUAL AGEING BIOMARKERS WITH ALL-CAUSE MORTALITY
# =============================================================
# COHORT:
# Lothian Birth Cohort 1936
# COX MODELS:
# Models are fitted separately for each ageing biomarker.
#
# ... |
6960ad24d1ae079d8034929e74cc30918e7f7509722ac8625c55bbf33a027d71 | R | 26,182 | 614 | ---
title: "Mouse_SOX2-_SOX10+_subclustering_and_annotation"
output: html_document
date: "2025-04-17"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
l... |
2f99ad26f6bf92e180d38e60bc7a1697057b28752cd06453fcd6d9ee52a697f1 | R | 26,260 | 686 | ---
title: "Mouse_clustering_and_annotation"
output: html_document
date: "2025-04-16"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(tidyverse)
library(harmony)
library(patchwork)
library(scales)
library(scCustomi... |
e0b894197dd0bc1d788a78c7c068c184b9594b9d7fcf43eb07ab1336634cb1ac | R | 26,860 | 608 | library(ggplot2)
## Make a bar graph to summarize proportion of clusters/programs/etc in each sample
## @para: x, x-axis data
## @para: y, y-axis data
## @para: x_order: order of x-axis variables
## @para: y_order: order of y-axis variables
## @para: col_names: column names for df for plotting
## @para: x_var: name of... |
f914aeb7695b4411af29533854ebd90f3dffc1018f42d5a0e0b067280e7d9724 | R | 27,530 | 770 | ---
title: "Cleaning LL14"
output: html_document
date: "2023-12-06"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = FALSE, # don't print the code chunk
warning = FALSE, # don't print warnings
message = FALSE, # don't print messages
fig.width = 8, # set default width of figures
fig.height = ... |
dbc523681ecfb6163527b478c3e5dad7787e416dbd2bddea02c8c3155e541cf9 | R | 27,726 | 834 | ---
title: "Elevated Hippocampal Activity at Turnaround"
output: html_document
date: "2024-03-26"
---
```{r setup, include=FALSE}
## libraries ##
library(tidyverse)
library(ggplot2)
library(lmerTest)
library(doParallel)
library(parallel)
library(foreach)
library(here)
library(fs)
library(lmtest)
library(brms)
library(... |
f243aa066a2b1472646187fbef2febaeec2a76cd3981292fefb57be1b9d50f63 | R | 28,290 | 512 |
#' Compare the number of peptide detection counts between groups
#'
#' The computation of scores is detailed in the online vignitte for "differential testing".
#'
#' @param dataset a valid dataset
#' @param min_peptides_observed minimum number of peptides for a protein to pass filtering rules (i.e. otherwise, no z-sco... |
a85e0ee727ce15bd546913c5bc223361d250e7ac7cc054654a81eedd446a8501 | R | 28,689 | 592 | ---
title: "Pseudo DEG co-culture vs no mono-culture EP1NS"
author: "Sara Danielli"
date: '`r format(Sys.time(), "Last modified: %b %d %Y")`'
output:
html_document:
toc: yes
df_print: paged
---
## Set up
```{r, setup, include = FALSE}
# Load packages -----------------------------------
library(knitr)
opts_ch... |
ed35997627dfc253bf6d587463c090d6e1a47b0a78c9a24c36f8ae5602fe87d9 | R | 28,748 | 478 | ---
output:
rmarkdown::github_document:
html_preview: true
toc: true
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
This vignette details the main functions of the MS-DAP R package.
If you have not installed MS-DAP yet, check out the installation guides and ex... |
c8c5f8c477838e9749d2ec25a287baed288f9fe267ef49ec91ee1441bb570530 | R | 28,787 | 507 |
#' placeholder title
#' @param tib_input todo
#' @param samples todo
#' @param isdia todo
plot_abundance_distributions = function(tib_input, samples, isdia) {
param_density_bandwidth = "sj"
param_density_adjust = 1.0 # alternatively, 0.9
# for DIA datasets, only use abundances for peptides detected at some q-va... |
b5d3c4be5ba91a3535e140aae061fd78776075e972f7ed073b66a4fcef41e333 | R | 28,936 | 401 |
#' Create gene-level summary tables for your DEA and differential detection results
#'
#' @description
#'
#' To expedite downstream analysis, this function maps the proteingroup results from your
#' differential expression analysis to Human gene identifiers and exports these as Excel tables that are ready for
#' use w... |
f5af304687c4f9efe6250372ac5c79a084ded492f737219f90714e536eb49bb5 | R | 29,009 | 531 | library(biomaRt)
library(Seurat)
library(tidyverse)
library(qs)
library(glue)
library(data.table)
library(infercnv)
library(matrixStats)
source('~/Projects/General-Codes/Resources/Plotting_helper_functions.R')
source('~/Projects/General-Codes/Resources/single_cell_preprocessing_helper_functions.R')
source('~/Projects/... |
7661181e390e92dd97369e52098f10f2431e5693798f6527ab7af85c6eec55ef | R | 29,179 | 706 |
prep_conn_plot_df <- function(df, sub){
# filter to subject #
conn_sub_df <- df %>%
rename(pval = percent_sig) %>%
filter(subject == sub) %>%
arrange(pairs)
# correct for time points #
conn_sub_sig_df <- conn_sub_df %>%
mutate(roi_pair = paste0(first_region, "_", second_region)) %>%
g... |
a5b4b6ae58e00974a7bf7da025277a6eed30e2477eb80abe7e2bd351552e6490 | R | 29,299 | 679 | library(Seurat)
library(ggplot2)
library(patchwork)
library(dplyr)
library(DropletUtils)
library(tidyverse)
library(harmony)
s1_filter_matrix <- Read10X("./s1_filter_mx/")
s2_filter_matrix <- Read10X("./s2_filter_mx/")
write10xCounts("./s1_filter_mx/filtered_feature_bc_matrix.h5", s1_filter_matrix, type = "HDF5",
... |
a7a979d427b07b0d56d75e16f34a423ba71cfda376c822a5df23dced80ff2c2e | R | 29,342 | 719 | ---
title: "Clinical Anxiety EDA"
output: html_document
date: "2024-01-17"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo <- FALSE, # don't print the code chunk
warning <- FALSE, # don't print warnings
message <- FALSE, # don't print messages
fig.width <- 5, # set default width of figures
fi... |
3cff0e863a94585df96de067b4c718aaa5b57aef8715ca44448f4ed20f38d3c9 | R | 29,814 | 555 | adjust_flip_data <- function(df){
# Function: adjust_flip_data
# Purpose: Prepares and cleans data for analysis by adjusting trial data based on flip events.
# Input:
# - df: A dataframe containing trial data, which includes variables like Trial, GhostLocation, trial_flip, etc.
# Process:
# - Filters ou... |
dbdadd62a798e2ebf1b05969e1c7f68261bcee792803646b007ec888b3a3bb6a | R | 29,997 | 425 | #for NGN2-neurons
#Pipeline initally written by Alexander J Trostle
#code to define disease signature, bin the resuce percentage, visualization for disease gene rescue
rm(list = ls())
options(java.parameters = "-Xmx8g" )
setwd("path_to_wd")
library(ggplot2)
library(ggrepel)
library(readxl)
library(fgsea)
library(pheat... |
90714d2b0102a3d3d4c67a66ee890f74efdb0feeb4c445751e94e62cf1dcb17e | R | 30,435 | 115 |
library(dada2)
library(dplyr)
path <- "C:/Users/Jacobs Laboratory/Documents/JCYang/Raw_Data_March2022SeqRun/PFF_FastQ_Files/" # CHANGE to the directory containing the fastq files
list.files(path)
# Extract sample names, identify forward and reverse reads
fnFs <- sort(list.files(path, pattern="R1", full.names = TRUE)... |
5554fcfad4b62636f9e94037f1220d98187c3e0cc02db025f4a723096bbf72e2 | R | 30,660 | 124 | library(dada2)
library(here)
library(tidyverse)
getwd()
here::i_am("../pdbehavior/ASO_DADA2.R")
path <- "/home/julianne/Documents/pd_paper/raw_data/" # CHANGE to the directory containing the fastq files
list.files(path)
# Extract sample names, identify forward and reverse reads
fnFs <- sort(list.files(path, pattern="... |
4f721fa33b0b30bccf432511be92fb031c8fb3b58afaab49bf1b6c6e4d4cf1db | R | 30,675 | 687 | ---
title: "Progenitors_subclustering_and_annotation"
output: html_document
date: "2025-04-14"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
library(... |
6ba0a2b189c6f178d0900edeb1fbf78efd69ef55ccfdaad2643396be1ae5fe1d | R | 30,693 | 568 |
# estimateParam ---------------------------------------------------------
#' @name estimateParam
#' @aliases estimateParam
#' @title Estimate simulation parameters
#' @description This function estimates and returns parameters needed for power simulations.\cr
#' The user needs to choose the following options at least... |
b4dd1c85b046a9fdf5cfd2a3c6d45ed0ecbd892d5f94dbd8d4cef6d624ee826d | R | 30,749 | 581 | library(scToppR)
library(Seurat)
library(tidyverse)
library(harmony)
library(patchwork)
library(openxlsx)
library(orthogene)
# Mouse ectoderm and mesenchyme subclustering
#subset E11 matching TW E11 data
setwd("/scr1/users/manchela/Data")
cds <- readRDS("face_mouse_final.rds")
Idents(cds) <- "stage"
E11 <- subset(cds... |
3026d563f884a570fc33e2a8e286666fbd5d8fdc0cc5645d733d0f995713a7b5 | R | 30,993 | 453 | setwd('~/path to your ABCD 5.0 csv folder')
## Setting up environment
library(psych)
library(dplyr)
library(purrr)
library(tidyr)
library(stringr)
library(tableone)
library(MatchIt)
library(car)
library(ggplot2)
library(ggstatsplot)
library(jtools)
library(sensemakr)
library(reshape2)
library(emmeans)
library(devtoo... |
3d66882e133bf95f0864d9e0a8dece4238b7328e6336490659318704c24fec62 | R | 31,025 | 490 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~ FUNCTIONS MOSTLY RELEVANT TO ASSIGN PROGRAMS STEP~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ReadMarkerGenes function takes in the location of ... |
7e24604b1cf94b043eb1c9e24e80364879248a90f2c1b88d1128d457df56d0ba | R | 31,150 | 974 | # Utility -----------------------------------------------------------------
data_clean_rdk <- function(x){
if('Participant Public ID' %in% colnames(x)){
y <- x %>%
as.data.frame() %>%
rename(ID = `Participant Public ID`,
Trial = `Trial number`,
RT = `Total time for referenc... |
de221ed5c496d86b9b26939c6ff467521218175dbccbe1f6cc07b3ff6a0d561f | R | 31,308 | 810 | # ------------- Figure S3 --------------
#----Figure S3A----
#infercnv,Identify CNV levels at the gene level in epithelial cells
#Extract epithelial cells corresponding to module patients
rm(list = ls())
setwd("./t100553/wss")
sce <- readRDS("./sce_Annotated_umap.rds")
corrsce <- readRDS("./subsce.corr.rds")
ep... |
d6fc991f1097d1c8a6c764d018f529c6e4b9574439d7055131dff067b86cda27 | R | 31,541 | 322 | ---
output:
rmarkdown::github_document:
html_preview: true
toc: true
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
fig.path = "images/intro-",
comment = "#>"
)
```
This document provides an introduction to MS-DAP; what is it and how does it work, together with highlights from th... |
ade6578c41b47b9e3691b74728bed4068d9c2b2712fa4a495a82b4f726d442bd | R | 31,620 | 532 |
#' returns all DEA functions integrated with MS-DAP
#'
#' @description
#'
#' ## available DEA functions
#' **ebayes**: wrapper for the eBayes function from the limma package (PMID:25605792) <https://bioconductor.org/packages/release/bioc/html/limma.html>. The eBayes function applies moderated t-statistics to each row ... |
8104ab420187685e4ba7775447c3b9b0aa6451a8b4f906545a00c9782394677e | R | 32,241 | 873 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This script is to fit a GLMM using INLA framework for the manuscript in PLOS ONE:
# "Growth rates on coral reefs peaked at 25 °C through the Holocene"
# by Tonya Macedo and Robert van Woesik
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
1aafe0bfd8bdf0c5800e910d22592cc85c4b86d2f02d2e0196551c23f2a3f54f | R | 32,323 | 909 | ---
title: "ST-EPN malignant cells - sc/snRNA-seq (Figure 2)"
author: "Sara Danielli"
output:
html_document:
toc: yes
df_print: paged
---
```{r, setup, include = FALSE}
library(knitr)
opts_chunk$set(
echo = TRUE, cache = TRUE, warning = FALSE, comment = FALSE)
```
```{r preparation environment, message=FA... |
edca186396d4ec32a106c020111f5a15c8f7353c6da7a0e81e6683bda54bc0a8 | R | 32,445 | 902 | ##' The leverages of PCA model indicate how much influence each
##' observation has on the PCA model. Observations with high leverage
##' has caused the principal components to rotate towards them. It can
##' be used to extract both "unimportant" observations as well as
##' picking potential outliers.
##'
##' Defined a... |
9bb3c991d50bac13ccc396e0488ccfb1a9e7b035e8f4ca7b59b9664dd0656eca | R | 32,581 | 659 | library(infercnv)
addNormalControl <- function(ext_ctrl, inferCNV_analysis_folder, cm_raw, orig_samples, type){
## Read ctrl cm
message("Loading normal control count matrix...")
if (type == 'frozen'){
suffix <- "_nuc_premrna_counts.rds"
} else if (type == 'fresh') {
suffix <- "_fresh_counts.rds"
}
... |
fd370bf778f60eae18c369ce6301e4db1b51ae2c9d022c78af10d7070574495f | R | 32,696 | 827 | # readall8.r Plot power spectra for classes.
# Normalize:
# Divide power by power in target-aligned interval prior to time 0
# Now values are expressed as percentage of baseline
# Specific for each site and for each frequency
# (stack & class are not relevant to baseline)
#
# Scale:
# Give all sites equal weight, AF... |
4b23d8770d2f396afa3e323ae410baa9b1401cf23b830417805ee27ce5493c48 | R | 32,807 | 627 | #' Perform differential neighbourhood abundance testing
#'
#' This will perform differential neighbourhood abundance testing after cell
#' counting.
#' @param x A \code{\linkS4class{Milo}} object with a non-empty
#' \code{nhoodCounts} slot.
#' @param design A \code{formula} or \code{model.matrix} object describing the
... |
0c10aad27dbe21db65cee75f675258f90ceefc6f4bb28498b7d8446abf227e74 | R | 33,377 | 600 |
#' Import a label-free proteomics dataset from FragPipe; combines quantitative data from the MSstats.csv file with PSM data from psm.tsv files
#'
#' @description
#' This function requires the following FragPipe output data:
#'
#' - 'combined_protein.tsv' file, located in the FragPipe output folder
#' - 'MSstats.csv' f... |
fc4cb86b9a0e1cc8c24c1f46de3a2a1e94a754c5457a78c83892661c7a5fb2c6 | R | 33,652 | 532 | #' placeholder title
#' @param peptides todo
#' @param samples todo
#' @param isdia todo
#' @importFrom data.table setorder
#' @importFrom patchwork wrap_plots
plot_retention_time_v2 = function(peptides, samples, isdia) {
param_density_bandwidth = "sj"
param_density_adjust = 1.0 # alternatively, 0.9
# TODO: inpu... |
5722af15e66db6f677d0f8cab13eb59d856a7296db5c28b67efebe5b1f0f7ad3 | R | 34,562 | 566 | ################### ################### ################### ###################
#Bootstrapping (will run for ~40 minutes)
################### ################### ################### ###################
set.seed(123)
n <- length(sample_newTBI[,1])
B <- 1000
boot.samples <- matrix(sample(sample_newTBI$subclass, size=B*n... |
6b87ba8d5894771fe570842812284bfed442ec2d2417fba0117cd0f82f9d8436 | R | 34,601 | 705 | # remove scientific notation ----------------------------------------------
.plain <- function(x,...) {
format(x, ..., scientific = FALSE, trim = TRUE, digits=1)
}
# ggplot colors -----------------------------------------------------------
#' @importFrom grDevices hcl
.gg_color_hue <- function(n) {
hues = seq(15... |
a1044b454deec32fed878c35a2258c00ac834ac47c539ad031ed32fa6988a988 | R | 35,122 | 931 | cli::cli_h2("┗ [Vasc-AoP] Loading visualizations")
#--------------------#
####🔺Correlation ####
#--------------------#
corr_matrix_plot <- function(dat, vars, title = "") {
return(
dat |>
dplyr::mutate(
dplyr::across(where(is.character), factor),
dpl... |
66796a41de49b6838718262c9fd9cf217e01a6a9bc3d83c76638f04c361ee3f8 | R | 36,233 | 1,061 | # ------------- Figure 5 --------------
#----Figure 5A----
library(Seurat)
library(dplyr)
library(tibble)
library(pheatmap)
library(tidyr)
library(viper)
library(decoupleR)
library(ggplot2)
library(patchwork)
library(OmnipathR)
# Infer transcription factor activity in CM2 and CM5 cells
module2 <- readRDS("... |
e172d7fa2d96ac92820d5b8eb46a8829c6466049ab302ab95a7e917be6860a45 | R | 36,253 | 655 |
#' placeholder title
#' @param peptides todo
#' @param prop_peptide todo
peptides_collapse_by_sequence = function(peptides, prop_peptide = "sequence_plain") {
tib_result = tibble_peptides_reorder(as_tibble(aggregate_tibble_by_datatables(peptides, prop_peptide)))
return(tib_result)
}
#' Completely remove protein... |
8648eb51061d90ea1785907c714be18011378bb690a7f008fe41f12df8d66e18 | R | 36,263 | 765 | #' Perform differential abundance testing using a NB-generalised linear mixed model
#'
#' This function will perform DA testing per-nhood using a negative binomial generalised linear mixed model
#' @param X A matrix containing the fixed effects of the model.
#' @param Z A matrix containing the random effects of the mod... |
34dadd773f73a5cb4af2faf485a61931b71daf14a4e760e994a2669df7c990e4 | R | 36,491 | 532 | ---
title: "powsimR"
output:
rmdformats::material:
highlight: kate
self_contained: true
code_folding: show
thumbnails: true
gallery: true
fig_width: 8
fig_height: 4
df_print: kable
fig_caption: yes
use_bookdown: true
bibliography: Bioc.bib
link-citations: yes
vignette: >
%\Vi... |
48b2c8bc242afbc44a37c061846ce66b8cbdee8f60ddb2c3d3d4e445c1fa1ef4 | R | 37,149 | 726 | # ------------- Figure 4 --------------
#----Figure 4A----
#Create CellChat objects for module2 and module5
library(CellChat)
library(patchwork)
library(tidyverse)
options(stringsAsFactors = FALSE)
corsce <- readRDS("./wss/subsce.corr.rds")
corsce@meta.data <- corsce@meta.data[,c(4,5,25,24,27)]
cancer.epi <- readRDS(fi... |
70c808fa923916fc20205268214aaa350410f7de3ddd3535ba1e737cb83f6731 | R | 37,797 | 750 |
# simulateDE --------------------------------------------------------------
#' @name simulateDE
#' @aliases simulateDE
#' @title Simulate Differential Expression Pipeline
#' @description simulateDE is the main function to simulate differential expression for RNA-seq experiments.
#' The simulation parameters are speci... |
2d3503591ee191157d146763294e57b29345849c82af2d5266ffdbed6033d353 | R | 38,045 | 953 | ###########################
### MILO PLOTTING UTILS ###
###########################
#' Plot histogram of neighbourhood sizes
#'
#' This function plots the histogram of the number of cells belonging to
#' each neighbourhood
#'
#' @param milo A \code{\linkS4class{Milo}} object with a non-empty \code{nhoods}
#' slot.
#'... |
3535769caee9be6ff2b7cd02901d773e575520986ec5a6ed31b589726887d1c6 | R | 38,077 | 911 | ---
title: "Normative Gameplay on the Pacman Task from Pilot Data"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo <- FALSE, # don't print the code chunk
warning <- FALSE, # don't print warnings
message <- FALSE, # don't print messages
fig.width <- 5, # set default width ... |
633fa15bec415e4bb5decfa1c36ec195c53b5228fb72d1341819ec4feb4f5339 | R | 38,187 | 1,311 | ---
title: "granger_thresholds"
output: html_document
date: "2025-07-03"
---
```{r setup, include=FALSE}
## libraries ##
library(tidyverse)
library(ggplot2)
library(lmerTest)
library(doParallel)
library(parallel)
library(foreach)
library(here)
library(fs)
library(lmtest)
library(scales)
library(ggthemr)
library(RColorB... |
81fca8f58f49ba52318b2c76ff71b51649939cbe00be5c367b40235894940ed2 | R | 38,524 | 972 | # checkup -----------------------------------------------------------------
#' @importFrom SingleCellExperiment SingleCellExperiment
#' @importFrom scater isOutlier
#' @importFrom BiocGenerics counts
.run.checkup <- function(countData,
readData,
batchData,
... |
5324f669b453e2111c6cd18e72737f88d3291a2a6a563b77e8397e5969e46903 | R | 39,529 | 1,315 | ---
title: "hNPC_scRNAseq_analysis"
author: "SabaShahin"
date: "06/06/2023"
output: html_document
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
load required libraries
```{r}
suppressWarnings(library(dplyr))
suppressWarnings(library(Seurat))... |
97c8fa8d75ca30442de35754c7d54dcd16e97238d27cffb504b278ba9e840b0a | R | 39,690 | 948 | ---
title: "Supercluster Statistics"
output: html_notebook
---
Version 1.0, July 2025, SA
This script calculates a weighted average of data clustered together 100% consistently across leave1out iterations, and runs the statistical comparisons for each supercluster.
It plots the supercluster connectivity profiles in... |
af1ab33a987105663a855c21a1eb80e230f7f78979ac9aa1e3cb601472b783b0 | R | 41,243 | 1,049 |
# Normalisation Wrapper ---------------------------------------------------
.norm.calc <- function(Normalisation,
sf,
countData,
spikeData,
spikeInfo,
batchData,
Lengths,
... |
23707cc5fdfdd3d11ad3e3e02b237b9a5473332f765b98d1e0f3b25ffd22c924 | R | 41,498 | 736 | library(ggplot2)
library(dplyr)
library(magrittr)
library(Seurat)
library(scCustomize)
library(tidyverse)
library(harmony)
mouse_cds1 <- readRDS("cds_face_mouse.rds")
mouse_cds2 <- mouse_cds1
mouse_cds_ect <- readRDS("ect_all.rds")
mouse_cds_mes <- readRDS("mes_all.rds")
Idents(mouse_cds1) <- "cell_type1"
mouse_cds_cn... |
dc1e7e79c759f7d6d14ca320e9521219a932a56f1c8a1804013eb508821cf3d8 | R | 41,658 | 715 |
#' Input validation for eBayes/DEqMS/MS-EmpiRe functions
#'
#' @param eset protein/peptide log2 intensity matrix stored as a Biobase ExpressionSet. Must describe protein_id and sample_id in metadata
#' @param model_matrix a `stats::model.matrix()` result that is supplied to `limma::lmFit()`
#' @param model_matrix_res... |
943ea8dcb2503e5c3f996c1d642f1e8dd013aff8bf11702aecba1c8bff2f60a6 | R | 42,371 | 901 |
#neurogenomicslab/magma.celltyping
Sys.setenv(GITHUB_PAT="your token")
install.packages("piggyback")
Sys.setenv('R_MAX_VSIZE'=64000000000)
if(!require("remotes")) install.packages("remotes")
library(MAGMA.Celltyping)
library(qqman)
face_ctd <- EWCE::load_rdata("ctd_face_ctd.rda")
face_subtype_ctd <- EWCE::load_rdata... |
95f4d23bab5044aae839490f5527539148490522dfd22bb9e471256b9a4e5f75 | R | 42,651 | 1,033 | ---
title: "Spatial_Expression"
output: html_document
date: "2025-04-07"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
library(patchwork)
library(vir... |
de9d72be4d53bddb1d50aa250ab00a61323cea889e3a29fdca8c442ba308fa64 | R | 43,560 | 1,339 | local({
# the requested version of renv
version <- "1.1.8"
attr(version, "md5") <- "cbffd086c66739a0fdaac7a30b4aa65c"
attr(version, "sha") <- NULL
# the project directory
project <- Sys.getenv("RENV_PROJECT")
if (!nzchar(project)) {
project <- getwd()
}
# use start-up diagn... |
0548af8a8c8a464a4226fb7769a11003e9608db370b8ebda1319cdb959fc954b | R | 43,668 | 705 |
#' Import a label-free proteomics dataset from Bruker proteoscape
#'
#' This function was tested with a Proteoscape that uses DIA-NN 1.7.1, and expects the
#' respective peptide.parquet and protein.parquet files with peptide and protein data.
#'
#' You can also import the report.tsv file generated by Proteoscape using... |
ea86afd829df2557ef8160580782d12f97b1db64e3a1ccb0dc1e66709d47532c | R | 44,556 | 796 |
#' plot peptide-level data
#'
#' @examples \dontrun{
#' # example 1:
#' # <assuming you imported a dataset and applied analysis_quickstart()>
#' # plot all significant proteins found by DEA
#' plot_peptide_data( dataset, select_dea_signif = TRUE,
#' # should match analysis_quickstart() parameters !
#' norm_algorit... |
5e22b02eff7f2e286a9269a2e52beb4b450fd93224988295bd1b3fd3ba81005f | R | 45,073 | 895 | # ------------- Figure 2 --------------
#----Figure 2A----
#co-occurrence analyses
library(Seurat)
library(dplyr)
library(ggplot2)
library(tidyverse)
setwd("./NSCLC/Figure/figure2/")
rm(list = ls())
TIME <- readRDS(file = "./NSCLC/Figure/figure1/TIME.rds")
sce <- TIME
#remove cell populations with low cell counts, low ... |
bf0f955c587aa0da611d32e122f282fe1d0c89047ad45e2ef5b8579f7ed9e4d7 | R | 45,365 | 789 | library(phyloseq)
library(ggplot2)
library(tibble)
library(tidyr)
library(tidyverse)
library(plyr)
library(dplyr)
library(vegan)
library(treeio)
library(ape)
library(pairwiseAdonis)
###############################
#Script template for DADA2 ITS2 workflow
###############################
#library(readr)
#library(dada2)... |
9d429c38b3a4519123e71d066d02e5c3d2c601da27999c61e44a02b3f9a1b413 | R | 45,613 | 945 | ---
title: "NMF for ST-EPN"
author: Sara Danielli
date: '`r format(Sys.time(), "Last modified: %b %d %Y")`'
output:
rmdformats::readthedown:
lightbox: true
highlight: tango
editor_options:
chunk_output_type: console
---
```{r include = FALSE}
library(knitr)
opts_chunk$set(comment = NA, eval = FALSE)
```
... |
5bff882ea9b8c0846a45f102451f2eab9a4d76ab15c22789511aba0544a9cd95 | R | 45,794 | 1,026 | # Load libraries
## Libraries for basic preprocessing
library(reshape2)
library(dplyr)
## Single cell libraries
library(Seurat)
#library(pagoda2)
##library(conos)
## Libraries for plotting
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(pheatmap)
## Annotation and pathway analysis library
##library(... |
cd1d74dbb05ca7ba211f0985fc95585f336edb06345e3e696074a648cb44bab3 | R | 46,653 | 723 | ---
title: "MS-DAP: Mass Spectrometry Downstream Analysis Pipeline"
subtitle: "version: `r msdap::msdap_version()` https://github.com/ftwkoopmans/msdap/"
output:
pdf_document:
toc: true
toc_depth: 2
number_sections: true
latex_engine: xelatex
keep_tex: false
fontsize: 11pt
geometry:... |
1fa1fb357929b056b4d47cde007231bda9faed601a368a8f238df99c812b04dc | R | 48,838 | 869 | library(EWCE)
library(SingleCellExperiment)
library(scRNAseq)
library(scater)
library(Seurat)
library(tidyr)
library(pheatmap)
# Sys.setenv('R_MAX_VSIZE'=64000000000)
options(future.globals.maxSize = 10 * 1024^3)
setwd("/scr1/users/manchela/Data")
cds_subtype <- readRDS("/scr1/users/manchela/Data/human_face_no-neuro_c... |
9304d93423a5a8320ff33bd7c5d647fcd975b3774e6ec0e21b6cfc4921911f5f | R | 49,478 | 1,163 | #####################################################################################################################
#
#####################################################################################################################
# STEP 1 - NEURONS LVL2 DEVELOPMENT SUBSET CONTROL CELLS - CONTRASTS
setwd("/datos... |
841a94cea4b9aae99a50bb3ca5787ac229bd4a07ddca00c6d08275c0845d0c75 | R | 51,092 | 863 |
#' check if peptide tibble has cache
#' @param dataset your dataset
#' @export
check_dataset_hascache = function(dataset) {
is.list(dataset) && all(c("groups","dt_pep_group") %in% names(dataset))
}
#' invalidate peptide tibble cache
#' @param dataset your dataset
#' @export
invalidate_cache = function(dataset) {
... |
3962cb647e88be4c28214765205648e74fa247af4ce68ac227adefe7990c4e06 | R | 52,350 | 445 | ################### ################### ################### ###################
#Summary Scores: Means and 95% Confidence Intervals across Iterations
################### ################### ################### ###################
df_groupcomp <- data.frame(groupcomp.mtrx)
summary_groupcomp <- data.frame(
Comparison ... |
c69206ca16b498d3bacd55f1cacdc191a3fa552d8d61b5207a370c1cf652e27c | R | 53,259 | 980 |
#' Import sample metadata from an Excel table
#'
#' @param dataset your dataset
#' @param filename full file path of the input file (eg; C:/temp/template_experiment1.xlsx)
#'
#' @export
import_sample_metadata = function(dataset, filename) {
# TODO: input validation
stopifnot(is.list(dataset) && "peptides" %in% nam... |
219d20f3e472eb11fa4efb736e300bfc6002d3a93fcf25d18b99effe91443ac0 | R | 53,667 | 1,158 | # Load libraries
## Libraries for basic preprocessing
library(reshape2)
library(dplyr)
## Single cell libraries
library(Seurat)
#library(pagoda2)
##library(conos)
## Libraries for plotting
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(pheatmap)
## Annotation and pathway analysis library
##library(... |
bc78aed406acce19356dd9f1284469ef31fde519d6ef98b43807c86aa51a3093 | R | 54,100 | 1,237 | library(tximeta)
library(DESeq2)
library(tidyverse)
library(readr)
library(apeglm)
library(ashr)
library (EnhancedVolcano)
library(gprofiler2)
library(dplyr)
library(IHW)
library("variancePartition")
library(edgeR)
library(tximport)
library(patchwork)
library(cowplot)
##################################################... |
e34ee44c1b7b7fd087796d2de2df84a0eb7bc32f539705a4de6d29eb11d96249 | R | 54,187 | 1,367 | ---
title: "R Notebook"
output: html_notebook
---
```{r }
library(Seurat)
library(Matrix)
library(data.table)
library(ggplot2)
library(gridExtra)
library(SeuratDisk)
library(zellkonverter)
library(ShinyCell)
library(dplyr)
library(clusterProfiler)
library(org.Hs.eg.db)
setwd("/data/Combined_hthymus/Fetal_Pediatric_... |
d5c9c8082c8f55cc5d153772b04f460c635c492405e92ef1bb53216c41e5d92c | R | 54,195 | 1,051 | ## code to prepare `DATASET` dataset goes here
library(RNHANES)
library(plyr)
library(dplyr)
# NHANES 1999-2018 --------------------------------------------------------
#Demographic
DEMO <- nhanes_load_data(c("DEMO","DEMO_B","DEMO_C","DEMO_D","DEMO_E","DEMO_F","DEMO_G","DEMO_H","DEMO_I","DEMO_J"),
... |
af64b20d344fd1465036ed80bda4d9cd6545c040ad772b687429c5208adddf47 | R | 54,308 | 1,166 | # Load libraries
## Libraries for basic preprocessing
library(reshape2)
library(dplyr)
## Single cell libraries
library(Seurat)
#library(pagoda2)
##library(conos)
## Libraries for plotting
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(pheatmap)
## Annotation and pathway analysis library
##library(... |
4c770f949822674e01267d915ee80b991c192830a58bdc62f804cb240e958ce8 | R | 55,115 | 1,151 | ############################################################
## Project: Coordinated multicellular immune programs and drug targets revealed by single-cell analysis in driver-mutated NSCLC
##
## Purpose:
## Reproducible R workflow for single-cell analysis, TIME module identification, prognostic model construction, ... |
322e4b2b3b421b6947052fe44af71a6a03f637ef1ae6ecaae95af9352976a044 | R | 55,881 | 1,733 | #Prepare GWAS sumstats files
#get summary file from FINNGEN
#focus on congenital studies
#grep "XVII Congenital" finngen_R11_manifest.tsv | cut -f1 > congenital_studies.txt
#get other controls
# grep "Crohn's" finngen_R11_manifest.tsv | cut -f1 > immune_studies.txt
#get lupus
# grep "SLE_FG" finngen_R11_manifest.tsv | ... |
da7eed8518a6e4d27a4e4e7f4a6eb699c4938c19cebd74f6250d0cf36d37574b | R | 56,300 | 835 | library("ggVennDiagram")
library(eulerr)
library("GeneOverlap")
human_main_markers <- readxl::read_xlsx("tables/SigGenes_Main_CellTypes.xlsx", sheet = 1)
mouse_main_markers <- readxl::read_xlsx("tables/Mouse_SigGenes_Main_CellTypes.xlsx", sheet = 1)
mouse_main_markers_orthologs <- subset(mouse_main_markers, hgnc_symbol... |
9576dffa501f442708018825f3483e1f7c1a0319e96ccfa2931706664e713e4c | R | 56,469 | 808 | ---
title: "Approach/Avoid Behavior Prep"
output: html_document
date: "`r format(Sys.time(), '%d %B, %Y')`"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo <- FALSE, # don't print the code chunk
warning <- FALSE, # don't print warnings
message <- FALSE, # don't print messages
fig.width <- 5, #... |
0efb0c6367c5c76a30d4048c802f58913a5491955b299d54f90256b22ddc0b64 | R | 56,916 | 1,504 | # ------------- Figure 3 --------------
#----Figure 3A----
#Analysis of Cancer Cell Status
#CopyKat Identify malignant cells
rm(list = ls())
setwd("./t100553/wss")
sce <- readRDS("./sce_Annotated_umap.rds")
dir.create("./copykat/")
setwd("./copykat")
#corrsce <- readRDS("./subsce.corr.rds")
epi <- subset(s... |
71ed0f7cdef9ac584e13cc52b3cd5fd26bdd079654c690f6a00b20bf3ec00464 | R | 57,102 | 1,911 | ---
title: "Granger Analyses"
output: html_document
date: "2025-02-11"
---
```{r setup, include=FALSE}
## libraries ##
library(tidyverse)
library(ggplot2)
library(lmerTest)
library(doParallel)
library(parallel)
library(foreach)
library(here)
library(fs)
library(lmtest)
library(scales)
library(ggthemr)
library(RColorBr... |
dcf816c48c8889493b8430edfd0d4025889d00c4ee69661f3c5fd2556781ba2d | R | 57,668 | 1,461 | # NOTES -------------------------------------------------------------------
# Note that the function in scater gave negative values and
# when cpm.DGEList was allowed to take the log itself all CPMs were nonzero!
# ROTS, NOISeq, EBSeq, monocle, scDD have no log fold changes internally calculated?
# DE TOOLS WRAPPER ... |
30ee255f12440008e9b8e751df74fef0bc9590efd9c49bcb58afbb67572749bb | R | 58,682 | 1,269 | # Load libraries
## Libraries for basic preprocessing
library(reshape2)
library(dplyr)
## Single cell libraries
library(Seurat)
#library(pagoda2)
##library(conos)
## Libraries for plotting
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(pheatmap)
## Annotation and pathway analysis library
##library(... |
8f1e4567e84a855209e536de018a0427efeac4e2c238267b6d93dc16ef0d8016 | R | 59,092 | 1,280 | # Load libraries
## Libraries for basic preprocessing
library(reshape2)
library(dplyr)
## Single cell libraries
library(Seurat)
#library(pagoda2)
##library(conos)
## Libraries for plotting
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(pheatmap)
## Annotation and pathway analysis library
##library(... |
1c033361ee7eb039c3a5bae660ca4bd396c226fcafd2723988e298f87505196c | R | 59,278 | 1,284 | # Load libraries
## Libraries for basic preprocessing
library(reshape2)
library(dplyr)
## Single cell libraries
library(Seurat)
#library(pagoda2)
##library(conos)
## Libraries for plotting
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(pheatmap)
## Annotation and pathway analysis library
##library(... |
b2a3495e1d4e38bb298969281097b3362e6f4d384e7a2414f28848eb160b6b04 | R | 60,704 | 1,446 | ---
title: "Ectoderm subclustering and annotation"
output: html_document
date: "2025-04-05"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
library(pat... |
a8739534510a7acfa690a2fb6effec6d61a560481289cfc4fa80d4feb2e37923 | R | 60,788 | 2,512 |
# ---- libs ----
library("arrow") # parquet files
library("binom") # wilson confidence intervals for binomial counts
library("foreach") # flexible looping and return amalgamation
library("episensr") # misclassification error contingency table adjustments
# library("simdata") # NORTA method to get correl... |
3f6d1f21af9569c25462e58fdcb78027d00a672d9eb8ed3247c21549d3d269d8 | R | 61,726 | 1,218 |
# plotParam -------------------------------------------------------------
#' @name plotParam
#' @aliases plotParam
#' @title Visualize distributional characteristics of RNA-seq experiment
#' @description This function plots the results of the parameter estimation. This includes the absolute and relative sequencing dep... |
8c27cc2ba360ad2db08f7ccf8ca4c149a0982ec010311c05afcde97b2d17500a | R | 62,949 | 1,508 | ---
title: "Mesenchyme_subclustering_and_annotation"
output: html_document
date: "2025-04-05"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
library(p... |
31c3f1049cd8ef345879379d349615957f46f65dce9c40702459de3c56ad63ca | R | 63,790 | 1,509 | ---
title: "Mouse_Spatial_Expression"
output: html_document
date: "2025-04-17"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
library(patchwork)
libra... |
909d25e9369f321c200ae8389965dcef4b6ace0e2dde8ece0d09db6b0b9f3da7 | R | 67,679 | 1,351 |
# Barnby et al. (2026): Corpus Callosum Dysgenesis impairs metacognition:
# evidence from multi-modality and multi-cohort replications
#
# Analysis script covering three experiments:
# Experiment 1: Online RDK (CCD vs NT, computer-based)
# Experiment 2: In-lab RDK (CCD vs NT, MRI environment)
# Experiment 3: VR ... |
c4e1ea7a722e420775bc9898094a872c51b37535c7f9db9a6a934ab123d8a3b1 | R | 70,283 | 1,308 | individual_and_overall_robust_lme_onset_before_turn_model_and_plot <- function(region, freq, distance_df, brain_df, plot_title, y_low, y_high, rerun_model = TRUE){
if(rerun_model == TRUE){
## Run LME Multiple Regression Models with two predictors: Distance to Ghost, Points Remaining
# merge be... |
b0c419cf55bb817b3adddc61564f7535323fbf781b6b4b26bab3adcb2ff76d67 | R | 74,566 | 1,537 | # EVALUATE DISTRIBUTIONAL FITS --------------------------------------------
#' @name evaluateDist
#' @aliases evaluateDist
#' @title Model Diagnostics for RNAseq Data
#' @description With this function, the user can determine goodness of fit for each gene.
#' @usage evaluateDist(countData, batchData = NULL,
#' spikeDa... |
40360f47a38dc1269667719b79bda23c4e5679e3a8e1b944d80452f555abcdd0 | R | 76,241 | 1,321 | ---
title: "Species_Comparison"
output: html_document
date: "2025-04-09"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
library(patchwork)
library(vir... |
dc01f13690177042d1ad731a02a52561055935daf1713c8ede3c50cf45391f29 | R | 79,002 | 1,762 | ---
title: "CNCC subclustering and annotation"
output: html_document
date: "2025-04-06"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = "/scr1/users/manchela/Data")
library(Seurat)
library(SeuratDisk)
library(tidyverse)
library(harmony)
library(dplyr)
library(patchwo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.