sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
3d430aa2dd64918c514007aff182087040729528cc1d9edaee12729b5c0cde16 | R | 11,669 | 376 | ---
title: "script02_analysis"
author: "Shamini Ayyadhury"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more ... |
0083f8bd340f1cbf945e06727f7f30a8f1f1aa147c59f0578b350e598183d9b9 | R | 11,688 | 309 | # Meta-analysis of scRNA-seq data of E14 Neocortex - Part 2 : Clustering ---------------------
# Rahul Jose
# SCB, RGCB
# October 2024
# Primary Aim :
# For the identification of NIHes1 and NDHes1 cells from Neocortex single cell data,
# Identifying PCA based clusters in scRNA-seq data from Loo, L., Simon, J.M... |
dc42494cb06b98ad5ddce8df01c0e80e2a9bfdfbe608e1f15d8e5d55f4635d73 | R | 11,689 | 330 | #!/usr/bin/env Rscript
suppressPackageStartupMessages({
library(dplyr)
library(ggplot2)
library(ggpubr)
library(gridExtra)
})
# - First, create colored deltaZ score box and whisker
# — assume `gene_mat`, `clusters`, and `meta_pat` are already defined —
# Prepare data for Cluster 1 (Immune)
genes_c1 <- names(c... |
b68cbb36d0be8d0e9200ab3be78103120eac660ab34bb32aa585701259bd4f15 | R | 11,708 | 316 | library(RCurl)
library(stringr)
# Data processing for mouse
# download protein annotation from STRING v11.0 (10090.protein.info.v11.0.txt)
pinfo<- read.table('D:/workspace/Rstudio/STRING_v11/2020NAR/10090.protein.info.v11.0.txt',
stringsAsFactors = F,
sep = '\t',
... |
642e5c48d96da5d45a70f5f784a0ba2ba793883471f9fbf526a20e4095bcc5db | R | 11,735 | 299 | ---
title: "HeMoVal_Data_Analysis_ADDITIONAL"
date: "2025-01-28"
authors: "Kevin Akeret & Raphael M. Buzzi. Statistical review: U. Held, D. Kronthaler"
output: html_document
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE, echo=FALSE}
knitr::opts_chunk$set(echo = TRUE,
... |
be8328d105ee033561b2be9f0d2bb58115009dd7f88f19ed6912ecb5d2f5a128 | R | 11,742 | 333 | #
# Figueroa-Vargas, Navarrete et al., 2025
#
#
# LASSO implementation
rm(list = ls())
library(rjags) # rjags library allows R to interface with JAGS
library(coda) # coda package provides tools for summarizing and visualizing MCMC output
library(ggmcmc) # ggmcmc is used for diagnos... |
2e5f9ff44812669aed5b463b9e0bd94f47e081d5255d6399b639c5c064033710 | R | 11,750 | 299 | #' compare enrichment results across different samples
#' @param x list of richResults
#' @param pvalue cutoff pvalue
#' @param padj cutoff p adjust value
#' @param include.all include all richResults even empty
#' @examples
#' \dontrun{
#' hsako <- buildAnnot(species="human",keytype="SYMBOL",anntype = "KEGG")
#' hsago... |
b7543731ceb5255c2a93eb77062ad73cce7c93e3d8dcc488d250d7e74ac51872 | R | 11,792 | 259 | ---
title: "Frequently Asked Questions"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Frequently Asked Questions}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
message = FALSE,
warning =... |
ade55583b9f88585a2e541f7fe374061cd266174cd395f6e71e5e8fe66d879ee | R | 11,795 | 237 | #' Add FASTA sequence content to PAF alignments.
#'
#' This function takes a PAF table and for each alignment (rows) will report counts and frequencies of user defined
#' `sequence.pattern` (such as exact DNA pattern, e.g. 'GA') or `nucleotide.content` (such as sequence GC content).
#'
#' @inheritParams breakPaf
#' @in... |
c1187f79b95a315d929a6966f5026596adee53c1d7b462e10baa22aa084f8d87 | R | 11,823 | 214 |
library(dplyr)
library(Seurat)
library(patchwork)
library(sctransform)
library(ggplot2)
library(harmony)
path2='path/to/figure/images/'
sctv2fileloc='path/to/datasets/'
MayZhang10x<-readRDS(file = paste0(sctv2fileloc,'2024-06-18_May-Zhang2021_10x_6wks_MouseColDuodIle_SCTv2Integrated_HarmonyBC.RDS'))
MZ... |
e2f3d7d6020b33278e8b0bfbc564a7f9b5a1f0f65bc4dad211ea9cf7f472b1b4 | R | 11,842 | 145 | #!/usr/bin/env Rscript
#
# Script to merge SlamDunk count files
#
# Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder.
#
# This file is part of Slamdunk.
#
# Slamdunk is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Sof... |
7e64c33cb1b497b3772b521666201f8fe8316103c0a1f200b4af72aee613954d | R | 11,846 | 383 | #' @name lgb.train
#' @title Main training logic for LightGBM
#' @description Low-level R interface to train a LightGBM model. Unlike \code{\link{lightgbm}},
#' this function is focused on performance (e.g. speed, memory efficiency). It is also
#' less likely to have breaking API changes in ne... |
b67cd641b8e52ebd48ba90f7ad6a91dbf5166468129f9e08657320f6151d2796 | R | 11,851 | 207 | # K. S. Gaonkar 2019
# Annotates standardizes fusion calls from callers [STARfusion| Arriba] or QC filtered fusion
# calls with zscored expression value from either GTEx/cohort . The input should have the following standardized
# columns to run through this GTEx/cohort normalization function
# "Sample" Unique SampleID... |
933d615a308126438dd5805dfc95b3ee6f65a9e10c266aa1fd9487525d33ebdb | R | 11,863 | 333 | # Analyses d) and e): to see whether an increased PAD at baseline is associated with a future increase in atrophy (d) and cognition (e)
# Load required libraries
library(mvtnorm)
library(data.table)
library(LMMstar)
library(mets)
library(riskRegression)
library(dplyr)
library(boot)
library(writexl)
library(mmrm)
### ... |
941bb4447dfacd20ee8fa960e83ca2852c47e1693ffb9a6153dec1bffaa29491 | R | 11,876 | 370 | ---
title: Two brain systems for the perception of geometric shapes
subtitle: fMRI Behavior analysis
author:
- Mathias Sablé-Meyer
- Lucas Benjamin
- Fosca Al Roumi
- Cassandra Potier Watkins
- Chenxi He
- Stanislas Dehaene
lang: en
output: rmdformats::readthedown
---
```{r setup}
library(tidyverse)
librar... |
00eb741d135177e79ed3be6486a01c5f82c7155e9156ab5549ad63cf4c0830ae | R | 11,932 | 426 | #' Utility function removing columns with all values NA from a dataset.
#'
#' @author
#' Klev Diamanti
#'
#' @param df An Olink dataset.
#'
#' @keywords internal
#' @noRd
#'
#' @return The input Olink dataset without all-NA columns.
#'
remove_all_na_cols <- function(df) {
# input check ----
check_is_dataset(x =... |
8a706550259e2d4b15bd44e02547a5e5e4a5b46f27deb5b0426637948b1251ff | R | 11,936 | 287 | ## Script for merging our datasets with public datasets to investigate the origin of our FBs
## Initial basic Seurat and Harmony workflow script to create Fibroblast origin complete object in Figure 1 manuscript
## Rebuttal: Different harmony settings and added new Betsholtz data
library(Seurat)
library(SingleCellExpe... |
4c2e1180c0cb84a6e7d5e39fe59b7a252c202c2124902bd625a77b1d7527b660 | R | 11,944 | 326 | # Functions for circos plots
#
# C. Savonen for ALSF - CCDL
#
# 2020
#
prep_bed <- function(df,
samples_col = "samples",
sample_names = "all",
chr_col = "chrom",
start_col = "start",
end_col = "end",
... |
aa7abf82e12d3d79c0d88a746f7047aa66f36103dffe98927d7ce53d369b33e4 | R | 11,959 | 209 | ################################################################################
# Post-hoc Analysis: Testing Co-occurrence of Disrupted Gene Pairs in Cases
# Logistic regression with covariate adjustment
################################################################################
library(tidyverse)
library(data.t... |
9562d9af7246f3beb1e9940dba2ab5fddf2ef6e9c886fdfed584aedcaf76a026 | R | 11,966 | 319 | ---
title: "Explore hypermutator samples and relationship to signatures"
author: "SJ Spielman (CCDL) and Jo Lynne Rokita (D3B)"
date: "2022"
output:
html_notebook:
toc: true
editor_options:
chunk_output_type: inline
params:
is_ci: 0
output_Folder: ""
---
#### Files and paths
```{r setup}
library(... |
332b9817377578ff8b99988bc0a0a9bb807605e04f1d85ad2a8f81a2efe7e876 | R | 11,972 | 274 | # Run Jin (D3b), Jo Lynne Rokita (D3b), and Stephanie Spielman (CCDL)
#
# Generate figures with UMAP results
### Load libraries
library(tidyverse)
### Define variables
release_used <- "release-v22-20220505"
other_cns_color <- "#a9a9a9"
to_be_classified_color <- "#656565"
other_lgat_color <- "#000000"
### Define di... |
d8961519c541080bf9aa56deed5ec20e91fa9009beb67de6c7f2bc26a839ffd4 | R | 11,981 | 237 | #' @title Get parcel-based disconnection
#' @description This function computes parcel-based direct disconnection measures using an
#' MNI-registered lesion file and an MNI-registered brain parcellation.
#' @param cfg a pre-made cfg structure (as list object).
#' @param cores an integer value that indicates how many pa... |
7adf902978ec23dc3ce4c62c5319ce4ec5466aab628aac8706287b95a783c81a | R | 12,019 | 407 | # For macOS users who have decided to use gcc
# (replace 8 with version of gcc installed on your machine)
# NOTE: your gcc / g++ from Homebrew is probably in /usr/local/bin
#export CXX=/usr/local/bin/g++-8 CC=/usr/local/bin/gcc-8
# Sys.setenv("CXX" = "/usr/local/bin/g++-8")
# Sys.setenv("CC" = "/usr/local/bin/gcc-8")
... |
ce046b4553839d4587c4924a380b57d58a651835c214deed6efb986282531665 | R | 12,030 | 329 | setwd("/media/user/disk21/completeAnalysis/figure_Dec2024/")
library(ggplot2)
library(ggpubr)
library(Seurat)
meta = read.csv('/media/user/disk21/completeAnalysis/scRNA_25Aug/meta_28Sept.csv', row.names = 1) #single-cell meta data
cells = unique(meta$Major.celltype)
num = which(meta$groups == '')
meta = meta[-num, ]... |
55d9b80dce5e7318246394271dc6f74e80f57f657827478f49920af561113f85 | R | 12,055 | 256 | #' @importFrom stringi stri_enc_mark
.quality_control <- function(object, verbose = FALSE) {
# Sanity checks
if (!is(object, "MOFA")) stop("'object' has to be an instance of MOFA")
# Check views names
if (verbose == TRUE) message("Checking views names...")
stopifnot(!is.null(views_names(object)))
stop... |
d873bcad1a288d656fa1e2dc7c184b0239785ba1202f5cb86f47444ecb0c1fc0 | R | 12,056 | 357 | # J. Taroni for ALSF CCDL 2020
#
# Makes a pdf panels for an RNA-seq overview figure
library(tidyverse)
library(ComplexHeatmap)
# Establish base dir
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git"))
# Declare output directory
output_dir <- file.path(root_dir, "figures", "pdfs", "fig5", "panels")
if (!dir.... |
2b4b3ae66cf64d2c0de1fac23cd2f1c9463c3b3947e61c031ab9c66e0edc6137 | R | 12,061 | 298 | # Functions to perform the deconvolution analysis
#
# Author: Xuran Wang
#####################################################################################################
#' Estimate cell type proportion with MuSiC and NNLS
#'
#' @param Y vector of bulk tissue expression
#' @param X matrix, Signature matri... |
9328f67ae0fd6e50cc2bd7bd373d512efbd313070115a7b7dde1a29b584de3e7 | R | 12,086 | 468 | # This script generated reference data for olink_normalization using
# OlinkAnalyze v3.8.2. To revert to OA version OA 3.8.2 please use the function
# install_version from the R package remotes and confirm the package version.
# datasets ----
lst_df <- list()
## npx_data1 ----
# npx_data1 does not contain column No... |
22e11d3e6beae388f52020ed2076d6cb516e060b78b4b2c94dbc8aa4aa4ecec9 | R | 12,094 | 352 | rm(list = ls())
# Packages ----
library(dplyr)
# library(Boruta)
# library(ranger)
# library(randomForest)
# tensorflow::install_tensorflow(version = "2.7")
# Load the tensorflow package
# Install the Python TensorFlow backend
# Note: This requires Python to be installed on your system -- tnesorflow only... |
31bc0351f019b8ec779f8150a2becf15d8593cd3328185c1dc9e99938b9fe399 | R | 12,119 | 298 | #' Create hierarchical dataframe for plotting for hierarchical visualization script from Yao et al. (2023) Nature
#'
#' @author Cindy van Velthoven
#'
#' @param cl.df level annotations
#' @param levels hierarchical levels to be visualized
#' @param rootname the name to be given to the center of the plot. Default is "to... |
a30663ae06e1ecb972e6e99257b29fadd90afbb1fa232dfc9dcaf3f0e15b93cd | R | 12,122 | 335 | ##########################################################################
### 7. mapping uncertainties from DNN predictions ------------------------
##########################################################################
library(tidyverse)
library(dplyr)
library(terra)
library(raster)
library(ggplot2)
library(ggd... |
fde83172511097c70d05179770045767551fa5dc3e393938d9f18bad2556b828 | R | 12,147 | 196 | ---
title: "Marker panel generation"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Marker panel generation}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
This vignette demonstrates how to generate an optimal marker gene panel (of length N), and then predicts how well ea... |
98ceb887ce166f4b6844861261e5cd85f405eaecc609b14eea69849f334e0b16 | R | 12,151 | 285 | # predict genes from related traits with different numbers of traits
'%notin%' = Negate('%in%')
library(igraph)
library(tidyverse)
library(pROC)
library(foreach)
library(doParallel)
library(ComplexHeatmap)
library(ggpubr)
source('code/0.networkPropagation.R')
distTraitsMatrix = readRDS('data/distTraits.rds')
trait... |
8a142f90a7f61d814b8594e4d6e74bef172f9ffa7f6e63abac350170e034016c | R | 12,223 | 288 | ## CHyMErA-seq analysis functions
## Author: Steven Dupas
## Description: Functions for CHyMErA-seq analysis, including DEG calculation, enrichment, and plotting.
# Calculate DEGs in clusters using pseudobulk profiles and edgeR
calculate_DEGs <- function(object, target, nt_guide, clusters, guide, de_test = "LRT", min_... |
a84d5e37e7ef04b343b3531ede26738c406166cf9bf4c0d9f3a4f786db7ffe70 | R | 12,259 | 274 | ---
title: "LIGER Plotting & Functionality"
date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`'
output: rmarkdown::html_vignette
theme: united
df_print: kable
vignette: >
%\VignetteIndexEntry{LIGER Plotting & Functionality}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
***
<style>
p.caption ... |
c08e64d005e350b3b4802b7629630ee6183ec05002a6dd9cbfe74dbfd97a62ee | R | 12,286 | 374 | ---
title: "script04_analysis_pca_correlation"
author: "Shamini Ayyadhury"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word docu... |
3d406eacff54b5222583fd06150e3f8e9d2d5fb76b0f850770d61cd483d0958b | R | 12,323 | 274 | # Plot output graphs
plot_model <- function(model, model_type, label_samples, outdir, numCC_clusters = 0){
model_clusters = model[[numCC_clusters]]$consensusClass
model_matrix = model[[numCC_clusters]]$consensusMatrix
sil_model = silhouette(model_clusters, model_matrix)
pdf(paste0(outdir, "silhouet... |
2e95611d9fb4b29c0e73d613349e1021437d668a13653bdadcf77b5b7dd38f22 | R | 12,364 | 217 | #############################################################################
#
# Temporal feature abnormality for Agitated MDD
#
# For this pipeline, we tested the temporal structure among agitated MDD, HC
# and retarded MD, focuing on slow-5 band (0.01 - 0.027 Hz)
#
# The alternative features include:
# ... |
94534ed3097f6f89f0bafa59eb58010d467da7f966b9f7b66d394b3dd92d754d | R | 12,407 | 310 | library(pROC)
data(aSAH)
context("roc.test")
# define variables shared among multiple tests here
roc.test_env <- environment()
test_that("roc.test works", {
roc.test_env$t1 <- roc.test(r.wfns, r.s100b)
roc.test_env$t2 <- roc.test(r.wfns, r.ndka)
roc.test_env$t3 <- roc.test(r.ndka, r.s100b)
expect_is(t1, "hte... |
cd9a12ddddf4448bd09eafb6be2815ca6b4b6ea4bf82313682ef8f69fec24b1d | R | 12,415 | 488 | npx_data_format_oct <- get_example_data("npx_data_format-Oct-2022.rds")
check_log_oct <- check_npx(df = npx_data_format_oct) |>
suppressWarnings() |>
suppressMessages()
npx_data_format <- clean_npx(df = npx_data_format_oct,
check_log = check_log_oct,
verbose... |
2a487163929584312623a8c045f56f406e72a82b2fd0911257371f8ff2de6f1e | R | 12,435 | 409 | ---
title: 'Create MB SHH methylation UMAP'
output:
html_document:
toc: TRUE
toc_float: TRUE
author: Ryan Corbett
date: "2024"
---
Load libraries and set directory paths
```{r}
suppressPackageStartupMessages({
library(tidyverse)
library(umap)
library(ggplot2)
library(devtools)
library(gdata)
library(... |
64e51f04bfd6147b9c5eee18d12c88b6e3184fb8d5e13e6ae64310e69941517b | R | 12,470 | 342 | library(scSeqComm)
library(scrattch.hicat)
library(scrattch.vis)
library(scrattch.io)
library(Matrix)
library(Seurat)
library(dplyr)
library(rhdf5)
library(pbmcapply)
library(OmnipathR)
library(graphite)
library(data.table)
library(corrplot)
library(ComplexHeatmap)
library(stringr)
library(ggplot2)
setwd("/mnt/DD/Sc... |
f9a65ff4cd816205aae3b0ffb925e59245bae152063d92533f67fbe3b6708445 | R | 12,480 | 302 | ---
title: "scRNA-Seq"
author: "Pavel"
output: html_document
---
Load required package
```{r, message=FALSE, warning=FALSE, paged.print=TRUE}
suppressMessages(library("Matrix"))
suppressMessages(library("NormExpression"))
suppressMessages(library("DropletUtils"))
suppressMessages(library("pheatmap"))
suppressMessages(... |
c83b75607e80c4915724b2b677cc9853975f1029c4e95ea587e2698b1bbb2b78 | R | 12,481 | 206 | # This script performs all the statistical testing for the analysis in
# "Anterior cingulate neurons combine outcome monitoring of past decisions
# with ongoing movement signals", by Oesch et al.
#
# The analyses here assume that all the results data frames are saved as .csv
# files into the same file directory (base_d... |
6df77ab3d5a480d81cbda7461a323cecd9ff5b63d23ed8d57e41ec8824fedf0e | R | 12,494 | 399 |
### PACKAGES TO LOAD
###------------------------------------------------------------------####
library(ggplot2)
library(colorspace)
library(tidyr)
library(dplyr)
library(ggpubr)
#library(ggrepel)
library(effectsize)
library(ggthemes)
#library(scales)
library(forcats)
library(PCAtools) ### note this version 2.6.0 re... |
50fd9124ba30f696ada8e2e82ba39fa9f5d9945cb7b2cec4b6382558e488b9d8 | R | 12,507 | 315 | ########################### Unit test: Screening ################
#
# Objective: Run unit tests for screening evaluation
########################### <<<<<>>>>> ##############################################
rm(list = ls()) # Clean environment
options(scipen = 999) # View data without scientific notation
#### 1.Li... |
3aadc0c59699ac0c32be45454870050ec8243a9fb8adb27de9f3028b64cc8e02 | R | 12,538 | 445 | #' Help function to read `r ansi_collapse_quot(get_olink_data_types())` data
#' from zip-compressed Olink software output files in R.
#'
#' @description
#' A zip-compressed input file might contain a file from the Olink software
#' containing `r ansi_collapse_quot(get_olink_data_types())` data, a checksum
#' file and o... |
a78f3f4a2a2e75a6ead65c85bc374b65ef3072e7301ce5e80eba9b5b82c0c748 | R | 12,539 | 268 | #' Ensembl Mito IDs
#'
#' A list of ensembl ids for mitochondrial genes (Ensembl version 112; 4/29/2024)
#'
#' @format A list of six vectors
#' \describe{
#' \item{Mus_musculus_mito_ensembl}{Ensembl IDs for mouse mitochondrial genes}
#' \item{Homo_sapiens_mito_ensembl}{Ensembl IDs for human mitochondrial genes}
#' ... |
31cd2aa6ac23f32ad12e8b4fcc0e6467a1396eaf568a8b4b4d658e50ddbbc517 | R | 12,556 | 295 | library( ANTsR )
library( ggplot2 )
library( randomForest )
library( ggplot2 )
nPermutations <- 500
trainingPortions <- c( 0.8 )
doCombined <- TRUE
source( "./geom_split_violin.R" )
resultsData <- data.frame( DataSet = character( 0 ), Pipeline = character( 0 ), RMSE = numeric( 0 ) )
count <- 1
dataSets <- c( "SRPB... |
8a06fdbd087329a0d920eddc204ab4c4a192ed0124922855ae5faf06345a6f58 | R | 12,614 | 320 | ###############################################
# summarize_eGene_overlap.R
# Summarize how eGenes appear in filtered DE results
# Inputs:
# - unqiue-eGene.txt one Gene ID per line
# - DE_all_outputs_subsetNorm_allpairs/Filtered_genes_p0.05_FC1.5/
# LR_by_comparison/*.tsv
# WH_by_comparison... |
e8675a7c482ed7f45d8c15690ee9bc514ebbe74f3e076f826fd6ecc68de179d2 | R | 12,642 | 260 | library("tidyverse")
library("data.table")
library(openxlsx)
layerCols <- c(
"L1" ="#8D405C",
"L23"= "#E7BDE1",
"L4"= "#CF8CA4",
"L5"= "#9F6E80",
"L6"= "#CDADB9",
"WM"= "#67A9D8")
apoeColors <- c("E3"="#2367AC",
"E4"="#B21F2C")
## The following codes will be used to create a dotplot of ... |
ca52acde67a286dbd5e02ec624cd751af784b6ee1dd9cd7264fd7e5496d7ba84 | R | 12,648 | 297 | options(Seurat.object.assay.version = "v3") # use old Seurat object version
library(Seurat)
library(ggplot2)
library(rstatix)
library(ggpubr)
library(gridExtra)
library(cowplot)
library(ggridges)
set.seed(123) # For reproducibility
color_palette_cluster <- c("DaN1" = "#0072B2",
"DaN2" = "#5... |
9eb47f433668d8bf43166bedccd9c48d65fe2657419578b465bcd9f495a0b047 | R | 12,686 | 297 | ---
title: "Figure3_CG"
author: "MM"
date: "2025-02-05"
output: html_document
---
```{r setup, include=FALSE}
options(future.globals.maxSize = 10000 * 1024^2)
library(Seurat)
library(harmony)
library(dplyr)
library(scCustomize)
library(tidyr)
library(ggplot2)
library(ggpubr)
library(Nebulosa)
library... |
6d835fc21f7fbbdff12126f26551609ba7ae149d80219ba261d17898e563305e | R | 12,691 | 359 | # --------------------
# title: FigureS11 Code
# author: Hu Zheng
# date: 2026-01-01
# --------------------
library(Seurat)
library(tidyverse)
library(hdWGCNA)
library(cowplot)
library(patchwork)
library(enrichR)
library(GeneOverlap)
library(umap)
library(scCustomize)
library(ggpointdensity)
library(Biorplot)
source(... |
7b428d588fb8226293ce1e0225f821d68bd2d0c399edce92f780984bc9e25411 | R | 12,709 | 261 | ---
title: "Read & Write Data Functions"
date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`'
output: rmarkdown::html_vignette
theme: united
df_print: kable
vignette: >
%\VignetteIndexEntry{Read & Write Data Functions}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
***
<style>
p.caption {
fo... |
5736e121e2f4a7f6d96ea0dab432ac9905633f2fe248a504bf7d31a8fe4c2f14 | R | 12,710 | 324 | ########################### Internal Validation #########################################
#
# Objective: Validate BayCANN posteriors by plotting fit of calibration outputs
########################### <<<<<>>>>> ##############################################
rm(list = ls()) # Clean environment
options(scipen = 999) ... |
ef05d1ee809df6f00b6bafeb705b1ac40cd05b0608e7ef9e441faa7b0bedb1b2 | R | 12,806 | 467 | ---
title: "MotiMus Questionnaire Data"
Me: Ségolène M. R. Guérin
output:
html_notebook:
code_folding: hide
toc: yes
pdf_document:
toc: yes
html_document:
toc: yes
word_document:
toc: yes
editor_options:
markdown:
wrap: sentence
---
# Preamble
```{r preamble, warning=FALSE, message=F... |
13d4bf5d32db8cbe0ae4e52845ce7e43e9611b0f64d92911db10cb2768cac262 | R | 12,808 | 421 | if (!requireNamespace("here", quietly = TRUE)) install.packages("here")
source(here::here("stats","learning_models","_setup.R"))
# Select data and recode for model fitting
scr_acq <- scr_df %>%
filter(PHASE == "acquisition" & TUS == "active") %>%
mutate(
US = ifelse(US == "reinforced", 1, ifelse(US == "unreinf... |
d56def218cb32042cd9109ec3e0858f7004bad2e3b2782371cba19286ceb1e7d | R | 12,808 | 304 |
# Load necessary library
library(ggplot2)
library(RColorBrewer)
library(patchwork)
library(VennDiagram)
library(dplyr)
library(VennDiagram)
library(grid)
# Assuming your dataframe is named 'df'
# Count the number of metabolites in each Super_pathway
df<-read.csv("~/DATA overview/cheminfor.csv")
# Assuming your dataf... |
f990eac48b179260bce5a7c31f741282e4619bcb555bbf03d8f9b9dcd579e0f1 | R | 12,842 | 284 |
##################################################################
## Functions to do dimensionality reduction on the MOFA factors ##
##################################################################
#' @title Run t-SNE on the MOFA factors
#' @name run_tsne
#' @param object a trained \code{\link{MOFA}} object.
#' @p... |
cd112bf45c821dea13999c07eefcf8a5b2061f3b80237f8d2d421e9b70b7e7cb | R | 12,858 | 274 | library(dplyr)
library(circlize)
library(ggh4x)
library(data.table)
library(stringr)
library(grid)
library(ComplexHeatmap)
library(ggplot2)
library(ggplotify)
library(cowplot)
source("../Plot_theme.R")
# Load color scheme
colors <- fread("../Plotting/colors.csv", strip.white = F)
color_v <- colors$Color
names(color_v)... |
c7f80a99fe501fbe3f78adb36a0501d115583c99bfc0c5b33c8267ca28a78908 | R | 12,865 | 215 | #############################################################################
#
# Temporal feature abnormality for Agitated MDD
#
# For this pipeline, we tested the temporal structure among agitated MDD, HC
# and retarded MD, focuing on typical band (0.01 - 0.08 Hz)
#
# The alternative features include:
# ... |
63fb4c33b1dbd56e3ae7d80ceb81f714e1971bee1bdc474d1104fbee8e97d13c | R | 12,907 | 243 | # independent-rna-samples.R
#' Generate a vector of unique rna samples
#'
#' The samples from this function will be unique with respect to participants
#' i.e. only no two samples will come from the same participant. The input list
#' should be pre-filtered by `composition` and `sample_type`.
#'
#'
#' @param ind... |
065f5726dd695fb8e11c9f90fd8ac279cb45b7e3c0bd62ce8119aff5e6228821 | R | 12,964 | 240 | #' Disjoin overlapping PAF alignments.
#'
#' This function takes loaded PAF alignments using \code{\link{readPaf}} function and identify overlapping
#' genomic ranges either in target or query coordinates and then split PAF alignments at the positions of
#' these overlaps into a disjoined set of genomic ranges. Alterna... |
e40fbc938532bc3691202172a895726664f3bf3f25ffa89b6aedd544908ee442 | R | 12,971 | 228 | #' Function to lift coordinates to the alignment in PAF format.
#'
#' @param gr A \code{\link{GRanges-class}} object containing single or multiple ranges in query or target sequence coordinates.
#' @param direction One of the possible, lift ranges from query to target 'query2target' or vice versa 'target2query'.
#' @pa... |
287b1b5249ee20852a8e1e96fbd8fd86001a5315adba48f544ad98f0f34e1858 | R | 12,979 | 453 | ---
title: "ADNI"
output:
html_document:
highlight: pygments
theme: yeti
toc: true
number_sections: true
df_print: paged
code_download: false
toc_float:
collapsed: yes
toc_depth: 3
editor_options:
chunk_output_type: inline
---
```{r setup, include=FALSE}
knitr::opts_chunk$s... |
4c2b74b70b68fdaec697fb00017253a2769fbd673c3f46d20b3552ab84e6bc8e | R | 13,042 | 202 | library(pROC)
data(aSAH)
context("auc")
test_that("full auc works", {
expect_equal(as.numeric(auc(r.wfns)), 0.823678861788618)
expect_equal(as.numeric(auc(r.wfns.percent)), 82.3678861788618)
expect_equal(as.numeric(auc(r.ndka)), 0.611957994579946)
expect_equal(as.numeric(auc(r.ndka.percent)), 61.195799457994... |
9f9dc4b33282a965d336a0ad939ee7f479873ce34a9b0b6388f091d6a57db6be | R | 13,052 | 256 | ##' richplot
##' @description plot the sigificant terms and shared genes with network format
##' @importFrom igraph graph_from_data_frame
##' @importFrom igraph simplify
##' @importFrom igraph V
##' @importFrom igraph V<-
##' @importFrom igraph degree
##' @importFrom ggplot2 geom_text
##' @param object richResult or da... |
726ca309d63c94f5b94148887f076bf434efe3413c374498341fb70ecd00b6b2 | R | 13,063 | 356 | #' Function which plots boxplots of selected variables
#'
#' @description
#' Generates faceted boxplots of NPX vs. grouping variable(s) for a given list
#' of proteins (OlinkIDs) using ggplot2::ggplot and ggplot2::geom_boxplot.
#'
#' @param df NPX data frame in long format with at least protein name (Assay),
#' OlinkI... |
4639e80f65d3cf31ce4ca7b61b36b8ab6c632b3db33bec57e01c0631753778d8 | R | 13,084 | 326 | setwd('/media/user/disk21/completeAnalysis/')
meta = read.table('cellbrowser/scRNA-Seq/meta1.tsv', row.names = 1, header = T, sep = '\t')
num = which(meta$tissue_histology %in% c('core:GBM', 'peri:GBM'))
m1 = meta[num, ]
meta$orig.ident = gsub('SNU34citeseq', 'SNU34', meta$orig.ident)
num = which(m1$orig.ident %in%... |
4741b57c75423822d1702a2c8401bcc666d8c20caeddda448ed2153e207d9bb7 | R | 13,136 | 306 | ## helper functions for constructing canlabtools matlab calls used by targets ----
canlabtools_apply_wb_signature <- function (out_path,
niftis = NULL,
fmri_data = NULL,
pattern_subdir = ... |
bd56de992941a2b4489a383eb3cb85a59b0947ceaaf3c422e746977adc34ca99 | R | 13,238 | 264 | #' MRlap - main function
#'
#' Performs cross-trait LD score regression, IVW-MR analysis and provide a correction
#' that simultaneously accounts for biases due to the overlap between the exposure and
#' outcome samples, the use of weak instruments and Winner’s curse.
#'
#'
#' @param exposure The path to the file conta... |
d78de139316c97711a919e4f980e3669655bc066d8bf9baa42f61f0b7434be08 | R | 13,260 | 369 | # Analysis b) an increased PAD is associated with decreased cognition at baseline
# Load required libraries
library(readxl)
library(writexl)
library(here)
library(stats)
library(dplyr)
library(lgr)
library(data.table)
library(ppcor)
library(LMMstar)
# Function to create structured log entry with multi-line content
log... |
a174cb72a9bb1a6f1afe60fe21d9e52adfc72dbf54249338c03e041a366c4166 | R | 13,265 | 390 | ---
title: "Generate Fusion Summary Files"
output: html_notebook
author: Daniel Miller (D3b), Jaclyn Taroni (CCDL), Jo Lynne Rokita (D3b)
date: 2020, 2023
params:
ci_run:
label: "1/0 to run in CI"
value: 1
input: integer
editor_options:
chunk_output_type: inline
---
Generate fusion files specifically ... |
c8afccd88370d29d9339b4a6eedcecf8a8443bf6704dc21a7f478af339a94cec | R | 13,288 | 393 | ### analysis nuclear intensities single channel with different thresholds
# go to main directory (parent directory of scripts)
if (basename(getwd())== "00_scripts"){setwd("../.")}
#load packages
library("tidyverse")
library(colorRamps)
library(lmerTest)
#define working directories
in_dir = "./04_inte... |
65bd4a6a3542491ec203b58daceeeac803072d88439dded2a1790bb596452971 | R | 13,307 | 587 | ---
title: "Profile_Matrix_Subset_Regions"
author: "Thomas Goralski"
date: '2022-06-21'
output: html_document
---
```{r}
library(rhdf5)
library(Matrix)
library(data.table)
```
```{r}
h5ls("expression_matrix.hdf5")
```
```{r}
h5closeAll()
```
```{r}
h5read("expression_matrix.hdf... |
0ff27cb93e6163c5355dfac7a393c73dffbe405dbed9f91ca0c633feba6bdede | R | 13,309 | 446 | #' barplots_dist_to_tss
#'
#' Display barplot of deltabetas distribution around TSS
#'
#' @param dmps data.frame of dmps
#' @param bin size of bin
#'
#' @return plot
#'
#' @importFrom ggplot2 ggplot aes geom_bar geom_hline labs
#' @importFrom ggplot2 theme_minimal scale_x_discrete theme theme_minimal element_text
#' @i... |
8cd45090f4a15c03197430db5386d68bd5d290691bbec177bf3e9b548a7fb973 | R | 13,312 | 271 | # Create Pediatric OpenTargets methylation summary table that will be utilized
# with OPenPedCan plotting API and displayed on the NCI MTP portal
# Eric Wafula for Pediatric OpenTargets
# 10/22/2022
# Load libraries
suppressPackageStartupMessages(library(optparse))
suppressPackageStartupMessages(library(dbplyr))
supp... |
abd2033ee5fa39ffb982683f53b0a30532c0614ecdd1c333a40eed211dd10c88 | R | 13,351 | 484 | #' Template Rendering Utilities
#'
#' Internal functions for loading and rendering .qmd templates with parameter substitution.
#'
#' @keywords internal
#' Load Template File
#'
#' Read a template file from inst/templates/
#'
#' @param template_name Character. Name of template file (with .template extension).
#'
#' @re... |
fed2e9df943d8f4b9d5547bc6e59316eb8def541f01944e78ff66ba30131ba96 | R | 13,361 | 477 | #' Calculate LOD using Negative Controls or Fixed LOD
#'
#' @inherit .downstream_fun_args params
#' @param data npx data file
#' @param lod_file_path location of lod file from Olink. Only needed if
#' lod_method = "FixedLOD" or "Both". Default `NULL`.
#' @param lod_method method for calculating LOD using either "FixedL... |
019426b435e878cd85405c897d2ce88496464331b2909a79c937285fcf81377b | R | 13,364 | 351 |
################################
## Functions to do subsetting ##
################################
#' @title Subset groups
#' @name subset_groups
#' @description Method to subset (or sort) groups
#' @param object a \code{\link{MOFA}} object.
#' @param groups character vector with the groups names, numeric vector with... |
0c2f46a0bf70f9aaccd12ec7047a1e69cc4adcad6f56483cfaebe3da75436c94 | R | 13,378 | 441 | ---
title: "Forced Response analysis"
author: "Marcos Moreno Verdú"
date: "2024-04-05"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load packages and data
Packages
```{r include = FALSE}
library(tidyverse)
library(modelsummary)
library(ggdist)
the... |
2cdfa971686e36338148e78b1bacc3f8ff94e9a2e90448f78a0e30e582709f9f | R | 13,411 | 290 | #######################################
## Functions to train a MOFA model ##
#######################################
#' @title Train a MOFA model
#' @name run_mofa
#' @description Function to train an untrained \code{\link{MOFA}} object.
#' @details This function is called once a MOFA object has been prepared (using ... |
8ffabcf8e8b9f18e0b27c3e74d5571d892f3e5590efda2e08041265db641e937 | R | 13,439 | 413 | # Genomic Prediction for Winter Wheat - Within Environment G×E Analysis
# Prediction Type: WTN (Within environments)
# Models: 6 different G×E models with modular ETA components
# Cross-validation: CV3 scenario (genotype-environment combinations)
# Load required packages
library(BGLR)
library(qs)
library(dplyr)
librar... |
2f0ab2ffd259816479c80ed82b9b213b654a19ad1653e2bf8edf6849724ea330 | R | 13,443 | 274 | prep_lme_scr_dfs <- function() {
# Remove previously derived scr_df_* objects (keep raw scr_df)
to_delete <- setdiff(ls(pattern = "^scr_df", envir = .GlobalEnv), "scr_df")
if (length(to_delete)) rm(list = to_delete, envir = .GlobalEnv)
# Snapshot BEFORE creating derived data frames
.before <- ls(envir = .GlobalEnv)
... |
e10bf81180a2606d6a75f6263adaf51e6d94186727f6e1eadd7bf161694f5046 | R | 13,463 | 349 | ###############################################
# Whole-cortex DE analysis with per-contrast
# subset filtering and normalization
# - Paired design by donor
# - Adjust covariates only if they vary within donor
# - Two comparison types:
# 1) Left vs Right within the same BA
# 2) All BA pairwise contrasts within the ... |
a765dd041d86a0365ce89605f8714a18aa25e78fd02d8dce26a7bb59b5dce864 | R | 13,473 | 284 | ---
title: "Plotting #2: QC Plots & Analysis"
date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`'
output: rmarkdown::html_vignette
theme: united
df_print: kable
vignette: >
%\VignetteIndexEntry{Plotting #2: QC Plots & Analysis}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
***
<style>
p.capt... |
d03ed9be5a43ff018bcfbca9114431aeef0ca52f2844d66026392a9b173381be | R | 13,473 | 404 | # Stephanie J. Spielman for CCDL, 2022
# This script creates three S3 panels:
# CN status heatmap
# CNV breaks across chromothripsis regions box/jitter plot
# SV breaks across chromothripsis regions box/jitter plot
## Load libraries ------------------------
library(tidyverse)
library(ComplexHeatmap)
# set seed f... |
38ea8cce52b7f0aa6f895c755b0d79ca6afc55dcabed51f4b1ac6d7892ac47c5 | R | 13,510 | 431 | ---
title: "Comparing counts across different stages of the Neuronal differentiation"
author: "AF"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(dplyr)
library(ggplot2)
library(rstudioapi)
library(clusterProfiler)
library(reshape2)
l... |
cc1643d9927ae7f98fa9b346ce66d9992a0b74f2abf4dc51b719b050c7e3c670 | R | 13,512 | 592 | ---
title: "Profile_Matrix_Subset_Regions"
author: "Thomas Goralski"
date: '2022-06-21'
output: html_document
---
```{r}
library(rhdf5)
library(Matrix)
library(data.table)
```
```{r}
h5ls("expression_matrix.hdf5")
```
```{r}
h5closeAll()
```
```{r}
h5read("expression_matrix.hdf... |
3f3d0544621dced7b209a85266eed189a2a173e919a4a11abf0bf4d6106300f0 | R | 13,535 | 240 | ---
title: "`r params$project`"
subtitle: "Single Cell RNA-seq - QC"
date: "`r Sys.Date()`"
output:
html_document:
lightbox: true
toc: false
toc_float:
collapsed: false
toc_depth: 3
fig_width: 8
fig_height: 5
number_sections: false
params:
project: Project
seuratdir: directory
... |
197853d7113d336471e3defcf4d02197a139a46e4b1cdef94fea14d1827396f0 | R | 13,558 | 343 | # Meta-analysis of scRNA-seq data of E14 Neocortex - Part 1 : QC ---------------------
# Rahul Jose
# SCB, RGCB
# October 2024
# Primary Aim :
# For the identification of NIHes1 and NDHes1 cells from Neocortex single cell data,
# Identifying PCA based clusters in scRNA-seq data from Loo, L., Simon, J.M., Xing... |
931ace7e89418c9ea96d042a38d9b55e84b2b99774283b46a49a09bcfc9cba51 | R | 13,567 | 500 | ---
title: "SBS Mutational Signatures Analysis"
output:
html_notebook:
toc: TRUE
toc_float: TRUE
author: Ryan Corbett (adapted from C. Savonen for ALSF CCDL)
date: 2022
params:
snv_file: ""
output_Folder: ""
---
**Purpose:**
Calculate and plot mutational signatures for all samples using [COSMIC signatu... |
24ead3e4aecb77feeac428cb546d9ad2b7933f4f713abf7c8d9d9af3b9bba714 | R | 13,579 | 294 | ---
title: "MOFA+: stochastic inference"
author:
name: "Ricard Argelaguet"
affiliation: "European Bioinformatics Institute, Cambridge, UK"
email: "ricard@ebi.ac.uk"
date: "`r Sys.Date()`"
output:
BiocStyle::html_document:
toc_float: true
vignette: >
%\VignetteIndexEntry{MOFA2: Doing stochastic inference ... |
fc6af68c2383f690a230cf7fac23f2b8fd5f0aa553b46e95a2378ce44aeb9e89 | R | 13,622 | 351 | # ==============================================================================
# S8_network.R
# Server logic for Step 5: Network Analysis
# Builds correlation networks between DEGs and DAMs for treatment vs control groups.
# ==============================================================================
# -----... |
5545e1464ff8b7f81100be48e0e363e8687595a17a00a4446fc1eada164728cf | R | 13,631 | 268 | # Authors: Komal S. Rathi, Jo Lynne Rokita
# Script to gather relevant data for EPN subtyping
# Load libraries
suppressPackageStartupMessages({
library(tidyverse)
library(readr)
library(data.table)
library(optparse)
})
# Define options
option_list <- list(
make_option(c("--disease_group_file"), type = "char... |
9a7faffa1d20addb37ca2d7dbaa66b1df6180c1f2958ffad03eaf15ce4cc9cf8 | R | 13,680 | 362 | # Format SV and CNV data into chromosomal breakpoint data
#
# C. Savonen for ALSF - CCDL
#
# 2020
#
# Code adapted from [svcnvplus](https://github.com/gonzolgarcia/svcnvplus).
#
# Option descriptions
# --cnv_seg: File path to CNV segment file to be used for breakpoint
# calculations.
# --sv: File path to SV ... |
35e110c6a40d5271fec4b60efe302b460943b2238075c29f36da9b74c77196a3 | R | 13,688 | 438 |
# Function to find "intercept" factors
# .detectInterceptFactors <- function(object, cor_threshold = 0.75) {
#
# # Sanity checks
# if (!is(object, "MOFAmodel")) stop("'object' has to be an instance of MOFAmodel")
#
# # Fetch data
# data <- getTrainData(object)
# factors <- getfactors_names(object)
# ... |
5939816e397fa3976c5bf97e5eb1dab044cae1f6984d093110162baac0278c12 | R | 13,706 | 309 | ################################################################################
# Script to perform multiple regression (lm) and linear mixed modeling (lmer)
# on MIND networks
################################################################################
# Copyright (C) 2026 University of Seville
#
# Wr... |
df91edbae829c476c0aace16a09516e284c246f2952b62d8b9d743fc0d07642c | R | 13,734 | 424 | library(shiny)
library(shinyjs)
library(shinycssloaders)
library(glue)
# Mouse and gene names with proper formatting.
mouse <- paste0("C57BL/6JSetbp1", tags$sup("em2Lutzy"), "/J")
mouse_gene <- paste0(em("Setbp1"), tags$sup("S858R"))
human_gene <- em("SETBP1")
hrnpa2b1_gene <- em("Hnrnpa2b1")
# External links used th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.