sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
4100c6794e8eafe9493e6d378d70835bdcb6ab5e8419ac6e6985a962319c2c97 | R | 7,934 | 243 | `%||%` <- rlang::`%||%`
#' @title Extract TF names from scRNA data and tf2motifs
#'
#' @param species (character) - Species name. Default: "human".
#' @param genes (vector(character)) - List of expressed genes.
#' @param output_file (character) - Path to output file.
#' @param tf2motifs (data.frame) - TF to motifs nam... |
4f955705c206981204d7338171cd01bb78eb10456b521e36993afb9842d3a8a8 | R | 7,955 | 187 | # Load libraries ----------------------------------------------------------
library(tidyverse)
library(here)
library(ggpubr)
# Load data ---------------------------------------------------------------
Transcripts <-
list(
GBA = read_tsv(here::here("data", "Brain", "GBA_classification_filtered.txt"), show_col_t... |
1cc6eb19ed506fbfc6ac32c8f3cc5b1380daa4ed056547258bfac458a7280ac1 | R | 7,959 | 252 | ---
title: "DESeq2 region others"
author: "Emma Jones"
date: "2023-05-25"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Script for DE analysis on one brain region vs others grouped together
For code review, I am tracking the amount of time that this analysis will tak... |
6a7d5ce3a32822e7d397c8c749251b396c5065a1b308bdaab6cab68d5938b92e | R | 7,981 | 198 | ## This script plots correlation between potential confounders.
suppressPackageStartupMessages({
library(here)
library(tidyverse)
})
## Functions
save_img <- function(image, fn, w=14, h=7){
for(ext in c(".svg", ".pdf")){
ggsave(file=paste0(fn, ext), plot=image, width=w, height=h)
}
}
pca_norm_... |
ad1b8c585f94055fdc8e654f10fdaa8927cc2dd4d9fc97e14a69ed2941406b10 | R | 7,994 | 234 | #' Imputation by predictive mean matching with distance aided donor selection
#'
#' Imputes univariate missing data using predictive mean matching.
#' @aliases mice.impute.midastouch
#' @inheritParams mice.impute.pmm
#' @param midas.kappa Scalar. If \code{NULL} (default) then the
#' optimal \code{kappa} gets selected a... |
f6e0ec6ec2497f13cda486f1094b99a5d105b86becba677c1c53f8eb35d274b4 | R | 8,021 | 262 | # Usage is an extension of 2l.norm
# -2 ... group identifier
# 1 ... fixed effects
# 2 ... fixed and random effects
# 3 ... introduce aggregated effects (i.e. group means)
# 4 ... fixed, random and aggregated effects
#' Imputation by a two-level normal model using \code{pan}
#'
#' Imputes univariate missing data u... |
a502318026194eaa987a348a73639bc62b542ec58a7b104367447aa404be6ff2 | R | 8,032 | 303 | # The sampler controls the actual Gibbs sampling iteration scheme.
# This function is called by mice and mice.mids
sampler <- function(
data,
m,
ignore,
where,
imp,
blocks,
method,
visitSequence,
predictorMatrix,
formulas,
calltype,
blots,
post,
fromto,
printFlag,
...
) {
from <- fromt... |
a5beb5b8e6bc6d921a776b5e02be562e97f4e7933fd7d9d2779644119971dd16 | R | 8,055 | 294 | ### Apply standard Limma/Voom analysis to phospho data
library(readxl)
library(limma)
library(edgeR)
library(DESeq2)
library(magrittr)
library(tidyverse)
library(patchwork)
## Import results as single data.frame
input_path <-
snakemake@input[['data']]
results_path <-
snakemake@params[['output_path']]
results_l... |
c6349b1e9aa6c674bb06a20093a55f2a60d0af5bb6de5dfee0ec0e2925940962 | R | 8,058 | 269 | addNormNoise <- function(vec, noise){
vec + rnorm(length(vec),mean = 0, sd = noise)
}
#----Simulation: functions----
validSimulationGRN <- function(object) {
#graph is a GraphGRN object
if (!is(object@graph, 'GraphGRN')) {
stop('graph must be a GraphGRN object')
}
#local noise
if (object@expnoise<0) {
sto... |
850e432686ca1445f6609e826c5768ba037feba2605e04551986ffec0e75af38 | R | 8,103 | 222 | #####################################################
# ~ ZFAD: adjustPixel function ~
#
# function to adjust delta-pixel data to adjust for size or pigmentation difference
# was originally written for PSEN2 experiment to adjust for fainter pigmentation of PSEN2 larvae
#
# Francois Kroll 2023
# francois@kroll.be
######... |
459deb805f1f5045fab778da9e3b7272d18ecbe7f51246c8f5946c58cbb77dca | R | 8,115 | 319 |
library(gridExtra)
library(ggplot2)
##########
require(scales)
cubic_trans = function() trans_new("cubic", function(x) x^(1/3), function(x) x^(3))
## cubic transformation for ggplot2
getMin <- function(x) min(x, na.rm = TRUE)
getMax <- function(x) max(x, na.rm = TRUE)
getSum <- function(x) sum(x, na.rm = TRUE)
ge... |
132150c6be783ece6d29ced18b9449ba1a30917eb47ce95581b6736fc0023844 | R | 8,130 | 240 | # importGenotype ----------------------------------------------------------
# small command to import .txt genotype file
#' Title
#'
#' @param genopath
#'
#' @return
#'
#' @examples
#' @export
importGenotype <- function(genopath) {
if( substrEnding(genopath, 3) != 'txt') stop('\t \t \t \t >>> Genotype file does not ... |
55300b9e0c20dcb9e15d71155ff4b0d16c8d176a75b0cd58de2d700e69ca22bb | R | 8,142 | 227 |
####################################################################################
#### This is the function runs the BNSP model after inputing the data and relevant parameters.
####################################################################################
BNSPfunc <- function(Xmat = Xmat, y = y, V = 20, R = ... |
9bb736d4b7dd836908cbbf04b580862865400774583b41b0dad3304050ddf334 | R | 8,181 | 168 | ##---------------------------------------------------------------------------##
## Modules
# module purge && module load shared slurm python/3.7.x-anaconda
# module load hdf5_18/1.8.17
# module load gcc/8.3.0
# module load htslib
# module load gsl/2.4
# module load macs/2.1.2
# module load R/4.1.1-gccmkl
##-----------... |
7eb2d76a4923076029cc24e2c267040154a92e78597e4a4906c8c4350e5895f2 | R | 8,196 | 199 | ##Evaluation of cell porprotion estimated deconvolution methods
##load ground truth
ihc<-read.csv('raw/ihc/ihcprop.csv',header=T,sep=',',row.names=1)
colnames(ihc)<-c('Ast','End','Mic','Neu','Oli')
scprop<-read.csv('raw/ihc/cell_counts_sc.csv',header=T,sep=',',row.names=1)
scprop<-t(apply(scprop,1,function(x){x/... |
d7267aa2169a58b7a3e3c5fe88a1c74b5c06d81db60913cb437ea130bb0823de | R | 8,203 | 168 | library(gplots)
########### Identify the input arguments
args <- commandArgs(trailingOnly = TRUE)
jobID <- args[1]
stringency <- as.numeric(args[2])
fitMode <- args[3]
tempFolder <- paste("./tmp/",jobID,sep="")
outputFolder <- paste("./out/",jobID,sep="")
########### read the exon and intron centered normalized rea... |
fd121ba8b0799975a4e149d2ed2b67c61f90d6313f4c4f40b5be5259c619fdb4 | R | 8,205 | 182 | glmm.model.stab<-function(model.res, contr=NULL, ind.cases=F, para=F, data=NULL, use=NULL, n.cores=c("all-1", "all"), save.path=NULL, load.lib=T, lib.loc=.libPaths()){
print("please carefully evaluate whether the result makes sense, and if not, please contact me")
#function determining stability of GLMMs (run using l... |
ed573ae2389d4f1fa14cca83ae4417d3c090101c157faf83192e4369c62edcaf | R | 8,208 | 212 | ## Differential expression analysis with limma-voom
## Sex-specific analysis for specific brain region
suppressPackageStartupMessages({
library(SummarizedExperiment)
library(optparse)
library(dplyr)
library(limma)
library(edgeR)
library(here)
library(sva)
})
save_volcanoPlot <- function(top... |
2faef2975ca71725fac56a9a6e483497652d614f5fd1ae2ffcb0b86b3fe5da52 | R | 8,211 | 191 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
library("dplyr")
library("gridExtra")
library("grid")
## Customize plotPCA function to return more PCs
plotPCA_more_pcs = function(object, intgroup="condition", ntop=500, returnData=FALSE)
{
# calculate the variance for each gene
rv <- r... |
f5160d318d49125bc69cfbd671db5bbd3a38fc7726f083065202ac780c2d09c8 | R | 8,223 | 245 | #' Basic filtering analysis Script
#'
#'
#' Example usage:
#'
#' Rscript PATH/TO/filtercounts.R
#'
#' input: directory containing read count files or tsv file containing reads
#' additional input variables: method used to generate file, model
#' output: `experiment_out.rds` is an experiment object after filtering
#... |
54462a5f6eb22bf1fdc7941b1aa4a8402c978c42a290d3ea27bf15f7d2998b02 | R | 8,225 | 184 | #' Combine R objects by rows and columns
#'
#' Functions \code{cbind()} and \code{rbind()} are defined in
#' the \code{mice} package in order to
#' enable dispatch to \code{cbind.mids()} and \code{rbind.mids()}
#' when one of the arguments is a \code{data.frame}.
#'
#' The standard \code{base::cbind()} and \code{base::... |
83fcb670e9c1ffdb480cf1a30476c759414a2105584633d03c71bf1fc366f752 | R | 8,232 | 212 | ## Differential expression analysis with limma-voom
## Sex-specific analysis for specific brain region
suppressPackageStartupMessages({
library(SummarizedExperiment)
library(optparse)
library(dplyr)
library(limma)
library(edgeR)
library(here)
library(sva)
})
save_volcanoPlot <- function(top... |
e22a263bfba47ebb3663f5427223a7e482a05283cdb1953c10a87d2effdb51a6 | R | 8,232 | 212 | ## Differential expression analysis with limma-voom
## Sex-specific analysis for specific brain region
suppressPackageStartupMessages({
library(SummarizedExperiment)
library(optparse)
library(dplyr)
library(limma)
library(edgeR)
library(here)
library(sva)
})
save_volcanoPlot <- function(top... |
7456142f41bb91cd2eb1fc52bd4b48704108d052545844d69b97a279c0b06c55 | R | 8,234 | 252 | #' Create a cor_tbl object
#' @title Create a cor_tbl object
#' @description Functions to create cor_tbl object from correlation matrix.
#' @param corr correlation matrix.
#' @param p.value significance value matrix of correaltion.
#' @param extra.mat any other matrix-like data with same dimmsion as \code{x}.
#' @param... |
c2dc57e17218a13e42aeb7c7eab28ec1c0fca62b2dba98e1815301d920558de6 | R | 8,235 | 194 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
library("dplyr")
library("gridExtra")
library("grid")
## Customize plotPCA function to return more PCs
plotPCA_more_pcs = function(object, intgroup="condition", ntop=500, returnData=FALSE)
{
# calculate the variance for each gene
rv <- r... |
99139ae187aab9fac632e48097f2771e49bd7989b35d795ced450e65c8830b5b | R | 8,241 | 191 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
library("dplyr")
library("gridExtra")
library("grid")
## Customize plotPCA function to return more PCs
plotPCA_more_pcs = function(object, intgroup="condition", ntop=500, returnData=FALSE)
{
# calculate the variance for each gene
rv <- r... |
664f832ebb50227b235ed219125d380b007cf522ea6837e80d5980d3f6ed6512 | R | 8,244 | 212 | #####################################################
# ~ FramebyFrame: conversion frame-by-frame data to middur data ~
#
#
# Francois Kroll 2023
# francois@kroll.be
#####################################################
# main use of this is to prepare middur file to be used in predPharma Shiny app
# was a standalone... |
071d7b5f86ceca9870f45e24d86f6edad807b5cfcfc669ead8edc631c7e1d983 | R | 8,245 | 203 | # title: "scRNA-seq data analysis with Seurat"
# author: "Tingting Zhao"
# email: tzhao7@bwh.harvard.edu
# date: "02/05/2022"
library(dplyr)
library(Seurat)
library(patchwork)
library(ggplot2)
library(stringr)
library(SoupX)
library(reticulate)
library(glmpca)
library(SeuratWrappers)
library(scry)
library(reticulate... |
077eb450e3923ffde035596db265095f86fec29fa9b7b4124c672debd306c87d | R | 8,252 | 158 | rm(list = ls())
# Loading necessary packages ----------------------------------------------
.libPaths(c("/data/kailash/DDP/libraries/", .libPaths()))
source("/data/kailash/DDP/src/main/scripts/libraries.R")
# Global variables --------------------------------------------------------
path_geneExp <- "/data/srivatsan/... |
5a510fe506d5529decb584c7e0c74ab5b46848f1b57af4a8062c3ec1d440bc0f | R | 8,252 | 203 | #!/usr/bin/env Rscript
#################### FUNCTIONS
# function to strip after 18 or 15 characters (remove Ensembl Version ID)
library(tximport)
library(GenomicFeatures) # TxDb Database
# library(DBI) only if transcript-gene mapping should be saved as sqlite file
library(DRIMSeq)
library(sta... |
50a3bad89f8b59378052874c9be8a262b44dd37d74eee10a916d526221737768 | R | 8,256 | 202 | options(warn=-1)
suppressPackageStartupMessages({
library(tidyverse)
library(matrixStats)
library(optparse)
library(pointblank)
})
option_list = list(
make_option(c("-a", "--abundance"), type="character", default=NULL, help="input abundance file. SQANTI: *classification.txt; TALON: *talon_read_annot.tsv [R... |
680fadf328732a4759e953d944bbfd7aaef17ce13c0ff12c21cdcdb3609e0363 | R | 8,291 | 318 | ---
title: "02_tf_activity"
author: "Tabea M. Soelter"
date: '2023-09-27'
output: html_document
---
**Transcription factor activity analysis using decoupleR**
__Goal__: Infer TF activity from pseudo-bulked DGE analyses. The TFs I am investigating are signaling mediators of LRTs that overlap across independent datasets... |
eeee64866d7cc14931b16dd950ae68d1f1fcd914d5e797d37cb2a23a56efee5a | R | 8,322 | 158 | ##-------------------------------------------------------
## SEURAT ANALYSIS | MODULES & LIBRARIES
##-------------------------------------------------------
# module purge && module load shared slurm python/3.7.x-anaconda
# module load gcc/8.3.0
# module load hdf5_18/1.8.17
# module load R/4.1.1-gccmkl
# NA104, NA108,... |
722f1a5ae8b1be4e6d41b8791e5f19ce05a0465a72853fe1110d7f00d05d2608 | R | 8,332 | 163 | library(readr)
library(proBatch)
library(dplyr)
library(ggplot2)
library(ggpubr)
#library(grid)
library(RColorBrewer)
library(grImport)
#library(png)
sample_annotation_AgingMice = read_csv("data_AgingMice/3_data_for_plots/sample_annotation_AgingMice.csv")
color_list_AgingMice = readRDS("data_AgingMice/3_data_for_plot... |
a49a4a6755eb89bc3d15441400065c897676cfe4523ce77b38ec7c19235d1054 | R | 8,337 | 217 | rm(list = ls())
# Prepping the metadata file ----------------------------------------------
path_data <- "/data/kailash/DDP/data/"
rna_metadata <- read.csv(paste(path_data, "MSBB_RNAseq_covariates_November2018Update.csv", sep = ""),stringsAsFactors = FALSE)
rna_metadata <- rna_metadata[which(rna_metadata$Action != "... |
325babf7201e66b46e8c4535b7c3a0a0e864dca33e3783b0f9c7d5e4b675f081 | R | 8,352 | 181 | # Set working directory
setwd("~/Desktop")
maindir <- getwd()
datadir <- file.path("~/Desktop/")
# Load packages
library("readxl")
library("ggplot2")
library("ggpubr")
library("reshape2")
library("emmeans")
library("hrbrthemes")
library("umx")
library("interactions")
library("car")
# Import data
data_ppi <- read_exce... |
b6b93c51ea223a4efbce39669df49c2baf4607b20cd2649cc6bb7424d704ef77 | R | 8,381 | 283 | reinstall = F
if(reinstall) {
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
# Bioconductor version 3.16 (BiocManager 1.30.17), R 4.2.0 (2022-04-22)
BiocManager::install("copynumber", update = FALSE) # 1.38.0
BiocManager::install("ComplexHeatmap", update = FALSE) # 2.14.0
... |
840842e2536b682a0d7a24c06ef0ccc4e5a827b151ab6fac27a4fd8d9fd4514e | R | 8,396 | 266 | library(readxl)
library(dplyr)
library(DESeq2)
library(ggplot2)
library(EnhancedVolcano)
############################################
# Plot Function
library(scales)
numColors <- 2 # How many colors you need
getColors <- scales::brewer_pal('qual', palette = "Set1")
myPalette <- getColors(numColors)
names(myPalette... |
cbef69dc9b4b745e6167c1c988fc9af36f5d805baad2f77a5038681316a3651a | R | 8,416 | 225 | # Load libraries ----------------------------------------------------------
library(tidyverse)
library(here)
library(plyranges)
library(ggtranscript)
library(cowplot)
# Arguments ---------------------------------------------------------------
args <-
list(
snRNA_files = list.files(here::here("data", "5prime_CU... |
cd2859fb0e4191f290cbae03b12a04eef1bffe6ab208fa622999b4b1feb089e4 | R | 8,416 | 266 | ---
title: "SpatialDM for LR interactions- RR3 brain"
author: "Yuvarani Masarapu"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Load reticulate library
```{r}
library(reticulate)
```
## Create virtual env with name 'test' and python v3.9.18
```... |
0fe994ec79fd16a82e3003771eaaba05c60f7530f19eaabdda2fb8b7981aa2b7 | R | 8,536 | 269 | #' Running DEXSeq
#'
#' WARNING: This script is work-in-progress
#'
#' Example usage:
#'
#' Rscript PATH/TO/diffexonexpression.R --rds-filename=experiment.rds --model=~sample+exon+group:exon --reducedmodel=~sample+exon
#'
#' `experiment.rds` is a DEXSeq experiment object after filtering
#'
#'
#' -> todo: ideas
sup... |
8cadffb00e87e8d941d3883f1af18b5149cc99e522f3538d5207b74b54bce298 | R | 8,546 | 190 | #' Combine estimates by pooling rules
#'
#' The \code{pool()} function combines the estimates from \code{m}
#' repeated complete data analyses. The typical sequence of steps to
#' perform a multiple imputation analysis is:
#' \enumerate{
#' \item Impute the missing data by the \code{mice()} function, resulting in
#' a ... |
84501f49e8e9ae083257ddecd189c251de676d0ee8286875a04a4f6c47183cfa | R | 8,556 | 220 | #' Procrutes test for dissimilarity matrices
#' @description Perform procrutes test quickly and tidy up the data to
#' data frame.
#' @param spec,env data frame object.
#' @param group vector for rows grouping.
#' @param procrutes.fun string, name of procrutes test function.
#' \itemize{
#' \item{\code{"protest... |
49362a5e666fd8e6256898bd74fd402945a6e86b118c59042b1069273e95aa40 | R | 8,561 | 177 | ## R-Script to read ASCII performance index data and plot them
rm(list=ls()) #clean memory
gc() #collect garbage
library(ggplot2)
library(reshape2)
library(gridExtra)
library(ggsignif)
library(effsize)
library(pwr)
library(BayesFactor)
source("DTS_plotfunctions.R")
################################# us... |
fdf588266c75b7c24c94586e16f30dd5991ebb7e0c9e39bae6b692c9819e14d0 | R | 8,569 | 429 | ---
title: "03_sadick_seurat_preprocessing"
author: "Tabea M. Soelter"
date: "`r Sys.Date()`"
output: html_document
---
**Pre-processing of snRNA-seq data from GEO (Accession #: GSE167490)**
__Goal__: Process GSE167490 (snRNA-seq) data for downstream analyses.
__Reproducibility__:
* GitHub: lasseignelab/230313_TS_... |
b05cbe9c9bbbfee6918aa6ad702742466e35fcc74ffaf5b14fc555506abc3209 | R | 8,630 | 248 | ## To run:
## Rscript process_array.R {idat directory} {output csv path} {path to ref_sample.RData}
## Note: Requires minfi package.
## To install minfi:
## try http:// if https:// URLs are not supported
## source("https://bioconductor.org/biocLite.R")
## biocLite("minfi")
args<-commandArgs(trailingOnly=TRUE)
if (!len... |
3ba423db2b23432989c64842fd5bc9487056a3ff533321b217424632b54f918b | R | 8,641 | 247 | source('~/scripts/single_cell/atac.R')
source('~/scripts/single_cell/wrapper.R')
source('~/scripts/single_cell/markers.R')
source('~/scripts/single_cell/celltype.R')
source('~/scripts/single_cell/de.R')
source('~/scripts/single_cell/graphs.R')
source('~/scripts/grn/models.R')
setwd('~/projects/cutntag/')
counts_path ... |
6f82bebed07e6c3f50c82b2f92821ab662ee1309b5745a7b87d6943e90850ea3 | R | 8,668 | 222 | #' Mantel and partial mantel test for dissimilarity matrices
#' @title Mantel test
#' @param spec,env data frame object.
#' @param group vector for grouping the rows.
#' @param env.ctrl NULL (default), data frame.
#' @param mantel.fun string, function of mantel test.
#' \itemize{
#' \item{\code{"mantel"} will u... |
94e9613fb67a2f8645697e6d6fb5112aec01597fa9a7bcd6d0798d115db6a0df | R | 8,681 | 256 | ---
title: "Random effects strategies in `mice.impute.2l.bin`"
author: "Stef van Buuren"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Random effects strategies in `mice.impute.2l.bin`}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
bibliography: refs.bibte... |
08fe352acbbe6639c05c0a93bac0d98493ebae2cbcc1c6097b9ea75cf9aa30db | R | 8,695 | 253 | library(readxl)
library(dplyr)
library(DESeq2)
library(ggplot2)
library(EnhancedVolcano)
############################################
# Plot Function
library(scales)
numColors <- 2 # How many colors you need
getColors <- scales::brewer_pal('qual', palette = "Set1")
myPalette <- getColors(numColors)
names(myPalette) ... |
2d490ac38f82806cda66c092e50eb9f7055138ca0724e5ad1b97d5f3edbd86c0 | R | 8,711 | 223 | ##-------------------------------------------------------
## SEURAT ANALYSIS | MODULES & LIBRARIES
##-------------------------------------------------------
# module purge && module load shared slurm python/3.7.x-anaconda
# module load gcc/8.3.0
# module load hdf5_18/1.8.17
# module load R/4.1.1-gccmkl
##-------------... |
53dc91ec69f5e6e7b615308bc263d7f6b1a82dde205e2b9681d9fc7ae24a33a8 | R | 8,726 | 253 | ---
title: "EnsembleAge: Epigenetic Age Prediction Using Ensemble Clock Methods"
author: "Amin Haghani"
date: "`r Sys.Date()`"
output:
BiocStyle::html_document:
toc: true
toc_float: true
vignette: >
%\VignetteIndexEntry{EnsembleAge: Epigenetic Age Prediction Using Ensemble Clock Methods}
%\VignetteEngine... |
8d6582e4023d2646d59331593cded90a514312fb0e89c1c74dcb5162cf5e24ef | R | 8,735 | 238 | ##' @title Download RNA data in GDC
##' @description Download gene expression quantification
##' and isoform expression quantification data from GDC
##' either by providing the manifest file or by sepcifying
##' the project id and data type
##' @param manifest menifest file that is downloaded from the GD... |
6806fcd9e79e4296c44b815b7ee73c83c52bd6862b0c1e1d5d4e0e40d5546225 | R | 8,753 | 303 | ---
title: "figure_S6"
author: "Tabea M. Soelter"
date: "`r Sys.Date()`"
output: html_document
---
**Plotting Supplemental Figure 6**
__Goal__: This is a script for generating supplemental figure 6.
__Reproducibility__:
* GitHub: lasseignelab/230313_TS_CCCinHumanAD
* Docker: tsoelter/rstudio_ccc_ad
* Version: ... |
e2829a3abee7485ac9844c82731e496e0c7dd8ea71cebc35510042d9adb16dcc | R | 8,801 | 225 | #' Get required CpG probes for all clocks
#'
#' This function extracts all CpG probes required by any of the clocks
#' to enable efficient data loading.
#'
#' @param verbose Logical indicating whether to print progress messages (default: TRUE)
#' @return Character vector of required CpG IDs
#' @export
#' @examples
#' ... |
aa0f896221b09e8e6476765deef2e31cb05064113a57688f9f767e27e6baa8eb | R | 8,808 | 309 | ---
title: "figure_S4"
author: "Tabea M. Soelter"
date: '2023-10-12'
output: html_document
---
**Plotting Supplemental Figure 4**
__Goal__: This is a script for generating supplemental figure 4 of my manuscript.
__Reproducibility__:
* GitHub: lasseignelab/230313_TS_CCCinHumanAD
* Docker: tsoelter/rstudio_ccc_ad
... |
8cae03824a76933b4b80b2726edddfddc5faf23d301f93686aacba3625260746 | R | 8,810 | 249 | # example of an R file with a helper function
# pretty print a time difference between two proc.time() calls
time_diff <- function(start_time, end_time = NULL) {
if (is.null(end_time)) {
end_time <- proc.time()
}
dt_cpu <- lubridate::make_difftime(num = sum(end_time[c('user.self', 'sys.self')] - start_time[c... |
7a5d6f9685bfd51ce996fed5740f4c95f7d3bf7a062bbd1d07beacea965d150c | R | 8,816 | 211 | library(readxl)
library(dplyr)
library(tidyverse)
library(janitor)
library(pheatmap)
library(grid)
# Function based on: https://stackoverflow.com/questions/43051525/how-to-draw-pheatmap-plot-to-screen-and-also-save-to-file
save_pheatmap_pdf <- function(x, filename, width=12, height=8) {
stopifnot(!missing(x))
stop... |
a9181d405df4560d3a3cd93e939c041f926c19ba1662c526147173974fdaf2e2 | R | 8,840 | 175 | #!/share/apps/R/3.3.3/bin/R
# letters_train <- letters[1:16000, ]
# letters_test <- letters[16001:20000,]
# library(kernlab)
# classifier <- ksvm(X231 ~ ., data=Te,kernel = "vanilladot")
# letter_classifier
classifier = svm(formula = X231 ~ .,
data = Te,
type = 'C-classification',
... |
db810c2e4db2d50398c341dc77047dba2bb6f9893c9b3d33db9e79715c1d1f5a | R | 8,867 | 247 | #' Imputation by a two-level logistic model using \code{glmer}
#'
#' Imputes univariate systematically and sporadically missing data
#' using a two-level logistic model using \code{lme4::glmer()}
#'
#' Data are missing systematically if they have not been measured, e.g., in the
#' case where we combine data from differ... |
862a35ecf9b82e568e59eb99393907b92fd73519bdf5c02a2fba89a7701c4df5 | R | 8,868 | 166 | library(proBatch)
library(readr)
library(dplyr)
library(MSstats)
library(tibble)
library(ggplot2)
library(ggdendro)
library(ggpubr)
library(cowplot)
# library(dendextend)
source('plot_dendrogram_replicates.R')
sample_annotation_PanCancer = read_csv('data_PanCancer/3_data_for_plots/sample_annotation_PanCancer.csv') %... |
46adcbacb9de500a2b566bec237f8381027140cd9df1a85e6801e8a7dfb6773a | R | 8,869 | 258 | #!/usr/bin/env Rscript
source(here::here("src/shared/R-helpers/get_settings.R"))
suppressPackageStartupMessages({
library("digest")
library("readr")
library("httr")
library("purrr")
library("dplyr")
library("ggplot2")
library("igraph")
library("tibble")
})
settings <- get_settings(omic = "proteomics"... |
01bfb98d9b4dc3c5c4dc340000e137626b1f05a754f47131d8a1cd9ef0a0bef3 | R | 8,880 | 142 | #' Fit generalized linear mixed model with known relationship matrices
#' under the null hypothesis for imbalanced case-control related samples.
#'
#' The \code{fit_null_glmmkin_Binary_SPA} function is a wrapper of the \code{\link{glmmkin}} function from
#' the \code{\link{GMMAT}} package that fits a regression model u... |
0df8cab152cb793b8f1a501de111ce49f2bf5068762833df3093f036e728bb23 | R | 8,885 | 327 | cbind.mids <- function(x, y = NULL, ...) {
call <- match.call()
dots <- list(...)
if (is.mids(y)) {
return(cbind.mids.mids(x, y, call = call))
}
if ((is.null(y) || length(y) == 0L) && length(dots) == 0L) {
return(x)
}
n <- nrow(x$data)
if (length(y) == 1L) {
y <- rep(y, n)
}
if (length(... |
e2de85423438a9c3d2d6c2556a8701dd7b080fae608565b0bdd65513b4f57a6e | R | 8,886 | 251 | ##################################################################################
# Load data
##################################################################################
df <- read.table("table_ind_params_covs.csv",
header = TRUE, sep = " ", as.is = TRUE)
df <- df[- which(is.nan(df$CTC)), ] ... |
6f9a503ac85c3026e9e8a91ed36cf1b29de4617d2e200d508ed07bbb8cf86701 | R | 8,917 | 202 | ##-------------------------------------------------------
## SEURAT ANALYSIS | MODULES & LIBRARIES
##-------------------------------------------------------
# module purge && module load shared slurm python/3.7.x-anaconda
# module load gcc/8.3.0
# module load hdf5_18/1.8.17
# module load R/4.1.1-gccmkl
##-------------... |
8a6281e040f967f48a8ece02cf2d73d9b7263d952fc68d0146a4c3d48aa515dc | R | 8,938 | 217 | ## Differential expression analysis with limma-voom
## Sex-specific analysis for specific brain region
suppressPackageStartupMessages({
library(SummarizedExperiment)
library(optparse)
library(dplyr)
library(limma)
library(edgeR)
library(here)
library(sva)
})
save_volcanoPlot <- function(top... |
171f1c2b8ca7f776bc13fdda3ba518e5f8f9f39193027cc06fc80c5650afa6b4 | R | 8,950 | 202 | #!/usr/bin/env Rscript
source(here::here("src/shared/R-helpers/get_settings.R"))
source(here::here("src/shared/R-helpers/create_volcano_plot.R"))
suppressPackageStartupMessages({
library("cowplot")
library("dplyr")
library("ggplot2")
library("purrr")
library("UpSetR")
library("EnhancedVolcano")
library(... |
ec5e220937670bccd74f2f4c761c99e392c87ad34c598b826b3045ddabce6ca5 | R | 8,985 | 228 | #' Influx and outflux of multivariate missing data patterns
#'
#' Influx and outflux are statistics of the missing data pattern. These
#' statistics are useful in selecting predictors that should go into the
#' imputation model.
#'
#' Infux and outflux have been proposed by Van Buuren (2018), chapter 4.
#'
#' Influx is... |
8a5daac15fd3d893fe90f640063101c0aa23a67cc54ee2a504495361ab871f3f | R | 8,996 | 203 | #!/usr/bin/env Rscript
source(here::here("src/shared/R-helpers/get_settings.R"))
source(here::here("src/shared/R-helpers/create_volcano_plot.R"))
suppressPackageStartupMessages({
library("cowplot")
library("dplyr")
library("ggplot2")
library("purrr")
library("UpSetR")
library("EnhancedVolcano")
library(... |
51c7ddb4acb28998fb51cc5bda19ae128e4007455852c6d5ef30bd1ffb7debb7 | R | 9,024 | 134 | ###########################################################################
## Author: Youtao Lu <luyoutao@sas.upenn.edu>
##
## Copyright (c) 2021-2023, Youtao Lu and Junhyong Kim, Department of Biology, University of Pennsylvania
## Copyright (c) 2021-2023, James Eberwine, Perelman School of Medicine, University of ... |
400559cef588af3704b799c3dfdde4b3006c534c3e37891c89d7f1ad0441708a | R | 9,025 | 294 | ## ClinVar data was downloaded and filtered using a bash getClinVarForLoci.sh avilable here: https://github.com/egustavsson/long-read_scripts
## GBA PD data was downloaded from: https://pdgenetics.shinyapps.io/gba1browser/
# Load libraries ----------------------------------------------------------
library(tidyverse)
... |
6338b43178ff7808c040aa0bc775f9f1461756ea684997b3c61a474a21ccb318 | R | 9,029 | 229 | # Making the scatter plot of pVals before and after cell type correction
rm(list = ls())
# Loading libraries -------------------------------------------------------
.libPaths(c("libraries/", .libPaths()))
source("scripts/libraries.R")
source("scripts/utils.R")
library(ggplot2)
library(tidyverse)
library(ggpubr)
# ... |
e22ebbd8d5b1df8f9de2d410c8f17600f943716653612eb7541dbc59117aefb6 | R | 9,092 | 263 | #!/usr/bin/env Rscript
source(here::here("src/shared/R-helpers/get_settings.R"))
suppressPackageStartupMessages({
library("digest")
library("readr")
library("httr")
library("purrr")
library("dplyr")
library("ggplot2")
library("igraph")
library("tibble")
library("stringr")
})
settings <- get_setting... |
bc3f32404d52627aad94010515f29776275815f7429b0074f04b07aeb3000d05 | R | 9,117 | 258 | rm( list=ls(all=TRUE ) )
# Load and install necessary packages
load_required_packages <- function(packages){
new.packages <- packages[!(packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
invisible(lapply(packages, library, character.only = TRUE))
}
requ... |
8ea3050f6fff501b46c6d48eef6862da0eecd3397ed283ff25a23ff53413a4b8 | R | 9,124 | 393 | data <- nhanes
# case A: no predictorMatrix, blocks or formulas arguments
imp1 <- mice(data, print = FALSE, m = 1, maxit = 1)
pred <- imp1$predictorMatrix
form <- imp1$formulas
test_that("MICE-INITIALIZE-001: Case A finds blocks", {
expect_identical(names(imp1$blocks), colnames(data))
})
test_that("MICE-INITIALIZE-... |
7bf7a51888099738b845edda526ec83abc427da580f5f0584bc66ca43af48ff2 | R | 9,125 | 213 | ##--------------------------------------------
## Modules
# module purge && module load shared slurm python/3.7.x-anaconda
# module load hdf5_18/1.8.17
# module load gcc/8.3.0
# module load htslib
# module load gsl/2.4
# module load macs/2.1.2
# module load R/4.1.1-gccmkl
##--------------------------------------------... |
95a90a7f1e5e3ce3467858c292385ec67061fef2290701d3f314ecf0f0a6f6cd | R | 9,140 | 227 | ### Frame-by-Frame package ###
### miscellaneous ###
# function appendRAWs(...) ------------------------------------------------
# was the experiment interrupted for some reason? e.g. powercut
# function allows to append two or more RAWs.csv into one
# naturally it will not magically recover the missing datapoints
#... |
48de823f0140a1a5a9b26b1f227c4d8cc4d8053719c237d62ca99c936c6225ae | R | 9,189 | 351 | #' Predict method for linear models with multiply imputed data
#'
#' @param object A prediction model, either a single lm object or a list of lm
#' objects obtained from multiply imputed data (object can also be of class mira).
#' @param newdata An optional data frame in which to look for variables
#' with which to pre... |
07fababfb85d37e4f1e701954e7ea15855d46c78b6ee16cd7197c04ed771095e | R | 9,207 | 252 | ##' @title Competing endogenous RNAs (ceRNAs) analysis
##' @description Identify ceRNAs by
##' (1) number of shared miRNAs between lncRNA and mRNA;
##' (2) expression correlation of lncRNA and mRNA;
##' (3) regulation similarity of shared miRNAs on lncRNA and mRNA;
##' (4) sensitivity correlation
##' ... |
ce9a5c236f55987dcacd4d3b10ac158abaec7476257d41e53026ba7e3e8174d4 | R | 9,207 | 209 | ### Frame-by-Frame package ###
### active bout parameter ###
# below are two functions
# 1-- main one (last) is activeboutParameter(...)
# it is called when the user asks for a parameter which requires distinguishing single active bouts
# e.g. activeboutMean or activeboutNum
# it loops loops through time windows, and... |
0dc076d0ca24ebd015d7b3e6cc4ac8378406e7c65bdc7d57cdc59d11c7de584d | R | 9,214 | 270 | # Load libraries ----------------------------------------------------------
library(tidyverse)
library(readxl)
library(here)
library(GenomicFeatures)
library(GenomicRanges)
library(gridExtra)
# Arguments ---------------------------------------------------------------
options(warn=-1)
args <-
list(
iPSC = list... |
74bfeefac899513a8bd1e74664861fdc5bb9def9344fbdef91509adc8d20a7bc | R | 9,232 | 219 | #' Imputation by Bayesian linear regression
#'
#' Calculates imputations for univariate missing data by Bayesian linear
#' regression, also known as the normal model.
#'
#' @aliases mice.impute.norm norm
#' @inheritParams mice.impute.pmm
#' @return Vector with imputed data, same type as \code{y}, and of length
#' \code... |
12474bbb0a2e8ff9a0402b6392e2f4e04640cb7af6987f07723af918ffbabbaf | R | 9,271 | 257 | ---
title: 'Saldana, Montano, et al. -- ATAC-seq: Annotation and enrichment analysis'
author: 'Florian Halbritter'
date: '`r format(Sys.time(), "%B %d, %Y %H:%M:%S %Z")`'
output:
html_document:
toc: yes
toc_float: yes
code_folding: show
highlight: pygments
df_print: paged
---
# Intro
In this ... |
15fb6e245c162dd90fa124c66feddb764bb0d6b5c008a8a2df366c8781f1698e | R | 9,331 | 354 | ---
title: "figure_S3"
author: "Tabea M. Soelter"
date: '2023-10-15'
output: html_document
---
**Plotting Supplemental Figure 3**
__Goal__: This is a script for generating supplemental figure 3 of my manuscript.
__Reproducibility__:
* GitHub: lasseignelab/230313_TS_CCCinHumanAD
* Docker: tsoelter/rstudio_ccc_ad
... |
5b12781c0e0d42de9c8d16bdd92bc190f939239b0023767f00b6f7222e1a1285 | R | 9,333 | 301 | library(tidyverse)
library(fgsea)
library(biomaRt)
### Read Data
metaData <- readxl::read_xlsx("ALS_Consortium_RNA_Metadata_01042021.xlsx")
metaData <- metaData %>%
mutate(ExternalSampleId = gsub("-", "_", ExternalSampleId))
SC_All_DEA_res <- read.csv("allsc.AllSamps.SexFilt.CompModel.csv")
SC_Females_DEA_res <-... |
7e53d20737a7bf87971da847a948c38f82e84c30d9a6e974b7fc5fdcc245ef24 | R | 9,363 | 297 | rm( list=ls(all=TRUE ) )
# Load and install necessary packages
load_required_packages <- function(packages){
new.packages <- packages[!(packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
invisible(lapply(packages, library, character.only = TRUE))
}
requ... |
ce944f019bcdcfb7b24f641e8bf1140bb88e89e7955ec5892d32318a132eeb8c | R | 9,365 | 297 | rm( list=ls(all=TRUE ) )
# Load and install necessary packages
load_required_packages <- function(packages){
new.packages <- packages[!(packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
invisible(lapply(packages, library, character.only = TRUE))
}
requ... |
0d8217839603762a332eb974a25376b379c50845401d50d6fdafb4dc39546bf9 | R | 9,371 | 237 | ### Frame-by-Frame package ###
### sleep parameters ###
# function hoursSleep_onefish(...) ----------------------------------------
# zzc = one column of sleep booleans (TRUE = this frame was part of a nap / FALSE = this frame was not part of a nap)
#' Title
#'
#' @param zzc
#' @param fps
#'
#' @return
#' @export
... |
e5bf60698070acd1c59d49f7bac9a405299f8b585488782d3651180d1d1f46a4 | R | 9,389 | 353 | ---
title: "figure_S8"
author: "Tabea M. Soelter"
date: '2023-10-08'
output: html_document
---
**Plotting Supplemental Figure 8**
__Goal__: This is a script for generating supplemental figure 8 of my manuscript.
__Reproducibility__:
* GitHub: lasseignelab/230313_TS_CCCinHumanAD
* Docker: tsoelter/rstudio_ccc_ad
... |
e546f9fc91d54ee9ca29cbf1e764ab0ed50674fa8f45820f05dc3c168ed3a2bd | R | 9,392 | 356 | ---
title: "figure_2"
author: "Tabea M. Soelter"
date: '2023-05-19'
output: html_document
---
**Plotting Figure 2**
__Goal__: This is a script for generating figure 2 of my manuscript.
__Reproducibility__:
* GitHub: lasseignelab/230313_TS_CCCinHumanAD
* Docker: tsoelter/rstudio_ccc_ad
* Version: 1.0.5
* HPC: Y... |
41475c0d028ce02c8e0b260f03529ee5532524a1d8836d28eef4ab56d8aad94b | R | 9,397 | 232 | ---
title: 'Saldana, Montano, et al. -- ATAC-seq: Annotation and enrichment analysis'
author: 'Florian Halbritter'
date: '`r format(Sys.time(), "%B %d, %Y %H:%M:%S %Z")`'
output:
html_document:
toc: yes
toc_float: yes
code_folding: show
highlight: pygments
df_print: paged
---
# Intro
In this ... |
46f004a0212ec0bffddba0bb06319d9bc4ce4c68b2ee761082162e6168b3fbc8 | R | 9,401 | 256 | source('~/scripts/single_cell/de.R')
source('~/scripts/perturbator/de.R')
library(Pando)
library(doParallel)
registerDoParallel(36)
setwd('~/projects/cutntag/')
#### Read and prepare stuff ####
marks <- read_rds('data/CT/all_marks_list_v3.3motifs.rds')
H3K27ac_nt <- read_rds('data/trajectories/nt/H3K27ac_nt_dpt_ls... |
216a6cb5199ab272b4ff865f3f0e101c649e7fd19cd55301f61308663867b105 | R | 9,426 | 332 | ---
title: "03_pathway_activity"
author: "Tabea M. Soelter"
date: '2023-10-03'
output: html_document
---
**Pathway activity analysis using decoupleR**
__Goal__: Infer pathway activity from pseudo-bulked DGE analyses in order to complement TF activity analyses performed previously.
__Reproducibility__:
* GitHub: lass... |
e4c1919fa8e72c58a211bc4919dc0a3c57887b405ed1706fa329d3a09e331185 | R | 9,445 | 257 | ---
title: "PCA Outlier Analysis"
author: "Emma Jones"
date: "2023-03-01"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Run PCA for Exploratory Data Analysis
Before performing DTU analysis, we want to ensure data is good quality. So, we will do some exploratory data ... |
e641b8addb1441a9591ddaa5a2b531a46bc3a9bbfeb86951457671caacab0c1b | R | 9,451 | 238 | ##' @title Differential gene expression analysis
##' @description Performs differential gene expression analysis by
##' \pkg{limma}, \pkg{edgeR}, and \pkg{DESeq2}
##' @param counts a dataframe or numeric matrix of raw counts data generated
##' from \code{\link{gdcRNAMerge}}
##' @param group a vector giving th... |
9659eb81712ed53406ae9bbd22ca4962b1478e6345d54950726bc6f45855448e | R | 9,477 | 194 | ## ---------------------------
##
## Script name:
##
## Purpose of script:
##
## Author: Prakhar Bansal
##
## Date Created: 2021-09-08
##
## Copyright (c) Prakhar Bansal, 2021
## Email: pbansal@uchc.edu
##
## ---------------------------
##
## Notes:
##
##
## ---------------------------
## set work... |
08971297763fc1b6268bdee70371fa09544fc5622fe8974b58a0092c0d2ba269 | R | 9,500 | 249 | ---
title: "Saldana, Montano, et al. -- scRNA-seq: Mapping of single cells to the Kameneva and Jansky datasets"
author: "Luis Montano"
date: '2023-08-09'
output: html_document
params:
inputdata: '~/path/to/input_data/'
kamenevadata: "~/path/to/kamenevadata/"
janskydata: "~/path/to/janskydata/"
plotpath: '~/path... |
6a43fda08ed31ceec22c04c44d0e8588a02d145a17f512dfd1ce9a462a13c8ff | R | 9,521 | 230 | #' Detect and fix data orientation
#'
#' This function detects whether methylation data has probes as rows or columns
#' and converts it to the standard format (probes as rows, samples as columns).
#'
#' @param dat0sesame Data frame or matrix containing methylation data
#' @param samps Optional data frame containing s... |
3041e837fdecaad91ba72ba2956455a5c76cc20a5f0d4d9a10dad709f1e06b47 | R | 9,539 | 233 | ###################################################
# ~~~ FramebyFrame package ~~~
# function addTimetoRAWs
# Francois Kroll 2022
# francois@kroll.be
###################################################
# previously, Vp_Sorter was a standalone script writing RAWs.csv without timestamp columns
# then, function importA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.