sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
9e513e4cb2951be9850e287c0623403c12f7b31ba60f5c55df4d50b397695c2c | R | 5,961 | 186 | # EMM with interactions
# https://cran.r-project.org/web/packages/emmeans/vignettes/interactions.html
# auto noise dataset
library(grid)
library(gridExtra)
library(ggplot2)
library(dplyr)
library(cowplot)
library(ggpubr)
library(pals)
# toy example
noise.lm <- lm(noise/10 ~ size * type * side, data = auto.noise)
ano... |
016b1e678357e518244fbc96585fe1a63a5f4b686f9d850404e99387e452376d | R | 5,975 | 150 | ## MILO Excitatory gNfib/x ##
library(Seurat)
library(ggplot2)
library(dplyr)
library(tidyr)
library(ggpubr)
library(miloR)
library(patchwork)
library(SingleCellExperiment)
library(pals)
## load pre-processed seurat:
gNFI_seurat <- readRDS("Processed_Objects/gNFI_merged_seurat_wLabel2.rds")
## ---------------------... |
90d30ea82cebf1016ea4ef4c77ad69f8d5932a1265ab7d48771b0c2fd4f73cd9 | R | 5,975 | 278 | ---
title: "st_area"
output: html_notebook
---
Written by Aunoy Poddar
May 23rd, 2022
# Process the puncta quantified raw data
```{r eval=FALSE}
current_file <- rstudioapi::getActiveDocumentContext()$path
output_file <- stringr::str_replace(current_file, '.Rmd', '.R')
knitr::purl(current_file, output = output_file)
f... |
0f361ba2b5969b99da16e0a98f27e9cfad062f02745d377a6b0e7a90c70ac4aa | R | 5,989 | 195 | ##### First write a funtion to simulation from mixture of normal models
simMixnormal = function(n, prob, mu=c(1:length(prob)), sigma2=rep(1,length(prob))){
if(length(prob)<1) stop("prob must be a vector of length at least 1")
if(length(prob)!=length(mu) || length(prob)!=length(sigma2)){stop("prob, mu and sigm... |
8da6b19a7b72ae44ac0212b770f061cc73f80c4c257f3460779064fe31a2345f | R | 5,989 | 197 | # Code to generate Figure10-fig-suppl1 of the Platynereis 3d connectome paper
# Gaspar Jekely 2023
# load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
# load cell type connectivity ---------------
syn_tb <- readRDS("source_data/... |
440d139abcb4fb9efc601321b316e5c0fa120ef8fe2ecad3634ae3cd94ead3f0 | R | 5,992 | 160 | ---
title: Analysis Script for Study 1 of 'Perceived community alignment increases information
sharing'
author: "Elisa Baek"
output:
html_document:
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
```
This is the custom code that was used for the main a... |
fbb314a52e26e8e5ba99c4991e91b34dc8acda765e07c5881cf797b3ad87385e | R | 6,009 | 110 | #' Function to aggregate p values
#'
#' \code{oPvalAggregate} is supposed to aggregate a input matrix p-values into a vector of aggregated p-values. The aggregate operation is applied to each row of input matrix, each resulting in an aggregated p-value. The method implemented can be based on the order statistics of p-v... |
2506c87e2a7fe0333509391e747cca086d463048e5d70eca4343c4c3cfafe32b | R | 6,010 | 94 | ## correlation analysis ##
library(Seurat)
library(corrplot)
source("Scripts/lib.R")
## load excitatory inhibitory data:
load("Processed_Objects/EXCIT_INHIBIT_cleaned.Rdata")
EXCIT_INHIBIT_cleaned <- SetIdent(EXCIT_INHIBIT_cleaned, value = "Annotated2")
## subset clusters containing apical progenitors:
AP_DV <- subse... |
b12c2536de493da439296023028765e3c5d2dbdfdd0db4f704b9eb0a5d640fb3 | R | 6,019 | 223 | loadSeuratObject = function(filename) {
require(Seurat)
sobj = readRDS(filename)
return(sobj)
}
saveSeuratObject = function(sobj, path) {
require(Seurat)
saveRDS(sobj, file=path)
}
runSeurat = function(data, batch, hvg=2000) {
require(Seurat)
batch_list = SplitObject(data, split.by = batch)
anchors = F... |
19ec02f099a1fb78104cee4ff46d1a45bbf35348d6ee7972b8b0fd034c1c899e | R | 6,077 | 142 | ---
title: "Comparing Read Distributions along the Tha genome by Technology and Condition"
author: "Arpy"
date: '2023-11-20'
output: html_document
---
### Setup
```{r setup-libraries, echo=FALSE, cache=FALSE}
# libraries
library(ggplot2)
library(tidyverse)
library(dplyr)
library(readxl)
library(stringr)
#library(biom... |
7be939045fce62f8ba8e010642a908dec93b0dbfad9802c9d31cf25ecf4be2d4 | R | 6,095 | 142 | ---
title: "Getting Started with TockyRandomForest Analysis"
author: "Dr Masahiro Ono"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
bibliography: TockyRandomForest.bib
link-citations: TRUE
vignette: >
%\VignetteEncoding{UTF-8}
%\VignetteIndexEntry{Getting Started with TockyRandomForest Analysis... |
221a68c7a89af6efd01ef8dd17a35dbe6360279e21afb00e1bf8b68fa5abae6d | R | 6,118 | 212 | ---
title: "Mixed ANOVA Worksheet, 2 Observations, 2 Groups"
output:
html_notebook: default
pdf_document: default
html_document:
df_print: paged
---
```{r, results='hide', echo=FALSE}
library(tidyverse)
library(ggpubr)
library(rstatix)
```
### Instructions:
Copy this template to the desired folder and renam... |
78d792b06dc306c88dfde04d7664588872b66d11f252e87cb930320ed61089e4 | R | 6,131 | 192 | ---
title: Analysis Script for Study 2 of 'Perceived community alignment increases information
sharing'
author: "Elisa Baek"
output:
html_document:
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
```
This is the custom code that was used for the main a... |
71f5d5a9b9cbb1d242eb111d398ef5423b2852522da85cfcf01bf397c7f5e55a | R | 6,165 | 132 | #### load packages ####
targetPackages <- c('tidyverse','arrow','patchwork')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) library(package, character.only... |
c3dc0aa6ca45cfebea1488dbf81b3b775ad1849e8cfca91bd8734a0afea38ed4 | R | 6,167 | 101 | #' Find cell-group communities by constructing and clustering a directed graph using the similarity values calculated by ClusterFoldSimilarity()
#'
#' `findCommunitiesSimmilarity()` Find communities by constructing and clustering graph using the similarity values calculated by ClusterFoldSimilarity().
#'
#' This functi... |
cbdb1c5f4e2cad2ba14246d7aa2ff518f2a229c1d570dd5aa9b0d92e1eaf3f16 | R | 6,177 | 164 | #R/natverse code to generate Figure 5 fig suppl 1 of the Platynereis 3d connectome paper
#Gaspar Jekely 2023
#load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/libraries_functions_and_CATMAID_conn.R")
load_neuron <- function(annotation){
nlapply(read.neurons... |
458ac04565ddc6e14aaeeb9b335b0397dd82c998abe508d27dc1fb3b54092723 | R | 6,184 | 204 | ---
title: "Getting Started with Battenberg"
author: "David Wedge Group"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Getting Started with Battenberg}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
coll... |
bdd0f87c0cbc4280748e3828126ea280895c937303eef364c6c9f1c2667af27a | R | 6,187 | 141 | #' Function to append the confidence information from the source graphs into the target graph
#'
#' \code{eConsensusGraph} is supposed to append the confidence information (extracted from a list of the source graphs) into the target graph. The confidence information is about how often a node (or an edge) in the target ... |
b199888617af77bff2f9fcfb4ef13e7365ff65e69ebbead587a9feab2ae4fff7 | R | 6,229 | 150 | #' Function to convert gene symbols to entrez geneid
#'
#' \code{oSymbol2GeneID} is supposed to convert gene symbols to entrez geneid.
#'
#' @param data an input vector containing gene symbols
#' @param org a character specifying an organism. Currently supported organisms are 'human' and 'mouse'. It can be an object 'E... |
c4fd3b9fb32eae93541de853e0f466f0c926d00d616ce99e2f444b9cf1eb1809 | R | 6,257 | 241 | ---
title: "Analyze sampled wells"
output: github_document
---
```{r message=FALSE}
library(magrittr)
library(tidyverse)
```
Read data
```{r}
backend_file <- "output/subset_BR00106975/backend/subset_BR00106975.rds"
if (file.exists(backend_file)) {
single_cell <- readRDS(backend_file)
} else {
cytoplasm <- rea... |
1048ec3ce7e4c1cd836db3de91506a468066082d3ee901bf316c0de868df8396 | R | 6,292 | 161 | #!/usr/bin/env Rscript
##########################################################################
# Function: Utilitis for MAasLin2
# Author: Yancong Zhang (zhangyc201211@gmail.com)
# Date: 05/29/2019
##########################################################################
# get the options
args <- commandArgs(T)
ac... |
b88f46fa3d9f96d4ea854b4b4e7f20c298cb3ed46909bd02e53760f11733342a | R | 6,340 | 147 | #### load packages ####
targetPackages <- c('tidyverse','arrow','car','lmerTest','ggpmisc','patchwork','ggrepel')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPack... |
93f3ad3f9bb5d80db6cc669f078c334998c75613ce2757bc79eb050f931d171a | R | 6,346 | 98 | ---
title: "CUT&RUN peaks"
output: html_notebook
---
## Read data
```{r}
library(data.table)
library(stringr)
path <- "/Volumes/MyPassport/CRISPRi_L1s/bulk/2_tagdirs/"
samples <- str_remove_all(pattern = "_tagdir", string = list.files(path))
samples <- samples[which(!grepl(pattern = "IgG", samples))]
peaks <- list()
#... |
62a4eaef00ee7b7a2409a8f3bc04b2467dcc90b05925586efeb06f3ed9978c94 | R | 6,360 | 208 | # R code to generate Fig10 fig suppl3 of the 3d Platynereis connectome paper
# Gaspar Jekely 2024
# load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
# plot graph with coordinates from gephi ----------------------------------
#... |
bbdef5ad417e4d02913a29511fe2423e26c6e54f8810ff1d9f289db587095d2a | R | 6,392 | 238 | ---
title: "st_regression"
output: html_notebook
---
```{r}
library(caret)
```
```{r}
scaled_data <- as.data.frame(t(GetAssayData(jy_all, slot = "scale.data")))
scaled_data$Y0 <- -1
scaled_data$Y0[grepl('Dorsal', jy_all$broad_areas)] <- 1
scaled_data$Y0[grepl('Ventral', jy_all$broad_areas)] <- 0
print(sum(scaled_data... |
ff88e73af5b7915302a82996f3788987b7a1f0f95e8fecca5cc7905c8a34703d | R | 6,401 | 142 | #### load packages ####
targetPackages <- c('tidyverse','arrow','patchwork')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) library(package, character.only... |
4570c3bb1a117c166cfffe87d8c600cb975e1fee94ef66e4ee47f513d5de02c6 | R | 6,409 | 157 | #----------------------------------------------
# Clustering high variable genes based on the spatial-seq data
clusterHyoerVariabGenesSp <- function(obj.st.lst, p.sig.gene, sample.size = 10000, up.cut = 2) {
dist.lst <- distScaleToOne(obj.st.lst)
p.sig.gene <- gsub("_", "-", rownames(p.sig.gene))
expr.sub... |
28a36397eeeb1fd5a466a5a9f0e3124bd5db0633d4d0f02535d009401fdd7da0 | R | 6,445 | 143 | #!/bin/env Rscript
library(optparse)
library(Seurat)
library(stringr)
library(dplyr)
library(patchwork)
library(RColorBrewer)
library(data.table)
set.seed(10)
# path <- '/Volumes/My Passport/FetalCortex/Dec2020/1_counts/DA103/'
# sample_name <- "seq098_2"
# outpath <- '/Volumes/My Passport/Gliomas/15.02.21/2_getClust... |
8e0a3660c13c7f1ee61da0d748b89914e052bbae1a2b5edc5076fbedcf5cd642 | R | 6,457 | 137 | #' Laboratory Diagnostics of Patients at University Hospitals
#'
#' This dataset includes laboratory diagnostics for the
#' complete blood counts without differentiation,
#' C-reactive protein and procalictonin for
#' patients admitted at the University Hospital Leipzig from
#' 2014 to 2019 as Training and from 2020 to... |
e7db373f97b7b9302e8ed5f42107193b2cb972a0a8c9cf6b737235b046ce1c4e | R | 6,474 | 177 |
# RFX vis
rfx_vis <- function(model, orig_data){
data <- ranef(model)$subject
data_long <- data %>%
pivot_longer(
cols = names(.), #-c("subject"), #, # Select columns starting with "est"
names_to = "level", # Create the "level" column
values_to = "mean" # Create the "conditional me... |
7010a909c37abe8fec5b51cf08abef15f1dba45a1a8b2e74d9da4bf9b0586c71 | R | 6,500 | 188 | library(magrittr)
OUT_DIR <- "/home/burkhart/Software/reticula/data/aim1/output/"
IN_DIR <- "/home/burkhart/Software/reticula/data/aim2/input/"
# tissue dendrogram comparisons
# misclass
# df <- scale(t(misclass_only.df))
# d <- parallelDist::parallelDist(df, method = "euclidean")
# saveRDS(d,file=paste(OUT... |
5a9fda084cc50933e4465db8253f08829b672214fbde364837d0acfa0a17d21c | R | 6,520 | 193 | library(qs)
library(magrittr)
library(dplyr)
library(Seurat)
library(parallel)
library(stringr)
library(tidyverse)
library(data.table)
library(RANN)
library(igraph)
library(sf)
# library(spatstat)
setwd("~/DATA/BRAIN/STEREO/frequentGraph")
qsFiles <- list.files("../cellbin/filterCellbin/",".qs",full.names = T) %>% s... |
7aef401ac4925d5a9fcc4cd528d3f9a0611e96faa59f1df81f9d658ac2e802dc | R | 6,533 | 233 | library(qs)
library(parallel)
library(magrittr)
library(tidyverse)
library(enrichR)
library(org.Hs.eg.db)
library(rrvgo)
library(ggplot2)
library(ggrastr)
devtools::load_all("~/seurat/") # too many bugs in seurat v5
devtools::load_all("~/ClusterGVis-main/")
setwd("~/cortex/fig2/")
seu_merge <- qread("../STEREO/st_do... |
61cda4503ca464190991140f7e7cfc0a75cb5e865f13af874539e9a0d9880961 | R | 6,541 | 206 | #!/staging/biology/ls807terra/0_Programs/anaconda3/envs/RNAseq_quantTERRA/bin/Rscript
# This script plot expression heatmap
## Options
pacman::p_load("optparse")
option_list = list(
make_option(c("-m", "--matrix"), type="character", default=NULL,
help="Specify a expression table for plotting heatmap.... |
743be2dfc4f3c9900f058ac95d352701f8a88ead8f7b6ae3338df1c0114a0e57 | R | 6,547 | 113 | ## genes linked to maturation (maturation genes) ##
source(file = "Scripts/lib.R")
## load data:
EXCIT_INHIBIT_cleaned_sub <- readRDS(file ="Processed_Objects/EXCIT_INHIBIT_cleaned_sub.rds")
traj_list_merged <- readRDS(file = "Processed_Objects/traj_list_cellIDs_merged2.rds")
## create subsets:
inhibitory_clusters <... |
c400d400130ee6c49c58dbe836ffa0dd61ef7b9d28dd8d739b09d0ce9f9168ab | R | 6,571 | 181 | ---
title: "inferCNV Notebook"
output: html_notebook
---
This is the inferCNV notebook, it would be interesting to expand into the whole SPATA package (assuming it will be less buggy than the inferCNV part)
```{r setup}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = '/home/rstudio/')
source('/home/r... |
3989e9cb5dc7b51dd6bcd9e08ab0cf6c03a88614ec962686c8131f67f6617366 | R | 6,573 | 249 | ---
title: "Select images to print"
---
```{r message=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(glue)
library(magrittr)
library(stringr)
library(tidyverse)
```
# Prepare load_data
```{r prepare_load_data, message=FALSE}
load_data <-
list.files(
"load_data_csv",
pattern = "load_data.csv",
full.n... |
62dcd6ee39eef7fb2dd9e70054d2c2f021519f2accb7fe4f8fd3c3ff4c21201e | R | 6,577 | 114 | #' Function to perform targeted or combinatory attack for an igraph object
#'
#' \code{oAttack} is supposed to perform targeted or combinatory attack for an igraph object, where the effect of node removal is defined as the fraction of network nodes disconnected from the giant component (the largest connected component)... |
e04cf6e37a79cbb632b7085988a3d5d8f48e17033e79a0972de1e1b2ccfab63c | R | 6,602 | 140 | #' Function to visualise enrichment results using dot-like plot
#'
#' \code{oSEAdotplot} is supposed to visualise enrichment results using dot-like plot. It returns a ggplot2 object.
#'
#' @param obj an object of class "eSET" or "eSAD". Alterntively, it can be a data frame having all these columns (named as 'name','adj... |
76d5c3d2adf42218d466bffd58e4258b46daa456422b7e035753099f964f9f84 | R | 6,649 | 151 | #' Morphs phased SNPs from SNP6 input into haplotype blocks
#'
#' This function matches allele frequencies and halplotype info, reverses frequencies by haplotype, combines the output and saves it to disk.
#' @param chrom The chromosome number for which this function should run.
#' @param alleleFreqFile File containing... |
d295fb3f6e1a6f971c6c13c20513b8d3c15ca44d53578d664b76789fd47191a6 | R | 6,663 | 207 | library(tidyverse)
library(GenomicRanges)
library(ggplot2)
library(ggVennDiagram)
library(gridExtra)
library(viridis)
file_paths <- list(
LANCEOTRON = Sys.glob("~/Downloads/Transfers/results_2/LANCEOTRON/*H3K*_R*.bed"),
MACS2 = c(
Sys.glob("~/Downloads/Transfers/results_2/MACS2/*H3K27me3*_R*.broadPeak"),
... |
4c9e4f63d4c85f765091dd5a7d09cff03356b61765798962d416968a080e4cad | R | 6,705 | 178 | ---
title: "Microglia Pathway Analyses"
author: "Greg"
date: '2024-12-10'
output: html_document
---
```{r}
library(tidyverse)
library('gprofiler2')
library('ReactomePA')
library('org.Hs.eg.db')
library('clusterProfiler')
library('enrichplot')
# library(ggtree)
# library(scales)
```
#0. Load Data
```{r load DE microgl... |
39e66fc1e84ea80be8c63fdfac1d8f4583f918875585d4298ec2f0f5bc73008f | R | 6,710 | 171 | # Function to replace lower diagonal values with NA, needed for interaction_plot
upper_diagonal_only <- function(df) {
df %>%
mutate(emmean = ifelse(as.numeric(variable.2) > as.numeric(variable.1), NA, emmean))
}
interaction_plot <- function(means, title_prefix="", omni_data){
# DEBUG
#means = tar_read(slidi... |
1cc080d836aa44c8b1af3c58f86903858c7e37be4b90a235849b514dac001c2e | R | 6,717 | 155 | #' Function to read RDS files
#'
#' \code{oRDS} is supposed to read RDS files.
#'
#' @param RDS which RDS to load. To support the remote reading of a compressed RDS file, it must be compressed via the gzip method
#' @param verbose logical to indicate whether the messages will be displayed in the screen. By default, it ... |
59d6ea11d3bf3f0717678abf07879c68fa1b3a930f613b0cc40daf125e814862 | R | 6,738 | 157 | #' Function to visualise enrichment results using a upset plot
#'
#' \code{oSEAupset} is supposed to visualise enrichment results using a upset plot. The top is the kite plot, and visualised below is the combination matrix for overlapped genes. It returns an object of class "ggplot".
#'
#' @param obj an object of class... |
805154d89bf988e801ca8777a0ff9aabb422ebba855329c492efac3ef1d77ee5 | R | 6,750 | 233 | ---
title: "Inspect profiles"
author: "Shantanu Singh"
date: "June 2021"
---
# Load libraries
```{r message=FALSE}
library(ggplot2)
library(glue)
library(magrittr)
library(tidyverse)
```
# Read profiles
```{r message=FALSE}
batch_id <- "NCP_PILOT_3B"
platemap <- "MAtt_ICC_test"
plate_id <- "MAtt_ICC_test"
profil... |
e59c102c5d4153610817e88a52bf10548adc5cd57a213dec8f613b9f214fccf2 | R | 6,760 | 202 | # Run after running 'analysis/02_diffbind_e16.R'
# Requires .txt files resulting from HOMER findmotifsGenome.pl
# SET UP
library(DiffBind)
library(ChIPseeker)
library(org.Mm.eg.db)
library(TxDb.Mmusculus.UCSC.mm10.knownGene)
library(tidyverse)
library(dplyr)
library(readr)
# LOAD RDS FILE OF DIFFBIND DBA OBJECT: ----... |
c5f387c02f28eda05510eb592dad8c0261d886f459c569b56c47921775d10a20 | R | 6,843 | 189 | # Created by use_targets().
# Follow the comments below to fill in this target script.
# Then follow the manual to check and run the pipeline:
# https://books.ropensci.org/targets/walkthrough.html#inspect-the-pipeline
# Load packages required to define the pipeline:
library(targets)
library(tarchetypes) # e.g. for t... |
1cb79bf8a1b8c8282d363f93bd6665bb08793d2ae7a5702d099dcfdf4dcf0c0b | R | 6,877 | 116 | #Upset plots ----
source("Scripts/lib.R")
library(UpSetR)
library(tidyr)
#Prep
load("Processed_Objects/Seurat_objects_All.Rdata")
##
exp2_vec <- c("FlashTag" = "CFSE", "Reference" = "WT", "TrackerSeq" = "LINEAGE")
tip_vec <- c("Fabp7"="No","Fabp7_Ccnd2"="No","Snhg11"="Snhg11","Npy"="No","Tshz1"="No", "Ube2c"="No", "... |
b9451a5bbaa963770c4262b6a3c2f1391f569d0e5b5aec2e5252f6ce89730808 | R | 6,923 | 173 | ---
title: "Feeding Liquid Interaction Counter(FLIC): Two-Choice"
author: "Kayla Audette"
date: "December 6, 2023"
output:
html_document:
css: styles.css
---
### 1. R Environment
- **Setting Up Environment:**
- The first chunk configures the presentation options for the R code.
- It hides the code and resul... |
87f06a4b37ae350f0376f1b519298f59f64c077aa92284cc6ea4918b402cce3c | R | 6,928 | 173 | context("Rtsne main function")
# Prepare iris dataset
iris_unique <- unique(iris) # Remove duplicates
Xscale<-normalize_input(as.matrix(iris_unique[,1:4]))
distmat <- as.matrix(dist(Xscale))
# Run models to compare to
iter_equal <- 500
test_that("Scaling gives the expected result", {
Xscale2 <- scale(as.matrix(iri... |
5073d020460ba0468b01ebbea4685888eaa2f100534f3919517a27808c6eff8b | R | 6,970 | 155 | ---
title: "Introduction to TockyRandomForest Analysis"
author: "Dr. Masahiro Ono"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
bibliography: TockyRandomForest.bib
csl: apa.csl
link-citations: TRUE
vignette: >
%\VignetteIndexEntry{Introduction to TockyRandomForest Analysis}
%\VignetteEn... |
1cbeeaf789f108f63672c65ec38dc3cf92f35b801de56ff4da0c8d756b0b58a8 | R | 6,972 | 199 | #!/bin/env Rscript
library(yyxMosaicHunter)
library(pryr)
library(stats)
library(data.table)
args<-commandArgs(TRUE)
verbose=TRUE
read_file=args[1]
write_file=args[2]
ignore_single_read_umi=args[3]
vaf=as.numeric(args[4])
MaxBaseQual=93
MaxDepth=1000
set.seed(1)
input=as.data.frame(fread(file=re... |
ec69a1778981934139af3aebe83f8ce4b32f91687d6d84d603be11ac7f2bdb6c | R | 7,003 | 157 | # Functions
# Select columns
choose_correct_columns <- function(name_id, col_to_remove){
if (name_id=="recompute"){
columns_to_delete <- c("multiple", "Experiment.ID", "drug.concentration..uM.", "spheroIndex", "UniqueIdentifier")
columns_new_names <- c("Area"="Area..pix2.", "Perimeter"="Perimeter..... |
32aa550647bb552dbcc1d2e712c19a93b0de79962cc94f4531c11b12591aaf2c | R | 7,022 | 151 | #!/bin/env Rscript
library(optparse)
library(Seurat)
library(stringr)
library(dplyr)
library(RColorBrewer)
library(patchwork)
set.seed(10)
option_list = list(
make_option(c("-i", "--inpath"), type="character", default=NULL,
help="RData paths", metavar="character"),
make_option(c("-s", "--ids"), type... |
8208c041ba1d0e2876cfe0d251e816bea2b44e01e5f809b0c472f6219048845c | R | 7,050 | 188 | #' Function to create a GRanges object given a list of genomic regions
#'
#' \code{oGR} is supposed to create a GRanges object given a list of genomic regions.
#'
#' @param data input genomic regions (GR). If formatted as "chr:start-end" (see the next parameter 'format' below), GR should be provided as a vector in the... |
bea4884a76d047cfc741b2e80978cbaee7df61d8ae5250947be584454b92f22a | R | 7,067 | 250 | ---
title: "Preprocessing"
output: html_notebook
---
# Details
Aunoy Poddar
April 14th, 2023
```{r setup}
require(knitr)
#opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
```
# Import Libraries and declare file paths
```{r}
library(Seurat)
library(tictoc)
library(plyr)
library(dplyr)
library(tidyr)
libr... |
bc9e9030de41b6c079e5b56348cda89e5e075fb0218730972778f296f42a08e1 | R | 7,118 | 187 | #### load packages ####
targetPackages <- c('tidyverse','arrow','patchwork','Gviz','rtracklayer','biomaRt')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) ... |
bd4a79eb1bf5fa11076364306f16924d97b4482993752d3f72330aba2538b818 | R | 7,165 | 191 | # Created by use_targets().
# Follow the comments below to fill in this target script.
# Then follow the manual to check and run the pipeline:
# https://books.ropensci.org/targets/walkthrough.html#inspect-the-pipeline
# Load packages required to define the pipeline:
library(targets)
library(tarchetypes) # e.g. for t... |
4a7f387d4de2eef1549de4de6f33344213f7352d495195ab6189895684f61be5 | R | 7,247 | 156 | #' Function to add coordinates into a graph according to a node attribute
#'
#' \code{oAddCoords} is supposed to add coordinates into a graph according to a node attribute such as community or comp.
#'
#' @param g an object of class "igraph" (or "graphNEL") for a graph with such as a 'community' node attribute
#' @para... |
28796898411485b4c0c98754b2de1d2440c087c69c47ca9ed46922535f64d245 | R | 7,251 | 223 |
subsOnlyCount = function(alStr, pks){
# Convert to data frame. One position per column
alStrDF = as.data.frame(alStr)
alStrDF2 = strsplit(alStrDF[,1], "") %>% do.call(rbind, .) %>% as.data.frame
rownames(alStrDF2) = rownames(alStrDF)
# Remove the positions with N (ancestral sequence could not reconstruc... |
ce2cb8eaba19ed361b8f92050bb1afd8b61eaca22bd4734995a783934e2a2271 | R | 7,254 | 207 | ```{R}
##################################################################
# Plotting motif gene expressoin dotplot
# Reproducibility for Figure.4K
##################################################################
library(Seurat)
library(tidyverse)
library(presto)
library(ComplexHeatmap)
library(circlize)
library(Matri... |
f28d11cf5a860d7c81e4e88a3ea1a510e85c906f75e80f8e2ac621089603e68c | R | 7,257 | 169 | #' Function to visualise enrichment results using a balloon plot
#'
#' \code{oSEAballoon} is supposed to visualise enrichment results using a balloon plot. It returns an object of class "ggplot".
#'
#' @param obj an object of class "eSET" or "eSAD". Alterntively, it can be a tibble having all these columns (named as 'n... |
651386c8ec54f436da67e77665ca8e5d63b772abc70c186f2fb1b50be024d185 | R | 7,280 | 214 | # load nat and all associated packages, incl catmaid
library(natverse)
library(nat)
source("~/R/conn.R")
library(heatmaply)
#use multiple cores
library(doMC)
library(parallel)
####################################
#this section was used to test the potential_synapses algorhythm on PRC and IN1 cells
#read the neurons f... |
9b14e7335943b42ab290099880dfdffbfcec8c52c0736646934013f0dcd87ead | R | 7,388 | 174 |
# treatment codes: A = Sham, B = JM-20, C = MCAO (untreated)
library(dplyr)
library(survival)
library(readxl) # read data
library(brms) # Bayesian (mixed) models
library(survminer) # displaying adjusted survival curves
library(ggplot2)
library(ggborderline) # enhance borders in plots
setwd(dirname(rst... |
0f9280fca1d47e4584c1bb782c85c80b4460eef927a0c0b0d05b2643681bf957 | R | 7,398 | 130 | library(tidyverse)
set("~/cortex/figS1-6/")
wholeMeta <- read.csv("wholeMeta.csv")
# IT
IT <- wholeMeta %>% filter(str_detect(cross_area_subclass, "IT")) %>% group_by(donor, batch, cross_area_subclass) %>% summarise(count = n()) %>% group_by(donor, batch) %>% mutate(per = count /
... |
c882803afcae9c9a0f86b4d57e5c2e78f33aa6ef3335aef2aca2e79ab41f4c4a | R | 7,450 | 202 | ---
title: "plot survival curve"
output: html_document
date: "2024-08-19"
---
```{r}
#################################
#Calculating Cox p value of survival curve
#Reproducibility for Figure.3DEF
#################################
library(readxl)
library(dplyr)
library(survival)
library(survminer)
library(grid) # Requi... |
af4a738131bc21b06dd69798d1eb327650901379c01126aae6dcea7d595db8f5 | R | 7,453 | 183 | ---
title: "Feeding Liquid Interaction Counter(FLIC): One Choice"
author: "Kayla Audette"
date: "December 6, 2023"
output:
html_document:
css: styles.css
---
### 1. R Environment
- **Setting Up Environment:**
- The first chunk configures the presentation options for the R code.
- It hides the c... |
eed7441a2501c6292eca7e25b2cc1a18639e849df5156a3db181883ca7646fff | R | 7,463 | 175 | # human_retina_organoids > GSE235585
library(dplyr)
library(Seurat)
library(ggplot2)
whole <- readRDS("GSE235585_UMAP_QC_240918.rds")
integrated_markers <- c("LHX2", "PAX6", "RAX", "SIX3",
"ELAVL3", "RCVRN",
"VSX2", "MAP2", "SOX2", "NES", "MKI67",
... |
223f7a26074694242e63ac910c022eae6f9e132c107111bc47f75bb6ca841f3a | R | 7,493 | 171 | #' Function to define eQTL genes given a list of SNPs or a customised eQTL mapping data
#'
#' \code{oSNP2eGenes} is supposed to define eQTL genes given a list of SNPs or a customised eQTL mapping data. The eQTL weight is calcualted as Cumulative Distribution Function of negative log-transformed eQTL-reported signficanc... |
507c0f91bc97d3355daf345b88e021d04ea9445484001c32c21dfba47d382120 | R | 7,534 | 220 | ## create source data for each figure ##
library(writexl)
## main figures:
df1 <- read.table("Results/source_data/fig1g.csv", sep = ",")
df2 <- read.table("Results/source_data/fig1h_left.csv", sep = ",", h=T)
df3 <- read.table("Results/source_data/fig1h_right.csv", sep = ",", h=T)
df4 <- read.table("Results/source_da... |
7902e4db52e8eb23796b8416f1fba657623e5fc7ab15ce612b9a8094e4c9c0a5 | R | 7,553 | 196 | # load nat and all associated packages, incl catmaid
library(natverse)
library(nat)
library(heatmaply)
library(factoextra)
conn = source("~/R/conn.R")
#for larger calls we need to use http/1, see https://www.gitmemory.com/issue/natverse/rcatmaid/158/641537466
#for this we configure to http/1.1
conn_http1 = catmaid_log... |
b4d3f8d23483a3b5e4cfb6319f420ff67ba6ef9686b1a6dc136cf492152d98d9 | R | 7,575 | 201 | library(ggplot2)
library(dplyr)
library(targets)
library(RColorBrewer)
# function to add noise to iris
blur_iris <- function(iris){
n_rows <- nrow(iris)
# Standard deviation for the noise
noise_sd <- 0.3
# Generate normally distributed noise
noise <- matrix(rnorm(n_rows * 4, mean = 0, sd = noise_sd), ncol = ... |
5e53ada31bfc0f7a42df3f434dc0f0983e4e87ba34664c5536e7dc9a5f6c138c | R | 7,597 | 108 | #' Function to visualise a graph object of class "igraph"
#'
#' \code{oVisNet} is supposed to visualise a graph object of class "igraph". It also allows vertices/nodes color-coded according to the input pattern.
#'
#' @param g an object of class "igraph"
#' @param pattern a numeric vector used to color-code vertices/n... |
83f456dd36235c23e49c59a347877e390b5452e1ae74c2227431cf1e51c747f6 | R | 7,612 | 146 | #### Analyze SNVs in human brain regions
source("./Settings.R")
### read in the SNV data
SNV.data.lieber <- read.xlsx("./Published_data/Bae_et_al/science.abm6222_tables_s1_s2_s6_and_s7/science.abm6222_table_s2.xlsx", sheet = 4)
SNV.data.yale <- read.xlsx("Published_data/Bae_et_al/science.abm6222_tables_s1_s2_s6_and_... |
0b5397b495019b60289b666760b4dcf715cab4b50019668bab1ac2af689ecda8 | R | 7,621 | 186 | #' @title AssociationTest
#' @description Run association test for features with alternative expressed pairs. Features that have similar expression pattern with the 'test feature' and show different expression pattern with the 'binding feature' will be prioritized.
#' @param object Seurat object
#' @param features Vect... |
179ba1eef6522d098b45be868b376b7a5067327375eb41a491a1036722561543 | R | 7,650 | 188 | # ==============================================================================
# SCRIPT 05: EEG-ONLY SUBSET ANALYSIS
# (originally distributed as eeg_only.R)
# ==============================================================================
#
# PURPOSE:
# Filters the full dataset to EEG-only studies (excludin... |
e119728a10d714496aa0d70c53c1c49b4925fc079f20f706c5b2e20eba59f779 | R | 7,671 | 186 | # scripts for running RCTD and CSIDE method to identify ctDEG
library(spacexr)
library(Seurat)
library(Matrix)
library(doParallel)
library(ggplot2)
library(plyr)
library(data.table)
############################################################################################
#### Inputs
###############################... |
1884669093be20b5d004f54546b4953967764a958436254e59296c0232dc9d3b | R | 7,705 | 208 | miic.reconstruct <- function(input_data = NULL,
is_contextual = NULL,
is_consequence = NULL,
is_continuous = NULL,
black_box = NULL,
n_threads = 1,
... |
d3ef9f055b3401a102d3b8a6648460964c40984202ea5351d28f7f0db4f64212 | R | 7,709 | 144 | # devtools::document()
#' find overlap between sets in a list
#'
#' @param setlist list of character vectors.
#' @param xlim vector with 2 numbers, x axis limits for the venn diagram.
#' @param ylim vector with 2 numbers, y axis limits for the venn diagram.
#' @return list with 2 items: a data.frame with inform... |
d254dffdb35c82294f9cb2bf1f09488dbf4e4ad99e0ae12d2d570c4aa9c80488 | R | 7,726 | 207 | library(Seurat)
library(magrittr)
library(tidyverse)
library(tcltk)
library(harmony)
library(rtracklayer)
library(harmony)
library(MASS)
library(patchwork)
library(FNN)
setwd("~/cortex/SnRNA/3_mergingDatasets/")
devtools::load_all("~/ClusterGVis-main/")
setwd("~/cortex/SnRNA/3_mergingDatasets/")
# initial assignment -... |
c2b2825b30038020a27a6179681c75e82994ded9bd5cf1c325a6b26eda59b0a8 | R | 7,745 | 219 | library(plyr)
library(dplyr)
library(tidyverse)
library(tidyr)
library(reshape2)
library(data.table)
# LDSC regression requires GWAS summary statistics to include certain columns.
# Below code modifies the summary stats for "munge_sumstats.py" script
# Before running this script, please do the following in ... |
3c48c462c1e0873152b4224c57db3386bcd27bd34522c6665fca993d459dbe6b | R | 7,753 | 222 | #' @title geom_splice
#' @description A ggplot2 geom for drawing splice junction arcs.
#' @inheritParams ggplot2::layer
#' @param spline_shape Spline shape parameter, default -0.25.
#' @export
geom_splice <- function(mapping = NULL,
data = NULL,
stat = "splice",
... |
224a599034e4bd6dda7dbed6f5b8c039f82e05240fceed7f8c568c3a38e35774 | R | 7,777 | 237 |
# sandbox
source("R/functions.R")
library(targets)
library(emmeans)
library(coin)
library(ggplot2)
library(magrittr)
library(ggsignif)
hlm <- tar_read(hlm_all_experiments)
summary(hlm)
#ref + hpf + lpf + base + det + ar + emc + mac + experiment
variables = c("ref","hpf","lpf","base","det","ar","emc","mac","experi... |
0fc86319d0905f887f3eaea94776500f9063a40a1b2e19cfee87fc3e9f08da1d | R | 7,810 | 236 | #code to generate the Supplementary figure cell type connectivity matrix of the 3 day old Platynereis larva
#described in Veraszto et al.
#Gaspar Jekely 2022
#load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/Natverse_functions_and_conn.R")
# read all skids ... |
41e42191f83efeebbd4d21701de5a02d697223d6218c9518f9a05e08d9a330c5 | R | 7,823 | 171 | #' Function to do prioritisation through random walk techniques
#'
#' \code{oPier} is supposed to prioritise nodes given an input graph and a list of seed nodes. It implements Random Walk with Restart (RWR) and calculates the affinity score of all nodes in the graph to the seeds. The priority score is the affinity scor... |
ac02ed2c4a8fc7a7a8a4d2710dbd48c2a92b9bd85a5d9c04bf1c2e79574d1986 | R | 7,836 | 308 | #load python environment####
Sys.setenv(HDF5_USE_FILE_LOCKING = "FALSE")
library(rjson)
library(rhdf5)
library(readr)
library(reticulate)
#use_virtualenv('virtual_R42', required = TRUE)
#load data#####
patht="/home/clustor2/ma/w/wt215/RFILES/"
source(paste(patht,"utils_bayNorm.R",sep=''), echo=FALSE)
source(paste(pa... |
4e20d52930c6463a97f89a919c90d44f89595701c667d770c8eed02e3bde7cde | R | 7,870 | 305 | ---
title: "Advanced Usage and Parameter Optimization"
author: "David Wedge Group"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Advanced Usage and Parameter Optimization}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::op... |
159a72064bd3328eab1512546ff0f54030cb5e30480abcc26920aa4d4e6df983 | R | 7,897 | 186 | #' Function to visualise enrichment results using a forest plot
#'
#' \code{oSEAforest} is supposed to visualise enrichment results using a forest plot. A point is colored by the significance level, and a horizontal line for the 95% confidence interval (CI) of odds ratio (OR; the wider the CI, the less reliable). It re... |
5d0642392b52af7f84996ffc74845803fac57acaf3c16f5e6a5c5d40b3721c1d | R | 7,916 | 225 | #' AMPEL Exclusion
#'
#' Run the exclusion as done in the AMPEL project.
#'
#' @param x `data.table`, in the format described in [`sbcdata`]
#' @param time `numeric(2)`, keep just entries between `time[1]` and
#' `time[2]`, in seconds.
#' @return `data.table`, same as `x` but with an added column `Excluded` and
#' 3 at... |
c835c05202e62c2b56956a41f25cb039637de69e049a73913e235fab647fb271 | R | 7,993 | 186 | library(dplyr)
library(parallel)
library(Biostrings)
library(ggpubr)
library(Seurat)
library(reshape2)
library(readr)
library(pheatmap)
library(gridExtra)
plt_pref = 'Fetal_Microglia'
####
## FETAL MICROGLIA RAGs GO
####
# Load fetal cell type markers
ctmarks = readRDS('IN_DATA/PseudoBulk_DARs_MAJ... |
d407cd1e76827b1fe7bca2e8c8d19a79de975879dfa2f987ad5adfd4f695bbf8 | R | 7,995 | 178 | library('GEOquery')
library('limma')
library('minfi')
library('IlluminaHumanMethylationEPICanno.ilm10b4.hg19')
library('sva')
library('IlluminaHumanMethylationEPICmanifest')
library('ENmix')
library('lumi')
library('knitr')
library('sesame')
library('dplyr')
library('BiocParallel')
library('stringr')
#################... |
3f63d8fc5e9df4be1d57fa0a2deaad92f5decd6c3747a0193616b39907a9ebf4 | R | 8,077 | 222 | # R code to generate Figure 3 fig suppl 4of the 3d Platynereis connectome paper
# Uses Natverse/catmaid and accesses the data on CATMAID
# Gaspar Jekely 2022
# load packages, functions and anatomical references
source("code/Natverse_functions_and_conn.R")
# read and plot example cell types ---------------------------... |
03a61dff2f32695e82f9ed8e5cdadb5083a7c2dd59b423274940e58fb2a8e1f2 | R | 8,088 | 187 | IN_DIR <- "/home/burkhart/Software/reticula/data/aim2/input/"
ALPHA <- 0.05
tissue2idx.df <- data.frame(read.table(paste(IN_DIR,"inverted_targets.txt",sep=""),
stringsAsFactors = FALSE),
read.table(paste(IN_DIR,"transformed_targets.txt",sep=""),
... |
2d4bd7aa8b984c67d162d7a231f07ac2136ee0e9b83193ff9bbb32f2a9ad4fde | R | 8,090 | 143 | #### load packages ####
targetPackages <- c('tidyverse','data.table','arrow','car','emmeans','patchwork')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) li... |
37654bf51111b8d537ce9b852ff167101f97acd9dd552c68d410cc36ad651486 | R | 8,130 | 237 | # GSE138002
library(dplyr)
library(Seurat)
library(patchwork)
library(ggplot2)
whole_c <- ReadMtx(mtx = "GSE138002_All_cells.mtx.gz",
cells = "GSE138002_All_barcodes_adj.csv.gz",
features = "GSE138002_features.csv.gz",
feature.column = 1, skip.cell = 1, s... |
e06cbc40de21115636ef9b35588172410f941c937013e572eba20d3eb8692b6b | R | 8,170 | 227 | #### load packages ####
targetPackages <- c('tidyverse','arrow','normentR')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in targetPackages) library(package, character.only ... |
ce0feec989e33a08f42b7822e23d55cd2a8693a5d8c1096a432cfb5a0febb7f3 | R | 8,188 | 192 | library(dplyr)
library(magrittr)
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP050223/output/"
GTEX_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/"
ALPHA <- 0.05
tissue2idx.df <- data.frame(read.table(paste(IN_DIR,"inverted_targets.txt",sep=""),
stringsAsFac... |
f55d5ffac311c25ae7cc2ece6f6ddfa7624131a572631e7296b52500147c0f82 | R | 8,188 | 192 | library(dplyr)
library(magrittr)
IN_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP049593/output/"
GTEX_DIR <- "/home/jgburk/PycharmProjects/reticula/data/gtex/"
ALPHA <- 0.05
tissue2idx.df <- data.frame(read.table(paste(IN_DIR,"inverted_targets.txt",sep=""),
stringsAsFac... |
163258d22285a0be3fabfd6d253ff1b689141a46063e5ab44f51aaf2552d7e3c | R | 8,265 | 179 | #### load packages ####
targetPackages <- c('tidyverse','arrow','car','lme4','lmerTest','ggpmisc','patchwork','normentR')
newPackages <- targetPackages[!(targetPackages %in% installed.packages()[,"Package"])]
if(length(newPackages)) install.packages(newPackages, repos = "http://cran.us.r-project.org")
for(package in ta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.