sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b8cb68a5435318792003b5fcaaa16dff6dd892df7d8532adb7bb035e016e0869 | R | 3,044 | 98 | test_that("registry selectors validate their strong identity", {
selected <- registry_selector(
release = "candidate-0002",
index_sha256 = paste(rep("a", 64), collapse = ""),
index_url = "https://example.com/index.json"
)
expect_s3_class(selected, "datamonger_registry")
expect_identical(selected$sch... |
4328e6850359facc7d339e9983707108e6127f731fcba6b824259b33071d3ae4 | R | 3,052 | 97 | function trials_table= get_table(s_coord,rnd_builder)
% GET_TABLE returns the table of values of all components.
% TRIALS_TABLE=GET_TABLE(S_COORD,RND_BUILDER) returns the table of
% values of all components.
% RND_BUILDER is a (2 x num-of-crids) cell array that holds for each crid
% of a swept-values component with mo... |
58eef8a078bed5e6c25f651e7da1cbfcf108235b14624e49962e091148464a8a | R | 3,059 | 92 | #load libraries
library(magrittr)
library(pheatmap)
library(tidyverse)
#CONSTANTS
outfileBase <- "03_NCATS_ATAC_"
#create a list of the contrasts to loop through
contrasts <- c("A1_vs_NCRM5", "D30_vs_A1", "D30_vs_NCRM5", "D50_vs_D30", "D50_vs_NCRM5", "LSB_vs_A1", "LSB_vs_NCRM5")
#set a common theme for plotting
myt... |
f9df2b8fdefb4cff51e01985d46b6f387e077c4efbf2d6597ccac9321e19bfce | R | 3,061 | 101 | #' Filter out genes that should not be included
#' in analysis downstream (CM's list)
# THIS CODE TAKES A LONG TIME TO RUN, SO YOU
# SHOULD RUN IT ON THE EC2 AND SPECIFY 7 CORES;
# IT STILL TAKES 10 MIN OR SO TO RUN FOR EACH
# LIST
# req'd pkgs
x <- c("tidyverse", "data.table", "parallel")
sapply(x, library, charact... |
e5dcab9145cb252e7555b69aeb297aafe068be7f62ab7ad9e5e39b5e90e8b16e | R | 3,080 | 57 | #Author: Giacomo Bignardi
#Date: 2023-05-02
#Adapted from Sutherland, Burton et al, 2020, PNAS;
#Function to tidy Variance Component with 95% CI output from the VCA function
#input:bootVCA
VCA_exposure_tidyCI = function(bootVCA, MLM, variable = NA) {
VCAsummary =
data.frame(
Domain = rep(variable,18),
Compon... |
e1dc86e0550b4405931e9dc5ef797d5b47e908bea781f4cd4d46bfbca36f91f1 | R | 3,084 | 126 | ---
title: "MDS stats"
date: "`r format(Sys.time(), '%d %B, %Y')`"
---
# Multi-Dimensional Scaling Stats on PINT ROI locations
```{r}
library(tidyverse)
library(broom)
library(igraph)
library(here)
```
```{r setting paths}
source(here('code/R/settings_helpers.R'))
Yeo7_2011_80verts <- read_Yeo72011_template()
YeoN... |
0c4e7e5b0c9dacf62e71ce7b4525b5c111067d4cd4abf4d1dd69aa740afd018b | R | 3,090 | 53 | ---
title: "Reproducibility"
---
`uwot` relies on the underlying compiler and C++ standard library on your
machine and this can result in differences in output even with the same input
data, arguments, packages and R version. If you require reproducibility between
machines, it is strongly suggested that you stick with... |
93bc99e9276e4d6c31df990196e5a37fe61c3be377f3f9f4e92e5950e536ff84 | R | 3,105 | 99 | .split_component_name <- function(split, component) {
escape <- function(value) {
gsub("/", "~1", gsub("~", "~0", value, fixed = TRUE), fixed = TRUE)
}
paste0(escape(split), "/", escape(component))
}
.split_recipes <- function(representation) {
fail <- function(message) .abort_category("unsupported-decoder... |
69bce64ea3a48c9649ce9b66106fd2d9510fdfee5b42bb5f1dbdbe1561ee9186 | R | 3,120 | 88 | #############################################
##### Load packages
#############################################
packages <- c("raster", "caret", "readxl")
for(i in 1:NROW(packages)){
if(!require(packages[i], character.only = TRUE)){
install.packages(packages[i])
library(packages[i], character.only = TR... |
3b6e254df6301201dc99d3031fb944669bd55a2139d97b692bb3efb5481151a2 | R | 3,128 | 122 | .validate_delimited_options <- function(options) {
.require_object(options, "decoder options", "datamonger_unsupported_decoder")
supported <- c(
"encoding",
"delimiter",
"header",
"quote",
"escape",
"missing_values",
"row_order",
"columns"
)
required <- setdiff(supported, "missin... |
25e1444e18b0f1b16a15d7b5ca5f964aef230cb938989b64ec59ff42b753f52c | R | 3,147 | 106 | library(uwot)
library(RSpectra)
context("similarity graph")
# #96: more convenient way to just get the high dimensional similarity graph
# Hard way first (by using umap function)
# allow for no initialization if n_epochs = 0
# Allowable but returns nothing of value
expect_warning(
res <- umap(iris10, n_neighbors = ... |
2df3130b256fcf4c469e03240a19edfa765bd41d72f25ef4a2961fd759016f1f | R | 3,189 | 85 | ---
title: "R Notebook"
output: html_notebook
---
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ct... |
9d0283917c78fe1e6f97ac0ee0b4b8dc91789e3e7f6a3d6e2585516397e0f0fa | R | 3,231 | 68 | #' @name getOptimum
#' @title Extract a set of genes that are both highly specific for and highly
#' expressed in a tissue of interest.
#' @description
#' This function ranks genes by their score (as calculated in
#' getTissue()) and extracts the highest scoring genes that are highly specific
#' to the tissue of int... |
090089b7ed6b4ff361563e02e0bfb61b4b2db398cb36e1b32356f25a79a942fe | R | 3,270 | 47 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
connected_components_undirected <- function(N, indices1, indptr1, indices2, indptr2) {
.Call(`_uwot_connected_components_undirected`, N, indices1, indptr1, indices2, indptr2)
}
annoy_searc... |
ab17456609d467b38d75f255f4466b365779b82266c6f187c265bc45b459d30b | R | 3,281 | 86 | ---
title: "Timing methods in CellBench"
author: "Shian Su"
date: "`r Sys.Date()`"
output: BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{Timing}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
library(CellBench)
```
# Introduction
CellBench provides the abil... |
9b7b2dc198ea1d480dea2454f4ce0467b0ba6b698794a5ccdd7c7616018d6c73 | R | 3,320 | 125 | #' Filter out zero count genes
#'
#' Remove all genes (rows) where the total count is 0
#'
#' @param x the SingleCellExperiment or matrix to filter
#'
#' @return object of same type as input with all zero count genes removed
#' @export
#'
#' @examples
#' x <- matrix(rep(0:5, times = 5), nrow = 6, ncol = 5)
#' filter_ze... |
36da86dfb93f804b830f43704cb53f9a3e32aa3278a4bbe24668ec92bf26b805 | R | 3,328 | 117 | #' Calculate median values by groups
#'
#' @param mat a matrix of numeric values NxM
#' @param groups a vector of size M with annotation of columns in mat
#'
#' @return a matrix with one column per group
medianMatrix = function(mat,groups) {
fgroups = levels(factor(groups))
mat.group <- do.call(cbind, lapply(fgroup... |
f1085875b81612032be57cefa8ce2d96c0199e28f374b37329dcc38caab9e436 | R | 3,334 | 78 | source("local-functions.R")
# dvname = "mean_gait_speed_meter_per_second"
# dvname = "abs_75th_percentile_turning_angle_deg"
# dvname = "amax_landing_impact_g"
# dvname = "amax_max_sensor_lift_cm"
# dvname = "asymmetry_gait_speed_left_right_pe... |
dbe579b03d4a58186138e270df21ada05b6c572ff4f372cc1eb389fc2550402b | R | 3,396 | 76 | read_source <- function(matrix_path, platform_path, phenodata_path) {
lines <- readLines(gzfile(matrix_path), warn = FALSE)
start <- match("!series_matrix_table_begin", lines)
end <- match("!series_matrix_table_end", lines)
stopifnot(!is.na(start), !is.na(end), start < end)
expression <- as.matrix(read.delim(... |
18d479b862139c15d46be65e4e3937cf87962d6f0bb7157a4ec5dd178ed05716 | R | 3,487 | 86 | #load libraries
library(magrittr)
library(clusterProfiler)
library(openxlsx)
library(org.Hs.eg.db)
library(VennDetail)
library(tidyverse)
library(data.table)
GenesToRemove <- fread("./data/refs/Genes_To_Remove_filter.txt")
#CONSTANTS
outfileBase <- "03_NCATS_ATAC_"
#get contrasts based on files that are available
#t... |
8367aaae5dc2670297769920f7befd46ad5b23bb019e227c1a4e46204cdc1abd | R | 3,534 | 104 | ## ##############################################################################
## Author: Karsten Krug
## Purpose: - collection of functions for reading/writing various data formats
library(pacman)
## deal with non-unique rid
parse.gctx2 <- function( fname,
show_modal=FALSE, ##... |
14020fc04c40d418b8abbb2150929b8e8e14324366aed168973ef495701e41ae | R | 3,602 | 87 | ---
title: "Analyzing big single-cell data"
author: "Dvir Aran"
date: "1/18/2019"
output: html_document
bibliography: Citations.bib
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(SingleR)
library(ggplot2)
library(plotly)
library(ggrastr)
path.data = '~/Documents/SingleR/package/SingleR/manu... |
ee2c819c2ea24591a884cf0d1f99721bb5b6c0a70f519601e2c4a84bae454f78 | R | 3,609 | 78 | library(dplyr)
library(argparser)
readdPsi <- function(path) {
dPsi <- read.csv(path, sep = "\t", check.names = F)
dPsi$conditions <- sub("_dPSI", "", colnames(dPsi)[2])
colnames(dPsi)[2:3] <- c("dPSI", "p.val")
dPsi
}
#### CLI ARGS ####
args = commandArgs(trailingOnly = TRUE)
parser <- arg_parser("Argument... |
3c6ea62d6341fb28f6423e06d3181a712013f90421dbbc96601b9a322b10364a | R | 3,618 | 76 | #Author: Giacomo Bignardi
#Date: 2023-05-02
#Function to calculate Variance Components from an MLM
#Adapted from Sutherland, Burton et al, 2020, PNAS; and Martinez et al. 2020, Behav Res Methods
#input: lmer() intercept only model e.g. lmer(Rating ~ 1 + ((1|Sub) + (1 |Obj) + (1|Sub:Obj) + (1|Block) + (1|Block:Sub) + (1... |
58082e2741f86630483630a1f2fc5476351e52fc8a706cea738b26df5f945768 | R | 3,645 | 168 | ---
title: "Figure_2_b_c"
author: "Brett Hale"
date: "6/14/2022"
output: html_document
---
```{r}
library(DESeq2)
library(tidyverse)
library(ggplot2)
library(RColorBrewer)
library(DESeq2)
library(dplyr)
library("edgeR")
library("statmod")
#import data matrix
# tidyverse core packages
library(tibble)
library(dplyr)
... |
a3541ab54ba95a62c0cdc4e9a027a92cd7daf54fedb3fee7b03e9292e14dafd5 | R | 3,655 | 97 | log <- file(snakemake@log[[1]], open = "wt")
sink(log)
sink(log, type = "message")
message("CONFIGURATION STEP")
# A. Parameters:
# 1. Load libraries.
suppressMessages(library("Seurat"))
# 2. Folder configuration.
dir.name = snakemake@params[["output_dir"]]
folders = c("1_preprocessing", "2_normalization", "3_clus... |
b29e185f71492b5a6665df35e1dfad46aa6732bbd223cd9c736a905fcb6c5657 | R | 3,657 | 109 | ---
title: "Figure_2e"
author: "Brett Hale"
date: "8/17/2022"
output: html_document
---
```{r}
library(dbplyr)
library(dplyr)
library(ggplot2)
library(devtools)
library(ggrepel)
```
```{r}
`20220716_KEGG_cluster_df` <- read.csv("/Volumes/USB20FD/PhD Research/Chapter_2/20220716_KEGG_cluster_df.csv", stringsAsFactors=... |
59d9f6ca5b208e0d1079c6aee1e314385def0d66c4d48c2a07651036d85d4ba6 | R | 3,665 | 94 | ###########load data###########
#friendship
friend <- read.csv('friend_baseline.csv')
#mental health
mh <- read.csv('cbcl_baseline.csv')
#cognition
cog <- read.csv('tbss_baseline.csv')
#covariates
covs <- read.csv('cov_beh_baseline.csv')
covs$eth <- as.factor(covs$eth)
covs$site <- as.factor(covs$site)
#Da... |
cc9a90f7558ee1c0ee3ca8d2b3fbd26c73a5f6d02480c8dec150f2a1a37b4bee | R | 3,692 | 145 | # Small -ve distances are possible
dist2 <- function(X) {
D2 <- rowSums(X * X)
D2 + sweep(X %*% t(X) * -2, 2, t(D2), `+`)
}
# Squared Euclidean distances, ensuring no small -ve distances can occur
safe_dist2 <- function(X) {
D2 <- dist2(X)
D2[D2 < 0] <- 0
D2
}
# convert dataframe to distance matrix
x2d <- f... |
8247066e1bc0480fba9b37b2fd5fa05c00685156bfe539c0606d4281f754fa52 | R | 3,747 | 105 | #############################################
##### Load packages
#############################################
packages <- c("raster", "caret", "readxl")
for(i in 1:NROW(packages)){
if(!require(packages[i], character.only = TRUE)){
install.packages(packages[i])
library(packages[i], character.only = TR... |
0fdee18338e78bbd84dc5dfd58fc07c484bfcf62bb1257f2fbb304818dee2832 | R | 3,752 | 104 | test_that("all delimited and LIBSVM cases match shared golden digests", {
document <- read_fixture_json("conformance", "cases.json")
expect_identical(document$schema_version, 1L)
expect_identical(document$canonical_form, 1L)
for (case in document$cases) {
recipe <- case$recipe
decoded <- switch(
... |
0214294f99315cb162145f12a2530a54c2600d375a30056adcf6ad67048fe7ce | R | 3,770 | 72 | test_that("citations preserve roles, instructions, and upstream recommendations", {
cache_dir <- tempfile("datamonger-citations-")
seeded <- seed_conformance_cache(cache_dir)
index <- seeded$index
index$schema_version <- 2L
index$datasets[[1]]$schema_version <- 2L
records <- list(
list(citation = "Datas... |
ea65f1df370ead98543b7b977899ab87fdf23048be06f68970ab8060c800a96f | R | 3,783 | 100 | #' SingleR: A package for reference-based single-cell RNA-seq annotation
#'
#' @docType package
#' @name SingleR
NULL
#' Immgen reference dataset for mouse
#'
#' @format A list with the following items:
#' \describe{
#' \item{data}{Gene expression data matrix}
#' \item{types}{vector of annotation per column in th... |
aa45e347f2d5967b23774e0e349405cf8d6b3c71171e84d9276cfcd6f6fd7db0 | R | 3,812 | 170 | nndescent_nn <- function(X,
k = 10,
metric = "euclidean",
nn_args = list(),
n_threads = NULL,
n_build_threads = NULL,
ret_index = FALSE,
verbose ... |
f20b2ff05e37821d27398f296c7d4036f30aeedef6fbd42472bf3072484fc756 | R | 3,813 | 91 | setwd("~/Data_Visualization/EskelandLab/Github/NeuroDiffParacet/Shiny_timepoint/scRNANeuroDiffParacetD7D20/output/plots/")
library(Seurat)
library(speckle)
library(limma)
library(ggplot2)
currentjob="Revision Paracet"
DimPlot(NeuroDiffParacet.qcFilt, label = TRUE, label.size = 4, reduction = 'umap', group.by = 'orig.id... |
8b916f7f7f6e51499cb00f013abf9723230655f3684e98670c94b26c84e6f644 | R | 3,863 | 116 | dvs = c("gait_speed_meter_per_second", "stride_length_cm", "max_sensor_lift_cm", "PC_1")
tests = c("gait", "tug", "fast", "normal", "slow")
dvs = c("gait_speed_meter_per_second")
tests = c("fast", "normal", "slow")
lme_plot <- function(dvname, test, saveplot=TRUE, conds = "all", title = "", skipxlabel=FALSE){
# l... |
ef43b76c2f708abb3b08c4edd30e3f1f493ad3ee5f4cdbee9c2e62df05a4987e | R | 3,875 | 99 | load("/Volumes/ncatssctl/NGS_related/BulkRNA/ISB025/ISB025_Vukasin/Analysis/Vukasin.DDS.RData")
dds.subset <- dds[ , dds$condition %in% c("NCRM5_astro_D0", "NCRM5_astro_D4",
"NCRM5_astro_D7","NCRM5_astro_D14",
"NCRM5_astro_D21", ... |
6844035fa9363c7f52eeceaa53d278901b7ea64101119d7345e1d86211594076 | R | 3,892 | 114 | #' Re-run DESeq-2 on filtered MeDIP-Seq peaks
#' found in at least 2 replicates
# req'd pkgs
x <- c("ggplot2", "tidyverse", "DESeq2",
"data.table", "tidyverse",
"GenomicRanges", "IRanges", "extrafont",
"extrafontdb")
sapply(x, library, character.only = TRUE)
loadfonts()
source("./functions/adj... |
30cb3bf86391f62920ebdc50cb16eedcc8e0b419f78777bf5dd89f5a1e26d095 | R | 3,908 | 104 | library(openxlsx)
library(magrittr)
library(ggplot2)
library(tidyverse)
#CONSTANTS
outfileBase <- "03_NCATS_ATAC"
mytheme <- theme(plot.title = element_text(lineheight = 0.8, size = 20, family = "NotoSans-Bold"),
axis.text = element_text(size = 14, family = "NotoSans-Condensed"),
a... |
d3528a25cb8c1a95fd08a40df92f01a91168b86e2619b648de0d117fb1fd1a4c | R | 3,967 | 100 | # After slidingWindow_count.py, count co-occurence of CD47 and PHF1Tau pixel clusters
# Author: Candace Liu
# Date: 4/20/21
library(data.table)
library(ggplot2)
library(RColorBrewer)
library(viridis)
library(gridExtra)
window_size = 6
counts_filen = paste0('slidingWindow_size',window_size,'_counts.csv')
pheno1_name =... |
fe03fdb91401243d52d3dae15ad6bc2b3a5a3f143dd551a7d5dfadc6737f39a7 | R | 4,027 | 93 | wd <- "D:/Dateien/Studium_KIT/Master_GOEK/Masterarbeit/dat/clm/use"
db_fig_dir <- "C:/Users/Manuel/Dropbox/Apps/Overleaf/Masterarbeit/fig"
D_fig_dir <- "D:/Dateien/Studium_KIT/Master_GOEK/Masterarbeit/fig"
require("lubridate")
T_Marken <- read.csv(file.path(wd, "Temperature_marken.csv"))
T_Marken$Date <- as.Da... |
6cf6859b93dc939b8b853342e9e15756a428c44679d2631b62f74adafbf994dd | R | 4,035 | 111 | ---
title: "Writing Wrappers"
author: "Shian Su"
date: "`r Sys.Date()`"
output: BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{Writing Wrappers}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
library(CellBench)
library(purrr)
```
# Introduction
This vignette... |
6fc6d90aae2173335a042e781639f90c5220f25481b3162a4c140c5fd7dd8376 | R | 4,119 | 100 | dvs = c("gait_speed_meter_per_second", "stride_length_cm", "max_sensor_lift_cm")
tests = c("fast", "normal", "slow", "tug", "gait")
# Use these for the additional analysis of the "free" condition
#dvs = c("max_sensor_lift_cm")
#tests = c("free")
lme_model <- function(dvname, testname, save = FALSE, padj = "fdr"){
#... |
684cd00a98baed15f671f3abc17040ca930fa23500e95abd30393eedb3b5ba06 | R | 4,124 | 147 | #' Time methods
#'
#' time_methods() take either lists of datasets or benchmark_timing_tbl objects
#' and applies a list of functions. The output is a benchmark_timing_tbl where
#' each method has been applied to each dataset or preceding result. Unlike
#' apply_methods(), time_methods() is always single threaded as to... |
ce71a822921254cf9c13cb5d6eb560cfa894a2a502c4b5e5b99fd864e1d65580 | R | 4,149 | 116 | require(Seurat)
require(data.table)
library(Hmisc)
setwd('/Volumes/ncatssctl/NGS_related/BulkRNA/ISB009/analysis/UCSC_Cell_Browser_dataset/')
mat <- fread("zcat < exprMatrix.tsv.gz")
mat <- as.data.frame(mat)
row.names(mat) <- mat$gene
mat <- mat[-1]
meta <- read.table("meta.tsv", header=T, sep="\t", as.is=T, row.name... |
02c14a14452ab9e33f30673207ccfcc036295acc97a539ceb634b80d20dd6b68 | R | 4,161 | 102 | library(uwot)
library(RSpectra)
context("normalized laplacian")
# this exists as a separate file only because it's easier to comment out as
# part of temporarily removing any function calls to rspectra when using rhub
# with sanitizers and valgrind (probably the extended compilation time with
# eigen causes a preperro... |
c51b0d68a7406b7d37b5ef4a0b9c21db487148472f63f2e6fd9da2a927f18602 | R | 4,201 | 126 | library(tidyverse)
library(cowplot)
#===============================================================================================
# Looking how predicted amino acid distributions relate to CNN confidence
#===============================================================================================
fills <- c("#... |
50dcfece72566620045bd2329ead5137ee6bc6c50d13d5bcaafcd6b243cb4568 | R | 4,206 | 115 |
#!/usr/bin/env Rscript
#module load R/4.0.2
# Use arguments:
args<-commandArgs(TRUE)
# args[1] = input table of counts
# args[2] = minimum CPM to consider expression
# args[3] = minimum samples to contain gene so it is considered for analysis
# args[4] = number of genes or transcripts in the table
# args[5] = sampl... |
836d1deae30aec6ce449ad78899a7a23251d24c8f1c1817f6181bcc63aa9f336 | R | 4,241 | 133 | .citation_metadata <- function(dataset) {
provenance <- .require_object(dataset$provenance %||% list(), "provenance")
fields <- names(provenance)
fail <- function(message) .abort_category("unsupported-registry", message)
nonempty <- function(value, field) {
value <- .require_string(value, field)
if (!nz... |
5a39bca150c8e022e4a9117f0b9ab14121b77b001b861264dba69b083bd6f249 | R | 4,248 | 120 | #' Perform GSEA for GO/KEGG across all contrasts
# req'd libs
x <- c("magrittr", "clusterProfiler", "openxlsx",
"msigdbr", "tidyverse", "Cairo", "data.table",
"enrichR", "DOSE")
sapply(x, library, character.only = T)
#set a common theme for plotting
mytheme <- theme(plot.title = element_text(lineheight ... |
cb5953188003049601ba463516bdc456a15feac3944318504fbe06bda1879417 | R | 4,257 | 124 | #' Build top 50 heatmaps from normalized counts
#' across all contrasts
# req'd pkgs
x <- c("magrittr", "pheatmap", "tidyverse", "data.table",
"RColorBrewer", "scales", "grid")
sapply(x, library, character.only = TRUE)
# source custom fxns
source("./functions/save_pheatmap_pdf.R")
#set a common theme for plot... |
74fc0353ec6c38ffe0d7f81c41db9b51134e0455289c62be3a74616e15d41970 | R | 4,268 | 90 | library(rtracklayer)
library(GenomicRanges)
library(biomaRt)
#### CLI ARGS ####
args = commandArgs(trailingOnly = TRUE)
parser <- arg_parser("Argument parser for differenial splicing analysis", name = "DE_parser")
parser <- add_argument(parser, "-m", help = "Meta data for expressions in tsv")
parser <- add_argument(p... |
088349ee9adaafd8a785bf31a3459ef00b8b9f615e1151993eaa4dd20ffcb821 | R | 4,346 | 100 | library(mediation)
######Load data
#friendship
IDV <- read.csv("med_IDV_less5.csv")
#covariates
COV <- read.csv("med_cov_less5.csv")
COV$eth <- as.factor(COV$eth)
COV$site <- as.factor(COV$site)
COV$hand <- as.factor(COV$hand)
COV$mri <- as.factor(COV$mri)
#significant brain area
Area <- read.csv("med_sigA... |
d41f28210c580cdb5610afcae483e5d24db2965d7fb245a82dff2249cb4d2dea | R | 4,375 | 132 | library(data.table)
library(purrr)
library(Seurat)
library(ggplot2)
library(gridExtra)
library(MOFA2)
library(ggrepel)
library(ggpubr)
library(GGally)
colours=c("#FFFF00","#1CE6FF", "#FF34FF","#FF4A46","#008941","#006FA6","#A30059","#FFDBE5","#7A4900","#0000A6","#63FFAC","#B79762","#004D43",
"#00C2A0","#FFAA... |
6c5c7605232d7bf106fa653af1ab86440b839c4740c631fccbbfd0cb338ee6f0 | R | 4,383 | 121 | local_constants <- function(){
out = list()
# set paths dependent on user
out$paths =list()
if(Sys.info()["user"] == "urs"){
out$paths$root = "/home/urs/sync/projects/DBSgait"
out$paths$data = file.path(out$paths$root, "data" )
out$paths$results = file.path(out$paths$root, "results")
out$paths$img ... |
88e231ca03043d5a0bb75486b327943944e6c8524c85da32e7f9e795c3da7194 | R | 4,396 | 158 | context("Supervised")
# categorical y
res <- umap(iris10,
n_neighbors = 4, n_epochs = 2, learning_rate = 0.5, min_dist = 0.001,
init = "rand", verbose = FALSE, n_threads = 1, y = ycat
)
expect_ok_matrix(res)
# numeric y
res <- umap(iris10,
n_neighbors = 4, n_epochs = 2, learning_rate = 0.5, min_dist = 0.001,
... |
010151d01b17e1a54ceb75899a8e4b348730c5b71eac6492070fc7993f19fd08 | R | 4,408 | 123 |
#!/usr/bin/env Rscript
# module load R/4.0.2
# Load libraries:
library(melange)
library(dplyr)
library(Seurat)
library(patchwork)
library(ggplot2)
library(clustree)
library(stringr)
# WARNING!!!dims = 1:N
# --- Edit --- Replace through the file:
# Find "dims = 1:N"
# Replace by "dims = 1:X"
# Reload the object:
r... |
281c3363d8538c00a2af89f4c44f55c1906d50287f509542b22e2102ede7f347 | R | 4,408 | 123 |
#!/usr/bin/env Rscript
# module load R/4.0.2
# Load libraries:
library(melange)
library(dplyr)
library(Seurat)
library(patchwork)
library(ggplot2)
library(clustree)
library(stringr)
# WARNING!!!dims = 1:N
# --- Edit --- Replace through the file:
# Find "dims = 1:N"
# Replace by "dims = 1:X"
# Reload the object:
r... |
34d6f883fbb03e071f260edaf0962836cc899c184c91ec17c817b14b396c5937 | R | 4,473 | 235 | ---
title: "R Notebook"
output:
html_document:
df_print: paged
---
# whole brain prediction
```{r message=FALSE, warning=FALSE}
library(here)
library(tidymodels)
library(vip)
library(tidyverse)
library(kernlab)
```
```{r}
knitr::opts_chunk$set(dev = "png", dev.args = list(type = "cairo-png"))
```
```{r settin... |
5f40b58f6da20f0af4b4f81b57ab78012aafc5aefc6595b8a52ce692ff5bbb51 | R | 4,479 | 74 | #We start with the 10th rank analysis
#Import dataset - Both the Kenyan and Zimbabwean
require(lme4)
require(emmeans)
require(car)
require(ggplot2)
rank_10_Ken <- read_excel("~/Documents/MSc/Project/Final_Results.xlsx", sheet = "Rank_10_Ken", range = "B2:D522")
rank_10_Zim <- read_excel("~/Documents/MSc/Project/Final_... |
0e356468195a5e249cc4fe68b27c0da9fc994eb1c441fd1be00381685d73c25e | R | 4,486 | 150 | 'Calculating boots from for DX cohens D Schaefer
Usage:
naval_fate.R <iteration>
Options:
-h --help Show this screen.
' -> doc
# install.packages('docopt', lib = "/home/edickie/R/x86_64-pc-linux-gnu-library/4.1")
# install.packages('tidyverse', lib = "/home/edickie/R/x86_64-pc-linux-gnu-library/4.1")
# inst... |
f39831fb53e17665d044beef5a45e8f519e58adf68ef64a5ed14be2a0fbe2594 | R | 4,570 | 111 | #' Make the super swirly YeoNet7 fancy plot
#'
#' @param lm_df a dataframe built by running broom on an lm for all edges
#' @param pos_label the text label (string) describing the positive effect
#' @param neg_label the text label (string) describing the positive effect
#' @param plot_title title on the plot
#' @param ... |
f0893ed0672f0ec0b25026089b0d9de193b339fc6425ea8953a2e8dde8b36163 | R | 4,586 | 106 | #Author: Giacomo Bignardi
#Date: 2023-02-13
#Function to calculate Variance Component from an MLM
#input: lmer() intercept only model e.g. lmer(Rating ~ 1 + ((1|Sub) + (1 |Obj) + (1|Sub:Obj) + (1|Block) + (1|Block:Sub) + (1|Block:Obj)),data=yourData)
rcVCA = function(mlm, null = T, nullmodel) {
if (null == T){
#... |
19ac534a9ee825075360e917f5b68429fb42d68f853331282f4ec74b0d80b30b | R | 4,617 | 153 | 'Calculating boots from for DX cohens D
Usage:
naval_fate.R <iteration>
Options:
-h --help Show this screen.
' -> doc
install.packages('docopt', lib = "/home/edickie/R/x86_64-pc-linux-gnu-library/4.1")
install.packages('tidyverse', lib = "/home/edickie/R/x86_64-pc-linux-gnu-library/4.1")
install.packages('h... |
d3b72622fc076ee011cc1e8b368726b293dcbe1dc6e3df8b0c39265c3654e59d | R | 4,625 | 139 | ### This script creates a dataset containing all subjects of interest (CamCAN data) including
### frequency-specific global values for MEG connectivity and power and demographic information
### Written and modified by Christina Stier, 2021/2022
### R Studio 3.6.3 (2020-02-29)
### RStudio 2021.09.0+351 "Ghost Orchid" R... |
4a92fb7a609e362805094ac209920fc702927e4a63cb245e02693ee3b0b8a4df | R | 4,702 | 108 | #!/usr/bin/env Rscript
# majority vote
library(BiocGenerics)
library(data.table)
library(stringr)
library(RColorBrewer)
library(VennDiagram)
library(argparser)
# parse arguments
args = commandArgs(trailingOnly = T)
parser <- arg_parser("Majority vote parser", name = "majority")
parser <- add_argument(parser, "--miran... |
676407c51793f3751f33c2a794b4abd48f76f99fb4cb46cb799303d7a734cf0e | R | 4,729 | 180 | #' @importFrom rappdirs user_cache_dir
#' @importFrom BiocFileCache BiocFileCache
.get_cache <- function() {
cache <- rappdirs::user_cache_dir(appname = "CellBench")
BiocFileCache::BiocFileCache(cache)
}
#' @importFrom BiocFileCache bfcquery bfcadd bfcrpath
#' @importFrom glue glue
#' @importClassesFrom Single... |
e2495f51d034d95d7e5264d240457e24753f3751f15ba36e26436f125dd15b29 | R | 4,738 | 130 | #!/usr/bin/env Rscript
suppressMessages(library(AnnotationHub))
suppressMessages(library(assertr))
suppressMessages(library(Biostrings))
suppressMessages(library(GenomicRanges))
suppressMessages(library(Matrix))
suppressMessages(library(optparse))
suppressMessages(library(SingleCellExperiment))
suppressMessages(librar... |
018ba3d2b119d1df54a534041a3d558b05f5c6e1a416ca915f20706b19cf2a50 | R | 4,819 | 134 | # After slidingWindow_count.py, make co-localization heatmap and venn diagram
# Author: Candace Liu
# Date: 4/20/21
library(data.table)
library(ggplot2)
library(RColorBrewer)
library(viridis)
library(gridExtra)
library(ComplexHeatmap)
library(VennDiagram)
window_size = 6
counts_filen = paste0('slidingWindow_size',win... |
936b870a82027095043be893a545b01e7337b5f16660c32907453433347c4d2b | R | 4,827 | 90 | seed_split_case <- function(case, cache_dir, compression = "none") {
dataset <- case$manifest
directory <- file.path(cache_dir, "objects", "sha256")
dir.create(directory, recursive = TRUE, showWarnings = FALSE)
for (i in seq_along(dataset$artifacts)) {
artifact <- dataset$artifacts[[i]]
path <- fixture_... |
1b93b8ff7739cd17220e41c5f7a013360792201132870761b39453fa68b78deb | R | 4,830 | 145 | #load libraries
library(magrittr)
library(ggplot2)
library(Rtsne)
library(variancePartition)
library(tidyverse)
#CONSTANTS
#set a constant to attach to file names
outfileBase <- "03_NCATS_ATAC"
#set a common theme for plotting
mytheme <- theme(plot.title = element_text(lineheight = 0.8, size = 20, family = "NotoSans... |
493ee65ffeccdf8b0c4e8e4bb9de7300a38ccdb3f7e919f1ff6b4bdb49ef8482 | R | 4,857 | 237 | ---
title: "06b_prediction"
author: "Erin Dickie"
date: "5/2/2020"
output: html_document
---
# whole brain prediction
```{r message=FALSE, warning=FALSE}
library(here)
library(tidymodels)
library(vip)
library(tidyverse)
library(kernlab)
```
```{r setting paths}
# These functions are for reading timeseries files
sou... |
f31e576c2129927497c10b38aa29d1d420350bfac54f735fcf8908bc301ad079 | R | 4,918 | 146 | # fuzzy set data for iris10 with 4 neighbors
# numbers have been compared with python fuzzy_simplicial_set
# Asymmetric fuzzy set data
V_asymm <- Matrix::sparseMatrix(
i = c(
5, 6, 8, 3, 9, 10, 2, 4, 7, 9, 10, 2, 3, 7, 9, 10, 1, 6, 8, 3, 5, 1,
5, 6, 7, 4, 1, 2, 4, 8
),
j = c(
1, 1, 1, 2, 2, 2, 3, 3, ... |
c1ee7b824e7c29a3aaeb40c484d0bbd6f2f3b577f4337246f4de35848f2a432b | R | 4,924 | 126 | #Author: Giacomo Bignardi
#Adapted from: Vessel et al.(under review) https://psyarxiv.com/pnu3r/
#Date: 02-05-2023
#Description:
#Apply relative contribution to Variance Component Analysis (rcVCA) to get an approximate estimate of the amount of covariance between any given fixed effect IV an VPC
#Program: rcVCA ------... |
12ea56429cc01902bf3b5cdb7bded4a5e405e9e18078493809a75292e31d638b | R | 4,940 | 147 | slf <- function(){source("local-functions.R")}
msg <- function(..., verbose = TRUE, newline = TRUE, sep = " "){
if(verbose) cat(paste(..., sep = sep))
if(newline) cat("\n")
}
ipak <- function(pkg){
# taken from https://gist.github.com/stevenworthington/3178163
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Pac... |
8680ae94eb318b898f9f4f76b073bfb64e04f7e4cc9e0f9e0c25544b3c46a279 | R | 4,979 | 124 | #############################################
##### Load packages
#############################################
packages <- c("raster", "ggplot2", "vegan", "dplyr", "ggdendro", "stringr")
for(i in 1:NROW(packages)){
if(!require(packages[i], character.only = TRUE)){
install.packages(packages[i])
library... |
0180236f89b7d984196d4bfd36a1f2626e377d93a1f1075518538e994e848ae4 | R | 4,988 | 132 | #Source:
#https://rdrr.io/github/aet21/SCENT/f/vignettes/SCENT.Rmd
# Input File (for example):
#cd /working/lab_julietF/mainaB/Project_NormalBreast/scRNAseq/Individuals1to3/BowtieRsem_GencodeAll/Stemness
module load R/4.0.2
library(SCENT);
data(net13Jun12);
data(net17Jan16);
print(dim(net13Jun12.m));
# [1] 8434 8434... |
2e822231d8a349c236a03700eb8dd70e6b6ac8c904e19a4c83130acd205703ad | R | 5,010 | 83 | ################################################################################
### R script to compare several conditions with the SARTools and DESeq2 packages
### Hugo Varet
### April 20th, 2015
### designed to be executed with SARTools 1.2.0
##########################################################################... |
9386c9444e8631de2d0a29ab420250e8ab1b4cace3b273ab6f367006a06c606b | R | 5,012 | 83 | ################################################################################
### R script to compare several conditions with the SARTools and DESeq2 packages
### Hugo Varet
### April 20th, 2015
### designed to be executed with SARTools 1.2.0
##########################################################################... |
3260f2386c1ee06e708507467b1617688749dfc17ee6c6169cd1c4a6c1c46cde | R | 5,026 | 121 | ---
title: "Figure_S1"
author: "Brett Hale"
date: "12/24/2022"
output: html_document
---
```{r packages}
library(ggplot2)
library(dbplyr)
library(dplyr)
library(devtools)
library(tidyverse)
library(scales)
```
```{r Reference}
##Data
Figure_S1_Capture_Reference <- read.csv("~/Downloads/Figure_S1_Capture_Reference.csv... |
f4b186cefeaf712c212b384492e4363ab27737d278ce99d866ef6008a663809e | R | 5,031 | 144 | library(pacman)
#p_load(cmapR)
p_load(magrittr)
p_load(limma)
p_load(pheatmap)
#setwd('h:/LabMembers/Karsten/Projects/CPTAC3/PTRC/Westbrook/20180817_limma/')
#source('c:/Users/karsten/Dropbox/Devel/R-code/my_io.r')
##gct.in <- 'proteome-ratio-norm-NArm-UP2_PTPN12status.gct'
#gct.in <- c(
#
# Proteo... |
ccc9f762d5d7b2f2c4da5b5a9743fc97f051041f2d6df32f114feb193fe72b23 | R | 5,071 | 142 | ### This script plot global connectivity values across age ranges for each frequency band separately
### Written and modified by Christina Stier, 2021/2022
### R version 3.6.3 (2020-02-29)
### RStudio 2021.09.0+351 "Ghost Orchid" Release (077589bcad3467ae79f318afe8641a1899a51606, 2021-09-20) for macOS
### Mozilla/5.0 ... |
a6977e3a0aff08e3025152f3e10758f8044bb27abca7bd1ada18748017bf8ccf | R | 5,076 | 115 |
---
title: "Walkthrough with kidney dataset"
author: "Suoqin Jin, Lihua Zhang"
output: html_document
mainfont: Arial
vignette: >
%\VignetteIndexEntry{Integrative analysis of single cell multi-omics data using scAI}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include = FALSE}
kn... |
edc1356d7b0c69dc497d3796b83f6409e9a2043ac03ef0dfcf39c50f1ef642d3 | R | 5,130 | 106 | library(dplyr)
library(stringr)
library(EnhancedVolcano)
library(biomaRt)
library(ggplot2)
library(ggpubr)
library(reshape2)
library(MetBrewer)
library(argparser)
annotatePsi <- function(psivec) {
psivec[,c("gene_id", "transcript_id")] <- str_split_fixed(rownames(psivec), ";", 2)
psivec$transcript_type <- ifelse(... |
08b8a8a28cf8c62043efb0aec594490389c5a2a5bde10e98416f962df4b4a8de | R | 5,138 | 124 | #!/usr/bin/env Rscript
install.packages("pacman")
pacman::p_load(BSgenome, AnnotationHub, argparser, ggplot2, biomaRt, ensembldb, Biostrings)
ah <- AnnotationHub(ask = F)
args = commandArgs(trailingOnly = TRUE)
parser <- arg_parser("Argument parser for circRNA quantification", name = "quant_parser")
# ARGS
parser ... |
cb8da7a538e11385652d3814e37d7c4b524c1e3d0b37e08ab4716f53a76b1353 | R | 5,153 | 149 | dvs = c("gait_speed_meter_per_second", "stride_length_cm", "max_sensor_lift_cm", "PC_1")
tests = c("gait", "tug", "fast", "normal", "slow")
dvs = c("gait_speed_meter_per_second")
tests = c("fast", "normal", "slow")
sig_lines <- function(sig, xpos, yul, yll, sigstep = .06, sigoff = .01, xoff = 0, reverse = FALSE
... |
e9662b50ad1f50a12ed333b34c34878560aab9dbffae80be9aca0a88e3faa054 | R | 5,229 | 75 | ---
title: "Performance"
---
## Performance
*December 31 2018* Updated timings, keeping better track of versions numbers.
To get a feel for the performance of `uwot`, here are some timings for
processing the MNIST dataset, compared with some other methods. I wouldn't take
them very seriously, but they show that `uwo... |
4617568fe6b8e46f592740e33524cd8cd2ef66a89ac3f57a4c667a5348655d23 | R | 5,234 | 92 | #' CS-CORE for cell-type-specific co-expression network inference
#'
#' Run CS-CORE on a Seurat object to infer the cell-type-specific co-expression network for a specified set of genes,
#' with optional adjustment for covariates.
#' For more details on the covariate adjustment and the moment-based regression,
#' pleas... |
cabafea10cb449a2dad6e7ec9d97a175fcad3d75cf05245ebb360f64b512311b | R | 5,240 | 147 | ### This script plot global power values across age ranges for each frequency band separately
### Written and modified by Christina Stier, 2021/2022
### R version 3.6.3 (2020-02-29)
### RStudio 2021.09.0+351 "Ghost Orchid" Release (077589bcad3467ae79f318afe8641a1899a51606, 2021-09-20) for macOS
### Mozilla/5.0 (Macint... |
2a63db8bd3f31e162b5b951ae156fb6f669149ea233f9696cf0dd990a04d2df8 | R | 5,263 | 130 | #' Iteratively reweighted least squares (IRLS) procedure in CS-CORE (base R, archived)
#'
#' This function was originally implemented in 2023 and included in the first release of the CS-CORE R package.
#' It has since been replaced by \code{\link{CSCORE_IRLS}} for two main reasons:
#'
#' \enumerate{
#' \item It relie... |
89f4b648c56143272924a22979e62ae300d0c1418ae2d6d7ece3104b171b537d | R | 5,302 | 160 | library(uwot)
context("fuzzy simplicial set")
### Various fuzzy set matrices are defined in helper_fuzzy_sets.R
# matrix
# same as
# umap.umap_.fuzzy_simplicial_set(iris10, 4, random_state=42, metric="euclidean")
# as of 0.5 (and even earlier)
res <- fuzzy_simplicial_set(
set_op_mix_ratio = 1, local_connectivity = ... |
0e41641030f6baaa2237a03e33926778da8aeb0e8cf3f5d28d69c49f91f48db5 | R | 5,360 | 113 | #UMAP by cell classes (grouping related Seurat clusters)
#1A - Illustration of experiment generated in Biorender
#1B - Illustration of human-mouse synteny generated in Adobe Illustrator
#1C - Human Cortical Organoid UMAP by cell class:
library(Seurat)
library(ggplot2)
sub_obj2 <- readRDS(file = "~/Desktop/Purcell 20... |
5fd7a6dcbe59e454059d19561d476a905a1dc9f4e22577682d144e7f20fb4c37 | R | 5,379 | 185 | ---
title: "GO analysis"
author: "Asela Wijeratne"
date: '2023-5-26'
output: html_document
editor_options:
markdown:
wrap: 72
---
```{r}
library(stringr)
library(dplyr)
library("ggbeeswarm")
library("pheatmap")
library(ggplot2)
library(edgeR)
library(reshape2)
library(rlist)
library(dplyr)
library(tidyverse)
l... |
2ad7a7cd1ec1ce8d07ec086be2df93f1200a8d14a4ab042d1abdf26614cff95d | R | 5,380 | 116 | log <- file(snakemake@log[[1]], open = "wt")
sink(log)
sink(log, type = "message")
message("CONFIGURATION STEP")
# A. Parameters:
# 1. Load libraries.
suppressMessages(library("Seurat"))
suppressMessages(library("dplyr"))
suppressMessages(library("data.table"))
suppressMessages(library("reticulate"))
suppressMessage... |
faf696ee4a5c0e4557889e5ce517444f722cdfa4950ee9de478f9d5c89991149 | R | 5,408 | 122 | #Author: Giacomo Bignardi
#Adapted from: Bignardi et al.(under review) https://psyarxiv.com/79nbq
#Date: 02-05-2023
#Description:
#Apply Variance Component Analysis (VCA) to partition sources of variance in aesthetic ratings
#Partially adapted from: Martinez et al., 2020; Sutherland, Burton et al., 2020
#Program: VCA... |
c8bfbd5a8dc9484dfa0b5896d01c85f6bfd6eade5d8f32df717ba4efe7b8b064 | R | 5,449 | 116 | ---
title: "Embedding New Data"
subtitle: "Out of Sample Data"
---
Note: some of this information is repeated from the [metric learning article](https://jlmelville.github.io/uwot/articles/metric-learning.html), an
article so poorly-titled that I was unable to find where I had discussed
transforming new data. [As reque... |
0cdfed96d6e9907f5b0d5fc2b332ecef030b623906e1e1950e57f3a2e6dc63ee | R | 5,492 | 238 | context("Apply methods")
test_that(
"Apply methods works for most basic case", {
x <- list(
data = c(1, 2, 3)
)
f_list <- list(
mean = mean
)
expected <- structure(
list(
data = structure(1L, .Label = "data", class = "factor"),
f_list = structur... |
bd52978a58c503237b2e7d574ca6756b786fc2f9772632bdf58684d103ec258a | R | 5,494 | 155 | library(SingleR)
library(Seurat)
library(reshape2)
library(ggplot2)
library(directlabels)
dirs = dir(paste0('~/Documents/SingleR/10X_sorted'),full.names=T)
dirs = dirs[-2]
tenx1 = Combine.Multiple.10X.Datasets(dirs[-c(3,5)],random.sample=50,min.genes=1000)
tenx2 = Combine.Multiple.10X.Datasets(dirs[c(3,5)],random.sam... |
102d58a42a0a318a414f93d92fa20a2eac8aa1146b8d0af465137bcdaa64f158 | R | 5,565 | 210 | context("Utilities")
test_that(
"Matrix head works", {
x <- matrix(runif(100), nrow = 10, ncol = 10)
expect_identical(mhead(x), x[1:6, 1:6])
expect_identical(mhead(x, n = 10), x)
expect_identical(mhead(x, n = 11), x)
y <- c(1, 2, 3)
expect_error(mhead(y), "!is.null(dim(x)) is not TRUE", f... |
ee1f2592696dac7e30131ae1d9673b4118141f7df00ebba347cca5e978843487 | R | 5,597 | 134 | library(ArchR)
suppressPackageStartupMessages(library("argparse"))
#getGeneAnnotation("hg38"#)
addArchRGenome("hg19") #
parser <- ArgumentParser()
parser$add_argument( "--path_data",
help="Directory contining arrow files")
parser$add_argument("--output", default="./data/",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.