sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
102953d1df60bccd310ae911dcf881b12a59f7f457a437855081f034f28b7e70 | R | 10,976 | 181 | ##### 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... |
de518f6d41ad85fb3abe5e8462179cc4aa79efe034835954bbbfcaf687f3faba | R | 10,982 | 181 | ##### 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... |
e98329ca5ccafcc4c3083eef801f30243f3c62f67b144d3dbe35900538b717a5 | R | 11,035 | 334 | ---
title: "CEM_Analysis"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r}
# Load necessary libraries
library(here)
library(tidyverse)
library(ggplot2)
library(dendextend)
library(data.table)
#library(dynamicTreeCut)
library(Rtsne)
#library(gridExtra)
library(knitr... |
21a0f12934edf26f855457d5b6f934d918d898d55c3eaf8b4706569162e55552 | R | 11,059 | 258 | test_that("annotation membership normalization validates and deduplicates rows", {
annot <- data.frame(
GeneID = c("A", "A", " ", NA, "B"),
Term = c("T", "T", "T", "X", ""),
Annot = paste0("name", 1:5)
)
expect_warning(
normalized <- richR:::.normalize_annotation(annot, func_name = "test"),
"... |
d8534264717e3b8f45907f674066a0323878bcd26e5da9cdb5997b83c383f5ea | R | 11,068 | 182 | ##### object_image_writer ##### - Repeat for Hi, Med, and Ctrl Conditions
# Working with post-ez_segmenter data and 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... |
83a8dbaab56a10e0f898346c813f9abae27f5334179ab6c8717fa262a06cd87d | R | 11,074 | 182 | ##### object_image_writer ##### - Repeat for Hi, Med, and Ctrl Conditions
# Working with post-ez_segmenter data and 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... |
034fbb66e06a4f2b7f9f9f7902e4a751982642035b9ef18e3900ecb36fc5b71e | R | 11,115 | 190 | ##RUN DeepCellAnalysis_HiAD_Gated_NormAllChannel.R to generate all_data ###
# Import existing all_data from the enviroment using Import Dataset. Rename simply into all_data
# Need to pool all the new Mantis corrected csv into one folder.
library(readr)
dataPath = "/Volumes/KausaliaHD/AllProjects/BRAIN DATA/MIBI/MIBID... |
a97e076de51aacc83314c6970da27b30e1544b4cea68361551d68de0ed7345c0 | R | 11,118 | 337 | describe("Given non-valid params", {
# since this is more of an integration test, this unit test logic is repeated in test_001_utils.R
np_dataset <- generate_non_proportional_dataset()
p_dataset <- generate_proportional_dataset()
# for paired data test
np_dataset_trunc <- np_dataset[-2, ]
test_that("it sh... |
574862ac85d3d3d0d3d7ad9e6c03b33d156db438f2f5085236dbaef39965a79b | R | 11,122 | 185 | ##### 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... |
e49e07e88f3f52d27f80f30085d2af0a40b50d7e6e5aedc6e2ef2ab662613ffb | R | 11,162 | 220 | ### 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)
... |
db934affaf1fa468a5957c7afca345600ae77a235c02f49f33a27694de2f9749 | R | 11,203 | 321 | ## Ref: https://keras.rstudio.com/
library(sigminer)
library(keras)
library(dplyr)
library(caret)
# Preparing data ----------------------------------------------------------
load("output/Sig.CNV.seqz.W.RData")
load("output/Sig.CNV.mskcc.RData")
load("output/CNV.mskcc.tally.W.RData")
## Switch Sig1 and Sig2 to make... |
a11dd32bf2b3f97355b7c38c140d789987887580acdfd82f3f1a828e66a57f9c | R | 11,210 | 182 | ##### object_image_writer ##### - Repeat for Hi, Med, and Ctrl Conditions
# Working with post-ez_segmenter data and 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... |
565b8ab62642211dd311c66173a4338cc5a4a03dbf0454377d2faa705f7bfea6 | R | 11,228 | 252 | # bindRich() (SPEC-RICHR-004 REQ-008 .. REQ-010): one long table with an
# explicit execution state and inferential state per term per group. Fixtures
# F-ORA and F-GSEA are built in helper-tested.R with the public API.
# Named state vector of one group, keyed by identifier.
bind_states <- function(b, group, id = "Ann... |
1a79b059d101bc51ad61999a72244a77af71d95cea003f3787f0e756829390a0 | R | 11,233 | 347 | ---
title: "Multilayer Perceptron Validation Experiments: Visualization"
subtitle: "Mouse-Human Mapping"
author: "Antoine Beauchamp"
date: "`r format(Sys.Date(), '%B %d, %Y')`"
output:
html_document:
theme: paper
highlight: pygments
toc: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = ... |
faf2c9e9d65a22be1c07509efa565efe36cb85959642dc624e01711f5f2c396a | R | 11,295 | 273 | #' Bind enrichment results into one table with an explicit state per term
#'
#' Combines several enrichment results of one class into one long table with
#' one row per group and per identifier, stating for each row whether the
#' group reported the term, tested it without reporting it, did not test it,
#' or cannot te... |
0b8c5f0504f39092b2fe585434a326c6c2c5d6fa7413146163a054eabb7dfbda | R | 11,379 | 309 | #' @include internal.R
#' @importFrom Seurat DefaultAssay Idents<-
#' @importFrom methods as slot<- slot
#'
NULL
clusters.key <- 'monocle3_clusters'
partitions.key <- 'monocle3_partitions'
#' Convert objects to Monocle3 \code{cell_data_set} objects
#'
#' @param x An object
#' @param ... Arguments passed to other meth... |
9e093f7b707f576ddf6b3957f63423e52027fcec10994a035baf2d7b4ab4913f | R | 11,390 | 203 |
## 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
#... |
5bb1658d3db987d76c0badef13477b7037bcdc044c07cab44ee90d2887b11fe4 | R | 11,401 | 249 | ---
title: "Tutorial: Delta-Delta"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Tutorial: Delta-Delta}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r, include = FALSE, warning = ... |
ce31894cb3f175262571e2fed13c82ffd2b153427cc15935e761275bf2f476fa | R | 11,410 | 187 | ##### object_image_writer ##### - Repeat for Hi, Med, and Ctrl Conditions
# Working with post-ez_segmenter data and 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... |
5da4f33522baa8042d92ad5d3249083320d8b11e3a0babb1a567d3f01234d227 | R | 11,472 | 308 | # Helper functions that deal with assignment of plot_kwargs for plot
#
# Contains function `assign_plot_kwargs`.
#' Adjustable Plot Aesthetics
#'
#' @name plot_kwargs
#'
#' @description
#' These are the available plot kwargs for adjusting the plot aesthetics of your
#' estimation plot:
#'
#' - `swarm_label` Default "v... |
60854f639167de2a2c96bb3c09978f2a720f61876a8876272c75242830c2d07f | R | 11,473 | 270 | describe("Testing dabest_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 <- generate_non_proportional_dataset()
p_dataset <- generate_proportional_dataset()
d_dataset <- generate_deltadelta_dataset()
desc... |
0f231bc4306b293a5d65ed16ebc8644fb5b244902cf995390df29b04dc4b0a16 | R | 11,537 | 306 |
if(T){
library(tidyverse)
library(magrittr)
library(conos)
library(cacoa)
library(Matrix)
library(ggpubr)
library(cowplot)
library(pagoda2)
library(reshape2)
library(RColorBrewer)
library(tidyr)
library(reshape2)
}
load("E:/wu_lab/For XS/20220709/Tbx3_metadata.Rdata")
a <- a... |
852ac6960c760749c82dac93e9334d88178c82fa59b8422c7f8aa4227d444ecf | R | 11,649 | 440 | library(data.table)
library(WGCNA)
library(flashClust)
setwd("./DLBproject/WGCNA")
commandIn <- commandArgs(F)
print(commandIn)
options(expressions = 500000)
inFilename <- "betas_1.csv" # DNA methylation beta value matrix
traits <- "Sample_Group,Gender,Age,PMI,NeuN_neg,NeuN_pos"
power.threshold <- 14 # predefined t... |
4d619c4689b741f1fb71ef6b9031c17b2a6043a37b70c945eae0bdf6a00b2fe4 | R | 11,675 | 366 | # ----------------------------------------------------------------------------
# label_expression_matrices.R
# Antoine Beauchamp
#
# Label voxel-wise and sample-wise expression matrices
#
# Description
# -----------
# This script does two things:
# 1. It intersects the mouse and human gene sets with a set of homologo... |
06d9c5866543f97017288de991843ea2d0960bd8f31688eb473204c1c0b07982 | R | 11,716 | 382 | # Create phyloseq objects
rm(list = ls())
source("src/load_packages.R")
source("src/miscellaneous_funcs.R")
negative_controls <- c("BLANK")
#----------------------------------------------------------
#- metadata prep
#----------------------------------------------------------
motor_testing_vars... |
e80c073c28a6e4d1a37b8853d1ba31e176d2321bd660bc02832eb9d160749bef | R | 11,741 | 229 | # Optional generic preliminaries:
graphics.off() # This closes all of R's graphics windows.
rm(list=ls()) # Careful! This clears all of R's memory!
a.c <- function(x){return(as.character(x))}
library(reshape)
##########################################################################################
# SET PARAMETERS:
... |
bd27e0d614b38094d0bdb47789b5b5471d5cd1241d777f506b9c17d114061510 | R | 11,999 | 209 | #This is LongCombat with some modifications by me
#' Harmonize Multi-batch Longitudinal Data
#'
#' \code{longCombat} function will implement longitudinal ComBat harmonization for multi-batch longitudinal data. Longitudinal ComBat uses an empirical Bayes method to harmonize means and variances of the residuals acr... |
dabb74aed17bfb6c26e44c27e0445d27167fae6804cea16aa3e5846752f39204 | R | 12,010 | 292 | setwd(
"~/Dropbox (ASU)/Placenta/BATCH2_PLACENTA_DECIDUA_ANALYSIS/HISAT_FeatureCounts/batch1_and_batch2/"
)
library(reshape)
library(ggpubr)
library("gridExtra")
# read in placenta CPM data
df_merged_placenta <-
read.delim ("genelists/placentas_batch_1and2/cpm_placenta_df_genes.txt")
df_merged_placenta$group <- "t... |
0207d45d385e1dcdb161061bfec080d6362f14d6174d6327ac38770dd18522ad | R | 12,070 | 253 | #' Per-identifier audit of a conversion or an enrichment analysis
#'
#' \code{mappingAudit()} lists what happened to every identifier on its way to
#' the enrichment engine, read only from what was recorded: the mapping record
#' of a \code{\link{mapGenes}()} conversion and the analysis metadata of a
#' result (\code{\... |
dbd652b1130832548564c8ddbacf71dc6ab1b4a49494b3142434e5e956a1bc74 | R | 12,087 | 217 | .run_consumer_rscript <- function(code) {
script <- tempfile(fileext = ".R")
on.exit(unlink(script), add = TRUE)
lib_paths <- paste(capture.output(dput(.libPaths())), collapse = "")
writeLines(c(
paste0(".libPaths(", lib_paths, ")"),
"setwd(tempdir())",
code
), script)
output <- suppressWarnings... |
f7c93fbb7a590a1b74f713a5547c914f71314b60223b19dcb5a8d62bf015aca1 | R | 12,107 | 238 | #Gating & Clustering
# START OF GATING
# all gated data set together
master_data_ion_cuberoot$cluster_id = 0
# add gate ids for ez_segmented objects
data_indexes = which(with(master_data_ion_cuberoot, obj_type_id == "tau-pathies"))
master_data_ion_cuberoot[data_indexes, "cluster_id"] = 1
data_indexes = which(with(mast... |
f632de2693303626ac60f85f85c8adc9c96e84ccd8cfa3bc3471b04c9f47879f | R | 12,150 | 250 | #Gating & Clustering
# START OF GATING
## visualization
master_data_all_cuberoot %>%
filter(MAP2 >= 0 & MAP2 <= 2) %>%
filter(GFAP >= 0 & GFAP <= 5) %>%
filter(obj_type_id %in% "cells") %>%
ggplot() +
aes(x = MAP2, y = GFAP) +
geom_point(size = 1L, colour = "#0c4c8a") +
geom_density2d(colour = "#FF7F00"... |
d2be1f32ad9e639c3198f8edbb71afcae5267f280f23a79695fab63264ffffd5 | R | 12,231 | 462 | #R code to generate panels B, C and D of Figure1 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")
# read cells and connectors --------------------------------------------------------------
{
outline <- ... |
625e1ba708303bbf723861443b3f819366178f781e16507604ed628a2ea0f503 | R | 12,241 | 321 | ---
title: "Using CIPR with human PBMC data"
date: "`r format(Sys.time(), '%d %B, %Y')`"
author: "Atakan Ekiz"
output:
github_document:
html_preview: true
toc: false
html_document:
df_print: kable
theme: united
---
This vignette demonstrates how to run CIPR on Seurat objects. If you use CIPR, plea... |
86e0e7b528fbd47fcc7ab1864737f3190c28fe955aa29c3ceab8666c8f1ae00f | R | 12,253 | 289 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2017-2020 Robert McCulloch and Rodney Sparapani
## ml.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 ... |
780c34037e38bc742156080938e126a4d5fc48759d765b7fa1d3be2569e2125c | R | 12,283 | 236 | # themeGenes(): per-group gene evidence of a theme (SPEC-RICHR-007 M6.2b).
# Fixtures and their role checks live in helper-themes.R.
.tg_stats <- function() {
list(q1 = data.frame(gene = sprintf("G%02d", 1:7), log2FC = seq(-1.5, 1.5, length.out = 7)),
q2 = data.frame(gene = sprintf("G%02d", 1:7), log2FC = (1:... |
b61167439571aa43fedffbcdfb0ca30d295e9f2ea569d31fc3f64aec35a51faa | R | 12,316 | 366 | #' Generates the dataframe requires for the tufte lines plot component in raw plots.
#'
#' This function returns a dataframe with summary statistics, such as mean, standard
#' deviation and quantiles (depending on the effect size) based on the input dataset.
#'
#' @param raw_data The tidy dataset passed to [load()] tha... |
878396a7b8f8c258fbdd11192f52a090b87fc07597dc005b69a617e760f7c703 | R | 12,390 | 354 | #' Loading data with dabestr
#'
#' @description
#' Processes and converts a tidy dataset into the dabestr format.
#' The output of this function is then used as an input for various procedural
#' functions within dabestr to create estimation plots.
#'
#' @param data A tidy dataframe.
#' @param x Column in `data` that c... |
afedeafa79d3650608910a6f32a39f26c210919a818bab30805c168b6b8adb36 | R | 12,430 | 476 |
fn_volcano_plot <- function(.xx) {
.xx %>%
dplyr::mutate(log2FC = ifelse(log2FC > 4, 4, log2FC)) %>%
dplyr::mutate(log2FC = ifelse(log2FC < -4, -4, log2FC)) ->
.xd
.xd %>%
ggplot(aes(x = log2FC, y = FDR, color = color)) +
geom_point(alpha = 0.8) +
scale_color_manual(values = c("#6BAB... |
90a5359b7f85fa1d6510ec4a67a4c3165f6fdd5981d80a3edb7d8b167d1a3b7f | R | 12,562 | 355 | #' Run Adaptively-thresholded Low Rank Approximation (ALRA)
#'
#' Runs ALRA, a method for imputation of dropped out values in scRNA-seq data.
#' Computes the k-rank approximation to A_norm and adjusts it according to the
#' error distribution learned from the negative values. Described in
#' Linderman, G. C., Zhao, J.,... |
9fb88d7ecdd67d18710814bc61be84138069ef0b7c71d6b75e591ae64e6bcbec | R | 12,585 | 287 |
#'
#' Impute data using the MAGIC algorithm
#'
#' This is an implementation of the Marcov Affinity-based Graph Imputation of Cells (MAGIC) algorithm described in
#' Van Dijk, David et al, modified for flexibility. It includes the mar_mat_input argument, which allows the data used to compute the diffusion operator... |
b7001e61242b6e84b4333b9db60863b9f1797fb9c74d16959fbaf39269757e9a | R | 12,670 | 347 | #library('pcaPP')
########################################
#Author: Feng Zhang
#Email: 15110700005@fudan.edu.cn
#######################################
.get_log_p_sc_given_ref <- function(exp_sc_mat, exp_ref_mat, CPU=4, print_step=10){
delta = 0.01;
#exp_sc_mat: single-cell gene expression matrix; row is gene;... |
0363c6f6627726b186b40c73bf569959717c0032a48fa0968276189df222145d | R | 12,756 | 357 | ---
title: "Whole-brain comparison of rodent and human brains using spatial transcriptomics"
subtitle: "Results 2, Figure 2, Supplement 1"
author: "Antoine Beauchamp"
date: 'July 26th, 2022'
output: html_document
---
# Initialization
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,
... |
179da89676c59ebb505fb3d7c60a52f8058d51bbfb9f34d053344ecf5c7f1359 | R | 12,799 | 250 | ## FOLD CHANGE NEIGHBOURHOOD ANALYSIS ON GRADED (HI MED LO) PLAQUES############
### LIBRARIES ###
libs <- c('ggplot2','RColorBrewer','reshape2','devtools',
'pheatmap','flowCore','plyr','scales','coin','grid',
'gridExtra','tidyr','randomcoloR','viridis','tidyverse','ggpubr')
for (L in libs){
if(!r... |
8eeaeff829032483746132e39934960d4b42962198a7fc5c4114fa6b45a1ad29 | R | 12,898 | 314 | ##' build annotation database
##' @name buildAnnot
##' @rdname buildAnnot-methods
##' @title make annotation database
##' @param species species for the annotation
##' @param keytype key type export
##' @param anntype annotation type
##' @param builtin use default database (TRUE or FALSE)
##' @param OP BP,CC,MF default... |
475f3a9fc7ce79c8719251c94ff810746b6d7de29d7e7bd12b6b88e7c9ff47b4 | R | 12,922 | 430 | # Metainfo ----------------------------------------------------------------
# @AUTHOR: Chun-Jie Liu
# @CONTACT: chunjie.sam.liu.at.gmail.com
# @DATE: Tue Sep 6 18:36:33 2022
# @DESCRIPTION: tcga 5op 50 genes
# Library -----------------------------------------------------------------
library(magrittr)
library(ggplot... |
36bdff01f0569c367255887e942ea7018a467c75d105be7a9efd51b1cf35ef5c | R | 12,977 | 214 | # Read in RGB mask TIF(s) and plot a heatmap of mean expression values per region (and per sample)
#### Import All ####
# Read in csv with pixel per mask, run info (generated in MATLAB)
pixel_regions_info <- read_csv('/Volumes/BryJC_Stanford/Analysis/KV_BJC_MIBI_Brain_Paper_1/Fig_MedRes/data_outputs/mask_expansion... |
0d8117e5f49f40034cf085b49df6bb4e497e12af8a7a10ad26afb06cb56764da | R | 12,992 | 307 | #!/usr/bin/Rscript
library(Seurat)
#
# NJ01, multifocal
rd001 = readRDS('RD-20180817-001-SR18271.seurat_final.rds')
rd002 = readRDS('RD-20180817-002-SR18271.seurat_final.rds')
rd001 = UpdateSeuratObject(rd001)
rd002 = UpdateSeuratObject(rd002)
rd0012.anchors <- FindIntegrationAnchors(object.list = c(rd001,rd002), di... |
b734d44129b032e1149058a83e934b0d060b3e36b057f644491ce9b0d10915b2 | R | 13,088 | 264 | #Gating & Clustering
## visualization
master_data_all_cuberoot %>%
filter(MAP2 >= 0 & MAP2 <= 2) %>%
filter(GFAP >= 0 & GFAP <= 5) %>%
filter(obj_type_id %in% "cells") %>%
ggplot() +
aes(x = MAP2, y = GFAP) +
geom_point(size = 1L, colour = "#0c4c8a") +
geom_density2d(colour = "#FF7F00") +
theme_minimal... |
f055823a749ebe03b1cc6fb51f78cf77bb6e537a7e5cf4af6af3941985bdbf0f | R | 13,099 | 273 | # Analysis audit (SPEC-RICHR-005 REQ-006 .. REQ-009): the engines keep the
# mapping record of their input and the per-identifier input counts, and
# mappingAudit() reads one decision per identifier from the recorded metadata.
# Fixture F-AUD is inline; F-ORA-C, F-GSEA and M4's legacy fixtures are files.
faud_annot <-... |
18a7e79e22df06a0e6a74948f25627e71407b1dc8831d003f21409b71eb2c70c | R | 13,143 | 252 | ##' richplot
##' @description plot the sigificant terms and shared genes with network format
##' @importFrom igraph graph_from_data_frame
##' @importFrom igraph simplify
##' @importFrom igraph V
##' @importFrom igraph V<-
##' @importFrom igraph degree
##' @importFrom ggplot2 geom_text
##' @param object richResult or da... |
d4677f78d362a97417c02b804e04e6dab25a15f813f2ac9232b1c78ee27aea0c | R | 13,163 | 199 | ####################### Generated simulated data for non-suture vertices ##############################
# CODE FUNCTIONALITY:
# - This code simulates intensity vertices (from MRI imaging) of vectors perpendicular to the skull surface
# - Currently it simulates 50 layers where each later is 0.5 mm thick.
# - To be more... |
e8525319b7546a7e46225a3a65dda33a568a0ac752ed4402ce61a2b8252ef4a9 | R | 13,177 | 431 | EPSILON<-0.000001
crossProduct<-function(a, b){
return(a[1]*b[2]-b[1]*a[2])
}
#
# Checks if a Point is on a line
# @param a line (interpreted as line, although given as line
# segment)
# @param b point
# @return <code>true</code> if point is on line, otherwise
# <code>false</code>
#
isPointO... |
4ac6d454d98b82e171fa3d4a624c49b1a825d20dcfdd0fc938612ce039e6d48b | R | 13,227 | 416 | #
# This master R file includes all the R functions for implementing the innovated
# scalable efficient estimation (ISEE) procedure introduced in Fan and Lv (2015) for
# scalable estimation of both the innovated data matrix (n x p matrix X tilde = X Omega)
# and the precision matrix (Omega = inverse covariance matri... |
3c1c6c4a5a71fc45f86d9022c2878b54f03ca8638980b46450e4fe426d1008e8 | R | 13,263 | 355 | library(Seurat)
library(BUSpaRse)
library(tidyverse)
library(textTinyR)
library(qdapTools)
#install.packages("qdapTools")
#install.packages("anndata")
#anndata::install_anndata()
library(anndata)
library(tidyverse)
setwd("C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling")
#read the data in backed m... |
10a4810a7ae541cc4dc2e8968a7dff50168e6b7001e2d5f9539f5e279d584055 | R | 13,348 | 385 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2018-2020 Robert McCulloch and Rodney Sparapani
## gbart.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... |
983fcc2ac8110ebcd0e5f87e178342dfb69ab3bbcc92f169a826167d402ea2a1 | R | 13,413 | 302 | # ORA tested family (SPEC-RICHR-002 D2, REQ-008 ... REQ-012).
# Expected values are computed here with stats::phyper and stats::p.adjust,
# never copied from richR output.
fam_sets <- list(
S = c("Q1", "X1"), # overlap 2, size 2 < minGSSize = 3
T1 = c("Q1", "Q2", "Q3", "F1"),
T2 = c("Q4", "Q5", ... |
71756e5d9e43680062a71d99851077405993ee5b5e20e600a24c7081ef1f793f | R | 13,418 | 328 | #' Gene set enrichment analysis
#'
#' @param values vector of values with associated gene names; values must be named, according to names appearing in set elements
#' @param geneset vector of genes in the gene set
#' @param power an exponent to control the weight of the step (default: 1)
#' @param rank whether to use r... |
4e7e36a99079f0b8c79d58fe4edb177270a4b78e5fd3b332c33adf81af0d0532 | R | 13,436 | 457 | #R code to generate Figure1 figure supplement 2 of the Jasek et al Desmosomal connectome paper
source("code/Packages_and_Connection.R")
# numbers of cells with tonofibrils, desmosomes or both, by cell t --------
# get all skids with "black fibers" tag
# there are also annotations for this but tags are more reliable... |
4a97bcb611ba241a114148168cc6580eb1777531e6f6391742be8e7c18c41830 | R | 13,439 | 289 | # Load data
load(here::here("data", "models.Rdata"))
# Create fixed variables
tract <- c(rep("AF", 4), rep("IFOF", 4))
laterality <- c("Left", "Left", "Right", "Right", "Left", "Left", "Right", "Right")
component <- rep(c("phonology", "semantics"),4)
# Create data frame concur acute
dataf_concur_acute ... |
bb2b08688fca2c203c176ddf5dd71cec03378f57270d00bb7c3f090bf54ec424 | R | 13,464 | 304 | library(limma)
library(edgeR)
library(RColorBrewer)
library(ggplot2)
library(tidyverse)
library(matrixStats)
library(reshape)
library(ggpubr)
library("gridExtra")
#--------------
# set working directory
#--------------
#setwd("~/Dropbox (ASU)/Placenta/BATCH2_PLACENTA_DECIDUA_ANALYSIS/HISAT_FeatureCounts/batch1_and_ba... |
bf9593acd24f095ff1ddab3db810156c6b0c59b42dcc062ebb826cb9a3c29249 | R | 13,485 | 472 | ---
title: "Untitled"
author: "Antoine Beauchamp"
date: '2022-08-06'
output: html_document
---
```{r}
library(tidyverse)
```
```{r}
datadir <- '../data/MLP_validation'
df_original_naive <- as_tibble(data.table::fread(file.path(datadir, 'MLP_validation_naive_region67_original.csv'), header = TRUE))
df_original_resa... |
8a368a3913620274ca0d71263da31f357e7ca9cfd44fe6504c84095feca66911 | R | 13,490 | 278 | # setup -------------------------------------------------------------------
rm(list = ls())
library(data.table)
library(tidyverse)
library(plyr)
library(webr)
setwd("/home/eli/Desktop/Neurobiologia/projects/ongoing/verbal.irony/facilitators/experiment.3/tasks/google.forms/")
# general csv reading ---------------------... |
7a561e61451bb39fae8cb7bc54babd1d5005f54e5a9a60207cc441e75a97216b | R | 13,528 | 340 | library(ggplot2)
library(scales) # for muted function
library(tidyverse)
library(ggpubr)
figPath = "Z:/projects/Single-cell modeling/figures/"
setwd("C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling")
library(R.matlab)
##################################
# Structural comparison
######################... |
54a22f0fc6f1a068dffb86ffdaabcf3902e68009d9ea469e8eaad67311c1ae10 | R | 13,609 | 416 | #
# This master R file includes all the R functions for implementing the innovated
# scalable efficient estimation (ISEE) procedure introduced in Fan and Lv (2015) for
# scalable estimation of both the innovated data matrix (n x p matrix X tilde = X Omega)
# and the precision matrix (Omega = inverse covariance m... |
b11ef923d1f108088f9868c91a7bd97ae4194c4fe37121ce98aa0894614bc0e9 | R | 13,699 | 266 | # Rennie Kendrick, last updated: 06/16/21
# The following script preps data for use in finalize_Analyze_CEM.Rmd. It only needs to be run if:
# Note: Make sure you are in the project directory (hiplex-master when using any of these scripts. If you "here" location is your desktop, or somewhere else random, this means you... |
bbee0c7d956ef87570d95fa383abc62fae4c0aa84a49e0713512ebac2851a977 | R | 13,783 | 256 | # richSensitivity() (SPEC-RICHR-005 REQ-010 .. REQ-014): an ORA grid over
# user-named backgrounds x maxGSSize, one independent enrich() run per cell,
# states through bindRich(), a descriptive stability summary and its design.
# Fixture F-GRID (inline, seed 1) is the generator of ledger L-M5.
fgrid <- function() {
... |
d8b17502549f83c786bc1f5a750b6d3bad421240b6b5e49ac294d304e4f290bc | R | 13,867 | 198 | #' KEGG Pathway Enrichment analysis function
#' @importFrom dplyr filter
#' @importFrom rlang sym
#' @param x vector contains gene names or dataframe with DEGs information
#' @param kodata GO annotation data
#' @param ontology KEGG
#' @param pvalue cutoff pvalue
#' @param padj cutoff p adjust value
#' @param organism o... |
c7bb09c8f38bfd8ee1a84026df8b484bdfe77e12cb94a35c61cac7b912b377fa | R | 13,946 | 396 | #' Generates permutation test results.
#'
#' This function returns a list that include permutations results:
#' its corresponding permutations, variance of permutations, p value and effect size
#' (depending on the effect size).
#'
#' @param control Vector, the control group data.
#' @param test Vector, the test group ... |
1755992fc67932201c5445bd2a609273aea6bc95b751cc281cb7f217a1674470 | R | 13,964 | 386 | conv <- function(a, b)
.C("convolve",
as.double(a),
as.integer(length(a)),
as.double(b),
as.integer(length(b)),
ab = double(length(a) + length(b) - 1))$ab
showImage <- function(file) {
file <- as.character(file)[1]
## check for existence
if(!file.exists(fi... |
e46167891b74e5d785435863985aa179a1efe75be32bae3165bb2bb27bfe7712 | R | 14,002 | 383 | #' UpSet plot for visualizing set intersections with color support
#'
#' Creates an UpSet-style plot from named gene lists, built entirely with ggplot2.
#' Supports per-set coloring of bars, matrix dots, and connecting lines, without
#' requiring or modifying the UpSetR package.
#'
#' @param x A named list of character... |
255f09f00b323a2be6745fac2b5192ee59f6b802ba66a369d9b858ee57e9d671 | R | 14,010 | 231 | # Read in RGB mask TIF(s) and plot a heatmap of mean expression values per region (and per sample)
#### Import All ####
# Read in csv with pixel per mask, run info (generated in MATLAB)
pixel_regions_info <- read_csv('/Volumes/BryJC_Stanford/Analysis/KV_BJC_MIBI_Brain_Paper_1/Fig_MedRes/data_outputs/mask_expansion... |
5c59780be017b737c879cd5d2cc1e28fddd9fc81e66f97c13ef0433bc5c1b96f | R | 14,104 | 334 | #setwd(
# "~/Dropbox (ASU)/Placenta/BATCH2_PLACENTA_DECIDUA_ANALYSIS/HISAT_FeatureCounts/batch1_and_batch2/"
#)
setwd(
"C:/Users/splaisie/Documents/Placenta/batch1_and_batch2/"
)
library(reshape)
library(ggpubr)
library("gridExtra")
# read in placenta CPM data
df_merged_placenta <-
read.delim ("ge... |
4f06e1cfc654e4289cb9ae5485b2e079d428110308ad4c934364ba7b911fcf5f | R | 14,139 | 264 | #### Region Analysis ####
#marker subsets
just_markers <- panel[-c(1:4,44:45)]
disease_struct <- c('Amyloidbeta140','Amyloidbeta142','PHF1Tau', 'X8OHGuano', 'pTDP43', 'PolyubiK48', 'PolyubiK63')
glia_struct <- c('Iba1', 'CD45', 'ApoE4','PanApoE2E3E4','pTDP43','CD33Lyo', 'PHF1Tau','Amyloidbeta140','Amyloidbeta14... |
8dedb502f0a6d7f56816d5b896c19d3c25afb89a529570c3badbad2fb085dd78 | R | 14,191 | 291 | #' Stability of ORA conclusions over a prespecified grid of settings
#'
#' \code{richSensitivity()} re-runs \code{\link{enrich}()} once per cell of the
#' full cross product of user-named backgrounds and gene-set upper bounds
#' (\code{maxGSSize}), every other argument identical across cells, and
#' summarises how ofte... |
8e3af00833dbcf60e2476953d99b92e92aa2d58088346cebd19512063d78e441 | R | 14,196 | 297 | #' Convert gene identifiers with a recorded decision for every entry
#'
#' \code{mapGenes()} converts a gene vector or a ranking from one identifier
#' type to another and records what happened to every input entry. Unlike
#' \code{\link{idconvert}()}, which keeps the first candidate of a one-to-many
#' identifier with... |
59cde74f11591df277d5677977c0761777dc68b63b3bf2a7cd8d081ed5abe052 | R | 14,258 | 364 | # Create phyloseq objects
source("src/load_packages.R")
source("src/miscellaneous_funcs.R")
source("src/metaphlanToPhyloseq_Waldron.R")
negative_controls <- c("BLANK")
#----------------------------------------------------------
#- metadata prep
#-------------------------------------------------... |
adef97b02ab17268be37702d07bf1f07267706229d3cfc4f6f089e51d7de0af5 | R | 14,287 | 296 | # title: "placenta and decidua MDS plots"
# author: "Kimberly Olney"
# date: "02/04/2020"
# output:
# pdf_document: default
# html_document:
# df_print: paged
library(limma)
library(edgeR)
library(RColorBrewer)
library(dplyr)
library(ggplot2)
library(VennDiagram)
library(mixOmics)
library(devtools)
library(dplyr... |
636a661db7772da0bf4169e5cddf3a31d5fcc34fb903801d1e6dd5b8df32dbac | R | 14,308 | 266 | #Gating & Clustering
# START OF GATING
# all gated data set together
master_data_all_cuberoot$cluster_id = 0
# add gate ids for ez_segmented objects
data_indexes = which(with(master_data_all_cuberoot, obj_type_id == "tau-pathies"))
master_data_all_cuberoot[data_indexes, "cluster_id"] = 1
data_indexes = which(with(mast... |
493f3d8b5fa4605b2c0adbdc9e2f84ff27d6f1f3bdbb3db2088bbe4f452a68e7 | R | 14,332 | 204 | #' GO Enrichment analysis function
#' @param x vector contains gene names or dataframe with DEGs information
#' @param godata GO annotation data
#' @param ontology BP,MF or CC
#' @param pvalue cutoff pvalue
#' @param padj cutoff p adjust value
#' @param organism organism
#' @param keytype keytype for input genes
#' @pa... |
2cc0b8a836db7897fec8237785cb11f045a1044a6eeddce228f750c0f5a38b16 | R | 14,358 | 301 | #!/usr/bin/env Rscript
################################################
################################################
## REQUIREMENTS ##
################################################
################################################
## DIFFERENTIAL ANALYSIS, SCATTERPLOTS AND PCA FOR... |
8f1c5b6f094696e3d6796982a5ccf45d7530e919ca932a508bd42071f04f0b88 | R | 14,672 | 389 | #' Plot KEGG Cluster Visualization
#'
#' This function merges two cluster-plot approaches:
#' \itemize{
#' \item \strong{Enrichment mode}: requires columns \code{Term}, \code{Padj}, \code{Significant}, \code{Annotated}, etc.
#' \item \strong{GSEA mode}: requires columns \code{pathway}, \code{padj}, \code{NES}, etc.... |
56d4f9470319691db03cbe24d72a5774de898600b9ebb82146401fa76c84639c | R | 14,901 | 330 | # This is the script for generating the query database
# All required files are annotated
# Can search through variables with suffix 'path' to modify the input files
# The downloading source can be found in the annotations
require(raster)
require(rgeos)
require(rgdal)
require(maps)
require(maptools)
require(dplyr)
# ... |
afccecc52502449e9f2d99d569c386e50fea911f6a63f686e83aa9185a67602f | R | 15,325 | 357 |
#' @include internal.R
#'
NULL
#' Run Banksy on a Seurat Object
#'
#' @param object A Seurat object
#' @param lambda (numeric) Spatial weight parameter
#' @param assay (character) Assay in Seurat object to use
#' @param slot (character) Slot in Seurat assay to use
#' @param use_agf (boolean) Whether to use the AGF
#'... |
38b2938f1c9149b6fae0a583c9b0910aae53261bd1af41287860505aade50319 | R | 15,526 | 266 | ###
### Process the TCGA phenotype data.
###
### The sample names need to be normalised:
### The DNA methylation data uses this sample name format:
### TCGA-D1-A0ZV-01, while all other data types use TCGA-2E-A9G8-01A,
### indicating that sample repeats have already been aggregated for
### the DNA methylation da... |
172f17734f02247bb1d60e95a45b16a5908865570bc1eed09b1cf48f7828bdab | R | 15,555 | 317 | #### FlowSOM Clustering Neurons ONLY ####
#filter for just neurons
fsom_clustering_data <- filter(disease_cell_overlap, FlowSOM_ids == "neurons")
#convert all factors to numeric
fsom_clustering_data <- mutate_if(fsom_clustering_data, is.factor, ~ as.numeric(.x))
flowFrame_... |
f701f6edd79997dccd7dfb52f0ab9342fb6b799141a289f9daaa48d0932e5ac8 | R | 15,586 | 307 | # script used to analyse data reported in https://doi.org/10.1101/2022.08.25.505296
# data and analysis scripts can be found at www.github.com/BriVandrey/lec-to-mec-analysis
# to use, download files and set working directory (***) to relevant path for your machine on line 14
# outputs: statistical results are saved as... |
90314a647c3dae149729cc4586ff346ad277e4775c2a2ec6d6001259bfd81e8b | R | 15,654 | 302 | ## FOLD CHANGE NEIGHBOURHOOD ANALYSIS ON GRADED (HI MED LO) OF TANGLES AND THREADS############
### LIBRARIES ###
libs <- c('ggplot2','RColorBrewer','reshape2','devtools','FlowSOM','Rtsne',
'pheatmap','flowCore','plyr','scales','coin','grid',
'gridExtra','tidyr','randomcoloR','viridis','tidyverse','... |
b4bc736f307d6767f8c23aa4b83998447f1a3d1b076da022b3c9bd19d32c4b9e | R | 15,811 | 262 | ##############################################################################
# Script:CellEnginePopulationImport.R
# Project: HiRes AD Scanned Data
# Author: Dmitry Tebaykin
# Date : 19th August 2020
# This program reads in a folder of tsv files, adds a filename column, merges the files, writes out a csv & makes heat... |
f56ff1168988a49ddd2166183c6116095d7d4802667cb929eeab5d0f51f8a395 | R | 16,355 | 455 | library(Deriv)
dataset <- "adni" # wrap, blsa, or adni
dir.name <- "/path_to_project_directory"
output.dir <- file.path(dir.name,"output","ODE_GP_v6") # make sure this output directory has already been created; this code will not create it if it doesn't exist
stopifnot(dir.exists(output.dir))
if (dataset=="wrap") {
... |
1908b12ed5019b5f03a59ca46ffeca12f3f20d9bf1712ecf02ad6f74916439dd | R | 16,466 | 352 | # set up ------------------------------------------------------------------
#rm(list = ls())
library(tidyverse)
library(webr)
library(rstatix)
library(ggstatsplot)
library(ggpubr)
setwd("/home/eli/Desktop/Neurobiologia/projects/ongoing/verbal.irony/facilitators/experiment.3/")
# data ----------------------------------... |
709ae893d9b383dbfe4f86e348a43c748e579ea9be2335a8ccb4c14cef6c4bcb | R | 16,687 | 289 | library("ggplot2")
library("pals")
# This script computes key structure stats for each vertex in the input and, for vertices with sufficient total intensity, it generates an intensity plot of all "good" vertices and computes key structure summary stats across these "good" vertices
# Inputs: the intensity matrix and th... |
ce3ebe02c7ec1e78dda699bd2c21d7c286929dc8f4808d75aa18b63943c851dc | R | 16,855 | 471 | #code to retrieve the desmosomal connectome from CATMAID
#and convert it into igraph, tbl_graph and visNetwork format
#the first exported gexf graph has to be imported to Gephi for force-field clustering
#the code also generates a grouped desmosomal graph and saves it in different formats
#final files saved to source... |
12472242d1fab0e79d4d4b455068cfc4721a6e50cefb9cd58ac3e83036b61761 | R | 16,952 | 343 | ##' generate network based on Enrichment results
##' @rdname richNetwork
##' @param object richResult,GSEAResult object or dataframe
##' @param gene vector contains gene names or dataframe with DEGs information
##' @param top number of terms to display
##' @param pvalue raw p-value cutoff: a term is kept when \code{Pva... |
88b592ef921fb24589c407759effbc2613957290cb959a7948433c97d15fb919 | R | 17,034 | 374 | #' compare enrichment results across different samples
#' @param x Non-empty list of richResult objects, result data.frames, or NULL
#' entries. Unnamed lists receive positional Group labels; explicit names
#' must be nonblank and unique.
#' @param pvalue Raw p-value cutoff in (0, 1]: a row is kept when
#' \code{... |
2236ce65e0943c1e9af67048e3c44967cb6b4f204f34a3089a6d2e165477b696 | R | 17,113 | 332 | #### Region Analysis ####
#marker subsets
just_markers <- panel[-c(1:4,44:45)]
disease_struct <- c('Amyloidbeta140','Amyloidbeta142','PHF1Tau', 'X8OHGuano', 'pTDP43', 'PolyubiK48', 'PolyubiK63')
glia_struct <- c('Iba1', 'CD45', 'ApoE4','PanApoE2E3E4','pTDP43','CD33Lyo', 'PHF1Tau','Amyloidbeta140','Amyloidbeta14... |
8b9ad21795ebb710dc112163c05c68081c163f2ee3217503156625a84f48762a | R | 17,222 | 387 | #Functions to select scans with DTI data
############################################
# #
# Extract md or fa with DTI series name #
# as a subset of those with structural data#
# #
############################################... |
da2bd633303782731aac4a2606f15882b87516e28a01b9fbfc027db2b9270787 | R | 17,347 | 427 | #' Perform spatial prioritization of the response to a biological perturbation
#'
#' Prioritize spatial locations involved in a complex biological process by
#' training a machine-learning model to predict sample labels
#' (e.g., disease vs. control, treated vs. untreated, or time post-stimulus),
#' and evaluate the... |
aa7bd72df1ea1e58eea3ea3d1550f0cffcf59e9ea4d1e62b615d9b755b3ddadd | R | 17,374 | 549 | ---
title: "Exploring the multi-layer perceptron using integrated gradients"
author: "Antoine Beauchamp"
date: '2022-07-19'
output:
html_document:
theme: paper
highlight: pygments
toc: true
code_folding: hide
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Libraries
```{r}... |
e97d53551289ededeec0e3f4c2cf2540f4beb5d83fd3a084cda5aa7ce26163f4 | R | 17,618 | 459 | #Code to generate Figure 3 showing the different Leiden modules of the desmosomal connectome graph from Jasek et al 2021
#Gaspar Jekely
source("code/Packages_and_Connection.R")
#read the saved igraph format graph file from supplements/
#this file was generated with the desmo_connectome_graph.R script
desmo_conn_grap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.