sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
e7cae9c4645a65abd9073af241826c3ffce5ba80d0333b1b11f4dacc679086c0 | R | 11,734 | 326 | # RETRIEVE NORMALIZED READ COUNTS: ---------------------------------------------
# Load RDS file that contains dbObj following normalization
dbObj <- readRDS(rds_normcounts)
# Extract normalized read counts
norm_counts <- dba.peakset(dbObj, bRetrieve = TRUE, DataType = DBA_DATA_FRAME)
# ANNOTATE PEAKS TO NEAREST GENE... |
09106b46e9631328cc820dfec149ece564fc8f6e2cc9982b3449a9e9659dec6c | R | 11,761 | 208 | #' Harmonize Multi-batch Longitudinal Data
#'
#' \code{longCombat} function will implement longitudinal ComBat harmonization for multi-batch longitudinal data. Longitudinal ComBat uses an empirical Bayes method to harmonize means and variances of the residuals across batches in a linear mixed effects model framework. ... |
1fad5a9c5557502b1a218037a7933fc58a63fc299de93f1e9d6f28f22d03270c | R | 11,791 | 157 | ########################
#I/O
########################
library(tidyverse)
library(ggplot2)
library(data.table)
library(ggExtra)
sample_names <- c("e174", "FC5501", "FC5801")
#read in genotyping data
loose_data_list <- list()
loose_data_list[["e174"]] <- fread("/n/groups/walsh/indData/Maya/FCD_project/analysis/2_Anal... |
52b30ffbe6f7be2890220cab8c50edb3a9bf70d41d3a40ab7b84e9d70e9f8485 | R | 11,813 | 271 | #' Plot consensus matrix as a heatmap
#'
#' The consensus matrix is a NxN
#' matrix, where N is the number of cells.
#' It represents similarity between the cells based
#' on the averaging of clustering results from all
#' combinations of clustering parameters. Similarity 0
#' (blue) means that the two cells are a... |
a20da0ffe4a6c30725464e4bbecf2a76a84b5f0eacbc7e3a85dd63a854969043 | R | 11,823 | 277 |
#### THIS CODE IS FOR EUTHERIA, RODENTIA AND PRIMATES
library(phylopath)
library(phytools)
library(picante)
library(nlme)
library(dplyr)
library(phylolm)
library(performance)
library(ggplot2)
# data_path <- file.path("Desktop/order_data/")
data_path <- file.path("eutherians.csv")
tree_path <- file.path("4705sp_mea... |
5eba257ceab174284d974f58411c1b1048ad1c2af9c4c2c716364bdcc90f1628 | R | 11,839 | 362 | m(list=ls())
library(ArchR)
library(Seurat)
library(grid)
library(ggplot2)
threads = 40
addArchRThreads(threads = threads)
addArchRGenome("mm10")
inputFiles <- './FFPE_S1.fragments.sort.bed.gz'
sampleNames <- 'S1_ATAC'
ArrowFiles <- createArrowFiles(
inputFiles = inputFiles,
sampleNames = sampleNames,
minTSS ... |
737c85432fde57977522661ddb7e9a0e9fc41ad7676071e6bec45fad41236e8d | R | 11,859 | 96 | # R script to download selected samples
# Copy code and run on a local machine to initiate download
# Check for dependencies and install if missing
packages <- c("rhdf5")
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
print("Install required packages")
source("https://bioconductor.org/bio... |
5d2e258d628c32382804738d03d6535841e444776752d4c01cb6e9e82d17893e | R | 11,949 | 312 | ## #' @useDynLib Yano depth2matrix
# Fill a complete pos x label grid for one strand, defaulting uncovered
# positions to depth 0. Duplicate (pos, label) hits are summed via
# sparseMatrix before matching back onto the dense grid.
.fill_cov_grid <- function(pos.v = NULL, lab.v = NULL, depth.v = NULL, x = NULL, y = NUL... |
52adcb49245a83e8a22dea77e69f60d8a2ddde30d6b88fd676c260b08606aa68 | R | 11,955 | 209 | ## get subnetworks from scenicplus network ##
library(ggrepel)
library(igraph)
source(file = "Scripts/lib.R")
## load data:
eRegulon_md <- read.table("Processed_Objects/eRegulon_metadata_filtered.tsv", h = T, sep = "\t")
eRegulon_AUC <- read.table("Processed_Objects/cfse_network_wArchR_peaks_eRegulon_AUC_filtered_ge... |
b616021a17c4e7e7f85a8f78fea53eddada89331e15a6cdb10abf10742fa1cd5 | R | 11,972 | 233 | #### load packages ####
targetPackages <- c('tidyverse','arrow','patchwork','emmeans')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) library(package, char... |
0c5897d5f8c8642a228d3bc2b7146da92bc1a4639065c8346d8deba4ae2ff91f | R | 12,016 | 200 | ---
title: "XGBoost for R introduction"
vignette: >
%\VignetteIndexEntry{XGBoost for R introduction}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
output:
html_document:
theme: "spacelab"
highlight: "kate"
toc: true
toc_float: true
---
XGBoost for R introd... |
72b7bdd0d40d34c36ff94d351614a9494d90023e70b72a70df8cd79d762c5032 | R | 12,049 | 236 | #### load packages ####
targetPackages <- c('tidyverse','arrow','patchwork','ggpubr','gg.layers')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) library(pa... |
29f4011fad74c6ac7f5a5645092080ff8428cf3f5a256c99e356f901297eed25 | R | 12,056 | 427 | # statistics for paper - to be sourced and inserted into the text
# Gaspar Jekely 2023
library(tidygraph)
library(dplyr)
library(tibble)
library(igraph)
library(catmaid)
library(readr)
#source("code/CATMAID_connection.R")
# read graph -------------------------
connect.tb <- readRDS("supplements/connectome_graph_tibbl... |
e59e8f520d7c4c6deddcf00450daad7f50baa296231b874c2a0f597b07826cb3 | R | 12,164 | 257 |
# THIS CODE IS FOR BATS, ARTIODACTYLS, CARNIVORES, and EULIPOTYPHLA
library(phylopath)
library(phytools)
library(picante)
library(nlme)
library(dplyr)
library(phylolm)
library(ggplot2)
# Define file paths
# data_path <- file.path("Desktop/order_data/carn_no_pinni.csv")
data_path <- file.path("Desktop/clean_orders/a... |
0e72b5584128b30fdd9dd5d9074196bc527e1d56e07604761f30b3a5abd10d0d | R | 12,167 | 232 | #' Function to define nearby genes given a list of SNPs
#'
#' \code{oSNP2nGenes} is supposed to define nearby genes given a list of SNPs within certain distance window. The distance weight is calcualted as a decaying function of the gene-to-SNP distance.
#'
#' @param data an input vector containing SNPs. SNPs should b... |
e77fbdd70f6ea641cbec5fc4278d7e6c00de6d8da0e8827643972a08cff07ff9 | R | 12,184 | 314 |
# heatmap across fps (best to worst) of time resolved decoding significances
# DEBUG
#tsums <- tar_read(data_tsum)
#data <- tar_read(data_sliding)
cluster_heatmap <- function(data, tsums){
# merge tsum onto data
data <- data %>%
left_join(tsums, by=c("emc","mac","lpf","hpf","ref","det","base","ar","experime... |
37eed53b6f7653bdf70d5d3af0a6796aeacbbc66135f6b011606ef4996b464d9 | R | 12,196 | 207 | ---
title: "Exon visualization"
output: html_notebook
---
## Read data
```{r}
library(data.table)
library(ggplot2)
library(ggpubr)
library(stringr)
library(DESeq2)
library(bedr)
gene_annotation <- fread("/Volumes/MyPassport/annotations/human/gencode/v38/gencode.v38.annotation.gene_names.tab", data.table = F, skip=1,... |
d5b25ab5457bfe7b1aa964f0d6848b8b2a239d989453bf82a1c38f9eef22ba10 | R | 12,338 | 233 | library(ggplot2)
library(stringr)
DATA_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/output/accuracy_logs/"
fixDecimalDelim <- function(x){
replaced <- unlist(stringr::str_replace_all(x,"0\\.",",0."))
replaced <- unlist(stringr::str_replace_all(replaced,"1\\.",",1."))
if(sum(is.na(replaced))>0){
pr... |
3c4fa79d0da9d870223bcb983813213c1ac981f9f8a4f6731e1ae5fda3493be6 | R | 12,395 | 300 | #' Function to score lead or LD SNPs based on the given significance level
#'
#' \code{oSNPscores} is supposed to score a list of Lead SNPs together with the significance level. It can consider LD SNPs and the given threshold of the significant level.
#'
#' @param data a named input vector containing the significance l... |
e0f8f22ed5551a97deaebcc23e95afc96f080034b97becaa74acf4b77a493e68 | R | 12,428 | 364 | # Details: Scripts used for human validation of DEGs identified by CHCHD2 point mutant (PM) mouse model, replicating this autosomal dominant form of PD.
library(readxl)
library(stringr)
library(circlize)
library(ComplexHeatmap)
library(Seurat)
library(SeuratObject)
library(viridis)
library(dplyr)
library(ggpubr)
libr... |
a380d64ad27dc1d51466dc95519f973775a72e71081febb18ff383ad7cad69a6 | R | 12,482 | 281 | setwd("G:/My Drive/Projects/Variations in risk taking/analysis_code")
library(RSQLite)
library(anytime)
get_path <- function(subpath = c()){
path = file.path(dirname(dirname(rstudioapi::getSourceEditorContext()$path)),"schedule_files")
if (length(subpath)>0) {
path = file.path(path, subpath)
}
ret... |
1469dec68c6d1fe589b80099c1459beb4f5cfa455685516f3f81e81bed3e58d3 | R | 12,506 | 301 | #' @title spatialDistTest
#' @description Compute minimum distances to N nearest neighbors from spatial coordinates.
#' @param coord A matrix of spatial coordinates.
#' @param n Number of nearest neighbors. Default is 8.
#' @return A matrix of distances.
#' @export
spatialDistTest <- function(coord = NULL, n = 8) {
c... |
e0e9ff51f301cf924e6b52a67bf6e4d2c1e699ff082b5f449ca4710ff653dad9 | R | 12,573 | 339 | ################################################################################
# Written by James M Roe, Ph.D.
# Center for Lifespan Changes in Brain and Cognition, Department of Psychology
# University of Oslo, Oslo, Norway
# November 12, 2020
#------------------------------------------------------------------------... |
6d312ef46310839a9d4101134f7dd7f66dc1436effe632227b64f6ff7384c047 | R | 12,623 | 263 | #' Function to setup the pipeline for finding maximum-scoring subgraph from an input graph and the signficance imposed on its nodes
#'
#' \code{oNetPipeline} is supposed to finish ab inito maximum-scoring subgraph identification for the input graph with the node information on the significance (p-value or fdr). It retu... |
45d45ba14a4c41ff958f775a9c5adbbaab123c48481a344a779797cf469acb90 | R | 12,659 | 321 | library(magrittr)
library(viridis)
library(RColorBrewer)
library(pheatmap)
vst.rbe <- readRDS("~/vst_rbe.Rds")
sample.transcripts <- rownames(vst.rbe)
sample.transcripts.no.version <- gsub("\\.[0-9]+","",
sample.transcripts)
ensembl2rxns.df <- read.table("~/Downloads/Ensembl2React... |
7322d5c5dd56221f656b38e7b9e15ade85b8232eb16f8d151e6a9247726034eb | R | 12,683 | 152 |
####################################################################################################################
# R script to process data for analysis of hippocampal neuronal cultures
# AGONIST CHALLENGE CHALLENGE
##################################################################################################... |
a274b36f0101592299655912378578d36c6f7b356f696691bf29b1b9f15d5fb0 | R | 12,725 | 139 | #### load packages ####
targetPackages <- c('tidyverse','BiocManager','wordcloud','ggnewscale','ggarchery','tidytext')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
targetPackages_Bioc ... |
41faf05d186c3478cf6c401c6a08306e167a5802d6d7a9af7aa3369e16a7b0df | R | 12,837 | 166 | #' Style writing function for the miic network
#' @description This function writes the miic style for a correct
#' visualization using the cytoscape tool (http://www.cytoscape.org/).
#' @details The style is written in the xml file format.
#' @param file [a string] The file path of the output file (containing the
#' ... |
2b177b570cf1b931dd5896b18680b839edee88f30b83a3b160e8643af1944d0e | R | 12,848 | 155 | #' Function to prioritise genes from an input network and the weight info imposed on its nodes
#'
#' \code{oPierGenes} is supposed to prioritise genes given an input graph and a list of seed nodes. It implements Random Walk with Restart (RWR) and calculates the affinity score of all nodes in the graph to the seeds. The... |
92bfe453a643c4f5574d2609829ae649420802064d5ae3b36cbfc5ee1b5085ee | R | 12,899 | 507 | ---
title: "Inspect profiles"
author: "Shantanu Singh"
date: "Nov 2020"
---
## Load libraries
```{r message=FALSE}
library(ggplot2)
library(glue)
library(magrittr)
library(tidyverse)
```
```{r}
simple_aggregate <- function(population, variables, strata, operation="mean") {
population %>%
dplyr::group_by_at(.v... |
aaba7f6d387afd58b4d60fdf01aec520a3f42d1f47416583aaa749ba16fa7fe0 | R | 12,941 | 226 | library(purrr)
library(magrittr)
library(tidyverse)
library(Seurat)
library(harmony)
library(ape)
library(uwot)
library(ggtree)
library(treeio)
library(ggtree)
library(treeio)
# library(future)
setwd("~/cortex/SnRNA/3_mergingDatasets/")
qsFiles <- list.files(".","merge.qs",full.names = T)
x = qsFiles[[1]]
datasets <... |
8cffa04802da72580c9ebba21b4ecd7d99b34f453bb1e25dc89e352e297b61f4 | R | 12,957 | 271 | ---
title: "L1-CRISPRi organoids: TE pseudobulk visualization"
output: html_notebook
---
This markdown relates to the visualization of pseudobulk quantification of TEs in day 15 cerebral organoids.
I want a heatmap of the differentially expressed FL-L1s (discovered from the bulk RNAseq data) using the pseudobulked no... |
e16334080047addb03288271f49b4c1933cc34a1762edc994e72d67a9b07244a | R | 12,999 | 313 |
# The following code is performing a DE analysis using the DESeq2 package in R.
# The analysis is based on the Negative Binomial distribution,
# which is a common choice for modeling RNA-seq count data because
# it can handle the variability typically present in this type of data.
#
# The DESeqDataSetFromMatrix() ... |
962775b48d8ad217b699aa85b581959e1e32dee57ef20d450c0d276be816fe2b | R | 13,016 | 315 | # Run after running 'analysis/02_diffbind_e16.R'
# Requires .txt files resulting from HOMER findmotifsGenome.pl
# DEFINE FILES AND PATHS: ------------------------------------------------------
# input DBA object/ diffbind resultds rds file
rds_dbObj <- "data/processed_data/atacseq_e16/r_objects/diffbind_dbObj.rds"
#... |
a61e6c8df6c8decaa32726094c334cb1d924b51d44fa00825310e14f45bfa1af | R | 13,016 | 282 | suppressMessages(library(Seurat))
suppressMessages(library(dplyr))
suppressMessages(library(tidyr))
suppressMessages(library(caTools))
suppressMessages(library(ROGUE))
suppressMessages(library(colorRamps))
suppressMessages(library(tidyverse))
#--------------------------------------------------------------
# Load own m... |
31b87a80fd381bfb643777e8240ecc2bdd057497e02da03ad7642359ac9d75ce | R | 13,127 | 339 | #' Reindex cluster labels in ascending order
#'
#' Given an \code{\link[stats]{hclust}} object and the number of clusters \code{k}
#' this function reindex the clusters inferred by \code{cutree(hc, k)[hc$order]}, so that
#' they appear in ascending order. This is particularly useful when plotting
#' heatmaps in which ... |
4ef2305c80f1c9adc8a4ae0431eebe005a53904f8415bf8d981fb6a032e884dd | R | 13,162 | 376 | #' Cross Validation
#'
#' The cross validation function of xgboost.
#'
#' @inheritParams xgb.train
#' @param data An `xgb.DMatrix` object, with corresponding fields like `label` or bounds as required
#' for model training by the objective.
#'
#' Note that only the basic `xgb.DMatrix` class is supported - variants s... |
176157c25b3843b9c8de41a63025b799086321d01255fffd15c6a011ffd50844 | R | 13,267 | 375 | ---
title: Fig5. Peripheral immune cells atlas and inflammatory-related mechanisms in COVID-19
revealed by CLEAR.
author: "Yuqi Cheng"
output: html_document
fontsize: 24pt
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Self-supervised Contrastive learning for integrative single cell scRNA-se... |
7103949f08a21efa496da404ee4389d36b8a61ce6ccf476b57b43d375e403725 | R | 13,311 | 295 | library(GenomicRanges)
library(readr)
library(ggplot2)
library(dplyr)
library(tidyr)
library(stringr)
library(patchwork)
file_paths_chip <- list(
LANCEOTRON = Sys.glob("/Volumes/Extreme Pro/CUT&RUN/EPI_P003_CNR_MM10_07172022/Four_DN/ChiP/VISUALIZATION/results/LANCEOTRON/beds/*H3K*_R*.bed"),
MACS2 = c(
Sys.glo... |
7ef581eed1d2ca66a89f416c6cc39504258a5fd6eb59887ed099c263e8dade48 | R | 13,335 | 283 | library(caret)
library(randomForest)
sampleda <- read.csv(".Data/samplevariables.csv", header=TRUE, sep=",", row.names=1, comment.char = "", stringsAsFactors = T)
ilr <- read.table("Data/ILR.tsv", header=TRUE, sep="\t", row.names=1, comment.char = "")
abundance <- read.table("Data/SeqTab_NoChim_SamplesInColumns_Tax... |
9a24d0f18bb68e145810ed127e4b9c468439ff998e724451a1f822e70f848dd6 | R | 13,335 | 285 | library(ggplot2)
library(ggrepel)
library(biomaRt)
library(dplyr)
library(countToFPKM)
library(expss)
library(tibble)
library(Seurat)
library(vioplot)
library(rstatix)
load("Processed_Objects/E12_transplant_matrix.Rdata")
load("Processed_Objects/E16_transplanted.Rdata")
load("Processed_Objects/Inhibitory_datasets.R... |
7f2ea6cf4f9c10784087b56478cca67659c52d8d728260e336b95bb12a03afad | R | 13,373 | 100 | # R script to download selected samples
# Copy code and run on a local machine to initiate download
# Check for dependencies and install if missing
packages <- c("rhdf5")
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
print("Install required packages")
source("https://bioconductor.org/bio... |
d8b3b93ef753adf4cff473b55065f91e85021f4cb157d9524ab19e6eeee2b30e | R | 13,401 | 433 | #' @rdname QuickRecipe0
#' @export
setMethod(f = "QuickRecipe0",
signature = signature(counts = "SMatrix"),
definition = function(counts = NULL, min.cells = 20, min.features = 200,
assay = NULL, verbose = TRUE
) {
assay <- ... |
3ce957679367204a605b9457d833445e0761fc572c4737c2e2c0f94c48188d1c | R | 13,417 | 448 | # R/natverse code to generate Figure 16 for the Platynereis 3d connectome paper
# Gaspar Jekely March 2022-2023
# load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
# load cell clusters -------------------------------------------... |
cc105e597a4fc4a184fb9d51ee6d497b7f1276ba21d39c05e0338f2969d6fd63 | R | 13,423 | 351 | #R/natverse code to generate Figure 9 fig suppl 2 for the Platynereis 3d connectome paper
#Gaspar Jekely Feb 2022
#load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
#annotations of all MB celltypes and their direct pre and posts... |
af026486e4db0ffc38193c40787e193e9373a487ce2748849d57021dd8462506 | R | 13,502 | 519 | #PCF-ALGORITHM (KL):
### EXACT version
exactPcf <- function(y, kmin=5, gamma, yest) {
## Implementaion of exact PCF by Potts-filtering
## x: input array of (log2) copy numbers
## kmin: Mininal length of plateaus
## gamma: penalty for each discontinuity
N <- length(y)
yhat <- rep(0,N);
if (N < 2*kmin) {
... |
ea4c145d6dca357341608acc3d3e1df58bbb0d52b60150603410a91cc06495df | R | 13,509 | 333 | ---
title: "Tutorial on sBLISS Downstream Analysis (human)"
# author: Federico Agostini
output:
github_document:
html_preview: false
fig_width: 6
fig_height: 6
dev: jpeg
pandoc_args: [
"--output=README_human.md"
]
---
```{r setupEnv, include=FALSE}
wo... |
401a9c2b49241e112df02f31e9601741dc82bddae59a520287cda85e5e1f3cb0 | R | 13,688 | 183 | #' Function to identify a gene network from top prioritised genes
#'
#' \code{oPierSubnet} is supposed to identify maximum-scoring gene subnetwork from a graph with the node information on priority scores, both are part of an object of class "pNode". It returns an object of class "igraph".
#'
#' @param pNode an object... |
7b8a15644a3a83ebdf9016e2987da0240f48f59f5f18bb191741fedcbb497532 | R | 13,750 | 546 |
#######################################################################################
require(MCMCpack)
require(nloptr)
require(mvtnorm)
require(glmnet)
############# FACTOR ANALYSIS WITH AUTOMATIC ROTATIONS TO SPARSITY #####################
# Y.......n x G matrix of n observations on G continuous responses
# ... |
e17f52deeacd2304c65961893f88cd7738f0b82a9a4978af12c9a44bedfc8eb1 | R | 13,763 | 379 | ---
title: "Step 1: Read in and normalize data"
author: "Sam Pring, Sarah Lower, Brian Vestal"
date: "`r Sys.Date()`"
output:
html_document:
theme: cerulean
toc: TRUE
toc_float:
collapsed: TRUE
code_folding: hide
editor_options:
chunk_output_type: console
---
**Goal: To read in data and c... |
e5111af49e7c72f3d195caa695bf7eeea5ce49c207d45cac2d19a82801417a39 | R | 13,767 | 272 | #' Function to visualise GSEA results using dot plot
#'
#' \code{oGSEAdotplot} is supposed to visualise GSEA results using dot plot. It returns an object of class "ggplot" or a list of "ggplot" objects.
#'
#' @param eGSEA an object of class "eGSEA"
#' @param top the number of the top enrichments to be visualised. Alter... |
79e5f2c0230bba114118f0fc983da0ca2335599750e20019e6c422b9bc7bf0e7 | R | 13,835 | 411 | ##################################################################
# Retrieving Pathway of CellChat cell-cell communication matrices in AD case study
# Reproducibility for Figure.4EFGH
##################################################################
library(CellChat)
library(patchwork)
library(Matrix)
options(string... |
9db9f8e17e921d0ad9ac5e93c98b56011064c8d8caf54d8dde29053920fd42b3 | R | 13,853 | 296 | ---
output: html_document
editor_options:
chunk_output_type: console
---
```{r libraries and functions, message=FALSE}
library(tidyverse)
library(Seurat)
library(Matrix)
source("~/OHSU Dropbox/Saunders Lab's shared workspace/arpy/manuscripts/2023_Thai2P4M_FeigeYoung/ms_analyses/1_karl_analysis/r_functions_paths/_... |
f17503d8cf85c911d6c471bff14efcd919a1a76e3dc271f83bbaf37f7e42ac8c | R | 13,857 | 506 | ---
title: "SpaCET"
output: html_notebook
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = '/home/rstudio/')
result.dir = '/home/rstudio/mod/results/'
st.folder = './data/stdata/'
all.sources = c('S1', 'S2', 'S3', 'S4')
# knitr::opts_knit$set(root.dir = 'E:/ST_mul... |
ca35f8a3695b11ccd6c2e7bb989842ec52bf549967efd686fd35351621267f8f | R | 13,905 | 359 | ---
title: "ATACseq Analysis of PAX3-FOXO1 injected zebrafish and ABC model"
output:
html_document:
code_folding: hide
editor: visual
editor_options:
chunk_output_type: inline
---
# Goal
This project aims to understand the initial in vivo activities of PAX3-FOXO1, and how it alters chromatin accessibility.
We in... |
d26f1968ba17364ce6771b3e64763f4b14ee07a7c819591f6ab9a2c1903dc457 | R | 13,945 | 392 | ###########################################################
# longCombat package examples
# JCBeer joanne.beer@pennmedicine.upenn.edu
# 13 Sept 2021
###########################################################
#################################
# install longCombat package
#################################
# install.pac... |
465f9e9da243b43df88a1dc99ea0e07b064765d557bd4b17f48d04177bf8d212 | R | 14,009 | 393 |
# heatmap of all model choices and their ranking (top=best model, bottom =worst)
#
seq_pink = c("#e7e1ef", "#c994c7", "#dd1c77")
# own colorscale for factor levels
cols_seq <- c("None" = "black",
"0.1" = seq_pink[2],
"0.5" = seq_pink[3],
"6" = seq_pink[3],
"20"... |
4582bb3234b395ec781f6e15bc46a21065fe00bae44cfc1943ff4c8a057576e8 | R | 14,062 | 445 | # load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/libraries_functions_and_CATMAID_conn.R")
# functions ------------------
load_neuron <- function(annotation) {
nlapply(
read.neurons.catmaid(
annotation,
pid = 11
),
function(x) smooth... |
2ec0513e6115142fbf85594ddc762e9b27e5d036dbf2cd69c051882b6ea72313 | R | 14,115 | 371 | ################################################################################
# Written by James M Roe, Ph.D.
# Center for Lifespan Changes in Brain and Cognition, Department of Psychology
# University of Oslo, Oslo, Norway
# November 12, 2020
#------------------------------------------------------------------------... |
34af48ef94518111053e187c5fccaf30820abed96a3d573b1fd959ae7757cf94 | R | 14,130 | 256 | library(Seurat)
library(tidyverse)
library(scCustomize)
library(cowplot)
library(patchwork)
library(RColorBrewer)
##########################
#I/O
##########################
# seurat_obj <- readRDS("/n/groups/walsh/indData/Maya/FCD_project/analysis/2_Analyze_Full_Object/Output/Seurat_Objects/8_processed_seurat_obj_inte... |
8c62e651f5082934a78f284d460666460b35d8013d537a8b0762b4980702d056 | R | 14,193 | 325 | suppressMessages(library(Seurat))
suppressMessages(library(dplyr))
suppressMessages(library(tidyr))
suppressMessages(library(caTools))
suppressMessages(library(ROGUE))
suppressMessages(library(colorRamps))
suppressMessages(library(tidyverse))
suppressMessages(library(ape))
suppressMessages(library(ggtree))
#----------... |
2fb86506ade5263d1070f14087dcae37a6d51af06d8cc29ab35c78e0b310bd28 | R | 14,199 | 370 | require(rphast)
require(ape)
require(dplyr)
require(parallel)
require(Biostrings)
require(ggpubr)
require(Seurat)
require(reshape2)
require(pheatmap)
require(readr)
args = commandArgs(trailingOnly = TRUE)
for (arg in args) {
split_arg <- strsplit(arg, "=")[[1]]
var_name <- split_arg[1]
var_value <-... |
d21d923f3d476cd184359ad6ad83176f3ae23390c2940f211a9792d9df41df23 | R | 14,229 | 192 | #' Barnes-Hut implementation of t-Distributed Stochastic Neighbor Embedding
#'
#' Wrapper for the C++ implementation of Barnes-Hut t-Distributed Stochastic Neighbor Embedding. t-SNE is a method for constructing a low dimensional embedding of high-dimensional data, distances or similarities. Exact t-SNE can be compute... |
72807facfa7f89b453ba5d3f89a95ac31bdd9bb4acd6aff200b088b8debdf01b | R | 14,260 | 416 | #R/natverse code to generate Figure 5 - figure supplement 2 of the Platynereis 3d connectome paper
#Gaspar Jekely 2024
#load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
load_neuron <- function(annotation){
nlapply(read.neuron... |
16bd8ba0bf4153d79c97cab56e63bb6ac975c2e0e3efb0b71b67cc2294a50de4 | R | 14,278 | 255 | #' Calculate cluster similarity between clusters from different single cell samples.
#'
#' `clusterFoldSimilarity()` returns a dataframe containing the best top similarities between all possible pairs of single cell samples.
#'
#' This function will calculate a similarity coeficient using the fold changes of shared fea... |
cecc24b330f2ade830643a0c8a037c1ebd87c34f61d68f74cd05130a6043a9ae | R | 14,300 | 221 | #' Function to define a colormap
#'
#' \code{oColormap} is supposed to define a colormap. It returns a function, which will take an integer argument specifying how many colors interpolate the given colormap.
#'
#' @param colormap short name for the colormap. It can be one of "jet" (jet colormap), "bwr" (blue-white-red ... |
cffa6d664eb6acc75dad023cd054500f307513efc7589dea5d449ccbbdd061c2 | R | 14,526 | 399 | #!/usr/bin/env Rscript
library(yaml)
library(dplyr)
library(reshape2)
library(challengeR)
library(doParallel)
library(huxtable)
library(magrittr)
# Function to calculate one subranking ------------------------------------
#' Calculate a single ranking
#'
#' @param data The underlying dataset used to calculate the ra... |
5cda70e75629841edaa3e3c0d83416659c3196178d1dd8456278945f7bc647df | R | 14,567 | 290 | # ==============================================================================
# Project: LanguAging
# Author : Loïc Labache, Ph.D.
# Lab : Holmes Lab, Dept. of Psychiatry, Rutgers University
# Date : June 21, 2024
# ==============================================================================
# Libraries....... |
19c3933c2a97ed2e9f8581bf2bcbe8fb25c9fefc3bd862258906edf34daefdc2 | R | 14,585 | 376 | #### load packages ####
targetPackages <- c('tidyverse','Seurat','hdWGCNA','harmony',
'biomaRt','clusterProfiler')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for... |
b0d0b2d542ca0fa50f65548a1a8a2e9d8dac0a873cc0bb749ebaf5bc7f791c57 | R | 14,627 | 450 | # function takes seurt obj and the deconvolution object. As Seurat can modify the names of the cells, this function makes sure that the deconvolution names become compatible
merge_sample_affix = function(seurat.obj, spacet.obj) {
if (grepl('_', colnames(seurat.obj)[1])) {
sample_suffix = t(as.data.frame(strsplit(... |
a367dbfd420378da96d41ac545367d846eb2f2c4af35fc9f04bd1bb1f399382d | R | 14,752 | 382 | #Platynereis 3d larva connectome paper Figure on gland circuits
#Gaspar Jekely
source("code/Natverse_functions_and_conn.R")
# load cells ---------------------------------------
#Glands
spinGland = nlapply(read.neurons.catmaid("^celltype_non_neuronal7$", pid=11),
function(x) smooth_neuron(x, sigma=6000... |
6423481e2a1a92e8db3a3c3b22ee2c5c5271bb79bf2795cef5bfcaba346f6a58 | R | 14,755 | 104 | # R script to download selected samples
# Copy code and run on a local machine to initiate download
# Check for dependencies and install if missing
packages <- c("rhdf5")
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
print("Install required packages")
source("https://bioconductor.org/bio... |
cd68a211b34b4a8b043dcdd27eab6d40454cb37fff6f889a618e9a466e1edb6c | R | 14,854 | 526 | # code to compare the connectivity of cell types on the left and right body sides of the 3 day old Platynereis larva
# Gaspar Jekely 2023
# load packages, functions and anatomical references
source("code/libraries_functions_and_CATMAID_conn.R")
# load all cells with celltype or celltype_non_neuronal annotation
cellty... |
5377232a5c11d7e3698ba3372c76f94ef027a9e0612347c4ef1f2eb175b9a56c | R | 14,887 | 337 | #' Function to prioritise pathways based on GSEA analysis of prioritised genes
#'
#' \code{oPierGSEA} is supposed to prioritise pathways given prioritised genes and the ontology in query. It is done via gene set enrichment analysis (GSEA). It returns an object of class "eGSEA".
#
#' @param pNode an object of class "pN... |
785c7ed2eab6e6a6da2e5d03908c0bc05ca803addc84e4826f99147b17ec7952 | R | 14,894 | 384 | library(dplyr)
# breast, lung
IN_DIR <- "/home/burkhart/Software/reticula/data/aim2/input/"
OUT_DIR <- "/home/burkhart/Software/reticula/data/aim1/output/"
labelled_edge_weights.df <- read.table(file=paste(IN_DIR,"pathway_hierarchy_labelled_edge_weights.csv",sep=""),header = TRUE,sep = ",")
misclass_rates.df <- read... |
71f14ebaba2b428134e34025aabf57478fcb63bc4951137bd2e3759edc850ba9 | R | 14,910 | 394 | ---
title: "st_clump"
output: html_notebook
---
Written by Aunoy Poddar
July 21st, 2022
# Process the puncta quantified raw data
```{r eval=FALSE}
current_file <- rstudioapi::getActiveDocumentContext()$path
output_file <- stringr::str_replace(current_file, '.Rmd', '.R')
knitr::purl(current_file, output = output_file)... |
150953da391c2c780f69125f886a8bdb36bdb7c3ad960c0ace342c57719f43d3 | R | 14,984 | 358 | suppressMessages(library(Seurat))
suppressMessages(library(dplyr))
suppressMessages(library(tidyr))
suppressMessages(library(caTools))
suppressMessages(library(colorRamps))
suppressMessages(library(tidyverse))
suppressMessages(library(writexl))
suppressMessages(library(clusterProfiler))
suppressMessages(library(reshape... |
f4f39289db991f9300b00b0d6d501320fa4f33d7553da1c732f3436970392c3b | R | 15,099 | 284 | #### load packages ####
targetPackages <- c('tidyverse','arrow','patchwork','gtools')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) library(package, chara... |
15e592b2293a4ab42a1138379bb1ab6504b827b141b9184dabd2b26185679b81 | R | 15,155 | 345 | trgStat <- function(merged.obj) {
trg.stat <- lapply(T.CELL.GROUPS, function(tg) {
if (!(tg %in% (merged.obj$t.cell_group %>% unique()))) {
xx <- c(0, 0) %>% `names<-`(c(FALSE, TRUE))
return(xx)
}
obj.tmp <- subset(merged.obj, t.cell_group == tg)
xx <-
... |
6ff08a4726504945fe463ef640e922a99a6f69c30e92557a86e3001ccfa3dd54 | R | 15,204 | 354 | #' @title medullaScore
#'
#' @description Calculates medulla scores for each spot in spatial seurat data objects using Seurat's method.
#' @param obj.st.lst A list of spatial seurat data objects.
#' @param medulla.genes A vector of genes associated with the medulla.
#' @return Updated obj.st.lst with added medulla scor... |
3b2249c75c2f9c2b4a14f92ab3944395d2767baa1e0da03132b9e399ef0be790 | R | 15,263 | 105 | # R script to download selected samples
# Copy code and run on a local machine to initiate download
# Check for dependencies and install if missing
packages <- c("rhdf5")
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
print("Install required packages")
source("https://bioconductor.org/bio... |
c833fdd2bf38516645af0826f0cf56d41f8dbad63d4912ac6565c58ab518a19f | R | 15,289 | 481 | # R code to generate Figure 3 of the 3d Platynereis connectome paper
# Uses Natverse/catmaid and accesses the data on CATMAID
# Gaspar Jekely 2022
# load packages, functions and anatomical references
source("code/Natverse_functions_and_conn.R")
# table for neuronal cell types -------------------------------
annotati... |
b9bc182d703fc3553838a12fd4ce9be57b14462db0d4d62f3ce8cd2c2976fd86 | R | 15,437 | 482 | #load packages########
library(org.Mm.eg.db)
library(org.Hs.eg.db)
library(genefilter)
library(topGO)
library(babelgene)
DROP_GO_PATTERN='hair|sex|heart|liver|gonad|lung|sexual|skin|cardiac|molting|behavior|bone|animal|urogenital|renal|kidney|digestive|digestion|ear|light|salt|pregnancy|ovulation|eye|sperm|odontoge... |
dea4264273b22fc28fa9efb88af02fdef70c331028cd949ac9de56781b358cf7 | R | 15,615 | 335 | #### load packages ####
targetPackages <- c('tidyverse','arrow','lmerTest','patchwork')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) library(package, cha... |
5b6b7dd23deb0a8863a23c3fd27ad56329ad649b6369e31901a9df58f31518e4 | R | 15,677 | 288 | library(Seurat)
library(tidyverse)
library(scCustomize)
library(cowplot)
library(patchwork)
library(RColorBrewer)
###########################
#I/O
###########################
# seurat_obj <- readRDS("/n/groups/walsh/indData/Maya/FCD_project/analysis/2_Analyze_Full_Object/Output/Seurat_Objects/8_processed_seurat_obj_in... |
3680e7b98312125bf369c65d29697bfe9e347d0e70cd931851225136c9f093e4 | R | 15,751 | 541 | # R code to generate the Figure 1 figure supplement 2 of the Platynereis connectome paper
# Gaspar Jekely 2023 July
# load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
# read neuron groups ---------------------------------------... |
9bc82ea03dc2d077863a0e60fa488ec94fb61cc36ba5fecd6abb227de64ae0e3 | R | 15,786 | 352 | #' Function to implement Random Walk with Restart (RWR) on the input graph
#'
#' \code{oRWR} is supposed to implement Random Walk with Restart (RWR) on the input graph. If the seeds (i.e. a set of starting nodes) are given, it intends to calculate the affinity score of all nodes in the graph to the seeds. If the seeds ... |
504d0df596d03ba2e5becf63791aeeb682458221df1c14e9ae17e7f03db6395e | R | 15,789 | 322 | ################################################################################
# Written by Loïc Labache, Ph.D. #
# Holmes Lab, Department of Psychiatry - Rutgers University #
# April 25, 2025 ... |
ddde571cd99805406b32a05eb3faf03512a943b94608288d43e751b64d1ef1ca | R | 15,797 | 449 | require(Signac)
require(Seurat)
require(Matrix)
require(EnsDb.Hsapiens.v86)
require(BSgenome.Hsapiens.UCSC.hg38)
require(dplyr)
require(readr)
require(tgutil)
require(tidyverse)
require(ggpubr)
require(parallel)
require(gridExtra)
args = commandArgs(trailingOnly = TRUE)
for (arg in args) {
split_arg ... |
0c6afdbf81688dc34de566a018cd5142d7721b1dd145bcb321e201f18a88297a | R | 16,052 | 443 | #' Key optimizations:
#' 1. Early termination after first good solution (like original)
#' 2. Vectorized distance calculations
#' 3. Optimized constraint checking
#' 4. Smart search ordering (best regions first)
#' 5. Reduced memory allocations
runASCAT_enhanced = function(lrr, baf, lrrsegmented, bafsegmented, chromoso... |
be00f20e06bdd0ace946933ddcbb025a79004ea01b8822bf292b8f44bbadb77d | R | 16,139 | 208 | library(data.table)
library(GenomicRanges)
library(BSgenome.Hsapiens.UCSC.hg38)
run_all <- function(args){
hybrids <- args[1]
sample <- args[2]
repeatmasker_bed <-args[3]
transcripts <- args[4]
features <- args[5]
is_umi <- args[6]
merged <- args[7]
is_ambiguous <- args[8]
input_hybrids <- fread(hyb... |
8a46cb12513622eb0015f186d512796f12578b6b3ac1f4a1bdb241cb26111c26 | R | 16,243 | 508 | #code to generate Figure12 figure supplement 3 of the Platynereis 3d connectome paper
#Gaspar Jekely 2023
#load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
#redefine read and plot a neuron function
read_plot_neuron_ventral <- f... |
9bfdb561a89e18262eee14b20af40196830e9cc9612cc6ea5cc579d3698f4fcc | R | 16,384 | 366 | #Scripts to generate Figure 2f to 2k
library(ArchR)
library(parallel)
library(GenomicRanges)
library(ggplot2)
##############################################################################
# Figure number: 2f
# Figure description: scATAC-seq UMAP based on stage.
ArchRProject <- loadArchRProject("/path/to/archr_proj/"... |
4cbcc7649ee7c42aa892731266c9c99ab923f304d622f01d28f96d2249a2466a | R | 16,399 | 359 | # GSE138002
library(dplyr)
library(Seurat)
library(ggplot2)
whole <- readRDS("GSE138002_UMAP_QC_250712.rds")
# library(CSCORE)
# RPCs_joined <- JoinLayers(RPCs)
# stage = RPCs_joined
# mean_exp = rowMeans(stage@assays$RNA$counts/stage$nCount_RNA)
# genes_selected = names(sort.int(mean_exp, decreasing = T))[1:5000]
#... |
a091af17eb15abb62575f1a08c1af338d5c5951f1b7b98182b127028e8f733d2 | R | 16,447 | 461 | # Details: Scripts used for human validation of DEGs identified by chemogenetic (DREADD) mouse model to chronically hyperactivate of DA neurons.
# As described in manuscript "Chronic hyperactivation of midbrain dopamine neurons causes preferential dopamine neuron degeneration"
library(readxl)
library(stringr)
library(... |
79be36d1809917f2ea1f0218a52dcf59cb0d022be1e7dad4a85771ce68f61d8d | R | 16,507 | 358 | ########################################################################################
# Generic table reader
########################################################################################
#' Generic reading function using the readr R package, tailored for reading in genomic data
#' @param file Filename of ... |
8723e1591011dcd64d74785266a854763442b4b1b9b84d765f65c596bccdeb0f | R | 16,510 | 347 | # load the necessary libraries
library(Seurat)
library(Matrix)
library(dplyr)
library(ggplot2)
library(ComplexHeatmap)
library(RColorBrewer)
library(NeuronChat)
library(viridis)
#load the rds. data files
neuros_10_datasets <- readRDS("/mnt/S7/data2/AIMED/sblim/Hypothalamus/neuros_10_datasets.rds")
Berkhout2023 <- rea... |
9c38582987882886f42651ff66efc820a49d88c01021ae8ce76ab9c5aa8749f2 | R | 16,721 | 322 | library(data.table)
library(seqinr)
library(miRBaseConverter)
library(Biostrings)
library(stringi)
run_all <- function(args){
smallrna_bam <- args[1]
sample <- args[2]
rna_bam <- args[3]
mod_rna_bed <- args[4]
repeatmasker_bed <-args[5]
smallrna_whole_bam <- args[6]
transcripts <- args[7]
features ... |
ae4f98f62bae5df471e656a37fb921c89b3bb4c4e21cc5f298604a1b2694a064 | R | 16,728 | 314 | ---
title: "GO and other analysis related to pro-viral pseudotime-based Gene Sets"
author: "Arpy"
date: '2024-09-24'
output: html_document
---
```{r libraries and functions, message=FALSE}
library(tidyverse)
library(ggplot2)
library(dplyr)
library(readr)
library(clusterProfiler)
library(org.Hs.eg.db)
library(enrichplo... |
b4e72edd8e743cdc679fd6488c7f908796fd500210249fb7b8ea2642b8f1b7e6 | R | 16,742 | 620 | ---
title: "st_profiling"
output: html_notebook
---
Written by Aunoy Poddar
May 23rd, 2022
# Process the puncta quantified raw data
```{r eval=FALSE}
current_file <- rstudioapi::getActiveDocumentContext()$path
output_file <- stringr::str_replace(current_file, '.Rmd', '.R')
knitr::purl(current_file, output = output_fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.