sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
039694e40c1650627e887898ad6b77f59d8c6dd499b83fdcf37092ff96a4cc04 | R | 8,270 | 193 | library(dplyr)
library(magrittr)
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP035988/output/"
GTEX_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/"
ALPHA <- 0.05
tissue2idx.df <- data.frame(read.table(paste(IN_DIR,"inverted_targets.txt",sep=""),
stringsAsFac... |
7efafa3fa466b24f60a68b44f91c19f9c6d2da83bc4b78011e3caee7c62f9317 | R | 8,297 | 229 | #' @importFrom data.table fread
#' @importFrom Matrix readMM
.ReadMM <- function(file = NULL)
{
## DT <- fread(file,sep='\t', skip = "%", header = FALSE)
## nr <- DT[1,1]
## nc <- DT[1,2]
## DT <- DT[-1,]
## nr <- nr[[1]]
## nc <- nc[[1]]
## mt <- sparseMatrix(i = DT$V1, j = DT$V2, x = DT$V3, dims = c(nr,... |
f9993699fd27c4b1346f22b23f0063edb44852a1875c2fd808804a5c3117ebfb | R | 8,397 | 155 | #----------------------------------------------------------------------
# Reference expression and markers
SCIENCE_EXPR <- "../4.extdata/science_thymus_gene_expression.xls"
SCIENCE_MARKERS <- "../4.extdata/science_thymus_markers.csv"
ANNO.AREAS <- c("protein_coding", "TEC", "TR_C_gene", "TR_J_gene", "TR_V_gene", "TR_... |
83c50bafe61767d1562ab3bb9c03a4a8ef7dd76d6c28edcf317fc211f7dd9a76 | R | 8,492 | 228 |
# List of required libraries
required_libraries <- c("geiger", "ratematrix", "phytools", "picante", "dplyr")
# Check if each library is installed; if not, install it
for (lib in required_libraries) {
if (!requireNamespace(lib, quietly = TRUE)) {
install.packages(lib)
}
}
# Load the libraries
lapply(required_... |
70fbd2dba30dc013dd474a07cccdc968f74e6b7e0998464f06e68e2adb03da4e | R | 8,504 | 150 | #' Function to transform p-values into scores according to the fitted beta-uniform mixture model and/or after controlling false discovery rate
#'
#' \code{oBUMscore} is supposed to take as input a vector of p-values, which are transformed into scores according to the fitted beta-uniform mixture model. Also if the FDR t... |
2ab3369438e02d267356933c71a14e81e159266356f311ef575f7097e985570b | R | 8,522 | 259 | # R code to generate Figure 3 fig suppl 5 of the 3d Platynereis connectome paper
# Gaspar Jekely 2022-2023
# load packages, functions and anatomical references
source("code/libraries_functions_and_CATMAID_conn.R")
# Sholl analysis --------
annotation_neuronal_celltypelist <- list()
# read all neuronal cell types and... |
932de9281b6e780cb3fea9bef06c9af4cdb523f1961e5f08039387b7a34e4bee | R | 8,523 | 263 | ##### First write a funtion to simulation from mixture of normal models
simMixnormal = function(n, prob, mu=c(1:length(prob)), sigma2=rep(1,length(prob))){
if(length(prob)<1) stop("prob must be a vector of length at least 1")
if(length(prob)!=length(mu) || length(prob)!=length(sigma2)){stop("prob, mu and sigm... |
772daa579e69a0eaa1a0df4813111cb306d213e60378ed6763c8461f33eeef0d | R | 8,553 | 319 | # Code to generate Figure7-fig-suppl2 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")
# load cell-type connectivity -----------
syn_tb <- readRDS("source_data/Figur... |
cca9a6f652fcaeb2280e9e9d6adfa4b699581da142420af70560931956edcc07 | R | 8,567 | 205 |
#install.packages
library(Seurat)
library(ggplot2)
library(DoubletFinder)
library(dplyr)
library(ggplot2)
library(cowplot)
library(reshape2)
library(MAST)
setwd("/Users/lifan/Desktop/data_analysis/mouse_pgrn/data_analysis/integration_with_Axl/")
PGRN <- readRDS(file = "Mouse_FTD_integrated_PCA_0.1_no141516.rds")
# ... |
501f8007b7f44768a3cd0e106fa2f25c537df9efec04a409c3fe7a91c134c8c0 | R | 8,578 | 263 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
OUT_DIR <- "/home/jgburk/PycharmPro... |
cbd47850bc2708f203b1a162df564138e67973b38ad6deeb76d1ef79b1d00e02 | R | 8,593 | 254 | #' Function to convert an object between graph classes
#'
#' \code{oConverter} is supposed to convert an object between classes "igraph", "dgCMatrix", "dtree", "lol", and "json".
#'
#' @param obj an object of class "igraph", "dgCMatrix", "dtree", "lol", and "json"
#' @param from a character specifying the class convert... |
f803b2379da18c5dda873b5a2500780f00964553c01dab93e2ce3d4eb00e7267 | R | 8,633 | 263 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
OUT_DIR <- "/home/jgburk/PycharmPro... |
8cacf475fe5506c7f07c120d9e8f24b15b49e82125d7e7f79b30d82d6dc056f2 | R | 8,635 | 197 | #' Function to define HiC genes given a list of SNPs
#'
#' \code{oSNP2cGenes} is supposed to define HiC genes given a list of SNPs. The HiC weight is calcualted as Cumulative Distribution Function of HiC interaction scores.
#'
#' @param data an input vector containing SNPs. SNPs should be provided as dbSNP ID (ie star... |
13392e3b78fccf01ef0c81fde519d275d56453a77f22ee0e796840cbcc9c095f | R | 8,656 | 188 | library(vioplot)
library(tidyverse)
library(rstatix)
library(ggpubr)
library(Seurat)
library(ggrepel)
library(VennDiagram)
# Analysis of FlashTag transcriptome datasets
#Fig2
# Subset FlashTag data from the common pool ----
load("Processed_Objects/Inhibitory_datasets.Rdata")
Inhibitory_datasets <- SetIdent(Inhibitor... |
df3d67a0d1e58e24cfb01824b48f0290119f7e7ed50ea1a79cdc33b59ac04fc5 | R | 8,703 | 195 | # Load necessary libraries
library(GenomicRanges)
library(readr)
library(ggplot2)
# Define the paths to the BED files
file_paths <- list(
LANCEOTRON = list(
"Brain_H3K27ac_R1" = "~/Downloads/Transfers/peak_calling_mouse_result/LANCEOTRON/Brain_H3K27ac_R1_L-tron_noheader.bed",
"Brain_H3K27ac_R2" = "~/Download... |
58ebdb4405d9033e8795b7cb934b64c74b014fb011cea97ed4901ce6ceed322d | R | 8,732 | 184 | 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... |
bb1ddf3df87e442ebc86a0cf73158ffe255322c8cb7ed246c770da384f586a36 | R | 8,741 | 248 | #' Single cell RNA-Seq data extracted from a publication by Yan et al.
#'
#' @source \url{http://dx.doi.org/10.1038/nsmb.2660}
#'
#' Columns represent cells, rows represent genes expression values.
#'
"yan"
#' Cell type annotations for data extracted from a publication by Yan et al.
#'
#' @source \url{http://dx.doi.or... |
f73ced2563efa947a9de398f60275d68874911dc29537300f11a1aa113ee99d7 | R | 8,761 | 181 | library(tidyverse)
library(ggplot2)
library(Seurat)
options(Seurat.object.assay.version = "v3")
library(msigdbr)
library(clusterProfiler)
library(org.Hs.eg.db)
library(DOSE)
library(enrichplot)
library(limma)
library(gplots)
library(marray)
library(RMySQL)
library(stringr)
library(reshape2)
library(dplyr)
library(fgsea... |
0561d090df16c12ed092052ffbd1a0727a37abd670c5f2a48a303dd7a1063eee | R | 8,783 | 263 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
OUT_DIR <- "/home/jgburk/PycharmPro... |
27ade85e3932798b2b6ddcdb1cb20bd7a33ccbd45bd5b16cd89df503c70dc795 | R | 8,783 | 263 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
OUT_DIR <- "/home/jgburk/PycharmPro... |
d966490760a7a3880c7fd94de1fffe85db3b15490cc54f6c6c40be9f51aaf9ac | R | 8,790 | 203 | #' Function to visualise a graph with communities using hierarchical edge bundling
#'
#' \code{oHEB} is supposed to visualise a graph with communities using hierarchical edge bundling (HEB), an effective way to visualise connections between leaves of a hierarchical/tree graph (representing the community structure). The... |
daf9a0f748b6b06528f0c04896818573c4d67c78507a5fcf90bdf48a3e14075a | R | 8,801 | 175 | #' Function to fit a p-value distribution under beta-uniform mixture model
#'
#' \code{oBUMfit} is supposed to take as input a vector of p-values for deriving their distribution under beta-uniform mixture model (see Note below). The density distribution of input p-values is expressed as a mixture of two components: one... |
887ddaec2c019a6671d8e4c48f04badfc29ca7b4c1f748670c96b930db453937 | R | 8,825 | 263 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
OUT_DIR <- "/home/jgburk/PycharmPro... |
2caa55bfa7008294ed2be74df7d8ba2911ae80bbb32a16e9c95b2aa10e703286 | R | 8,831 | 263 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
OUT_DIR <- "/home/jgburk/PycharmPro... |
88c84742f41a45c5aa142e19b3a521309913f7643db3cd64f3441175400a79e3 | R | 8,890 | 313 | # R code to generate Fig2 fig suppl2 of the 3d Platynereis 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")
# plot graph with coordinates from gephi ----------------------------------
# ... |
33deb47356aba9ba15f1c288e12e4bfe74867cb170c66bd1c7e1c0679e66647b | R | 8,891 | 263 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
OUT_DIR <- "/home/jgburk/PycharmPro... |
a07ec71d70f1c5751b106dfcf0fa0811b89ba13719dce82be8a61c4ee720767d | R | 8,937 | 226 | # Copyright 2024 Masahiro Ono
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
d577031c3a82ee2bb05e9a72e5600013b94b058edb45363035ce71dc32d94e67 | R | 8,945 | 345 | ---
title: "Untitled"
author: "Heejung Jung"
date: "`r Sys.Date()`"
output: html_document
---
iqm
```{r include=FALSE}
library(ggplot2)
library(raincloudplots)
library(gghalves)
library(plyr); library(dplyr)
# source("/Users/h/Documents/projects_local/RainCloudPlots/tutorial_R/R_rainclouds.R")
# source("/Users/h/Docum... |
12e36200fe12a5f7c889779932ae5e368c25bf39cf63da8df413fc8418dc5d5c | R | 8,959 | 272 | #' Import and Format MIMIC-IV
#'
#' Import and format MIMIC-IV dataset as done in the AMPEL project.
#'
#' @param path `character(1)`, path to the root MIMIC-IV folder (that contains
#' the subfolders: core and hosp).
#' @param verbose `logical(1)`, if `TRUE` progress messages are shown.
#' @return `data.frame`, same a... |
aaf9b3ba949b10b5a40082f93eea82a7f518b2cf47a2a358a33099ab6cc12196 | R | 9,007 | 153 | # Review phyper function used in https://github.com/joshuaburkhart/reticula/blob/master/src/r/analysis/hypergeometric_enrichment_analysis.R
# use phyper to calculate (positive) enrichment with fisher exact p-value (explained here: https://stackoverflow.com/questions/53051977/p-value-from-fisher-test-does-not-match-phyp... |
19b64bb2b5f0d5762f4b5a043508c8e44df526fdb60d85922b26eff9ac2a7064 | R | 9,009 | 178 | ###########################################################################################################################################
## Simulate a neutrally evolving tree with a progenitor compartment
library(SCIFER)
library(doParallel)
library(foreach)
library(parallel)
### simulate trees with a stem cell cou... |
0b580f19ee8b0f19b42a689af245a3a77080acbccea29aded8a08808d67fe098 | R | 9,064 | 248 | #' @title RunAutoCorr
#' @description Calculate spatial autocorrelation (Moran's I) for features in parallel. Autocorrelated features are labeled with SetAutoCorrFeatures() automatically.
#' @param object Seurat object
#' @param assay Working assay
#' @param layer Input data layer, usually be 'data'.
#' @param snn Nam... |
b5bd9fa61b131fd3ed601b41752df2aa647d3f01de974485aaf454f57c0c7cb9 | R | 9,104 | 151 | #' Plot a heatmap of the similarity values obtained using cluster fold similarity
#'
#' `similarityHeatmap()` returns a ggplot heatmap representing the similarity values between pairs of clusters as obtained from \link[ClusterFoldSimilarity]{clusterFoldSimilarity}.
#'
#' This function plots a heatmap using ggplot. It i... |
a987aacedb39518e8b3a9fba96d596a834f3b6d54355d3b7067f3be4bbd2805d | R | 9,132 | 267 | ---
title: "Integration_Analysis"
output: html_notebook
---
## Aunoy Poddar
## Friday December 22, 2023
## This notebook is designed to take cca-integrated data from Shi et al
## and from our human arc data and quantify the extent of co-clustering
## between celltypes in order to identify relationships between early i... |
82de3df2e9acaae24130e91c21015fc5243024dbe83af48de0cdd962bb4d7411 | R | 9,150 | 235 | suppressMessages(library(Seurat))
suppressMessages(library(dplyr))
suppressMessages(library(tidyr))
suppressMessages(library(caTools))
#--------------------------------------------------------------
# Load own modules
source('modules/utils.R')
source('modules/global_params.R')
source('modules/seurat_methods.R')
sourc... |
5576f5dc30a57d55c5dd889f4a5b4c0ac6938c312c94fd664117d06a3c52f238 | R | 9,198 | 270 | #code to generate Video5 of the Platynereis 3d connectome paper
# showing a close-up of mechanosensory cells in the 2nd segment
#Gaspar Jekely 2022-2023
#load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
# create temp dir for vi... |
8860245c7ca48f5be803cf31afee94cb3515a2c58473be889d8fe03d8d2a501e | R | 9,228 | 194 | predictor1 = 'stimrisky_learning_bin'
predictor2 = 'stimsafe_learning_bin'
predictor3 = 'decision_bin'
model_name = 'three_category_riskyplussafe'
group = 'group1' # e.g., 'group1'
simulated_data = '' #data file name
iteration_suffix = '' # e.g. '_b' or '_c'
library(rstan)
library(bridgesampling)
library(... |
6bc318b3abdd6a3f9056b1c4f3f70d34880257625859f5642656ff5b9b435aaa | R | 9,239 | 268 |
## First construct phylogenetic tree as per https://f1000research.com/articles/5-1492
## Create phyloseq object including tree using https://vaulot.github.io/tutorials/Phyloseq_tutorial.html
## Continue with Philr analysis using https://rdrr.io/bioc/philr/f/vignettes/philr-intro.Rmd
## Intro to Philr: http... |
f46a1152108b07b36217808cfc644b0774c72b6c5cd26b06a418352f1a6877d9 | R | 9,268 | 208 | ---
title: "TockyPrep: Data Preprocessing Methods for Flow Cytometric Fluorescent Timer Analysis"
author: "Dr. Masahiro Ono"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
bibliography: TockyPrep.bib
link-citations: TRUE
vignette: >
%\VignetteEncoding{UTF-8}
%\VignetteIndexEntry{TockyPrep: Data Preprocessi... |
86ad90974554d1ffa55daddf588165a7cba14a433ff5db0b6d5f744e57970211 | R | 9,356 | 231 | ---
title: "L1-CRISPRi organoids: TE pseudobulk sizefactors"
output: html_notebook
---
This markdown relates to the visualization of pseudobulk quantification of TEs in day 15 cerebral organoids.
We need to calculate sizeFactors per pseudobulked clusters to normalize TEs using unique mapping (crispri_org_pseudobulk_u... |
8472fc392c33c4af1c5dc985595d05e369241ea0d5bf7251e37e3e8250d77ed5 | R | 9,367 | 243 | #' Launch a Shiny App for Exploring timer_transform Parameter Space
#'
#' This function launches a Shiny application that allows users to interactively explore
#' the parameter space of the `timer_transform` function. Users can adjust thresholds
#' and normalization methods to see how these changes affect the transform... |
26a99db8657896e978806cec3fd6bff777db4a6aa7f95444e317097ea07d92db | R | 9,394 | 292 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
#OUT_DIR <- "/Users/burkhajo/Softwa... |
479f1f65a3649e905c023bb50d44b408713dafcf2d685a4e0a6addc9434af3da | R | 9,441 | 292 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
#OUT_DIR <- "/Users/burkhajo/Softwa... |
cfdbee4903d2404f9c87fa155ee38d3ad91f9f8c796e32bcabe0c01552c9f442 | R | 9,506 | 188 |
#install.packages
library(Seurat)
library(ggplot2)
library(DoubletFinder)
library(dplyr)
library(cowplot)
library(reshape2)
library(MAST)
#load in data from Cell Ranger or other counts data ====
#for loading Cell Ranger counts:
setwd("/athena/ganlab/scratch/lif4001/Mouse_pgrn_mertk/DF_2ndRound")
Ctrl_1 <- readRDS(fi... |
415f591787bb71c672dea5f5ae725ea0ba943a3fe2b99a038e2af9bbb21b7d3b | R | 9,521 | 349 | ###############################################################################
## Script to convert and anonymize internal dataset UMG.
###############################################################################
###############################################################################
## Laboratory Data
###... |
5bcdedfebc06c4b1f1eded3df74eed4c3514f6d4f233d83fbf1d6f292bc3c50a | R | 9,531 | 229 | #### load packages ####
targetPackages <- c('tidyverse','arrow','car','lmerTest','ggpmisc','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) libr... |
283d4b7f037432289a0cca9ec916ee95783febffbfdb6863b6f12530d02b3e53 | R | 9,560 | 185 | library(qs)
library(tidyverse)
library(vegan)
library(ggrepel)
library(cowplot)
library(ggh4x)
library(magrittr)
library(vegan)
library(ggrepel)
setwd("~/cortex/fig3/")
taskScore <- data.frame(
stringsAsFactors = FALSE,
row.names = c("working memory",
"visuospatial","visual semantics","visual perce... |
811f375dae958c890185fc7b3ff9471f45d17b5b25ffefae708e596bb09245c5 | R | 9,576 | 351 | # Code to generate Figure12-fig-suppl2 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")
# load cell type connectivity ---------------
syn_tb <- readRDS("source_data/... |
7fabad0a08047b77df14edcc3d5c890398cc2999f92dadc382f67ea7367bab2f | R | 9,584 | 207 | #### load packages ####
targetPackages <- c('tidyverse','arrow','car','lmerTest','ggpmisc','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) libr... |
bfc8ac6c7a6180d748183937e2e24a56bc06c63224daae7775f2a7877cc60a92 | R | 9,602 | 351 | ---
title: "st_profiling_clean"
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 = out... |
9b1b293576178cde7a3c24f1b4e28815db0b6b67215136463f08e2ae7572ff08 | R | 9,641 | 244 | set.seed(88888888) # maximum luck
library(magrittr)
library(ggplot2)
library(ggiraph)
library(plotly)
library(plyr)
library(reshape2)
library(factoextra)
start_time <- Sys.time()
OUT_DIR <- "/home/burkhart/Software/reticula/data/aim1/output/"
gtex_tissue_detail.vec <- readRDS(paste(OUT_DIR,"gtex_tissue_detail_vec.R... |
557bc025e91c911b23caf91f6333dfeb464ecc97adfb6d27b09ad5cbd0dd2aac | R | 9,692 | 199 | #' Function to draw heatmap using ggplot2
#'
#' \code{oHeatmap} is supposed to draw heatmap using ggplot2.
#'
#' @param data a data frame/matrix for coloring. The coloring can be continuous (numeric matrix) or discrete (factor matrix)
#' @param reorder how to reorder rows and columns. It can be "none" for no reordering... |
73105fb2f977be906cf703423712adc2e2d098950ab246326ec11e409a90bcb0 | R | 9,708 | 232 | #-------------------------------------------------------------
# Number of gene detected per cell type.
numberOfGeneDetecedPerCellType <- function(merged.obj) {
ggplot(merged.obj@meta.data, aes(x = Anno.Level.Fig.1, y = nFeature_RNA, fill = "#94B3DE")) +
geom_boxplot(outlier.colour = "red") +
geom_... |
0ac2a3b7e58df20dbb064103a7225e0023ad98f3a2e7ae82645e2e515daef7bb | R | 9,747 | 195 | library(qs)
library(parallel)
library(magrittr)
library(tidyverse)
library(org.Hs.eg.db)
setwd("~/cortex/fig6/")
devtools::load_all("~/seurat/")
devtools::load_all("~/ClusterGVis-main/")
library(scRNAtoolVis)
seu <- qread("../STEREO/st_domain_seu_44slides.qs")
genes <- read.csv("../../ensemble93gtf_rmXY.csv")
regio... |
9230420abc291ff318f85e396b8651bd5105ee79477b35b92754bbfaf0538d2b | R | 9,800 | 275 | library(dplyr)
library(magrittr)
# 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,"labelled_edge_weights.csv",sep=""),header = TRUE,sep = ",")
misclass_rates.df <- read... |
70f4a61528f0b9664983ecb4dd66e2d21afdb6ee1ef7ede04092022c83552497 | R | 9,818 | 225 | # ==============================================================================
# SCRIPT 02: SUBGROUP ANALYSES ON PRIMARY META-ANALYSIS MODELS
# (originally distributed as subgroup_processing.R)
# ==============================================================================
#
# PURPOSE:
# Performs subgroup ... |
5ec66effb8a76aa9fba92803130f0f4958686102c86b47c55962bedf51e94780 | R | 9,842 | 341 | options(bitmapType = "cairo")
library(Seurat)
library(scrattch.hicat)
library(dendextend)
library(tidyverse)
library(matrixStats)
library(Matrix)
library(magrittr)
library(RColorBrewer)
library(ranger)
library(ggheatmap)
library(patchwork)
library(ggtree)
library(ggcorrplot)
library(bioDist)
library(harmony)
library(rt... |
483c6e0f70c67e8b581780c817f8b907a332ee8180eff7dc6faba1575d4b1097 | R | 9,843 | 206 | suppressMessages(library(Battenberg))
suppressMessages(library(optparse))
suppressMessages(library(Rsamtools))
suppressMessages(library(tictoc))
option_list = list(
make_option(c("-a", "--analysis_type"), type="character", default="paired", help="Type of analysis to run: paired (tumour+normal), cell_line (only tumour... |
c8190e4e8c18417ea33baa2fb9b54293c78dd9b0c27539fc3d25132603f2ef52 | R | 9,889 | 251 | ## Nfib OE ##
library(Seurat)
library(ggplot2)
library(pals)
library(patchwork)
library(dplyr)
library(tidyr)
library(ggrepel)
library(pheatmap)
library(gridExtra)
library(RColorBrewer)
library(ggvenn)
library(ComplexHeatmap)
library(circlize)
library(stringr)
library(ggpubr)
NFI_OE_seurat <- readRDS("Processed_Objec... |
14cccddb90ed1951cf0c54a3093ee5fbf9c99f2e317646c0aa308a9294f68999 | R | 9,950 | 202 | #install.packages
library(Seurat)
library(ggplot2)
library(DoubletFinder)
library(dplyr)
library(ggplot2)
library(cowplot)
library(reshape2)
library(MAST)
setwd("/athena/ganlab/scratch/lif4001/Human_PGRN/data_analysis/integration_2023")
Human_FTD_integrated <- readRDS("Human_FTD_integrated_PCA_0.1.rds")
# remove clus... |
705bcb069565c66c36d9de32d48b24ef65b5cd446c3443e01799b1004ef0373a | R | 10,014 | 365 |
library(mclust)
library(MCMCpack)
library(Matrix)
library(expm)
library(MASS)
library(mvtnorm)
library(msm)
library(cluster)
Init_clara = function(y,K,Metric){
clara.res <- clara(y, K, samples = 50, pamLike = TRUE,metric = Metric,stand = TRUE)
#ll = order(mod1$centers)
ll = clara.res
init ... |
3383ea33abe8b7e0f16108b62eacf4c7bc9cd6a2a5e497307a11994475fd58b5 | R | 10,071 | 235 | #' Function to obtain repurposing matrix
#'
#' \code{oRepurpose} is supposed to obtain repurposing matrix given a query list of genes. It returns an object of the class 'DR'.
#'
#' @param data an input vector containing gene symbols
#' @param phase.min the minumum phase of drugs allowed. By default it is 3 defining tar... |
64ba724951d646715f256ff2de0ea6f4d440110f7f7ffddc159a05fe40486b87 | R | 10,181 | 226 | ## cell type abundance of post-mitotic cells across stages ##
source(file = "Scripts/lib.R")
library(data.table)
library(ggalluvial)
## load data:
EXCIT_INHIBIT_cleaned_sub <- readRDS(file = "Processed_Objects/EXCIT_INHIBIT_cleaned_sub.rds")
## cell type abundances across ventral/ dorsal along stages:
plot_df <- EX... |
829edf407434623b0c64d4772f93bd0e9f9bb546d45d00d3a4d1fd0847164e35 | R | 10,201 | 200 | #!/bin/env Rscript
library(optparse)
library(Seurat)
library(stringr)
library(data.table)
library(dplyr)
library(patchwork)
set.seed(10)
# mode <- "merged"
# group_name <- "am_pd"
# by_factor <- "seurat_clusters"
# samples <- c("DA807","DA811","DA812","DA814","DA815","DA778","DA779","DA780","DA783","DA803_ASAP48_Ctl_N... |
8a4e91c6ed4267bce377a5aaad11cdb2fecbe39eeb8fc323d624f0ee9de32c5e | R | 10,208 | 234 | ################################################################################
### R script to compare several conditions with the SARTools and DESeq2 packages
### Hugo Varet
### March 20th, 2018
### designed to be executed with SARTools 1.6.3
###
### modified by CT for run inside singularity image
### v2: this versi... |
b59c683954af0aa390d8f71d7850055f1d93c6bba8f9088d401a59cfe8b5e173 | R | 10,242 | 211 | ### public dataset processing
library(Seurat)
library(SeuratDisk)
library(data.table)
library(SpatialExperiment)
library(SingleCellExperiment)
library(WeberDivechaLCdata)
library("AnnotationDbi")
library("org.Hs.eg.db")
library(anndata)
library(harmony)
### locations ###
public_dataset_location = "/Users/zacc/USyd/spa... |
87e640a60fe7bcef87e4f7b73459bf42a65d121603a4d419d5e212a6f4302b86 | R | 10,341 | 292 |
```{R}
##################################################################
# Visualization of CellChat Pathway
# Reproducibility for Figure.4EFGH
##################################################################
# Install packages if not already installed
install.packages("ggplot2")
install.packages("ggalluvial")
# ... |
f73fb6aba0c66ddd11110b473bb15d8933dfd8c50db9630a3d9d90488ac56120 | R | 10,367 | 172 | #### load packages ####
targetPackages <- c('tidyverse','data.table','arrow','car','emmeans','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) li... |
a72d4f5792e8be38efbc7090365dc0de0b8fe6074da9502d0822837bcef2c17d | R | 10,403 | 256 | # data_analysis.R
library(ggplot2)
library(dplyr)
library(methods)
library(tidyverse)
library(hrbrthemes)
library(zoo)
# Get the argument passed from the bash script
args <- commandArgs(trailingOnly = TRUE)
sub <- args[1] # The first argument
# Get the exported environment variables
dest_dir <- ... |
23795dcbc50dee5ee5498ebf8deec9505a589d16175d48bf9012d7049b58d18f | R | 10,415 | 326 | # code to generate the connectome graph based on the CATMAID database
# Gaspar Jekely 2023
source("code/Natverse_functions_and_conn.R")
# get all synapses from CATMAID
all_syn_connectors <- catmaid_fetch(
path = paste(pid, "/connectors/", sep = ""),
body = list(
relation_type = "presynaptic_to",
relation_... |
5a6c48b96f3fe93685884c8cbc534518122382618a5abf8954e7ebefcb863956 | R | 10,444 | 305 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
GTEX_OUT_DIR <- "/home/jgburk/Pycha... |
9be806c13b5122b13bb3b873611012e1a78f84457fcab2fe934152ccb5c659c2 | R | 10,464 | 218 | #### load packages ####
targetPackages <- c('tidyverse','data.table','arrow','ggsci','gganimate','gifski','gapminder')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targe... |
4f968a23462de4cc87dc242b85f646a45e76297ae29fd35f0354062ee0e502f8 | R | 10,480 | 222 | #### load packages ####
targetPackages <- c('tidyverse','arrow','car','plyr','ggcorrplot','corrr')
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(p... |
ee90e54ca73812b024be88f119c8a256f791c140886374bcbfbb67e26768393f | R | 10,511 | 306 | set.seed(88888888) # maximum luck
library(DESeq2)
library(plotly)
library(ggplot2)
library(viridis)
library(magrittr)
library(pheatmap)
library(DescTools)
library(pdfCluster)
library(RColorBrewer)
library(SummarizedExperiment)
library(caret)
library(class)
start_time <- Sys.time()
GTEX_OUT_DIR <- "/home/jgburk/Pycha... |
99e9fc88f4dbc3df10c89a8791c8a31d5bf9ee17bc13242c6cd15d349b2ac556 | R | 10,573 | 332 | library(plyr)
library(dplyr)
library(tidyverse)
library(tidyr)
library(ggplot2)
library(ggpubr)
library(reshape2)
library(data.table)
library(Seurat)
library(dplyr)
library(tidyverse)
library(rio)
library(GenomicRanges)
library(rGREAT)
library(pheatmap)
library(readr)
library(rrvgo)
library("org.Hs.eg.... |
c34460e47029a6ddd02eb9fe775b7d4ecb43cec76f87bcc40d8b9e00ebd98cbc | R | 10,615 | 245 | #' Function to visualise prioritised genes using manhattan plot
#'
#' \code{oPierManhattan} is supposed to visualise prioritised genes using manhattan plot. Genes with the top priority are highlighed. It returns an object of class "ggplot".
#'
#' @param pNode an object of class "pNode" (or "sTarget" or "dTarget")
#' @p... |
92c5c247073f9400f367b2c553e77927b8a495f3af26d3a81257b1d6655491a0 | R | 10,642 | 310 | ### versioni ke avalin valuesh ba 0.63 shoroo mshe
library(tidyverse)
library(GenomicRanges)
library(ggplot2)
library(ggVennDiagram)
library(gridExtra)
library(viridis)
file_paths <- list(
LANCEOTRON = Sys.glob("~/Downloads/Transfers/results_2/LANCEOTRON/*H3K*_R*.bed"),
MACS2 = c(
Sys.glob("~/Downloads/Trans... |
7700bac6b03e073c9aecd888dba3864dd581664059cb3da4e869dee6f3a1ca71 | R | 10,670 | 234 | suppressMessages(library(Seurat))
suppressMessages(library(dplyr))
suppressMessages(library(tidyr))
suppressMessages(library(caTools))
suppressMessages(library(colorRamps))
suppressMessages(library(tidyverse))
#--------------------------------------------------------------
# Load own modules
source('modules/utils.R')... |
d4c7c9f02a9840d6b507117bec680146e7d45778b4834fa28b22371f2361da31 | R | 10,670 | 302 | # =========================================================================
# Internal helpers -- shared across all selector functions
# =========================================================================
# Robust cell extraction: get selectable cell names from a ggplot object.
# Falls back to colnames(object) i... |
17b6a30720b61109a7e21d69df624859aac60e1243c6f15ada9bee77a0420759 | R | 10,776 | 148 | #' Function to extract promoter capture HiC-gene pairs given a list of SNPs
#'
#' \code{oDefineRGB} is supposed to extract HiC-gene pairs given a list of SNPs.
#'
#' @param data NULL or an input vector containing SNPs. If NULL, all SNPs will be considered. If a input vector containing SNPs, SNPs should be provided as d... |
e6237c4473446882c2a1042e465716628428d362f6056d47ddf0a82538668b08 | R | 10,798 | 258 | ######
##### Code based on the code provided by Shuangbin Xu and Guangchuang Yu in the Workshop of microbiome dataset analysis using MicrobiotaProcess
##### available at https://yulab-smu.top/MicrobiotaProcessWorkshop/articles/MicrobiotaProcessWorkshop.html and
##### https://github.com/YuLab-SMU/MicrobiotaProcessWorks... |
f70f1a5227b1148037f328f8bd9188202000e3b47758c350a52740ee8dffd241 | R | 10,810 | 239 |
#install.packages
library(Seurat)
library(ggplot2)
library(DoubletFinder)
library(dplyr)
library(ggplot2)
library(cowplot)
library(reshape2)
library(MAST)
setwd("/Users/lifan/Desktop/data_analysis/Human_PGRN/integration_2023")
MG <- readRDS(file = "Human_FTD_MG_subset.rds")
DefaultAssay(MG) <- 'integrated'
MG <- Scal... |
e8f061bd5a2a694363be920f677d1315c8c21989a9364f6ad359a809bbfb2597 | R | 10,849 | 273 | # Set of functions to process sets of waves into time course mean type graphics
# Updated EBM 3/2/2023
# loadhdf5todf: function to load time course data taking all files in the specified directory
# Each file should be hdf5 forman containing just one dataset
# of a single column
# Input is the directory
# ... |
9476b3ce050140f0cb8b15b4190f4aad3aa2270c99728958dfc9fb28bcfe79c1 | R | 10,923 | 266 | # functions archive
# ecdf plot with the best pipeline(s) marked for each experiment
ecdf <- function(data){
best_data = data.frame()
for (experiment_val in c("ERN", "LRP", "MMN", "N170", "N2pc", "N400", "P3")){
newdata <- data %>%
#group_by(ref, hpf, lpf, emc, mac, det, base, ar) %>%
#summari... |
a100f3388c346745476f999edbd50c792dd423c45a635429e336c29d1ef73534 | R | 10,996 | 199 | # ==============================================================================
# Project: LanguAging
# Author : Loïc Labache, Ph.D.
# Lab : Holmes Lab, Dept. of Psychiatry, Rutgers University
# Date : June 17, 2024
# ==============================================================================
# Libraries....... |
78be851bbc376e791245f1664f6a392bf7b963408ca7b36e1215e5ee8649f2c3 | R | 11,032 | 406 | ---
title: "Data Interpretation and Analysis"
author: "David Wedge Group"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Data Interpretation and Analysis}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
co... |
27589ceed06c31faf0d22ce8e66ad1bcbd16cbfad1d34f3f5277c256a38623e8 | R | 11,050 | 342 | require(plyr)
require(dplyr)
require(tidyverse)
require(tidyr)
require(ggplot2)
require(reshape2)
require(data.table)
require(Seurat)
require(rio)
require(GenomicRanges)
require(ggpubr)
require(TFBSTools)
require(JASPAR2020)
require(motifmatchr)
require(readr)
require(GeneOverlap)
args = commandArgs(t... |
adeb1f3f08252b2f087106710d8038a95992d46417246b6d5ceeb6711aa3e916 | R | 11,094 | 233 | #### load packages ####
targetPackages <- c('tidyverse','patchwork','WGCNA',"hdWGCNA")
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... |
66089570966f6b6a929b5ec02321124f8fbb18f32671f9d8d89b41d21fe02e83 | R | 11,111 | 272 | library(multiROC)
library(magrittr)
library(ggplot2)
library(data.table)
library(stringr)
library(dplyr)
DATA_DIR <- "/home/jgburk/PycharmProjects/reticula/data/tcga/output/"
generate_misclass_chord <- function(n_elements,nm_elements,tcga_test_calls_df,tissue_code2name,plot_name){
misclass_df <- data.frame(matrix(d... |
b3d1ce98955e40bba4126fb35b4fabb7125bfaed064585bb6d07412e977149a2 | R | 11,114 | 135 | #' Function to conduct enrichment analysis given a list of sets and a list of ontologies
#'
#' \code{oSEAadv} is supposed to conduct enrichment analysis given a list of sets and a list of ontologies. It is an advanced version of \code{xSEA}, returning an object of the class 'eSAD'.
#'
#' @param list_vec an input vector... |
3bf4afeb5ea4a4ef6239bbdadbc59c8fee31ebfd264ca979befe15797827b2af | R | 11,189 | 359 | library(zellkonverter)
library(Seurat)
library(SingleCellExperiment)
library(ArchR)
############ process ref data
seurat_obj <- readRDS('./label_transfer/Human_thymus_all.rds')
ref <- seurat_obj
ref <- NormalizeData(ref)
ref <- FindVariableFeatures(ref)
ref <- ScaleData(ref)
ref <- RunPCA(ref)
ref <- FindNeighbors(ref... |
e8c58badcad81a42b8a48d1774f9f6af5722fbadb364bf653690e174319a02df | R | 11,241 | 259 | ---
output: html_document
editor_options:
chunk_output_type: console
---
```{r libraries and functions, message=FALSE}
library(tidyverse)
library(Seurat)
source("~/Dropbox (OHSU)/Saunders Lab's shared workspace/arpy/manuscripts/2023_Thai2P4M_FeigeYoung/ms_analyses/1_karl_analysis/r_functions_paths/_color_palettes_... |
b764c688cc7fd30fbec742e0726ba72067b89e5ea9d4c2649a2f7a72042e1460 | R | 11,261 | 257 | ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ###### ######
###### Illustrate the theoretical model behaviour
source("./Settings.R")
################################################################################################################... |
ca17d5fe83ec8f02ba6a8ee86992e5f03529b8ea3d2ced79320383a2f77c69ac | R | 11,311 | 307 |
# Define a function to process each data frame
process_data_frame = function(df) {
# Set column names
names(df) <- header
# Convert columns to numeric
df$per_down <- as.double(df$per_down)
df$per_up <- as.double(df$per_up)
df$num_down <- as.double(df$num_down)
df$num_up <- as.double(df$num_up)
# ... |
999c216c7a6c57ec1a0fe5a7c97cc3590d3fd5b3be4d1ef663cabaf1e8ddf1ae | R | 11,373 | 274 | #### load packages ####
targetPackages <- c('tidyverse','tidytext','arrow','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... |
b16afd117305c110987c290d63938d12f97ac58ea916a1f57544774b03fae141 | R | 11,429 | 244 | #' Function to define graph node coordinates according to igraph- or sna-style layout
#'
#' \code{oLayout} is supposed to define graph node coordinates according to igraph- or sna-style layout.
#'
#' @param g an object of class "igraph" (or "graphNEL") for a graph
#' @param layout a character specifying graph layout fu... |
384c637b765af2451800d13966ac0095966f1a01f597cd63f0a235870615c2c3 | R | 11,515 | 480 | ---
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... |
0db561797ccbacfac0499eeb5b8f649ed37c61946387819d0ee41a00b1591a7a | R | 11,620 | 319 | # random forest analysis
# Load necessary libraries
library(phytools)
library(picante)
library(randomForest)
library(caret)
library(dplyr)
# Define file paths
data_files <- list(
# carnivora = "carnivora_no_pinni.csv"
# primates = "primates.csv"
# rodentia = "rodentia.csv",
# artiodactyla = "artiodact... |
e1349f45ed56591c487306a40e661cb43fa118e66156f36f07ab38b5c6ba6a73 | R | 11,646 | 301 | #-------------------------------------------------------------------------------
# export
#-------------------------------------------------------------------------------
#' Export miic result for plotting (with igraph)
#'
#' @description This function creates an object built from the result returned
#' by \code{\link{... |
5a80b55e47a2c7b339ed693192e8efac0c39002e78e116c5040699d0b61018f5 | R | 11,684 | 168 | #resnet 10fold CV vs reaction network 10 foldCV vs pathway hierarchy 10fold CV with lines for random tissue label and reaction pc1 shuffles
library(magrittr)
library(dplyr)
library(ggplot2)
OUT_DIR <- "/home/burkhart/Software/reticula/data/aim2/output/"
# resnet 10fold CV
resnet_10foldCV_acc_fns <- c("resnet_resnet_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.