sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
80ae0d1bb8874c968bb1ba78639fd26d8e2597eaec23b209e22ad21feee47582 | R | 4,507 | 148 | setwd('~/git/dissertation/thesis/Chapter 05 - The Power Law of Learning/src/')
source(file='../../Chapter 04 - A variable-length code/src/transmit/R/transmit.R')
require(tidyverse)
require(entropy)
require(cowplot)
hyman_transmit <- function(
codebook,
signal_power,
noise_power,
timesteps,
time_interval,
... |
f763854bb25531df9e47cfca583bca63875e91118a8684f6fd89136a5d9f7454 | R | 4,518 | 103 | # build_reject_table.R
#
# Precompute script for custard-based dead-ROI rejection. Builds verdicts for
# both ROI and pensub data sources in a single run.
# Runnable with: Rscript 01-scripts/build_reject_table.R
# Run from the repo root; here::here() resolves all paths relative to the project root.
#
# Reads: 04-data... |
b88639fc5148b81ad312f905abe0611127c6e5b6bdabe3655ec41f06a1ae5dda | R | 4,557 | 234 | getErrorDF_LMM <- function(
mixedModel
, xVarAsChar
, errorType = "model"
, ... # other things to afex_plot
) {
lmmData <- afex_plot(
mixedModel
, xVarAsChar
, error_ci = FALSE
, return = "data"
, error = errorType
, ...
)
return(
lmmData$means %>%
as.data.frame()... |
46a725bb58e7436c18f899728a57847b5648ddfec02759b85b164a03a350fbdc | R | 4,635 | 172 |
library(bmrm)
library(Biobase)
# given an object K of class dist, find n nearest neighbors
knn.index <- function(K,k=30) {
K <- as.matrix(K)
diag(K) <- -Inf
t(apply(K,1,function(v) order(v)[1:k]))
}
# compute rowmeans of knn neigbors
# m: matrix to correct
# K: distance matrix between columns to consider fo... |
c64e7e03b61ae3900a97e446818f952f1c7d0cc9ba0444beea100a6656ae4daa | R | 4,659 | 118 | library(tidyverse)
library(lme4)
library(lmerTest)
library(DHARMa)
library(emmeans)
install.packages("pbkrtest")
library(ggplot2)
library(ggdist)
library(sjPlot)
library(devtools)
install_github("jfrancoiscollin/ClinReport")
library('ClinReport')
## Read data, transform and recode variables
dat <-read.delim("Data_Opt... |
ef2f44aa07a83f27292249d377f25168d977e383bb24373cfbbf0e958a798a4d | R | 4,668 | 138 | #!/nfs/sw/R/R-3.6.1/bin/Rscript
RUV_total <- function(raw,pData,fData,k,hkgenes = NULL,exclude = NULL){
### INPUT: raw - p x n raw expressions with p genes and n samples
### pData - phenotype metadata across samples
### fData - feature metadata across genes
### k - number of dimens... |
7f8f794cad34e7ee23984409d6fb55950b7bba55bed8d2dc61746c1142d6baaa | R | 4,684 | 178 | #' make factors
#'
#' @param df a dataframe
#' @param cols the columns that you wish to make factors; if using multiple use c(...)
#'
#' @return a dataframe with the indicated columns made factors
#' @export
#'
#' @examples
#' Demo_dam %>%
#' makeFactors(c(
#' damID,
#' dam,
#' ParaType,
#' litterNum,
#' cohort
#'... |
74fe4e2dd0f0aa695d70a01616faf5888e048de702ccdb061f48ab26bbdb7cf9 | R | 4,732 | 190 | ---
title: 'Code Notebook for : </br> </br> Developmental Emergence of Neurogliaform
Cell Diversity'
author: "Lucia Gomez Teijeiro"
date: "2023-07-19"
output:
html_document:
df_print: paged
subtitle: "</br> </br> Embryonic POA dataset Integration </br> </br>"
---
</br>
**Information for replication:** </b... |
1fafcd577fd9383a2f09e1f4a643c7836991196544aac4dc7c5bdbb69efdf24d | R | 4,743 | 106 | #source("helper_preprocess.R")
#' SONAR.preprocess
#'
#' @param sc_count scRNA-seq expression matrix of reference(Details and formats are in vignettes)
#' @param sc_cell_type cell type annotation for reference(Details and formats are in vignettes)
#' @param sc_nUMI cell library size(Details and formats are in vign... |
4d8a049f60618afa8d2c4b66e0f61308da19080ce7994f25dc01588d37312694 | R | 4,743 | 95 |
#' Dirichlet multinomial GLM likelihood ratio test for a single cluster
#'
#' @param xFull [samples] x [covariates] matrix for the alternative model
#' @param xNull [samples] x [covariates] matrix for the null model
#' @param y [samples] x [introns] matrix of intron usage counts
#' @param concShape Gamma shape parame... |
a65f737a17e0bb579adb1abd3f45edcadc3ec9ef5b04faa2c771d17e755aecd8 | R | 4,768 | 93 | library(ggplot2)
library(ggpubr)
library(rstatix)
library(tidyr)
theme_Publication <- function(base_size = 14, base_family = "helvetica") {
library(grid)
library(ggthemes)
(theme_foundation(base_size = base_size, base_family = base_family)
+ theme(
plot.title = element_text(
... |
ea5493f58444cf13051f970bee8f58f1fc44479cfdf4fea29fc9b4729e348866 | R | 4,794 | 192 | ---
title: 'Code Notebook for : </br> </br> Developmental Emergence of Neurogliaform
Cell Diversity'
author: "Lucia Gomez Teijeiro"
date: "2023-07-19"
output:
html_document:
df_print: paged
subtitle: "</br> </br> Embryonic NGC identification (time-conserved) and NGC conserved genes </br> </br>"
---
</br>
*... |
97a0d5413b1bc3a8ca71d88984c90cc443fc9ecbe4c8bc28ff181ee7c666cebc | R | 4,805 | 93 | library(ArchR)
library(ggplot2)
library(gridExtra)
library(Rtsne)
library(clusterProfiler)
setwd('output path')
###Figure3a####
proj = readRDS('Save-ArchR-Project.rds')
cellColData=as.data.frame(proj@cellColData)
cellColData[,1][cellColData[,1] == 'adult_hindbrain_PL2011260025'] = 'Rho-1'
cellColData[,1... |
604d8acad814f7153f0636bb660179b95d51d962e5ebead1c6a855668886992f | R | 4,823 | 159 | ### This file contains major functions for EM iterations.
### E-step.
apea.step.gbd.k <- function(PARAM, i.k, update.logL = TRUE){
.MixfMRIEnv$logbetanorm(PARAM, i.k)
compute.expectation(PARAM, update.logL = update.logL)
invisible()
} # End of apea.step.gbd.k().
### CM-step
cm.step.gbd.ETA.BETA.MU.SIGMA.k <- fu... |
79b2e80e330e13463f5c5978d8c27fd33cce099688fabd257528c4da6a63ea58 | R | 4,836 | 177 | ### This file is modified from EMcluster.
### partial logL. Return a matrix with dimension M * N.
partial.logL.pv <- function(x, ETA, BETA, MU, SIGMA, post.z){
K <- length(ETA)
N <- dim(x$X.gbd)[1]
BETA.digamma <- lapply(BETA, function(b){ digamma(b) - digamma(sum(b)) })
# SIGMA.inv <- lapply(SIGMA, function... |
4a51469974ec9ce2681cd5b5adeb173f638f664a50b90dd7a7224bcc72b4a504 | R | 4,885 | 178 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(ggpubr)
library(ggbeeswarm)
# read in data
df <- read_tsv("./MCX_ALS_vs_Control_JessWesternBlot_protein_quantification.txt")
df_mod <- df %>%
select(Sample,... |
a002eea23301265d8d0d626af2c3549a0f19fc774b5ab6ae0605dc67c9d78e55 | R | 4,906 | 187 | Copyright 2023 Sophie Ostmeier
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, software
di... |
aeeabad8aa78bdab1a720a64e6a51b27b57f1f01691e31fb67f9ab701e817b63 | R | 4,940 | 128 | #!/bin/Rscript
#--- Setting up the libpath, loading necesary libraries, and setting up some variable names ----####
args<-commandArgs(trailingOnly=TRUE)
library.path <- .libPaths()
library("tidyverse", lib.loc = library.path)
args = commandArgs(trailingOnly = TRUE)
cohort = args[1]
#---Load principal components ge... |
42e9bde8468d0c5a965cc3fbc55e640e0cdda5697a7d7ae3fbbe5b6c5fec7ad3 | R | 4,968 | 158 | "%&%" <- function(a,b) paste(a,b, sep = "")
library(tidyverse)
library(MMUPHin)
library(vegan)
library(magrittr)
library(Maaslin2)
"%ni%" <- Negate("%in%")
#"S:/Obesity_Bone/Paul/Data/data_to_O2/"
data_path <- "/n/groups/ifaromics/paul/HRPQCT_16S_Analysis/data/"
res_path <- "/n/groups/ifaromics/paul/HRPQCT_16S_Analys... |
9c1731b1b60ca1f48fcb456c47cd1008a175cb48012a8c7e8cf8f4a49e133a4e | R | 4,995 | 91 | library(ArchR)
library(ggplot2)
library(gridExtra)
library(Rtsne)
library(clusterProfiler)
setwd('output path')
###Figure2f####
proj = readRDS('Save-ArchR-Project.rds')
cellColData=as.data.frame(proj@cellColData)
cellColData[,1][cellColData[,1] == 'adult_hindbrain_PL2011260025'] = 'Rho-1'
cellColData[,1][... |
a4f6e24fe00b39a36d15d57507a8facfa88dd909875cd3cca875b01019117dfb | R | 4,997 | 158 | "%&%" <- function(a,b) paste(a,b, sep = "")
library(tidyverse)
library(MMUPHin)
library(vegan)
library(magrittr)
library(Maaslin2)
"%ni%" <- Negate("%in%")
#"S:/Obesity_Bone/Paul/Data/data_to_O2/"
data_path <- "/n/groups/ifaromics/paul/HRPQCT_16S_Analysis/data/"
res_path <- "/n/groups/ifaromics/paul/HRPQCT_16S_Analys... |
d8fd3b3c12cdcf739623892246fa3ae6e6a592c72a5a2c77c83068b43d3a17ba | R | 5,007 | 127 | options(stringsAsFactors=F)
if(interactive()) setwd('~/d/sci/src/scaso')
suppressMessages(library(tidyverse))
suppressMessages(library(janitor))
suppressMessages(library(weights))
suppressMessages(library(openxlsx))
suppressMessages(library(Hmisc))
suppressMessages(library(MASS)); select = dplyr::select; summarize = dp... |
8ac93319435f755d95385d96254c197366ce56149f7c7ab3915d34f60d964f05 | R | 5,088 | 169 | ---
title: 'Code Notebook for : </br> </br> Developmental Emergence of Neurogliaform Cell Diversity'
author: "Lucia Gomez Teijeiro"
date: "2023-07-19"
output:
html_document:
df_print: paged
subtitle: </br> </br> Postnatal Molecular Architecture - NGC Subtypes (Dock5 vs Lsp1) </br> </br>
---
</br>
**Informat... |
ecefabb20822bd31c936a2b63e2a6df6a6dfc86b315752498b99f53135dd3669 | R | 5,100 | 174 | # init ----------------------------
library(dplyr)
library(tibble)
library(readr)
library(tidyr)
library(broom)
library(ggplot2)
library(gridExtra)
library(sjPlot)
library(purrr)
if (Sys.info()['sysname'] == "Linux") {
setwd('/home/mfromano/Research/mri-surv-dev/mri_surv')
} else {
setwd('/Users/mromano/resear... |
6afb089e455862976ea4b46eea6873b007dbd98fe47598777335e8b54c1690a8 | R | 5,164 | 163 |
isManuscript <- FALSE
# Self-locate this script ------------------------------------------------
# Figure out where this file lives on disk, so paths work regardless of
# the current working directory and however the script is invoked
# (sourced from an Rmd, Source button in RStudio, line-by-line, or
# Rscript). Av... |
6b83a6a8ae40e3fdaea3b7ce2a63313df60d1c79006eb66d854cb4dad1102df8 | R | 5,246 | 134 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnotated_clean_SeuratV4_object.rds")
meta... |
3d991bcf35a39a75c457024ad3adb7bfecdd82f5e4420411c7d7b6b94f8568e8 | R | 5,340 | 110 | #source("helper_preprocess.R")
#' SONAR.preprocess
#'
#' @param sc_count scRNA-seq expression matrix of reference(Details and formats are in vignettes)
#' @param sc_cell_type cell type annotation for reference(Details and formats are in vignettes)
#' @param sc_nUMI cell library size(Details and formats are in vignettes... |
4da3e4a69b2d72bc9dc62d426e9ebf839a0c924c7b2b62d9b6cdbd44d83bd4c1 | R | 5,345 | 135 | #' Plots spikes and an entropy trace for a single transmitted signal.
#'
#' Optionally save the result to file.
#'
#' @param symbols vector of character symbols
#' @param symbol_to_transmit Symbol that signal power should be allocated to
#' @param signal_power spikes per second for signal power
#' @param noise_power s... |
0b57395fce222af040f42c2e60df1de369a03b9457519cdbe56676def8908d47 | R | 5,357 | 141 | #### Thank you for using our code, wish you all the best! ####
# Note: In this script, our code comments are not very detailed,
# please see the simulation code of Homo-Area for detailed comments.
# The main difference between Compo-Area code and Homo-Area code is to assign-
# different properties to each sub-regi... |
615778a3d372dfc8c2e7b654bfb2794b0aaba7d9e2b3b5a8620b5256fbf8de33 | R | 5,380 | 150 | commot<-lapply(c('8_um-post-pNR-1','8_um-pre-pNR-1','8_um-post-MPR-1','8_um-pre-MPR-1'),function(x){
fname=paste0('commot_filepath/',x,'_lrpair_commot.csv')
tmp<-read.csv(fname,header = T)
tmp<-tmp %>%
filter(celltype_target %in% c('CD8_Tn','CD8_EarlyActiv','CD8_Tem','CD8_Tex') & p.values<0.001) %>%
... |
21aeae20c7c8f466192281c450380efe68dea4e49648609d838cc6dd7390a2b2 | R | 5,393 | 99 | #In this visualization section, we follow part of the CARD's visualization code(Ying Ma, Xiang Zhou. Nature Biotechnology)
#pie plot
#' SONAR.visualize.pie
#'
#' @param proportion deconvolution results matrix from SONAR(Details and formats are in vignettes)
#' @param spatial_location spatial coordinates matrix(Det... |
a5a88f1adc58da7e7e3db5d6f0ccdd27d7a9b08ed0164f53b0b41a41cb0d7c4c | R | 5,448 | 168 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(Augur)
library(tictoc)
tic()
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnot... |
9f5a1ccd68e0779290e67bedf9093d06be980e0ad21ef7ae1a6f0c85720842fd | R | 5,449 | 168 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(Augur)
library(tictoc)
tic()
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnot... |
c35fb947a31220cc156d095578d9f255a48145400d4dfc8330cad76225465723 | R | 5,449 | 168 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(Augur)
library(tictoc)
tic()
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnot... |
e82d0617440868da725f5e78833f3f95425697949360003cce421b9c7ca4ca9e | R | 5,449 | 168 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(Augur)
library(tictoc)
tic()
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnot... |
6eafd390c896f78453f36b91a90ec71b96489eea432d42d34b117fe7952b9c27 | R | 5,456 | 168 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(Augur)
library(tictoc)
tic()
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnot... |
266f7fd38d16235aafeda777db59adad9330592e1eb7e79c67021088119cbe48 | R | 5,483 | 181 | #' @importFrom Signac StringToGRanges
#' @importFrom Seurat GetAssay VariableFeatures
#' @importFrom S4Vectors subjectHits queryHits
#' @importFrom IRanges findOverlaps pintersect
NULL
#' Initiate the \code{RegulatoryNetwork} object.
#'
#' @param regions Candidate regions to consider for binding site inference.
#' If... |
48de25b28a93d07379b06e372b60254adb3d434d3fcc881cd58d15bcbcc80ca4 | R | 5,516 | 95 | ####################
## load CCDS and name table
ccds <- fread("/xchip/gistic/Jeremiah/tracks/ccdsGene.hg19.txt")
## load and format name table (CCDS to gene name conversion)
nm <- fread("/xchip/gistic/Jeremiah/tracks/name_conversion.tsv")
setnames(nm, colnames(nm), gsub(" ","_",colnames(nm)))
app_sym <- rep(nm$App... |
def9bfb285c50c2164f9ece9ce93e3fb13477aed2cc343dd97db2f43a18374c2 | R | 5,522 | 215 | ### This file is modified from EMcluster.
### partial logL. Return a matrix with dimension M * N.
partial.logL.I <- function(x, ETA, BETA, MU, SIGMA, post.z){
K <- length(ETA)
N <- dim(x$X.gbd)[1]
BETA.digamma <- lapply(BETA, function(b){ digamma(b) - digamma(sum(b)) })
SIGMA.inv <- lapply(SIGMA, function(s)... |
971687d7cfc153b2b4244d31d831711421932f1da4bb8f5b3aff8f1e528e1c59 | R | 5,526 | 158 | options("width"=240)
library(MixfMRI, quietly = TRUE)
library(AnalyzeFMRI, quietly = TRUE)
phantom <- c("shepp0fMRI", "shepp1fMRI", "shepp2fMRI")
overlap <- c("0.01", "0.1", "0.25", "0.50", "0.75", "0.95")
if(!file.exists("new/summary_alternative")){
dir.creat("new/summary_alternative")
}
pval.cutoff <- 0.05
qval... |
6a7204b1c6f87cfdc84aa1b00280009114147d38899f514c15e980809fafae90 | R | 5,597 | 138 | ---
title: "Visualization"
author: "Jonas Simon Fleck"
date: "17/05/2022"
output: html_document
---
```{r, echo = FALSE, message=FALSE}
knitr::opts_chunk$set(message = FALSE, warning = FALSE)
```
Here we want to show you some ways to visualize the GRN and to plot some metrics that might be interesting to look at for ... |
f05f00d300333a04389558fa774e059b84581a56938c764b328bbf2e1afb2975 | R | 5,601 | 146 | library(tidyverse)
library(lme4)
library(lmerTest)
library(emmeans)
library(ggplot2)
#Read data, convert and relevel factor variables
dat<- read.delim("Data_ShoalingPatterns.txt")
dat <- dat %>%
mutate_at(vars(c('trial','line','rep','treatment','time')), as.factor)
dat$treatment <- relevel(dat$treatment, "Op... |
a89d020fa751ce49a4ea9ad3f363fd1bc8dac21b3a5210545f6288347ff111e1 | R | 5,603 | 148 | # before-after-v7.R
#
# Successor to before_after_v6(). Uses helpers from plot-slices-core.R to
# share machinery with plot_baseline_v2. Adds optional per-slice color
# and shape mapping for stable visual identity, and abbreviates x-axis
# treatment labels for compact figures (b / s / TTX / first three letters).
#
# Ba... |
af0d28dcdff13dac6a54fe5e08827b483b27337df0c9cd40fca963030c628ebb | R | 5,605 | 143 | ---
title: "Leafcutter Shiny App"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Written by Jack Humphrey, David Knowles & Yang Li
To see an example of the `leafcutter` shiny app in action without installing anyt... |
faf898e588a272cf693f19da89a8ece8360802c3750e78368b2ef9f1203927c7 | R | 5,656 | 141 | context('Tests for core Pando functions')
library(testthat)
library(readr)
library(GenomicRanges)
library(matrixStats)
library(doParallel)
library(BSgenome.Hsapiens.UCSC.hg38)
library(Pando)
library(Seurat)
data(motifs)
test_srt <- read_rds('../../../data/test_seurat.rds')
genes_use <- c('NEUROD6', 'POU5F1')
test_s... |
2d40e36c420a1860bd2090639f9c61f4abc4d18d33c05ef019e8b1d22d968e52 | R | 5,701 | 130 | library(ggplot2)
library(viridis)
#### MCG #####
setwd('input')
s1 = read.csv('GO_sort_20celltypes_MCG.csv',,header=T)
s1 = s1[which(s1$Count >= 5),]
s1$LogP_1 = -log10(s1$p.adjust)
colnames(s1)
s1 = s1[order(s1$Count),]
s1$Description = factor(s1$Description,levels = s1$Description)
ggplot(data=s1, aes(... |
bfc8364cdc61f64f0d4612f35efd723c635df2ac8bf95fc3abcfbd6ad512b601 | R | 5,739 | 198 | #---------------------------
# Load libraries and define
# plotting functions
# 25 Jan 2023
#---------------------------
library(ape)
library(corrplot)
library(diagram)
library(dplyr)
library(factoextra)
library(geiger)
library(ggpubr)
library(ggrepel)
library(gridExtra)
library(igraph)
library(memoise)
library(mvMORP... |
97f5f9cf50fdb0046f449ed70cbcf214c51ccb31c0bec0c919819ef31e74bd5b | R | 5,742 | 183 |
base.dir <- "/iblm/netapp/home/gmcvicker/data1/gmcvicker/data/WASP_power_calcs"
power.sim.tab <- read.table(paste(base.dir, "/power_sim_params.txt", sep=""), header=T)
tab <- power.sim.tab
tab$N.SIGNIF <- rep(NA, nrow(tab))
tab$N.TEST <- rep(NA, nrow(tab))
for(i in seq(1, nrow(tab))) {
ref.af <- tab$REF.ALLELE.FR... |
f97e5bcef074f752b531312089243f85f16b48f97212c92fdfff96a8c1e96178 | R | 5,794 | 161 | #!/nfs/sw/R/R-3.6.1/bin/Rscript
################################################################################
### COPYRIGHT ##################################################################
# New York Genome Center
# SOFTWARE COPYRIGHT NOTICE AGREEMENT
# This software and its documentation are copyright (2023) by... |
500d65c2f4fecf2b25a76013e2d0d1a0420e0a6688bfb613ee5f9ef381786d2a | R | 5,845 | 174 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
5e386c1eaeb1a1216e47d3fea05f118f411765bed5f0cf17697da7408e4238a1 | R | 5,861 | 174 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
194eddb8faedba40186e4894e9e3277cec6200e0a9b9c0eea2446f04bcb626c8 | R | 5,863 | 174 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
7593b19473f40365dc7065a10ded66f2856a28e64316229e71d6ff3070120e2a | R | 5,904 | 213 | Copyright 2023 Sophie Ostmeier
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, software
di... |
d607fdfeebc43f02123018cc52e2d26775a7972af46aa4c4ad00492def8e29cd | R | 5,923 | 148 | ###Using StringTie with DESeq2 to analyze Nasonia RNAseq data
rm(list=ls()) #clear all objects
gc()
#dataset:
#Nasonia RNAseq data
#experimental light treatment and dark control
#4 different time point: 0.5h 1h 2h 4h
#8 sample groups
#3 replicates per experimental sample group, 2 replicates per control sampl... |
f92fdb8e11be5bffe648ac154c4fd3b42e700de436722fac554a05713f06f4d8 | R | 5,924 | 199 | # script takes a list of BED files (replicates),
# and filters their elements to remove those not overlapping with at least N other replicates.
#
# then, the consensus peak set is constructed, using reduce() command in GenomicRanges.
#
#
#
# initial BED files and output BED files are in 0-based coordinates
# in... |
c1c05edc05fd24c530603f4a36564d9087a2f2036e7a9944e48a13f6330e0f3d | R | 5,938 | 165 | options("width"=240)
library(MixfMRI, quietly = TRUE)
library(AnalyzeFMRI, quietly = TRUE)
phantom <- c("shepp0fMRI", "shepp1fMRI", "shepp2fMRI")
overlap <- c("0.01", "0.1", "0.25", "0.50", "0.75", "0.95")
if(!file.exists("new/summary_alternative")){
dir.creat("new/summary_alternative")
}
pval.cutoff <- 0.05
qval... |
92ba43f39d56b405976fcd9123eacff8b6c3937121f31e223ed8c313ab0f7312 | R | 5,960 | 152 | #
# Script to simulate data to be used with combined haplotype test
#
library(optparse)
option.list <- list(
make_option(c("-a", "--alpha"),
help="expected number of reads from REF chromosome overlapping a single site such as a heterozygous site",
default=5.0, type="double"),
make_o... |
01e22db5553041481b241a48dfb75fc0b649b34b864aefd4bbf2dd223975fc22 | R | 6,009 | 165 | options(stringsAsFactors=F)
if(interactive()) setwd('~/d/sci/src/scaso')
suppressMessages(library(tidyverse))
suppressMessages(library(janitor))
suppressMessages(library(MASS)); select = dplyr::select; summarize = dplyr::summarize
# statistical parameters
ci_size = .95
alpha = 1 - ci_size # 0.05
qnormval = qnorm(1-alp... |
8d866019a6597ced9d50291bd8bae93175973fd120576783b9e4dfa5b324279f | R | 6,101 | 138 | context('Tests for placeholder variable names in model formulas')
library(testthat)
library(Pando)
# Names which are not valid R symbols: reserved words, parentheses, colons,
# leading digits (e.g. dm6 chromosomes '3R') and underscores
target <- 'if'
regions <- c('3R-100-200', '2L-5-50', 'chr1-1-9')
tfs <- c('Su(H)'... |
0b25a4b1ebcf842fa0da166fba7cfde9bb06b8229a16257a22e47a9628f6df1a | R | 6,102 | 151 | library(testthat)
library(gUtils)
library(gTrack)
gg.jabba = gG(jabba = system.file('extdata/hcc1954', 'jabba.rds', package="gGnome"))
test_that('event caller', {
## run events caller with qrp
############# not running this currently since it is erroring out (See: https://app.travis-ci.com/github/mskilab/gGnome/bui... |
78cf00c12da6ad11297985a3f7268f37b40b74d3d58891180988f1a16cb903ec | R | 6,241 | 194 | library(tidyverse)
DE_level_2 <- read_tsv("MAST_res_level2_summary.txt")
FDR_threshold <- 0.05
FC_threshold <- 1.2
selected_cell_types <- c(
"Exc_superficial", "Exc_intermediate", "Exc_deep",
"Inh_PVALB", "Inh_SST", "Inh_VIP", "Inh_LAMP5", "Inh_ADARB2_Other",
"Astro", "Endo", "Micro", "Oligo", "OPC", "VLMC"
)
... |
427dd26285f0ad32c723cbb7198881a807a343f6559a0dbe1f841af8b0d18bed | R | 6,309 | 148 | #' @title Simulate a Continuous Gene Expression Matrix and an Accompanying
#' Perturbation Matrix
#' @description Generate a binary perturbation matrix and a continuous gene
#' expression matrix in a bottom-up fashion according to a hierarchical factor
#' model with normal noise terms.
#'
#' @param N Number of samples ... |
db8040561751cb1652543cfdf69b71558ecca450f0bfe0147a8fcecfe96d7143 | R | 6,379 | 212 | # init ----------------------------
library(dplyr)
library(tibble)
library(readr)
library(tidyr)
library(lme4)
library(lmerTest)
library(broom)
library(emmeans)
library(ggplot2)
library(gridExtra)
library(sjPlot)
# 0.34137757667169427 +/- 0.10511520840922657 overlap
setwd('C://Users/micha/Sync/Research/mri-pet/mri_sur... |
0bc5c215941afbd694ab11ddc911c7f7a8c040acde2c8dffc8b209fc40de6342 | R | 6,382 | 181 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(ArchR)
library(Seurat)
library(BSgenome.Hsapiens.UCSC.hg38)
set.seed(666)
addArchRThreads(threads = 16)
addArchRGenome("hg38")
proj <- loadArchRProject(path ... |
0e03b1982fc5b974dfe5c505d54d86298793fa2ab8b96b8628addeb20cd3b377 | R | 6,383 | 131 |
#' Make sashimi-esque plot with ggplot2
#'
#' Shows only junction reads and can optionally show splicing variation across groups.
#'
#' @param y [samples] x [introns] matrix of counts
#' @param x [samples] vector of group membership. Can be numeric, factor or character.
#' @param exons_table An optional data frame spe... |
86987cfe19b9351dcf27839a80941e3860938d02b30079e1fd2cbaa7363d8ed9 | R | 6,390 | 151 | library(tidyverse)
library(lme4)
library(lmerTest)
library(emmeans)
library(DHARMa)
library(ggplot2)
#Read data, transform and relevel factor variables
dat <- read.delim("Data_GroupPolarization_Position_withpredator_framebyframe.txt")
dat <- dat %>%
mutate_at(vars(c('trial','line','rep','treatment','timepred'... |
b056509bd4bae0d7af0822b19de1b6ee69a499e9245ee52f662c599247b8b151 | R | 6,435 | 179 | #!/nfs/sw/R/R-3.6.1/bin/Rscript
################################################################################
### COPYRIGHT ##################################################################
# New York Genome Center
# SOFTWARE COPYRIGHT NOTICE AGREEMENT
# This software and its documentation are copyright (2023) by... |
d26afdc0a6884f7fb201efcbc3e62206249dac2fcb908a091046a8627a6b4dfe | R | 6,435 | 194 | ### This function initializes global variables.
set.global <- function(X.gbd, PV.gbd, K = 2,
min.1st.prop = .FC.CT$INIT$min.1st.prop,
max.PV = .FC.CT$INIT$max.PV,
class.method = .FC.CT$INIT$class.method[1],
RndEM.iter = .FC.CT$CONTROL$RndEM.iter,
algorithm = .FC.CT$algorithm[1],
model.X = .FC.C... |
8ee5b146f512c05653397c4c630d4fa15d67e73851cf965647ae6feb49a3b57f | R | 6,451 | 218 | ### This file contains major functions for EM iterations.
### E-step.
e.step.gbd <- function(PARAM, update.logL = TRUE){
for(i.k in 1:PARAM$K){
.MixfMRIEnv$logbetanorm(PARAM, i.k)
}
compute.expectation(PARAM, update.logL = update.logL)
invisible()
} # End of e.step.gbd().
### z_nk / sum_k z_n might have... |
501566fd57953cdb0ac0c65f3957f6f30413112b09cd97edf21641095b319f9f | R | 6,463 | 99 | #!/usr/bin/env Rscript
library(optparse)
library(leafcutter)
arguments <- parse_args(OptionParser(usage = "%prog [options] counts_file groups_file", description="LeafCutter differential splicing command line tool. Required inputs:\n <counts_file>: Intron usage counts file. Must be .txt or .txt.gz, output from clusteri... |
5ca63625639c71f4f0058811cf90746bccc9b36a45c7af39bc1c8b2166dc0e7e | R | 6,521 | 228 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(pheatmap)
library(viridis)
library(scico)
rna <- read_tsv("MAST_res_level2_summary.txt")
get_FC_cor <- function(selected_cell_type_rna,
... |
80e585c153bbef1449af5c658c83b909d71445291a69b0b58b59370c72fd39d7 | R | 6,525 | 140 | #' Parse output of differential_splicing
#'
#' Parse output of \code{\link{differential_splicing}} and make a per cluster results table
#'
#' @param results From \code{\link{differential_splicing}}
#' @return Data.frame with columns status, log likelihood ratio, degrees of freedom, p-value
#' @import dplyr
#' @export
c... |
05705dabd080c71e44c9957e2786df6e351fac32b21f5b19ed66746fec67bdde | R | 6,581 | 166 | before_after_v6 <- function( df, slice_summary, group_summary, yresult, ylabel,
slice_colors,
plotType, scaleYtype,
hide_facet_titles, hide_xlabels,
plot_y_min, plot_y_max,
fo... |
757f37b751c55f1aafa26179b9bf258a1bea50e569d8f5cc65032c4e5295ae52 | R | 6,581 | 103 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
gsfa_gibbs_cpp <- function(Y, G, K, neg_ctrl_index, use_ctrl = FALSE, prior_type = "mixture_normal", initialize = "svd", prior_s = 50, prior_r = 0.2, prior_sb = 20, prior_rb = 0.2, prior_gp = 1... |
5b1f833a3cd0c1851a72ac0b355b58504b044db39e50778b5c33041832841447 | R | 6,665 | 170 | library(dplyr)
library(Seurat)
library(ggplot2)
library(biomaRt)
library(data.table)
library(readxl)
##########mouse GPCR gene
mus38g<-read_xlsx('MouseHumanRatGPCRs.xlsx')
colnames(mus38g)<-mus38g[2,]
mus38g<-mus38g[-c(1:2),]
mus38g<-filter(mus38g,!Subgroup %in% c('Opsin receptors','Taste 1 receptors','Taste 2 receptor... |
8b84f01dfa219268aa5d205cbd7ca717e6a41602be5e6995e595a62b0a001faa | R | 6,667 | 164 | #!usr/bin/Rscript
.libPaths("/data/kronos/kronos/acarrasco/R_libs")
library(plyr) # To split up long data and apply a function to each group
library(tidyverse) # For tidy manipulation of data
library(here) # For file path construction
library(DT) # To display data tables
library(lm... |
fdf4412935717de3afa1632138741500b6b8645c9899a3b128e7f53895f06ca6 | R | 6,668 | 193 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
db45cb45b12d4485f29edfe192738596104640aec53e338ad74e4b0a28229a72 | R | 6,669 | 193 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
dbb2e8c1b0c5b903390f3c10a22a205b39e5e0e52042ec4b7c0b72108819a9f2 | R | 6,681 | 155 | # rejection_rule.R
#
# Custard-based dead-ROI rejection module.
# Source this file to load compute_rejection_verdict().
#
# compute_rejection_verdict(df)
# Input: data frame as returned by load_raw() — single dataset (custard).
# Output: verdict table, one row per (run_id, slice_id, ROI) in eligible
# sl... |
a8bfdd7831898bb232cee476667a182670b6a2b61d27bde497298d510c27764b | R | 6,686 | 193 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
adcee7634601eb36c5e37e3b2957c040010d30c3e1b3ea9feef668fbac6e6649 | R | 6,794 | 245 | ---
title: 'Code Notebook for : </br> </br> Developmental Emergence of Neurogliaform
Cell Diversity'
author: "Lucia Gomez Teijeiro"
date: "2023-07-19"
output:
html_document:
df_print: paged
subtitle: "</br> </br> Embryonic Pseudotime - CGE & POA </br> </br>"
---
</br>
**Information for replication:** </br... |
d798b99321f59f6bcca10bcf36dd6307e766be4401a741ccaec9c0d6c98e0721 | R | 6,795 | 229 | # Figure 1b 1c and 1d
# the data_B.csv is the raw data for Fig 1c
pacman::p_load(tidyverse,ggsci)
data_1 <- read.csv("data_B.csv",header = T)
data <- data_1
data$group = factor(data$group, levels = c("Movement speed",
"Movement time",
... |
b72db69a6550aede123c6db797668536e0aea6386c9c9e7b880822f624839b5e | R | 6,830 | 104 | ---
title: "Outlier Splicing"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
LeafCutterMD has two main components:
1. Python code to
- generate intron excision counts from `junc` files (which can be obtained... |
8ac12885fe6402e6ed4034362f5bd4a0d518dcd201bbefdc2f4f86ff022f3fb4 | R | 6,870 | 277 | #' Add a jitter geom to a ggplot
#'
#' Defaults to a circle with fill and outline (shape 21). Provides defaults for
#' size, alpha (fill density), jitter width, and jitter height
#'
#' https://stackoverflow.com/questions/77055966/shapes-border-color-is-darker-than-the-fill-after-setting-alpha-in-ggplot2
#' https://gi... |
9122f9ced1da656b86acbd42d67c11e7061124d9b387d4c3c327d057720aebc2 | R | 6,966 | 189 |
DotPlot(data_obj_sub,
cols = c("lightgrey", "#C73D4C"),
features = c("SNAP25", "MEF2C", "SLC17A7", "SATB2", "GAD1", "GAD2"
# "SOX10", "RBFOX3", "DCX", "MAP2", "TUBB3", "ENO2"
)) +
theme_bw(base_size = 7, base_family = "Helvetica") +
xlab("Marker genes") +
ylab("Cell c... |
4e4b952400e7dc054e7e3a10675a85a223e82dab72c0470e45f8857f1204ecc3 | R | 7,005 | 177 | library(tidyverse)
library(glmmTMB)
library(ggplot2)
library(DHARMa)
library(sjPlot)
#Read data, convert and relevel factor variables
dat <- read.delim("Data_PredatorInspections.txt")
dat <- dat %>%
mutate_at(vars(c('trial','line','rep','timestim')), as.factor)
dat$timestim <- relevel(dat$timestim, "bef")
#... |
2cb2b96846edebe5fc92b6e2ffb2444fd37423eddff237c8384860d1f67bd0ee | R | 7,029 | 223 | ### This file is for Cov(z_nk) and Cov(z_nk - z_n1).
### Partial logL. Return a matrix with dimension M * N.
# partial.logL.I <- function(x, ETA, BETA, MU, SIGMA, post.z)
### Compute posterior. Return a matrix with dimension N * K.
# post.prob <- function(x, fcobj)
### Partial all z_nk. Return a list of length = len... |
43d9806a8c44a9d478e0797c9149791d148437d0b329c1663f59fbc7ddfc8658 | R | 7,063 | 143 | #!/use/bin/env/ Rscript
require(ggplot2)
require(data.table)
.libPaths = c("/xchip/gistic/Jeremiah/R", "/broad/software/free/Linux/redhat_6_x86_64/pkgs/r_3.1.1-bioconductor-3.0/lib64/R/library")
library(optparse)
AVAIL_MODES <- c("realign-test")
option_list = list(
make_option(c("-i", "--input"), type = "charac... |
d8eef20a5d2e3f2b2e53cce78f904f942704951aa6a572682c2c1e86eb6391ca | R | 7,077 | 169 | ### Get the parameters
parser = argparse::ArgumentParser(description="Script to Cluster scATAC data by ArchR")
parser$add_argument('-I','--inputpath', help='input arrow directory')
parser$add_argument('-D','--id', help='tissue ID')
parser$add_argument('-O','--out', help='out directory')
parser$add_argument('-F','--filt... |
7017e10beae8da4ee229effe98a7bad111166ca441ecee8d0e49b072cb04275c | R | 7,089 | 198 | library(MixfMRI, quietly = TRUE)
prefix <- "simu"
load("new/summary/summary.rda")
if(!file.exists("new/summary_plotfclust")){
dir.create("new/summary_plotfclust")
}
### Plot
i.counter <- 0
for(i.case in 1:nrow(ret.summary.org)){
i.counter <- i.counter + 1
tmp.phantom <- eval(parse(text = ret.summary.org[i.case,... |
8ce7eb28ba84f1db679096ea5e2aebe7ba75d2a1cca735df79e994e9bc426552 | R | 7,102 | 191 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
36a2ec0a90dd2d7172a97660008a4cea6a70482caa141d113d17a94b182533c9 | R | 7,118 | 191 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
af13cd320af2c2f03cadac133334a44f131e6672d8b7148807ef9e33f34a2171 | R | 7,120 | 191 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
449af0b0b1ed06263b02145569a28d41f8cb7f07e734fb6f24b4f848618f27bd | R | 7,126 | 155 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(sctransform)
library(scales)
library(harmony)
library(ggrastr)
# library(future)
# AugmentPlot_mod <- AugmentPlot
# fix(AugmentPlot_mod) # dele... |
bac3214ded43066543a0d6adabd32f95208390696313c4c3caf5a8f7d152c5c7 | R | 7,131 | 210 | ---
title: "Applying GSFA in a simulated dataset"
author: "Yifan Zhou"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{gsfa_intro}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(results = "hold",
... |
ce57ea2a03d65c42378f1ff1250bef882ef807b89d69931246a4c8250e85ff80 | R | 7,179 | 215 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(scDist)
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnotated_SeuratV4_object.... |
5c8f96777033955d2e42179b34e0fe499e0e9d8fc03e2b321fba5146d2a02a3c | R | 7,180 | 215 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(scDist)
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnotated_SeuratV4_object.... |
5553264bf6e57c1eeded709a8748550ec0b66dcb8c2a215fc93ad0d5ec3d1f7d | R | 7,183 | 193 | # run this dobro w/o activated conda env, with `MAST` v1.18.0 installed
# logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(data.table)
library(NMF)
library(rsvd)
library(lme4)
library(Seurat)
library(sctransform... |
da95ac62a74d237e1d46b88780aaf319ac730b7c134b874cd5bc93b317f64eeb | R | 7,186 | 191 | #### Thank you for using our code, wish you all the best! ####
# Note: In this script, our code comments are not very detailed,
# please see the simulation code of Homo-Area for detailed comments.
# The main difference between Compo-Area code and Homo-Area code is to assign-
# different properties to each sub-regi... |
4947b20cf4ed36f219da4dd9e93b1ebda529a2194ebe192e0aa627c0189b9b0b | R | 7,187 | 215 | # logging which server was used to run this script
system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"")
# load library
library(tidyverse)
library(Seurat)
library(scDist)
data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnotated_SeuratV4_object.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.