sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
60a2355c5d21405f9829f0ebde45fa504a79bf3c67321073cac177ee6c56782d | R | 5,644 | 131 | # This is code to run analyses for the DBS gait project;
# Code developed by Felicitas Muegge, Amelie Heun, Urs Kleinholdermann and David Pedrosa
# switches / flags / constants
normfun = "difference" # "proportion"
# subfunctions
ipak <- function(pkg){ # taken from https://gist.github.com/stevenworthington/3178163
n... |
811131603b6457334d60dcf367381ad70c43df0fd1f83d9f99b66a557d3d0c2f | R | 5,666 | 142 | # Plot mean expression values of the windows
# Author: Candace Liu
# Date: 4/20/21
library(data.table)
library(ggplot2)
library(ggpubr)
library(gridExtra)
library(pheatmap)
window_size = 6
window_exp = fread(paste0("slidingWindow_size",window_size,"_expression_norm.csv"))
window_counts = fread(paste0("slidingWindow_s... |
d21c9b8c77e4a3b3e0771c21a26610581a064f1aed76cff158dfdd150c0e2b50 | R | 5,675 | 154 | #dvs = c("gait_speed_meter_per_second", "stride_length_cm", "max_sensor_lift_cm", "PC_1")
dvs = c("gait_speed_meter_per_second", "stride_length_cm", "max_sensor_lift_cm")
lme_plot <- function(dvname, saveplot=TRUE, conds = "all", title = "", skipxlabel=FALSE){
# load the data
df.fast = read.csv(file.path(loc$pat... |
3c861f59a12aa1658d877594e8839a97013df8dd81c5877666151867f1ab6cea | R | 5,702 | 164 | library(tidyverse)
library(cowplot)
library(ggforce)
#======================
#***BOX SIZE 30*****
#======================
# code for figure 1.
#==============================================================================
# a) Basic stats (% match across all genes)
#=================================================... |
618e165c762406b8ae31fdb39cd841a034095eb2d990c45ba52ebdab94ba4de3 | R | 5,702 | 164 | library(tidyverse)
library(cowplot)
library(ggforce)
#======================
#***BOX SIZE 12*****
#======================
# code for figure 1.
#==============================================================================
# a) Basic stats (% match across all genes)
#=================================================... |
366b4c7dcbe4f8c2cd740ae1b85bca30bb6a83d7375c15316012c53bfb5c08ba | R | 5,708 | 253 | `%||%` <- function(left, right) if (is.null(left)) right else left
.sha256_pattern <- "^[0-9a-f]{64}$"
.identifier_pattern <- "^[a-z0-9][a-z0-9._-]*$"
.version_pattern <- "^[A-Za-z0-9][A-Za-z0-9._+-]*$"
.release_pattern <- .identifier_pattern
.dataset_id_pattern <- paste0(
"[a-z0-9][a-z0-9._-]*:[a-z0-9][a-z0-9._-]*@... |
b8adf70bed9f36e1db5c756f47cfcfd848fcf71dfc5ef36c4727a236cde9de67 | R | 5,738 | 158 |
require('lme4')
require('nlme')
require('lmerTest')
require('pbkrtest')
PFC = 1
VERTEX = 0
data <- read.csv(file="data_for_R_model.csv", sep="\t")
data_raw <- read.csv(file="data_for_R_model_raw_TMS.csv", sep="\t")
data[data$trial <= 225,"session_half"] = 0
data[data$trial > 225,"session_half"] = 1
# Model 1: we... |
b86084986727f357494687ea40e0ebbaa562d927493fdd729e7e4a8897a1e63c | R | 5,810 | 164 | library(tidyverse)
library(cowplot)
library(ggforce)
#======================
#***BOX SIZE 40*****
#======================
# code for figure 1.
#==============================================================================
# a) Basic stats (% match across all genes)
#=================================================... |
31643cf027ad5122bfb68a15e91b20cc2c3a889243563801c5134227bdf12763 | R | 5,846 | 153 | #!/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)
# Import RSEM counts using Melange:
cell.names <- scan("ListOfCellsWithRSEMgeneresults", character(), quote = "")
cell.rsem.file.locatio... |
53067817ee54cdad115013d2fb121e27e34a0d7b273b0311c518e9f582ec7278 | R | 5,846 | 153 | #!/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)
# Import RSEM counts using Melange:
cell.names <- scan("ListOfCellsWithRSEMgeneresults", character(), quote = "")
cell.rsem.file.locatio... |
cf03af41cb06bcceb599e7c0acd859b00410966840547ad386c21bc1a7f254ed | R | 5,873 | 154 | library(uwot)
library(RSpectra)
context("Input validation")
expect_error(umap(X = list(X = "bad", Y = "wrong", nn = "what")), "data format")
expect_error(umap(iris10, n_neighbors = 1, n_threads = 0), "n_neighbors")
expect_error(umap(iris10, n_neighbors = 15, n_threads = 0), "n_neighbors")
expect_error(umap(iris10, set... |
3b1986a6747abfe0a0bfa458ff0ad0776b28c9e075bba7f65454be7d49248b79 | R | 5,882 | 170 | ---
title: "umap2"
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
eval = FALSE
)
```
`umap2` is a new function that works a lot like `umap`, but updates some
defaults to make it easier to use, and to bring it a bit more in line with the
Python UMAP implementation. The main d... |
1a79b74122c741ef35e3052d4d61cd8885d414f0eaf96cf9456b15a19fad59ea | R | 5,897 | 156 | ---
title: "Mixed Data Types"
---
The default approach of UMAP is that all your data is numeric and will be
treated as one block using the Euclidean distance metric. To use a different
metric, set the `metric` parameter, e.g. `metric = "cosine"`.
Treating the data as one block may not always be appropriate. `uwot` no... |
1d82ae7d76fd9febcec8171361e6852b5b71f39bf959193674cde25dcdd7bd7b | R | 5,897 | 151 | # helpers for reading files
output_base <- here('data/processed/mri/')
read_pheno_file <- function() {
pheno <- read_csv(here('data/processed/pheno/20200221_pheno_clinicalplusqa.csv')) %>%
drop_na(DX)
return(pheno)
}
read_Yeo72011_template <- function() {
Yeo7_2011_80verts <- read_csv(here("data/raw/templa... |
bacf9879415fabc951f14de1f09294a6a70cbb418f08f5ddb26e3e39a55edbf6 | R | 5,927 | 165 | library(Seurat)
library(dplyr)
library(ComplexHeatmap)
library(ggplot2)
library(reshape2)
library(biomaRt)
library(ggrepel)
library(corrplot)
library(colorspace)
## Read seurat objects with 10x, sciRNA-seq, spinDrop sorted_not_sorted, technology stored in metadata$data
obj <- readRDS("040722_integrated_data_brain_anno... |
1b66792bb0ab402aac8d7fc0e5be787c3dd1eea018f7967c38008b4943c54be7 | R | 5,990 | 153 | #load libraries
library(magrittr)
library(DESeq2)
library(openxlsx)
library(limma)
library(edgeR)
library(tidyverse)
#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-Bold")... |
5cac7e20f82037cd6a817eff6c1be84e4c6e00ac6ae288e19b25c3543322bbdf | R | 6,048 | 194 | cache_object <- function(cache_dir, namespace, contents) {
digest <- digest::digest(contents, algo = "sha256", serialize = FALSE)
directory <- file.path(cache_dir, namespace, "sha256")
dir.create(directory, recursive = TRUE, showWarnings = FALSE)
path <- file.path(directory, digest)
writeBin(contents, path)
... |
6951b73109d47315e0f5b7e542df5a1eb40b91c00ac7b2955d0b15039d817a1f | R | 6,050 | 194 | # Combine a fuzzy simplicial set with another fuzzy simplicial set
# generated from categorical data using categorical distances. The target
# data is assumed to be categorical label data (a vector of labels),
# and this will update the fuzzy simplicial set to respect that label data.
# TODO: optional category cardinal... |
b49617aa429c5265d2153f6f1a0582c00ad4422071af1f3235a864827d35be27 | R | 6,077 | 134 | #!/usr/bin/env Rscript
library(plyr)
library(dplyr)
library(data.table)
args = commandArgs(trailingOnly=TRUE)
if (length(args)!=4) {
stop("Four argument must be supplied", call.=FALSE)
}
dataset_path = args[1]
miRNA_filtered_path = args[2]
circRNA_filtered_path = args[3]
filtered_bindsites_path = args[4]
dataset <... |
809332e99a03a64e31336cf2bbe9315256fc701a8b71e35fb69e07612f5cf210 | R | 6,109 | 184 | ---
title: "Seedcorr Area Stats"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
keep_md: true
df_print: paged
---
# Seedcorr Area Stats
```{r}
library(tidyverse)
library(broom)
library(here)
```
## The paths to data
```{r setting paths}
source(here('code/R/settings_helpers.R'))
Yeo7_2... |
df8e7988d6ff71d21a18e3261a9ad779d512692eddbd83290b0765fbb0098635 | R | 6,251 | 130 |
---
title: "Walkthrough with A549 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}
knit... |
e53dfd11132e7a4e44b05e821b69d58863079740e61b77498ceb2972317e25fe | R | 6,279 | 230 | ########################################################################
##
## Filename: manage_session.R
## Created: January 10, 2018
## Author(s): Karsten Krug
##
## Purpose: shiny module to manage 'protigy' sessions saved on the server
###########################################################... |
cd36fdceb9a563005f2a74d2f2e85c5ba0da89e1129207d8c66335666ea08476 | R | 6,296 | 209 | ---
title: Getting started with Datamonger
author: Johan Larsson
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Getting started with Datamonger}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Datamonger brings public research datasets into your R analysis. It downloads
the re... |
559baf4fb9b73349a49b3f2464aac84c26f679c182c2b368c7623ad4abb0305f | R | 6,304 | 276 | ---
title: "Double Check Clinical vars"
output:
pdf_document: default
html_notebook: default
---
This calculations were run (on a kimel lab machine) to double check the coding of cases and controls and Sex in our phenotypic file.
While most things are fine. Two issues were identified:
1. Two participants in COBR... |
f3a34cdcc1a608e9d8a230ea4fc512b4857adf88436c5154d60eebe50dc0b2b7 | R | 6,307 | 243 | #' Apply methods
#'
#' apply_methods() and its aliases apply_metrics and begin_benchmark take either
#' lists of datasets or benchmark_tbl objects and applies a list of functions.
#' The output is a benchmark_tbl where each method has been applied to each
#' dataset or preceeding result.
#'
#' @param x the list of data... |
c8bcd03ee88f0169b297b7a6efc8633fc87f0b8760c7d13415be81cd7cff5b77 | R | 6,335 | 174 | ##Scripts to run DropletQC on the FADS sorted and unsorted mouse brain samples
## address queries to marcin.tabaka@gmail.com
require(ggplot2)
require(data.table)
require(DropletQC)
require(Seurat)
require(harmony)
require(ggExtra)
tab10 <- c("26 98 165", "253 105 16", "40 147 34", "203 17 30", "129 78 175",
... |
9f1ef0430ff1a306987a13d7b8228b75345539e7705bdc88f80534165f62bbc6 | R | 6,352 | 136 | #############################################
##### Set directories
#############################################
if(Sys.info()['sysname'] == "Windows"){
# paths Win
wd <- "C:/Users/Manuel/Nextcloud/Masterarbeit/"
db <- "C:/Users/Manuel/Dropbox/Apps/Overleaf/Masterarbeit"
}else if(Sys.info()['sysname'] == ... |
7dbf7358e5bfb9ea5ba75be7a414d7a48714988d72558accbfebc97a5992fcd8 | R | 6,392 | 136 |
---
title: "Walkthrough with a simulated data"
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}
... |
601eddcb9110ab30ec1d0d23ec9eeff4c7327e597b6ddac4436cf9c554b6c9ab | R | 6,446 | 211 | #' Reorder a matrix
#'
#' This function reorders a matrix by rows of columns
#'
#' @param matrix1 a matrix (rows=genes x columns=samples) of gene expression data
#' (e.g., scRNA-seq)
#' @param by.rows By rows (TRUE; default) or by columns
#'
#' @return a reordered matrix
#'
#' @export
reorder_matrix <- function(matri... |
e05bb8346a1c54ffe0158b680f1f26631b157e0f6fa8d3dcb6799939c70a7602 | R | 6,593 | 137 |
---
title: "Walkthrough with the simulated dataset 8"
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 ... |
d780966b8c69a075dc86094ef9d858f02ce7a840f972ff8af2252f69c843d9cd | R | 6,731 | 153 | #' Differential co-expression analysis with CS-CORE
#'
#' Test for differential co-expression between two groups using a permutation test.
#' CS-CORE is run on each group separately to obtain co-expression estimates.
#' Group labels are then permuted \code{n_permu} times at the biological sample level
#' to build a nul... |
f097e031a010d3d15332ad1193749300622f02cd6a8c68f8e89446ac84f94053 | R | 6,779 | 139 | library(ANTsR)
library(Morpho)
library(Rvcg)
library(rgl)
source("VTK_ops.R")
# assumes there's a CSV file with an ID variable which corresponds to the subject ID from freesurfer
csvfile<-read.csv(file.path(base_folder,"data.csv"))
#for example
csvfile<-data.frame(matrix(ncol=1,nrow=1, c("bert"), dimname... |
104f7a3ff8ab3b21f81af8e5aebc9f38ecd4c5e1511cb56872c9f3de46110e7b | R | 6,902 | 213 | ---
title: "04 PINT displacement stats"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
keep_md: true
df_print: paged
---
# Stats on the PINT summary displacement values
```{r}
library(tidyverse)
library(broom)
library(here)
```
## The paths to data
```{r setting paths}
source(here('co... |
fb35942e0e3f84f9db545f25423df18a37c556930e4a67a8c642ae75b50d3278 | R | 6,928 | 202 | test_that("delimited decoding has strict lexical and record grammars", {
recipe <- conformance_recipe(1)
recipe$columns <- list(list(name = "x", type = "float64"))
bad_float <- c(" 1", "+1", "NaN", "1e999")
for (value in bad_float) {
path <- write_text(paste0("x\n", value, "\n"))
expect_error(
dm_... |
e9974b32229c9b0a9129511c399466efa62ccd29d9c6b92c8ae983032279fffd | R | 6,941 | 245 | library(ggplot2)
library(ggrepel)
library(car)
library(xtable)
library(dplyr)
library(tidyr)
library(tibble)
library(stringr)
library(ggcorrplot)
library(gridExtra)
# Read the data in
mf <- read.csv("MF_ephys.csv")
mf %>%
separate(Group, sep = "-", into = c("Sex", "Treatment")) %>%
mutate(SexShort = substr(Sex, 1... |
3fd613ad37744dca0f1d42b4c35d16a063ab9f9d1573b03b0b764af1b11a66df | R | 7,053 | 149 | 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... |
489780db260bfbff8a3d072859738a4f10d1839bd711843a650bf5d46ba6cc6d | R | 7,094 | 254 | ---
title: "20221222_data_analysis"
author: "Asela Wijeratne"
date: "2022-12-22"
output: html_document
---
```{r setup, include=FALSE}
library(apeglm)
library(tximport)
library(DESeq2)
library("pheatmap")
library(ggplot2)
library(calibrate)
library("RColorBrewer")
library(dplyr)
library(reshape2)
library(tidyverse)
li... |
3a64b3a1ee6745ba59abfec1afa3b688d7feb16cbd2dfcbd2b2204c07c006421 | R | 7,109 | 248 | .cache_files <- function(cache_dir, namespace) {
directory <- file.path(cache_dir, namespace, "sha256")
if (!dir.exists(directory)) {
return(character())
}
paths <- list.files(directory, full.names = TRUE, all.files = FALSE)
paths <- paths[
grepl(.sha256_pattern, basename(paths), perl = TRUE) &
... |
c89ab9b5a09d83b90c0bb508f59948786241e9d52d715e4855d599e403c96df3 | R | 7,127 | 228 | #load libraries
library(magrittr)
library(clusterProfiler)
library(openxlsx)
library(org.Hs.eg.db)
library(VennDetail)
library(tidyverse)
#CONSTANTS
#set a constant to attach to file names
#outfileBase <- "NCATS_ATAC_DESeqOnly_" #used if filtering out ChipDuo
outfileBase <- "03_NCATS_ATAC_"
#get contrasts based on fi... |
7fe8f1e3c192af913a0a5253d395997bd44d2c3fe6a4e77386605a1d87530830 | R | 7,147 | 153 | 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("ggplot2"))
suppressMessages(library("viridis"))
suppressMessages(library("devtools"))
suppressMessages(l... |
3347d5ea6521042d56fa9f212a44337724b1821a19a2553a754aebad21929c53 | R | 7,195 | 206 | ## Corrplot for Vukasin's D7astro_vs_LAday7NPC data
## 2020-04-16
library(corrplot)
library(RColorBrewer)
library(DESeq2)
require(data.table)
setwd("Z:/NGS_related/BulkRNA/Common_analysis/Cross-experiment/D7astro_vs_LAday7NPC/")
load("D7astro_vs_LAday7NPC.DDS.after_housekp_correction.RData") # load dds
co... |
14cfd3ff72321f25a987582d00a5bf7ce9b15d72045c8ebbd13371b62ca6f8b6 | R | 7,207 | 219 | # comparing amino acid class distributions
library(tidyverse)
library(yardstick)
library(ggpubr)
library(cowplot)
library(sqldf)
library(sinaplot)
library(dplyr)
library(ggforce)
cnn_data <- read.csv(file="./cnn_wt_max_freq.csv", header=TRUE, sep=",")
natural_data <- read.csv(file = "./natural_max_freq.csv", header=... |
4feb92044b5a07a04511537928e5e70c613bb1d3687ecfea7b9adbc5379f4bb0 | R | 7,217 | 162 | ---
title: "Covariate adjustment"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Covariate adjustment}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
# Motivation
The original implementation of CS-CORE does not consider covariate adjustment. For example, in the [paper](http... |
5da8eaa9d26c34cd9b0c7a28cd4b9a400c322a269d1d4fa69ef10232c027d3ef | R | 7,261 | 294 | ---
title: "Double Check Clinical vars"
output:
html_document:
keep_md: TRUE
---
This calculations were run (on a kimel lab machine) to double check the coding of cases and controls and Sex in our phenotypic file.
While most things are fine. Two issues were identified:
1. Two participants in COBRE are coded as... |
2a811cf1b83487fea57c64e0520cbd316d820e39dfbb4a2e715c0cf8ed97777b | R | 7,330 | 147 |
---
title: "Walkthrough with mESC 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}
knit... |
7b24cba29b24ed59b3dfd259ab6b52bb4192984baadc1a236004d6284b246297 | R | 7,430 | 191 | library(GenomicFeatures)
library(ChIPseeker)
library(rtracklayer)
library(ggvenn)
library(tidyverse)
library(dplyr)
library(ggpubr)
theme_set(theme_pubr())
gffFile <- "Gmax_508_Wm82.a4.v1.gene.gff3"
txdb.filename <- "Gmax_508_Wm82.a4.v1.gene.sqlite"
txdb <- makeTxDbFromGFF(file=gffFile)
saveDb(txdb, txdb.filename)
txdb... |
e1b0c1e6d6152a17104fb1822c0e97ccd07bf7096c2700e8df6ce8c96ad1b0c4 | R | 7,445 | 178 |
YeoNet7 <- tribble(
~network, ~hexcode,
"VI", "#781286",
"SM", "#4682B4",
"DA", "#00760E",
"VA", "#C43AFA",
"FP", "#E69422",
"DM", "#CD3E3A",
"LI", "#dcf8a4")
specify_decimal <- function(x, k) trimws(format(round(x, k), nsmall=k))
factor_corrtype <- function(x, cort_atlas) {
if (cort_atlas == "PINT... |
b69375b308097d3204e804acab6143a4f46ac855937dc36c771accc4f869f448 | R | 7,464 | 202 | ### This script plots the correlation between age effects on MEG markers and cortical thickness
### Needs the output files from the statistical analysis using PALM (t-values fpr MEG connectivity/power and cortical thickness)
### Written and modified by Christina Stier, 2022
### R version 3.6.3 (2020-02-29)
### RStudio... |
3c1659c3e828b362bdbd203acddf3e043ceaad7ee64f5c52fb4ca01c91eb7d79 | R | 7,508 | 212 | ### This script plots the results for the predictor cortical thickness on MEG connectivity levels
### (after regressing out the effects of sex, age, age2, intracranial vol. using the PALM toolbox)
### Written and modified by Christina Stier, 2022
### R version 3.6.3 (2020-02-29)
### RStudio 2021.09.0+351 "Ghost Orchi... |
c529f0100a2e37e885788763a3d4e345d01105605fba5ecc89de7a7b35842244 | R | 7,581 | 190 | # Pixel clustering
# Author: Candace Liu
# Date: 3/18/21
library(data.table)
library(RColorBrewer)
library(FlowSOM)
library(dplyr)
library(viridis)
library(pheatmap)
library(ggplot2)
library(gridExtra)
library(ConsensusClusterPlus)
pixel_mat_dir = "pixel_mats"
sigma = 2
cap = 3
k_hclust = 20
hclust_coln = "hCluster_c... |
c13238cbcd25be2108514f9808e9a61e84112b0ae6cdd2e48a121db2ebf1c2c0 | R | 7,582 | 215 | ### This script plots the results for the predictor cortical thickness on MEG connectivity levels
### (after regressing out the effects of sex, age, age2, intracranial vol. using the PALM toolbox)
### Written and modified by Christina Stier, 2022
### R version 3.6.3 (2020-02-29)
### RStudio 2021.09.0+351 "Ghost Orchi... |
99ad6e8aa82297695fc74048b060ba57ae2469e73f82c41a21e060082e4d52aa | R | 7,603 | 295 | stime <- function() {
format(Sys.time(), "%T")
}
# message with a time stamp
# appears only if called from an environment where a logical verbose = TRUE
# OR force = TRUE
tsmessage <- function(..., domain = NULL, appendLF = TRUE, force = FALSE,
time_stamp = TRUE) {
verbose <- get0("verbose", ... |
2d44bdd6f676e9cb3b948179044f8895fa13039420019dcca0042d6cdbf3d3bc | R | 7,616 | 171 | 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("velocyto.R"))
suppressMessages(library("SeuratWrappers"))
suppressMessages(library("RColorBrewer"))
suppr... |
de622f52e934caf18014612541c75a5ef5eaacfa33c03e589f124bf2f725222e | R | 7,647 | 199 | #' Filter to retain peaks in at least two biological replicates
#' for MeDIP-Seq data from Active Motif.
# req'd pkgs
x <- c("openxlsx", "magrittr", "tidyverse",
"data.table", "annotatr", "GenomicRanges",
"IRanges")
sapply(x, library, character.only = TRUE)
# load count files based on medipseq peaks
mr... |
2570f4b52f88e664c56c321109b8aba2d45b32426bb0d30183b1ce9ffb600912 | R | 7,649 | 195 | #############################################
##### Load packages, set theme
#############################################
if(!require("BiocManager", character.only = TRUE)){
install.packages("BiocManager")
}
# in case the following fails due to issues with nloptr,
# run in terminal: sudo apt-get install lib... |
5c6b7e896f59e85b6456c56d03cead1b50cc14bd2e675d65fac65eec7541be0e | R | 7,674 | 252 | test_that("dataset references select the same data, artifacts, and metadata", {
cache_dir <- tempfile("datamonger-cache-")
seeded <- seed_conformance_cache(cache_dir)
selections <- list(
list(name = "mixed_csv", source = "conformance"),
list(name = "conformance:mixed_csv"),
list(name = "conformance:mi... |
df8b1611b88d8c699a52ff7e526d9ea30922afe8a5e73158df009f489c49630a | R | 7,806 | 169 |
#' An S4 class to represent SingleR objects
#' This object can be upload to the SingleR browser (http)
#'
#' @slot project.name a string. Must be the same as the file name.
#' @slot xy matrix of the xy coordinates. Row names must be single-cell names.
#' @slot labels data.frame of the SingleR annotations. Rows are s... |
5eeb4380ffdcb0bbd0593ef7e8cafcbbec4b7782d5c7ba8bbfc1e580412f4c4d | R | 7,863 | 195 | #!/usr/bin/env Rscript
if(!require(pacman)) install.packages("pacman", repos = "http://cran.us.r-project.org")
pacman::p_load(Biostrings, argparser, DESeq2, reshape2)
args <- commandArgs(trailingOnly = TRUE)
parser <- arg_parser("Argument parser for circRNA quantification", name = "quant_parser")
parser <- add_argu... |
759f794c742028976c9455cf5c758dac4d58aeb35772a3065a837ca2615bf088 | R | 8,143 | 362 | ---
title: "R Notebook"
output: html_notebook
---
# whole brain prediction
```{r message=FALSE, warning=FALSE}
library(here)
library(tidymodels)
library(vip)
library(tidyverse)
```
```{r setting paths}
# These functions are for reading timeseries files
source(here('code/R/settings_helpers.R'))
pheno <- read_pheno_f... |
80e1e47740c6e879049371f0b273ecadd4ea8179c8f1e701d2e585783d756629 | R | 8,153 | 171 | 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... |
9c2957887b3455d85e67a85ec575ff81e5555cb81044064ec479a263944ef249 | R | 8,239 | 176 | 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("SeuratDisk"))
suppressMessages(library("dplyr"))
suppressMessages(library("data.table"))
suppressMessage... |
202db5840e5fa159f84a0ad970c314525d8cfa653c88c996dccb343ac70cc77a | R | 8,247 | 248 | #load libraries
library(Gviz)
library(rtracklayer)
library(Rsamtools)
library(GenomicAlignments)
library(data.table)
library(Cairo)
library(magrittr)
library(biomaRt)
library(tidyverse)
library(extrafont)
#get functions
source("./code/functions/build_locus_zoom_DAG.R")
##CONSTANTS
#create a list of the contrasts to ... |
da4599f8bdd7e53bdf700aaf45dff22f6d997811e463b6262faacf1c28c45ddc | R | 8,278 | 166 | log <- file(snakemake@log[[1]], open = "wt")
sink(log)
sink(log, type = "message")
message("CONFIGURATION STEP")
# A. Parameters:
# 1. Load libraries.
suppressMessages(library("GenomeInfoDbData"))
suppressMessages(library("Seurat"))
suppressMessages(library("RColorBrewer"))
suppressMessages(library("slingshot"))
sup... |
2aad4c55a1c5e1fa4a9692302129c2d844d089d47018ea3eea628d78ba0b827e | R | 8,291 | 166 | ---
title: "Fast SGD settings"
---
By default, `uwot` uses some conservative settings during the stochastic
gradient descent. But there are some options that can speed things up:
* `n_sgd_threads = "auto"` (or any value greater than one): this is the biggest
thing you can do to speed up optimization. The optimizatio... |
7b477f74880e2e22a2f7a02bbebcd89a21984101b7b96b9c5a26fd0424b75f93 | R | 8,306 | 174 | 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... |
e3d7ef6bc51fe51cf7dca584f77c507bcf5e96979ff7fd19092c9d40ffa0b637 | R | 8,336 | 183 | # Function to plot relevance layer boxplots
relevance.boxplots <- function(plot.df){
curr.boxplot <- plot.df %>%
mutate(
GROUPS = fct_relevel(GROUPS, 'Top', 'Middle', 'Bottom'),
BaseToken = fct_reorder(BaseToken, median)
) %>%
ggplot(aes(y = BaseToken,fill=Type)) +
geom_boxplot(aes(xmin=m... |
189b52f646378ac007b436c0b122aeaac208be6ea0008e3c0f903420409b7b24 | R | 8,339 | 194 | ---
title: "Nearest Neighbor Format"
---
The Python implementation of UMAP supports lots of distance metrics; `uwot` does
not, because it depends on the distance metrics supported by `RcppAnnoy`, which
in turn depends on those supported by `Annoy`. For more flexibility, at the
cost of convenience, you can generate nea... |
3efe5a2409afdc177095f09a8525713024dde9b2dd2ec87adbe85a8fc4996b31 | R | 8,446 | 253 | #load libraries
library(Gviz)
library(rtracklayer)
library(Rsamtools)
library(GenomicAlignments)
library(data.table)
library(Cairo)
library(magrittr)
library(biomaRt)
library(tidyverse)
library(extrafont)
#get functions
source("./code/functions/build_locus_zoom_DAG.R")
##CONSTANTS
#create a list of the contrasts to... |
c9fb8357c1e614de2a0f3f39df37a94ac860550277649a3658600b17a852c2ff | R | 8,616 | 180 | #' Iteratively reweighted least squares (IRLS) procedure in CS-CORE
#'
#' This function implements the IRLS procedure used in CS-CORE for estimating and testing
#' cell-type-specific co-expression from single-cell RNA sequencing data.
#'
#' Let \eqn{x_{ij}} denote the UMI count of gene \eqn{j} in cell \eqn{i};
#' \eqn{... |
fd259f5635cb3590fd2ba11fc2e3b5eea4c533cf91c889056f9c7c50fe19dddf | R | 8,654 | 116 | library("Seurat")
set.seed(123)
# Read object
setwd("/storage/scratch01/users/chernandez/rscripts")
se_subset <- readRDS("se_subset_res_482N1_box3_round3.rds")
pos2cells <- WhichCells(se_subset, cells = rownames(se_subset@meta.data)[which(se_subset@assays$RNA@data["Egr1", ] > 2)])
se_subset$Egr1.Expression.2 <- ifels... |
3117f319b1310cf73449d77f832b6eddc8f8fc05520e6a442dfecd1ee8eff2d1 | R | 8,796 | 151 | ---
title: "What's New"
---
A place for me to put the old less-structured updates that I post at the top of
the `README.md` file for the package. When they aren't new any more, they will
get moved here. You should look at the
[Changelog](https://jlmelville.github.io/uwot/news/index.html) for fuller
details.
*August ... |
1e0b17c5baf15f7a533fa59a4ad9faa058e709d9430d370837249500d80bc998 | R | 8,884 | 138 | ---
title: "SingleR 0.2.1 - Usage"
author: "Dvir Aran"
date: "11/6/2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Introduction
SingleR is a package that performs reference-based annotation of single-cell RNA-seq data. Here we show different ways to create Single... |
6f0f8c01a555a99249e3f4a971e52e864bde2b0b17074547ef3eb5dce8aebd22 | R | 8,932 | 218 | #' Class markers
#'
#' This function identifies both on and off markers genes for classes for use
#' with patchSeqQC library. 'On markers, are genes that are highly expressed
#' in the cell type of interest with enriched expression relative to other cell
#' types. The second class, Off markers, are expected to be... |
df7918f395be9f9a81100e6cd1406c7e57f0a9ba7208ef520126fdd1ab32dcf2 | R | 8,966 | 293 | ---
title: "Sulcal Depth Stats"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
keep_md: true
df_print: paged
---
# Sulcal Depth Results
```{r}
library(tidyverse)
library(broom)
```
## The paths to data
```{r setting paths}
output_base <- '../data/ciftify_fmriprep/'
Yeo7_2011_80verts <... |
2eff1b3390ad722e1f9355d9ea8ad3cd525e3003f5b4d88add29af324e936444 | R | 8,977 | 244 |
#!/usr/bin/env Rscript
# module load R/4.0.2
# Use arguments:
args<-commandArgs(TRUE)
# 1-Dir; 2-RootCluster; 3-Dimensions;
# Load libraries
library(slingshot)
library(Seurat)
library(SingleCellExperiment)
library(Polychrome)
library(ggbeeswarm)
library(ggthemes)
library(scales)
library(viridis)
# Define Function -... |
9f2de3dfd2ad5a6d82f5da41148d9a2b0012eb97dd88c18bccedbdbe441c10fe | R | 9,194 | 261 | library(DESeq2)
library(data.table)
library(ggplot2)
library(ComplexHeatmap)
library(scales)
library(RColorBrewer)
setwd('/Volumes/ncatssctl/NGS_related/BulkRNA/Common_analysis/Cross-experiment/D7astro_vs_LAday7NPC/')
load('/Volumes/ncatssctl/NGS_related/BulkRNA/Common_analysis/Cross-experiment/D7astro_vs_LAday7NPC/P... |
533b328951be6d70cdc946ab002c171eed9dd3805fea32dbe0ff2939dd91cf41 | R | 9,281 | 282 | ---
title: "Benchmark Data Manipulation"
author: "Shian Su"
date: "`r Sys.Date()`"
output: BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{Data Manipulation}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
library(CellBench)
library(dplyr)
library(purrr)
```
# ... |
bb4dd65aef68ca86eabb9580008279432f30b328b59d04f5de929465531ab871 | R | 9,329 | 311 | # set_op_mix_ratio = between 0 and 1 mixes in fuzzy set intersection
# set to 0 for intersection only
#' @import Matrix
fuzzy_set_union <- function(X, set_op_mix_ratio = 1) {
XX <- X * Matrix::t(X)
if (set_op_mix_ratio == 0) {
Matrix::drop0(XX)
} else if (set_op_mix_ratio == 1) {
Matrix::drop0(X + Matrix:... |
8474ec7173cc331fb234872802639b1508626b2541aba354302fa24fb62f1bea | R | 9,409 | 202 | ---
title: "Use case: Benchmarking method parameters"
author: "Shian Su"
date: "`r Sys.Date()`"
output: BiocStyle::pdf_document
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
library(CellBench)
library(SingleCellExperiment... |
2a59c65f99ec10580b3fa911be231b9d7149825398d5bb74108d6b202d0c1e0d | R | 9,573 | 188 | ---
title: "CS-CORE for cell-type-specific co-expression analysis"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{CS-CORE for cell-type-specific co-expression analysis}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = ... |
137ff040ab7eb188034c0c0028532a7db011e240b343f76a931084dca2857226 | R | 9,575 | 272 |
### Modify sLED for CSNs
library(sLED)
sLED.csn = function(X, Y, adj.beta = -1, rho = 1000, sumabs.seq = 0.2,
npermute = 100, useMC = FALSE, mc.cores = 1, seeds = NULL,
verbose = TRUE, niter = 20, trace = FALSE){
D.hat = getDiffMatrix.csn(X, Y)
pma.results <- sLEDTestStat(D... |
de62f22ced0a0ddec548a660a94489362d7662b1cddc56ae4a5a20ccc1231648 | R | 9,663 | 293 | library(tidyverse)
library(yardstick)
library(dplyr)
library(ggplot2)
library(ggpubr)
library(cowplot)
library(tidyr)
# finding the Kullback-Leibler (KL) divergence
# y - CNN, x - natural
get_D_KL <- function(y, x) {
sum <- 0
for (i in 1:20) {
if (x[i] != 0 & y[i] != 0) {
sum = sum + x[i] * log(x[i]/y[i... |
8deb3a4d1e3f7de50643c8a9b9fbd6c6e234d9c137e19116f4153efbb7c724cd | R | 9,670 | 221 | ################################################################################################################
## Filename: global.r
## Created: October 09, 2015
## Author(s): Karsten Krug
##
## Purpose: Shiny-app to perform differential expression analysis, primarily on proteomics data, to perform
## simple... |
a7dd584e3ed97c25ee50dc26f1c3558a971bd6344ef573e11abf3e2c62eba787 | R | 9,753 | 338 | ---
title: "Tidyverse Patterns"
author: "Shian Su"
date: "`r Sys.Date()`"
output: BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{Tidyverse Patterns}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(purrr)
library(dp... |
95759de5b53ce363b4691ab3e0b1f03ba33bd86d8178aa2cf6966add2ab1ea06 | R | 9,888 | 224 | #!/usr/bin/env Rscript
if(!require(pacman)) install.packages("pacman", repos = "http://cran.us.r-project.org")
pacman::p_load("ggplot2", "ensembldb", "pheatmap", "DESeq2", "data.table", "EnhancedVolcano", "argparser", "MetBrewer")
args = commandArgs(trailingOnly = TRUE)
parser <- arg_parser("Argument parser for dif... |
547ad395ae51be836a5dd91b5db682fb90be85bea1e1d2d36a6eb603f3c30da9 | R | 9,899 | 290 | library(tidyverse)
library(cowplot)
library(ggforce)
#======================
#***BOX SIZE 20*****
#======================
# code for figure 1.
#==============================================================================
# a) Basic stats (% match across all genes)
#=================================================... |
ac6690b46e1611713955aef9f6c7ef1f23c06aad9f99124bcd3fc84774f7a835 | R | 10,097 | 205 | library(dplyr)
library(tidyverse)
suppressPackageStartupMessages(library("optparse"))
suppressPackageStartupMessages(library("stats"))
# Initialize list of matrix object
genes <- c("NSD2", "CCND3", "MYC", "MAFA", "CCND1", "CCND2", "MAF", "MAFB")
callers <- c()
header <- c("Specimen")
option_list <- list(
make_optio... |
2267e00f4e8f9e5488be87a97e4c2b5c9f6b97002097e0e4c9210322f3bc4f28 | R | 10,109 | 182 | #' @name plotCorr
#' @title Plot correlation between expression and specificity
#' @description
#' This function plots quantile normalised expression values versus
#' tissue specificity values of all genes in all tissues to visualise
#' correlation.
#' @param x output from getTissue()
#' @param y optional vector of u... |
158490a7d6ef8ad3c976f9292e06fd7b332f7b793e14cf0b6d609ee990be88a0 | R | 10,137 | 245 | ---
title: "UMAP on some simple datasets"
---
The distill publication
[How to Use t-SNE Effectively](https://distill.pub/2016/misread-tsne/) provides
some interactive examples of t-SNE on a variety of simple datasets and
demonstrates the effect of changing its hyperparameters, mainly the perplexity,
which acts like a... |
e3973e34bf06ce66d742dad8a7b22117ad8997228d358d320702ec9d985967a1 | R | 10,185 | 287 | library(tidyverse)
library(cowplot)
# reading csv files
natural_var <- read.csv(file="./stats_align_all.csv", header=TRUE, sep=",")
cnn_data <- read.csv(file = "./cnn_wt_max_freq.csv", header=TRUE, sep=",")
# joining the two data frames.
natural_var <- natural_var %>%
nest(q_natural = c(q_H:q_C))
joined_data <- i... |
aa10e4de92edc82bd2509166999146ba2a91d16eb46d5441f16f0d6e2bac7c1a | R | 10,189 | 325 | library(Rsamtools)
library(TxDb.Mmusculus.UCSC.mm10.knownGene)
library(GenomicAlignments)
library(GenomicFeatures)
library(biomaRt)
library(genefilter)
library(DESeq2)
library(ggplot2)
library(ggrepel)
library(gridExtra)
library(dplyr)
library(pheatmap)
library(goseq)
library(GOfuncR)
# This assumes bam files are in t... |
eb591c44b6cb2e0e2ba9a531e93d8d5cff7f9e76cf19180eb0d2f37bb63d1226 | R | 10,394 | 278 | library(DESeq2)
library(data.table)
library(RColorBrewer)
library(gplots)
library(ggplot2)
library(ggrepel)
source("https://bioconductor.org/biocLite.R")
BiocManager::install("biomaRt", suppressUpdates = TRUE)
library(biomaRt)
library(stringr)
library(dendextend)
library(ComplexHeatmap)
library(gtools)
library(doParall... |
48cd735cc254ed582ef0efa45a2fa6ee5578327d03d3d4a68a22d0e736f6ce5d | R | 10,489 | 199 | ---
title: "Extended Data: Figures and Tables"
output:
pdf_document:
toc: true
fig_caption: true
header-includes:
- \usepackage{caption}
bibliography: Citations.bib
---
```{r setup, include=FALSE,warning=F}
knitr::opts_chunk$set(echo = TRUE)
library(knitr)
library(reshape2)
library(RColorBrewer)
library... |
19a5785499e9c8ffcc9bd957633069f11fbb958614d5e7137f942c3e4f344525 | R | 10,542 | 244 | #Figure 5 plot code
#5A - NPC example images
#5B - Experiment Illustration
#5C - Experiment Metadata
#5D - OCR vs ECAR
library(ggplot2)
library(tidyverse)
library(ggpubr)
library(rstatix)
#load data (compiled from Wave software export into single .csv file)
ocr_data <- read.csv("~/Desktop/Purcell 2023 dataset/Fig. ... |
07d018c2441b2bbbc10da1314240ab4ea0a8351bb0d40a96d71b8eda32f8aa76 | R | 10,557 | 271 | library(tidyverse)
library(cowplot)
library(ggforce)
box_size = "20"
pred_wt_aa = 0.592
pred_wt_class = 0.713
# loading data
cnn_data <- read.csv(file = paste0("./data/PSICOV_box_",box_size,"/output/cnn_wt_max_freq.csv"), header=TRUE, sep=",")
natural_data_all <- read.csv(file = paste0("./data/PSICOV_box_",box_size,"... |
c22f1f7281bc0d31cb6a21967c040c105fb1f71d705c0f6e6b6992e24b090058 | R | 10,640 | 435 | .cache_namespaces <- c("objects", "registries")
.cache_path <- function(cache_dir, namespace, digest) {
if (!(namespace %in% .cache_namespaces)) {
.abort_category("cache", paste0("unsupported cache namespace ", namespace))
}
if (
!.is_scalar_character(digest) ||
!grepl(.sha256_pattern, digest, per... |
34fdbc61a368320a76679d6f6398f3504d8e370407daffe6ffe34210d89d46e7 | R | 10,666 | 400 | #' Get head of 2 dimensional object as a square block
#'
#' head prints all columns which may flood the console, mhead takes a square
#' block which can look nicer and still provide a good inspection of the
#' contents
#'
#' @param x the object with 2 dimensions
#' @param n the size of the n-by-n block to extract
#'
#'... |
20df7b1b132993d7c633ec3a609b9332db68365298270e1566a725d7316c6361 | R | 10,731 | 342 | #figure 8- wt prob predicted by CNN ~ n_eff of alignment
# done across the different % similarity groups
library(tidyverse)
library(cowplot)
library(broom)
box_size = "40"
# reading csv files
natural_var <- read.csv(file="./output/output_PSICOV/stats_align_all.csv", header=TRUE, sep=",")
natural_var_20 <- read.csv(... |
27c4573d3c465a4a2efd99082df99e09af6111391ee824f6dc6a2210aa6b24ae | R | 10,738 | 203 | 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("ggplot2"))
suppressMessages(library("RColorBrewer"))
suppressMessages(library("stringr"))
suppressMessag... |
a79a89af85248bcbc8953097144de28bb56e1d2c294dbb77b04292b766486db2 | R | 10,772 | 351 | library(tidyverse)
library(cowplot)
# figure 3.
# heat maps.
# loading data
cnn_data <- read.csv(file = "./cnn_wt_max_freq.csv", header=TRUE, sep=",")
natural_data <- read.csv(file = "./natural_max_freq.csv", header=TRUE, sep=",")
joined_data <- rbind(x = cnn_data, y = natural_data)
for_heat <- joined_data %>%
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.