sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
1554e30f6c7b011bb0524df54833964ee206c5ec1d58a10de5925708e928f22f | R | 9,296 | 155 | library(ggplot2)
library(hrbrthemes)
library(gridExtra)
library(igraph)
library(psf)
### loading unprocessed kgml files
kegg_collection_unporecessed <- generate.kegg.collection.from.kgml(list.files(system.file("extdata", "kgmls", package="psf"), full.names = T), sink.nodes = T)
### loading curated networks
load(syste... |
fa28150a07d55fe5c99d721b616df999012a54f25fae3a6a41fb60d29b0fae56 | R | 9,362 | 276 | # =======================================================================================
# Purpose: Integration of scRNA-seq and spatial proteomics of the E9 chick cerebellum
# Author: James Li
# Date: July 30, 2024
#
library(Seurat);library(tidyverse)
library(SeuratWrappers);library(harmony)
# Load spatial CycIF... |
e71d6062435f757193ddc232b79108a3c5723d1e56f7ceba3daac35c7ec81211 | R | 9,368 | 183 | #' @import ggplot
#' @importFrom table1 table1
#' @importFrom VIM aggr
meta_regroup_str <- function(data,new_col_id='new_col',col_str,keep_col,regroup=F,silent=F){
deposit <- list()
data_unite <- data[col_str]
data_unite <- na.omit(data_unite)
col_combie <- as.character(apply(data_unite, 1, function(m){pas... |
3c84a05dffd60c97e5f8d9528051d5a4e25e0a67f9c679af1d059bddb142d632 | R | 9,432 | 146 | ---
title: "Jointly Defining Cell Types from Single-Cell Gene Expression and Methylation Data Using LIGER"
author: "Joshua Welch"
date: "4/19/2023"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE, results = "hide")
```
## Introduction
This... |
6a000a8f64253d76804b7675fb88a0b865c641232facb5d15dad71436fd18f35 | R | 9,503 | 190 | ---
title: "Integrating STARmap spatial transcriptomic and scRNA datasets using UINMF"
author: "April Kriebel and Joshua Welch"
date: "12/03/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
library(rgl)
options(rgl.useNULL = TRUE)
knitr::k... |
5b7a80526adb1f2e9dd59dfbc633fc9c5694f0826b74d5f58fd0ab1625ddc547 | R | 9,548 | 246 | ---
title: "S8bc"
output:
workflowr::wflow_html:
toc: false
editor_options:
chunk_output_type: console
---
```{r}
library(dplyr)
library(devtools)
library(tidyverse)
library(data.table)
library(here)
library(readxl)
library(ggpubr)
library(cowplot)
```
```{r MCCC1, echo=FALSE, fig.width=5, fig.height=4, dev... |
3d918054450be43084ff204f13a41371b2934bc4e02ba1c076df4ae0df3221e1 | R | 9,574 | 131 | # DatasetNames is a vector of strings of dataset names. BroadClusterTypes is a vector of cell types. CommonGenes is a vector of genes held in common with all datasets.
# PresenceofDataTable is a table detailing whether a cell type has data for each cell type.
# This code requires the user to have files named DatasetNam... |
c1042affc099bcede9a165b8cb092c94102407165790f85b4fab2134e5710354 | R | 9,618 | 236 | setwd("working/directory")
library(PheWAS)
library(data.table)
library(RColorBrewer)
library(wpa)
'%ni%' <- Negate('%in%')
options(ggrepel.max.overlaps = Inf)
# PheWAS is done by SPAtest, and corrects for age, sex, batch, and top 10 PCs.
# Any phenotype with case # <10 is censored and not run.
# It is done in unrela... |
56f98ff4235adfd1f052e61ae70a0237fcc5bbdb17abd17df7288574c30d9f75 | R | 9,835 | 249 | color_code <- function(values, pal1, pal2, log_scale = TRUE) {
if(log_scale) {
center_val <- 0
} else {
center_val <- 1
}
if(all(values > center_val)) {
calc_colors <- pal2(10)[cut(values[which(values > center_val)],10)]
} else {
if(all(values <= center_val)) {
calc_colors <- pal1(... |
2ad6f64c407dfc616fe396687ac7fc7d95ea2542f8953a2e4d13aa5adb0d9b77 | R | 9,864 | 263 | ###### MVCM estimators, adapted from MATLAB code ######
# Author: Shengxian (Naomi) Ding
# Email: naomidsx@gmail.com
# Date: 2025-07-19
MVCM_lpks_bw0 <- function(Coord) {
L <- dim(Coord)[1]
d <- dim(Coord)[2]
h_opt <- rep(0, d)
for (dii in 1:d) {
dm <- rep(0, L)
for (Lii ... |
71b1bbb7f18264b83ad5e0c23703c4364e2ff01128d23a879496b414737c6939 | R | 9,879 | 274 | ---
title: "Distribution of DELFI multi-modal scores by stage and histology"
site: workflowr::wflow_site
output:
workflowr::wflow_html:
code_folding: hide
toc: true
editor_options:
chunk_output_type: console
---
```{r caching, echo=FALSE}
knitr::opts_chunk$set(autodep = TRUE, echo=FALSE)
```
# Extended F... |
6cb341e3681a82aff9afa5364a9e028fc334fc183b3d6e61d604404b46eeacbe | R | 9,881 | 139 | # DatasetNames is a vector of strings of dataset names. BroadClusterTypes is a vector of cell types. CommonGenes is a vector of genes held in common with all datasets.
# PresenceofDataTable is a table detailing whether a cell type has data for each cell type.
# This code requires the user to have files named DatasetNam... |
4774bcafc17c5533e32e16e256c7d60fe2a36fa1b36f976addaab03c72668e82 | R | 9,973 | 210 | library(Seurat);library(tidyverse)
# Refine PC annotation using subclustering
cdS <- readRDS("../cdS_No31.rds")
# correct the slice name of one sample
cdS$ID2 = paste(cdS$orig.ident, cdS$sample, sep = "_")
cdS$ID2 = gsub("X","", cdS$ID2)
cdS$ID2 = gsub("TR","P", cdS$ID2)
Idents(cdS) <- "res1"
cdS <- RenameIdents(cdS,... |
65626a63f162faf322203698b0dd555556d6d455006d78e66cbc32e3e929a18c | R | 10,049 | 281 | # Compute the summary report for different CN detected in the single line analysis
# find the centromere position
# filter out CN of poor quality
# Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de
suppressPackageStartupMessages(library(argparse))
##############################
suppressPackageStartupM... |
9f025b19ec5372c192efcd08f9ad9cdd9b9288dd9b931a46d2133d5e4cf2924f | R | 10,051 | 230 | .cbind.ligerDataset.mem <- function(args) {
# TODO: Now by default merging the three slots
# NEED TO add checks on existence and think about adding NA if any slot is
# missing for one dataset
libraryNames <- NULL
if (!is.null(names(args))) libraryNames <- names(args)
if (any(is.na(libraryNames))... |
1b0c38eb8bc0e1675a595466bfa83ef1652545103477ba9e252df4900ecc7bcb | R | 10,111 | 244 | ---
title: "Fig 2c"
site: workflowr::wflow_site
output: html_document
chunk_output_type: console
---
```{r packages, echo=FALSE, message=FALSE, warning=FALSE}
library(tidyverse)
library(caret)
library(recipes)
library(pROC)
library(devtools)
library(reshape2)
library(plyr)
library(gridExtra)
library(grid)
library(h... |
853d4a6c46dc45f2870f64820b36ab84b5afe03ff0a7b6a22ee47c39a080563c | R | 10,122 | 286 | #!/apps/R/gnu/9.1/3.6.3/bin/Rscript
setwd("/filepath")
library(ggpubr)
library(tidyverse)
library(ggplot2)
library(lemon)
library(scales)
library(RColorBrewer)
library(ggrepel)
library(ggpmisc)
library(ggseqlogo)
library(rstatix)
library(ggdist)
library(readr)
library(DESeq2)
library(stringr)
##### Deseq2 and PCA ana... |
ac6dfd5757b742a81117c247de018f45b3cb11398c9a56272f13c5a6a30b9aa8 | R | 10,257 | 257 | # selectGeneGlobalRank <- function(
# object,
# n = 4000,
# alpha = 0.99,
# useDatasets = NULL,
# unsharedDatasets = NULL,
# chunk = 1000,
# verbose = getOption("ligerVerbose")
# ) {
# .checkObjVersion(object)
# # A bunch of input checks at first ####
# ... |
04973ee7d66b12aee02616fa0b2425e411002884e14f2eb3fc9ac79916067efc | R | 10,343 | 198 | #' Calculates psf for given kegg pathway based on expression matrix and generates pdf report with colored pathways and plots
#' @param kegg_collection list of kegg pathways
#' @param exp_matrix expression fold change matrix with gene entrez id rownames
#' @param folder_name name of the folder where pdf report(s) will b... |
b2a706d7262a6d98a0114512d4cea8a3dc3b90460f16a33266092286d9db8a66 | R | 10,391 | 239 | ---
title: "Get started"
author: "Fulong Yu"
date: "<h4>Vignette updated: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>"
output:
BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{SCAVENGE}
%\usepackage[utf8]{inputenc}
%\VignetteEngine{knitr::rmarkdown}
---
## Overview
This vignette covers the ... |
650d8cae5a48b9b795f0ababecf1af22638bd71ecfd4a8cffc22cd8c8808dc76 | R | 10,396 | 235 | library(Seurat)
library(tidyverse)
# require(biomaRt)
# chicken <- useMart('ensembl', dataset = 'ggallus_gene_ensembl', host="https://useast.ensembl.org")
# mouse <- useMart('ensembl', dataset = 'mmusculus_gene_ensembl', host="https://useast.ensembl.org")
# annot_table <- getLDS(
# mart = mouse,
# attributes = c('... |
8c9e5bf45e93d6604562cb18d763681cbb4c00365c2923b9c7251eb0febfc70c | R | 10,420 | 271 | # Compute the heatmap for the GT match and update the annotation file with the GT match
# Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de
suppressPackageStartupMessages(library(argparse))
suppressPackageStartupMessages(library('ComplexHeatmap'))
suppressPackageStartupMessages(library('RColorBrewer'))... |
d61a514556a17cbb1177cfed1ea0f500b47590e8d044ef7df63b43eeaa774ff5 | R | 10,440 | 284 | library('signs')
library('Cairo')
library('viridis')
library('RcppAlgos')
library('stats')
library('RColorBrewer')
# a function to adjust exon coordinates for each mRNA
adjust_exons <- function(exons_group, l_max = 2000) {
mRNA_name <- exons_group$name[1]
total_length <- sum(width(exons_group))
if (total_length <... |
8fec872dd37f02153efb040e219feb3024f3c8e078786765324252b2535e7275 | R | 10,500 | 268 | library('tidyverse')
library('ggplot2')
library('Cairo')
library('RcppAlgos')
library('RColorBrewer')
library('viridis')
library('signs', quietly = T)
custom.breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) {
bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits)
bmax = ceiling(bmax * (10 ^ digits... |
a8f48cea69b6a8b53c40365cf778194ee07e7c6c28b0f323a726612679e486cc | R | 10,510 | 261 | library(ggplot2)
library(ggpubr)
setwd(".../codes revised/reproducibility/output from the server/real_data") # revise this as needed
myfiles = readRDS("fx_kfilter_nomatch400.rds")
#do analysis for mean bag
output_i<-myfiles$output_i
output_i_filter<-output_i[names(output_i)[-c(4:6)]]
output_b_all_cali<-myfiles$outpu... |
3c6ba1e6c610fbcb6d1743c276904a3a38dee613de4f0ca4fee098bb9b274176 | R | 10,548 | 176 | ---
title: "Iterative single-cell multi-omic integration using online learning"
author: "Chao Gao and Joshua Welch"
date: "9/7/2021"
output:
html_document: default
pdf_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE, results = "hide")
```
## Lo... |
7fbe6d233f28b8781ee3202cdc9ec6ba1c2cadad7028dd251b075604be3aa91e | R | 10,609 | 212 | library(Seurat);library(tidyverse)
# reload data
cdS <- readRDS("data/integrated_all.rds")
cdS = readRDS("/Volumes/SSD_JamesLi/Experiments1/Multiplexed/Integrated_all/data/integrated_all.rds")
metaDD <- cdS@meta.data
# remove the posterior-most sections and cell clusters of imaging artifacts
# we also removed midbra... |
c31379afc3eab2e11e904435cafd934f9d652733782b8e2b80a8dd58f4a039a0 | R | 10,622 | 293 | ---
title: "External validation"
site: workflowr::wflow_site
output:
workflowr::wflow_html:
toc: true
editor_options:
chunk_output_type: console
---
# ROCs
```{r load_data, echo=FALSE, include=FALSE}
library(devtools)
library(data.table)
library(caret)
library(recipes)
library(magrittr)
library(tidyr)
library(... |
31dab2e96b028d058b615d7db555e302667e8207128d8bca2705c320dac7220b | R | 10,648 | 180 | ---
title: "Using LIGER to integrate datasets stored in Seurat objects"
author: "Yichen Wang"
date: "2024-03-11"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
```
## Goal of this article
We have introduced the basic usage of LIGER throughou... |
499d9b1438cf22b4ae267b718742282de8c4f34dfa0f579bea588b6cf648159c | R | 10,661 | 255 | #'*Script for Enrichment Analysis Using GSEA*
####GSEA method: Metabolomics---
set.seed(1)
# Obtain GSEA summary stats:
library(clusterProfiler)
library(enrichplot)
library(ggplot2)
library(ggridges)
library(ggplotify)
library(gridExtra)
# Libraries needed to generate tables:
library(kableExtra)
library(gt)
library(... |
522a41254c38ffdd36065457e5deae60acbd6b8bbeb45fe8314f7651068d65db | R | 10,696 | 305 | ###for report----------------------------------------------------
library(dplyr)
library(emmeans)
library(parameters)
library(bayestestR)
library(ggplot2)
library(knitr)
# extract lm bootstrapped coefficients ------------------------------------
##defince function
# extract lm bootstrapped coefficients --------------... |
558a16ad9442a2d03545b030602f93c91fb67b4ff331df8e18fcd7234ce0b8b0 | R | 10,832 | 309 | #' @title Deprecated functions in package \pkg{rliger}.
#' @description The functions listed below are deprecated and will be defunct in
#' the near future. When possible, alternative functions with similar
#' functionality or a replacement are also mentioned. Help pages for
#' deprecated functions are available ... |
d5d0d6ce29eea36c1fa870630186d3c365de3951ddaf8fc03f4b79a5e63f320c | R | 10,841 | 240 | library('signs')
library('Cairo')
library('ggseqlogo')
library('ggrepel')
library('RColorBrewer')
library('Biostrings')
custom_breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) {
bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits)
bmax = ceiling(bmax * (10 ^ digits)) / (10 ^ digits)
if (bmin > ... |
77c3a12511150d54705d52a7b566963571f8efbeb1aa82959a7c7fe0ff3981ea | R | 10,987 | 260 | # Compute the summary report for different CN detected in each comparison
# Use the summary.tab file produced from each comparison
# Find the centromere position, only one dat.tab file is needed
# filter out CN of poor quality
# Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de
suppressPackageStartupM... |
d42566eeb5bb27580f8253236baef0a2b537059ef68116950bd5ef7a623c8ece | R | 11,029 | 261 | # Compute the summary report for different CN detected in each comparison
# Use the summary.tab file produced from each comparison
# Find the centromere position, only one dat.tab file is needed
# filter out CN of poor quality
# Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de
suppressPackageStartupM... |
27c83b85158d39cbe0ef5a3ef04cb611b503d4397c30fa6d9ba3ebbafb5f7b8e | R | 11,036 | 346 | ---
title: "SCopeLoomR Tutorial - Creating and reading .loom files"
package: r pkg_ver('SCopeLoomR')
output:
html_notebook:
toc: yes
html_document:
keep_md: true
df_print: paged
toc: yes
toc_float: yes
BiocStyle::html_document:
number_sections: no
pdf_document:
toc: yes
vignette: |
... |
f6995acf5a1fbd1706d9ea69dd417a85ddf182e71e47d8f0af70d9dfee5bb85c | R | 11,094 | 341 | ####################################
###### FUNCTIONS ###################
####################################
`%not_in%` <- purrr::negate(`%in%`)
add_vireo <- function(obj, dir) {
donor_ids <- read.table(paste0(dir, 'vireo/donor_ids.tsv'), header = TRUE, stringsAsFactors = FALSE)
obj <- AddMetaData(obj, dono... |
63ac6cffdbf23299f0775094ba1f1b1e60856d872094343b505ceb22fc86c844 | R | 11,143 | 369 |
library(Rfast)
library(glmnet)
library(ranger)
library(datasets)
library(MASS)
library(dplyr) # for basic data wrangling
library(rootSolve)
library(vtreat)
library(xgboost)
library(fastDummies)
library(nnet)
##input: Lagrange multiplier lambda and the calculated estimating function stored in the ZZ matrix
... |
7712d4447f678c327f68bad8b6d3b2755007b6f69bdefd1b08c910eb02f6309d | R | 11,199 | 302 | # Cell propotion changes in each Class Sub class and brain regions in snRNA and snATAC
setwd("~/zunpeng@mit.edu - Google Drive/My Drive/01_Data/01_ADMR_snATAC_multiome_2024/01_Overall/CellFractionChanges")
library(dplyr)
library(data.table)
library(ggpubr)
library(ggplot2)
library(ggthemes)
#install.packages("oddsrati... |
70208dcd4778f44ee16dc86180259746e35d3e97e59ab13edeb7ae9a2c57b734 | R | 11,247 | 299 | ## Tests for object creation and preprocessing
data("pbmc", package = "rliger")
rawDataList <- getMatrix(pbmc, "rawData")
withNewH5Copy <- function(fun) {
ctrlpath.orig <- system.file("extdata/ctrl.h5", package = "rliger")
stimpath.orig <- system.file("extdata/stim.h5", package = "rliger")
if (!file.exists(ctrl... |
af17b6e363ddbd60de0bf23dddafef8beb0cb6456c578c69aa41c09d0805924d | R | 11,453 | 392 | MNR <-function(regression_data,perm,disease_filename, reg_type, resDir, screening_method, key, LM,folds, GLM_user_word) {
# install.packages(c("glmnet","Matrix","parallel","doParallel","foreach","stats","utils","matrixTests","graphics"))
# install.packages(c("testthat","knitr","rmarkdown","plotly","htmltools","... |
6c237cd797baaeb4f82928e0b67699a6bcb6eb7de64c9c27f67ee753b311af63 | R | 11,510 | 296 | ### Author : Marie-Michelle Simon
### Date : May 1st, 2023
### Extract the tissue-specific genes from rna-seq data on 12 tissues (ArrayExpress : https://www.ebi.ac.uk/biostudies/arrayexpress/studies/E-MTAB-6081) and
### only keep the the tissue-specific genes that overlap with the genes that are differentially expres... |
4bb11091aabd245c71098dcaea707608133b05c82e6d3da319080067e9c95339 | R | 11,533 | 319 | # ---- Load and install required libraries ----
# List of required packages
required_packages <- c(
"lme4", # For fitting linear mixed-effects models
"pbkrtest", # For Kenward-Roger approximation for mixed models
"simpleboot", # For simple bootstrap methods
"lmeresampler", # For resampling me... |
825493addb90bb374028ad628826a49127a0bf1f91edf5f392e2d73d313eaf5f | R | 11,619 | 273 | ################################################################################
# Step 3: Mediation Analysis
# Author: Shengxian (Naomi) Ding
# Email: naomidsx@gmail.com
# Date: 2025-07-19
################################################################################
#========================================... |
7ef2148f6b3d4fd1024b354ef2dc7b68c50b77ba6bff5f6b7ee549a2b42cd3d1 | R | 11,712 | 309 | ---
title: "S23_24"
output:
workflowr::wflow_html:
toc: false
editor_options:
chunk_output_type: console
---
```{r}
library(here)
library(data.table)
library(tidyverse)
library(devtools)
library(ggplot2)
library(ggpubr)
library(cowplot)
library(RColorBrewer)
library(readxl)
```
```{r}
load_all(here("code","... |
0ef0d3447523c3355b38b426630ae691e202600a53c71197456888c11258bdf7 | R | 11,719 | 308 | #' `r lifecycle::badge("experimental")` Batch-aware highly variable gene selection
#' @rdname selectBatchHVG
#' @description
#' Method to select HVGs based on mean dispersions of genes that are highly
#' variable genes in all batches. Using a the top target_genes per batch by
#' average normalize dispersion. If target ... |
f9e83ca4917c7461f9347cacec890aa314657f83f9305dcd86c757e9f281587f | R | 11,824 | 334 | ---
title: "Extended data Figure 4"
site: workflowr::wflow_site
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
code_folding: hide
chunk_output_type: console
---
```{r caching, echo=FALSE}
knitr::opts_chunk$set(autodep = TRUE)
```
```{r packages, message=FALSE}
library(tidyverse)
l... |
7960e7e8f7ca01164a7a33a5b173a129545acde504f19247416147cb616e9287 | R | 11,931 | 257 | #' ---
#' title: Experiencer Verbs in Malayalam -- Light Verb Constructions
#' subtitle: ERP Data analyses using Linear Mixed-effects Models
#' author: " "
#' output:
#' html_document:
#' code_folding: show
#' theme: flatly
#' highlight: kate
#' ---
#'
#' <style>
#' pre {
#' overflow-x: auto;
#' font-... |
ce8a239f26abd1dbd0b166477c5b785ff98c0323a06d58ace7eec7fa3a30a4ac | R | 12,068 | 311 | data("pbmcPlot", package = "rliger")
withNewH5Copy <- function(fun) {
ctrlpath.orig <- system.file("extdata/ctrl.h5", package = "rliger")
stimpath.orig <- system.file("extdata/stim.h5", package = "rliger")
if (!file.exists(ctrlpath.orig))
stop("Cannot find original h5 file at: ", ctrlpath.orig)
... |
46a563538373c65af4885f9c0564e7d68b6ca29ca8f8f4e570fb451f5fcd5975 | R | 12,078 | 276 | # psf.signal.sheets <- function(psf.results, kegg.collection, output.path)
# {
#
# plot.psf.pathway <- function( psf.object, signal.values, signal.values.lim, main="",
# highlight.sinks=FALSE, highlight.genes=NULL )
# {
# g <- igraph.from.graphNEL(psf.object$graph)
#
# node... |
494833c1f2884cb902a3f65c061af342d95ab04690f46d8304f572204bdd2c2a | R | 12,146 | 308 | modify_data=function(data,design, min_relative,min_odd) {
otu_origin=data
mapping=design
# 将第一列转为行名
rownames(otu_origin)<-otu_origin[,1]
otu_origin<-otu_origin[,-1]
# 过滤掉小于千分之一的数据
otu_origin[otu_origin<min_relative]=0
#先矩阵化,再倒置
otu_t=as.data.frame(t(as.matrix(otu_origin)))
# 修改第一列
otu_t=d... |
6835816286f2286183fd75d6ab51aacd6806bde9e2a31cb7d9b5a406b8978549 | R | 12,166 | 331 |
concatenate.summonds <- function(summonds){
sum = paste(summonds, collapse="+")
}
psf.flow <- function(g, node.ordering, sink.nodes, split = TRUE, sum = FALSE, mult_normalization = FALSE, tmm_mode = FALSE, tmm_updated_mode = FALSE) {
# show(i)
# k = 0
node.order <- node.ordering$node.order
node.rank ... |
4b5b76c2b99548d4c911b41fb5658b5da79b52148b99e700f746be9e968d7746 | R | 12,285 | 338 | # Description ####
# Longitudinal plots to characterize our data
# Set environment ####
rm(list= ls())# ctrl + L to clear console
setwd("~/Documents/GitHub/Striatocortical-connectivity-FEPtrt/LongitudinalPLOT/")
#setwd("/Users/brainsur/Desktop/GitHub_repos/Striatocortical-connectivity-FEPtrt/LongitudinalPLOT")
librar... |
74d841b4c14d0e71d0e897bddc6b51bb3f4662cb78b394b7c3c5b47c8e591c02 | R | 12,595 | 375 | projDir <-""
setwd(projDir)
source("functions.R")
package.list <- c("psych","reshape2","rstatix","lmerTest","lme4","afex","car","dplyr","ggplot2","Hmisc", "purrr",
"broom","tidyr","corrplot","ggpubr","Matrix","tibble","ggeffects","effects","stringr","readxl","readr","purrr",
"patter... |
89d91946f4f9d53bde6e41843627ede9cf5671497fdfeda6c75bf1e3092f3844 | R | 12,712 | 284 | #' Find shared and dataset-specific markers
#' @description Applies various filters to genes on the shared (\eqn{W}) and
#' dataset-specific (\eqn{V}) components of the factorization, before selecting
#' those which load most significantly on each factor (in a shared or
#' dataset-specific way).
#' @param object \linkS... |
a35cf2acf464e0e472a8eb04bdb9e6cd984eb08b227bc83468bded6170fb0652 | R | 12,726 | 340 | ---
title: "S22"
output:
workflowr::wflow_html:
toc: false
editor_options:
chunk_output_type: console
---
```{r}
library(here)
library(data.table)
library(tidyverse)
library(devtools)
library(ggplot2)
library(ggpubr)
library(cowplot)
library(RColorBrewer)
load_all(here("code","useful.stuff.aa")) # Lo... |
cc23545ebad4171b5898d07252f58fb47d5f4ae877b9312e0d73be959d24b814 | R | 12,813 | 287 | # Copyright: Han Wang
## V1: 25/03/2025 - This script contains behavioural-task data analysis for the fMRI-ML study in Wang et al.
## Please run descriptive.R first to load the data sets into your environment.
# Load packages and define some functions
library(car)
library(dplyr)
library(tidyr)
library(ggplot2)
lib... |
f5fcacb8a7f5bd794107724e220540ceb33db1ad55c7f7c97c8b9be35ca89140 | R | 12,863 | 326 | ---
title: "Interact with A Liger Object"
author: "Yichen Wang"
date: "2023-11-06"
output:
html_document:
toc: 3
toc_float:
collapsed: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, results = "hold")
```
## Structure
Starting from rliger 2.0.0, we introduced a newly designe... |
58051a2f9e161fcfc767e1ef87d9bd7a13a3247844e163d9fa5e338c4d55118c | R | 12,865 | 371 | ###### Step 1: R script for running fast GWAS on cognitive outcomes ######
# Author: Shengxian (Naomi) Ding
# Email: naomidsx@gmail.com
# Date: 2025-07-19
# Parse command line arguments for working directory
args <- commandArgs(TRUE)
wkpath <- (parse(text = args[[1]])) # Get working directory path
setwd(wkpath... |
3e8b5a35a7de9b7e5fc0372856e8b2b1c6b662a2397ab3a5b9e36cf871a65427 | R | 12,900 | 367 | library(plyr)
library(dplyr)
library(tidyverse)
library(caret)
library(recipes)
library(devtools)
library(data.table)
load_all("/dcs04/scharpf/data/annapragada/useful.stuff.aa")
library(pROC)
cohort_name<-"LUCAS"
#read in the cohort
train<-fread(paste0("../Cohorts/",cohort_name,"_Train.csv"),header=T) %>% select(-V1)
t... |
79cf1c0188ef272970e26829a2cc9ee3dc8ce7d66b9ae3dbeb15d5fd99e1348e | R | 13,085 | 282 | library(tidyverse)
library(parallel)
library(RcppAlgos)
source('helper.R')
# get prediction results for all variants
input_folder <- '/lab/solexa_bartel/coffee/Sequencing/AllofUs/Exome_v8_3UTR_variants/All_of_us_predictions/CV_MINN_XL_HS_MM_L_2000_CDS/'
pred_files <- list.files(path = input_folder, full.names = TRUE, ... |
b2d5a81877eb97e6374c8917e654f35c3c0e2d782c8fae22b49416a8cc37cf7d | R | 13,117 | 346 | library('ggplot2')
library('Cairo')
library('ggrepel')
library('RColorBrewer')
library('viridis', quietly = T)
library('ggpointdensity', quietly = T)
library('signs', quietly = T)
library('circlize')
library('ComplexHeatmap')
library('gprofiler2')
custom_breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero ... |
00c11fcd3b6b6f7d46a5856fd5cbe539f62e80b12b65773e7c8831396e4834f8 | R | 13,288 | 350 | #' Test all factors for enrichment in a gene set
#' @description
#' This function takes the factorized \eqn{W} matrix, with gene loading in
#' factors, to get the ranked gene list for each factor. Then it runs simply
#' implemented GSEA against given gene sets. So if genes in the given gene set
#' are top loaded in a f... |
607e827e0cf960af567311e2b03f3a3333da7eba4f15850f970a8992c0071257 | R | 13,507 | 328 | library('signs')
library('Cairo')
library('viridis')
library('RColorBrewer')
custom_breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) {
bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits)
bmax = ceiling(bmax * (10 ^ digits)) / (10 ^ digits)
if (bmin > 0 | bmax < 0) zero = FALSE
d = round((bmax... |
abcf78f609c2889d25a11c79830b9dfd609c7be7631aed0163b2a3d95f837171 | R | 13,527 | 327 | library('signs')
library('Cairo')
library('viridis')
library('RColorBrewer')
custom_breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) {
bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits)
bmax = ceiling(bmax * (10 ^ digits)) / (10 ^ digits)
if (bmin > 0 | bmax < 0) zero = FALSE
d = round((bmax... |
b6b15954c686031b9c8fcd772d1dcb199c776a91c587d5b5b264270ce0bcabeb | R | 13,583 | 495 | #!/usr/env/bin Rscript
library(here)
library(data.table)
library(bootES)
library(ggplot2)
library(GGally)
library(ggtext)
library(gt)
### CONSTANTS
REDOTABLE <- TRUE
REDOPLOTS <- FALSE
RERUNSIMS <- FALSE
### INPUT
fpaths <- list(
RDS = c("adnimerge_baseline", "adni-bl_volumes_icv-adjusted") |>
sprintf(fmt = "d... |
a5611d50c6f0602959c2163851b02b16d4a49ca7ee46c7015ba9763008d28562 | R | 13,711 | 301 | #!/usr/bin/Rscript
#=####################################################################O
# R ERP pipeline using the eeguana package
# Experiment: E1 (Malayalam)
#
# Author: R.Muralikrishnan
# 2024-05-10: V 1.0
# 2024-06-11: V 10.0
#=####################################################################m... |
fa654aaf2fcd4e65731acd817e3d4e85178df05fde9ab481baa30eca722e9e32 | R | 13,914 | 308 | graphical_data_generator <- function(pathway, include_changes = FALSE) {
entrez_id <- unname(sapply(pathway$graph@nodes, function(y) {
ifelse(is.null(unlist(graph::nodeData(pathway$graph, y, attr = "genes"))),
as.character(unlist(graph::nodeData(pathway$graph, y, attr = "label"))),
paste... |
007fdf3f4217ed8ebf18562c5f756b69b9da93e1923cfb9386e545a8e4d25486 | R | 14,041 | 567 | ---
title: "Mice CSF-cN Intrinsic Properties along the rostro-caudal axis"
author: "Nicolas Wanaverbecq - Elysa Crozat - Edith Blasco"
date: "`r Sys.Date()`"
output:
pdf_document:
toc: yes
toc_depth: 5
params: null
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## OPEN REQUIRED PA... |
107e53c6d1bdf45b2e841f8d715c8ccef7d8baefcdb607fb1e8b75d3c8c3c847 | R | 14,147 | 200 | library(Seurat)
library(dplyr)
library(Azimuth)
library(SeuratData)
library(presto)
library(car)
# Note: the code below can be adapted to study sex interaction and to get the sex specific SumRank.
#### Merge code
Datasets = c("Mathys","Grubman","Lau","Morabito","Zhou","Leng_EC","OteroGarcia","YangCortex","Gerrits_OTC"... |
cd15466c0c40a648b76e00bb63b9534d6078a19f5d63c9d0626f10b169324d6a | R | 14,214 | 317 | ##This code is to make figure2 to demonstrate the performance of low-input TAPS and CAPS on mESC
##module load R/4.0.3-foss-2020b
#.libPaths("/well/ludwig/users/ebu571/R/4.0/skylake")
suppressPackageStartupMessages(library(data.table))
suppressPackageStartupMessages(library(parallel))
suppressPackageStartupMessages(li... |
de9d907c5e121dca63734d99ea2a0fd96709763a410ca3b405bc918d0ef48f23 | R | 14,216 | 293 | ##This code is to make figure2 to demonstrate the performance of low-input TAPS and CAPS on mESC
#ml use -a /apps/eb/2020b/skylake/modules/all
##module load R/4.0.3-foss-2020b
#.libPaths("/well/ludwig/users/ebu571/R/4.0/skylake")
library(data.table)
library(parallel)
library(dplyr)
library(ggplot2)
library(RColorBrewe... |
a0391b88859c57b8ce95ced6d44558783aa7a4a36882655c01921fe8b43d1b6c | R | 14,328 | 345 | #' Map gene data onto a pathway graph
#'
#' @param g Tha pathway graph of graphNEL class
#' @param entrez.fc gene expression fold change matrix with entrez gene rownames (A matrix data associated with the genes; rownames represent genes; a single gene-row may contain one or many data values;)
#'
#' @return graphNEL obj... |
15d81b87d2f8ad719d034081ecfb17b27e2112b3827f3877d2c53e67328cb550 | R | 14,352 | 328 | data("pbmc", package = "rliger")
withNewH5Copy <- function(fun) {
ctrlpath.orig <- system.file("extdata/ctrl.h5", package = "rliger")
stimpath.orig <- system.file("extdata/stim.h5", package = "rliger")
if (!file.exists(ctrlpath.orig))
stop("Cannot find original h5 file at: ", ctrlpath.orig)
ctr... |
3d5aef002d98ee3e9ed22eea18e94062bc9f8c8cc29961043553d73abe585faf | R | 14,644 | 575 | #!/usr/bin/env Rscript
library(here)
library(data.table)
library(progress)
library(DescTools)
library(ggplot2)
library(gridExtra)
library(ggtext)
library(ggsignif)
library(ggridges)
library(ggnewscale)
## Calculate and compare correlations of HC & Age | Memory | Cognition
## ADNI data CN|MCI|AD
RERUNPERMS <- FALSE
... |
d170048d6e54cea9aec797fa0d3c11aedd053b075a589ce8e58dac5f9ba93ee8 | R | 14,684 | 358 | library('tidyverse')
library('ggplot2')
library('Cairo')
library('RcppAlgos')
library('RColorBrewer')
library('viridis')
library('signs', quietly = T)
library('ggpointdensity', quietly = T)
custom.breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) {
bmin = floor(bmin * (10 ^ digits)) / (10 ^ digi... |
dac2ba5f0d40ac35a9e76bbb6b44036722736164e99461c803c5174d2d383ddb | R | 14,689 | 309 | # ----------------------------------------
# Load required packages
# ----------------------------------------
library(randomForest)
library(xgboost)
library(Matrix)
library(caret)
library(dplyr)
library(pROC)
library(ggplot2)
library(precrec)
library(tibble)
library(yardstick)
library(purrr)
library(glmn... |
9a12c44d3a7a51c79a666764b4623798efb6d2dfdfcbb21fed26e094de06416a | R | 14,722 | 342 | data("pbmc", package = "rliger")
rawDataList <- getMatrix(pbmc, "rawData")
withNewH5Copy <- function(fun) {
ctrlpath.orig <- system.file("extdata/ctrl.h5", package = "rliger")
stimpath.orig <- system.file("extdata/stim.h5", package = "rliger")
if (!file.exists(ctrlpath.orig))
stop("Cannot find orig... |
176d8c99f40a9aa1f3cfca9516be5e7c2d331e54eb00f7c6481e188fa7b64d6a | R | 14,812 | 317 | #' @import ggplot2
#' @import grid
#' @importFrom plyr alply
#' @importFrom dplyr inner_join
#' @importFrom fs file_move
#' @import stringr
#' @importFrom ggiraph girafe
#' @importFrom htmlwidgets saveWidget
#' @importFrom ggpubr stat_compare_means
#' @importFrom vegan diversity
#' @importFrom vegan estimateR
#' @impor... |
6c7129207edd79fccbb214a661b0e72f6786454381379579117deb1c659db295 | R | 14,940 | 394 | ---
title: "2E_S13"
output:
workflowr::wflow_html:
toc: false
editor_options:
chunk_output_type: console
---
```{r lib}
library(here)
library(data.table)
library(tidyverse)
library(devtools)
library(ggplot2)
library(ggpubr)
library(cowplot)
library(caret)
library(recipes)
library(pROC)
library(readxl)
```
As... |
440290e83403db6155214f12dfd6728015f38a8126b7a5ec4e8748ce8faa118d | R | 15,308 | 395 | workdir <- "~/My Drive/Bench/HP1/HP1_Manuscript/Ovation"
setwd(workdir)
cov_dir <- "~/My Drive/Bench/HP1/HP1_Manuscript/Ovation/5hmC_extract"
library(methylKit)
# List all the coverage files in the directory
coverage_files <- list.files(cov_dir, pattern = "*.bismark.cov.gz$", full.names = TRUE)
# Convert character ... |
3a7c21307cb3ecde59351285ac88714c5deaddb8564662c1d568ab4fc3cdafda | R | 15,671 | 375 | ### Author : Marie-Michelle Simon
### Date : April 30th, 2023
### Goal : Generate 2 heatmaps :
### -one heatmap showing gene expression from the bulk RNA-Seq of freshly sorted MuSCs (n=3)
### -one heatmap showing the distribution of H3K4me3 signal from the Cut&Tag on freshly sorted MuSCs (n=2)
### Type of samples : mu... |
5084e70ca98996535e527f960d7e0735d12d87aa29b47e9b471a62a6d2c578c7 | R | 15,753 | 412 |
# ---- Load and install required libraries ----
# List of required packages
required_packages <- c(
"dplyr", # Data manipulation
"pbkrtest", # Parametric bootstrap and Kenward-Roger approximation
"lme4", # Linear and generalized linear mixed-effects models
"lmeresampler", # Resampling m... |
2a8139490883820ee71bc13b2b9a7ddcaccbc1ac90be37dc039e62263e8574e0 | R | 15,761 | 262 |
## this is a script used to analize the SmB-CLIP-Seq data, Nijssen axon/soma seq data, and Lu 2014 Y12 RIP data used for supplementary figures.
# import libraries
library(readr)
library(stringr)
library(tidyr)
library(dplyr)
library(tidyverse)
library(biomaRt)
library(ggplot2)
library(ggpubr)
libra... |
225c4d4d65533347e13ab61248d4964eb70545ee93f0c101530973afdb75dc59 | R | 15,771 | 326 | EMP_MICRO <- function(data=NULL,design='mapping.txt',dir='.',min_relative=0.001,min_ratio=0.7,html_out=T,method='LSD',distance=c('bray','jaccard'),seed=123,pattern='',group_level='default',top_num=10,cooc_r=0.3,cooc_p=0.05,width=10,
height=10,RFCV_estimate='species',x_break=1,vertex.size=15,vertex... |
08a5031124bd81ab07338db26e554505b908b83f3dc24ab309dc226765afb478 | R | 15,781 | 277 |
###this is a script for processing the ATP vs No ATP data
# for mouse B(hxmr) vs C(hxmra)
# for human E(mxhr) vs F(mxhra)
#load libraries
library(readr)
library(stringr)
library(tidyr)
library(dplyr)
library(tidyverse)
library(biomaRt)
library(ggplot2)
library(gridExtra)
library(gtable)
library(patchwork)
#Human
... |
a630dae275c7a3872756862ea72044a76f8d85f45dfb348c168001b42dc34ca2 | R | 15,845 | 482 | ## C. Vriend - Amsterdam UMC - July '24
## perform mixed model analysis on pre-to-post treatment CORE data and compare between responders and non-responder
## additional sensitivity analyses with trial/treatment as random intercept
## Leave-one-sample-out validation (trial or treatment) and calculation of harmonic P-va... |
47078a16651e79a09f185acee64aa86292155d4ecb9f6d1b82469e20f3e67fd1 | R | 15,876 | 330 | ---
title: "2A_S11_S16"
output:
workflowr::wflow_html:
toc: false
editor_options:
chunk_output_type: console
---
Make the heatmap figure and curate some correlations for the text
Also some figures on healthy variation
```{r}
library(here)
library(data.table)
library(tidyverse)
library(devtools)
library(ggplot2... |
b31134da16064090be08b2dc9c9f3f5d4cba18bbe162d8f5cf48c69a10dda69e | R | 15,971 | 274 | library(tidyverse)
library(Biostrings)
library(RcppAlgos)
source('helper.R')
###----------------------------------------------------------------------------------------------------------
##-- single-nucleotide mutagenesis library F044
# prediction with the model trained on: Frog endogenous mRNA tail-length change duri... |
251797d2c974bb9b70506b632725c7d97b8721f6ed578dcc717898e5258d2b4f | R | 16,209 | 314 | #### Pathway activity analysis on GTEx single cell expression data, comparison of gene and pathway level UMAP clustering and feature analysis
library(zellkonverter)
library(SingleCellExperiment)
library(Seurat)
library(ggplot2)
library(pheatmap)
library(RColorBrewer)
library(plotly)
library(psf)
library(biomaRt)
libr... |
99a86b0ff6c165be66916be27d8b6458ad7ede9501eb0f5d9f5907cb8b81d121 | R | 16,273 | 464 | args <- commandArgs(trailingOnly = TRUE)
fold <- args[1]
library(plyr)
library(dplyr)
library(tidyverse)
library(caret)
library(recipes)
library(devtools)
library(data.table)
load_all("/dcs04/scharpf/data/annapragada/useful.stuff.aa")
library(pROC)
cohort_name<-"Cristiano"
#fold="fold10"
#read in the cohort
train<-f... |
17104b3b6c5d6c0e35bbc9e1fbf872fa35faede3d7256e7488af00abc407627c | R | 16,294 | 405 | #' Analyze biological interpretations of metagene
#' @description Identify the biological pathways (gene sets from Reactome) that
#' each metagene (factor) might belongs to.
#' @param object A \linkS4class{liger} object with valid factorization result.
#' @param genesets Character vector of the Reactome gene sets names... |
be7563cf694f3ecbd096d970a32f244eedd15e881473b8872f273c11a47de604 | R | 16,306 | 331 | ---
title: "S9"
output:
workflowr::wflow_html:
toc: false
editor_options:
chunk_output_type: console
---
Make the heatmap figure and curate some correlations for the text
Also some figures on healthy variation
```{r}
library(here)
library(data.table)
library(tidyverse)
library(devtools)
library(ggplot2)
librar... |
b398ee335f091ea748db2abd2b4f27c2020432ad7edaa3c0b0a200a96f16d785 | R | 16,312 | 353 | library(scales)
library(Seurat)
library(cowplot)
library(pheatmap)
library(dplyr)
library(ggplot2)
library(RColorBrewer)
library(ggsci)
library(viridis)
library(data.table)
library(tidyr)
library(corrplot)
setwd("/users/ludwig/cfo155/cfo155/scTAPS_CAPS/human_immune_cells/t_cell_update/stats")
#### 1. plot QC ####
qc <-... |
5e4248c9bacbbee214c083d1efa164c56decec0bc357e70745488947a2c54c4c | R | 16,334 | 361 | # Plot CNV for a sample (PRE and POST lines) in the entire genome, use QC summary files
# Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de
suppressPackageStartupMessages(library(argparse))
##############################
suppressPackageStartupMessages(library('ggplot2'))
suppressPackageStartupMessages... |
c41ecd9b891b6a71c3b593580a1bf4daa4a1b7814dac047c356c6eabeefa6265 | R | 16,465 | 446 | # Load necessary libraries
library(dplyr)
library(pbkrtest) # Provides tools for parametric bootstrap and Kenward-Roger approximation
library(lme4) # Fits linear and generalized linear mixed-effects models
library(lmeresampler) # Provides functions for resampling mixed models
library(emmeans) # Est... |
b4602eda7bbc2eff1a64fae82fd1b6dec1e33b3a5402ee41bb83814daffa5ba5 | R | 16,505 | 399 | workdir <- "~/My Drive/Bench/HP1/HP1_Manuscript/Ovation"
setwd(workdir)
library(dplyr)
library(tidyr)
# Import Differentially Methylated Regions calculated Previously
combined_contrasts_df <- readRDS("2024-05-26_Combined_intersection_dataset.rds")
rownames(combined_contrasts_df) <- NULL
master.df <- read.table("Annota... |
edef29d653b86134f5e2353b84bb690c7df03b5ae125abc7afe1ffaec8f2564d | R | 16,520 | 351 | library(ggplot2)
library(ggpubr)
library(tidyverse)
# --------------------------------- SETUP ---------------------------------
repo <- 'path/to/psychosis-FC-prediction'
# Specify finer details of models
p_thresh <- '0.01' # supps also used p<0.05 and p<0.001
preproc <- 'dt_AROMA_8Phys-4GMR_bpf' # s... |
86c903b0badc1f32d4b9c956930b253aeda627016d450e6ed231d310d76d7926 | R | 16,630 | 415 | ---
title: "S25"
output:
workflowr::wflow_html:
toc: false
editor_options:
chunk_output_type: console
---
```{r packages, message=FALSE}
library(here)
library(data.table)
library(tidyverse)
library(devtools)
library(ggplot2)
library(ggpubr)
library(cowplot)
load_all(here("code","useful.stuff.aa")) # ... |
881856aa01167139cda8cabedfaf4663071af0ffc36ef82883500c996682e813 | R | 16,674 | 446 |
#lib_dir <- paste0(getwd(),"/libs")
#.libPaths( c( .libPaths(),lib_dir ) )
# p.R175H,p.R248Q,p.R273H,p.R248W, p.R273C, p.R282W, p.G245S
# R175H,R248Q,R273H,R248W,R273C,R282W,G245S
# p.R175H|p.R248Q|p.R273H|p.R248W|p.R273C|p.R282W|p.G245S
# R175H|R248Q|R273H|R248W|R273C|R282W|G245S
options(warn=-1)
graphics.off... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.