sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
299d648ea26dab7822ec6fd94fa376ef35a7ac4e2e063003cea7ee1f617d4d9b | R | 5,807 | 125 | ---
title: "Code availability for the paper Mutant Huntingtin impairs neurodevelopment in human brain organoids through CHCHD2-mediated neurometabolic failure"
output: html_notebook
---
```{r}
#R version 4.2.2
library(Seurat) #version 5.0.2
library(dplyr) #version 1.1.4
library(ggplot2) #version 3.5.0
```
# Data pre-... |
80104a9705e2196a7e2ea341644a89e45b1537ed250c0639002d43a3653083c1 | R | 5,807 | 181 | #!/usr/bin/R
# ----------------------------------------------------------
# DEseq2 run on pseudobulk data for the multiregion project:
# Updated: 10/27/23
# ----------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(... |
f9f182677f9111010cd2eeb97a1f0c522ef2eb7bfe26227fee10052fc9aafac2 | R | 5,814 | 146 | ## HiC-Pro
## Copyleft 2015 Institut Curie
## Author(s): Nicolas Servant
## Contact: nicolas.servant@curie.fr
## This software is distributed without any guarantee under the terms of the GNU General
## Public License, either Version 2, June 1991 or Version 3, June 2007.
##
## Plot Valid Interaction Statistics
##
rm(l... |
692bea55124e5e01bd4522775e8839b6c81e6b65d71d0bd1009c134ee9561052 | R | 5,819 | 178 | library("Seurat")
library("tidyverse")
# load the data
setwd("./Step4.IterativeCleaning")
# Ex
Ex <- readRDS("Recluster.R1/Ex.rds")
# inspect the data
DimPlot(Ex, label = T)
# marker gene expression
NormalizeData(Ex, assay = "RNA")
DotPlot(Ex, features = c("RBFOX3","GABRB2","SATB2", "SLC17A7", "SYT1",
... |
4f911bb8ff5b055d054ba61f0e151aeea2aa25a2ba8d146124143bea5a2f75a0 | R | 5,820 | 157 | # I obtained the articles as of March 21, 2024
# They are from the PMC OA Subset - Commercial Use
# I did not use the incremental files.
# So they were selected from December 17, 2023 and earlier.
library(colorspace)
library(magick)
library(tidyverse)
library(xml2)
source("Functions.R")
set.seed(0)
dir.create("PMC_I... |
9019238d367d245f1f5483eabafd4a2662e7a256b3ded01c483d6ac709945c75 | R | 5,828 | 172 | setwd("F:\\ATAC\\processFiles\\RNA-tissue_specific0711")
library(dplyr)
library(edgeR)
library(ggplot2)
library(stringr)
##gene expression matrix
dataExp <- read.csv("F:\\RNA\\DEG_Tissues_Stages\\GeneExpressionAllSamples.csv", header = T, row.names = 1)
##A list of genes involved in gene expression measureme... |
58fca4ccc8c3c6f4d404a40825866351e8b750f8fe76a4566b58150302dc3517 | R | 5,837 | 274 |
# Function -------------------------------------------------------------------
.replace <- function(x, i, j, ..., value) {
validObject(x)
if (missing(i)) i <- row.seq(x)
if (missing(j)) j <- col.seq(x)
if (is(value, "hyperSpec")) {
validObject(value)
x@data[i, j] <- value@data
} else {
x@data[... |
0277b008d8935f034f60d7b584291b48763ccb17c6d476fd7da560a71d01c49e | R | 5,846 | 184 | #!/usr/bin/R
# --------------------------------------------------------
# Plot the aggregated DE results across different methods:
# Consistency of DEG directionality by different variables
# Updated: 12/19/22
# --------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')... |
afb43de8a449ea03c736aa2ee1d89c6861ab9b569cf3aad68addc32f1f3ff586 | R | 5,848 | 167 | #' This function deconvolves the BOLD signal using Bush 2011 method, augmented
#' by the resampling approach of Bush 2015.
#
#' @param bold_obs observed BOLD signal
#' @param kernel assumed kernel of the BOLD signal
#' @param nev_lr learning rate for the assignment of neural events. Default: .01
#' @param epsilon relat... |
a7f4a08df6789eea1b48f7dd90d40affbdfdac60a7dd577e9ce755bc8161aa2a | R | 5,869 | 92 | library(ggplot2)
library(dplyr)
library(ggplotAssist)
library(DOSE)
library(enrichplot)
library(clusterProfiler)
library(org.Hs.eg.db)
library(gridExtra)
setwd("/Volumes/Elements SE/ppmi_zheda/kegg")
# data(geneList)
keytypes(org.Hs.eg.db)
gene_data <- read.csv("/Volumes/Elements SE/PPMI/csf_proteins_fdr_bh_0.05_key_5v... |
7bba10550eacb1d37f4165a426429d263b0b85d649311a553be1f36d51d368bc | R | 5,873 | 151 | #### DoubletFinder ####
run_doubletfinder = function(x, labels=NULL, ncells=ncol(x), data=NA, PCs=1:30, sct=FALSE, GT=FALSE, num.cores=6, pN=0.25, return.metadata=TRUE, ...) {
# Detect doublets with DoubletFinder
# Recommended job submission:
# doubletfinder = CJ(
# sct=TRUE,
# num.cores=1,
# label... |
a32464d9dab8020b6b4526a08621fd30389ff5e7f668e46b0a13a5bf572f80d7 | R | 5,882 | 204 | ### --------------------------------------------------------------------------~
###
### write.txt.long
###
###
#' @name DEPRECATED-write_txt
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Export `hyperSpec` objects to ASCII (text) files
#'
#' @description
#' These \pkg{hyperSpec} functions are **deprecated... |
b709e0e6933ffd9932a1acfa95a7eb77eef8f2b80fc90c8d09bb429f3d082e52 | R | 5,886 | 188 | #!/usr/bin/R
# --------------------------------------------------
# Plot GWAS gene intersections with aggregated DEGs:
# Updated: 12/16/21
# --------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(ggplot2)
... |
a048c1606bd6637c1b9e2ad6c11b5ab94c8c5a47b87ceec2b5239ab07a00b0f6 | R | 5,889 | 150 | #!/usr/bin/R
# --------------------------------------------
# Aggregate the DE results for DESeq2 results:
# Updated: 11/02/23
# --------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
print(version)
options(width=175)
... |
203087b9e974cb2bf42f34e0e8728a7370b15db444af3dd8e156389ee2254958 | R | 5,894 | 189 | ####################################################################################################
###
### File: 05_extract_peak_features.R
### Purpose: Extracting peak features from each time series
### Authors: Gabriel Rodrigues Palma, Rafael De Andrade Moral
### Date: 09/03/23
###
##########################... |
9363a84d6b41176f3065e5e1948b75fde07015bf5e29b52335303a503a561d3e | R | 5,899 | 120 |
#### Generics from stats ####
## --------------------------
setGeneric("predict")
setGeneric("fitted")
#### Basic getters and setters ####
## ---------------------------------
setGeneric("keys", function(object, ...) standardGeneric("keys"))
setGeneric("keys<-", function(object, ..., value) standardGeneric("keys<-"))... |
8cc20cbc1a3ccdfce4488161f5407bb74af0a2b11d2f903669e97ba39b2cd8e0 | R | 5,911 | 155 | library("batchtools")
## use the bath tools for RNA contamination detection and doublet removal
setwd("./Step8a.SubClusterAnalysis")
reg <- makeExperimentRegistry("Reclustering.Marker.Registry",
conf.file = "./Projects/snRNAseq/Step12.SubclusterAnalysis/batchtools.conf.R",
... |
19f4630c400b95d15523bedf7765410dc3b092653dd88af18345f8eb474a162a | R | 5,914 | 142 | #' Clear Stan Draw Files
#'
#' @description
#' This function removes Stan MCMC draw CSV files from the output directory. These files can accumulate and consume significant disk space (often GBs).
#' Draw files are created during model fitting but are typically only needed during the analysis session.
#' Once results ar... |
9a9811dd8396a48cde33e15b1729a42f9040e58dc9e81b52bce38af90bf70bbe | R | 5,920 | 139 | ---
title: "Differential expression between yth and ythmut in scDART"
output:
html_document:
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
In this document we carry out differential expression analysis for each cell type and cluster between yth and ythmut.
We set an adj... |
dc64a19255639803da430b6982a3bcd44cccf63c418c1ab99b15a7ec977d65ec | R | 5,920 | 123 |
#relationship between gene expression, chromatin accessibility and methylation level in tissue-specific gene
library(dplyr)
library(pheatmap)
library(dtwclust)
Tis_spe <- read.csv("C:\\Users\\qjp\\Desktop\\RNA-Tissue_specific.genes.csv", header = T)
##RNA-seq data
Exp <- read.csv("F:\\RNA\\RawTables\\Ori... |
121035ac3bfcb30119a8f8444dd68595168a52c9e5d58a06eab0af4d775c8918 | R | 5,924 | 125 | #' counts_obj
#'
#' @description
#' A tidy example dataset containing cell counts per cell group (cluster), sample, and phenotype for differential analysis. This dataset represents the counts of cells in various phenotypes and cell groups across multiple samples.
#'
#' @return A `tibble` representing cell counts per cl... |
4927ee49ed63ece3d9e39b6517102fb44ccec97572bbc39e599075175d2c2215 | R | 5,925 | 212 | source("ggcoxzph_fixed.R")
#define helper function#
values2deciles <- function(values){
qua <- quantile(values, seq(0,0.9,0.1))
res <- rep(0, length(values))
for (cu in qua){
idx <- values >= cu
res[idx] <- res[idx] + 1
}
res <- res - 1
return(res)
}
if (exists("adnimerge"))
rm(adnimerge)
libra... |
e51271ee833e4045bec3d5f87136b7cf915c50ba653c578721e979c675f961d5 | R | 5,925 | 178 | #!/usr/bin/R
# ----------------------------------
# Plot individual-vs-neurons heatmap
# Updated: 12/06/2022
# ----------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(viridis)
library(ggplot2)
library(ggrepel)
library(ggpu... |
609d2e5a6ae62cd8271e24358edba982c728d9793c67b3343a899431dd0727ba | R | 5,926 | 122 | SEM_Analyser = setRefClass(
"SEM_Analyser",
contains = "Analyser",
methods = list(initialize = function()
{
callSuper(
description = "Creates the standard error of mean of a given dataset.
If PeakAverage is TRUE: 1. finds for each stimulus and each sample the maximum
value of a given PeakS... |
03a39455258f74e72b41b26dd4e349d85d61cc42781849c3630febc956ad835b | R | 5,932 | 172 | #!/usr/bin/R
# -----------------------------------------------------
# Plot umap with the batches and with indivual metadata
# TODO: Which are the HC and PFC individuals
# -----------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
li... |
b9bbfa865595918e632eb679576a60d5e77d18ff8cf5b04661ec8eae6a73807b | R | 5,934 | 156 |
#'
#' Adds vertical lines to a ggplot object.
#'
#' @param plot Ggplot object
#' @param df A data frame with relevant plot data. (If the plot is faceted, then df must be the subset of data for the corresponding facet)
#' @param xintercepts Numerical x axis values that control the position of the line
#' @param linetyp... |
f2afc096422108089bd9ca30b238988c65fd05ad1d87a8f758b34dc814b408d3 | R | 5,935 | 234 | # Functions ------------------------------------------------------------------
.merge <- function(x, y,
by = setdiff(intersect(colnames(x), colnames(y)), "spc"),
by.x = by, by.y = by,
...) {
force(by)
force(by.x)
force(by.y)
if (any(grepl("^spc$", by.x)... |
20e94ee36bd125e0be9e4b42ac749f0e02093a6014e4f9d153f083d77e5854bb | R | 5,938 | 137 | ## ---------- Script -----------------
##
## Script name:
##
## Purpose of script:
##
## Author: Szi Kay Leung
##
## Email: S.K.Leung@exeter.ac.uk
##
## ---------- Notes -----------------
##
##
##
##
##
## ---------- Packages -----------------
suppressMessages(library(reshape2))
suppressMessages(library(dplyr)... |
34acf4b8b034910e198869a4978eec8ea267eca8753f952f8a7b9eff74eca2a2 | R | 5,940 | 187 | library(tidyverse)
library(ROGUE)
library(ggplot2)
simul_diff <- function(r = 2, n_gene = 10000, n_cell = 2000, n_diff = 200, sub = 0.5, ZINB = F, sd = 2){
gene_means <- exp(rnorm(n_gene, 0, sd = 2))
sda1 <- simul_da(gene_means = gene_means, r = r, n_gene = n_gene, n_cell = n_cell, ZINB = ZINB)
diff1 <-... |
4779ab117f739437a5710f2772671c4e0c29917dd076538ae59f82e607e675d0 | R | 5,945 | 163 | ---
title: "FICLE Output"
author: "Szi Kay Leung"
date: "11/08/2023"
output: rmdformats::robobook
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(kableExtra)
```
Shown below are output plots that can be generated from files generated using FICLE.
## Setup
Source scripts for plotting fro... |
c07ac53bb02e896569a34ece9ae35611f12aeb8c991f7f4c6417035200e4a5b9 | R | 5,948 | 132 | #!/usr/bin/env Rscript
##script to pull together FSL FEAT level 2 runs into an AFNI BRIK+HEAD format for review
##Note: this is largely a simple wrapper around the first-level conversion script
##For L2 analyses, the individual cope*.feat directories have the L1 structure and can be digested accordingly
print_help <-... |
e4da3f627793407cce4d1ec7f39dbc21974aaf0a8a7aeb3d58c317cb4eadfdc3 | R | 5,951 | 154 | # Greg Booth 2021
# This script takes the output from the BBI pipeline for sciATAC
# for each sample
# performs some filtering (by QC and doublets)
# returns a cds object of peak by cell data.
basepath = "/net/trapnell/vol1/HuBMAP/novaseq/210111_Riza_sciATAC3_split_sample/analyze_out/"
out_path = "/net/trapnell/vol1... |
4c5ae7064d1556e11b49addad036408fb354671d12e328bcb27872b11b060cdf | R | 5,962 | 154 | # Greg Booth 2021
# This script takes the output from the BBI pipeline for sciATAC
# for each sample
# performs some filtering (by QC and doublets)
# returns a cds object of peak by cell data.
basepath = "/net/trapnell/vol1/HuBMAP/novaseq/210111_Riza_sciATAC3_split_sample/analyze_out/"
out_path = "/net/trapnell/vol1... |
d64974225b3bfb78262e9bcfe13ff940f4f349f0311ff82e59ad029a80022edb | R | 5,966 | 198 | # For the specified k, separately average the positive and
# negative LE values for each region for each network to produce a score.
# Output:
# clab,'.jpg' Contains the network radar plots for average positive and negative LE values.
#Set libraries.
library(tidyverse)
library(reticulate)
library(ggplot2)
library(grid... |
02c75e5d031632b8dfa105ef12734b973a9e4bc967eb7452a1c130e0988d3579 | R | 5,969 | 168 |
library(ggplot2)
library(dplyr)
library("optparse")
library(stringr)
library(msigdbr)
library(fgsea)
library(tidyr)
library(tidyverse)
library(RColorBrewer)
print("Libraries loaded, starting now")
# Get the passed parameters
option_list = list(
make_option(c("-m", "--modelNotes"), type="character", ... |
3431c2eee9999fc174b3c58534cf48e0b9984ba58b3a396712614179051f4da2 | R | 5,970 | 153 |
setpairs2enrichments <- function(set1, set2, backgroundGenes, minSize, printOverlap = FALSE, alternative = "over", minFDR = 1, convertID = FALSE, mapSource = NULL, mapTarget = NULL){
#require("HTSanalyzeR")
set1 <- lapply(set1, function(x) intersect(x, backgroundGenes))
set2 <- lapply(set2, function(x) int... |
155dbb95603a60f24e5adb704e88a44a046ead976dd8986ee60f4eb8e3a991ce | R | 5,983 | 183 |
library(ggplot2)
library(dplyr)
library("optparse")
library(stringr)
print("Libraries loaded, starting now")
# Get the passed parameters
option_list = list(
make_option(c("-m", "--modelNotes"), type="character",
# default="_fix_Anatomical_Site_rand_Donor_HM10UMI=100_mito=10Scrub=0.2noPackerMNN=sampleNameK=... |
2cfefb54ea520ff1da225b3eede308999407be03e2579f8617638fb170d94430 | R | 5,986 | 250 |
#' archstabms
#'
#' Main analysis script.
#'
#' @param startStage Start at a specified analysis stage (default:2)
#' @param stopStage Stop at a specified analysis stage (default:7)
#' @param base_dir Base directory for all input files (default:NB private CRG server path; change accordingly)
#' @param output_dir Output... |
2d6f8e8450b70a54ef93f0322b49813662003ef4cbf890518beb733a598f24bb | R | 5,986 | 184 | #!/usr/bin/R
# ------------------------------------------------------------
# Calculate the fraction differences, by dirichlet regression:
# Updated 04/13/2021
# Last updated 11/25/2021 to clean up code only
# ------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegio... |
c12180963fe1497e505d1b93059ffdd0436ebe9ebde782f177b7970cb1444247 | R | 5,994 | 190 | #!/usr/bin/R
# --------------------------------------------------
# Plot GWAS gene intersections with aggregated DEGs:
# Updated: 12/16/21
# --------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(ggplot2)
... |
ab4c512a3e0da67a2687bbe82f8b560af0c5380f75d7ee6f94e1a3cb6377735b | R | 6,007 | 120 | get_mmy3_trial_df <- function(cache_dir="/proj/mnhallqlab/projects/clock_analysis/fmri/fsl_pipeline", model="selective", groupfixed=TRUE, allow_cache=TRUE) {
require(tidyverse)
expect_file <- file.path(cache_dir, paste0("mmy3_trial_df_", model, "_", ifelse(groupfixed, "groupfixed", "subjspecific"), ".rds"))
if (... |
42acfaafe3df4cacb5317c5ecfd6ee71850a48dab62b81cf8b1b72f0af184da9 | R | 6,012 | 195 | #' @name DEPRECATED-spc.bin
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Wavelength binning
#'
#' @description
#'
#' These \pkg{hyperSpec} functions are **deprecated** and not maintained any
#' more. You should not use these.
#' Currently they are present due to back-compatibility reasons and will be
#' r... |
7df04fc945e7a9d793d2895179e3f444ff45afb049ad3ccae3488c03ab605156 | R | 6,032 | 186 | #!/usr/bin/R
# ----------------------------------
# Starting from all DEG results,
# - Build region-specificity scores
# - Regression of lFC across results
# NOTE: mostly preliminary, not finished analysis
# Updated: 03/02/23
# ----------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
sourc... |
897eaedfb9366589b83372b1f8f387433cbdedea62ee67f3ad7547af63631dae | R | 6,036 | 162 | #!/usr/bin/R
# --------------------------------------------------------------
# Nebula as in minimal example, but using the precomp. matrices:
# Updated: 05/25/21
# --------------------------------------------------------------
# Aggregate number of sign. genes:
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir... |
44aa1057eb7b5601c9110b62c522e378ebb0aa9439ad98a79945206dbe6bdb06 | R | 6,048 | 174 | #!/usr/bin/R
# -----------------------------------------------------------------------
# Plot module insets, coloring/highlighting DEGs for a specific condition
# Updated 12/08/2022
# -----------------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists(... |
72adb6cb0f9657cb677279b4a36ea1a9c092d530611d1b6a666d2393bd9941c7 | R | 6,061 | 171 |
library(tidyr)
library(ggplot2)
library(glmnet)
library(ROCR)
library(data.table)
library(monocle3)
library(gridExtra)
# Get shared functions between this and runRegressionModel.R
source("./utilityFunctions.R")
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
libra... |
91e862b3c8cbe8bf2c3af119e48a66e337afc6eee257a17aa1bd713fe737bd7c | R | 6,064 | 188 | library("Seurat")
library("tidyverse")
# load the data
setwd("./Step4.IterativeCleaning")
# Ex
Ex <- readRDS("Recluster.R2/Ex.rds")
# inspect the data
DimPlot(Ex, label = T)
# marker gene expression
NormalizeData(Ex, assay = "RNA")
DotPlot(Ex, features = c("RBFOX3","GABRB2","SATB2", "SLC17A7", "SYT1",
... |
8781dac389e80c87b48eaf1a5d432e39327054ec07d7f782a9d0590eaa4413ac | R | 6,073 | 161 | #Polarised light detection in bumblebees varies with light intensity and is mediated by both the ocelli and compound eyes
library(lme4)
library(glme)
library(afex)
library(emmeans)
library(multcomp)
#In case that this code does not run in your computer, install the package Matrix:
#library(Matrix)
#Tes... |
60ce967d3f4139264d1db2e4adcf743e61aac441c1e17dc0c596d2bcf5f6eabc | R | 6,076 | 219 | library(jsonlite)
library(lme4)
library(lattice)
library(lmerTest)
library(MuMIn)
library(performance)
library(rstudioapi)
library(xtable)
library(emmeans)
library(car)
library(tibble)
library(dplyr)
library(tidyr)
library(ggplot2)
library(xtable)
# --------------------------------------------------------------------... |
722bb0463bfb4f4ffd2721299e1a0f2eb87a4cc9934d0140df771190496aa5d1 | R | 6,081 | 125 | # Title: Nested docked vesicle density analysis
#
# Description:
# This script performs a nested docked vesicle density analysis.
# It calculates the density of docked vesicles per volume
# within each nested active zone.
#
# Author: Daniel Parthier / Felicitas Brüntgens
# Date: 04.04.2024
# Last modified: 10.04.2024
#... |
270cba8a665cb483650eee60800e600cf9a2100e04f1665d0d07e93ea3033d6f | R | 6,085 | 81 | ################################################### integrate data from different patients using LIGER
library(Seurat)
library(rliger)
library(tidyverse)
library(SeuratWrappers)
library(UCell)
library(RColorBrewer)
packageVersion("rliger") ## version 1.0.0
setwd("Couturier_scRNA/GBM_res")
readRDS("GBM_liger.rds") -> ... |
94e1cd37ef6a9605c8a8a846490542b86b892e5d0f93aa0527cb6aa9ecbdc3f8 | R | 6,087 | 153 | library(dplyr)
library(sccomp)
estimate_for_alpha_normalisation_tests <- function(output_directory, bimodal = FALSE) {
data("counts_obj", package = "sccomp", envir = environment())
cache_dir <- file.path(output_directory, "stan_cache")
dir.create(cache_dir, recursive = TRUE, showWarnings = FALSE)
counts_obj |... |
136860b8ea4d6ac8d3a6e5dd0d8eba842fa8f929ce9e6083cbe6257232999a61 | R | 6,088 | 194 | #!/usr/bin/R
# ----------------------------------------
# Auxiliary functions for DE calculations:
# Updated: 02/23/22
# ----------------------------------------
library(cbrbase)
library(tidyr)
library(Matrix)
# For nebula:
library(nebula)
library(DESeq2)
library(RUVSeq)
library(qvalue)
# Same as plotting settings... |
fea4e8dd404b05478aecc8c71f5f51800d157d1cb49b249a02fce7f2a4e670fb | R | 6,090 | 215 | ---
title: "PPMI RNA-seq preprocessing"
author: "Jacqueline Maasch"
date: "10/15/2021"
output:
html_document:
toc: true
---
Data preprocessing of RNA-seq raw counts and experimental metadata.
## Preamble.
```{r setup, echo = FALSE, results = "hide", message = FALSE}
# Data manipulation
library(dplyr)
# Prin... |
245ef1465169bcf8b765b417342c318833c194f47df69baa7d27f0ba06549870 | R | 6,094 | 161 | #!/usr/bin/R
# ------------------------------------
# Enumerate types of modules captured:
# Updated 03/23/2022
# ------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadata.R'))
}
library(tidyr)
library(viridis)
library(P... |
329f4b6e053e6e2cc5f5a99cc60986ee1e21108f271dad289cb5053165a18607 | R | 6,096 | 203 | require(testthat)
require(Cardinal)
context("process-spectra")
test_that("process spectra - SpectralImagingArrays", {
set.seed(1, kind="default")
x <- replicate(9, rlnorm(100), simplify=FALSE)
t1 <- replicate(9, sort(runif(100)), simplify=FALSE)
t2 <- replicate(9, sort(runif(100)), simplify=FALSE)
t3 <- replica... |
3bddb9ec87457b1d68ff45713133740b1e1145faf849d8f2a22c00ef41a1e6f3 | R | 6,107 | 177 | setwd("./Projects/SNCSynuclein")
library("Seurat")
library("tidyverse")
library("DESeq2")
library("vsn")
library("factoextra")
library("ggpubr")
# load the Seurat object
Seurat.SNC.final <- readRDS("Step5.FinalClustering/Seurat.SNC.final.rds")
# normalize the data before plotting
DefaultAssay(Seurat.SNC.final) <- "RN... |
723a1fb2bd0d25a02a946314ee530fa49cc9a9acb4bc548e03771bfb1ff3e83c | R | 6,114 | 158 |
source("./01_load_data.R")
library(stringr)
library(boot)
library(DescTools)
set.seed(1)
save.dir <- "./"
result_file_name <- "UKB_incremental_R2.csv"
PRS.names <- c("PRS_BMI", "PRS_FG", "PRS_HDL", "PRS_HTN", "PRS_T2D",
"PRS_TG", "PRS_WC", "PRS_F1", "PRS_F2", "PRS_F3", "PRS_MetS")
phenotype.names ... |
8589ccf405b093b01a511abe38cac31c00efcd8852e97d2b65d605bcde6a2924 | R | 6,115 | 174 | #' Harvest standardized L3 input tables from upstream producer backends
#'
#' @param gpa a glm_pipeline_arguments object
#' @param l3_backend target L3 backend specification or backend name
#' @param l1_model_names optional character vector of L1 models to include
#' @param l2_model_names optional character vector of L... |
1e59e0cfa5bfd731b363e28bea621782aeac2aaa06b84bed35ba1ef383ea8870 | R | 6,131 | 192 | #' @name DEPRECATED-spc.NA.approx
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Impute missing data points
#'
#' @description
#' These \pkg{hyperSpec} functions are **deprecated** and not maintained any
#' more. You should not use these.
#' Currently they are present due to back-compatibility reasons and w... |
b849a63b5fe2cfd84ac8a84c4c50f81dda186fb02ece6a090ecb6585f6cc3f43 | R | 6,134 | 204 | ---
title: "longmod_ucsd"
author: "Veronica Mandelli"
date: "10/12/2023"
output: html_document
---
# subject classification into the subtypes is done with the WEB APPLICATION
here we print longitudinal plots to describe developmental trajectories of each autism subtype
```{r}
work_dir = ""
codepath = file.path(work_dir... |
fb8c83aef3c5fde58d025ef3d805663d865d0e85683c4c7d5e1464a23168d882 | R | 6,136 | 203 |
library("monocle3")
library(ggplot2)
library(stringr)
# Load helper functions
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
monocle_theme_opts <- function()
{
theme(strip.background = element_rect(colour = 'white', fill = 'white')) +
theme(pa... |
4673ab64af4a6a5fdd3e6e7348f0406b67ab2c614b287fb87139b7950d968f92 | R | 6,146 | 138 | train_nn_annealer <- function(train_epochs, anneal_rate, beta_weights, ...) {
trained <- train_nn(n_epochs = train_epochs[1],
beta_mse = 1, beta_prior = 0,
beta_ind = 0, beta_cov = 0,
anneal_rate = 0, ...)
pretrained_model <- trained$model
pretrain... |
abd79f41976b8e2364cbe8c0e13ef986a6e198cf7f157c8da32d53463a3d05c9 | R | 6,161 | 195 |
# library("devtools")
# library('spdep')
# load_all("/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/misc/monocle3mmVersion/monocle3")
library("monocle3")
library(ggplot2)
# Load helper functions
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
formatCe... |
76a7f26453a135331b272bfbbabbf96d8df063544489e2515106d43929daa29a | R | 6,164 | 197 | # Unit tests for glm_pipeline_arguments (GPA) object
# ===================================================
# Tests for the core gpa object structure and methods
library(testthat)
# ==============================================================================
# Tests for GPA object structure
# =======================... |
d535e51f71850e3729cf3accaf27a2e4bb51823fc09b40700e91688959b2465a | R | 6,166 | 202 | make_fwe_spec_test_gpa <- function(root, create_images = c(TRUE, TRUE),
complete = TRUE) {
l3_feat <- file.path(
root, "feat_l3", "L3m-l3_group", "L1m-facehouse",
"L2m-l2_session", "l2c-overall", "FEAT_l1c-EV_face.gfeat"
)
stats_dir <- file.path(l3_feat, "cope1.feat", "s... |
327c4045034a0f67e29b49bd8fa41120b8b12730a7f0e60aa6fc1974130a017b | R | 6,169 | 184 | make_fwe_plan_test_gpa <- function(root, create_mask = TRUE,
create_smoothness = TRUE,
scheduler = "slurm") {
l3_feat <- file.path(
root, "feat_l3", "L3m-l3_group", "L1m-facehouse",
"L2m-l2_session", "l2c-overall", "FEAT_l1c-EV_face.gfeat"
... |
54ff9cf9605ce071dfc94540456c2e29935842ceea6992bbb9fec77b6f99f173 | R | 6,169 | 119 | # Aim: find the mapt transgene sequencing after grep mapt human and mouse sequence in clustered.fasta
# while using clustered.fasta, plot shows the occurence of transgene in original raw reads
# since use the clustered_report.csv description detailing the number of raw reads clustered to each transcript
# Input:
# m... |
7f2e151923c8600b827bd8cb41cb1c9d206415cd471208d7e07dadd3e86b1d84 | R | 6,178 | 178 | #!/usr/bin/R
# -------------------------------------------------------------------------
# Determine consistent up / down patterns for each covariate
# Determine unique subtypes of DEGs for each pathology / AD measurement
# Plot coeff. + clusters of these DEGs across EC neurons
# Updated: 12/06/2021
# -----------------... |
cb018ff3d3838988f13ac91668be53a7b9fcdd54158f0aa55a0af00ab772fb08 | R | 6,187 | 153 | #!/usr/bin/R
# --------------------------------------------------------
# Calculate composition differences using binomial emmeans
# Run contrasts on 2-level categorical vars, plot heatmap
# of effect sizes (log2 OR) and adjusted p-values
# As in:
# https://github.com/vals/Blog/tree/master/201127-cell-count-glm
# Updat... |
b499023346f64d280a88c4d6e76b997018f4524d436d693b2b018231288debdb | R | 6,195 | 189 | #!/usr/bin/R
# ------------------------------------------------
# Plot example DEGs from msex*AD interaction model
# Updated: 11/16/23
# ------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(ComplexHeatmap)... |
296122e24446f1ea0261137fda502ccc8d0957feda25b1d86a12f49a7e79129f | R | 6,205 | 186 | #!/usr/bin/R
# -----------------------------------------------------
# Plot top marker overlaps between multiple cell types
# when comparing thalamus <> neocortex subtypes
# Updated 06/29/2023
# -----------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbin... |
372a8fae3264c9866755410766349de5d4634c41ab2336592961da228a8c02a1 | R | 6,217 | 189 | #' Perform the analysis of NOSA software results.
#'
#' By calling this function, all data specified under "Directories$Sheets" in the Yaml
#' file are read into data.frames. Additional parameters and plots can be defined
#' with the Yaml configuration. It is advisable to create a file with the function
#' "writeDefaul... |
16f640976cab507aabc56387b93b847d8fdbcd9b0acdbd2289a7eeda405c7599 | R | 6,218 | 190 | #!/usr/bin/R
# --------------------------------
# Run MAST on selected genes only:
# Updated: 02/23/22
# --------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(Matrix)
# For nebula:
library(MAST)
library(nebula)
library(D... |
4e01e75f3c9ac399733a721a9684c4ec44ffbacaecdba565ae019fa1a857654b | R | 6,223 | 180 | #!/usr/bin/env Rscript
# Helper script to return list of outlier samples from an svcounts.txt file,
# their reasons for being outliers, and one plot for each SVTYPE
###Set global options
options(stringsAsFactors=F,scipen=1000)
###################
###HELPER FUNCTIONS
###################
#Get list of outliers for a ... |
2b8d3a1daf1b606d5826f46273b3ad033471b2984c4b4a86866732af4a11a4a3 | R | 6,228 | 121 | ## ---------- Script -----------------
##
## Purpose: Input variables for rTg4510 Iso-Seq global dataset
##
## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk_
##
## ---------- Directory and input files -----------------
dirnames <- list(
root = "/gpfs/mrc0/projects/Research_Project-MRC148213/sl693/rTg4510/A_IsoSeq_... |
780d0499a4ba02ade69bab4ca039cedfa072a167be1f69dc5a1de01d13e21f3e | R | 6,231 | 168 | # Test Setup for fmri.pipeline
# =============================
# This file is loaded before tests run. It should contain only:
# - Package imports needed for testing
# - Global test configuration
# - References to helper files (loaded automatically by testthat)
#
# Heavy object builders and integration test utilities h... |
b08de9afd9e7fab7b63d2a9b83054907aa9636cb2a0870b5e174e03c78a79d0a | R | 6,240 | 164 | #script to do the gene and pathway analyses
#load all library
library(org.Hs.eg.db)
library(openxlsx)
library(clusterProfiler)
library(dplyr)
library(clusterProfiler)
library(diffEnrich)
kegg_hsa <- get_kegg('hsa')
#source all used functions Up_Down_GO() Up_Down_KEGG() and disease_spec_genes()
source("function_ut... |
629015ee14c27dc08393612a591459ef78e79db300207987f47a212797802578 | R | 6,244 | 170 | #!/usr/bin/R
# --------------------------------------------------------
# Calculate whether modules at psbulk level are assoc.
# with compositional changes at the cell / subtype level.
# NOTE: Particularly interested in Mic subtypes, OPC/Oli
# Nothing major - probably not the right way to go about asking this question... |
a025c18c4648e393292a6f3af5313ce6501633115b5e237297873141f5f656e8 | R | 6,246 | 202 |
library(scSeqComm)
library(topGO)
library(tidyverse)
source("function_utils.R")
load("sctransv2_pd_annotated_new.Rdata")#get Seurat object from annotate.R script
gc()
Idents(sctransv2) = "cond"
head(sctransv2@meta.data)
table(sctransv2@meta.data$classcellmarker)
sub_sctransv2 <- subset( sctransv2,idents = "... |
43408e5cecd4d6075cf6e246babf1ed664caffda86241c72f758e8af6ed61d0f | R | 6,253 | 156 | #' function to submit 3dLMEr jobs on a cluster
#'
#' @param gpa a \code{glm_pipeline_arguments} object
#' @param level GLM level to run; currently only level 3 is supported.
#' @param model_names optional subset of L3 model names to run
#' @param rerun logical, whether to rerun existing models
#' @param wait_for job ID... |
4117b51a238ac771cf196d7c912afe6437d722ea19b575ac08745e3c2ecced16 | R | 6,255 | 194 | #!/usr/bin/R
# -------------------------------------------------------------
# Calculate the cross-ct module corr. for a pair of cell types:
# NOTE: Mainly for OPC / Oli
# Updated 03/26/2022
# -------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("... |
8577bd0f79044542716506100e2c9f260368446dcfa12c6c5c3c79fa141dafd3 | R | 6,260 | 165 | #!/usr/bin/env Rscript
# Talkowski SV pipeline downstream analysis helper script
# Make reclassification table for batch effect variants
###Set global parameters
options(stringsAsFactors=F,scipen=1000)
###################
###HELPER FUNCTIONS
###################
#Process master freq table data and compute joint PC... |
754cba4a78f9435add0d53c31bcb3e5b7f390b5037c821f3e925402c5d2cadca | R | 6,269 | 141 | # PLOT_allROI
# This script creates one plot with the estimated effects for all ROIs and all groups
# for the condition you fill in (in conditions <- c(...))
# There are different parts in the script for type 1 vs type 2 models
# INPUT:
# - folder 'models': containing all the created (raw) models for each condition and... |
892f8e4a40c545989b6730970699d0c9a535aebe6cbfe020fc5814bb007ef5e5 | R | 6,282 | 170 |
library(ggplot2)
library(dplyr)
library("optparse")
library(stringr)
library(msigdbr)
library(fgsea)
library(tidyr)
library(tidyverse)
library(RColorBrewer)
print("Libraries loaded, starting now")
# Get the passed parameters
option_list = list(
make_option(c("-m", "--modelNotes"), type="character", ... |
be35216b0ace4cc6e135837716f872ecbc53473b37eb7e4e8f4ee1b7b42d81a4 | R | 6,285 | 174 | vanilla_encoder <- nn_module(
"Encoder",
initialize = function(vae_dim) {
self$n_layers = length(vae_dim)
self$layers <- nn_module_list()
self$layers[[1]] <- nn_linear(vae_dim[1], vae_dim[2])
for (i in 2:(self$n_layers - 2)) {
self$layers[[i]] <- nn_linear(vae_dim[i], vae_dim[i + 1])
... |
60f363a159c306d56a35ad7c1a45db26d4ebcd431c9ad29661dd3a16c5c552bd | R | 6,311 | 157 | #!/usr/bin/env Rscript
# Talkowski SV pipeline downstream analysis helper script
# Make reclassification table for batch effect variants
###Set global parameters
options(stringsAsFactors=F,scipen=1000)
allpops <- c("AFR","ASN","EUR","HSP")
###################
###HELPER FUNCTIONS
###################
#Process maste... |
0d4d5d8227950c4eda664a0ea51713e1746fa19d2c66f5c027d191ec27f02650 | R | 6,320 | 162 | #!/usr/bin/env Rscript
#script to pull together FSL FEAT level 1 runs into an AFNI BRIK+HEAD format for review
print_help <- function() {
cat(paste("This script converts a first-level feat directory to an AFNI-compatible stats file with",
"the afni graphical viewer. This avoids the challenge of unlabeled and uni... |
6d2084ca9ab62d2df5db8dd37801569cbc362cba7ce1d5e1ec8d3043b2972ce2 | R | 6,325 | 109 | library(dplyr)
library(Seurat)
# library(reticulate)
# reticulate::use_python("C:/Users/mauri/AppData/Local/Programs/Python/Python311")
### USER INPUT ###
seurat_file <- "C:/SynologyDrive/Projects/scRNAseqR/results/Bas_pipe_V8/A-C-N/A-C-N.qs"
##################
# MapMyCells (Allen Institute for Brain Science): https... |
2fbc5391ccb325465f5a74bd40a9c3082c8770d10d45dadf23f8640e1baf929b | R | 6,326 | 187 | #!/usr/bin/env Rscript
# Helper script to filter trio-based SV data to meet
# a set of conditions for minGQ parameterization
###Set master parameters
options(stringsAsFactors=F,scipen=1000)
###################
###HELPER FUNCTIONS
###################
#Check & clean optional arguments
checkOpt <- function(value,nume... |
f189915951dc4e7f5a0ac6ef10f616d7be8345f4482b1bee052915df476b2736 | R | 6,329 | 160 | ## Nicolas Servant
## HiC-Pro
## Copyleft 2015 Institut Curie
## Author(s): Nicolas Servant, Eric Viara
## Contact: nicolas.servant@curie.fr
## This software is distributed without any guarantee under the terms of the GNU General
## Public License, either Version 2, June 1991 or Version 3, June 2007.
##
## Plot mappin... |
c544aa5f716e546ece449962fd03cef653b25327277c4055781e126a220a5821 | R | 6,332 | 151 | # Greg Booth 2021
# This script takes the output from the BBI pipeline for sciATAC
# for each sample
# performs some filtering (by QC and doublets)
# returns a cds object of peak by cell data.
.libPaths("2")
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_03_24_reprocessHeartAlone_nobacku... |
91c70c412f8e0b9ae63b08bb926bfe353bdc307f9388d54ec755e5e20813c69b | R | 6,336 | 182 | library(tidyverse)
library(ROGUE)
library(ggplot2)
# Load data
matr1 <- readr::read_rds("/home/pauling/projects/04_SEmodel/01_data/04_rogue/10_batch/matr1_con.rds.gz")
matr2 <- readr::read_rds("/home/pauling/projects/04_SEmodel/01_data/04_rogue/10_batch/matr2_sti.rds.gz")
mda <- rbind(matr1, matr2)
info <- readr::rea... |
04073053c32ad3b30906ea496081fc88761f1c59c547e84bebc3fc8241fc6f4f | R | 6,354 | 205 | #' @name DEPRECATED-read.txt.Renishaw
#' @concept moved to hySpc.read.txt
#'
#' @title (DEPRECATED)
#' Import Raman measurements from Renishaw ASCII-files
#'
#' @description
#'
#' These data input functions are **deprecated** and they will be removed in
#' the next release of \pkg{hyperspec} package.
#' Now func... |
c8b3dfdbfe4e77c304ecbfb8f97fdab4345f5d1ee39547bd03f69a7c36f018d1 | R | 6,356 | 132 | # Given secondary path and meta information (a data frame)
# construct a merged SeuratObject.
create_merged_seurat_object <- function(secondary.path, meta=NULL, raw=FALSE, subsample=FALSE, ...) {
source('Analysis/util/matrix.r')
metric.summaries <- gather_metric_summary(secondary.path)
x <- create_from_10x(secon... |
132c5034bc7d80115cb2c218027311ce76f30f00adf215304770f64af3a420ad | R | 6,365 | 178 | #!/usr/bin/R
# --------------------------------------------------------
# Plot the aggregated DE results across different methods:
# Number of DEGs for msex * AD interaction model
# Updated: 11/15/23
# --------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(pa... |
d981c4a6c8560625ce0dfd68007d786b64fadfa7c668d82cbaf003be791669da | R | 6,371 | 190 | library(testthat)
test_that("harvest_l3_inputs resolves AFNI requests through the FSL producer and preserves subsets", {
gpa <- list(
subject_data = data.frame(
id = c("sub1", "sub2"),
session = c(1L, 1L),
exclude_subject = c(FALSE, FALSE),
stringsAsFactors = FALSE
),
l1_models = ... |
39bc105116b59d079445c751c406787e9823b85777c475b441bc34c066688bfb | R | 6,372 | 178 | rm(list = ls())
library(fmsb)
library(ggplot2)
library(ggpubr)
library(scales)
library(stringr)
library(asbio)
library(tidyverse)
library(car)
library(broom)
# -- Set ggplot basic theme
theme1<- theme(panel.border = element_rect(size = 2, colour = 'NA', fill='NA'),
axis.line = element_line(colour = "... |
04604893e4ff5f3369d7f3778397fffca949db921c8abcd351052c910bd188cf | R | 6,385 | 197 | library(data.table)
library(dplyr)
df_bim <- fread("UKB_random10k_noqc.bim",
sep="\t", data.table = F, col.names = c("chr", "snp", "cm", "bp", "ref_ukb", "alt_ukb"),
nThread = 20) %>%
dplyr::select(snp, ref_ukb)
### MetS GWAS
file_gwas <- "MetS_GWAS.txt"
df <- fread(file_gwas... |
5a1053824da2d0f1e4effacdadb5d647ff82aeaaf7fbf90f2c6daa71460d868c | R | 6,401 | 188 | #!/usr/bin/R
# ---------------------------------------------------------
# Calculate and plot the module enrichments for covariates:
# Updated 03/18/2022 (standardized figure size)
# ---------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.