sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
3a68b82c19eab0a7fe9aa2dbcc470e42513ebb937b7cec1ba816d3bc4c402f52 | R | 1,471 | 35 |
# try again and track time of model fitting in R instead of julia
# use || to keep it reasonable
library(dplyr)
#library(lme4)
library(tictoc)
data <- tar_read(data_eegnet) %>% filter(experiment=="ERN") %>% select(-c("experiment"))
tic()
model <- lme4::lmer(accuracy ~ ( ref + hpf + lpf + emc + mac + base + det + ar)... |
105a8eb345566698b3fb319c1e11f7bcfe0daa885f35675078631f54d2b0a5f4 | R | 1,474 | 44 | #' Count Cases or Blood Counts
#'
#' Function to count number of individual cases and blood counts.
#'
#' @param x `data.table`, in the format described in [`sbcdata`].
#' @return `integer`, number of cases or blood counts
#' @author Sebastian Gibb <mail@@sebastiangibb.de>
#' @rdname counts
#' @export
#' @examples
#' c... |
f5d0bef76c14985fc7a9607dc4e7b841e675c568f809ca403c39d92c4e92998c | R | 1,477 | 58 |
# sociodem EDA
demo <- tar_read(demographics)
model <- tar_read(eegnet_HLM) # TODO, also branches
orig_data <- tar_read(data_eegnet)
# from rfx_vis function
data <- ranef(model)$subject %>%
mutate(subject = rownames(.)) %>%
mutate(intercept = `(Intercept)`) %>%
select(c(intercept, subject))
rownames(data) <- ... |
dc3596fc0514b3511c5f17f536d025b02a1152f4e123ad012f3e0b96ffdecb88 | R | 1,484 | 43 | #' Label CBCs
#'
#' Run the labeling as done in the AMPEL project.
#'
#' @param x `data.table`, in the format described in [`sbcdata`]
#' @param time `numeric(1)`, label entries with `"SecToIcu"`
#' below this time and `Diagnosis == "Sepsis"` as "Sepsis" or as "Control"
#' otherwise.
#' @return `data.table`, same as `x... |
893508800cb7761a1853037344eaad33b3ca2cf95dd12a7b0f0649fea441d8b2 | R | 1,490 | 27 | #### load packages ####
targetPackages <- c('tidyverse','biomaRt')
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, character.only = T)
###... |
895a6b502a5919f3ebbfeeeaf698d7f8491208bb7eded14f3d705eac68b4839a | R | 1,492 | 59 | library(Seurat)
library(tidyverse)
library(stringr)
setwd("~/cortex/fig4/")
gene_list <-
c(
"PDZD2",
"GNAL",
"GRIA4",
"CALB1",
"DCC",
"TRHDE",
"GRIN3A")
chipIDs <- cortexMeta %$% ChipID
t2 <- list()
bins <- list.files("../GEF/bins/", "200.qs", full.names = T) # bin200 seurat obejct
mcla... |
7898fc30b0de8641a2af5fa0898d607d71629dc17342e453ae3847e5d2fcc0e0 | R | 1,499 | 33 | library(tidyverse)
setwd("~/cortex/SnRNA/4_abaundance_differential/")
library(data.table)
library(magrittr)
# subclass neuron test
# cluster test
wholeMeta <- read.csv("../3_mergingDatasets/SnRNA_Meta.csv")
region <- c("ACC", "AG", "DLPFC", "FPPFC", "ITG", "M1", "PoCG", "S1", "S1E",
"SMG", "SPL", "STG",... |
58b88a874f14f0ec13ead375dd2d2cbceaa1d652fc7f1ad4fc5ac78fc0cf7508 | R | 1,503 | 50 | #' Function to reverse the edge direction of a direct acyclic graph (DAG)
#'
#' \code{oDAGreverse} is supposed to reverse the edge direction of a direct acyclic graph (DAG; an ontology). The return graph remains all attributes associated on nodes and edges.
#'
#' @param g an object of class "igraph" or "graphNEL"
#' @... |
1446eab633714bff9dc2e2f7ffc23018f52d61aed91ce9f15f194b8608dcf504 | R | 1,510 | 53 | library(Seurat)
library(parallel)
library(stringr)
library(tidyverse)
library(magrittr)
library(hdf5r)
library(qs)
setwd("~/cortex/STEREO/GEM")
h5adFiles <- list.files("~/cortex/STEREO/GEM/bin200", "\\.h5ad", full.names = T)
file = h5adFiles[[1]]
mclapply(h5adFiles, mc.cores = 5, function (file) {
print(file)
dat... |
aa0ee0e8fa0e2116e197d517cf6ed23496b44a2aef57bfe2a548cb4476f34ef0 | R | 1,510 | 23 | #!/usr/bin/env Rscript
library(tidyverse)
library(ggplot2)
library(Seurat)
library(MAST)
cell_type = commandArgs(trailingOnly=TRUE)[1]
cleaned_cell_types <- c("L5/6_NP" = "L5/6 NP", "L5_ET" = "L5 ET", "L6_IT_Car3" = "L6 IT Car3", "L6_CT" = "L6 CT", "L6_IT" = "L6 IT", "L2/3_IT" = "L2/3 IT", "L4_IT" = "L4 IT", "L5_IT" ... |
6698b885237a4b831441e123ef7c28bfaaa280a5ef2ff8823dd42ec71b5dee8d | R | 1,512 | 71 | suppressPackageStartupMessages({
library(SC3)
library(SingleCellExperiment)
library(scater)
library(aricode)
})
############################## Run sC3 ###################################
run_SC3 <- function(sce){
if(ncol(sce) > 5000) {
idx <- sample(1:ncol(sce), 5000)
k <- sc3_estimate_k(sce[,id... |
f6ae6afdbbd089c591ebd92bb3f12d4c5395bccec556def02f6a77d03be52462 | R | 1,515 | 53 | library(dplyr)
library(data.table)
library(optparse)
# Load arguments ----------------------------------------------------------
# Environment: R 3.6.1
parse <- OptionParser()
option_list <- list(
make_option('--plink', type='character', help="plink-format files", action='store')
)
args = commandArgs(t... |
fe31985d5a685f1d2dd1711051cc3095dba2287478f06977819cf650a5bba3a7 | R | 1,524 | 42 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
vst.counts <- DESeq2::vst(dds,
... |
8b621da108d4442fdf522b851cafd9b1aeb9a77011bf9b1e3c77f735dbf2385c | R | 1,525 | 42 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/tcga/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/tcga/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
vst.counts <- DESeq2::vst(dds,
... |
e480d3f963353d297da8eda6692f5dbe69831bed1bbaa7a16268fbe9eaff92ca | R | 1,527 | 46 |
## ggpairs with adj correlation p values
##
## # Install and load the necessary packages
library(GGally)
library(dplyr)
# Sample data
data(mtcars)
# Custom function to calculate correlations with adjusted p-values
# Custom function to calculate correlations with adjusted p-values
cor_with_p_adjust <- function(dat... |
7d20790ff2cb2ecefe2946d75cd59610731efaf65c8ea6fc741d2690092f3e88 | R | 1,531 | 60 |
# TODO
# other model checks (HLM)
# posterior predictive check
performance::check_model(hlmexp[[1]])
# model checks
plot(model)
# non-normality might / not must obscure statistical tests
qqnorm(resid(model))
qqline(resid(model))
qqplot.data(resid(model))
# Extract random effects at level 1
random_effects <- ra... |
bd8f6c0f63b6c978f7f53c1fb7190e6f2368964c2d7a551557f6d6c11e5633f4 | R | 1,532 | 50 | require(plyr)
require(dplyr)
require(tidyverse)
require(tidyr)
require(reshape2)
require(data.table)
options(scipen = 999)
####
## EXPAND PEAKS AND WRITE AS BED FILE
####
# Load grouped CREs
cres = readRDS('OUT_DATA/Evo_groups/CREs_SignTested_ConsAdded.RDS')
# Top N CREs
n = 20000
type = 'TOP20K_E... |
9c4ef1437cfd7c2532ab1ab3c16f38df22a19505f4e8f4d98329706943980399 | R | 1,538 | 46 | # READ DDS OBJECT FROM RDS FILE: -----------------------------------------------
dds <- readRDS(
file = rds_deseq2_results
)
# EXTRACT TRANSFORMED VALUES: --------------------------------------------------
vsd <- vst(dds,
blind=FALSE)
# CUSTOMIZE A PCA PLOT: -------------------------------------------... |
a080072ea3127489451b63eda2ee94909463cdaece8517edae08fa0716e7f40d | R | 1,539 | 36 | setwd("~/cortex/STEREO/2_Deconvolution_and_QC/")
chipList <- read.delim("~/DATA/data/STEREO/AnalysisPlot/cortex") %>% {setNames(nm = .$chip,.$region)}
chipList2 <- read.delim("~/DATA/data/STEREO2/sampleMeta") %>% filter(cortex_category == "neocortex") %>% {setNames(nm = .$chipID,.$abbr)}
chipList2[str_detect(chipList2... |
8c378d1b38c17a3456669dd90aeb8abd3c08c7ece0c9e5b8b5f832c8796d0426 | R | 1,553 | 54 | context('Test Poisson regression model')
set.seed(1994)
test_that("Poisson regression works", {
data(mtcars)
bst <- xgb.train(
data = xgb.DMatrix(as.matrix(mtcars[, -11]), label = mtcars[, 11], nthread = 1),
nrounds = 10, verbose = 0,
params = xgb.params(objective = 'count:poisson', nthread = 2)
)
... |
49d41e116db8a7ae995b57f73b582560e7059809d2c45b7ab96b95f690bafd4b | R | 1,558 | 23 | #!/usr/bin/env Rscript
###############################
#I/O
###############################
library(tidyverse)
library(ggplot2)
library(Seurat)
library(MAST)
cell_type = commandArgs(trailingOnly=TRUE)[1]
cleaned_cell_types <- c("L5/6_NP" = "L5/6 NP", "L5_ET" = "L5 ET", "L6_IT_Car3" = "L6 IT Car3", "L6_CT" = "L6 CT", "... |
b16a45e26942583184d7c3fb3880d826c08fcb26cdee1e37e48c998e2e359b5a | R | 1,559 | 28 | run.DESeq2 <- function (counts, target, varInt, batch = NULL, locfunc = "median",
fitType = "parametric", pAdjustMethod = "BH", cooksCutoff = TRUE,
independentFiltering = TRUE, alpha = 0.05, ...)
{
dds <- DESeqDataSetFromMatrix(countData = counts, colData = target,
... |
6ab632321a14422ccd29a8ca4a71142306c22d02796e82061896fb8214f4a9a8 | R | 1,560 | 62 |
args <- commandArgs(TRUE)
if(length(args)!=3)
{ print("Usage: \'R --slave --args <InputData> <output> <CopyNumberEstimatFile> < refine.R\'")
q()
}
infile = args[[1]];
outfile = args[[2]];
cnfile = args[[3]]
x_in = read.table(infile,header=TRUE);
x_in$ratio = x_in$obs/x_in$expected
cn = ... |
0de082060e9528b0cb39d64aee6424d52e84059aba92374379af9e850a11e6db | R | 1,567 | 51 | #' @title mergeMatrix
#' @description Merge multiple matrix files into one. At least two matrix files should be specified.
#' @param x Matrix 1 or a list of Matrix.
#' @param y Matrix 2.
#' @param ... More matrix files.
#' @export
setGeneric(
name = "mergeMatrix",
def=function(x, y, ...) standardGeneric("mergeMatr... |
3d2aa957b3f2a04d9cfe5dfa5952f964e270ae5970a122f3836e3070dbc9061b | R | 1,568 | 39 | library(Seurat)
library(dplyr)
library(ggplot2)
## CFSE Transcriptome: UMAP visulaization and cell state abundance ##
## load data and subset:
load("Processed_Objects/Inhibitory_datasets.Rdata")
Inhibitory_datasets <- SetIdent(Inhibitory_datasets, value = "Experiment" )
CFSE <- subset(Inhibitory_datasets, ident = c("... |
b5ad51890378a75e33a5306253a45d5a457fe1633298184c69294b9ed808ea5a | R | 1,570 | 48 | library(Seurat)
library(tidyverse)
library(ranger)
set("~/cortex/figS1-6/")
seu <- readRDS('../SnRNA/SnRNA_seurat.RDS')
seu <- seu[,seu$class == "excitatory"]
train_data <-
seu@reductions$pca@cell.embeddings %>% as.data.frame()
train_data["label"] <- seu$region %>% factor
train.forest <- ranger(label ~ .,
... |
29216bfc147d8e64871b0226ccd6e83dcfa15b1e1627a24422ca301f18e466ee | R | 1,575 | 42 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP061240/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP061240/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
vst.counts <- DESeq2::vst(dds,
... |
4d3fcd7dfa16a2b45f77680403b135ecfea16325f0d5657a0f5da514791a340e | R | 1,575 | 42 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP050223/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP050223/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
vst.counts <- DESeq2::vst(dds,
... |
56eae68d61f08d630fc449e58bed560d7df4ac20dd2fbf42ab01aa1ea094e6aa | R | 1,575 | 42 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP042228/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP042228/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
vst.counts <- DESeq2::vst(dds,
... |
a324c35f53b6f8eadc2cc224b0e40e473bbe8ffd7fe014a5b583220a87304f69 | R | 1,575 | 42 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP035988/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP035988/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
vst.counts <- DESeq2::vst(dds,
... |
ab4df6c3dda6e2bb85f7a4f430beb1fe28787e7a2d3a878b0e825a52072a8dad | R | 1,575 | 42 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP049593/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP049593/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
vst.counts <- DESeq2::vst(dds,
... |
d989a229da90a8b869364bf2ec962ab6cbd87d3a2d034694058b8de5da72363a | R | 1,581 | 39 | # ==============================================================================
# run_all.R - MASTER SCRIPT: RUNS THE FULL ANALYSIS PIPELINE
# ==============================================================================
#
# PURPOSE:
# Convenience wrapper that runs all analysis scripts in the correct order,
# wit... |
bbf69c5a70cbf6d7f4ee61d92481c03a4e41aea429136b36888049d98c09b76c | R | 1,582 | 55 |
args <- commandArgs(TRUE)
if(length(args)!=3)
{ print("Usage: \'R --slave --args <InputData> <FragmentLength> <output> < normalize.R\'")
q()
}
infile = args[[1]];
fragLen = as.numeric(args[[2]]);
outfile = args[[3]];
load.success = library(mgcv,logical.return=TRUE)
if(!load.success){
q(sav... |
c5f5a331c8e5587126af7ad5617f0a11d6f517b40a6ab75f26f397d408417094 | R | 1,602 | 56 |
# extract average decoding accuracy after baseline in sliding window approaches
#
#data <- tar_read(data_sliding) %>% filter(experiment=="ERN") %>% filter(times <= -0.6)
data <- tar_read(data_sliding)
experiments <- c("ERN", "LRP", "MMN", "N170", "N2pc", "N400", "P3")
baseline_end = c(-0.2, -0.4, 0., 0., 0., 0., ... |
11737e944beb72b0b0fa8dca51569bd5d0a37fb99562fde9d19506eb836f98e7 | R | 1,604 | 23 | #' SNV data from individual A1
#'
#' Exemplary SNV data from individual A1 of the study Körber et al., Detecting and quantifying clonal selection in somatic mosaicism. The dataset is a list object, containing variant information in vcf format.
#'
#' @format ## `snvs`
#' A list containing a data frame with 447 rows and... |
36468ac641c417f4dc3e1fdaf294bb1ed4965fed43a007ec186a5772d504248f | R | 1,606 | 74 |
# similar RFX across experiments?
model <- tar_read(eegnet_HLM_exp, branches=1)[[1]] # TODO: use pattern, and then combine the results
orig_data <- tar_read(data_eegnet_exp, branches=1) %>% filter(tar_group==1) # to get the EXP information
# start here
data <- ranef(model)$subject %>%
mutate(Subject = rownames(... |
fd9c5662885c6a2bacabcea028ee642c8474a033f533a5a056fa97a04c52b0d5 | R | 1,609 | 33 | library(tidyverse)
library(qs)
library(parallel)
library(magrittr)
library(RANN)
library(ggridges)
library(dendextend)
library(ggpubr)
devtools::load_all("~/spacexr-master/")
setwd("~/cortex/fig1/")
spatialCellMeta <- read_csv("../STEREO/spatialCellMeta.csv")
subclass_color <-c(AST = "#665C47", ENDO = "#604B47", ET =... |
14c715749ca5556b1e0ce767b58dd863d56229477143cda0e23886cfcf092ab5 | R | 1,613 | 36 | # load packages
library(MEAanalysis)
# data processing
source("hippocampal_data_processing.R")
####################################################################################################################
# Single electrode analysis - Hippocampal Neuronal Cultures
# well A6: 1 mM KCl agonist challenge, 45k cel... |
5df3231037b122886d9e82611b275973900e71c4236744b8f6d111d373dbf873 | R | 1,623 | 47 | library(viridis)
library(pheatmap)
library(RColorBrewer)
combined.df <- readRDS("~/combined_df.Rds")
tissue.vec <- readRDS("~/tissue_vec.Rds")
datasource.vec <- readRDS("~/datasource_vec.Rds")
colFun <- colorRampPalette(RColorBrewer::brewer.pal(10,"Paired"))
annotation_col.df <- data.frame(Datasource = datasource.ve... |
0255c35f6b9cdcd3c5cbe4227462f744a947fcacb21035893c95845dc28d79fe | R | 1,630 | 77 | suppressPackageStartupMessages({
library(cidr)
library(aricode)
library(SingleCellExperiment)
})
################################ Drop out ####################################
#drop out function
dropout_sampling <- function(sce, drop_rate = 0, seed){
#set seed
set.seed(seed)
#dropout sampling
gene_size ... |
82384d1b1df4a6b8d356599acda594d260534e6d72ff9486f93694009bb05ecc | R | 1,639 | 82 | ---
title: "plots"
output: html_document
date: "2024-05-13"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## decodubg time series
```{r}
library(ggplot2)
library(dplyr)
library(targets)
# import N170 sliding data
data <- tar_read(data_sliding) %>% filter(experiment == "N170")
# generate a ... |
8937608bae64fe9d1effdc21d9c2b50f8c4a3a96ecf39c02cf603515f09f7bee | R | 1,646 | 47 | #' Discretize a real valued distribution
#' @description This function performs minimum description length (MDL)-optimal histogram density estimation
#' as described in Kontkanen and Myllymäki (2007) and returns the cutpoints found to give the best model
#' according to the MDL principle.
#'
#' @references
#' \itemiz... |
63fc482d655a01b797b1cac05cfb0e6f1b51eece6fbb79db40b5ccfe3729b66f | R | 1,648 | 44 | # https://github.com/amarinderthind/RNA-seq-tutorial-for-gene-differential-expression-analysis
# get the first agrument as the filename
filename <- commandArgs(trailingOnly = TRUE)[1]
#filename <- 'daf-16_SVIP_daf-16.salmon.deseq2_results_padj0.05.csv'
print(filename)
# get the second argument as the comparison
compa... |
f439fb09fb7ff8fdc8097dc26cc795d3fd43ba6d2c0f77bd6823b47688819a5f | R | 1,654 | 40 | # modified 2021/02/02 by CT changing size of text inside cells
pairwiseScatterPlots <- function (counts, group, outfile = TRUE)
{
ncol <- ncol(counts)
if (ncol <= 30) {
if (outfile)
png(filename = "figures/pairwiseScatter.png", width = cairoSizeWrapper(700 *
... |
305b1577706cc4c4a798cc849a727b6f2b5414f38d1ca60c8d8b7317b689a9bc | R | 1,661 | 52 | library(sybil)
library(writexl)
library(stringr)
library(data.table)
### configure
path2model = "../data/IMB015.RDS"
path2output = "../result/metabolic_fluxes.xlsx"
### define functions
getMetaboliteProduction <- function(mod) {
require(sybil)
require(data.table)
# MTF
sol.mtf <- optimizeProb(mod, algorith... |
26948faceb78142cb5d5b4f235d2b7565ef2f0625cc13ed2938fa3a71d54b7ec | R | 1,664 | 74 | suppressPackageStartupMessages({
library(SingleCellExperiment)
library(SINCERA)
library(aricode)
})
memory.limit(1e+10)
################################ Drop out ####################################
#drop out function
dropout_sampling <- function(sce, drop_rate = 0, seed){
#set seed
set.seed(seed)
#dropo... |
1c33fabb363259eeacbc05d9229f3e05a609fc53ab4428a254854983bda14cf0 | R | 1,669 | 30 | MAPlot <- function (complete, alpha = 0.05, outfile = TRUE,fc.cutoff=1)
{
ncol <- ifelse(length(complete) <= 4, ceiling(sqrt(length(complete))),
3)
nrow <- ceiling(length(complete)/ncol)
if (outfile)
png(filename = "figures/MAPlot.png", width = cairoSizeWrapper(1800 *
... |
4ae8a31aae7adb173f421561e1e6ad77f2ff650a979fce82bc6e1d6ed06b9a35 | R | 1,677 | 31 | library(tidyverse)
library(readxl)
library(ggpubr)
setwd("~/Desktop/R_scripts/")
file_path <- "all_performance_metrics.xlsx"
data <- read_excel(file_path)
data <- data %>% rename(Score = F1)
data_f1 <- data %>% select(Method, Score, HistoneMark) %>% mutate(Metric = "F1")
data_precision <- data %>% select(Method, Pre... |
139c2f64e0978e1cf6e9f5a1c5147bfd48296d155fb8b0facf20dbf97b7b13b7 | R | 1,690 | 48 | ###############################################
###############################################
###############################################
###############################################
###############################################
###############################################
################################... |
8de1d3dd99130dccf15fea9eabbf5f4ff4fccc5c55f1bff758d70a42f70194e7 | R | 1,703 | 55 | #' Function to calculate the area under the curve
#'
#' \code{oAUCurve} is supposed to calculate the area under the curve.
#'
#' @param x numeric vectors giving the x-coordinates
#' @param y numeric vectors giving the y-coordinates
#' @param method the medthod used to calculate the area under curve. It can be 'trapezoi... |
a67826a90982a696b0210a904e06d2a4baa9ca5099f2584852b52d2cf8661e22 | R | 1,703 | 47 | # DEFINE FILES AND PATHS: ------------------------------------------------------
# Path to the gene raw counts matrix
input_cts <- "data/processed_data/rnaseq_e17/raw_counts/rnaseq_e17_raw_counts.tsv"
# Path to the sample sheet file
input_coldata <- "data/meta_data/rnaseq_e17/coldata.csv"
# Path to output directory f... |
885100468c37487799e9a5bcc813feaf5ece39cc17be036af47f0b7b7d2916cc | R | 1,712 | 47 | library(viridis)
library(pheatmap)
library(RColorBrewer)
combined.df <- readRDS("~/combined_df.Rds")
tissue.vec <- readRDS("~/tissue_vec.Rds")
datasource.vec <- readRDS("~/datasource_vec.Rds")
colFun <- colorRampPalette(RColorBrewer::brewer.pal(10,"Paired"))
annotation_col.df <- data.frame(Datasource = datasource.ve... |
4cbea7892b491febd0c87356ec7a557b919e0f97ece1244c8fe9b7ec703e4654 | R | 1,713 | 49 | # DEFINE FILES AND PATHS: ------------------------------------------------------
# Path to the gene raw counts matrix
input_cts <- "data/processed_data/rnaseq_e16/raw_counts/rnaseq_e16_raw_counts.tsv"
# Path to the sample sheet file
input_coldata <- "data/meta_data/rnaseq_e16/coldata.csv"
# Path to output directory f... |
aafbc43138acce4c01ed61e9fa8d7d67a568b979d3d3f7d89a6707f621dd3963 | R | 1,722 | 40 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
TCGA_IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/tcga/input/"
TCGA_OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/tcga/output/"
GTEX_IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/input/"
GTEX_OUT_DI... |
be3796fc741853e3dc8081d88796c157a0b6f0fae6f9cf34468edbcf4b2a06c8 | R | 1,722 | 31 |
# test interactions
#DEBUG
data = tar_read(data_eegnet_exp, branches=1) %>% filter(experiment == "ERN")
interactions = TRUE
# INFO: Julia should start its own process by each function call, so the ENV variables set should be individual
julia_library("Parsers, DataFrames, CSV, Plots, MixedModels, RData, CategoricalAr... |
2179b2bcfca5cfcd1a57c994ab946a63bc86a0b499ef14e9eba680e4a1fbaa1c | R | 1,723 | 66 | library(readxl)
library(dplyr)
library(ggplot2)
library(tidyr)
library(ggstatsplot)
library(patchwork)
file_path <- "~/Downloads/final_peak_analysis_summary_all.csv"
if (!file.exists(file_path)) {
stop("File not found: ", file_path)
}
data <- read.csv(file_path)
colnames(data) <- tolower(colnames(data))
data$me... |
cfc3337aaaacf10b270e41186210de4874a83cbffdbbbb733b88b2e173095f0e | R | 1,723 | 41 | ### Analysis of genes or gene-sets of interest from Visium 10X datasets
library(spacexr)
library(Seurat)
library(Matrix)
library(doParallel)
library(ggplot2)
library(plyr)
library(data.table)
library(ggpubr)
############################################################################################
#### Inputs
#####... |
569c8e6476f86e48ffe935c40970870817b655c5ab47048a33e461cb79ffa83e | R | 1,725 | 44 | ## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(echo = TRUE)
## ----library, include=TRUE----------------------------------------------------
library(TockyPrep)
library(TockyRandomForest)
library(gridExtra)
## ----files, include=TRUE------------------------------... |
c364fc0980a7d5161862c0d33f18f2738fe1dee9408d2ca6bbaf2431a4923ec0 | R | 1,730 | 67 | library(data.table)
library(tidyr)
library(ggplot2)
library(ggrepel)
#' Compare two different metrics files
#' useful when tweaking pipeline or metrics
new_metrics <- fread('data/metrics_batches_isolabel-fix.csv') # most recent metrics output
old_metrics <- fread('data/metrics_batches_master.csv') # previous metric... |
a9e5a29b434af362e1b39ef3c0f5e93ba16a2e5fded7223f2cdb1a464bac4b84 | R | 1,739 | 47 | # DEFINE FILES AND PATHS: ------------------------------------------------------
# Path to the gene raw counts matrix
input_cts <- "data/processed_data/rnaseq_ctrl_e13/raw_counts/ctrl_e13_e17_counts.tsv"
# Path to the sample sheet file
input_coldata <- "data/meta_data/rnaseq_ctrl_e13-vs-e17/SampleSheet_e13_e17.csv"
#... |
874b76e617fd46424475a66f42890180fcd103006fd4d62fec9fdb787efd402c | R | 1,740 | 61 |
args <- commandArgs(TRUE)
if(length(args)!=3 && length(args)!=4 )
{ print("Usage: \'R --slave --args <InputData> <output> <fragmentLen> <CopyNumberEstimatFile> < refineGAM.R\'")
q(save="no",status = 1)
}
infile = args[[1]];
outfile = args[[2]];
fragLen = as.numeric(args[[3]]);
if(length(arg... |
b5a366c58af495a04f75be5497076b202a6783ba852a33d01b49ac86534da550 | R | 1,753 | 61 |
# JULIA tests
# https://hwborchers.github.io
library(dplyr)
library(JuliaCall)
#options(JULIA_HOME = "~/Programs/julia-1.8.5/bin/")
options(JULIA_HOME = "/Users/roman/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/bin/")
julia_setup()
julia_call("sqrt", 2.0)
julia_command("a = sqrt(2.0)")
## [1] 1.41421356237... |
2dc95cb4c77e5cefbc2ea0402860e43bc68b944c7614fdd8a7bf14363d69e434 | R | 1,757 | 35 |
####################################################################################################################
# R script to compare outputs between MEAanalysis results and Axis Navigator
####################################################################################################################
#######... |
72e621f616a1941fcd6d5bac8d488975902215e30351f36e12ce5e408d3400be | R | 1,757 | 56 | #' Function to find the root node of a direct acyclic graph (DAG)
#'
#' \code{oDAGroot} is supposed to find the root node of a direct acyclic graph (DAG; an ontology). It return the name (i.e Term ID) of the root node.
#'
#' @param g an object of class "igraph" or "graphNEL"
#' @return
#' \itemize{
#' \item{\code{ro... |
7ba5ec99825e156ab85b7f169e01056a29dbffe85d5df0e335f7e1ed10998857 | R | 1,758 | 51 | # Load library
if (!require("vioplot")) install.packages("vioplot")
library(vioplot)
# Trait columns
trait_cols <- c(
"gestation_length_d_x_brain_mass_g",
"gestation_length_d_x_adult_mass_g",
"litter_size_n_x_gestation_length_d"
)
trait_labels <- c("GL X BrM", "GL X BM", "GL X LS")
trait_colors <- c("#F9766E", "... |
bb59632055d75da94ed33ebf3d26e3e8c441af2b486b4e2a9baa8f277235ecf9 | R | 1,761 | 62 | library(CellChat)
library(tidyverse)
library(Seurat)
library(qs)
library(magrittr)
options(stringsAsFactors = FALSE)
setwd("~/DATA/BRAIN/STEREO/frequentGraph")
geneIDtoSym <- read.csv("../../SnRNA/gene_kept.csv") %>% {setNames(.$gene_name,nm = .$gene_id)}
scRNA <- qread("../../SnRNA/3_5_seu.rna.rmXY.qs")
Idents(scR... |
5d7e91cd63da658253c5bea3dbec04751298e6e41c2782125b6517b63fd4ee38 | R | 1,767 | 57 | library(purrr)
library(magrittr)
library(tidyverse)
library(Seurat)
library(harmony)
library(ape)
library(uwot)
library(ggtree)
library(treeio)
# library(future)
setwd("~/cortex/SnRNA/3_mergingDatasets/")
set.seed(123)
qsFiles <- list.files(".","merge.qs",full.names = T)
sampledCell <- function(x){
set.seed(1)
x... |
9e98624108edf8255b61ed1b8ca0d05a54d31f76260be60ffa465c91773dc6a0 | R | 1,782 | 46 | # PREPARE DATA: ----------------------------------------------------------------
# Extract the numeric data for plotting starting at column 7
ctrl_data <- ctrl_matrix[, 7:ncol(ctrl_matrix), with = FALSE]
nicd_data <- nicd_matrix[, 7:ncol(nicd_matrix), with = FALSE]
# Calculate the mean across all regions for each posi... |
50d9671bc769a9b8e92332cc01c631f0d254c62b2820d49fde1e65a7c41f554e | R | 1,801 | 49 | library(tidyverse)
setwd("~/cortex/SnRNA/3_mergingDatasets/")
library(data.table)
library(magrittr)
resFiles <- list.files("./","merge.qs")
x = resFiles[[1]]
Meta <- parallel::mclapply(resFiles,mc.cores = length(resFiles),FUN = function(x){
seu <- qs::qread(x)
seu@meta.data$sex[str_detect(seu@meta.data$donor,"^S[... |
0b460790233ada428de867948c77578efd62e6918789613b87cfaf38d3cef206 | R | 1,807 | 54 | #' plot power curve
#'
#' @param resFile - the dataframe with proportions of probes with certain level of power output from running calcProps() where each column is a
#' cell type and each row is a different condition, e.g. different sample size or mean difference
#' @param calcType - character string of the type of p... |
39fb0d1baf60f3728360cb9a4105bc33647e9a885d3e86055a1ea60dc257bf55 | R | 1,814 | 70 | library(Matrix)
library(Seurat)
library(stringr)
library(magrittr)
# library(SeuratDisk)
library(tidyverse)
library(Matrix)
library(qs)
library(parallel)
devtools::load_all("~/spacexr-master/")
setwd("~/cortex/STEREO/1_Deconvolution_and_QC/")
qsFiles <- list.files("../cellbin/", ".qs$", full.names = T)
snRNA = readR... |
d67ab940b32b7340db27cb41fe9bbcd96619336cc2d0a927483320c627b86250 | R | 1,835 | 54 | library(dplyr)
library(data.table)
library(optparse)
# Load arguments ----------------------------------------------------------
# Environment: R 3.6.1
parse <- OptionParser()
option_list <- list(
make_option('--bim', type='character', help="plink-format .bim file", action='store')
)
args = commandArgs... |
2427334d299109fafd912fe2b127a25306b5219b5e0a204abe666381c1b9a82a | R | 1,845 | 82 | suppressPackageStartupMessages({
library(SingleCellExperiment)
library(SINCERA)
library(aricode)
})
memory.limit(1e+10)
################################ Drop out ####################################
#drop out function
dropout_sampling <- function(sce, drop_rate = 0, seed){
#set seed
set.seed(seed)
#dropo... |
6271a996b84330710edd5445f56ed92c85a4d64f92c8327da65596f790fe774f | R | 1,845 | 34 | library(magrittr)
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP035988/output/"
labelled_edge_weights.df <- read.table(paste(OUT_DIR,"labelled_edge_weights.csv",sep=""),
stringsAsFactors = FALSE,sep = ",",header = TRUE)
rxn_ensembl_counts.nls <- readRDS(paste(OUT_DIR,"... |
31677f42f4f0102b84dcdfe60c9c7f55023542bbd2979ed6948d95c2804d8e97 | R | 1,852 | 57 | # Run 'analysis/01_deseq2_e16.R' if you haven't already
#source("analysis/01_deseq2_e16.R")
# DEFINE FILES AND PATHS: ------------------------------------------------------
# input deseq2 results rds file
rds_deseq2_results <- "data/processed_data/rnaseq_e17/r_objects/deseq2_dds_e17.rds"
# output directory
output_dir... |
b0a81066f6705f9606a61f8b905b0b2dcff179ceefa33de813a057821b69ab58 | R | 1,853 | 75 | library(Seurat)
library(tidyverse)
library(stringr)
setwd("~/cortex/fig2/")
domainColor <- c(
ARACHNOID = "#8a3b35",
L1 = "#8ba28e",
L2 = "#9ec87e",
L3 = "#669c68",
L4 = "#67b8bb",
L5 = "#5687ac",
L6 = "#5d5d8d",
WM = "#b5b3bb"
)
gene_l... |
fa802ba50bc4b212a40697e310b25d21b7b854d5f04c0397e1525548c7bd3f0a | R | 1,858 | 54 | # Run 'analysis/01_deseq2_e16.R' if you haven't already
#source("analysis/01_deseq2_e16.R")
# Run 'tables/scripts/tableS1.R' if you haven't already
# source("tables/scripts/tableS1.R")
# DEFINE FILES AND OUTPUT DIRS: ------------------------------------------------
# input rds file containing deseq2 results
rds_deseq... |
293bcdd4c2e5662ec226040aca2bef2a530228c0ac2f51339fa62f1ed9f3a4ec | R | 1,864 | 66 | library(magrittr)
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/output/"
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/input/"
X <- readRDS(paste(OUT_DIR, "rxn_pca_nls.Rds", sep = ""))
Y <- readRDS(paste(OUT_DIR,"gtex_tissue_detail_vec_train.Rds",sep=""))
E <- read.table(paste(IN_DIR,"React... |
5ba099f21a13d33ff1b47838ba5ce2745f8a01f5964dee490f2ecba023b8dc71 | R | 1,878 | 43 | #code to generate Figure14 figure supplement 2 of the Platynereis 3d connectome paper
#Gaspar Jekely Feb-Dec 2022
#load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
imgTEM <- readPNG("pictures/Girdle_TEM_VNC_40um.png")
panelTE... |
26ac5844729f3660704ff441e5d8a5e34acb71d309c2ce5beb01f49c827e18ee | R | 1,885 | 57 | # Run 'analysis/04_deseq2_e13-vs-e17.R' if you haven't already
#source("analysis/04_deseq2_e13-vs-e17.R")
# DEFINE FILES AND PATHS: ------------------------------------------------------
# input deseq2 results rds file
rds_deseq2_results <- "data/processed_data/rnaseq_ctrl_e13/r_objects/deseq2_dds_e13-vs-e17.rds"
# o... |
c8b06ba7bdeb6401b3dc7fb8b6601b11f114ae42ebafc88675c5f77e919d0946 | R | 1,904 | 62 | #' Function to create a bipartitle graph
#'
#' \code{oBicreate} is supposed to create a bipartitle graph.
#'
#' @param data a data frame/matrix to create a bipartitle graph
#' @param verbose logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display
#' @return It r... |
fde1ca3a6c184dbb81f1e2f239a22a75c88e9b56c9588e95ad747fccf6a0ce3c | R | 1,904 | 43 | ##############################################################################
# Figure description: Dotplot displaying combinatorial binding
# Stage specific ATAC-seq peaks were used for performing tfcomb analysis
# (https://tf-comb.readthedocs.io/en/latest/examples/TFBS_from_motifs.html)
library(ggplot2)
library(d... |
400b81126400136a316f983234db72b005c68e4fa2af870d8c5a32dfd7e1fccf | R | 1,907 | 59 | # code to generate the cell type connectivity matrix of the 3 day old Platynereis larva
# Gaspar Jekely 2022-2023
source("code/libraries_functions_and_CATMAID_conn.R")
# load the cell type graph generated in the Figure4 code
syn_tb <- readRDS("source_data/Figure4_source_data1.rds")
names <- syn_tb %>%
activate(nod... |
34dd33bcc7d638fe28405fd00ce405fe00be714bb02591ad98c470d6cfbd0f7e | R | 1,934 | 49 | library(qs)
library(magrittr)
library(MASS)
library(tidyverse)
library(sf)
library(Seurat)
library(patchwork)
setwd("/home/luomeng/data/STEREO/AnalysisPlot//")
seu <- qs::qread("merge_slides_seu.qs")
# fig7a ---------
SpatialDimPlot(seu,group.by = "domaine.fine") %>% ggsave("fig7a.pdf",height = 10,width = 20,limitsi... |
b4289d3b47f22ced1b2d8116b49112d045bc73061997f49b42dd6f2c55b46fd8 | R | 1,944 | 49 | # =======================================================================
# FIG 4 - Sleepiness across Stages Plotting Script
# -----------------------------------------------------------------------
# Variables:
# time = 1:T # timepoints
# sleep_onset = sf; # time index of sle... |
0558b0ac0d976cfc2a1c39a34f648c551593026e3cac50243f7d559897f17079 | R | 1,952 | 75 | # setup_environment.R
# Load renv for package management
if (!requireNamespace("renv", quietly = TRUE)) {
install.packages("renv")
}
library(renv)
# Restore the environment from the renv.lock file
if (file.exists("renv.lock")) {
cat("\nRestoring environment from renv.lock...\n")
renv::restore()
} else {
stop(... |
3fd7a0210e574e579f2e05fd11d6a48da06f6a4f5c73b2c7abcf0cec10c44e11 | R | 1,953 | 66 | library(Seurat)
library(data.table)
library(ggplot2)
library(plotly)
library(ggforce)
library(rtracklayer)
library(ggtree)
library(tidyverse)
library(magrittr)
library(patchwork)
library(qs)
library(parallel)
library(ggtern)
library(sf)
setwd("~/data/STEREO/AnalysisPlot/")
chipID = chipIDs[[1]]
gtf <- import("../Homo... |
b8ad39a771b61fb23ac6f6b03786b567df584c677b0cce479b3e8d31a83be6de | R | 1,958 | 64 | #' Merge lab entries
#'
#' Merge laboratory measurements.
#'
#' @param x `data.table`.
#' @param f `factor`, splitting factor
#' @param columns `character`, column names of laboratory measurements in `x`.
#' @return `data.table` depending on `x` with reduced number of rows.
#' @author Sebastian Gibb <mail@@sebastiangib... |
5abac8ecb89ab9aab26aaba0624a40a53c9bf2568bdab95ce2b9019b6ab45b66 | R | 1,978 | 44 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP035988/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP035988/output/"
SRP035988_DATA_FIL <- "rse_gene.Rdata"
ensembl2rxns.df <- read.table(paste(IN_DIR... |
60cf2fe155974c56468208049bb4725653faf3ecdcfe852a58fe3e2e1ba123ef | R | 1,979 | 54 | #' @title Selection of ions with potential labeling signals
#' @description Compare the average ion intensities of M2 and M3 isotopologue
#' between labeled and unlabeled groups by ratio analysis.
#'
#' @param df The updated table generated after running Scanint.
#' @param Intensity The minimum intensity ratio indi... |
025445505eef53c6f100522b2ac39fc304217a61a573762b83087f34ca3c2d9d | R | 1,982 | 69 | s <- data.table(
Id = c(rep(1, 3), 2),
Diagnosis = c(rep("Sepsis", 3), "SIRS"),
Center = rep("G", 4),
SecToIcu = c(1, -1, -1, NA),
Sender = c("ED", "CIMC", "SICU", "MICU"),
TargetIcu = c("CIMC", "CIMC", "SICU", "MICU"),
CRP = c(NA, NA, 100, NA),
HGB = seq(6, 8, length.out = 4)
)
test_th... |
89d25437992baec99ad2facee06e04cd936832f3b1e7ab66af7975cf802788f0 | R | 2,004 | 45 | library(DESeq2)
library(magrittr)
library(SummarizedExperiment)
start_time <- Sys.time()
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP061240/input/"
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP061240/output/"
SRP061240_DATA_FIL <- "rse_gene.Rdata"
ensembl2rxns.df <- read.table(paste(IN_DIR... |
94edce2b6cc6d9f0e6e147fc32e4b3785b9e65cf71a660868cf41301d4ecd14b | R | 2,006 | 41 | #### load packages ####
targetPackages <- c('tidyverse','arrow')
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, character.only = T)
#### ... |
3c37c2c20e9e6384a6c85addb2992757dfa0c3aeca8971e2958b2aa0180b44b0 | R | 2,028 | 76 | library(Seurat)
library(parallel)
library(stringr)
library(tidyverse)
library(magrittr)
library(hdf5r)
library(dplyr)
library(rjson)
library(Seurat)
library(ggplot2)
library(argparser)
library(SeuratDisk)
setwd("~/cortex/STEREO/1_cellbin/")
h5adFiles <- list.files("./batch_gem/", ".h5ad$", full.names = T)
mclapply(h... |
55b0aa6f5093b9f786945cb0a2884db943efffcdb7aa4c15b7a684bed19b6e8d | R | 2,030 | 73 | # Title : Install all R integration methods
# Created by: mumichae
# Created on: 6/4/21
suppressPackageStartupMessages({
library(optparse)
library(data.table)
})
optparse_list <- list(
make_option(
c("-d", "--dependencies"),
type = "character",
help = "Dependency TSV file with R packages & versi... |
2073c6614673d4a0cdc36b101c57200c94f8051bac4a47835b7de399c4721f6f | R | 2,031 | 46 | #!/usr/bin/env Rscript
###############################
#I/O
###############################
library(tidyverse)
library(ggplot2)
library(Seurat)
library(MAST)
#add in info about tle status
seurat_obj <- readRDS("/n/groups/walsh/indData/Maya/FCD_project/analysis/2_Analyze_Full_Object/Output/Seurat_Objects/8_processed_se... |
aacc5aea60b99383e8c61e08ac113a1a74341a77a3b320d024a3b50785796ce3 | R | 2,031 | 75 | rm(list = ls(all.names = TRUE)) #will clear all objects includes hidden objects.
gc() #free up memory and report the memory usage.
library(tidyverse)
library(tidygraph)
library(stats)
segmental_colors <- brewer.pal(6, 'Paired')
#read graph
conn.tb <- readRDS("supplements/connectome_graph_tibble.rds")
conn.tb
conn.... |
f1a169cf5eb5a7cb954ef2a902a470f52bfcdb5d2663321dae02448b3efc8775 | R | 2,039 | 29 | library(tidyverse)
setwd("~/cortex/fig4/")
library(data.table)
library(magrittr)
library(Seurat)
subclass_color <-c(AST = "#665C47", ENDO = "#604B47", ET = "#CEC823", CHANDELIER = "#E25691",
`L2-L3 IT LINC00507` = "#07D8D8", `L3-L4 IT RORB` = "#09B2B2",
`L4-L5 IT RORB` = "#69B19... |
12a33e3e929c7448eede3c0715a06d2324222dee57a5c131fa683f4a572fdfc1 | R | 2,041 | 46 | #!/usr/bin/env Rscript
###############################
#I/O
###############################
library(tidyverse)
library(ggplot2)
library(Seurat)
library(MAST)
#add in info about tle status
seurat_obj <- readRDS("/n/groups/walsh/indData/Maya/FCD_project/analysis/2_Analyze_Full_Object/Output/Seurat_Objects/8_processed_se... |
b61a9d78c6dacfaacc7c25a5b483472768b24558ad1c3a36e192020385cff165 | R | 2,044 | 92 | ######read files
suppressPackageStartupMessages({
library(SC3)
library(SingleCellExperiment)
library(scater)
library(aricode)
})
################################ Drop out ####################################
#drop out function
dropout_sampling <- function(sce, drop_rate = 0, seed){
#set seed
set.seed(seed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.