sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
890cd974552ffe0360e59d03370b18e5ee7b60b56608a4c3bfdba6185ba6a10d | R | 4,171 | 113 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(RColorBrewer)
library(rcartocolor)
library(ggpubr)
library(tidymodels)
library(broom.mixed)
library(ggsci)
library(lme4)
library(lmerTest)
library(qvalue)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit... |
ad1e4bd3d32ec9c227eec85571434be77caaf2b600cee84ee4fc24c8496e0b2e | R | 4,175 | 66 | sessionInfo()
print("R script is running...")
# Install devtools if it's not already installed
#if (!require(devtools)) {
# install.packages("devtools")
#}
# Install from GitHub
devtools::install_github("BUStools/BUSpaRse")
#devtools::install_github("satijalab/seurat-wrappers")
#if (!require(BiocManager)) {
# ... |
a043e3f5cb877015ed85c78ec78e9484aba5c4786e40fe7179c6ec5dd074604e | R | 4,176 | 114 | require(R.matlab)
rm(list = ls())
ecgpath='/data/p_02186/TMS_ECG2/analyses/EEGmotor/EKGdata/'
setwd(ecgpath)
eventpath='/data/p_02186/TMS_ECG2/analyses/EEGmotor/FDIdata/events/'
bigdata=c()
subids=c('VP01', 'VP02', 'VP03', 'VP04', 'VP05','VP06', 'VP07', 'VP08', 'VP09', 'VP10', 'VP11',
'VP12', 'VP13', 'VP14', '... |
8ef8a45cd38018987df991c116e52707347b2ea7926e85db2e40aaa08d4916a4 | R | 4,179 | 81 | library(tidyverse)
library(ggplot2)
library(ggsignif)
library(ggpubr)
# Load results
results <- data.table::fread('results_intermediate_encoders/10foldvalidation_wholeModel_32dim2000ep_serology.csv')
results_f1 <- results %>% select(F1Species,F1_global,F1Protection,KNNTranslationF1,ClassifierTranslationF1)
results_f1 ... |
aab385266120c9b87070ae1755e52d0db6af9f988030f9c741077f458236d465 | R | 4,187 | 131 | library(Seurat)
options(Seurat.object.assay.version = "v5")
library(SeuratObject)
library(tidyverse)
library(rlang)
Sys.setenv("_R_USE_PIPEBIND_" = TRUE)
library(future)
options(future.globals.maxSize = 10e9)
library(future.apply)
plan(multicore, workers = 4)
library(Matrix)
projdir <- here::here()
rdir <- file.path(... |
499fe7b5483ea32d0d3219fc15af4f8cfc9d3a461fd7756faddff136dfc3445f | R | 4,194 | 125 |
##############CHECK##############
#ALL PCA!
rm(list = ls())
dev.off()
cat("\014")
##############CHECK##############
setwd("/Users/adityanatu/Library/Mobile Documents/com~apple~CloudDocs/Project_2023/Juliet_Data_Analysis/EV_RNASeq/2.mRNAseq_EVs_RAW counts/All PCA/")
getwd()
options(stringsAsFactors = FALSE)
library(... |
3070b56b6448a9070f8fc56867a44931c7672a9558d4684364495f5176ed7a39 | R | 4,197 | 117 | #-----------------------------------------------
# LICENSE
#-----------------------------------------------
# Copyright 2019 Novartis Institutes for BioMedical Research Inc.
# Licensed under the GNU General Public License, Version 3 (the "License");
# you may not use this file except in compliance with ... |
f07b5b567daba2b04bd6dbccf19aa78cf3b25f971ce70e1ebd7dc64251107c73 | R | 4,201 | 98 | validateMaf = function(maf, rdup = TRUE, isTCGA = isTCGA, chatty = TRUE){
#necessary fields.
required.fields = c('Hugo_Symbol', 'Chromosome', 'Start_Position', 'End_Position', 'Reference_Allele', 'Tumor_Seq_Allele2',
'Variant_Classification', 'Variant_Type', 'Tumor_Sample_Barcode')
#Change... |
a12508a8ebb7ae5ad5a41b1a371cb350c9513cc436704e06d083b5f04b96e986 | R | 4,204 | 117 | ## conda environment can be created from https://github.com/brianherb/HumanHypoDev2Adult/blob/main/Hypo_R_Env.yml
library(scCoco)
library(Seurat)
setwd('/local/projects-t3/idea/bherb/Hypothalamus/PubRes/Rewrite/')
flexsplit <- function(dat,char){
test=strsplit(as.character(dat),char,fixed=TRUE)
n.obs <- sapply(test,... |
c4175ac5d2249cc52fbfb4e28e1f5f16d7f238b038a5fef83e90158ddfc72328 | R | 4,216 | 186 | ---
title: "LC analyses: mouse markers"
author: "Lukas Weber"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
number_sections: true
toc_depth: 2
toc_float:
collapsed: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, cache = TRUE)
```
# Introduction
Computation... |
6b0b331ea6a36a5a569748a0dfa174ba8fd0b915ce96d44d3884bb1739867c7c | R | 4,224 | 97 | #' Clustering algorithm wrapper function
#'
#' Will generate the clustering results necessary for downstream filtering/gating and plotting
#'
#' @param fcs_in compensated and transformed FCS in the flowFrame format as input
#' @param colsToUse select the channels to use for the clustering: c(7,8,9,10)
#' @param clus... |
38bf9946cc8dd496be7db9b06ad611242d43b83e6b3a493906e2eb6429d55353 | R | 4,229 | 125 |
##############CHECK##############
#ALL PCA!
rm(list = ls())
dev.off()
cat("\014")
##############CHECK##############
setwd("/Users/adityanatu/Library/Mobile Documents/com~apple~CloudDocs/Project_2023/Juliet_Data_Analysis/EV_RNASeq/1.mRNAseq_Cells_RAW counts/All PCA/")
getwd()
options(stringsAsFactors = FALSE)
librar... |
d0e13b3f7093db81f4e64ad6c4df538df145e57b1a1505ac48e2b6e6e379d86e | R | 4,240 | 117 | #KEGG Enrichment Analysis of the enriched genes
#this script uses clusterProfiler::enrichKEGG() function
#run locally on Ayushi's laptop
#load the required packages
library(org.Mm.eg.db)
library(clusterProfiler)
library(tidyr)
#set the working directories
indir <- paste0("~/Dropbox (Gladstone)/YH_MN02/",
... |
ea6cc445cb0d589e4d9b5c50adc47672826dfc1dbae09ddcc39e30a2c26ceffc | R | 4,241 | 104 | #############################################################
# Test for single granlarity
# Note: BSP uses paired granularities
#############################################################
library(EnvStats)
library(fitdistrplus)
library(ggplot2)
library(ggpubr)
InputPath <- "../Data/Real_Data/Test Score/"
... |
e9f51c801161a20c5fc6842218609aa96205b8a11b3d3cec7065ec091e29d739 | R | 4,245 | 159 | library(optparse)
packdir <- file.path(here::here(), "package/R")
import::from(
.from = "utils.R",
.directory = packdir,
checkArgsExistOrStop, prepareOutdir,
checkFileExistOrStop, colFn)
import::from(.from = "cembav2env.R",
.directory = packdir, cembav2env)
import::from(
.from = "hc.R",
.directory = pack... |
1225cb23c5144f21e708702d2aaaf32b4738da3020c4c9707a17f922ca5fba53 | R | 4,257 | 123 | library(SingleCellExperiment)
library(ComplexHeatmap)
library(rcartocolor)
library(data.table)
library(tidyverse)
library(ggsci)
library(here)
library(readxl)
library(ggh4x)
library(wesanderson)
library(tidyverse)
library(data.table)
library(tidymodels)
library(here)
ss <- function(x, pattern, slot = 1, ...) {
sapp... |
a12a99570ae4fe5bd9b67d3d1c9290ceed3286c1b01e079184ae035a01fcef2e | R | 4,259 | 117 | #KEGG Enrichment Analysis of the enriched genes
#this script uses clusterProfiler::enrichKEGG() function
#run locally on Ayushi's laptop
#load the required packages
library(org.Mm.eg.db)
library(clusterProfiler)
library(tidyr)
#set the working directories
indir <- paste0("~/Dropbox (Gladstone)/YH_NK01-Results/",
... |
948145b632d9d588b6ed304036ea56a3dffdda87b5a110752095ee694a0e108c | R | 4,260 | 124 | ##Create tables for info by cluster for lmmp
##Create tables for NMF pattern definitions and usage
##Create tables for info by cluster for gut cell atlas (nfh subset)
library(tidyverse)
library(monocle3)
library(here)
### lmmp metadata----
lmmp <- readRDS(here("6month_LMMP.rds"))
pData(lmmp) <- pData(lmmp) %>% as... |
6ec64b8ce10bebbd45ae5560c1b3f7b9081fbb774bca12b04aabcdab801482bb | R | 4,266 | 111 | ---
title: "R Notebook"
output: html_notebook
---
---
```{r}
library(ggplot2)
library(pheatmap)
library(RColorBrewer)
library(tidyverse)
library(ggpubr)
library(ggsignif)
library(openxlsx)
library(viridis)
library(jcolors)
```
```{r}
#setwd("//atlas.uni.lux/users/isabel.rosety/GBA/PI_FACS")
setwd("//atlas.uni.lux/LCSB... |
338c71ffe809e747ad19ce4b7bab2774a6ead0328cf54f26270bbec4ac585e36 | R | 4,272 | 104 | # R script that compares between mean fold-changes and deltaSVM scores for the MFVs
library('RColorBrewer')
orig<-read.table("MPRA_minP.norm.diff.pvalues.combined.sig.0.01.mfc_vs_dsvm.txt", header=T, sep="\t")
mtsa<-read.table("MPRA_minP_mtsanorm.norm.diff.pvalues.combined.sig.0.01.mfc_vs_dsvm.txt", header=T, sep="\t")... |
a4bfe47902133228c804d47db7811f7807d4409e89bd7432d07550511b5b3cab | R | 4,278 | 79 | #' Plot the directionality results in a heatmap.
#'
#' Given an \code{dataframe} with the directionality results obtained after apply
#' the \code{directionality} function, a heatmap plot of the results is obtained.
#'
#' @param input A \code{data.frame} obtained after applying the \code{directionality}
#' function
#... |
c7797ae04d9121ff3ee6262aca62d2e3732f5ca7a12bf4258e2cf26892ed4d04 | R | 4,282 | 125 |
##############CHECK##############
#ALL PCA!
rm(list = ls())
dev.off()
cat("\014")
##############CHECK##############
setwd("/Users/adityanatu/Library/Mobile Documents/com~apple~CloudDocs/Project_2023/Juliet_Data_Analysis/EV_RNASeq/4.microRNAseq_EVs_RAW counts/All PCA/")
getwd()
options(stringsAsFactors = FALSE)
libr... |
62d094374c360a50efd5b926d403c1ecd48ab36cfee95e10b9ca68938c48476a | R | 4,286 | 110 | ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors = F)
## packages for data table processing/plotting
library(tidyverse)
library(rcartocolor)
library(ggsci)
library(ggsankey) # devtools::install_github("davidsjoberg/ggsankey")
library(her... |
1f5ac2bd7ab125aa9346a3fedce72a836ee949f1279596663bbb58acb78ea167 | R | 4,290 | 120 | library(dplyr)
InputExp <- openxlsx::read.xlsx("../Data/mmc6.xlsx", colNames = FALSE)[,-1] %>% unlist() %>% as.numeric()
OutputDir <- "../Data/Simulation_3D_Test/"
sim_discrete <- function(InputExp, OutputDir,
NGenes = 1000,
NX = 15, NY = 15, numSlices = 10,
... |
39be642df2eb2edaaf105bb1d278811ac1561915c305da24320a311ca669a070 | R | 4,293 | 112 | ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors = F)
## packages for data table processing/plotting
library(tidyverse)
library(rcartocolor)
library(ggsci)
library(grid)
library(gridExtra)
## main Seurat package snRNA-seq pacakges
libr... |
cf849a2a9ddfb2b3c9268829152b96949fbb55da3bf5a60085c7de36469adbe5 | R | 4,306 | 125 |
##############CHECK##############
#ALL PCA!
rm(list = ls())
dev.off()
cat("\014")
##############CHECK##############
setwd("/Users/adityanatu/Library/Mobile Documents/com~apple~CloudDocs/Project_2023/Juliet_Data_Analysis/EV_RNASeq/3.microRNAseq_Cells_RAW counts/All PCA/")
getwd()
options(stringsAsFactors = FALSE)
li... |
b2433a82ace2a5b15d1853d8e5d01fb2cfc826dc9fdbf1f61219332c595a0e67 | R | 4,315 | 145 | ---
title: "Replicate-Wise Variance for Vglut Data"
author: "Stephen P Plassmeyer"
date: "5/11/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
source('../../code/mpra_tools/mpra_tools.R')
```
```{r}
compiled_counts <- fread('../../data/compiled_counts/asd3utr_compiled_co... |
964573819151c734f9a74f4d97068e426858e0f10d7ffc0bca92fdc3338ec90e | R | 4,316 | 116 | rm(list = ls())
## Check which modules are loaded
.libPaths(c('/ncf/hcp/data/analyses/myelin/verse-cmdstan-container', .libPaths()))
.libPaths()
# R Setup ----
library(brms)
library(data.table)
library(ggplot2)
library(readr)
library(future)
library(stringr)
## Set working directory to where model outputs are genera... |
7f71816cc322732c7ffdb7b86badbd9f73d44d0807dfc27d53e84fbaae3d1287 | R | 4,317 | 122 | library(SingleCellExperiment)
library(ComplexHeatmap)
library(rcartocolor)
library(data.table)
library(tidyverse)
library(ggsci)
library(here)
library(readxl)
library(ggh4x)
library(wesanderson)
library(tidyverse)
library(data.table)
library(tidymodels)
library(here)
ss <- function(x, pattern, slot = 1, ...) {
sapp... |
eb3a348b6de01a74691c2c39fdf8f8ad96bc62f5d9cf6fdf74af4feddb11307b | R | 4,317 | 125 |
##############CHECK##############
#ALL PCA!
rm(list = ls())
dev.off()
cat("\014")
##############CHECK##############
setwd("/Users/adityanatu/Library/Mobile Documents/com~apple~CloudDocs/Project_2023/Juliet_Data_Analysis/EV_RNASeq/5.BulkRNAseq_Responder Cells_RAW counts/All PCA/")
getwd()
options(stringsAsFactors = F... |
273dc24f26d39bcca350a6d30e4d9c0c2e7a847f09d1855508373b2bebee70ee | R | 4,320 | 101 | #' Comorbidity Analysis \code{comorbidityAnalysisMolecular}
#'
#' Given an object of type \code{molecularComorbidity}, a comorbidity analysis is perform,
#' taking into account the number of genes shared between the disorders.
#' It generates a \code{molecularcAnalysis} object.
#'
#' @param input A \code{molecularCo... |
b71354aab922a9063892eab438ed6e6b2cee1c48523e3e99851a1d9998a67d96 | R | 4,327 | 142 | ## ---------------------------
##
## Script name: Bee brain statistics
##
## Purpose of script: Supporting Information of Paper
##
## Author: Dr. Coline Monchanin
##
## Email: coline.monchanin@gmail.com
##
## ---------------------------
##
## This script is part of the publication:
##
## Lösel et al. Natu... |
5f107a0c2b2f52e7c0a30f4bcc14d4f726385555f4fe4da9e66f1dfad5d801ef | R | 4,331 | 94 | #' Plots segmented copy number data.
#' @details this function takes segmented copy number data and plots it. If MAF object is specified, all mutations are highlighted on the plot.
#' @param cbsFile CBS segmented copy number file. Column names should be Sample, Chromosome, Start, End, Num_Probes and Segment_Mean (log2 ... |
53b0c8c32617c99e3bcfc3156532f56a3b8c7f83604779f971f88326014d5ca8 | R | 4,333 | 109 | ---
title: "CCInx Usage"
author: "Brendan Innes"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup_vignette, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "... |
6341996d7f15ae97d4ce7fcd90aa23cfae651eddfde8cf9723489f3f0b046f19 | R | 4,342 | 100 | # Sum FAST grey- and white-matter partial-volume estimates to obtain TBV in mm3.
args <- commandArgs(FALSE)
file_arg <- args[grepl("^--file=", args)]
this_file <- if (length(file_arg) > 0) sub("^--file=", "", file_arg[1]) else "scripts/00_calculate_tbv_from_fast_pves.R"
this_file <- gsub("~+~", " ", this_file, fixed = ... |
c7d8b000bb9e7866e5b71cc629e5681ff495d3486b5cf3cfba08e8dcac2bbc28 | R | 4,344 | 130 | library(data.table)
library(dplyr)
library(tidyr)
library(tibble)
library(stringr)
library(misha)
#####################
#Variables to define
#####################
# main_f <- '/home/fnoack/projects/3D_RAMseq_250k/rep1/'
# bedgraph_file <- '3DRAM_ES_250k_rep1_R1.fastq.gz_trimmed.fastq_CpG_cov5x.bedGraph'
# rf <- c('C... |
46e41eba4eb660a4a6b2f3925c6565ac32908760f41b178e9060e90ca3ad7aab | R | 4,361 | 155 | ---
title: "Bulk RNA-seq Data Set - GTEx - v8"
author: "Regina H. Reynolds"
output:
html_document:
theme: paper
highlight: kate
df_print: paged
toc: true
toc_float: true
number_sections: true
---
```{r setup, include=FALSE}
library(here)
library(tidyverse)
knitr::opts_chunk$set(echo = TRUE... |
777b15eaaec38105fb515fc1d5a9cdd457d0ff8712d6902ce32ae22414698191 | R | 4,367 | 146 | set.seed(321)
# mock up some single-cell, mixture & marker data
sce <- mockSC()
spe <- mockSP(sce)
mgs <- getMGS(sce)
# .scale_uv ----
test_that(".scale_uv()", {
x <- counts(sce)
y <- .scale_uv(x)
expect_is(y, "matrix")
expect_identical(dim(y), dim(x))
expect_identical(dimnames(y), dimnames(x))
... |
d014f4177780b6325130d250b0c16e5b61f10e462ec10f32c473c09396271f63 | R | 4,368 | 50 |
#' @title Genes Associated with High Frequency of a Cellular State
#' @description The expression of genes in bulk samples reflects the combined effect from multiple expressing cell types and cell states, and therefore many genes that are good markers for a particular cellular state in single cell data may not be good... |
47d140b09e0248184b016fd042b551cee79cd69945e9956cab3bfdb26c73af09 | R | 4,374 | 108 | # this script will tile windows and count the cellranger-atac bam
# the windows will be hg38 excluding an encode blacklist
# SCRATCH1=/mnt/g/scratch
# docker run -it \
# --workdir $HOME \
# -v /mnt/g/cellranger_atac_counts:$HOME/cellranger_atac_counts \
# -v /mnt/g/cellranger_rna_counts:$HOME/cellranger_rna_counts \
#... |
ced9f4fa71241e1b42f0285ecd54ced3304730a892d5cf5bf265a483c3072534 | R | 4,378 | 158 | ################################
# LC project
# Script for downstream analyses
# Lukas Weber, Apr 2022
################################
# module load conda_R/4.1.x
# Rscript filename.R
# file location:
# /dcs04/lieber/lcolladotor/pilotLC_LIBD001/locus-c/
library(SpatialExperiment)
library(here)
library(scater)
libr... |
04d6ba4fc0a85fa1168d085a00fcb4c7ac9e34b494b47ed041a8f29515270e51 | R | 4,404 | 158 | ################################
# LC project
# Script for downstream analyses
# Lukas Weber, Apr 2022
################################
# module load conda_R/4.1.x
# Rscript filename.R
# file location:
# /dcs04/lieber/lcolladotor/pilotLC_LIBD001/locus-c/
library(SpatialExperiment)
library(here)
library(scater)
libr... |
571fb0803c53afb08574c01f98a8354098230791d1e9c9aa8582dc408a62ac6d | R | 4,409 | 116 | ---
title: "Setting1 marker expression"
author: "Hao Huang"
date: "01/11/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load
```{r}
suppressPackageStartupMessages({
library(SingleCellExperiment)
library(Seurat)
library(tidyverse)
library(dplyr)
libra... |
dde72b34877be5fde27ad19da44db2183af409b8c7b8ca9fe919fba93a1645ab | R | 4,423 | 136 | ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors = F)
## packages for data table processing/plotting
library(tidyverse)
library(tidymodels)
library(rcartocolor)
library(ggsci)
## main Seurat package snRNA-seq pacakges
library(Seurat)
li... |
3ff019e007fbada59b092010dcdb4cc1aa06fcc5b542fc8d913219fc5ac72d94 | R | 4,425 | 127 | #############################################################
# Generate Figure 4A
#############################################################
library(plotly)
library(scales)
setwd("D:\\PhD\\Lab\\Project_3_SVG\\Figures\\")
for(Pattern_index in 1:3){
Input_Folder <- ".\\Data\\Manuscript_3D_Simulation_Patt... |
7b75030ee8db43f634d31fb11d094a6b5afc85a3f7cdcf58a85593b7031d460d | R | 4,439 | 123 | #-----------------------------------------------
# LICENSE
#-----------------------------------------------
# Copyright 2019 Novartis Institutes for BioMedical Research Inc.
# Licensed under the GNU General Public License, Version 3 (the "License");
# you may not use this file except in compliance with ... |
4c2dfca396eff932fea490d2eea0e39e9e2c6f08a3f01249380d506de54678c5 | R | 4,443 | 149 | library(tidyverse)
library(rlang)
Sys.setenv("_R_USE_PIPEBIND_" = TRUE)
library(future)
library(data.table)
projdir <- here::here()
rdir <- file.path(projdir, "package/R")
import::from(.from = "cembav2env.R", .directory = rdir,
cembav2env, Sa2PeakCalling)
workdir <- file.path(projdir, "18.snap2_peakcalling")
peaksu... |
611fda56874794a64fcd4b2df5248f8f26c4b245f0337075969052bfadb897ed | R | 4,445 | 85 | ## Dataset build for fetal brain data from Polioudakis et al (2019)
## Joe Raymond
#install.packages('Seurat')
library(Seurat)
## Loading Data
# Prior to running this script, data must be downloaded from Polioudakis et al's
# 2019 publication: 10.1016/j.neuron.2019.06.011
load('/path/to/data/matrix')
metadata <- read... |
ec6906041bf92588fdec47df328f9842da518d54f72df1b48cf2fc022f0418fe | R | 4,452 | 124 | ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors = F)
## packages for data table processing/plotting
library(tidyverse)
library(ComplexHeatmap)
library(rcartocolor)
library(ggsci)
## main Seurat package snRNA-seq pacakges
library(Seurat... |
47e681351ffcc03a1628bb28d1c66f434f7751c1c9d6beb24fa9bb69f3c0df79 | R | 4,454 | 66 |
# First load in the spatial extent of each PFN (they're in order, 1-17)
# Then merge with the same datasets as above (NIH toolbox, trauma, etc.)
pfn_sizes <- read.csv("/Users/askeller/Documents/Kellernet_PrelimAnalysis/All_PFN_sizes.csv")
# Change PFN column names so they're sensible
colnames(pfn_sizes)<-c("subjectkey... |
309209ef1669106ad2890764c02228c3c9aa3bc0b8823c6afd178d56445ba4b1 | R | 4,456 | 110 | # Function to apply random transformations to a dataframe
transform_df <- function(df) {
# Randomly transform MedianCerebellum and MedianCerebrum columns
transformed_df <- df
transformed_df$MedianCerebellum <- transformed_df$MedianCerebellum * runif(1, 0.5, 2.0)
transformed_df$MedianCerebrum <- transformed_df$M... |
0e3fa176a6219643b9f64a63d5fc678c4d5d7072b20b74ee7b9eee8c600c2575 | R | 4,458 | 126 | #############################################################
# Generate Figure 4A
#############################################################
library(plotly)
library(scales)
for(Pattern_index in 1:3){
Input_Folder <- ".\\..\\..\\Data\\Manuscript_3D_Simulation_Pattern\\Simulation_3D_Example\\"
Input_Fi... |
6283dd9ecece1fee3950ac6a95bb43523dd24f121c6c11cc22fa53abd5743349 | R | 4,460 | 143 | ---
title: "Plot evaluation"
author: "Hao Huang"
date: "07/07/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load
```{r}
suppressPackageStartupMessages({
library(ggplot2)
library(glue)
library(reshape2)
library(ggpubr)
})
```
# Setting 1
## Classificati... |
7a57d00bbdc5e275ad8f31144ebd7a0de0097796fc6ed88c1ab02d3ea1c1da58 | R | 4,466 | 112 | ---
title: "Tutorial: querying genes across specificity matrices"
author:
- name: Regina H. Reynolds
affiliation:
- UCL
email: regina.reynolds.16@ucl.ac.uk
output:
BiocStyle::html_document:
self_contained: yes
toc: true
toc_float: true
toc_depth: 2
code_folding: show
date: "`r doc_... |
beab503e62525c790a496b94bf35720e8ff99f5256a61044754b964cf689a545 | R | 4,466 | 94 | ##' plotGANetwork
##'
##' @title Visualize gene association network graph of a gene module or pathway at the specified cell phenotype
##'
##' @description
##' Based on the gene set input by the user, \code{plotGANetwork} functional draws the gene association network in the specified cell phenotype.
##' The node s... |
44ce3b757858577aed10c28f04e5441e77c7eeb184facaff67f20fea68cfc01c | R | 4,467 | 168 | library(optparse)
packdir <- file.path(here::here(), "package/R")
import::from(
.from = "utils.R",
.directory = packdir,
checkArgsExistOrStop, prepareOutdir,
checkFileExistOrStop, colFn,
fastread.csv)
import::from(.from = "cembav2env.R",
.directory = packdir, cembav2env, Sa2PeakCalling)
import::from(
.fr... |
ad2904c5e0eb355be142e20368989ba75f8cb5a9e18dc6c279517ee5fc42e082 | R | 4,472 | 83 | library(here)
library(tidyverse)
library(CoExpNets)
## NSL GENE LIST
# Import lists of genes of interest
NSL_file <- read.csv(file.path(here::here("data", "Gene_lists", "NSL_genes.csv")))
names(NSL_file)[names(NSL_file)=="Symbol"] <- "Gene_symbol"
# Find corresponding ENSGs
NSL_ENSGs_list <- getBM(attributes = c("hg... |
2c8dc1b82d2d024f87fd8520ba4bc65d17ba180fb107e58986ebf330194c769a | R | 4,473 | 150 | library(optparse)
library(Matrix)
pack_dir <- file.path(here::here(), "package/R")
import::from(.from = "utils.R", .directory = pack_dir,
checkArgsExistOrStop, prepareOutdir, scaleByRow,
scaleUseRankByRow, fastPearCorOnRow.scaled,
fastCorOnRow.chunk)
import::from(.from = "annot.R", .directory = pack_dir,
mapAll... |
8c60cad4ff844d972e2ca46ef53bcdd2c5f39e1b9363b86c35e80a65d21e26e9 | R | 4,490 | 150 | #' Function to run codeml within R
#'
#' @param phy path to phylogenetic tree
#' @param model which model to use (see XX for details)
#' @param fasta path to FASTA codon alignment file
#' @param delete whether to force analysis (delete original) and mask early stop codons
#' @param outpath output path for results
#' @... |
99b1778e105406c59202a5c8fa51320bbaa3a83ba69df488218b1303dfef0244 | R | 4,491 | 161 | # This code is to plot Fig. 7
# WANG. 23-Aug-2024
# Remove all objects created before to prevent clash
rm(list = ls())
library(TOSTER)
# Set the working directory to the path where your files are located
setwd("/Users/wang/Desktop/Research_projects/BBSC/Functional/fmri/derivatives/freesurfer-v7.2.0/")
#from 7.2
l... |
be0f019bd5bfeceb9128fc3449c445e8a80f36e750f629a234a1cbf9818242ab | R | 4,496 | 124 | library(ggplot2)
library(scales)
# raw figure
set.seed(1)
Figure_Raw <- png::readPNG(".\\..\\..\\Data\\Main_Figure\\rsz_1raw.png")
#Figure_Raw <- as.data.frame(Figure_Raw[,,1])
Figure <- data.frame(x = rep(1:ncol(Figure_Raw), rep(nrow(Figure_Raw), ncol(Figure_Raw))),
y = rep(c((nrow(Figure_R... |
66bb2cded0b027aac2df77f500c5ebc25cd811cac2db60d45beb88fe4cf41b3f | R | 4,498 | 68 |
# First load in the spatial extent of each PFN (they're in order, 1-17)
# Then merge with the same datasets as above (NIH toolbox, trauma, etc.)
pfn_sizes <- read.csv("/Users/askeller/Documents/Kellernet_PrelimAnalysis/All_PFN_sizes.csv")
# Change PFN column names so they're sensible
colnames(pfn_sizes)<-c("subjectkey... |
87d995f3a8270e8c92c9386e3e1f05b2d605b86544fb9f4c41dbdaa949d68b7c | R | 4,508 | 113 | #' Query genes in specificity matrices.
#'
#' Allows user to query a vector of genes in a celltype_data file with mean
#' expression and specificity matrices.
#'
#' @param genes Query genes as a vector.
#' @param ... Names of input ctds. An individual ctd, should have been generated
#' using \code{generate.celltype.d... |
12fce670fe73b41c9a3869eb92a2edc888feb724f51e8f74b8e95af097b62d1c | R | 4,509 | 115 | # this script will compute cnv burden for multiomes using infercnv and epianeufinder results
# SCRATCH1=/mnt/g/scratch
# docker run -it \
# --workdir $HOME \
# -v /mnt/g/ckd:$HOME/ckd \
# -v /mnt/g/cellranger_atac_counts:$HOME/cellranger_atac_counts \
# -v /mnt/g/cellranger_multi_counts:$HOME/cellranger_multi_counts \... |
9a831e1943887c7bbf71489147078976c8564f6cf2c2de879a77326c1aaa3f21 | R | 4,509 | 109 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(RColorBrewer)
library(rcartocolor)
library(ggpubr)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
library(future)
## AUCell object for DNA damage estimates
library(AUCell)
ss <- functio... |
6200b8642e03baeff23094dfc78f2a0094724307e32a733db06a3be8be795168 | R | 4,511 | 142 | ---
title: "Plot evaluation"
author: "Hao Huang"
date: "07/07/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load
```{r}
suppressPackageStartupMessages({
library(ggplot2)
library(glue)
library(reshape2)
library(ggpubr)
})
```
# Setting 1
## Classificati... |
20482c26ada2796f061d56681f97ec1e167baf4d1772ee98211e2b4e8c54a42b | R | 4,520 | 140 | #' @rdname data
#' @name data
#' @aliases mockSC mockSP getMGS
#' @title Synthetic single-cell, mixture and marker data
#'
#' @description
#' \code{mockSC/mockSP()} are designed to generate synthetic single-cell and
#' spatial mixture data. These data are not meant to represent biologically
#' meaningful use-cases, but... |
f5d0006980c388603f9f72542b42388c79e9f7d57ccb4d7daa69969319f67ce8 | R | 4,521 | 89 | #' Function for building a Symphony reference from a Harmony object. Useful if you would like your
#' code to be more modular. Note that you must have saved vargenes_means_sds and PCA loadings.
#'
#' @param harmony_obj Harmony object (output from RunHarmony() with return_object = TRUE)
#' @param metadata Reference cell... |
81dbec8cb97f55974f5a21c69a9431daa75eada8413bfc85434cbb34f7646beb | R | 4,523 | 163 | #' @export
getPseudoCPM1 <- function(gmat,
scale.factor = 1e4,
asdf = T) {
totalcnt <- sum(gmat)
genecnt <- colSums(gmat)
s <- genecnt * scale.factor / totalcnt
names(s) <- colnames(gmat)
if(asdf) {
r <- data.frame(c1 = s)
rownames(r) <- colnames(gmat)
} else... |
cc4284c26ad01fde8ab222849a5735b9e69ce9b1ffc1ce547dd2670d68c988bb | R | 4,525 | 181 | ###################################################################
# LC snRNA-seq analyses: secondary clustering of inhibitory neurons
# Lukas Weber, Oct 2022
###################################################################
library(here)
library(SingleCellExperiment)
library(scater)
library(scran)
library(bluster... |
fae2ac21dffbfc290a36b2815de6c0613e6a78e011f64b080585e43950f5074d | R | 4,525 | 159 | ---
title: "R Notebook"
output: html_notebook
---
# Set Up
```{r setup}
knitr::opts_knit$set(root.dir = normalizePath("../.."))
```
# Imports
```{r}
library(finalfit)
library(mice)
library(purrr)
library(dplyr)
library(lavaan)
library(ggplot2)
library(gplots)
source('functions/mediation.R')
```
```{r}
get.brain.feat... |
d48bc9e340b2a369cb458772134771435a4b6963bb68994772c5faeaa29ed272 | R | 4,530 | 103 | # Gregory Way 2017
# PanCancer Classifier
# scripts/copy_burden_figures.R
#
# Generate figures for visualizing copy burden across different samples
# stratified by TP53 mutation status
#
# Usage: Run in command line
#
# Rscript --vanilla scripts/copy_burden_figures.R
#
# Output:
# Two figures summarizing copy burde... |
ae48ace8f5a212fd83010e1a42906ada2a58e2696bcfbc8855f8049d4aa1564a | R | 4,542 | 126 | library(Seurat)
options(Seurat.object.assay.version = "v5")
# Not sure if this is a must
library(SeuratObject)
# Not sure if this is a must
library(SeuratData)
# seurat5 version wrappers
# needed for FastMNNIntegration
library(SeuratWrappers)
# [FIXED] Seurat5 use future inside, this is a must
# for 2 million cells, Fi... |
54d6422fa10b63ae8951f287515bf3bdd74020bfa23f937a5ceabdd2dbe4b1c5 | R | 4,554 | 112 | # this script will tile windows and count the cellranger-atac bam
# the windows will be hg38 excluding an encode blacklist
# SCRATCH1=/mnt/g/scratch
# docker run -it --rm \
# --workdir $HOME \
# -v /mnt/g/cellranger_atac_counts:$HOME/cellranger_atac_counts \
# -v /mnt/c/reference:$HOME/reference \
# -v /mnt/g/ckd:$HOM... |
c57f88926333e9c5208e56ba946830ed134f919e4c925bebf6127a0fe8d331be | R | 4,558 | 103 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(RColorBrewer)
library(rcartocolor)
library(ggpubr)
library(data.table)
library(fgsea)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors ... |
81907f36e05e376c2db8a2eceea68fcc114d552d02afe369f1f28758f4675849 | R | 4,560 | 104 | library(tidyverse)
library(data.table)
library(ggpubr)
library(metafor)
library(tidymeta)
library(broom)
library(qvalue)
library(here)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors = F)
options(repr.plot.width=11, repr.plot.height=8.5... |
34fce0433a3201cb09991ac728df1b0d7a2a69c8c8d56b09265431f25b9db755 | R | 4,561 | 84 | ---
title: "Dataset metadata"
author:
- name: Regina H. Reynolds
affiliation:
- UCL
email: regina.reynolds.16@ucl.ac.uk
output:
BiocStyle::html_document:
self_contained: yes
toc: true
toc_float: true
toc_depth: 2
code_folding: show
date: "`r doc_date()`"
package: "`r pkg_ver('Marke... |
b2d49835335bfdf20385218f7310a9a0e5ca90ae62386d6f8b5d87d6a254431e | R | 4,565 | 93 | #' Function to plot reference, colored by cell type
#'
#' @param reference Symphony reference object (must have UMAP stored)
#' @param as.density if TRUE, plot as density; if FALSE, plot as individual cells
#' @param bins for density, nbins parameter for stat_density_2d
#' @param bandwidth for density, bandwidth param... |
5e68d325ce41533a27897f8ff298ed480437b513fe4040d40d9fe84c4f4cc915 | R | 4,571 | 158 | ---
title: "6month projections"
author: "Jared Slosberg"
date: "5/19/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r check_interactive}
if(interactive()){
print(date())
print("This was run interactively. Please run with rmarkdown::render")
}else{
print(... |
2e2273284eae972bccbb2ccc8a779b2c50deb4ef0ae7db35aeced2cb7b043dc3 | R | 4,573 | 125 | ---
title: "R Notebook"
output: html_notebook
---
```{r}
library(ggplot2)
library(pheatmap)
library(RColorBrewer)
#display.brewer.all()
library(tidyverse)
library(ggpubr)
library(ggsignif)
library(openxlsx)
library(viridis)
library(data.table)
library(readxl)
library(janitor)
library(dplyr)
library(jcolors)
library(st... |
75dbc9f3cafb19badee97d15273a71b29f19563fda2ab9dcaa573f6b101de3f8 | R | 4,573 | 108 | # generate two files for SERGIO: one for master regulator expression for n.cell types;
# one for regulator relationships
library(qpcR)
library(formattable)
library(pheatmap)
# set parameters
n.celltypes <- 3
n.genes <- 5000
n.master.regulators <- n.genes * 0.005
n.tight.strong.targets <- n.genes * 0.1
n.tight.medium.t... |
8f7caa76ece82a5720c92ec353b5c8bc6214a7186c94e3bf8703ea226068a92b | R | 4,574 | 175 |
#Functions to help go through dendrogram while building iteratively
#function to remove NA entries from dendrogram
RemoveNA<-function(dend){
newdend<-dend
for(i in 1:length(dend) && typeof(dend)=="list"){
if( typeof(dend[[i]])=='double'){
if(dend[[i]]==0 ){
newdend[[i]]<-NULL
}
}
... |
6cc726301a1a2c63d141d76f781ba142d18db897562c61bce41d32f00d80c908 | R | 4,575 | 119 | ---
title: "Evaluating logFC Threshold for Case Enrichment"
author: "Stephen P Plassmeyer"
date: "7/27/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(tidyverse)
library(data.table)
library(patchwork)
source('../../../code/mpra_tools/mpra_tools.R')
```
Updated ... |
1fe04bad5fe7fc7b1a3f791ada53ba5eeba4648d216b76908f80edb76c23cd87 | R | 4,578 | 62 | source("src/lib/Repo.R")
source("src/lib/CHEX.R")
SampleInfo <- read.csv("data/SampleInfo.csv", as.is = TRUE, check.names = FALSE)
rownames(SampleInfo) <- sampleIDs <- SampleInfo[, "SampleID"]
## 1. NGS QC stats from the SCAP-T pipeline
## Biological samples only
SampleNGSstats <- t(mapply(function(exptID, sampleID) ... |
0b42cd2206c29d440d1d42c1c67abca22644cadd5820bd613617b22ee567dc00 | R | 4,588 | 173 | #05/23/2023 Fengyao Yan
#plot a polygon rank to show the model performance.
# functions ---------------------------------------------------------------
.radial <- function(data, r0 = 0.2, r = 1, theta0 = pi/2){
n <- ncol(dat) - 1
theta <- seq(theta0, theta0 + 2 * pi, length.out = n + 1)[-(n + 1)]
tb <- t... |
ab9ce0c70fa25cfbc0937bdfb215236571ace9e1ef53f191ef88c50b7dc2d340 | R | 4,588 | 97 | # Combine bilateral-labelled masks, TBV estimates, and demographics by study ID.
args <- commandArgs(FALSE)
file_arg <- args[grepl("^--file=", args)]
this_file <- if (length(file_arg) > 0) sub("^--file=", "", file_arg[1]) else "scripts/00_prepare_open_derived_data.R"
this_file <- gsub("~+~", " ", this_file, fixed = TRU... |
e8aa43f705f55a4b881893af0fe24168edfc44e61f2f0d75c39a40ae1914ae57 | R | 4,605 | 115 | ===---
title: "R Notebook"
output: html_notebook
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tidyverse)
suppressPackageStartupMessages(library(openxlsx))
library(readxl)
library(limma)
library(edgeR)
suppressPackageStartupMessages(library(clusterProfiler))
suppressPackageStar... |
92c63c533c3fb40feea359d1b1f06e94ec24c57227f38cf731aa03bb9aee98ea | R | 4,612 | 115 | ---
title: "R Notebook"
output: html_notebook
---
```{r}
## gene level analysis of transcriptomic data starting from foldchage values
## set path and load file
library(readxl)
library(dplyr)
library(tidyverse)
library(tidyr)
library(ggplot2)
suppressPackageStartupMessages(library(openxlsx))
library(readxl)
libr... |
ec42502541cc78c91e4b3a31bbc1227e8c755f38d1069a238dd4d9db3f7d25a3 | R | 4,614 | 110 | # Parser for IBSI 1 reference values. Converts csv to assert tests and renames
# feature tags to internal standard.
library(data.table)
line_parser <- function(ref_value, tol, tag, postfix=NULL){
suffix <- NULL
if(stringi::stri_startswith_fixed(str=tag, pattern="cm_")){
suffix <- c(suffix, "d1_")
}... |
1ae147f7e57b2e2ec1e091aa8e8f75eea72d1a98ca47428a108b0610fe39659a | R | 4,616 | 97 | #' @title Fit a Bimodal Gaussian Distribution
#' @description Fit a bimodal gaussian distribution to a set of observations.
#' @param x a named numeric vector of cells/observations or a matrix of genes X cells (variables X observations). If the latter, the column means are first computed.
#' @param prob a numeric val... |
0cc83cdd8646b79a4bceee9d3b843c3ef010df655cd9a49f1797f024a039b6b0 | R | 4,624 | 148 | library(tidyverse)
library(rlang)
Sys.setenv("_R_USE_PIPEBIND_" = TRUE)
library(future)
library(furrr)
plan(multicore, workers = 7)
options(future.globals.maxSize = 15e9)
library(GenomicRanges)
library(rtracklayer)
projdir <- here::here()
workdir <- file.path(projdir, "04.cCREgene/sa2.cicero")
packdir <- file.path(he... |
0222c68f94063b84776053b74c975cdd7b4827aec154a6ed53181ddf7839f708 | R | 4,625 | 88 | ---
title: "Introduction to MarkerGenes"
author:
- name: Regina H. Reynolds
affiliation:
- UCL
email: regina.reynolds.16@ucl.ac.uk
output:
BiocStyle::html_document:
self_contained: yes
toc: true
toc_float: true
toc_depth: 2
code_folding: show
date: "`r doc_date()`"
package: "`r pkg... |
4cc2b55a1fedc0aa8234915abea161a3214c093485aa0fe2f47ad6c60b4ebdab | R | 4,636 | 116 | #' Query genes in specificity matrices.
#'
#' Allows user to query a vector of genes in a celltype_data file with mean
#' expression and specificity matrices.
#'
#' @param genes Query genes as a vector.
#' @param ... Names of input ctds. An individual ctd, should have been generated
#' using \code{generate.celltype.d... |
9b77bf4020d1f011c1419d4055e523b0dae0328948d63045e9e15668cecd3b63 | R | 4,640 | 172 | #' @export
loadRawGRNFile <- function(f, indir = NULL) {
message("Loading ", f)
if(!is.null(indir)) {
f <- file.path(indir, f)
}
d <- data.table::fread(file = f, header = TRUE, sep = ",",
data.table = FALSE)
r <- d[ , c(2,3,4,7)]
colnames(r) <- c("source", "target", "coef", "nlogp")
return(r)
}
#... |
545acd455aa566a8de131114ead5c67168410ca32aeadaed804824aadc4fa03b | R | 4,641 | 107 | library(stats)
library(purrr)
library(dplyr)
load("bulk_dev_RNAseq.RData")
load("stress_RNAseq.RData")
load("Cel_dup_N4Cel.RData")
load("cluster_1_2_3.RData")
load("sc_exp.RData")
load("celltype.RData")
load("L4_exp.RData")
zscore = function(x){
x = (x - mean(x))/sd(x)
}
mean2 = function(x){
mean(... |
e84423106b42e302284c69a52359ea0f21d29c84d252770fc09ec8b70127d878 | R | 4,652 | 127 | # subcluster
merFISH_integrated = readRDS(file = "./RDS/merFISH_final.0827.RDS")
#ET
merFISH_integrated_ET = subset(merFISH_integrated, L3_cluster == "L5 ET")
merFISH_integrated_ET.marker = FindAllMarkers(merFISH_integrated_ET)
merFISH_integrated_ET.marker = merFISH_integrated_ET.marker %>%
group_by(cluster) %>%
... |
8ed948e6879f8c3148bf9e4cb834188e09fd7afd5c3d63fafb7f5f7567f8c17f | R | 4,655 | 125 | ---
title: "R Notebook"
output: html_notebook
---
# Set Up
```{r setup}
knitr::opts_knit$set(root.dir = normalizePath("../.."))
```
# Imports
```{r}
library(finalfit)
library(mice)
library(purrr)
library(dplyr)
library(lavaan)
library(ggplot2)
library(gplots)
source('functions/mediation.R')
source('functions/med.plot... |
466c1c1f0208cd7c20e7b40afec9fd6438e425c139ab76a33a4cc8e58df2dac9 | R | 4,661 | 86 | library(phylostratr)
library(tidyverse)
setwd("/home/benjamin/Documents/LF_2020_repo/Genomic/Phylostratigraphy/Vvulgaris")
phylostrata_pdom = read.csv("/home/benjamin/Documents/LF_2020_repo/Genomic/Phylostratigraphy/phylostrata_vvulgaris.csv")
#bin phylostrata
unique(phylostrata_pdom[,c("ps","mrca_name")])
phylostra... |
d9a92d65f716ad4a93b0db4eef14ab991cbad86544ab6a8d2ee0e18de85d1ec2 | R | 4,666 | 193 | #####################################
# LC project
# Script for deconvolution of ST data
# Lukas Weber, Apr 2022
#####################################
# module load conda_R/4.1.x
# Rscript filename.R
# file location:
# /dcs04/lieber/lcolladotor/pilotLC_LIBD001/locus-c/
library(SpatialExperiment)
library(SingleCellE... |
8e4dd1ebf5e9054d303d001ce6973d0e064f9cf145bc610963e91b52faa349a9 | R | 4,671 | 89 |
library(tidyr)
library(dplyr)
library(readr)
# First load in the spatial extent of each PFN (they're in order, 1-17)
# Then merge with the same datasets as above (NIH toolbox, trauma, etc.)
pfn_sizes <- read.csv("/Users/askeller/Documents/Kellernet_PrelimAnalysis/All_PFN_sizes_Rest_082122.csv")
# Change PFN column na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.