sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
31907e8063394065dab0dba4675514c2b6de2e917e8649ed287b0090583a582d | R | 8,427 | 166 | ####################################################################################################
###
### File: 08_clustering_analysis.r
### Purpose: Clustering analysis of the datasets created based on EEG data
### Authors: Gabriel Rodrigues Palma, Rafael Moral
### Date: 20/06/23
###
#########################... |
b246140cc13f28f6150077aec0a4e11de99ebf04f5a55f3abe221e76322ecdf2 | R | 8,437 | 207 | # Transfer cluster labels from DS1 to DS2 using Seurat
# Input:
# data/04_DS1.ssce.Rdata: Dataset1
# data/02_DS2.ssce.Rdata: Dataset2
#
# Output:
# data/05_DS1DS2_seuratLT_anchors.Rdata : Anchors estimated bty FindTransferAnchors function
# data/05_DS2_seuratLT.Rdata : Dataset2 SingleCellExpression o... |
6f50f7b9f02f7b0206d6341633d35fa27e0b580bde2ac56b15442f62d2e8cae5 | R | 8,455 | 257 | #' Checks whether any targets contain missing data
#' @param data A dataframe
.check_for_missing_targets <- function(data) {
# check for missing values among targets
missing <- purrr::map(data, ~sum(is.na(.)))
if (any(missing[config$targets] > 0)) {
stop("Targets contain missing values.")
}
}
#' Reads... |
b8d929c6417b1b3045e85df4524a2c6f9ce3c90adb5c400bdecf23937c0dcff2 | R | 8,458 | 277 | #!/usr/bin/R
# ------------------------------------------------------------------------
# Plot cross-module scores within the same celltype (at pseudobulk level):
# Updated 11/29/2021
# ------------------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exis... |
8121905c4329c27063bc69709f4dcc9c41a0b19b2f1802589fbd74142ce5d228 | R | 8,479 | 224 | ---
title: "paper_miracidia_no_WSR"
author: "T Attenborough"
date: "2023-11-17"
output: html_document
---
```{r}
library(Seurat) #Seurat v4.0.2
library(dplyr)
library(patchwork)
library(here)
library(ggplot2)
library(clustree)
library(SingleCellExperiment)
library(scater)
library(DoubletFinder)
library(zellkonverter)
... |
f2176dd4dcee6519415c02bc61a7b74b7c634b89d3a518df1c57e2c7638fb048 | R | 8,487 | 231 | ---
title: "ARI enrichment analysis"
author: "Michael Lombardo"
date: "13/10/2023"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, warning=FALSE, message=FALSE}
library(easypackages)
libraries("here","tidyverse")
# make genelistOverlap function
genelistOverlap <- ... |
744d4b74200c8b77cf462db5f0247b3573455cee58bd7bd471a47c3339b023b6 | R | 8,499 | 204 |
hardAssignDonorAges <- function(inputCDS){
colData(inputCDS)$Age = 0
colData(inputCDS)$Age =ifelse(colData(inputCDS)$Donor == "W134", 43, colData(inputCDS)$Age)
colData(inputCDS)$Age =ifelse(colData(inputCDS)$Donor == "W135", 60, colData(inputCDS)$Age)
colData(inputCDS)$Age =ifelse(colData(inputCDS)$Donor == "... |
5d949b95de6a795b74541783fcd28954725be89f729511138f2b96768c934d51 | R | 8,507 | 223 |
# Get functions
library(monocle3)
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
# modStatus <- loadMonoclePackages()
library(tidyr)
library(ggplot2)
# Note: Need bedtools loaded for this! bedtools/2.29.2
library(cicero)
# Add this to stop R from formatti... |
d640e09149763ba8435ec774cf1635acfae480b33db7ad55551eb20a8730bee6 | R | 8,515 | 282 | #!/usr/bin/R
# -----------------------------------------------------------
# Consistency of DEG directionality in the neuronal subtypes:
# Updated: 12/20/22
# --------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(... |
f9c0bb21e3005a4ecc8d2ec1258677e67019caca34619e230a3c1429e90cb549 | R | 8,524 | 252 | #!/usr/bin/R
# ---------------------------------------------------------
# Plot functional and category enrichments for inset plots:
# Updated 12/09/2022
# ---------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, '... |
fe2d8a6bf530b1ce3fcf2e2b94b1697fb2b708adba255a912d134fcb204c9995 | R | 8,530 | 206 | wd <- "~/projects/chimp_human_opnmf/"
setwd(wd)
# load in libraries needed for script #
# need to install pacman if not already installed
if (!require("pacman")) install.packages("pacman")
pacman::p_load(fs, ggplot2, dplyr, tidyr, reshape2, readr,
broom, tibble, sfsmisc, cocor, oro.nifti, neurobase, gg... |
f419b33c91b9b3efb1593b2fd5f09e95b7b86bbf70ec047f42b6051be197fea5 | R | 8,539 | 222 | ---
title: "remove_ZSR"
author: "T Attenborough"
date: "05/11/2023"
output: html_document
---
```{r}
library(Seurat) #Seurat v4.0.2
library(dplyr)
library(patchwork)
library(here)
library(ggplot2)
library(clustree)
library(SingleCellExperiment)
library(scater)
library(DoubletFinder)
library(zellkonverter)
library(basi... |
aace335512eb435acfbc844011e68fc20d3e9bf2fbdc2162dbae599a4a38c557 | R | 8,541 | 250 | #!/usr/bin/R
# -----------------------------------------------------
# Auxiliary functions for GO term pruning and plotting:
# Updated: 03/22/2022
# -----------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
librar... |
0ee53b2ee01872f363a7d07ebc5b7f25953ecaacfb717b7b58a20a1ae32b933e | R | 8,554 | 238 | #!/usr/bin/env Rscript
# Performs ROC analysis on de novo rate to determine optimal
# GQ threshold for a single condition in the v2 ROC workflow
###Set master parameters
options(stringsAsFactors=F,scipen=1000)
###################
###HELPER FUNCTIONS
###################
#Read & clean trio variant data
readTrioDat ... |
f45993c39f5e7a8ed2e72e002d4b38823e6fc5a499a5dd01ce8cab1f471fbc43 | R | 8,574 | 226 | ---
title: "remove_the_gametologues"
author: "T Attenborough"
date: "21/10/2023"
output: html_document
---
```{r}
library(Seurat) #Seurat v4.0.2
library(dplyr)
library(patchwork)
library(here)
library(ggplot2)
library(clustree)
library(SingleCellExperiment)
library(scater)
library(DoubletFinder)
library(zellkonverter)... |
7ddefea6f4fd04af14d144e9f5352592a9abd9aeef1c3a27a8363144f43a498f | R | 8,589 | 232 | #!/usr/bin/R
# ----------------------------------------------------------------
# Use the pathology to run some tests on linear mixed models:
# Using Liang's Nebula package to run the fast NBLMM
# Basic overall + per-region interactions, for relevant subtypes
# Updated: 10/28/2020
#
# Actually plot the runs for plot_d... |
c4fd9257b35693b838fdb1f0ce31d767ab1bdacd5ffac886780e24df8e01f095 | R | 8,597 | 231 | #
# Regulon analysis for DS2
#
# This script launches an entire SCENIC analysis of DS2
# In order to reproduce the paper results you should consider the following cisTarget DBs:
# mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-500bp-upstream-7species.mc9nr.feather
# mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm... |
9dd74f396ad40fc1a69ab4bfa722e628ab554873664d869be2b0f2497a7e1623 | R | 8,606 | 249 | #!/usr/bin/R
# ---------------------------------------------------
# Investigate differences between opc + oli subtypes:
# Updated 03/08/2021
# TODO: Re-factor as with ast, immune.
# ---------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_metadat... |
a15a52e44a745a943b3e635c99e3727d52445d337c88b95614bc25fcd1bd3d05 | R | 8,609 | 196 | library(fmri.pipeline)
## ----- 3DFWHMX
# TESTS
# path <- "/proj/mnhallqlab/studies/MMClock/MR_Proc/10637_20140304/mni_5mm_aroma/sceptic_vchosen_ventropy_dauc_pemax_vtime_preconvolve/FEAT_LVL1_run1.feat"
# res4d_file <- file.path(path, "stats", "res4d.nii.gz")
# fwhmx_mask_file <- file.path(path, "mask.nii.gz")
# t... |
96a7b0b98da24b2b30850aafd3099e9166157713189fdf0ad5349e8d7e858280 | R | 8,615 | 230 | #!/usr/bin/env Rscript
# Talkowski SV pipeline downstream analysis helper script
# Compute & plot AF correlation coefficient
###Set global parameters
options(stringsAsFactors=F,scipen=1000)
svtypes <- c("DEL","DUP","INS","MCNV","INV","CPX","BND")
allpops <- c("AFR","ASN","EUR","HSP")
###################
###HELPER... |
2ab5cf39f716a176503ce3ecf549b2285ec339ddd76d90da76a96ff93ee2d9e4 | R | 8,624 | 211 |
## ---------- AD gene list -----------------
# Most recent human AD GWAS 2022
# convert human genes to mouse homologues
ADGWAS <- read.table(paste0(dirnames$glob_metadata,"/ADGWASBellenguez.txt"), col.names = c("human"))
mouse2humanconversion <- read.csv(paste0(dirnames$utils, "mousehumangeneconversion.csv"))
ADGWAS... |
904a8aedee55d117ca3daaf0182d365b9c32f35ec78dc19bb862fed97cbda575 | R | 8,656 | 220 | ---
title: "Comparison of C>T variants according to m/k value"
output:
html_document:
self_contained: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
In this document we compare the distribution within 500 nucleotides of the stop codon for variants with m/k=1 (conserved variants), a... |
eccb2669df0a7373e4b1c9144ce6753b2d32504793af572aa458911614838015 | R | 8,660 | 233 | # For the specified k, find ICC(1,1) between the session averages across runs
# for each network reconfiguration metric.
# Output:
# cout,'.jpg' ICC matrix plots for transition distance, transition probability, k-wise metrics, transition number, and a sample matrix for formatting. Also, ICC interpretation legend.
#Set... |
41f9ff2584553dc022eeb3543ca18cfd83d589c7c7a27e05cf2b64e1242ae19d | R | 8,665 | 155 | check_designmatrix <- function(X, f_name, require_2d = FALSE) {
tryCatch({
X <- as(X,'matrix')
}, error = function(e) {
stop(paste0(f_name,': could not convert X to matrix using as(X,\'matrix\'). Please check that X is coercible to matrix, such as a matrix, dgCmatrix, or data.frame.'))
})
if(dim(X)[1] =... |
e422636ba8e81720b6f2edef316af60d69bf484a740449f44408e3cf982cecbf | R | 8,669 | 279 | #!/usr/bin/R
# -------------------------------------------------------------
# Cluster the DEGs consistently up/down in vulnerable subtypes:
# Plot the DEGs as volcano plots + their GO enrichments
# Updated: 12/06/2021
# -------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', ... |
b3c86f3495d5abf692a60267a8c78fbfa4d45ff73b1a520d0a504e125fb38910 | R | 8,699 | 211 |
#' ---
#' title: "Barcoded extraction and reduction from RNA samples"
#' author: "Tomas Bjorklund"
#' output:
#' pdf_document:
#' highlight: tango
#' geometry: margin=0.7in
#' ---
#' This workflow identifies correct amplicons from in vivo & in vitro samples and extracts the barcode. Barcodes are then reduced usin... |
02583f29f107de3451e07a2d7bb5ed1402d00c067f7234785538faadc1b55560 | R | 8,701 | 152 | # Szi Kay Leung: sl693@exeter.ac.uk
suppressMessages(library("data.table"))
suppressMessages(library("stringr"))
LOGEN <- "/lustre/projects/Research_Project-MRC148213/lsl693/scripts/LOGen"
source(paste0(LOGEN, "/aesthetics_basics_plots/pthemes.R"))
source(paste0(LOGEN, "/aesthetics_basics_plots/draw_density.R"))
sourc... |
5e65e13e35ec669db3df0ae2da18e7c08e5b98094b479ec22333a5f7465f4011 | R | 8,701 | 216 |
#' archstabms__tile_heatmap_wrapper
#'
#' ggplot tile heatmap wrapper.
#'
#' @param input_matrix matrix of heatmap values (required)
#' @param output_file plot output file path
#' @param width plot width in "units"
#' @param height plot height in "units"
#' @param units plot size units ("in", "cm", or "mm")
#' @param ... |
bd916f82a7d1f79d6a498783e9e401f64b931c1949f73c593e2d2b350e55e809 | R | 8,707 | 169 |
#' archstabms_thermo_model_results_datasets
#'
#' Evaluate thermo model results of multiple datasets.
#'
#' @param dataset_names character vector of dataset names (required)
#' @param literature_free_energies_list list of paths to literature free energies (default:list())
#' @param ddPCA_free_energies list of paths to... |
0c91473a23b250098eae6b8356eb8e7bf93ab430eceb733ace55d8c2cff14f29 | R | 8,722 | 169 | ---
title: "Diagnosing a run of fmri.pipeline"
author: "Zach Vig"
date: "15 August 2025"
output:
html_document:
code_folding: show
df_print: kable
mathjax: default
number_sections: yes
theme: spacelab
toc: yes
toc_depth: 2
pdf_document:
code_folding: show
df_print: kable
numb... |
9bfbdcaf6aaf3d17b2fdae38dd1e2903f95b7f8c7b9098b008fb714e62288ad4 | R | 8,725 | 225 |
setwd("/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_09_08_meta_mixed_DE_nobackup")
###########################################################################################
# Load relevant packages
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
l... |
e588182dcbe15805e52c465aa05e6a605be1ecdffbf8ff6e81ab3235dd9a6a67 | R | 8,731 | 243 | #!/usr/bin/R
# ---------------------------------------------------------
# Plot basic marker differences between astrocyte subtypes:
# Updated 11/26/2021
# ---------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
... |
5093101d7aa634d47cdfb389f997fa4577feddb026d2e18b904c741922d4ac99 | R | 8,783 | 260 | #!/usr/bin/R
# ---------------------------------------------------------------
# Plot module umaps and with the functional enrichment resources:
# Updated 03/18/2022 to standardize sizes
# ---------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("ce... |
a14f6b8d60e631ec2082bb78816022ab7e0a3f698c979503fbafc9846a827852 | R | 8,785 | 254 |
#### Legacy Cardinal 1.0 classes ####
## These classes and methods operating on them are
## now deprecated; the class definitions will remain
## for backward-compatibility with CardinalWorkflows
## and to support coercion/updating to newer classes
.Deprecated_Cardinal1 <- function(class1 = "MSImageSet",
class2... |
64ebc69d598866fef87cf1e34d4e0a405715a3f9db04197f709053a7d06e5dc8 | R | 8,786 | 204 | summarize_results_from_dna <- function(dataset = c("facebase", "neuroblastoma"),
measure = c("corr", "pcor"),
lp = 1,
pair_name = c("Lateral", "Medial", "Nasal", "Oral"),
... |
4365a61a2626ecd8e9ee7eae750e95e0d713798f7b9999b1007a91ed32574b17 | R | 8,813 | 261 | #' Generate a weave plot based on a palette of colors
#'
#' @param palette a character vector containing colors as either hex values (starting with #) or R colors
#'
#' @return a ggplot2 plot showing all intersections of the palette.
#'
weave_plot <- function(palette) {
n <- length(palette)
h_data <- data.... |
4e5c92c0550d604f2acdd8c9ba1bb96647e40747563aee0000158a60b7f13849 | R | 8,816 | 333 | if (identical(.Platform$OS.type, "windows")) {
test_that("FLAME runner behavioral tests require POSIX shell semantics", {
skip("requires executable shell scripts and POSIX process semantics")
})
} else {
test_that("flame_runner uses parallel and clamps to allocation", {
tmp <- withr::local_tempdir()
stub_d... |
cd5f6fbda4c0bfa11248006ddfa67dcf9444b64aa876b0adbf21bc6d26b6d0a4 | R | 8,819 | 174 | ####################################################################################################
###
### File: 01_data_visualisation.R
### Purpose: Obtaining the features related to the coordinates.
### Authors: Gabriel Rodrigues Palma, Rafael Moral
### Date: 05/04/23
###
#####################################... |
494e84aadf84d7e3d65c79911d3d261653ae4d39fae3c957e88a0df421728966 | R | 8,848 | 285 | #!/usr/bin/R
# ---------------------------------------------------
# Plot contours around peaks for modules on the UMAP:
# Updated 01/19/2023
# ---------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadata.R')... |
85811c37a1e5c7b1e20f0cc9da9644eab77faaa1c572e37f9d2d5df0e0edfffd | R | 8,849 | 206 |
library(tidyr)
library(ggplot2)
library(glmnet)
library("optparse")
# Get the passed parameters
option_list = list(
make_option(c("-p", "--pValFIMOcutoff"), type="numeric",
default=1e-6,
help="Max FIMO p value to retain match", metavar="character"),
make_option(c("-f", "--feature... |
5d5cb05fba7f7d3bf1f59e5fb0e28a86276005bc9eb90ced85c9a6b6bd42eea7 | R | 8,859 | 255 | # compare_branches_job.R
#
# Launch two RStudio background jobs – one for each branch – that install the
# selected sccomp branch, run a lightweight model fit on the built-in
# `counts_obj` test data, and save the results to disk. When both jobs are
# done you can load the two *.rds files and compare ESS / estimates.
... |
7ecab19d1b358ed8f50a03c343cbe2e2037e7ecb4b2384f4baec0675582fbc00 | R | 8,917 | 215 | #essential structure
# - time data: time, signal, unit (voxel/region) ([voxels + time] x signals)
# - metadata: id, trial, events (trials x signals)
# - time -> unit mapping: vnum, atlas_value, region etc. (units x grouping)
#ts_data
# $time: time index
# $signal: only used if there is more than one value column (mult... |
b41df1780c385bd361440b51ff878d384c384bf8e42765cc2dafa3fd0dfbbcae | R | 8,919 | 162 | ---
title: "Contribution guide"
output:
html_document:
toc: false
---
# {.tabset}
## Introduction
### Thank you
for contributing to PMLB!
We want this to be the easiest resource to use for benchmarking machine learning algorithms on many datasets.
This is a community effort, and we rely on help from users like... |
4f3471da08a70065aa6b68664ac5d8733fd578231f82e172254ce4f3a9d155f9 | R | 8,932 | 228 | #!/usr/bin/env Rscript
# Performs PCA based on an input VCF
###Set master parameters & load libraries
options(stringsAsFactors=F,scipen=1000)
require(e1071)
########################
###RSCRIPT FUNCTIONALITY
########################
require(optparse)
###List of command-line options
option_list <- list(
make_opti... |
93bc0ecb1089ac24ff9acec12f067801ba9627e3e5db68723859f7f100817494 | R | 8,952 | 251 | #!/usr/bin/R
# -----------------------------------------------------------
# Plot the cellular subtype - motif network for visualization:
# Updated: 03/11/2021
# -----------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
librar... |
5817af0ba7a400ee40b0987fa2bdd5462b06daf0e15687322733a76cfeaae44c | R | 8,962 | 231 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Internal function to convolve two vectors using nested for loop
#'
#' @name convolve_cpp
#' @param a A vector
#' @param b A vector
#' @return A vector containing the convolution of a and b
#... |
17b51e432ef0b52514afc3406f12740f6af5a03aa47ecb7e69e30ba77198c99d | R | 8,973 | 187 |
#' ---
#' title: "Clustering Polypeptide motifs using the Hammock hidden Markov model peptide clustering of organoid samples"
#' author: "Tomas Bjorklund"
#' header-includes: \usepackage{longtable}
#' output:
#' pdf_document:
#' highlight: tango
#' geometry: margin=0.6in
#' fontsize: 9.5pt
#' ---
#' This script ... |
b8cbcc691c96649f274db8c09cd7b9b039e2dd73e83a66db3dc403d3644d5949 | R | 8,976 | 299 | library(testthat)
test_that("get_l1_confounds initializes defaults when cache is missing and no confounds are requested", {
tdir <- tempfile("confound_cache_fallback_")
dir.create(tdir, recursive = TRUE)
sqlite_db <- file.path(tdir, "cache.sqlite")
run_nifti <- file.path(tdir, "run.nii.gz")
file.create(run_... |
ff28d3ad8d9664402927fc36144f294abf0c60c58c522b96d62ef593e9a731e3 | R | 8,979 | 190 |
#' ---
#' title: "Clustering Polypeptide motifs using the Hammock hidden Markov model peptide clustering"
#' author: "Tomas Bjorklund"
#' header-includes: \usepackage{longtable}
#' output:
#' pdf_document:
#' highlight: tango
#' geometry: margin=0.6in
#' fontsize: 9.5pt
#' ---
#' This script clusters Polypeptide... |
f8e3c6a6777e077f3fdba303067a29451a80d13872213aede8f1cbfb8cd72f24 | R | 8,989 | 217 | ---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
```{r gh.url, echo=FALSE}
ghurl <- function(x) {
x <- unlist(x = ... |
7a9088f24365035158524fecc9cfdbec85c394506855f1ae35042d3940c1f1ee | R | 8,993 | 286 | ---
title: "THRA Isoform 1 and Isoform 2 Relative Expression"
output:
html_document:
toc: True
toc_float: True
df_print: paged
---
INTRODUCTION to the Experiment
A total of 24 samples of human tissues. RNA seq data. First-Stranded pair-end reads. Read counts of exon 9a (Chr17:40089333) and exon 9b (Chr1... |
f44c5380dce00b70a604b56ba13c13e586ab566055e1ce1428245efc1865d8b2 | R | 9,008 | 169 | ---
title: "001_original_gastruloid"
author: "Nobuhiko Hamazaki"
date: "7/15/2022"
output: html_document
---
```{r}
library(dplyr)
library(Seurat)
library(patchwork)
library(ggplot2)
library(stringr)
library(RColorBrewer)
library(tidyseurat)
library(cowplot)
library(Signac)
library(viridis)
library(ggthemes)
library(ne... |
d9b32e18e52c59180f03bde71ee42b06b3131e378d386dad1e5db29a6b7147be | R | 9,034 | 257 | #!/usr/bin/R
# --------------------------------------
# Investigate differences in TH neurons:
# Updated 04/26/2021
# --------------------------------------
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
library(tidyr)
library(qvalue)
library(lme4)
library(emmeans)
library... |
e15adb7945a01e045af017fa2ece95f2bad09c37f460cf2cf4dbba80928509bc | R | 9,049 | 237 | ---
title: "remove_ZSR_keep_gameto"
author: "T Attenborough"
date: "05/11/2023"
output: html_document
---
```{r}
library(Seurat) #Seurat v4.0.2
library(dplyr)
library(patchwork)
library(here)
library(ggplot2)
library(clustree)
library(SingleCellExperiment)
library(scater)
library(DoubletFinder)
library(zellkonverter)
... |
fe505d40ca91d7418104d836212c1a26cce926165a7b4b0da290ecce9d2e634c | R | 9,068 | 252 | {
library(parallel)
}
#=======Read files========
n1 <- readline(prompt="Enter file address: ")
no_cores<-readline(prompt="Enter number of CPUs: ")
genome<-readline(prompt="Enter the source of genome(hg19/hg18): ")
no_cores<-as.double(no_cores)
input_case<- read.csv(n1,header = T)
input_control<- read.csv('/Users/soud... |
3f3df149c9b0039416e84501c0a9b5d6b24d7c55909971632972aec35e361d1a | R | 9,069 | 232 | #' Fit a linear mixed model with Julia MixedModels
#'
#' \code{jlmer()} is an \code{lme4::lmer()}-style wrapper around Julia's
#' \code{MixedModels.fit()}. It fits the model in Julia, then converts the result
#' back to an R \code{lmerMod} object through JellyMe4 so downstream R tooling
#' such as \code{broom.mixed}, \... |
691cc50827a5300d07742bbd881c6c505ee39891ccf3f57ed360f12088290160 | R | 9,072 | 257 | #!/usr/bin/R
# ----------------------------------------
# Calculate markers of vulnerable neurons:
# Updated: 12/23/2021
# ----------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(viridis)
library(ggplot2)
library(ggr... |
b57bfdb86d2964e69563d3dfef79adeaddcbba89aa1f678473837c322e814cb4 | R | 9,076 | 240 | #!/usr/bin/R
# -----------------------------------------------------------
# Use MAST + RE to run differential gene expression
# - ACROSS ALL REGIONS x per celltype subdivision
# Submit as chunks (633 -> 30 chunks) per combination.
# Updated: 01/29/2021
# OLD version of analysis.
# -------------------------------------... |
f6a2d1e6c6f77a6d174c006a9e627cf0b079ab57244f2a482aca5abc9438acec | R | 9,117 | 198 | ---
title: "neb_figs_paper"
author: "T Attenborough"
date: "2023-11-15"
output: html_document
---
```{r}
library(sleuth)
library(patchwork)
library(here)
library(RColorBrewer)
library(tidyverse)
library(ggrepel)
library(rhdf5)
```
```{r}
st=format(Sys.time(), "%Y-%m-%d")
st
```
The first step in a sleuth analysis i... |
67eed287e2b2501508b450cba36a76c300297012e04df035259bc6e3fafdf7ca | R | 9,135 | 284 | # For the specified k and cognitive variable, show box plots for the distributions
# of reconfiguration metrics across subjects. Additionally, explore coloring by
# significant correlations for box plots and bar plots.
# Output:
# unipath,'distplots/,namedyn,'.jpg' Box plots for each reconfiguration metric.
# unipath,'... |
dbc9e49aae9526e0337fb1b0a364937289c7548d302079e534ded56873ae0c1d | R | 9,136 | 187 |
#' ---
#' title: "Clustering Polypeptide motifs using the Hammock hidden Markov model peptide clustering"
#' author: "Tomas Bjorklund"
#' header-includes: \usepackage{longtable}
#' output:
#' pdf_document:
#' highlight: tango
#' geometry: margin=0.6in
#' fontsize: 9.5pt
#' ---
#' This script clusters Polypeptide... |
8bf93f4bbc02fedef3baaaa1fccda665f12f0747e53fd0e20ae6672291b6783e | R | 9,161 | 297 | library(testthat)
make_setup_l1_test_gpa <- function(n_subjects = 1, n_runs = 2) {
gpa <- create_mock_gpa(
n_subjects = n_subjects,
n_runs = n_runs,
include_l1_models = TRUE
)
gpa$run_data$run_nifti_present <- TRUE
gpa$run_data$tr <- 1.0
gpa$run_data$nvoxels <- 100000L
gpa$output_locations$set... |
592e162de09e3684345c3eecdab3f2da4e7cf2097f720eea652004705de86798 | R | 9,199 | 281 | #!/usr/bin/R
# ------------------------------------------------
# Differential expression for excitatory subtypes:
# Updated: 09/10/21
# ------------------------------------------------
# Aggregate number of sign. genes:
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
library... |
357d98a9cc701126ecee04cfb958914ab44f94bee40a0f597fb395b565e2d13f | R | 9,200 | 329 | options(bitmapType='cairo')
args <- commandArgs(TRUE)
dir<-args[1]
inputFile<-args[2]
headerSize<-as.numeric(args[3])
headerSpacing<-as.numeric(args[4])
binSize<-as.numeric(args[5])
binSizeDistance<-as.numeric(args[6])
imageWidth<-as.numeric(args[7])
imageHeight<-ceiling(imageWidth/8)
yBound<-as.numeric(arg... |
25ed45a9d99f194af74f63c8870a4b45e230a81dbdaa87b35f57a6e4865ab541 | R | 9,218 | 242 | library(SingleCellExperiment);library(tidyverse);library(reticulate);library(tidyverse)
library(ggplot2);library(scmap);library(fmsb);library(ggsci);library(ROGUE);library(loomR)
library(Seurat);library(M3Drop);library(ROCR);library(cluster);library(parallel);library(scran)
# Load data
datapath <- "/home/pauling/proje... |
098f047370bfeb7d1959f92d8c8c04e88dfd83e2dddf69502725def54ec27fa0 | R | 9,245 | 265 | ---
title: "HEK_YTH-E_vs_E-YTH"
output:
html_document:
self_contained: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
In this script we compare C-to-U editing sites for YTH-E and E-YTH in HEK293T cell lines.
For obtaining these variants we have:
In each replicate:
- Kept only va... |
404f95640ba95f69e3ccecbfe90dabce2a9bdfb9083f1514acd78055a6fe4731 | R | 9,292 | 293 | # Process de-novo Dataset1 discarding non-reproducible nuclei detected in DS1x
# Generate the k=40 MKNN graph
# Louvain clustering + refinement
#
# input:
# data_raw/01_DS1x_raw_ssce.Rdata :
# data_aux/01_DS1x_DblFinder.Rdata : pre-calculate doublet detection results
# data_aux/04_DS1_clusterIDs.Rdata : clus... |
2567a1f385ad30b5ca49b996fbb1aa41991f2c745ad8d8d9323a978c7099ae4b | R | 9,327 | 263 | #' internal function to populate l1_model_set onsets from spec specification
#' @param l1_model_set An L1 model set.
#' @param slist Parsed signal/model specification list.
#' @param trial_data Trial-level data.
#' @param field_names Fields to populate from the specification.
fields_from_spec <- function(l1_model_set, ... |
fbed505f719952091c1bff021547ae3c6d083106eabfa810c49d9c9f5be5bcbf | R | 9,331 | 185 | #this script is not dependent on run_model_index because it reads raw data at l1
Sys.setenv(fsl_pipeline_file="/proj/mnhallqlab/projects/clock_analysis/fmri/fsl_pipeline/configuration_files/MMClock_aroma_preconvolve_fse_groupfixed.RData")
Sys.setenv(run_model_index=1)
to_run <- Sys.getenv("fsl_pipeline_file")
run_mod... |
76839fbcb028a897d15c5dd9980d1280ebf6557f448cf151d1fe245c762c95f4 | R | 9,333 | 283 | run_spm_contrast_script <- function(script, arguments) {
system2(
rscript_executable(),
c("--no-save", "--no-restore", script, arguments),
stdout = TRUE,
stderr = TRUE
)
}
test_that("generate_spm_contrasts_from_model maps L1 contrasts to SPM columns", {
skip_if_not_installed("R.matlab")
tmp_di... |
0fd57a5ad2f8552950d00c9139268731aa70788f74b1a80c20bcb2eb4f36c01c | R | 9,356 | 250 | ---
title: "remove_ZW"
author: "T Attenborough"
date: "11/11/2023"
output: html_document
---
```{r}
library(Seurat) #Seurat v4.0.2
library(dplyr)
library(patchwork)
library(here)
library(ggplot2)
library(clustree)
library(SingleCellExperiment)
library(scater)
library(DoubletFinder)
library(zellkonverter)
library(basil... |
43b46ab14bbf28f1e10886b034ea08f30e55a646f0385de1db834ce16c5bc9be | R | 9,361 | 345 |
#### Plot spectra ####
## -------------------
# MSImagingExperiment
setMethod("plot", c(x = "MSImagingExperiment", y = "numeric"),
function(x, y, ...) plot(x, i = y, ...))
setMethod("plot", c(x = "MSImagingExperiment", y = "character"),
function(x, y, ...) plot(x, formula = y, ...))
setMethod("plot", c(x = "MSIm... |
c8b99ca7291691facb68f8ddd0a7830d21ef91c29a628d66627353440966cce8 | R | 9,371 | 210 | # MODEL_DIAGNOSTICS
# This script runs an analysis on the created models to check them for assumptions.
# It includes caterpillar plots, Gelman-Rubin statistics, checking for divergent transitions,
# effective sample size and a sensitivity analysis.
# INPUT:
# - folder 'models': containing all the created (raw) models... |
7b2652947d7cd42ac7f30a133a6e8c2f71e0f9fd7237cb98c28f85fa960ce5fc | R | 9,374 | 288 | options(bitmapType='cairo')
minor.ticks.axis <- function(ax,n,t.ratio=0.5,mn,mx){
lims <- par("usr")
if(ax %in%c(1,3)) lims <- lims[1:2] else lims[3:4]
major.ticks <- seq(mn,mx,1)
labels <- sapply(major.ticks,function(i)
as.expression(bquote(10^ .(i)))
)
axis(ax,at=major.... |
0d464954d021f89f8e59fd33792afd35ab787f644554ce5fdc7c7a9f31089865 | R | 9,415 | 225 | #!/usr/bin/R
# -----------------------------------------------------------
# Use the pathology to run some tests on linear mixed models:
# Using Liang's Nebula package to run the fast NBLMM
# TEST on the PFC data:
# Updated: 10/14/2020
# -----------------------------------------------------------
library(cbrbase)
set_p... |
9704a7e02af84078d90592e231850cd0e1ad40a1c6632458d7c0f092926eb9cf | R | 9,417 | 246 |
readHeartCDS <- function(pathToBBIdirs){
# List of samples to read in. Note that W137 failed in this prep, so I'm reading in all 14 others
samplesToRead <- c("W134.Apex", "W135.Left.Vent", "W136.Apex", "W136.Left.Vent",
"W139.Apex", "W139.Left.Vent", "W139.Right.Vent",
"W13... |
24f7161dd1835e81698333ae02e796a21cdd7756d8f0cde235ce134882e3243a | R | 9,436 | 185 | ```{r init}
library(Matrix)
library(tidyverse)
library(biomaRt)
library(monocle3)
library(rgl)
library(tricycle)
library(SignacX)
library(princurve)
library(ggplot2)
library(Hmisc)
library(pheatmap)
library("ComplexHeatmap")
library(circlize)
library(dplyr)
library(ggrepel)
library(latex2exp)
```
```{r loadData}
cds<-... |
b825213b5fa20dee10ae7a25e5e2240db99e784810c4f07195ba76febd7b3587 | R | 9,437 | 252 | library("Seurat")
library("tidyverse")
setwd("./Projects/snRNAseq/Step12.SubclusterAnalysis")
############################## Ex ###############################
setwd("/research/labs/moleneurosci/bug/data/ZH_processing_data/SnRNA.SNC/Ex")
Ex.Seurat <- lapply(list.files(pattern = "*.rds"), readRDS)
names(Ex.Seurat) <- ... |
8e6fd199afe7f1ba0cb22a1f781866fa5d2ae99771b7d2f7b4e2f91ebe43214c | R | 9,444 | 292 | ---
title: "R Notebook"
output: html_notebook
---
```{r}
library(SingleCellExperiment);library(tidyverse);library(reticulate);
library(ggplot2);library(scmap);library(fmsb);
library(ggsci);library(scibet);library(Seurat);library(M3Drop);
library(ROCR);library(cluster);library(parallel);library(RaceID);
library(SC3)
``... |
57c03e12b60b3f8ff2a7f6ba6abff3611b585c2e829d66841ad02507d7194fe5 | R | 9,476 | 233 | #' Main function for estimating ASE in single-cell data
#'
#' Fits a beta-binomial model for each gene and returns a results data frame.
#'
#' @description This function fits a beta-binomial model and returns estimates
#' of p and confidence intervals
#'
#' @param matrix1 a matrix of counts where the rows are genes a... |
6ba7d5c19c2f593bc401e2cd9c866ff56663ac33a07a3826f47cd90904936ca9 | R | 9,479 | 255 | #!/usr/bin/R
# ----------------------------------------------------------
# Plot the per-sample scores of regional DEGs (from nrad)
# - Compare across regions, staging.
# Updated: 02/27/23
# ----------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(bind... |
e123067eb3908bc36df059ea78ac5a445aee82dcbdcc85d24d811349aefa5cc4 | R | 9,482 | 200 | ---
title: "ThalamicAndCortical_Organoid_snRNAseq"
author: "Cody Ramirez"
date: "4/24/2023"
output: html_document
---
```{r}
CodyFunctions = paste(main_path, "Programs/Single_Cell_Analysis_Functions.R", sep = "")
source(CodyFunctions)
full_path <- paste(main_path, "ThalamicAndCortical_Organoid_snRNAseq", sep = ""... |
003745063530020efe09ace7f689584517cada1d80ac369e8658cd827ced8674 | R | 9,484 | 217 | #' Obtain user input from the console
#' @param prompt The character string to place on the line preceding the user input prompt. For example, "Enter location"
#' @param prompt_eol The character string to place at the end of the prompt line. For example, ">"
#' @param instruct The instructions to display above the prom... |
cb372428ec4b16405d485c8f6c67344d957db97a3169b2c66fec177d47bd620e | R | 9,551 | 417 | suppressPackageStartupMessages({
library(Seurat)
library(tidyverse)
library(patchwork)
})
get_heart_bb <- function(fov) {
points <- paste(
"data/mtx",
str_replace(fov, fixed("."), "-"),
"bb.csv",
sep = "/"
) |>
read.csv(
row.names = 1
) |>
_[["bb.heart", "coords"]] |>
st... |
5c3eb258931b92bfcc2090d20145db98ce25692b263f36e7a436c78e233b1402 | R | 9,559 | 255 | #!/usr/bin/R
# --------------------------------------------------------------------------------------
# Investigate the co-variation of selective vulnerability across all excitatory neurons:
# TODO: Neurons alone and neurons + glia
# Updated 12/21/2021
# -----------------------------------------------------------------... |
d27d3e72ad99a5a4bc6d425887cd0e4a44eaa4f9425f609960577367752c4146 | R | 9,583 | 200 | ---
title: "ThalamicAndCortical_Organoid_snRNAseq"
author: "Cody Ramirez"
date: "4/24/2023"
output: html_document
---
```{r}
CodyFunctions = paste(main_path, "/core/core_operations/Bioinformatics/cramirez/Programs/Single_Cell_Analysis_Functions.R", sep = "")
source(CodyFunctions)
full_path <- paste(main_path, "/c... |
d9e5e52b4934d503d91945dac8c6bae8339b46d8a72c92c46672d9e899c5ea02 | R | 9,611 | 279 | test_that("fsl_l3_model rewrites existing FSF when model is queued to run", {
outdir <- tempfile("l3_fsf_refresh_")
dir.create(outdir, recursive = TRUE)
l3_df <- data.frame(
id = "sub1",
session = 1L,
l1_model = "l1m",
l2_model = "l2m",
l3_model = "l3m",
l1_cope_name = "EV_choice",
l2... |
31d62f0b7d0d6e1a3f4863a78870fb9890fbea5e2aa0f9793085a9b9dadedcd6 | R | 9,656 | 148 | library(data.table)
library(dplyr)
##Consistency of m6A-H3K27ac bi-directional MR pairs across four tissues
##m6A-to-H3K27ac
#Merge indexes
m6A_idx_m6A2ha <- data.frame()
for(i in c("Brain", "Lung", "Muscle", "Heart")){
m6A_idx_m6A2ha <- bind_rows(m6A_idx_m6A2ha,
fread(paste0("~/Downstream_analysis/Cross_tis_... |
5d576183c9c6010ebed2da40e07dd10f6ad788b0bdf739966249cba384fa829b | R | 9,678 | 261 | #!/usr/bin/R
# --------------------------------------------------------------------------------------
# Investigate the co-variation of selective vulnerability across all excitatory neurons:
# TODO: Neurons alone and neurons + glia
# Updated 12/21/2021
# -----------------------------------------------------------------... |
6b56b838263b4cbbdc26d63e3529cf20f9d5d8bb3a6b486554f1ced9e518ea8c | R | 9,720 | 290 |
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/"
dir.create(paste0(basepath, "archr/results/"))
out_dir = paste0(basepath, "archr/results/Heart_ATAC/")
dir.create(out_dir)
setwd(out_dir)
# DFR add
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectC... |
b3606d75671557680b729e5958b2fc611744ffc9c629b568d5be490758650598 | R | 9,726 | 254 | #!/usr/bin/env Rscript
# Script to correct for GC content across a list of binCov files
# Note: Designed to be run on 24 chromosome-split files from the same library
#Requires tab-delimmed input file with the following columns:
# 1: full paths to binCov files for each contig
# 2: corresponding GC masks for each conti... |
1a6f3ebcca60e11a59608dc5c0f1c73b8401e210c75ef7672b22d0d301bcf832 | R | 9,735 | 276 | ---
title: "THRA Isoform 1 and Isoform 2 Relative Expression"
output:
html_document:
toc: True
toc_float: True
df_print: paged
editor_options:
chunk_output_type: inline
---
INTRODUCTION to the Experiment
A total of 8 samples of brain organoids at timepoints 21(x2), 46(x3) and 61(x3). RNA seq data. Fi... |
e27e1834e74dbd19f8ba313c90e53a1041544354f510959e11a2ba222897ff37 | R | 9,735 | 174 |
#' archstabms__plot_additive_trait_folding
#'
#' Plot folding additive trait.
#'
#' @param mochi_outpath path to MoCHI thermo model fit results (required)
#' @param input_dt data.table with model free energy estimates (required)
#' @param RT constant (default:0.001987*(273+24))
#' @param report_outpath output path for... |
c60d5c5a2ed6e2e8f8d6287bd96a4624bb8c3d124a10e5b75e0d0b5988cdc1ac | R | 9,738 | 240 | library(data.table)
library(dplyr)
library(ggplot2)
library(ggpmisc)
library(patchwork)
library(scales)
dir_cml_input <- "cml_ma_input/"
dir_res <- "cml_ma_result/"
dir_tsmr_res <- "tsmr_ivw_result/"
dir_out <- "cml_ma_dp_result.cML_IVW_scatter_plot/"
dir.create(dir_out, showWarnings = FALSE)
# cML results
file_in_cm... |
7aec7e4c48ade852f5785eba8ee2c12a74bcb7003804bd98c369243914c5f8e9 | R | 9,740 | 200 | # devtools::install_github("kushnerlab/scRNAseqR")
library(EMC.SKlab.scRNAseq)
##### USER INITIALIZATION #####
### USER CONFIG ###
# general
run_name <- "atlas_V_RPCA"
project_dir <- "C:/SynologyDrive/Projects/scRNAseqR"
samples_dir <- file.path(project_dir, "data/samples/")
# sample analysis
sample_names <- c("NS"... |
c12c5649faa36fa020722f1d1498d32d90401f8156a59b92ae97c87d7f3ac34c | R | 9,798 | 275 | ####------ Deduplicate citations function ------ ####
#'
#' This function deduplicates citation data
#' @details The following fields will be used in `raw_citations` (if provided): record_id, author, year, journal, doi, title, pages, volume, number, abstract, isbn, label, source
#' @import dplyr
#' @import progressr
#... |
7110153e585ad2ed62819f657d046c25fc2b4dc98952ff27d13088cecab6d64c | R | 9,802 | 212 | #' This function specifies a first-level GLM model in FSL based on a build_design_matrix
#' bdm object.
#'
#' @param id subject id.
#' @param session session number.
#' @param l1_confound_files optional first-level confound files.
#' @param d_obj a single-subject design matrix object generated by build_design_matrix
... |
1b0d512e0b572853c773e76db767d4143b0255cb42bfe3fbb46a68f39c5f19d5 | R | 9,828 | 214 | # devtools::install_github("kushnerlab/scRNAseqR")
library(EMC.SKlab.scRNAseq)
##### USER INITIALIZATION #####
### USER CONFIG ###
# general
run_name <- "SB_V1"
project_dir <- "C:/SynologyDrive/Projects/scRNAseqR"
samples_dir <- file.path(project_dir, "data/samples/")
# sample analysis
sample_names <- c("NS", "M", ... |
67abaf339a2cf7870058171667811aa707ce0d6614107197f063e46ed6d895e7 | R | 9,829 | 242 | #!/usr/bin/R
# ----------------------------------------------------------
# Plot the average gene expression for markers for clusters:
# Updated 09/17/2020 with final pass of doublet idenfitication.
# ----------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, '... |
d97251e18b77ef6c2fbdb30af49cd0df962af79ef2d045df287898eb33ed0ab5 | R | 9,838 | 141 | # plot label colour
label_colour <- function(genotype){
if(genotype %in% c("WT","CONTROL")){colour = wes_palette("Royal1")[2]}else{
if(genotype == "WT_2mos"){colour = alpha(wes_palette("Royal1")[2],0.5)}else{
if(genotype %in% c("TG","CASE")){colour = wes_palette("Royal1")[1]}else{
if(genotype == "TG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.