sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
cc904b84a19845c9b3c0863c5a6ecbd853f5b809b59aa1da99381600da017fc9 | R | 4,203 | 112 | # GSE220661
library(dplyr)
library(Seurat)
library(patchwork)
D028.count <- ReadMtx(mtx = "GSM6808628_D28_matrix.mtx.gz",
cells = "GSM6808628_D28_barcodes.tsv.gz",
features = "GSM6808628_D28_genes.tsv.gz")
D028 <- CreateSeuratObject(counts = D028.count, project = "D028",
... |
2aada50957aa2364e37a6aa3a1e18511784c9610cb1630c4fcd75a6c4993ff55 | R | 4,218 | 85 | #' Function to visualise enrichment results using a upset plot
#'
#' \code{oUpsetAdv} 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 data a data frame. It ... |
aa6e54b65772772f68c6e0645075c6e02438791fd13bce8a78465b8b1edbd35e | R | 4,222 | 106 | ######read files
suppressPackageStartupMessages({
library(MatrixGenerics)
library(Seurat)
library(dplyr)
library(SingleCellExperiment)
library(aricode)
library(mclust)
})
############################## Run seurat ###################################
run_Seurat <- function(sce){
dt.seurat <- CreateSeur... |
fb642216983483dcd48bdafacc15e789c0b172e4cd069ca3c004948a8861d029 | R | 4,233 | 183 | library(qs)
library(magrittr)
library(MASS)
library(tidyverse)
library(sf)
library(Seurat)
library(patchwork)
setwd("/home/luomeng/data/STEREO/AnalysisPlot//")
fileFiles <- list.files("~/data/STEREO/cellbin","qs")
layerColors <-
ggsci::pal_aaas()(10) %>% sort %>% {
c("#CCCCCC", .)
} %>% alpha(alpha = 1) %>% se... |
a4813963ba54112d0658eb6a29454ee9ffb3d55fa8afd00c0f854f48f836eb21 | R | 4,240 | 110 | #############################################################################
## Load required packages
library(overlapping)
#############################################################################
## Read CSVs and subset correlation columns
# Eutheria
eut <- read.csv("cors_alleutheria.csv")
sub_eut <- data.fram... |
c6ecd70430e547c68fd64742e91e3f447d700d4251e125666c504f1002207d17 | R | 4,243 | 141 | # code to generate Figure 4 fig suppl 5 of the 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")
# network plot ----------------------------------
# load network
syn_tb <- rea... |
317f82f9b5cbef57dfe8c8272dec0f0c0bf5769a6fb4c2c0e34622bb0a546727 | R | 4,249 | 106 | #' Function to extract genomic locations given a list of SNPs
#'
#' \code{oSNPlocations} is supposed to extract genomic locations given a list of SNPs.
#'
#' @param data a input vector containing SNPs. SNPs should be provided as dbSNP ID (ie starting with rs). Alternatively, they can be in the format of 'chrN:xxx', whe... |
7abd5968ff4c0e2784f3374084f125e8921aaa6b3d15f03fa6c728db0398beba | R | 4,253 | 103 | # GSE235585
library(dplyr)
library(Seurat)
library(patchwork)
library(ggplot2)
D020 <- read.csv("GSM7505844_D20_counts.csv.gz", row.names = 1)
D020 <- CreateSeuratObject(counts = D020, project = "D020",
min.cells = 3, min.features = 1000)
D033 <- read.csv("GSM7505846_D33_counts.csv.gz", row... |
627a6132c518d32f8cab3cda442eadb0244fcf007505e4aa13cb364ad66e9d8b | R | 4,271 | 101 | # devtools::document()
#' create a venn diagram in ggplot2
#'
#' Imports:
#' ggplot2
#'
#' @inheritParams ggplot2::geom_polygon
#' @inheritParams ggplot2::geom_text
#' @import ggplot2
#'
#' @param setlist list of character vectors.
#' @param textsize integer, defining the text size of the numbers in the gr... |
c8f02dd15dfc44bfeb1851f1448c39b04d746648c590bcf44c4a0989749c43cc | R | 4,289 | 101 | # for diffPlot to work, group names must be part of sample names
# i.e. if group names 'hairpin3', sample names must contains hairpin3
diffPlot <- function (out.DESeq2, alpha = 0.05, outfile = TRUE,fc.cutoff=1)
{
dds <- out.DESeq2$dds
nrow <- 2 # for up and down genes
if (outfile)
pdf(file= "figures/DiffPl... |
31aca618b55e8a14209b4352231adbe7e10ee1a9029890b978e072bd8d3cb651 | R | 4,302 | 77 | #' Creates a graph plot using the similarity values calculated with ClusterFoldSimilarity().
#'
#' `plotClustersGraph()` Creates a graph plot using the similarity values calculated with ClusterFoldSimilarity().
#'
#' This function will calculate a similarity coeficient using the fold changes of shared genes among clust... |
5cdc3698d3ac0ee30573cbfdb7c71f605d28e3ef4cfcf8ac50fbd30699e4966d | R | 4,304 | 84 | #' Find medulla clusters and corresponding edges.
#'
#' This function identifies medulla and cortex spots and their corresponding boundaries based on thymus spatial transcriptomics (ST) data.
#'
#' @param obj.st.lst A list of thymus spatial seurat objects.
#' @param medulla.genes A vector of genes associated with the m... |
517aa04970a23fcc741d2ea3237090c1bb9f8daf8960fc0d1d61e0bdba10063d | R | 4,314 | 122 | #' Calculate the percentage difference in methylation detectable from the specified number of samples
#'
#' @param betasOrSDs - the name of an r matrix object containing either:
# 1) a normalised betas matrix of cell type specific DNA methylation data (sites as rows and samples as columns), or
# 2) a matrix of standard... |
84739fdf82905ff01f7e657d42cddf663a48a3db700e74916cf6baedf463a06e | R | 4,314 | 112 | #### merge the neigboring bins whose log2 copy ratio are very close
bin.merge.chr = function(segs,min_diff=0.1,adjust=0)
{
copy.diff = diff(segs$log2.TumorExpectRatio)
indx = which.min(abs(copy.diff))
seg.tmp = segs
min.diff.tmp = c()
k = 0
while(nrow... |
6e49d8debe02c8d71adeb1a709c302c440f8ebabdecb435cbb9ba804cd5f889c | R | 4,330 | 104 | ---
title: "Subclustering to remove doublets from neurons, mitotic and hNSCs libraries"
author: "Arpy"
date: '2024-09-24'
output: html_document
---
```{r libraries and functions, message=FALSE}
library(tidyverse)
library(Seurat)
library(Matrix)
source("~/OHSU Dropbox/Saunders Lab's shared workspace/arpy/manuscripts/2... |
f6636eea50a08ae74dc1baf74ebf71e3fd974fb6b814132c2848ed76f834425f | R | 4,330 | 127 | library(Seurat)
library(tidyverse)
library(ggplot2)
library(parallel)
library(magrittr)
library(DoubletFinder)
library(rtracklayer)
library(scater)
setwd("~/cortex/SnRNA/1_SnRNA_preprocessing")
matrixFiles <- list.files("0_matrix/","filtered_feature_bc_matrix$",recursive = T,include.dirs = T,full.names = T)
out_dir <- ... |
8d5525dd9d90e169897da3f585bab81d26ddd0d10ad157227a7209058eb3a741 | R | 4,338 | 103 | # Run 'analysis/02_diffbind.R' and 'tables/scripts/tableS3.R' if you haven't already
#source("analysis/02_diffbind_e16.R")
#source("tables/scripts/tableS3.R")
# DEFINE FILES AND OUTPUT DIRS: ------------------------------------------------
# input rds file containing diffbind norm read counts results
rds_normcounts <-... |
34a82a204847a273b5559677199dd115ce22d5b10d8791e02009076869d61181 | R | 4,354 | 127 | #' Read feature count matrix generated by `PISA count`.
#'
#' This function will read Matrix Market files from a directory which generated by `PISA count`.
#'
#' @param mex_dir Feature count outdir generated by `PISA count`.
#' @return Returns a sparse matrix of feature counts or a list of spliced, unspliced, and
#' ... |
524d4cf9bd36f114d5ded56a2eff3bfa7c3a7b3c9fcaaa008fffad0eca5af4bb | R | 4,358 | 105 | ---
title: "Generate Summary File of Kim et al Tha vs Tha4M Bulk RNA Seq"
author: "Arpy"
date: '2024-08-03'
output: html_document
---
### Setup
```{r setup-libraries, echo=FALSE, cache=FALSE}
options(width = 300)
# libraries
library(ggplot2)
library(tidyverse)
library(dplyr)
library(readxl)
library(stringr)
library(... |
138a870d769f629ea2dab217397b9be7b655c0fe252b69022492420e34b78713 | R | 4,377 | 128 | ---
title: Data Processing Flow Charts
output:
rmarkdown::html_vignette:
toc_float: true
vignette: >
%\VignetteIndexEntry{Data Processing Flow Charts}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include = FALSE}
Sys.setenv(LANGUAGE = "en")
library("sbcdata")
sb... |
a4120c84e716f98eaab5459a2566d92ad4a706f5bc7bf5c6922069f2ef021665 | R | 4,408 | 115 | tcrSubgroup <- function(obj, trab.cut = 0, trd.cut = 1, seq = T) {
merged.obj <- subset(obj, tcr == 1)
if (seq) {
trb.seq <- merged.obj$tcr_cdr3s_aa %>%
strsplit(., ";") %>%
lapply(., function(xx) {
xx %>%
grep("TRB:", .) %>%
... |
d41079a55fadb9f206a247968485f15f1078d5f66ece73367d99df6271c661c6 | R | 4,412 | 137 | ---
title: "Calculate PRS"
author: X Shen
date: "\n`r format(Sys.time(), '%d %B, %Y')`"
output: github_document
---
This pipeline calculates PRS for the ENIGMA MDD PRS projects. There are a total of 6 steps in the protocol. Please use a linux machine for the pipeline.
For more information about PRSice 2.0,... |
409628be4726015c8c02cc6e3b0b068b7fbaf5b4fccec380181885b8319f9792 | R | 4,421 | 116 | ---
title: "Sample wells for analysis"
output: github_document
---
Select a few wells from each condition from the `CELLPAINTING` platemap.
```{r load_libraries, message=FALSE}
library(magrittr)
library(tidyverse)
```
```{r load_platemap}
platemap <- read_tsv("metadata/platemaps/CELLPAINTING.txt")
platemap %<>% mut... |
85fa4ee45c37f657579d317cf91ebc4058a75740d4874cc6ceb3c34956bd10d3 | R | 4,433 | 108 | anno_vcf <- function(chr, start, end, ref, alt, strand, vcf, tags, check.alt.only)
{
sl <- .Call("anno_vcf", chr, start, end, ref, alt, strand, vcf, tags, check.alt.only)
sl
}
#' @title varanno
#' @description Annotate genetic variants with VCF databases.
#' @param chr Vector of chromosome names.
#' @param start V... |
de3b8e420e154e0b018e48817581436414b72aac7ff4c7bbf50478534348bc3e | R | 4,439 | 84 | ###########################
#I/O
###########################
library(tidyverse)
library(ggplot2)
library(Seurat)
library(fgsea)
library(pheatmap)
library(cowplot)
library(patchwork)
library(scCustomize)
library(CellChat)
library(msigdbr)
library(org.Hs.eg.db)
library(readxl)
library(openxlsx)
#######################
#... |
42806200ca69363aa350fe48f253a6ae1b9ce7a32fc997e7d367853b81fe2f17 | R | 4,525 | 70 | #' Calculate the gene mean expression Fold Change between all possible combinations of clusters.
#'
#' `pairwiseClusterFoldChange()` returns a list of dataframes containing the pairwise fold changes between all combinations of cluster.
#'
#' This function will perform fold change estimation from the mean feature´s expr... |
9c677ed4ab1ee2497595e34cd2fad3cb09bf0d456794309e1ee89a3dc3437d72 | R | 4,534 | 92 | context("Rtsne neighbor input")
set.seed(101)
# The original iris_matrix has a few tied distances, which alters the order of nearest neighbours.
# This then alters the order of addition when computing various statistics;
# which results in small rounding errors that are amplified across t-SNE iterations.
# Hence, I ha... |
0229247e0de05a4ac9886e170865799e9fc52642976c234e3630323b014e1b40 | R | 4,558 | 99 | #### 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... |
835b396b390742ba1f0b9b9774e5708b81c588a860de6c5822c1cbf4d4462f1d | R | 4,575 | 115 | ## MILO Inhibitory gNfib/x ##
library(Seurat)
library(ggplot2)
library(dplyr)
library(tidyr)
library(ggpubr)
library(miloR)
library(patchwork)
library(SingleCellExperiment)
library(pals)
gNFI_inh_sub <- readRDS("Processed_Objects/gNFI_inhibitory_sub_wLabels_wPseudotime.rds")
## subset for cells that contain a guide... |
a2de62498ab9311b4563f85dd9e8bf5eb2b5163bbac2aa4ef215c319387d4f0c | R | 4,577 | 159 | ---
title: "Subclustering to remove doublets from neurons, mitotic and hNSCs libraries"
author: "Arpy"
date: '2024-09-24'
output: html_document
---
```{r libraries and functions, message=FALSE}
library(tidyverse)
library(Seurat)
library(Matrix)
source("~/OHSU Dropbox/Saunders Lab's shared workspace/arpy/manuscripts/2... |
6d8a1cd26387c9e4876b86e0991a82f673640323c4f3fe677e74dc0899009d2e | R | 4,580 | 153 | # GSE142526
library(dplyr)
library(Seurat)
library(patchwork)
library(ggplot2)
whole_c <- ReadMtx(mtx = "matrix.mtx",
cells = "barcodes.tsv",
features = "genes.tsv")
whole_s <- CreateSeuratObject(counts = whole_c, project = "whole_s",
min.cells = 3,... |
74c8990b247d5fe41f0de4f923584f3f7e2d0fee53f08eaac6f5d709e4cbd5bc | R | 4,603 | 147 | # code to generate Table 1 of the Platynereis 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 cell type graph
syn_tb <- readRDS("source_data/Figure4_source_data1.rds")
#... |
bccaead201ebf12d623575dde7a4a004d1839e4c687a3eee2f1a8c5257aab7ed | R | 4,627 | 121 | # READ DIFFBIND RESULTS FILE WITH GENE ANNOTATIONS AND STATS RESULTS: ----------
diffbind_res_df <- read.csv(csv_diffbind_results)
# SEPARATE BETWEEN CTRL-ENRICHED (Fold < 0) and NICD-ENRICHED (Fold > 0): ------
# This dataframe has everything including the stats info
CTRL_enrich <- diffbind_res_df %>%
dplyr::filte... |
a01b4a29bebe494d8f8662028341307970ce15510087e1792c263d0eee69abd4 | R | 4,637 | 102 | library(qs)
library(parallel)
library(magrittr)
library(tidyverse)
library(org.Hs.eg.db)
setwd("~/cortex/figS1-6/")
devtools::load_all("~/ClusterGVis-main/")
devtools::load_all("~/seurat/")
seu <- qread("../STEREO/st_domain_seu_44slides.qs")
genes <- read.csv("../STEREO/ensemble93gtf_rmXY.csv")
colorPallete <- c(g... |
32e4929f6cee5675de2fbf74901a8c2131a8699f0f41f760714967b16f73751b | R | 4,672 | 144 | ###### load observed data
## specify the VAFs at which model and data are compared; min.vaf must be given in the Run_model.script or defaults to 0.05
if(!exists("min.vaf")){
min.vaf <- 0.05
}
## should the sensitivity model be used?
if(!exists("use.sensitivity")){
use.sensitivity <- T
}
## what lower limit for the ... |
25c81fb5e2094c6d1124b477556db3398d94e7bf576d7cb4de87d50c423f5635 | R | 4,687 | 150 | set.seed(88888888) # maximum luck
library(magrittr)
library(dendextend)
library(parallelDist)
start_time <- Sys.time()
OUT_DIR <- "/home/burkhart/Software/reticula/data/aim1/output/"
#OUT_DIR <- "/Users/burkhajo/Software/reticula/data/aim1/output/"
#gtex_tissue_detail.vec <- readRDS(paste(OUT_DIR,"gtex_tissue_detai... |
760d9ea6afe364eff6644bb7f200bfaf4bff4d075890bc92369cb2914918cd45 | R | 4,709 | 103 |
#### 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.onl... |
8ca4bb4017cbc8dbabbfdcb78b0152357c82573e6f9b79dafaf3d9b8419a6f62 | R | 4,745 | 184 | ###############################################################################
## Script to convert and anonymize internal dataset UKL.
###############################################################################
###############################################################################
## Please source the `... |
3797b0b5c6601932a21c6694be1d67648830510d01808b0e2ad9e4a79f8a8c6e | R | 4,763 | 142 | ######################################################################
# DR
######################################################################
#' @title Definition for S3 class \code{DR}
#' @description \code{DR} has 3 components: df, index, gp.
#' @param df a data frame
#' @param index a data frame
#' @param gp a ... |
b9a4c211fd179ae37234e370edcd30c185fe7b1341692268de622ab03dd30367 | R | 4,776 | 78 | # R script to download selected samples
# Copy code and run on a local machine to initiate download
# Check for dependencies and install if missing
packages <- c("rhdf5")
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
print("Install required packages")
source("https://bioconductor.org/bio... |
c345a8604b262a1763a8a963c4cca02a08de1dc6d7b0cd05d1aaace840458445 | R | 4,793 | 134 | ##########################################
## This code is based on code provided by
## Richa Bharti, Dominik G Grimm, Current challenges and best-practice protocols for microbiome analysis, Briefings in Bioinformatics, Volume 22, Issue 1, January 2021, Pages 178–193, https://doi.org/10.1093/bib/bbz155 at
## https://g... |
9a84f232d4a1d172bc21df42477ec63e29d3fb7da839e8085a3ae471bfd31d2b | R | 4,843 | 170 | library(ggplot2)
library(dplyr)
library(colorspace)
# individualize panel border
data <- tar_read(eegnet_HLM_emm_means_comb)
data <- data %>%
# Apply replacements batchwise across all columns
mutate(variable = recode(variable, !!!replacements)) %>%
# delete the experiment compairson in the full data
filter... |
1dedbf6100daacf8995c50a12233c8f120f487cd3844b3f60733c1b3d919b393 | R | 4,848 | 111 | library(DESeq2)
library(magrittr)
library(EnhancedVolcano)
ALPHA <- 0.05
OUT_DIR <- "/home/jgburk/PycharmProjects/reticula/data/SRP035988/output/"
dds <- readRDS(paste(OUT_DIR,"dds.Rds",sep=""))
dds$Tissue <- relevel(dds$Tissue,
ref= "normal skin")
dds_de <- DESeq(dds,
betaPrior... |
387abec5870618399f2ef68b1d56e2231f291d7e6502ff6ad236a42593576aaf | R | 4,864 | 121 | ## EDF 4 c-g
library(ArchR)
library(parallel)
library(ggplot2)
## load archr project:
archr_proj <- loadArchRProject("/data/mayerlab/neuhaus/dorsal_ventral_comp/cfse_network/results/archr_proj_fAnn_wLabelTransfer/", force = T)
## EDF 4c:
marker_genes <- c("Fabp7","Ccnd2","Dlx5","Gad2","Maf","Ebf1")
p <- plotEmbeddin... |
b462a5a0240f0a7158d81e06b2a62c8d873a95bb305abb7bc95db8d7385de745 | R | 4,878 | 187 | ---
title: Introduction to sbcdata
output:
rmarkdown::html_vignette:
toc_float: true
vignette: >
%\VignetteIndexEntry{Introduction to sbcdata}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
bibliography: bibliography.bib
---
```{r setup, include = FALSE}
Sys.setenv(LANGUAGE = "en"... |
cf9fb505a8f7dcc3bf87aa2610aaa559ad3d060d6d1968632a8524b5efe0a545 | R | 4,894 | 187 | ---
title: Introduction to sbcdata
output:
rmarkdown::html_vignette:
toc_float: true
vignette: >
%\VignetteIndexEntry{Introduction to sbcdata}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
bibliography: bibliography.bib
---
```{r setup, include = FALSE}
Sys.setenv(LANGUAGE = "en"... |
209420360c9d6599ab681f1428478da299f364fb93849227a1765a467a11494d | R | 4,903 | 92 | library(ggVennDiagram)
library(ggplot2); theme_set(theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), text=element_text(size=8, color="black"),
panel.background = element_blank(), axis.line = element_line(colour = "black", size=0.75),
... |
63d3a5ffe093d254f0f7aaec3a29a5326ffe5444b1939d479fbdeb4aa02ec00f | R | 4,924 | 194 | require(plyr)
require(dplyr)
require(tidyverse)
require(tidyr)
require(ggplot2)
require(ggpubr)
require(reshape2)
require(data.table)
require(dplyr)
require(tidyverse)
require(rio)
require(GenomicRanges)
require(data.table)
require(rphast)
require(ape)
require(dplyr)
require(parallel)
require(Biostring... |
1ef12684747e038469fc7e4039bfc77d0ceea2fbf864f3d61ff53fc805edf152 | R | 4,930 | 98 | ############### prepare phenotype data ###############
library("GEOquery")
gse=getGEO(filename="/ix/ksoyeon/YQ/data/schizophrenia/GSE152027_series_matrix.txt")
pheno <- as.data.frame(cbind(id = as.character(map(strsplit(gse$title, split = " "), 1)),
pheno = gse$`status:ch1`,
... |
7c8ce44b9ebd787592248e9ab35e937b8ed551158fcda8918aed0e9176f83181 | R | 4,939 | 89 | #!/staging/biology/ls807terra/0_Programs/anaconda3/envs/RNAseq_quantTERRA/bin/Rscript
## Options
pacman::p_load("optparse")
option_list = list(
make_option(c("-c", "--counts"), type="character", default=NULL,
help="Enter a directory that contains count files.", metavar="COUNTS"),
make_option(c("-o",... |
8fba495899d896b0dc787c6daf44643371e7e85a12f2ccf77ecb7477edc7cdd9 | R | 4,969 | 120 | ##################################################################
# Calculating effect size for MIBI-TOF data
# Reproducibility for Figure.5k
##################################################################
file_path <- sprintf('result_rank/mibi_healthy_edge_rank.csv')
data <- read.csv(file_path)
edge_effectsize <... |
b609d158332cc5d7dad2904e81b1295aee774adafc963971fe01489bd9773ce1 | R | 4,998 | 122 | import scanpy as sc
import pandas as pd
import matplotlib.pyplot as plt
adata = sc.read_h5ad('Visium10X_data_TH.h5ad')
xx = adata[adata.obs['sample'] == 'WSSS_F_IMMsp9838711']
del xx.obsm['NMF']
del xx.obsm['means_cell_abundance_w_sf']
del xx.obsm['q05_cell_abundance_w_sf']
del xx.obsm['q95_cell_abundance_w_sf']
del x... |
c83d9b64c24a232806bdbc2527558765a5583bda8c36fb6fef15f60d0cf7f8e1 | R | 5,009 | 138 | predictor = 'stimrisky_learning_bin' # 'stimrisky_learning_bin' or 'stimsafe_learning_bin' or 'decision_bin'
model_name = 'one_category'
group = 'group1' # 'group1' or 'group2' or name of simulation
simulated_data = '' #data file name
library(rstan)
library(bridgesampling)
library(HDInterval)
options(mc.core... |
4f106f2128f5dbe1356ba1994b59f3ca4514d9620342717d43c4b9d6a074e24f | R | 5,062 | 139 | ---
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}
options(width = 300)
# libraries
library(ggplot2)
library(tidyverse)
library(readxl)
source("~/OHSU Dropbox... |
a8bcd2890bdabaca807cabc7036c0c8e633fd22c1b4d3e6be0d1a820baf3938d | R | 5,092 | 132 | # Copyright 2024 Masahiro Ono
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
b163b9a2a60ec115630490a0d54fbc17db89e59f5dfcf0d3f6c71e93d47d90f3 | R | 5,095 | 117 | # ==============================================================================
# SCRIPT 04: ROI AND FEEDBACK CATEGORY SUBGROUP ANALYSIS (SHORT DATASET)
# (originally distributed as roi_cat_sub.R)
# ==============================================================================
#
# PURPOSE:
# Loads short-form... |
b5d4af31fc04c8918af4c4298811df1c36261e3567c4cb83ceec0725f3177b10 | R | 5,102 | 159 | # R code to generate Figure3 figure suppl 2 in the Platynereis 3d connectome paper
# Gaspar Jekely Feb 2021
# load natverse and other packages, some custom natverse functions and catmaid connectivity info
source("code/libraries_functions_and_CATMAID_conn.R")
# read all annotations for cell types --------------------... |
0b460e39ee6d25c3a85ecae1d56a2db13157426f6c08a455e36efd38fd1b6466 | R | 5,117 | 124 | #### 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... |
b263bc7735eff3165e90d940cf523a6a421bd771a8bfb2e49e64f1265ae92682 | R | 5,118 | 175 | # R code to generate Figure 2 fig suppl 3 of connectome modules in 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 -----------... |
7aa8f13e6d6f8474e88564a8a24c710f1bd38a4d6930d3458d7450b9ea513c74 | R | 5,121 | 108 | #' Function to generate a DAG subgraph induced by input nodes
#'
#' \code{oDAGinduce} is supposed to produce a subgraph induced by input nodes, given a direct acyclic graph (DAG; an ontology). The input is a graph of "igraph", nodes, and the mode defining the paths to the root of DAG. The induced subgraph contains node... |
64fbc9d858297f533f27d8139850e3d9a0eb006953103c873c90c9599613e75b | R | 5,127 | 148 | #!/staging/biology/ls807terra/0_Programs/anaconda3/envs/RNAseq_quantTERRA/bin/Rscript
# This script normalized counts by YARN package.
## Options
pacman::p_load("optparse")
option_list = list(
make_option(c("-i", "--countFile"), type="character", default=NULL,
help="Enter a count table file.", metava... |
642912874537c810828447dad4fd5c3b7d7b2a3809bac0c0e521eaf37cd51905 | R | 5,148 | 118 | #' Function to generate a subgraph induced by given vertices and their k nearest neighbors
#'
#' \code{oNetInduce} is supposed to produce a subgraph induced by given vertices and its k nearest neighbors. The input is a graph of "igraph" or "graphNET" object, a list of the vertices of the graph, and a k value for findin... |
8132849a38952b4ebc6621bc40ec1c34c75478dfe4ab4f497e0aa208de860607 | R | 5,157 | 104 |
#install.packages
library(Seurat)
library(ggplot2)
library(DoubletFinder)
library(dplyr)
library(ggplot2)
library(cowplot)
library(reshape2)
library(MAST)
#load in data from Cell Ranger or other counts data ====
#for loading Cell Ranger counts:
setwd("/athena/ganlab/scratch/lif4001/Human_PGRN/data_analysis/DF_2ndRou... |
a1c5f61faa7c30de4f23001d6dbcd1d8c39beffdb97eddf023a2f597d6ee7e70 | R | 5,163 | 116 | ################################################################################
# Read the individual NIfTI images #
################################################################################
dat = matrix(NA, nrow = length(readNIfTI(X$mri_path[1])[]), ncol = nrow(X))
f... |
17a788e43641c6c9381def460e38aa31e7bf1368358b378420486930e61f2ae8 | R | 5,166 | 151 | #' Calculate the number of samples needed in each group to have power to detect the specified mean difference
#'
#' @param betasOrSDs - the name of an r matrix object containing either:
# 1) a normalised betas matrix of cell type specific DNA methylation data (sites as rows and samples as columns), or
# 2) a matrix of ... |
59e20fd7e8ea05e97eeb128dc7804300e2c6a4209c836e04be3e388a33c9ec55 | R | 5,177 | 148 | #!/staging/biology/ls807terra/0_Programs/anaconda3/envs/RNAseq_quantTERRA/bin/Rscript
# This script normalized counts by YARN package.
## Options
pacman::p_load("optparse")
option_list = list(
make_option(c("-i", "--countFile"), type="character", default=NULL,
help="Enter a count table file.", metava... |
86d3d771edf506bd961a33dff9c62b7708e05d691c852d4626b726e2bd5625bb | R | 5,240 | 144 | # READ DIFFBIND RESULTS FILE WITH GENE ANNOTATIONS AND STATS RESULTS: ----------
diffbind_res_df <- read.csv(csv_diffbind_results)
# SEPARATE BETWEEN CTRL-ENRICHED (Fold < 0) and NICD-ENRICHED (Fold > 0): ------
# This dataframe has everything including the stats info
CTRL_enrich <- diffbind_res_df %>%
dplyr::filte... |
5401d7bde24ef0ae2e5f5a776fb3bb7834274c8756c89f09f6d2b6f5e6618562 | R | 5,244 | 112 | #' Function to define/calculate the level of nodes in a direct acyclic graph (DAG)
#'
#' \code{oDAGlevel} is supposed to calculate the level of nodes, given a direct acyclic graph (DAG; an ontology). The input is a graph of "igraph" or "graphNET" object, and the definition of the node level. The return can be the level... |
b6f44bd4f759b38f5618a09c61434e73c877520687a0dc62d0013b515af9252b | R | 5,298 | 175 | library(tidyverse)
library(qs)
library(parallel)
library(sf)
library(patchwork)
library(magrittr)
setwd("~/data/STEREO/AnalysisPlot/")
layerCut <- read.csv("./range230826.csv")
chipIDS <- read.delim("./cortex_selected") %$% chip
chipRegion <- read.delim("./cortex_selected") %>% {setNames(.$region,.$chip)}
chipID <- ... |
90926eed749c2716f9d835d70e40cbd03470c26c6a7bf5a1d6f6699200b892ee | R | 5,309 | 183 | #Generate Video4 of the Platynereis 3d connectome paper
#Gaspar Jekely 2024
# load nat and all associated packages, incl catmaid
source("code/Natverse_functions_and_conn.R")
#create temp dir to store video frames
mainDir = getwd()
dir.create(file.path(mainDir, "videoframes"), showWarnings = FALSE)
# read volumes --... |
d52826ace8a2729dfac6c045f963018d7597f41376cc11bb92c8daebaf59a165 | R | 5,317 | 145 | rtest <- function(y, group, single.only = FALSE, robust.var = TRUE, maxiter = 5, err.limit = 0.01, espXWX=1e-16, upreg = TRUE) {
# constant matrices
X <- model.matrix(~group, contrasts = list(group = "contr.sum"))
gsize <- table(group)
ng <- length(gsize)
a <- as.factor(1:ng)
X0 <- model.matrix(~a, co... |
7312b4bc55b9c401d40ac9e509c6bdf1f8abcd77baf80399377740b7be7b654b | R | 5,333 | 143 |
volcanoPlot <- function(stats, meas, interaction, thresh=NULL,
log.scale.x=TRUE, labels=TRUE, plot.size=c(5, 7),
size.mult=3, meas.names=NULL) {
# Generate a volcano plot.
#
# Args:
# stats: Data frame generated by \code{\link{filterStats}}.
# meas: Measu... |
1b5be73c66fb2b9b135f117a7ba49db8e364ce5de2980a4f9042ec88f294c159 | R | 5,337 | 104 | ### modified CT 2018/06/20 adding gene symbol changing fold-change
#### modified CT 2018/08/13 changing fold-change when it is less than 0.
### modified CT 2021/02/02 fixed fold-change when it gets rounded to zero
exportResults.DESeq2 <- function (out.DESeq2, group, alpha = 0.05, export = TRUE,fc.cutoff=1)
{
dds <... |
626cd3db57d3a07ec3b4f64fe19107e3e444e67b169da4ce0d23e0fc3f533924 | R | 5,368 | 154 | library(qs)
library(tidyverse)
library(vegan)
library(ggrepel)
library(cowplot)
library(magrittr)
library(scrattch.hicat)
library(ggtree)
library(Seurat)
setwd("~/cortex/fig3/")
sym_id <- readRDS("../SnRNA/1_SnRNA_preprocessing/geneSym_to_geneID.RDS")
id_sym <- read_csv("../SnRNA/1_SnRNA_preprocessing/gene_kept.csv") ... |
ab50c957b9c40e241663e69fb4c0573eb3f4ce8a9459b515d362618bee69fe63 | R | 5,374 | 146 |
# functions to use with the alternative pipeline order
#
get_preprocess_data_ALT <- function(file) {
data <- read_csv(file, col_types = cols())
# change column order for arbitrary reason: None in LPF should be last, but because None is a factor both in hpf in lpf, lpf should come first with none as last entry... |
e70c8ced97c313149f7991b3ec326a9f7a38da5c3e4935b2f70377dca31fc385 | R | 5,380 | 154 | library(ggplot2)
library(dplyr)
library(tidyr)
library(scales)
library(RColorBrewer)
data <- read.delim("./Transfers/snr_summary_all.tsv", header=TRUE, stringsAsFactors=FALSE)
data2 <- data %>%
mutate(
Clean_Sample = case_when(
grepl("_H3K\\w+3_", Sample) ~ gsub("^.*?_H3K\\w+3_", "", Sample),
grepl("... |
0710a9f55088fc8a1859939a624cc2154f5fcc643368ec8bdd2eb36882dd9cc0 | R | 5,392 | 75 | ---
title: "Introduction to Tocky Random Forest Analysis"
author: "Dr. Masahiro Ono"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
bibliography: TockyRandomForest.bib
link-citations: TRUE
vignette: >
%\VignetteIndexEntry{Introduction to Tocky Random Forest Analysis}
%\VignetteEngine{knitr::rmarkdown}
... |
067a1ec90f40720cd9da7a7af972c727653e16c7e1f6626fddfaefa9620fc81e | R | 5,394 | 71 | ---
title: "Single-cell based analysis of Tha astrocyte subpopulations"
author: "Arpy"
date: '2024-09-24'
output: html_document
---
```{r libraries and functions, message=FALSE}
library(tidyverse)
library(readxl)
library(xlsx)
source("~/OHSU Dropbox/Saunders Lab's shared workspace/arpy/manuscripts/2023_Thai2P4M_Feig... |
fe171a0e6780d25aa56e9c7b60649fbadcfbcca8e52fc28f6575a769e2c9e4dd | R | 5,408 | 75 | ---
title: "Introduction to Tocky Random Forest Analysis"
author: "Dr. Masahiro Ono"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
bibliography: TockyRandomForest.bib
link-citations: TRUE
vignette: >
%\VignetteIndexEntry{Introduction to Tocky Random Forest Analysis}
%\VignetteEngine{knitr::rmarkdown}
... |
6b15588a27b45a0096d9695faf5ca7bed6d4a75d6279f882650269004795532b | R | 5,438 | 192 | library(snm)
library(umap)
library(limma)
library(phateR)
library(Biobase)
library(magrittr)
library(SummarizedExperiment)
tissue.vec <- readRDS("~/tissue_vec.Rds")
datasource.vec <- readRDS("~/datasource_vec.Rds")
# combined
combined.df <- readRDS("~/combined_df.Rds")
umap.com <- umap::umap(t(combined.df))
plot(uma... |
ba397af95920b046552bbb2351fe18faf3e898031a0020d39c7319e81408a1a1 | R | 5,499 | 161 | # Run after running 'analysis/02_diffbind_e16.R'
# Requires .txt files resulting from HOMER findmotifsGenome.pl
# DEFINE FILES AND PATHS: ------------------------------------------------------
# input DBA object/ diffbind resultds rds file
rds_dbObj <- "data/processed_data/atacseq_e16/r_objects/diffbind_dbObj.rds"
# ... |
2e7d0b6b3a53eecbd54ce48ba5516c025fecd419774533b2ee22ffb216920147 | R | 5,552 | 149 | ####################################################################################
####################################################################################
####################################################################################
#########################FAHMM###################################... |
6bd8086c9740a118b16f8c409bb934c51145a81a3fbb45d49bb87b01f396926e | R | 5,562 | 112 | library(Battenberg)
library(optparse)
option_list = list(
make_option(c("-a", "--analysis_type"), type="character", default="paired", help="Type of analysis to run: paired, cell_line, germline", metavar="character"),
make_option(c("-s", "--samplename"), type="character", default=NULL, help="Name of the sample to b... |
77933ab3c7f0c791d64adecb4c03f763a2d7244ac8c6803045627445900f639d | R | 5,578 | 150 | # R code to generate Fig 1 fig suppl anatomy 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")
# load skeletons ----------------
Ciliary_band_cell <- nla... |
e44eeb988ae25d06eda022dcdf3300d4cc485f8298b239d3bc86afec2c77a5b2 | R | 5,602 | 84 | #' Boxplot for Batch Effects
#'
#' \code{batchBoxplot} function will plot residuals of linear mixed effects model for a single feature by batch to visualize additive and multiplicative batch effects. Data should be in "long" format. Depends on \code{lme4} package.
#' @param idvar character string that specifies name o... |
a1ee0439a2f3a70db528f85b1ccf58205a634b669e8f10042b277e8b19a54283 | R | 5,695 | 198 | context('Test models with custom objective')
set.seed(1994)
n_threads <- 2
data(agaricus.train, package = 'xgboost')
data(agaricus.test, package = 'xgboost')
dtrain <- xgb.DMatrix(
agaricus.train$data, label = agaricus.train$label, nthread = n_threads
)
dtest <- xgb.DMatrix(
agaricus.test$data, label = agaricus.... |
c11fa8937e027163bd2af6b543630fbdf62c5b8eb0208de5c8bae622a6cfbb70 | R | 5,705 | 131 | ---
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... |
fabf14c16df2df29a4f720ef52f893ee9530e83ebea5e443f101dd1630e77d0c | R | 5,705 | 150 | suppressMessages(library(Matrix))
suppressMessages(library(Seurat))
suppressMessages(library(SeuratWrappers))
suppressMessages(library(monocle3))
suppressMessages(library(patchwork))
suppressMessages(library(ggplot2))
#----------------------------------------------------------------
#' runCellphoneDB
#' Cell-cell co... |
68fe2ccb9462da2dca9e44b924fe7d9c7abd014bef43eff4224b57b1aae6cdd2 | R | 5,738 | 137 | ---
title: "Filtered Microglia Differential Gene Expression Comparison"
author: "Greg"
date: '2024-12-10'
output: html_document
---
```{r}
library(tidyverse)
library(Seurat)
library(Libra)
```
#0. Load Primary Microglia Object
```{r}
mg.seurat <- read_rds('/Users/chingr/OHSU\ Dropbox/Saunders\ Lab\'s\ shared\ worksp... |
defff33277c4191d3fefc9eda832de92c19a566dae2945a4432be007161ee02c | R | 5,744 | 162 | #' Subset a phylogenetic tree on a particular cell type
#'
#' @param tree object of class `phylo`; the current tree. Needs the following additional list elements: `tip.class`, specifying the cell type and `sel.adv.`, specifying the selective advantage of each tip.
#' @param cell.type cell type of interest
#' @return t... |
a185e406e4e24743c39d1158448e7f35d23dfd952de046a4de0d7475b6983964 | R | 5,748 | 172 | library(catmaid)
library(tidyverse)
source("~/R/conn.R")
source("code/Natverse_functions_and_conn.R")
# get all skids with annotations decussating, commissural, contralateral
skids_decussating <- catmaid_skids("annotation:^decussating$", pid = pid)
skids_commissural <- catmaid_skids("annotation:^commissural$", pid =... |
3be81aa60d2c40d0f63eb0c7269ec9b9d0fdb323925240f88c2c9d274ae3f756 | R | 5,756 | 119 | ## lineage z-score analysis of GE e12/e16 data ##
library(Seurat)
library(ggplot2)
library(pheatmap)
library(gridExtra)
library(RColorBrewer)
## load data:
load("E12_lineage.Rdata")
load("E16_lineage.Rdata")
## clonal distribution per cluster:
E12_lineage$has_cloneID <- !is.na(E12_lineage$cloneID.umi6)
E16_lineage$h... |
4a795efd1b8fe68f859a86c0cb0070853d7a2f9d07a109a2a9095d07171c36cd | R | 5,766 | 198 | #load library#########
source("~/ANA_SOURCE_SHORT.R", echo=FALSE)
#load AUC GOBP M#####
INPUT_SAMPLES=PICK_SAMPLES
LIST_GOBP_M=readRDS('/home/clustor2/ma/w/wt215/PROJECT_ST/AUC_GOBP/LIST_GOBP_M.rds')
LIST_GOBP_M_SUB<-LIST_GOBP_M[INPUT_SAMPLES]
LIST_GOBP_M_SUB<-lapply(LIST_GOBP_M_SUB,function(x){return(x[,Markers_M_G... |
ce7c06645d87c27ead021914718d24f41f315b8fba101e03babfc9271ce40a5e | R | 5,776 | 109 | ---
title: "R Notebook"
output: html_notebook
---
## Metadata and read count matrices
Here we load the metadata of the samples (and split them by experiment and guide), and the TE count matrices (`te_counts` with all counts).
To measure the effect of the CRISPRi guides in the antisense transcription initiated by ORF0... |
219ff5998278822cea27b0a062cc1b14ea60ab871388a294e47d88c63a745c7b | R | 5,803 | 202 | # R code to generate Fig10 fig suppl4 of the 3d Platynereis 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")
# plot graph with coordinates from gephi ----------------------------------
#... |
36062c84ad69235c25e4dad41b82168011c89de91b5a98112ed1e1d35cf42024 | R | 5,809 | 148 | # Review plot_ly function used in https://github.com/joshuaburkhart/reticula/blob/master/src/r/validation/srp035988/pca_and_knn_calculation.R
library(pheatmap)
library(magrittr)
library(dplyr)
library(plotly)
library(ggplot2)
SRC_RXN <- "R-HSA-8956140"
HUB_RXN <- "R-HSA-8956184"
OUT_DIR <- "/home/jgburk/PycharmProjec... |
ed573f431673c618b0c48a68ac513e7ed0b44fd2a53d331da076774f2bc06243 | R | 5,892 | 167 | library(Seurat)
library(SeuratWrappers)
library(tictoc)
library(plyr)
library(dplyr)
library(tidyr)
library(tidyverse)
library(ggplot2)
#library(SeuratObject)
library(pracma)
library(monocle3)
library(future)
options(Seurat.Object.assay.version = "v5")
options(future.globals.maxSize = 8000 * 1024^2)
set.seed(12345)
#... |
6eeeed394af36d9e2073c8fa75680c655d7514abc64a2bf5cfd38a1b7daff761 | R | 5,900 | 85 | #' Plot Individual Subject Trajectories
#'
#' \code{trajPlot} will plot individual subject trajectories for multi-batch longitudinal data. Each line represents a trajectory of observations of a single feature (e.g., left fusiform cortical thickness) over time for an individual subject. Plotting points are coded by bat... |
3a504248ae2cea07dce3f738a7a3887ea5a25a741c819fc78e80a012c1fa9257 | R | 5,959 | 97 | #' Function to infer relations between terms based on shared members
#'
#' \code{oTIG} is supposed to infer relations between terms based on shared members. It returns an object of class "igraph".
#'
#' @param data a tibble with two columns 'name' and 'members' (each is a vector containing members separated by ', '). A... |
43e38a2efd725b314d460ff92aaf1ca139430011eb87742c35d019d7aa0feaf9 | R | 5,960 | 116 | #' @title fitDistLinesByWindows
#'
#' @description Curves of gene expression with spatial distance.
#' @param obj.st.lst A list of spatial seurat objects.
#' @param plot.tar Vector of gene names or metadata column names to plot.
#' @param win Integer specifying the window size for averaging data points.
#' @return ggpl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.