sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
16766232edbfef82607049b69f31674f3b73918375470dfecfcfc776f3a8e50e | R | 3,668 | 88 | #run locally on Ayushi's laptop
#Goal: volcano plots of the enriched genes using EnhancedVolcano package
#load required packages
library(EnhancedVolcano)
library(tools)
library(dplyr)
#set all directory paths
indir <- paste0("~/Dropbox (Gladstone)/YH_MN02/seurat_analysis_no_S521G")
outdir <- file.path(indir,"15_volca... |
6045ff8641122a3f5558681cd12bc535ea52a69b4f17ef1283d8b29e270709b5 | R | 3,676 | 84 | ---
title: "410 Vglut Total RNA MPRA QC"
author: "Stephen P Plassmeyer"
date: "7/14/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
source('../../../code/mpra_tools/mpra_tools.r')
```
# Load and Format Data
```{r}
compiled_counts <- fread('../../../data/compiled_counts... |
775ce6a1bfa2a2bfa3d7cf7ed09a5274b37fc133e3f80fdaeb973d84c7049dbf | R | 3,679 | 92 | #' Read in neuroimaging data from argument structure
#'
#' This function takes an argument structure that specifies all the parameters
#' that should be input to npointillist and returns an array of voxel data and
#' a design matrix.
#' @param args Arguments for neuropointillist
#' @param numberdatasets The number of d... |
91f3524c753090190cddb152446001fe633e1e82ef3e80d8301c76e74a05c359 | R | 3,681 | 101 | library(hdf5r)
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)
import::from(.from = "utils.R", .directory = r... |
96097f8a94266a06e4baadd475e24f5bfeb0d8941e0a6cb1b3d3030df8b9d057 | R | 3,681 | 95 | #' @title Hierarchical clustering analysis
#' @description Hierarchical clustering analysis
#' @param x a matrix (features X observations), an object of class `dist` or an object of class `hclust`.
#' @param cor.method option if <x> is a matrix. One of 'pearson' (default), 'kendall', 'spearman' or 'none' (no correlatio... |
bb225fe410cf40bd4deebf339998bf5761e07ac69df6dafccfcaacdfeb342b36 | R | 3,685 | 99 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(data.table)
library(RColorBrewer)
library(rcartocolor)
library(ggpubr)
library(svglite)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors... |
f622078befb09b1d1ba603c43e84ac610a9952d2b85cd292edaa9911b406015a | R | 3,688 | 69 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
library(future)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors ... |
d7481587a384341ce3bfac2e5e0e59e0440e9fd34449cb6889e83cc50ca839d8 | R | 3,717 | 89 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(RColorBrewer)
library(rcartocolor)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
library(future)
## gene expression heatmap plots
library(Nebulosa)
ss <- function(x, pattern, slot = 1,... |
ef97b26754a5f1efc0c78ca325f3946233a76480ca30c48d443d36d411849a0f | R | 3,723 | 136 | #This code is a direct translation of python package 'squarify' by Uri Laserson (https://github.com/laserson/squarify)
#See https://github.com/laserson/squarify for more details
# Squarified Treemap Layout
# Implements algorithm from Bruls, Huizing, van Wijk, "Squarified Treemaps"
# (but not using their pseudocode)
... |
d1820683d99d391b004edc45427ab051dfbc43e744bfc7c586a7cc9fafffc911 | R | 3,725 | 148 | ##############################################
# LC Visium analyses: SPE object for Shiny app
# Lukas Weber, Oct 2022
##############################################
# module load conda_R/4.2
# Rscript filename.R
# file location:
# /dcs04/lieber/lcolladotor/pilotLC_LIBD001/locus-c/
library(here)
library(SpatialExper... |
79031141a1e1dd5b75fb301ff9bfbfbd97cb4aa9727c5ee41271e73e13632701 | R | 3,735 | 149 | ---
title: "Quality control with saturation"
author: "Sergey Naumenko"
date: "`r Sys.Date()`"
output:
html_document:
code_folding: hide
df_print: paged
highlights: pygments
number_sections: true
self_contained: true
theme: default
toc: true
toc_float:
collapse... |
716f2de1a22638d0b6be7efd0a44855ecc0736af57c1dee22c60547a36e997d7 | R | 3,740 | 98 | ##############################
##### Data preprocessing #####
##############################
# Last edited: 06/04/23 by LVB
# Description: Data pre-processing. The *only* purpose of this script is to
# clean the data stored in data/raw and save data files for analysis in
# data/parsed.
#----- Packages
library("tidyv... |
8b9e6ebfcf51f0e43596e4236d60c174de7c307418e7ff07b5a02b83f6250804 | R | 3,745 | 85 | ## Dataset build for scRNA-seq analysis of select external publications
## Joe Raymond
#install.packages('Seurat')
library(Seurat)
# Prior to running this script, data must be downloaded from Tanaka et al's
# 2020 publication: https://doi.org/10.1016/j.celrep.2020.01.038, which contains
# three datasets of interest ... |
fc2820aa7181aa365826850811cca9e53a203fc662c833644ce0afd71118334b | R | 3,745 | 108 | #' @rdname plotCorrelationMatrix
#' @name plotCorrelationMatrix
#' @title Plot Correlation Matrix
#'
#' @description This function takes in a matrix with the predicted proportions
#' for each spot and returns a correlation matrix between cell types.
#'
#' @param x numeric matrix with rows = samples and columns = cell... |
2947aa6ad83a1aeacea09ebd8c00e0552953b1c963ad7f00ec9582b957385d1a | R | 3,755 | 109 | #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/",
... |
7ebab90bde0da69ab84db77401b452ef3bff2f91f353efb4f7e99af8bf737052 | R | 3,757 | 120 | ###################################################################
# LC analyses: spot-level deconvolution using cell2location - plots
# using merged reference clusters
# Lukas Weber, Jun 2022
###################################################################
library(SpatialExperiment)
library(here)
library(ggplot2... |
e490e3b810592a2ad809224f488290ef65e55b23077754458b293ac21ac3b810 | R | 3,763 | 114 |
library(randomForest)
library(caTools)
#function to apply to each module, computed diffusion mop, saves some plots
ApplyDiffusionMap<-function(seuratData, genes, find.branch=T){
#subset genes only
dat<-seuratData@assays[['RNA']]@data
reducedDat<-dat[genes,]
#run diffmap
if(dim(reducedDat)[1]<100){
dm... |
5d8f514d14338d8fc2d84f956b9f840e8222b3be5ec5591404fc6eabe5d08a38 | R | 3,765 | 89 | ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors = F)
## packages for data table processing/plotting
library(data.table)
library(tidyverse)
library(RRHO2)
library(here)
library(broom)
DATADIR='data/tidy_data/compare_to_Glud1tg_microarra... |
14c73b313e7f1949d35699852cd360bde9cab2b9597ebeca12f7b0f700f18614 | R | 3,772 | 80 | # Use the contract.vertices function with the membership vector that the community detection method provides, followed by simplify. In particular:
# 1. Assign a numeric vertex attribute with a value of 1 to each vertex as follows: V(g)$size = 1
# 2. Assign a numeric edge attribute with a value of 1 to each edge as f... |
0746b2472c5065003d4c27538e8701f193c5abdefffa2d3cac75547f11237669 | R | 3,778 | 81 | #Script to take GSEA results and create GO bubble plots
#set workding directory
setwd("/Users/bryanteefy/Dropbox/2023_Killifish_atlas_RNAseq_Data_Descriptor/Figures")
#import libraries
library(dplyr)
library(ggplot2)
library(grid)
#1.Import all GSEA results
#age down
brain_age_down <- read.csv("/Users/bryanteefy/Do... |
e0f4b7d2fcd3c22820dba49c84c85c127dcae7b3f93a5784bd0fb6a7f813a485 | R | 3,778 | 87 | ---
title: "410 Vglut Total RNA MPRA QC"
author: "Stephen P Plassmeyer"
date: "7/14/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
source('../../../code/mpra_tools/mpra_tools.r')
```
# Load and Format Data
```{r}
compiled_counts <- fread('../../../data/compiled_counts... |
59645fad6b0ebaaf79c2f13e10adb310a6b080d5e98899f3e68b0c3cacabe3ee | R | 3,779 | 119 | DEScoreClassify <- function(obj, DEGenes, markerList, className, specWeight=F, reannotate=F, ...){
celltypeList<-list()
reannotation<-vector(length = length(unique(obj[[className]][,1])))
names(reannotation)<-sort(unique(obj[[className]][,1]))
celltype<-vector(length = length(unique(obj[[className]][,1])))
... |
4d324074eacfc624f29fb9b580639d77e00c686e51ba32e58009fdfae2f4f334 | R | 3,781 | 102 | plotPathways = function(maf, pathways = NULL, fullPathway = FALSE, pathdb = NULL,
removeNonMutated = TRUE, tsgCol = "red", ogCol = "royalblue", fontSize = 0.6, showTumorSampleBarcodes = FALSE, sampleOrder = NULL, SampleNamefontSize = 0.6){
if(is.null(pathdb)){
pathdb <- system.f... |
2cbcda2aecdf229ee927bd35ec517a54ed8decce9d14284d70bccd19f5f4c6b1 | R | 3,785 | 141 | #########################################################
# LC snRNA-seq analyses: Grimm et al. (2004) rodent genes
# Lukas Weber, Oct 2022
#########################################################
library(here)
library(SingleCellExperiment)
library(dplyr)
library(tidyr)
library(forcats)
library(ggplot2)
library(Comp... |
6a029b18f5eaa8f80573757e61fc67a586144c1b7cb84fb1f147b2d782f00aee | R | 3,797 | 110 | #-----------------------------------------------
# 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 ... |
9765e1d8f54b0dc471418498d2fdc030824852377bde2326903a91fb268bc58c | R | 3,815 | 135 | # install.packages("rethomics")
# install.packages("behavr")
# install.packages("devtools")
# install.packages(c('ggetho', 'damr'))
# install.packages("zeitgebr")
# install.packages("sleepr")
# install.packages("ggpubr")
library(devtools)
library(behavr)
library(ggplot2)
library(ggetho)
library(damr)
library(tidyvers... |
6ccc21c15e844714bfae93dacbb615046dff0c54c001494b2043f68b3beaefc4 | R | 3,818 | 116 | 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)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
li... |
3909fea67aad3c81eabd09906eaf04cee0a29e85a298ff16fdb16a6f7e248cbf | R | 3,830 | 97 | ## packages for data table processing
library(tidyverse)
library(stringr)
library(RColorBrewer)
library(data.table)
library(simplifyEnrichment)
library(ComplexHeatmap)
library(here)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFactors = F)
... |
b60ea3566e5d938fc68f5b2cc04b838eb816ce6769a4f3b36ba85abb9ea3c199 | R | 3,834 | 97 | # This function is used to create a sampled dataset.
# It takes as input the (data) dataframe containing the total data,
# (pairedInfo) the dataframe of paired conditions,
# (n1) the number of drugs,
# (n2) the number of extra random conditions
# (n3) the number of extra conditions from the same drugs,
# (cells) the c... |
b9c130825766bb17c256b6c51f36b69ee22385848bfad30ebf0286d8fc768be5 | R | 3,834 | 109 | library(rhdf5)
library(SingleCellExperiment)
library(slingshot, quietly = FALSE)
library("FactoMineR")
library(grDevices)
library(uwot)
library(RColorBrewer)
library(TSCAN)
library(RcppCNPy)
library(reticulate)
np <- import("numpy")
run <- function(method){
npz1 <- np$load(paste0(root,data,"_",method,".npz"))
coun... |
b533f0c432afe65cef3b718124319eae50976a6af5fbbd4012c3426e1757f6a4 | R | 3,856 | 95 | library(phytools)
library(evomap)
library(ape)
library(geiger)
library(ggplot2)
library(nlme)
library(stats)
library(DescTools)
library(smplot2)
setwd("your directory")
##Import tree and data; plot tree
mammals<-read.table("final_compilation with percentage values.R1.csv",header=T,sep=",",row.names=1)
... |
52be8bc0a2d4e1b2ca5be7e5e7ced0a072d53d036644a3aa50aceb45423d8f31 | R | 3,857 | 90 | #' Generate a stratified subsample for a vector given a grouping
#'
#' Use this function to compute LISI scores of one or more labels.
#'
#' @param indexer A vector containing cell barcodes/labels to subsample
#' @param grouping A vector containg a groups to stratify by ( same size as indexer)
#' @param sample_proporti... |
ba024c5f028d9684becc2c6ee54f9ba5db4f77aed3029b79ef5d19facfdd98a2 | R | 3,858 | 89 | parseSWIGNamespaceFile <- function(nspace) {
## SWIG attemtpts to generate a package namespace file, but it is
## very wrong, at least for simpleITK. However it does contain a useful
## list of names that we can work with.
##
## Everything in SimpleITK is done with S4 classes. However the user never
## need... |
4c75d61d62f6fee56b49800b07c035349250c1e2928ccb5f967691a7c45a9b5e | R | 3,859 | 82 | #!/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
library(diffHic, quietly = TRUE, verbose = FALSE)
library(GenomicRanges, quietly = TRUE, verbose = FALSE)
require(edgeR)
cell=args[1]
track=args[2]
message('Working on track: ',track)
n_track=as.numeric(args[3])
chr=args[4]
path=args[5]
mode=args[6]
filter_v=a... |
12ddc0eba6364122b43a3301c0d07dafa21d26dacf66870c598eb43ac374065e | R | 3,866 | 81 | .prepare_mat <- function(mat, FUN = rowMeans) {
# If x is a matrix (rows by cols), transform x to row or column means
if (!is.null(dim(mat))) x = FUN(mat)
# If x is numeric, it will first be sorted.
if (is.numeric(x)) x = sort(x)
return(x)
}
.match_bins <- function(Group, bins) {
.check_arg(ar... |
9fbde4210b0c5f9611404c9deb5bee0635e99fcc4b4bef29ce99a37a14dcee58 | R | 3,868 | 111 | library(argparse)
suppressMessages(library(Seurat))
suppressMessages(library(Signac))
library(ggplot2)
suppressMessages(library(harmony))
parser <- ArgumentParser(description = "process input arguments")
parser$add_argument('--rds', action = "store", type = "character",
nargs = "+", help = "paths to rds files to int... |
0317db5c120a61a58ba7eba65012abe7b4624accbc1f5044233820c967438c7d | R | 3,874 | 110 | ---
title: "Effects of GC Content on Expression and Translational Modalities"
author: "Stephen P Plassmeyer"
date: "5/15/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_... |
e6c48d1844a04315be4e266ab68c45343aad5f015ec1e2dac43bc283ddb09620 | R | 3,885 | 79 | #-----------------------------------------------
# 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 ... |
6507038aec391d94b1feb7b5c5c60cf27716a9bce89438cbda655f93f2a7b819 | R | 3,886 | 94 | 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(data.table)
library(ggsci)
library(ggh4x)
library(here)
DATADIR='data/tidy_data'
## ma... |
f5f543305af7eca713d996c533e34a8397f3ca0574d39c122703438bf1d50c0d | R | 3,891 | 126 | ---
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.heart.feat... |
3db3d2bf7d2ce06fa51c366d1c27b5f3ed29ae799e09e0fc63f38b7cca64616a | R | 3,898 | 131 | library(Seurat)
library(Signac)
library(tradeSeq)
library(RColorBrewer)
library(SingleCellExperiment)
library(tidyverse)
library(ComplexHeatmap)
######## Running tradeSeq ########
## Load tradeSeq input created from Monocle3 results
load('../data_processed/tradeSeq_allneurons_input_0429.rda')
## Parallel computing... |
fca3312e97f2eed1530263538cb15b320d9758471afc722d91e578cdf4434768 | R | 3,899 | 85 | #' A graphical summary of the disease prevalence.
#'
#' Given an object of class \code{comorbidity}, and the characters used to
#' specify the sex, a barplot showing the disease prevalence in general
#' and according to sex is obtained.
#'
#' @param input Object of \code{comorbidity} class.
#' @param maleCode Char... |
55f7de18ef641b78e159b33fd88c6678f69d4886b3ca8fbf5892a1211095657c | R | 3,901 | 106 | # R script that QC & normalize the raw data (Ulirsch et al. 2016)
# This script is mostly based on "RBC_MPRA_CELLv1.Rmd",
# and further modified by Dongwon Lee.
args<-commandArgs(trailingOnly=T)
inputfile<-args[1] #../raw_data/GSE87711_RBC_MPRA_minP_raw.txt.gz
outputfile<-args[2] #"MPRA_minP.norm.txt"
library(readr)... |
1f35f4e313a462abb322a69d2afd3aa8b557426433a0364ae4b36540a0fdff31 | R | 3,904 | 124 |
## Load and prepare the gene expression data for analysis
# Genes in rows (gene symbols are row names), individuals in columns (dummy IDs used as column names)
data <- read.delim("Test_dataset_GSE104954.txt")
## Filter out low-variance (likely non-informative) genes
#MAD - median absolute deviation - used... |
2346d05f7af611cc237f7607753022730a90023c0538c0bfa7e8b4a609965086 | R | 3,916 | 81 | #Function to produce hierarchical clustering dendrogram from clusters (or other groupings) of cells in scRNA
#cds should be monocle object
#group_by can be be any categorical value in pData on which to average values (provide as string)
#feature should be the name of the feature to generate distances from ("expression"... |
9c1ed82b172ffe6a22b5e834dc4e33bc214de7940569526f960755e364cfdc2c | R | 3,924 | 110 | ---
title: "R Notebook"
output: html_notebook
---
# Set Up
```{r setup}
knitr::opts_knit$set(root.dir = normalizePath("../.."))
```
# Imports
```{r}
library(MatchIt)
library(dplyr)
library(ggplot2)
library(gplots)
```
```{r}
matched.ttests = function(subjects.matched, feature.tag) {
features = colnames(subjects.ma... |
213249f99757cf24c62857f55f1f6da257dcdcdcf33dda8a0d719f4736703e85 | R | 3,927 | 93 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(RColorBrewer)
library(rcartocolor)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
library(future)
## gene expression heatmap plots
library(Nebulosa)
ss <- function(x, pattern, slot = 1,... |
eecad7bb46d193e5359aa1b28eaa0476c2fd2d51d4660926339e5545df99bb73 | R | 3,928 | 91 | 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(data.table)
library(ggsci)
library(here)
DATADIR='data/tidy_data'
## make for this sub... |
8e657f71a311b151b10758e94bad493fab5eb61c4bb7ac3b94e0108a8056f983 | R | 3,937 | 108 | library(AUCell)
library(readxl)
library(tidyverse)
library(here)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
library(future)
library(BiocParallel)
library(doParallel)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(str... |
034643d63ec79fb4f65345dd0ad5f30adec5120670117531d68eb1d47002f157 | R | 3,938 | 101 | 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(data.table)
library(ggsci)
library(here)
library(ggvenn) # devtools::install_github("ya... |
3badc89d5e04c06b09ebf8f917dea0a9a070175fddbcc1ac52fa2b2d5148156d | R | 3,938 | 127 | #Repel points (shift points 40% to their inter cluster distance.)
shiftPoints = function(clust, leftDist, rightDist){
if(nrow(clust) == 1){
clust$pos2 = clust$pos
return(clust)
} else if(nrow(clust) == 2){
#if distance is huge between right and left clusters, bring it down to 50.
leftDist = ifels... |
8410e9050ab3cae2d838b096ac5c790c755fc8aa1b3aebd1724cc1e9b861e2f8 | R | 3,943 | 108 | ##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 subset metadata----
lmmp <- readRDS(here("tc_lmmp_p20.rds"))
# pData(lmmp) <- pData(lmmp... |
d0189c80268565cdbe2f693634faf3d7463091477c1805a434fd97e33f69a6e4 | R | 3,945 | 108 | #' compare two GISTIC objects
#' @details Performs fisher test on 2x2 contingency table generated from two GISTIC objects
#'
#' @param g1 first \code{\link{GISTIC}} object
#' @param g2 second \code{\link{GISTIC}} object
#' @param g1Name optional name for first cohort
#' @param g2Name optional name for second cohort
#' ... |
be16472e2df1452bc8e8607c12537e6e3b95c48c1077dad83ed9c20149400cfd | R | 3,947 | 87 | library(Seurat)
library(gsdensity)
library(ggplot2) # for plotting
library(ggrepel)
library(reshape2)
library(msigdbr) # for gathering gene sets
# library(copykat)
library(dplyr)
library(future) # for parallel computing
library(future.apply) # for parallel computing
plan(multiprocess, workers = 20)
# 1. get gene-sets
... |
a2efaeaf2c3eaea47a3f87e49c01ce14700f6e782b12f5843ff4e813fcf51834 | R | 3,949 | 107 | 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(dendextend) # install.packages('dendextend') # if don't have
library(ape)... |
7c6954a9a08d39aee7cab51cc255119eef84e6596bc7374f6bfbd815346b0a43 | R | 3,952 | 140 | options(
show.error.messages = F,
error = function() {
cat(geterrmessage(), file = stderr())
q("no", 1, F)
}
)
# we need that to not crash galaxy with an UTF8 error on German LC settings.
loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
suppressPackageStartupMessages({
library(ChIPseeker)
library(... |
9d388a2e2bbb39bbcdfaf51a03ca9dad71f1b0950ed919e0ae4ce6b05b85e886 | R | 3,958 | 92 | #############################################
# First create summed density plots using the script SumByDensity.pl on each file that contains
# pairwise data from each strain comparison
#
#SumByDensity.pl -f $file > $summed
#############################################
# Read in the file (here using Exc-DG cell type)
... |
e8607fe890045289496d0a3019d1f420ed19c7923969e8321ebe441c9e7c3069 | R | 3,963 | 132 | library(stringr)
library(ggplot2)
library(purrr)
library(dplyr)
packdir <- file.path(here::here(), "package/R")
import::from(.from = "sa2Leiden.R", .directory = packdir,
LeidenSum,
newLeidenSumFromPickleFile,
getCluster2Size,
getBarcode2ClusterName)
import::from(.from = "cembav2env.R", .directory = packdir,
... |
3d16b14ddf6f1843920a205767f56ace8a7c43ff263d42d80a27aff9c163095b | R | 3,967 | 114 | 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)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
li... |
0604ad7988092ddf53535254ae2f0b7fcb5428589cf2ec0503c72bcf674b65e4 | R | 3,974 | 213 | ---
title: "Alise IPD all in"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
---
title: "iPD"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
# if (!requireNamespace("BiocManager", quietly = TRUE))
# install.pack... |
f7fd149f9552eed9d48619c10fd52a3ebf85a510636cd3fe55769196c6f4e6fc | R | 3,978 | 114 | ---
title: "R tutorial of scBiG"
output: html_document
---
In this tutorial, we go over how to use basic scBiG functionality in R. If users have done preprocessing with `Seurat` and would like to continue to use scBiG, they can refer to this tutorial. It requires `reticulate` and `sceasy`, please install `reticulate`, ... |
e1547c8213340d66b350cb176c2d934730be7994e6ad5fd508f8d5158bfd07c0 | R | 3,980 | 94 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(RColorBrewer)
library(rcartocolor)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
library(future)
## gene expression heatmap plots
library(Nebulosa)
ss <- function(x, pattern, slot = 1,... |
3a3c37ded2277dc3d5bf71575087801cd7439fc7949aa51e475af896fbe96482 | R | 3,990 | 98 | #Function for transferring labels (cell type annotations) from one cell data set to another, by cell name
#Provided that the cells are the same or are a subset of one another
#Provide both cds and filename to write out plots
#Return newly annotated cell data set
#ToDO: Check that the annotation is actually present
#S... |
788dc4a020e1dec066a11153912783619805f7312dd4a557b3b64de58e9dc065 | R | 4,010 | 117 |
##################################################################################
## From: https://stackoverflow.com/questions/22410606/violin-plot-with-list-input
## and slightly modified to my liking here.
vioplot2<-function (x, ..., range = 1.5, h = NULL, ylim = NULL, names = NULL,
horizonta... |
3808b5daf525eae253c0036b3e20b772894fe3087792978a416202fc5ccc56d2 | R | 4,016 | 97 | 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(data.table)
library(ggsci)
library(ggh4x)
library(here)
DATADIR='data/tidy_data'
## ma... |
7c508570164636e6aff55b5f81478d8adedbcc58d629fd394687f8e46bda0a15 | R | 4,021 | 101 | library(ape)
library(geiger)
library(phytools)
library(evomap)
library(caper)
library(nlme)
setwd("your directory")
##Import tree and data
data<-read.table("final_compilation with percentage values.R1.csv",header=T,sep=",",row.names=1)
data<-data[c(which(data$Order=="Primates"),which(data$Order=="Carnivo... |
ff3db3ab28d85502f20d1cd21d6986a2a5c9efeebcda43c78c296153d33fef8d | R | 4,022 | 120 | rm(list=ls())
library(risonno)
library(ggplot2)
pdf("/tmp/valitation.pdf",w=10,h=5.625)
FILE <- "/data/validation/validation_out.db"
ANNOT_RESULTS <- "/data/validation/rois_t_10s-chunks"
ANNOT_LEVELS <- c("walking","spinning","micro-mov.","immobile")
BEHAVIOUR_MAP <- list(w="walking", r="spinning", g="micro-mov.", i="... |
824e61b34c024388cb536e212fae040507f07a3df7b24b49066862d76de65321 | R | 4,029 | 100 | ## packages for data table processing
library(tidyverse)
library(data.table)
library(here)
library(limma)
library(affy)
library(affycoretools)
library(annotate)
library(mouse4302.db)
library(swfdr)
library(splines)
library(org.Mm.eg.db)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pat... |
3b5199c93d11a661cc5ebbeb6a7cc9b6de86a63661c484e9ef0dca712bb40153 | R | 4,035 | 118 | # density plots for m vs. f and different chromosomes
library(dplyr)
library(ggplot2)
library(here)
library(gridExtra)
multi_counts <- readRDS(here("ckd","multi_aggr_prep","step3_multi_counts.rds"))
# male vs female chrY RNA coverage
plotA <- multi_counts %>%
group_by(seqnames) %>%
mutate(scaled_rna_counts = sca... |
e595bd93be01487d6e85c7ced79a3292efe5442bfa3752d9d887e468504e299b | R | 4,038 | 132 | library(shiny)
# Loading Data
brain.age <- read.csv("data/shiny_brain_age.csv", row.names = NULL)
brain.sex <- read.csv("data/shiny_brain_sex.csv", row.names = NULL)
heart.age <- read.csv("data/shiny_heart_age.csv", row.names = NULL)
heart.sex <- read.csv("data/shiny_heart_sex.csv", row.names = NULL)
muscle.age... |
1b0dce9f6e52265fbcc3421e64740bab559519e285a13b84873f997770b0728d | R | 4,063 | 133 | ---
title: "Figure 2 barplot"
author: "Hao Huang"
date: '2022-09-08'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load
## load packages
```{r}
suppressPackageStartupMessages({
library(SingleCellExperiment)
library(Seurat)
library(caret)
library(kknn)
lib... |
57dea1dae0114581cd4522aa65cade3c58a47a63bcd0371b2c0a0d73e3249aa0 | R | 4,064 | 106 | 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)
## Set working directory to where model outputs are generated
setwd('/ncf/h... |
2a055099ca4f1d7d0ea997ae6814ae0864c765990d1efe1fe562cadb27bb14e0 | R | 4,066 | 121 | # Use the rough annotation from snATACv1 to annotate the snATACv2 data.
# especially check IMN, NN, and CB granule cells.
# this is especially commented in snmc manuscript.
library(dplyr)
library(stringr)
library(tibble)
library(purrr)
library(furrr)
library(progressr)
packdir <- file.path(here::here(), "package/R")
im... |
e4799890b76cfbe67dc0e30f9bd767fb210e62e6d37de4579c45c6c681fe37b0 | R | 4,069 | 131 | #' @name runDeconvolution
#' @rdname runDeconvolution
#' @title Run Deconvolution using NNLS model
#'
#' @aliases runDeconvolution
#'
#' @description This function takes in the mixture data, the trained model & the
#' topic profiles and returns the proportion of each cell type within each
#' mixture
#'
#' @param x... |
6ad96ee128de5afb590603efb535320480032f4311ee4f51ed480b57098c3d1a | R | 4,074 | 102 | # this script will tile windows and count the cellranger-multi atac fragments file (including chrY)
# the windows will are hg38 excluding an encode blacklist
# output is cytoband_counts10k.rds which are 1MB tiles for cells with at least 10k counts in whitelist regions
# SCRATCH1=/mnt/g/scratch
# docker run -it \
# --... |
214478ec037de18e3f5885e6602fce8e85367e7963dae352c90d77395194a894 | R | 4,077 | 103 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(RColorBrewer)
library(rcartocolor)
## main Seurat package snRNA-seq pacakges
library(Seurat)
library(SeuratDisk)
library(future)
## gene expression heatmap plots
library(AUCell)
ss <- function(x, pattern, slot = 1, .... |
477507aa9c608bc30d54a0949b4bd13da5a605c7abab6cc37f9fea18169745d7 | R | 4,077 | 134 | ---
title: "Figure 2 barplot"
author: "Hao Huang"
date: '2022-09-08'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load
## load packages
```{r}
suppressPackageStartupMessages({
library(SingleCellExperiment)
library(Seurat)
library(caret)
library(kknn)
lib... |
a67976592c6a9fb3e38427308f3e22fbb264f3063f8b912d4cf17165b11b5623 | R | 4,078 | 103 | library(slingshot)
library(MAST)
library(parallel)
if(!require(data.table)) {
install.packages(data.table, dependencies = TRUE)
}
library(data.table)
args <- commandArgs(trailingOnly = TRUE)
out_dir <- args[1]
split_num <- args[2]
start_cluster <- args[3]
if(length(args)==4) end_cluster <- args[4]
# set up parallel... |
1037e62ad051570d7529e3190fa7dbef57c8ba0f893c1add2fae120ac079022b | R | 4,091 | 100 | ####################################
#### Studying variance effects #####
####################################
# Last edited: 06/04/23 by LVB
# Description: Model the normalised heteroplasmy variance in two ways:
# - firstly, using a linear model to determine whether mutation, tissue, time
# are explanatory varia... |
fcc22f8b032607ed18fa14125a94a9cfc22e2790a72874694269d543cbbcb06e | R | 4,091 | 117 | # Set up R error handling to go to stderr
options(show.error.messages = FALSE,
error = function() {
cat(geterrmessage(), file = stderr())
q("no", 1, FALSE)})
# Avoid crashing Galaxy with an UTF8 error on German LC settings
loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
# Import required libr... |
8953073b726c5071fe828d4ef5e65437728aa655a9be9fb0fc5c5d04fefd6029 | R | 4,098 | 151 | ##########################################################
# LC snRNA-seq analyses: Mulvey et al. (2018) rodent genes
# Lukas Weber, Oct 2022
##########################################################
library(here)
library(SingleCellExperiment)
library(dplyr)
library(tidyr)
library(forcats)
library(ggplot2)
library(C... |
8d647d7df83e109578880835830b20ff5a8ef98648981250a2f14b1764e43339 | R | 4,098 | 141 | # Description: create AIBS ctd
# Dataset includes:
# Single-nucleus transcriptomes from 49,495 nuclei across multiple human cortical areas.
# Individual layers of cortex were dissected from tissues covering the middle temporal gyrus (MTG), anterior cingulate cortex
# (ACC; also known as the ventral division of medial ... |
04a0380b9656d0118ded1eaa87e893cfd855be3a9beab798afc57d0243e3f8ab | R | 4,099 | 115 | ---
title: "Personlaized cancer report"
author: "Anand Mayakonda"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
toc_depth: 3
toc_float: true
number_sections: true
self_contained: yes
css: corp-styles.css
highlight: pygments
vignette: >
%\VignetteIndexEntry{03: Cancer report}
... |
8fa9d2071f7f37835a7f762cf638a340e14632644ff6d64c887166d2856183d2 | R | 4,108 | 113 | ---
title: "R Notebook"
output: html_notebook
---
---
```{r}
library(ggplot2)
library(RColorBrewer)
library(tidyverse)
library(ggpubr)
library(ggsignif)
library(openxlsx)
library(jcolors)
```
```{r}
#setwd("//atlas.uni.lux/users/isabel.rosety/GBA/Seahorse")
setwd("//atlas.uni.lux/LCSB_Cellular_Biology/16-Our Papers/I... |
e206c62a2000de8c907de4caa7f708c4b5bc9bf70213b78a9efe77e286fb86af | R | 4,112 | 151 | library(rhdf5)
library(SingleCellExperiment)
library(slingshot, quietly = FALSE)
library("FactoMineR")
library(grDevices)
library(uwot)
library(RColorBrewer)
library(Seurat)
library(TSCAN)
library(RcppCNPy)
library(reticulate)
np <- import("numpy")
#read data
read <- function(data){
root<-paste0("../reproducibility/... |
486ad80a9f41bfd43132cefb786cf2b0cb46c5ad9fe52600dcd22075f2012c7a | R | 4,113 | 99 | library(Seurat)
library(Signac)
library(argparse)
parser <- ArgumentParser(description = "process input arguments")
parser$add_argument("--rds", action = "store", type = "character",
help = "path to labeled rds file for integrated object")
parser$add_argument("--prefilter", action = "store_true",
help = "if true,... |
0f8dc9bb6cfdd0e1e73b37575b742e86ddc74c393c01f55bd47628fb228924c2 | R | 4,116 | 118 | #=========================================================================
#
# Copyright NumFOCUS
#
# 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/license... |
b8ef388f4d5562b5404353bb76a1f77b6342d50350e7e5a039754ad3b616b773 | R | 4,119 | 147 | ---
title: "Cleaning VRFs"
output: html_notebook
---
# Set Up
```{r setup}
knitr::opts_knit$set(root.dir = normalizePath("../.."))
```
# Imports
```{r}
library(finalfit)
library(mice)
library(dplyr)
```
# Load Data
```{r}
cardio.data = read.csv("data/cardio.data.csv")
extra.cardio.data = read.csv("data/extra.cardio.... |
75f3028e112a9f8203ad0dfd659179886c89bfe9687103180b24a8d943eb45cf | R | 4,124 | 118 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(data.table)
library(RColorBrewer)
library(data.table)
library(rcartocolor)
library(ComplexUpset) # devtools::install_github("krassowski/complex-upset")
library(cowplot)
library(ggsci)
ss <- function(x, pattern, slot = ... |
4f9e833fd3a4222d0554c614cb2acf4c84e27e616bae45d8aa7decd52d471542 | R | 4,125 | 73 |
#' @title SNN Graph-Based Clustering
#' @description We first build a SNN graph, where each node is a cell connected to its neighbours in high dimensional space. Input multiple values for 'k' and 'ndim' -- the nearest neighbours and number of dimensions to use --- and the function will generate a graph for every combi... |
d730fad41b6ad75db2b31e347b20f49fe2ea4703c1e3dca23e49dc0a5b65510f | R | 4,130 | 145 |
#This script loads in the required data to produce figures, and calls figure plotting scripts
set.seed(123)
## ----receive input from nextflow----------------------------------------------
#Get parameters
args <- commandArgs(TRUE)
path<-args[1]
file<-args[2]
MET<-args[3]
modules<-args[4]
spatial<-args[5]
Allen10x<-a... |
2da0c706bbdf235430b669d5b3609713eaa879a6c5a65c289b24cf893475dff7 | R | 4,134 | 107 | #A function to do gene set enrichment analysis on the amplitude matrix from NMF
# if(!require(clusterProfiler)){
# BiocManager::install("clusterProfiler")
# }
library(clusterProfiler)
library(dplyr)
library(org.Mm.eg.db)
library(DOSE)
library(ggplot2)
library(grid)
library(gridExtra)
#Helper function- given a matr... |
1a16165e665bdd764c6c79eff49b77c251ef5e46559d87b55e224101105db4aa | R | 4,142 | 89 | # this script will analyze the aggregated snATACseq object to identify cell-specific TF that change in activity for LOY vs no LOY
#!/usr/bin/env Rscript
# to run locally:
# SCRATCH1=/mnt/g/scratch
# docker run -it --rm \
# --workdir $HOME \
# -v /mnt/g/ckd:$HOME/ckd \
# -v $HOME:$HOME \
# -v $SCRATCH1:$SCRATCH1 \
# -e... |
cfd517a8ca1c8632c93d342f5f3017998b42fe3cdbb26e51d1489e3d1320d0d9 | R | 4,146 | 105 | library(SingleCellExperiment)
library(monocle3)
library(scrattch.vis)
library(scuttle)
library(here)
library(dplyr)
library(stringr)
source(here("scripts/accessory_functions/prep_sparklines_data.R"))
shorten_gene_lists <- function(gene_vec, n){
gene_list <- list()
while(length(gene_vec) > n){
genes <- list(ge... |
3bb6edd7ab34f251b4ee32aebae3d20339fabf2dcdfd8f2149fd70ce2d325534 | R | 4,156 | 110 | ####╔════ ═══╗####
####💠 Theme 💠####
####╚════ ═══╝####
cli_h2("┗ [CONFIG] Setting project's plots & tables' themes")
#---------------#
####🔺Colors ####
#---------------#
bg_color_light <- "white"
primary_color_light <- "black"
secondary_color_light <- "#0d6efd"
bg_color_dark <- "#222"
primary_color_dark <- "w... |
4702fbd9b0fc5392aea1ac742e912ff0adc149f23bbbc75f92c2605ed5afd6ee | R | 4,162 | 100 | ## packages for data table processing
library(tidyverse)
library(igraph)
library(network)
library(sna)
library(stringr)
library(RColorBrewer)
library(data.table)
library(here)
library(leiden)
ss <- function(x, pattern, slot = 1, ...) {
sapply(strsplit(x = x, split = pattern, ...), '[', slot) }
options(stringsAsFac... |
ea5f78972eb1a015f7fdb1d964dfdc0f5507cc8b359382c4603936d3b8802a6b | R | 4,162 | 118 | ## conda activate r4
## packages for data table processing
library(here)
library(tidyverse)
library(data.table)
library(RColorBrewer)
library(data.table)
library(rcartocolor)
library(ComplexUpset) # devtools::install_github("krassowski/complex-upset")
library(cowplot)
library(ggsci)
ss <- function(x, pattern, slot = ... |
ee972b042488ad5154637dbbefb0fb8e33453d8a13684520a079ce0f5eae82c6 | R | 4,165 | 137 | .validate_bamreadcounts_inputs <- function(bam, positions, mapq, flag) {
# Validate BAM file
if (missing(bam) || is.null(bam) || !is.character(bam) || length(bam) != 1) {
stop("bam must be a single character string specifying the BAM file path")
}
if (!file.exists(bam)) {
stop("BAM file does not exist... |
d20131b9bbbd1581d1e2dfc91dd60998e6cc6f5c9f403d3ff5b8407ad59db5a5 | R | 4,169 | 87 | #'Prepare input files for ASCAT tumor only samples
#' @description Function takes the output from \code{\link{gtMarkers}} and generates `logR` and `BAF` files required for ASCAT analysis.
#' @details The function will filter SNPs with low coverage (default <15), estimate BAF, logR, and generates the input files for ASC... |
0d7a6a4f4a2825a67e1ba3bf4f43db8756585e83084fc630cf98ad44f7af69c9 | R | 4,171 | 119 | #' @title FUNCTION_TITLE
#' @description FUNCTION_DESCRIPTION
#' @param genes PARAM_DESCRIPTION, Default: NULL
#' @return OUTPUT_DESCRIPTION
#' @details DETAILS
#' @examples
#' \dontrun{
#' if(interactive()){
#' #EXAMPLE1
#' }
#' }
#' @seealso
#' \code{\link[Homo.sapiens]{Homo.sapiens}}
#' \code{\link[AnnotationD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.