sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
eac5cba3ecd99ec60c7ec54316d9d34bc773a7a5eb1a7da56b8dbf41f3159744
R
5,126
130
--- title: "Visualize spatial importance" author: "Will Townes" output: html_document --- ```{r} library(tidyverse) theme_set(theme_bw()) fp<-file.path pth<-"scrna" plt_pth<-fp(pth,"results/plots") if(!dir.exists(plt_pth)){ dir.create(plt_pth,recursive=TRUE) } #dd<-c("sshippo","visium_brain_sagittal","visium_scra...
eba0de16c0768eb9105509729801463ac19e18c96210aba154c5310eaac678ad
R
5,126
149
#' Validate the input parameters for the load function #' #' TODO Add description of parameters #' @param data A tidy dataframe. #' @param name_x x Column in `data` #' @param name_y y Column in `data` #' @param id_col_params id Column in `data` #' @param colour_params Column in `data` that determines colour grouping #'...
f0f75620b36f9025b2695b0e1f382c48f1517638a6a080e6e4e4271c8596eb20
R
5,137
176
library(Seurat) source('scRef.R') exp_raw_data=read.table('GSE72056_melanoma_single_cell_revised_v2.txt.pure',header=T,row.names=1) tag1=read.table('GSE72056_cnv.txt',header=T,row.names=1) tag2=read.table('GSE72056_tag.txt',header=T,row.names=1) tag1=t(tag1) tag2=t(tag2) tag1[which(tag1!='malignant')]=tag2[which(ta...
5d8dcddeb7295f74a15bc37d41af1a6589da7aaf8fe63e4e5fd825b887b85664
R
5,142
147
# Characterization baseline (REQ-004): the S4 accessor, detail(), rbind() and # coercion surface of richResult, GSEAResult and Annot as produced by richR # 0.1.5. These are exactly the registrations that R/misc.R and R/accessors.R # define twice; the tests exercise whichever definition is live, so that # removing a dup...
065f54ae5911d7301894ee973b2ce101494c1caf6daa98d7d2bbe9e6663ee76b
R
5,144
143
# 07/23/21: Ran through with no errors. # INPUT: # Under PARAMETERS heading: # 1. Choose whether or not you want to save plots out (save variable) # 2. Choose whether you want to plot density maps and individual cells # for clusters with previously-studied markers (Figure 4 currently) or with novel markers (Figure 5...
588e87c6b7d82174e3aada67542943ab8b3b60f1175939558dca99ddd3a5356b
R
5,153
132
#' Central species lookup table used by all species-mapping functions. #' Each row: common name, Bioconductor OrgDb, KEGG 3-letter code, #' msigdbr scientific name, Reactome scientific name. #' @return data.frame with columns: species, dbname, kegg, msigdb, reactome .species_table <- function() { data.frame...
336a2e736b2db212a3d45c0201d6825a1916e132ff2c28f24983a6c4fec4a4ce
R
5,180
116
# setup ------------------------------------------------------------------- library(tidyverse) library(rstatix) library(corrplot) library(formattable) library(webshot) library(htmltools) library(ggstatsplot) library(webr) setwd("/home/eli/Desktop/Neurobiologia/projects/ongoing/verbal.irony/facilitators/experiment.3/") ...
73a0b3f3f58748eabafb460695eae25b3e99a72abd636cd6b1c81487debdcfec
R
5,264
135
## BART: Bayesian Additive Regression Trees ## Copyright (C) 2020 Robert McCulloch and Rodney Sparapani ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or #...
94a12a15e1bd4900a7a997a63d4fd12e3ea70fbcf1ff1c760af0198a0dfaf8c2
R
5,270
153
# This is the R script for batch query # Designed for command line use, given the required packages are installed # # Example usage: # Rscript Batch_query_db.R ./GeoDB ./example/input.csv ./example/output.csv # # ./GeoDB the folder containing the query database generated in previous step # see: Gen_data_proc.R...
91317b391f5fc291ce5a4f2140d7ad977b232a8e8cb4e37d4bbfaa7db81c35c1
R
5,283
132
# Description: script to run coloc analyses using PsychENCODE #---Import data and libraries----------------------------------------- library(BSgenome) library(coloc) library(colochelpR) library(data.table) library(GenomicRanges) library(MafDb.1Kgenomes.phase3.hs37d5) library(tidyverse) RBD_tidy_w_varbeta <- fread...
5fa47590ae8f22d36a9bab77b7ea9be4d9a4980f8ae1fa9297ab3481b547ebf1
R
5,284
142
# Shelli Kesler 7/19/19 # Connectome-based predictive modeling with LOOCV # Adapted from Matlab code Copyright 2015 Xilin Shen and Emily Finn # Reference: Finn ES, et al. Nature Neuroscience 18, 1664-1671. # Uses edge sums for each of 8 networks (Shen, X, et al. 2013. NeuroImage, 82, pp. 403-15.) # Conducts simple lin...
d84ebfe8da0353114dd872edef3a02fb0af602d394e21415a341f6dddd7c3a75
R
5,308
91
library(tidyverse) library(lme4) source("scripts/R/ReadDataMTurk.R") # STATISTICS score evaluation all_score = read.table("results/csv/score-evaluation.csv", header=T, sep=",") l=6 all_score_layer = all_score %>% filter(layer==l)# %>% filter(aq != -1)# %>% filter(aq<=17) dist.interact = lm(scoreByMean ~ aq * age, data...
883a43cb1017915a9ce402cfe682d70b21bc4843be4ad4fa56c64dea01184c6f
R
5,313
125
# setup ------------------------------------------------------------------- library(tidyverse) library(rstatix) library(corrplot) library(formattable) library(webshot) library(htmltools) library(ggstatsplot) library(webr) setwd("/home/eli/Desktop/Neurobiologia/projects/ongoing/verbal.irony/facilitators/experiment.2/") ...
c2c0866facf56e7b8fd2a844c63a2af70da28817c7f591fbb6e34c0e3e3f2ec8
R
5,322
122
source("code/Packages_and_Connection.R") #read the saved visNetwork file from source_data/ ------------------------------ conn_grouped_graph.visn <- readRDS("source_data/Figure3_figure_supplement1_source_data1.rds") # plot grouped graph ---------------------------------- #overwrite group value (partition) with s...
05752c64d4b23195d1f48fe8aa5a42c10b7ddfea9d33f9cebe728228265493a9
R
5,336
165
# ---------------------------------------------------------------------------- # build_human_tree.R # Author: Antoine Beauchamp # Created: March 9th, 2021 # # Build the gene expression tree for the Allen Human Brain Atlas # Packages ------------------------------------------------------------------- suppressPacka...
ffeb4215595e93ae53660eafb87fee46464eea692c338b7d556108ec5fdd7c23
R
5,352
205
--- title: "richR: Functional Enrichment Analysis and Visualization" author: "Kai Guo" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{richR: Functional Enrichment Analysis and Visualization} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, in...
a1446850584fecf1cddc16935a59de020488938db7d1f9852c0fc89004b11146
R
5,367
149
pdf('COM_HEAT.pdf',width=12,height=5) ################################## RESULT=c() setwd('F:/SCREF_COM') source('evaluate.R') result <- evaluate('./OUT/scRef_True_Labels.csv', './OUT/scRef_Pred_Labels.csv') RESULT=cbind(RESULT,result$F1) result <- evaluate('./OUT/scPred_True_Labels.csv', './OUT/scPred_Pred_Labels.cs...
a031e9dcb78d1361865f2878fcba734016209e89a38a281bc947169cf245b64d
R
5,466
136
--- title: "Splice-site level analysis: E-MTAB-599" --- ```{r} #Load in required library library(data.table) ``` ```{r} Data_compiler <- function (filename, annotation, extended){ print("Reading in files") dt <- fread(filename) #RNA-seq raw count table (STAR output .jcount file) isoforms <- fread(a...
fb2d624461ede23ad0598591319855791ab531100168542a121f5f7d04430928
R
5,467
155
#' Plot colocalisations #' #' @param coloc_hits Character. Vector of coloc hits as ensembl ids. #' @param eQTL_GWAS_to_plot Dataframe. Dataframe of p-values for SNPs #' overlapping between GWAS and eQTL. Columns to include: chr, chromosome; #' pos, position; gene, ensembl id; hgnc_symbol, gene symbol; Dataset, whet...
a98e3283992e37a0a28d32ac838774d4cc74a56a2eda3339e55f9a4f59a55793
R
5,472
194
describe("Testing add_swarm_bars_to_raw_plot function", { # Test Case 1: Custom Bar Color Provided test_that("Adds swarm bars with custom color when bars_color is specified", { # Generate dataset dataset <- generate_non_proportional_dataset() # Create dabest_effectsize_obj dabest_effectsize_obj <- ...
17669500d480257d9793c7cb705ef9a0fdc53372bb653d28eafcc39ab763023c
R
5,489
128
--- title: "Comparison of `liger` with `fgsea`" author: "Jean Fan" date: "June 26, 2018" output: rmarkdown::html_document vignette: > %\VignetteIndexEntry{Comparison of liger with fgsea} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- `liger` is just one of many methods for gene set enrichment a...
f00681e5e0ce6f24ec51f87e433fce6dcfee989b2f9e3ef0b4cae26faa46740a
R
5,493
108
#' GO term to offspring mapping #' #' A named list that maps each Gene Ontology term to itself and all of its #' offspring terms, covering the biological process, molecular function and #' cellular component ontologies. #' #' @format A named list of 42,984 character vectors. Each name is a GO #' identifier (for examp...
4381666380442afeddb0caf6ea757bc31b651048d8b960ea32ff111a335208d8
R
5,551
180
setwd("~/Dropbox (ASU)/Placenta/BATCH2_PLACENTA_DECIDUA_ANALYSIS/HISAT_FeatureCounts/batch1_and_batch2/") library(VennDiagram) library(RColorBrewer) PisarskaALL <- read.table("DEGs/pisarska/DEGs_placentas_genes_fdr1_lfc0_NOFPKMFILTER.txt", header = TRUE) WilsonALL <- read.table("DEGs/placentas_batch_1and2/batch_BirthW...
6f85925ff23d3a331e34696ca4ed3a92acf958b3cd3242580c2f0cb6507b1e13
R
5,576
127
#R code to generate Video7 (related to Figure8-figure-supplement1) of the Jasek et al. Platynereis desmosomal connectome paper #Uses Natverse and accesses the data on catmaid #Gaspar Jekely source("code/Packages_and_Connection.R") # Motoneuron plotting ------------------------------------------------------------- M...
b4e45ca8cd6fff0404f1feeeba951122f4cb219259820ecb2dc3f07ad21a26d7
R
5,579
234
#code for Video4 of the Jasek et al 2021 desmosomal connectome paper #Gaspar Jekely source("code/Packages_and_Connection.R") #read the tibble with desmosome ids, xyz coordinates and partners 1 and 2 desmo_with_partners <- read_csv("data/desmo_with_partners.csv") celltype_names <- read.csv("data/non_neuronal_celltype...
b0a7fba578634ff731cc41a52612407094a8dc03653831f39864bcc0c0c25008
R
5,668
108
##' generate network based on Enrichment results ##' @rdname richNetmap ##' @param richRes list of enrichment object ##' @param gene vector contains gene names or dataframe with DEGs information ##' @param top number of terms to display ##' @param top.display top number to display ##' @param pvalue raw p-value cutoff: ...
a4198796da7b467f2eb463d58896ec190cf8d0ed4e5b6a17187f12eb3b1e4f38
R
5,685
130
# SPEC-RICHR-010: separator metacharacters are literal gene delimiters. .review010_annot <- function() { data.frame(GeneID = paste0("G", 1:60), Term = rep(paste0("T", 1:6), each = 10)) } .review010_enrich <- function(x, sep = ",", annot = .review010_annot(), ...) { suppressMessages(enrich(x, annot, pva...
474ec2eed740397044e2223a1c98d55c50bc098188bd0ed93ca90ed3d4b33594
R
5,687
141
library(catmaid) library(tidyverse) source("~/R/conn.R") ################################################################################ # Calculate percentages of desmosomes which are: # - hemidesmosomes # - muscle to muscle # - muscle to muscle, same muscle type # - muscle to muscle, different musc...
1e147e0bdfff64478f239ef4b5a5b193b4cb06fc584b9e1fc46222cbcc745f4b
R
5,693
160
--- title: "Using schex with Seurat" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: github_document: html_preview: true toc: false html_document: df_print: kable theme: united --- This vigettte demonstrates how to run schex on Seurat objects, which aims to provide better plots. If ...
755b91aeed41fa3cd5cdfe5a3e4035ceb99911f7e1df51f2d72cfb651aa2bd01
R
5,757
144
--- title: "Tutorial: Mini-Meta Delta" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Tutorial: Mini-Meta Delta} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, warning = FALSE, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` When scie...
8733c07680004ffb7049b60cea5ce4194292d79a06575dcd09c0617e50ce94b7
R
5,767
125
# Bundled KEGG snapshots (SPEC-RICHR-003 REQ-019, REQ-020): the shipped # kegg.db, module and path objects say when they were retrieved and from which # KEGG version, agree with what their documentation states, and are internally # consistent, so that richLevel, richKEGG and richGSEA attach one hierarchy row # to each ...
843c5af72aff50a1ab918675504c4c69ce3cfa926fdaad26128dc57563493e81
R
5,783
146
# INPUT: # Under PARAMETERS heading: # 1. Choose whether or not you want to save plots out (save variable) # 2. Choose whether you want to plot density maps and individual cells # for clusters with previously-studied markers or with novel markers # using only_novel and only_old parameters # OUTPUTS: # If save set to...
a40a5d8c2a3c88a41e9ff7639b0720ac25e93eb4a5a22f156d605cee244c0375
R
5,796
154
# Shelli Kesler 6/5/19 # Connectome-based predictive modeling with split-sample CV # Adapted from Matlab code Copyright 2015 Xilin Shen and Emily Finn # Reference: Finn ES, et al. Nature Neuroscience 18, 1664-1671. # Uses edge sums for each of 8 networks (Shen, X, et al. 2013. NeuroImage, 82, pp. 403-15.) # Conducts s...
f10595f4d84dd281358fcab69e6ff115a68c6815b3ba2c6b2186aa331dc07e9c
R
5,797
166
# Create a toy dataset to demonstrate usage of the Magellan package. setwd("~/git/Magellan") options(stringsAsFactors = FALSE) library(tidyverse) library(magrittr) library(Seurat) library(Matrix) library(RANN) library(splatterBatch) ## https://github.com/jordansquair/splatter_batch library(scater) library(Magellan) # ...
e191285576b02f9dbc27d2936c7dde63a686313febf8988ea73f9aca0945be7d
R
5,880
238
# Differentially Abundant Features (DAFs) # Load data & functions ---- rm(list = ls()) source("src/load_packages.R") source("src/miscellaneous_funcs.R") source("src/load_phyloseq_obj.R") source("src/metadata_prep_funcs.R") source("src/community_composition_funcs.R") source("src/daf_functions.R") datfiles <- list.files...
b6b992e30f6ee9ded11e9b4af7ba1eac787a0ab76f0ea6999cbaf11d64ff18d2
R
5,885
152
#' Build a MINC array from structure-wise data #' #' @description #' Map a vector of structure-wise values to voxels in an image. #' #' @details #' This function matches the values defined for every region of #' interest (ROI) in an atlas to the voxels that lie within those #' ROIs in an image. This is done eithe...
bf32f7b2e35911c22719d4646b142d585e788ea6255475d850f11a8621f7a8d7
R
5,887
173
# Gut-Brain Module (GBM) and Gut-Metabolic Module (GMM) Analysis rm(list = ls()) source("src/load_packages.R") source("src/load_phyloseq_obj.R") source("src/miscellaneous_funcs.R") source("src/metadata_prep_funcs.R") source("src/community_composition_funcs.R") source("src/daf_functions.R") wkd <- getwd() #-----------...
52a0281ee04ea0546eecb8a150fb68049c922be049f19a24278a9fe13c35eea2
R
5,922
128
##' @importFrom ggplot2 ggplot ##' @importFrom ggplot2 aes ##' @importFrom ggplot2 geom_bar ##' @importFrom ggplot2 element_text ##' @importFrom ggplot2 geom_text ##' @importFrom ggplot2 theme ##' @importFrom ggplot2 scale_fill_gradient ##' @importFrom ggplot2 xlab ##' @importFrom ggplot2 ylab ##' @importFrom ggplot2 y...
bf108e38a59a74044e8c710e3237c10b443697eeee3393ce438ad526ea813095
R
5,925
132
test_that("ORA uses the supplied effective universe for its hypergeometric test", { annot <- data.frame( GeneID = c("A", "B", "B", "C", "D", "E", "F"), Term = c("T1", "T1", "T2", "T2", "T3", "T3", "T3") ) query <- c("A", "B") expected_p <- c(T1 = stats::phyper(1, 2, 2, 2, lower.tail = FALSE), ...
32a48d0da9b8651f93998ec361c96924b14ebe19e1e72e9ff01df4901eb5dc24
R
5,932
197
#R code to generate the Sankey graph in Figure 8 panel B of the 2021 Jasek et al Desmosomal connectome paper source("code/Packages_and_Connection.R") MN_names <- c( "MNacicX", "MNchae", "vMN1-2", "MNbow", "MNwave", "MNbiramous", "MNhose", "MNcrab", "MNladder", "MNspider type1", "MNspider type2", "MNring" ) ...
9f4659edf9bf12696fef66d446486a648e6a52d578b07336fd96367aa3600f33
R
5,943
148
## BART: Bayesian Additive Regression Trees ## Copyright (C) 2020 Robert McCulloch and Rodney Sparapani ## read.trees.R ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of t...
cab3a3f505b87aadc53ca94a6e487ebaebad0650c9f7a35f20ffc4dfa29d4ae3
R
5,954
129
#R code to generate Figure8-figure-supplement1 of the Jasek et al. Platynereis desmosomal connectome paper #Uses Natverse and accesses the data on catmaid #Gaspar Jekely source("code/Packages_and_Connection.R") # Motoneuron plotting ------------------------------------------------------------- MN_names <- c("MNacic...
692512961fc5071ad91233b755a7e750dd6c378fdf039885abd4caee086bfdcf
R
6,002
185
--- title: "Whole-brain comparison of rodent and human brains using spatial transcriptomics" subtitle: "Allen Mouse Brain Atlas legend slice" author: "Antoine Beauchamp" date: 'March 14th, 2022' output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, include = FAL...
b3d613b0b3dabeaad54462f545386ff514aa143e2942f56ba30252b1c4f46a98
R
6,010
122
library(ggplot2) library(hrbrthemes) library(gridExtra) experimentsFolder <- "/Volumes/Bathyscaphe/Mask RCNN for Kelp Detection/Experiments/" # "/Volumes/Jellyfish/Dropbox/Manuscripts/Convolutional Neural Networks for kelp canopy identification/Results/Experiments/" resultsFolder <- "/Volumes/Jellyfish/Dropbox/Manusc...
cdb706c5a02d6d9e1d8fadc38e5a0c12e860a31173e8954bb6f8dc7dbf44e434
R
6,011
256
## ---------------------------------------------------------------- ## Re-exported dplyr / magrittr functions ## ---------------------------------------------------------------- #' @importFrom magrittr %>% #' @export magrittr::`%>%` #' @importFrom magrittr %<>% #' @export magrittr::`%<>%` #' @importFrom dplyr filte...
7d7a70c5e08fe7c30b803cd666469955faff3eac43d23859b6d3d0abbd9d6d61
R
6,013
118
require(mgcv) require(itsadug) require(brms) options(show.signif.stars=FALSE) load('rt_data.rda') ############ ### GAMM ### ############ summary(gam.model <- gam(RT.log ~ (Type + Llama_F + SRT) * Condition + TrialOrder.z + s(Item, bs='re') + s(TrialOrder.z, Participant, bs='fs', m=1), data = rt...
dc5d00b195ceb7acf980f123ada5c21a5449ad87a239f5de3feb27fd2b6c48c3
R
6,017
141
#!/usr/bin/env Rscript ################################################ ################################################ ## REQUIREMENTS ## ################################################ ################################################ ## DIFFERENTIAL TRANSCRIPT EXPRESSION ANALYSIS ...
234fd79c3461ba3f7c1d008b5ea6f9da5361ae111d2666cb60d256554c306eff
R
6,029
236
# @DESCRIPTION: filename # Library ----------------------------------------------------------------- library(magrittr) library(ggplot2) library(patchwork) library(rlang) # src --------------------------------------------------------------------- source(file = "analysis/2022-07-20/script/utils.R") # Load data ----...
8b5ad2cba9833f342c61e8ca9f16933b90c0223f0924d5db51073bc1feca4553
R
6,053
198
############################################################### # Define the tests ############################################################### testgrouplinear = function(y, X, ALTERNATIVE = 'greater') { var.names = c("INTERCEPT", "TIV", "GROUP", "TRAINING", "GROUP_x_TRAINING") contrast.names = c("GROUP_x_TRAI...
43bcba4ff884163721204f268dd1af9ec5d56a25ed0652a9ad06d0894b4c2213
R
6,059
149
#packages to source and details of CATMAID connection rm(list = ls(all.names = TRUE)) #will clear all objects includes hidden objects. gc() #free up memory and report the memory usage. Sys.setenv('R_MAX_VSIZE'=8000000000) # load nat and all associated packages, incl catmaid library(nat) library(catmaid) options(nat....
5cb1c991146cab04f63646de91d547f99ace233775db08cf5f780d825b70255e
R
6,070
156
#' Read gene sets from a GMT file #' #' Reads a Gene Matrix Transposed (GMT) file and returns an Annot object #' for use with \code{enrich()} or \code{richGSEA()}. #' #' @param file path to a GMT file #' @param species species name (default: "custom") #' @param keytype gene ID type in the file (default: "SYMBOL") #' @r...
13fe4d6d0f590603431fabd343cd328162fb19193923d09176399525e74e77fe
R
6,156
177
library(ggplot2) library(tidyverse) figPath = "Z:/projects/Single-cell modeling/figures/" setwd("C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling") ############################################ # Fig 1B - Gene essentiality ############################################ # load data fns = c("d...
b1dcb4a007fc2ec7ca5a1cfb1aeaa9833209b2368ac3489cb32d36a4f06f72f9
R
6,170
150
library(ggplot2) library(glmnet) library(LSD) a=read.csv("experimentResults.csv") round(a,3) results = data.frame(tests = c("B vs B5","B vs BO","B vs B3","B vs BC","BC vs BCO","BC vs B5C", "B3 vs B3M","BC vs BC3M","BC3M vs BC3MS","BC3M vs BC3MD","BC3MS vs BC3MSD"), pvals = c(t.test(a$B, a$B5, paired=T,alternative='le...
9c7d2ae26e70da5d15316c551acee167b81e0cbe1f88580079201ff7716af21f
R
6,179
197
# Shared helpers for the characterization baseline (test-characterization-*.R). # # The characterization tests pin the 0.1.5 behaviour of richR on small # committed fixtures (tests/testthat/fixtures/, regenerated by # fixtures/make-fixtures.R). Every pinned value is recorded with # expect_snapshot_value() / expect_snap...
dd1a8269601e5deee8eb404148dedc02cbf962b926979c0320441963f0137606
R
6,215
153
describe("Testing forest_plot function", { skip_on_cran() # skips all tests below if env var NOT_CRAN=false skip_on_ci() # skips all tests below if env var CI=true np_dataset_1 <- generate_non_proportional_dataset(seed = 1) np_dataset_2 <- generate_non_proportional_dataset(seed = 2) np_dataset_3 <- generate_...
ba2a338a9f390b8bb90619647bcb33c3a183faf8fae26d3cf31c5d6e4b29838c
R
6,248
153
# Characterization baseline (REQ-004): richLevel(), compareResult(), # compareGSEA() (padj = NULL, and non-NULL padj after the SPEC-RICHR-002 B1 fix) # and richCluster(), as produced by richR 0.1.5. Known defects are pinned as # they stand (REQ-005): a later fix must show up as a snapshot change. compare_query_a <- fu...
7808d0b67e9819e6a81cf8dd60155d8fe6ea6d62a6dfc8670a2a598a0f252eb0
R
6,259
158
#' Create 5-layer Keras Model and Fitting Datasets #' #' @inheritParams keras::compile.keras.engine.training.Model #' @inheritParams keras::fit.keras.engine.training.Model #' @param data_list A `list` containing predictor and label matrix of training data and test data. #' Please use [prepare_data] to generate this. #'...
3c88f45bd33ae19d59157c7209565511e82ae6399f966cf0818015f53141984b
R
6,288
166
# This script contains helper functions and a data loading flow # Will load summarized data from Stage I integration, together with user input to plot.csv, samples.csv, and plot.yaml # Note - dots is a summarized data.frame for count plot only; # dots.full is non-summarized data.frame with all the columns; howev...
951662d9d512f859fa9d5116785e40dd979ea2939da3526edd489e4b5a848001
R
6,291
222
source('evaluate.R') DataPath='Zeisel_exp_sc_mat.txt.csv' LabelsPath='./Zeisel_exp_sc_mat_cluster_original.txt.csv' CV_RDataPath='./OUT/CV_folds.RData' OutputDir='./OUT_REV_NOI/' GeneOrderPath = NULL NumGenes = NULL #scPred Seurat 2 ################################### source('./scRNAseq_Benchmark-master/Scripts/rev...
c2ea968d870b6193ce4a6149b5b7b39f2fd26f06ca0c04b95b17928b57ea9ef1
R
6,307
162
library(ggplot2) library(glmnet) library(LSD) a=read.csv("experimentResults.csv") round(a,3) results = data.frame(tests = c("B vs B5","B vs BO","B vs B3","B vs BC","BC vs BCO", "B3 vs B3M","BC vs BC3M","BC3M vs BC3MS","BC3M vs BC3MD","BC3MS vs BC3MSD"), pvals = c(t.test(a$B, a$B5, paired=T,alternative='less')$p.value...
7673813d36adba56f9013b15f94e9197c78ea9c42817d46b71cb077443e2e4f4
R
6,332
91
# Load data source(here::here("code","01_load_data.R")) # Set theme gtsummary::theme_gtsummary_compact() # Create table patientchars <- PWAWM %>% dplyr::select(age, sex, handedness, education, stroke_type, stroke_laterality, stroke_history, stroke_area, stroke_size,...
e5907fb4317d9516eaf36d7bd3873a479f26198cfba66d23dce47efcf5e7b58c
R
6,400
174
## ---------------------------------------------------------------- ## Kappa-related helper functions ## ---------------------------------------------------------------- #' Compute kappa statistic between two gene sets #' @param x comma-separated gene string #' @param y comma-separated gene string #' @param geneall v...
b9fa50bea056df71044a7376e1693e689304a0523d78729f4060938d2c3c34ed
R
6,432
111
# ---------------------------------------------------------------------------- # create_neuro_pairs.R # Author: Antoine Beauchamp # Created: August 4th, 2021 # # Description # ----------- # This script defines a set of canonical neuroanatomical pairs between the # mouse and human brain atlases # Packages -------------...
34613fa776280a73ffb7dee5f0371deb496bc489257284f95829a9745367d4a1
R
6,497
262
library('Seurat') library(dplyr) load('this.RData') ls() exp_ref_mat=a #########PCA######## pca=prcomp(exp_ref_mat,scale=T,center=T) PC1=pca$rotation[,1] PC2=pca$rotation[,2] xmin=min(PC1)-0.1 xmax=max(PC1)+0.1 ymin=min(PC2)-0.1 ymax=max(PC2)+0.1 LABEL=colnames(exp_ref_mat) plot(PC1,PC2,xlim=c(xmin,xmax),ylim=c(ym...
ac488d9c81a7ec1821a981aba2876f07dbeb1bdbe912a3049c053b0a35f268c7
R
6,601
144
# setup ------------------------------------------------------------------- library(tidyverse) library(rstatix) library(webr) library(ggstatsplot) library(ggcorrplot) library(formattable) library(webshot) library(htmltools) setwd("~/Desktop/Neurobiologia/projects/ongoing/verbal.irony/discrepancy/experiment.1/") # read...
96cbd664ad6a5d03b8449cc8507d119ce0a024a6f9cec69df76bfbe47fb7684e
R
6,606
231
#a=read.table('Zeisel_exp_sc_mat.txt',header=T,row.names=1) #write.table(t(a),'Zeisel_exp_sc_mat.txt.csv',quote=F,sep=',',row.names=T,col.names=T) #a=read.table('Zeisel_exp_sc_mat_cluster_original.txt',header=T,row.names=1,sep='\t') #write.table(a,'Zeisel_exp_sc_mat_cluster_original.txt.csv',quote=F,sep=',',row.names=T...
4200ca2e0a0be17731ef4d5597207e4ce7abfa240562604ff8684ab8b9bfa1de
R
6,642
134
#' Plot compare heatmap of Enrichment result among DEG groups #' @importFrom dplyr full_join #' @importFrom dplyr arrange #' @importFrom ggplot2 ggplot #' @importFrom ggplot2 geom_tile #' @importFrom ggplot2 scale_fill_gradient2 #' @importFrom ggplot2 theme #' @importFrom ggplot2 theme_minimal #' @importFrom ggplot2 co...
283a05d8ed565af94223b43d77d9e2be6a5fbea06bcf0cc65668c86bd4279533
R
6,688
147
# 07/23/21: Ran through with no errors. # Only parameter to edit- "save" if you want to save your plots or not. Right now have set to FALSE to prevent overwriting library(tidyverse) library(ggplot2) library(here) ################### ### PARAMETERS #### ################### # TO EDIT: Would you like to save these plot...
d869c63d291e955edf1034551b8419d599ffd8a9540f1521c4d1f09fc3a356b1
R
6,812
186
## BART: Bayesian Additive Regression Trees ## Copyright (C) 2017-2020 Robert McCulloch and Rodney Sparapani ## ip.gbart ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of ...
558483d3dabce1e42814c4f691766cbb12cfec7745772b1b227b71355d0f4d5c
R
6,834
147
setwd( "~/Dropbox (ASU)/Placenta/BATCH2_PLACENTA_DECIDUA_ANALYSIS/HISAT_FeatureCounts/batch1_and_batch2/" ) library(reshape) library(ggpubr) library(ggpubr) library(dplyr) library(lattice) library(car) library(splitstackshape) library(ggrepel) # read in data # df_pvals_decidua_ImmuneDBgenes.txt # df_pvals_term_Immun...
5ab51ecca164dc2c0e99f368079687d44a06dbde9aa43b8223df5add9cef04fa
R
6,857
157
#' Segment features #' #' This function performs image segmentation. #' Returns a list object. #' @param input file path to a valid monochrome 16-bit TIFF. #' @numthresh unsigned integer. Number of threshold that should be used. Default is 8. Increase to pick up more fine grained intensity differences if cellbodies exi...
31cf52b082baced491256c4e0a70e4f5383690ba38e08a5030ffca212cbd8151
R
6,860
219
library(biomaRt) library(tidyr) library(ggplot2) ensembl = useMart(host='uswest.ensembl.org', biomart='ENSEMBL_MART_ENSEMBL', dataset='hsapiens_gene_ensembl') #ensembl75 feb2014.archive. annotations = getBM(attributes=c('ensembl_gene_id', 'external_gene_name','refseq_mrna', "chromosome_name"), mart = ensembl) head(ann...
900372ee29f8464a5c49bce893ec0bf329bcae6803b3d6dfdb45e40a7b5f36a0
R
6,928
165
#! /usr/bin/Rscript ### Data normalization (Livak's method) ### ######################################## Reference ######################################## # "Analysis of relative gene expression data using real-time PCR and the 2^-∆∆Ct method" # Kenneth J. Livak and Thomas D. Schmittgen # Methods, 25, 402-4...
59b6a5eb18535e0ed4ef0b8fd80cbd5b8a80a37bef8fed21c517e4677f36994e
R
6,934
170
# Annotation identity (SPEC-RICHR-003 REQ-001 .. REQ-005). # # One identifier rule for every builder, ORA and GSEA: the gene is column 1; # the identifier is the first of GOALL, PATH, Module, Term present (else column # 2); the label is the column named Annot. ORA results report the identifier in # `Annot` and the labe...
83de2b33dc77af6f1caf6ac8f25f32d1ecc560968d89ddd6e65df4252c6c7cc6
R
6,934
196
library(ggplot2) library(scales) # for muted function library(tidyverse) figPath = "Z:/projects/Single-cell modeling/figures/" setwd("C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling") library(R.matlab) ################################## # Structural comparison ################################## S_...
1b5c833438b0157f3a0898ed1f5b1c05c3be94981c670cde06a822e61976472d
R
6,942
207
#' @include internal.R #' NULL #' scVI Integration #' @param object A \code{StdAssay} or \code{STDAssay} instance containing #' merged data #' @param features Features to integrate #' @param layers Layers to integrate #' @param conda_env conda environment to run scVI #' @param new.reduction Name under which to store r...
c13f0afe4f469e21dc5eb2f8dad27ff7a7c435aaf43450c81dd239f58247747b
R
6,980
166
#' Pre-processing function for sex classification #' #' The purpose of this function is to process a single cell counts matrix into #' the appropriate format for the \code{classifySex} function. #' #' This function will filter out cells that are unable to be classified due to #' zero counts on *XIST/Xist* and all ...
e4be2558eb3c10d58ce2792b14d5bd7c37201ab8e0f2feacd67852756b6d08d5
R
7,002
236
# This only include the knockoff filter to computer FDR and Power # This master R file includes all the R functions for implementing the knockoff filter # in high-dimensional linear regression with precision matrix of covariates estimated # by the innovated scalable efficient estimation (ISEE) procedure introduced in...
56684a56475bca895b04563b4144415fd21cc8a629b446b1ee7a052a1b04ba1a
R
7,012
226
#' @include internal.R #' NULL # Runs Wilcoxon Rank Sum using the Presto package # # @param data.use Data matrix to test # @param cells.1 Group 1 cells # @param cells.2 Group 2 cells # @param verbose Print a progress bar # @param ... Extra parameters passed to wilcox.test # # @return Returns a p-value ranked matrix of...
6fdc05901fe1aab744c86ab5afaa041c953dcb7fe38afcd34e7894e2616c1ce8
R
7,026
155
#!/usr/bin/env Rscript ################################################ ################################################ ## LOAD LIBRARIES ## ################################################ ################################################ library(optparse) library(ggplot2) library(reshape...
81774ca4a7600c0bec20aec6ae785f41ec2586b8fb90985b01a17c1d80e989f1
R
7,064
164
batch_test_annotation <- function() { data.frame( GeneID = LETTERS[1:6], Term = rep(c("T1", "T2", "T3"), each = 2), Annot = rep(c("Term one", "Term two", "Term three"), each = 2) ) } batch_test_result <- function(genes, cutoff = 0.1) { suppressMessages(richR::enrich( genes, batch_test_annotation(...
1e7953da3bc2958b60e1a90b45b7fdc559b04eb3d6af67ba00ab3e3056a3986a
R
7,086
161
library(ggplot2) library(scales) # for muted function library(tidyverse) figPath = "Z:/projects/Single-cell modeling/figures/" setwd("C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling") library(R.matlab) ################################## # Structural comparison ################################## m...
a755e5dc94fa603e7fc8a72caceda97d6594833a29071a9f781bf305af95d25e
R
7,151
169
#Gating & Clustering # START OF GATING # all gated data set together master_data_all$cluster_id = 0 gateNames = c("Ungated","oligodendrocytes","astrocytes","microglia","endothelial","Dopaminergic-TH","Inhibitory-VGAT") ## To Gate Population. ## if not running FlowSOM gatedIndexes = c() ## visualization master_data_...
c3b1f1d3f534562d1b081f7d1962a44b75d99af4e646a4bff2f1b85be536dca2
R
7,158
184
# TODO add proper documentation print_greeting_header <- function() { dabest_ver <- utils::packageVersion("dabestr") line1 <- paste("DABESTR v", dabest_ver, sep = "") now <- Sys.time() now_hour <- as.integer(format(now, "%H")) if (now_hour < 12) { greeting <- "Good morning!" } else if (now_hour >= 12...
93dc6433089d4e3da5fbdabfd1e81c407c58ba75be9acc8c89eae637f1617d3d
R
7,241
170
# Shared fixtures of the theme tests (SPEC-RICHR-007), built from base R, # testthat and the public API, with no network. # # F-TH two hand-built ORA groups (no tested table): g1 reports A..F, g2 # reports D (another Term) and G (Term NA). Kappa A-B = A-C = D-E = # 0.8224, B-C = 0.6447, every other pair...
1496e11b300bfc47901134c5c563693ec27afc2ee749287ffd0dd9e92d6693cb
R
7,247
174
wd <- getwd() library(Seurat) library(dplyr) library(ggplot2) RG_4884_03 <- Read10X('Y:/CDBLabs-Bioinformatics/Some_Place_Where_Big_Files_Can_Sit/Giger_2022_CellRangerFiles/Day_0/4884-RG-3/filtered_feature_bc_matrix') RG_4884_04 <- Read10X('Y:/CDBLabs-Bioinformatics/Some_Place_Where_Big_Files_Can_Sit/Giger_2022_CellRa...
c24578433153c1a3913da159dfeac6cd582191e3adb32ebe18c4a89a3b837f84
R
7,254
187
describe("Testing effect_size functions", { # pre-loading all dataset types np_dataset <- generate_non_proportional_dataset() p_dataset <- generate_proportional_dataset() describe("Given valid params", { test_that("it should create dabest_effsize_obj with no issue", { dabest_obj <- dabestr::load(data...
220a8ab5099d18f2dafc490f46adc3adec26a8b685fec061d57e690acee63457
R
7,332
149
### LIBRARIES ### libs <- c('ggplot2','RColorBrewer','reshape2','devtools', 'pheatmap','flowCore','plyr','scales','coin','grid', 'gridExtra','tidyr','randomcoloR','viridis','tidyverse','ggpubr') for (L in libs){ if(!require(L, character.only = T)) { install.packages(L, dep = T, quiet = T) ...
b5c3e5971315d376a8abf4b447f0e6a864017136e92c578c03a1ce1ac83ab04e
R
7,399
241
library(tidyverse) setwd("C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling") metaDat = read_tsv("F:/GTEx/GTEx_Analysis_v8_Annotations_SampleAttributesDS.txt") tissues = unique(metaDat$SMTSD)#55 types length(metaDat$SMTSD)#22951 #grab 5 of each RNASeq = read_tsv("F:/GTEx/GTEx_Analysis_2017-06-05_v...
c42f0466ac5e4faed0c30a86f891b6ac3c34857757e001c1b03ddbca58ebbc98
R
7,419
121
##### object_image_writer ##### - Repeat for Hi, Med, and Ctrl Conditions # Working with post-ez_segmenter data ann deepcell (MATLAB GUI generated) for single object image creation # Author: Bryan Cannon 2020 (multiple code snippets taken or built from DM, FH, EFM, DT) # install and / or load ez_pkgs if you have...
6913ad62f3c21c0afaad51d4dce75f724f2e8751110fe95a3aadc6ad9ac950ce
R
7,443
156
--- title: "Batch-corrected imputation using magicBatch" author: "Kevin Brulois" output: html_document date: "2024-05-29" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## Introduction Marcov Affinity-based Graph Imputation of Cells (MAGIC) is an algorithm described by [David Van Dijk, et al]...
825b331446cc72410c089a1f73603cf8185ff29b8585131c08534b5eb8833ad7
R
7,443
267
#a=read.table('Zeisel_exp_sc_mat.txt',header=T,row.names=1) #write.table(t(a),'Zeisel_exp_sc_mat.txt.csv',quote=F,sep=',',row.names=T,col.names=T) #a=read.table('Zeisel_exp_sc_mat_cluster_original.txt',header=T,row.names=1,sep='\t') #write.table(a,'Zeisel_exp_sc_mat_cluster_original.txt.csv',quote=F,sep=',',row.names=T...
82778cdfab87b120feaf4c078e6406dbc9b5d86ba8e94c0afb20193ef10e3a92
R
7,452
156
# AC-001 .. AC-004 (SPEC-RICHR-006 REQ-001, IC-1): a table plot draws exactly # the rows its selection keeps and, when that drops rows, signals exactly one # `richR_plot_selection` message per call naming the counts and the rule. # The richR_plot_selection conditions signalled while evaluating `expr`, and # the value;...
c05b0abac261dee39f7b561b09f5e39aaca1d5e450c6b1fa61118d8706e6c341
R
7,468
179
# setup ------------------------------------------------------------------- library(tidyverse) library(rstatix) library(webr) library(ggstatsplot) setwd("~/Desktop/Neurobiologia/projects/ongoing/verbal.irony/discrepancy/experiment.1/") # reading data ------------------------------------------------------------ experim...
9d76a0b19e6ebd8730094117b21828cf65e3642b7ee1264cef56c21a6543a594
R
7,476
250
--- title: "Visualization of gene expression with Nebulosa" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: github_document: html_preview: true toc: true toc_depth: 3 html_document: df_print: kable theme: united --- ```{r r setup, include=FALSE} knitr::opts_chunk$set( tidy = TRU...
f3605965dbe0b8e399a7cd15c10334958ca521078c23851682ff4220f52cf188
R
7,638
156
if (F){ " This script implements all QC plots except the batch faceted count plot. It requires Stage I integration outputs dots.csv, samples.csv. The following plots will be generated: 1. per sample basis, intensity of the recognized & overlapped FISH dots 2. per sample basis, residual of the ...
5e7ae88befe6f69d3008d80cc728ae82b6651aa5f55315294b98af7e92b24d19
R
7,651
185
# Aitchisons Distance Analysis ####### Load PhyloSeq objects ####### source("src/load_phyloseq_obj.R") source("src/miscellaneous_funcs.R") beta_diversity_summary <- function(x, z, dist = "Aitchisons", tag){ # # TROUBLE # dist = "Aitchisons" # load("files/Phyloseq_objects_Woltka/Species_PhyloseqObj.RData") ...
84ac3492b057bf40e75e85c6bfccea2a78ecbf0b7c126ca62a7ead1264d71dd6
R
7,673
185
wd <- getwd() library(Seurat) library(dplyr) library(ggplot2) RG_3088_01 <- Read10X("Y:/CDBLabs-Bioinformatics/Some_Place_Where_Big_Files_Can_Sit/Giger_2022_CellRangerFiles/Day_1/3088-RG-1/filtered_feature_bc_matrix") RG_3088_02 <- Read10X("Y:/CDBLabs-Bioinformatics/Some_Place_Where_Big_Files_Can_Sit/Giger_2022_CellRa...
238eaeb10f253be5347e15adb3af7033b85b85a95c0f9c9c1b60fabc6dc2b891
R
7,686
179
randomized.svd <- function(A,K, q, method = 'rsvd', mkl.seed = -1) { out <- setNames(vector("list", 3), c("u", "d", "v")) if (method == 'rsvd') { out <- rsvd::rsvd(A,K,q=q) }else if (method == 'rsvd-mkl') { requireNamespace("fastRPCA") fastPCAOut <- fastRPCA::fastPCA(A, k=K, its=q, ...
238130b9e7f30112c88afc428af1f0fb6ac57c6e1e9af6951f7371fcf0b09d76
R
7,693
203
## BART: Bayesian Additive Regression Trees ## Copyright (C) 2017-2020 Robert McCulloch and Rodney Sparapani ## ss.gbart ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of ...