sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
3d18f2eeade6cceea52e218044f5b097402e5e6b20322c0bf84a2a3ecdd7615e | R | 6,408 | 235 | # libraries
library(readxl)
library(tidyverse)
library(ggpubr)
library(rstatix)
library(emmeans)
library(sjstats)
library(lme4)
library(lmerTest)
library(MuMIn)
library(multcomp)
library(nlme)
library(r2glmm)
library(ggplot2)
library(ggthemes)
library(svglite)
library(sjPlot)
library(dplyr)
# prepare -----------------... |
961c2d73ea70c814ebe5487d0b5da8f5ee526a8046599951d12f892ec20f78ba | R | 6,427 | 231 | ### plyr has rbind.fill for matrices now. We keep with our version to avoid the
### dependency, but do not export it anymore.
#' Quick data frame
#'
#' Experimental version of [as.data.frame()] that converts a list to a data
#' frame, but doesn't do any checks to make sure it's a valid format.
#' Much faster.
#'
#' @... |
393cee6392254134106b03054fc72337e794868824be657e76c741477ce142bd | R | 6,438 | 142 |
#' archstabms__get_model_results
#'
#' Get model results and coefficients.
#'
#' @param input_folder path to input folder with model results (required)
#' @param RT constant (default:0.001987*(273+24))
#'
#' @return data.table with model results
#' @export
#' @import data.table
archstabms__get_model_results <- functio... |
190b992268ff42a7b1f5d0d518b720541b84d164624db4675f04dbf124123f4c | R | 6,442 | 215 | # Plot the ROIs with positive LE values for each state across the ks of interest on the brain.
# Output:
# 'max',as.character(maxk),'_',onehemi,'_',onelat,'_ksortvis_brain.jpg' Brain plots of positive LE values for each state.
# 'max',as.character(maxk),'_ksortvis_brain_clbr.jpg' Corresponding color bar.
#Set librarie... |
3c87c95504ba8b8cadfd11fe34a0ebf9e1fb7280b0dc8c0ded1165b7d8ed51b9 | R | 6,446 | 150 | # author: "Manuel Miguel Ramos Álvarez and the Muzzio Lab" 2024
AdjMod.23.f<-function(LasMedP,TyLbl=NULL,xLb="X",yLb="Y",xmaxp=10,yminp=0,PIp=NULL,
LineRate=TRUE,pointXMed="p",pointXMedLb="OnAx",RootG=FALSE,MaxG=FALSE,InflG=FALSE) {
chkPkg(c("shape","RootsExtremaInflections"))
decilecolors=c(... |
9458b4498534e79812d71f6a24d4caf3c7e285d02512d20df87a0a6d35bb230a | R | 6,453 | 213 | #!/usr/bin/R
# -------------------------------------------------------------
# Bin cells with top scores - pseudotime ish
# Updated: 12/06/2021
# -------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
l... |
a3d2308a225b28a622d8454256932ca9f2a4dce29d256d057caa3eeb9c9d0186 | R | 6,472 | 175 | # load the reshape2 package
library(reshape2)
library(dplyr)
##########################################################################################
setwd("D:/home_wkstn/F/Brain_region_project/LIANA/Results_aggregate_rank_magnitude_all_projid")
data=read.csv("TH.csv")
data=subset(data,aggregate_rank ... |
bcad5c0a1d8bb725b5e0c5096e913fff0a18320e1171b94f8ed67b9e7d371393 | R | 6,485 | 98 | ###################################################MR##########################################
#load packages
library(TwoSampleMR)
library(MRInstruments)
library(data.table)
library(tidyr)
library(plyr)
#prepare exposure data
for (i in c("X24467","X24468","X24469","X24470","X24471","X24472","X24473","X24474"... |
c8d70a884ce68d6b86a4e43f11182238ac9d93e627984e6050092cc9ee5a5148 | R | 6,486 | 281 | require(testthat)
require(Cardinal)
context("XDataFrame")
test_that("XDFrame accessors", {
expect_true(validObject(XDataFrame()))
set.seed(1)
d0 <- DataFrame(A=sort(runif(10)), B=1:10, C=11:20, D=letters[1:10])
d1 <- XDataFrame(d0, keys=list(index1="A", index2=c("B", "C")))
expect_true(validObject(d1))
d1$X... |
3c0638c19d9a95ba72b89b4a87ec30731230d6444134ba92cddcf5f7c6e4bcfc | R | 6,502 | 95 | # Generation of the sliding window amino acid fragments for CustomArray synthesis
sys.args <- paste("-e",shQuote("setwd('/home/rstudio')"),"-e",shQuote("rmarkdown::render('S1_CustomArraySequences.R')"), sep=" ")
system2("/usr/local/bin/Rscript", args = sys.args, stdout = "logs/S1_CustomArraySequences_runLog.txt")
syste... |
2629c33250d140d29e06bb0440972814f71e5c2675c1a70a5332378ef563377a | R | 6,508 | 192 |
###########################################################################################
# Load relevant packages
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
modStatus <- loadMonoclePackages()
print(modStatus)
library("optparse")
# library("lme4")
# Source t... |
79bdc40ac40834673b7f6193c547e27ffbce8295674b12a83d44087eadffd737 | R | 6,514 | 223 | #!/usr/bin/R
# ---------------------------------------------------
# Select modules from multiregion set for Sumaiya
# 1. Remove/aggregate the redundant clusters
# 2. Score based on average gene expression per cell type
# - Remove ambient RNA / contam
# - Keep cell type specific
# - Cut down to top N genes
# Updated 10... |
d5bbbccd37f7d434d4fe1493e623cc426dd1d383b42f7aded469395966af027d | R | 6,516 | 183 |
# load requirements
suppressPackageStartupMessages({
library(monocle3)
library(dplyr)
})
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
library("optparse")
library("harmony")
library('class')
library(ggplot2)
# Get the passed parameters
option_... |
1f14f5552344619e1206583be5e21bf3d4fc5eb4f346ad5233cc9b1c276088db | R | 6,526 | 190 |
library(ggplot2)
library(dplyr)
library("optparse")
library(stringr)
library(tidyr)
library(tidyverse)
print("Libraries loaded, starting now")
getCombinedCovariateCSV <- function(opt, inputCelltypes, inputCovariateList){
# Loop and get a combined CSV for each covariate
for (eachCovariate in names(inp... |
c49303c1f1d9b93d3b73d4a84e8c952979f0802401369573a840f3ddf4597795 | R | 6,534 | 205 |
library(ggplot2)
library(dplyr)
library("optparse")
library(stringr)
print("Libraries loaded, starting now")
getFitResults <- function(opt){
rdsPath = "./rdsOutput/nebulaFits/"
# Loop through each of the splits
resultDF = data.frame()
for (eachSplit in 1:(opt$nSplits)){
inFile = paste0(rdsPath, opt$cellType, ... |
a1740c8e84fcb3369b8b760625f7ab076f69060cadce81764393cfed43d8e431 | R | 6,537 | 196 | #!/usr/bin/R
# ----------------------
# Score regions by DEGs:
# Updated: 03/29/22
# ----------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
library(tidyr)
library(ggplot2)
library(ggpubr)
library(ggrepel)
library(ggrastr)
library(circlize)
libra... |
72be48bd0b0b335b03602b7cc478efdc4350976b0c2d49faa44c55f7ee3b7f38 | R | 6,554 | 169 | ####function Up_Down_GO : get the geneLevel of each pathway
#input: the GO pathway, the DEG dataframe, the DEG name category, biological process of molecular function, the cell type
#output: a csv file with for each cell type and category the associated pathways with ID, description, Genes, pval, qvalue, count and gene... |
c3588be1bbd3536fbc7cd0065ce731dca927f9b524838a0945744e7167d1106e | R | 6,560 | 196 | #!/usr/bin/R
# -----------------------------------------------------------
#
# -----------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
library(tidyr)
library(rhdf5)
library(ggplot2)
library(viridis)
load('Annotation/multir... |
5303eaf0ffe53d728c0cfa7522b57d3ca4ad81d2cd20f0552d6c595ae745cfe6 | R | 6,566 | 188 | test_that("write_citations exports data frame correctly in txt format", {
citations <- data.frame(
duplicate_id = 1:3,
author = c("Author 1", "Author 2", "Author 3"),
title = c("Title 1", "Title 2", "Title 3"),
year = c(2020, 2021, 2022),
journal = c("Journal 1", "Journal 2", "Journal 3"),
abs... |
b2c76806370d38923ee9a152f901dce3f86899fb31415684c00f66526de1a320 | R | 6,566 | 172 |
###########################################################################################
# Load relevant packages
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
library(monocle3)
print(modStatus)
library("optparse")
library("lme4")
# Source the draft code for m... |
b856dd1e2230330e83cbf5243743e84aa9a73804626ed5b08da8046462d31931 | R | 6,591 | 195 | #!/usr/bin/R
# ----------------------------------------------
# Plot the module scores on the pseudobulk data:
# Updated 11/27/2021
# ----------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadata.R'))
}
library(tid... |
3db992fd9a936fb1b6fa98af8e540d88f34cb9515c308ed521ddd307ec6d8303 | R | 6,592 | 198 | # For the specified k, color the distribution of reconfiguration
# values across subjects in box plots by the PLSC loading with different colors
# for stable values.
# Output:
# curr_lab,'.jpg' Colored box plot for a given reconfiguration metric.
#Set libraries.
library(tidyverse)
library(ggplot2)
#Catches argument... |
498cc5e0821273211799aacc775946dddb3d97ac2b6a9b19250fce9acad654fd | R | 6,594 | 178 | #'
#' Class to read Nosa software results stored as *.xlsx file and store the tables internally.
#'
#' The 'data' field is initialized after $loadNosaResults was called.
#'
#' @field data NosaResults data as list. Valid list entries are: "metadata", "Raw", "Processed", "Baseline", "Spike Detection" and "Smoothing".
#'
... |
5199b294b3ce0dc0e302c21c393ae9d38bcf06dd4737eaefd25334587d505f0f | R | 6,594 | 190 | #!/usr/bin/R
# -------------------------------------------------------------
# Score genes by their expression's correlation with depletion:
# Updated: 01/19/2022
# -------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R')... |
cafb85afc29bedbf5e77c4ee14b9f7f4a6d1fdc20f1b44897c2615bce8e460b8 | R | 6,607 | 152 | # Load libraries
library(DESeq2)
library(tidyverse)
source('/E-P-INs/Scripts/DESeq2/DESeq2.R')
# DESeq2 Analysis
DESeq2(comparisons = '0hrs_3hrs.RNASeq',
comparisons_dir = '/E-P-INs/RNASeq/DESeq2/Comparisons/',
conditions = c('0hrs.RNASeq', '3hrs.RNASeq'),
conditions_dir = '/E-P-INs/RNASeq/DESeq2/... |
2b7a80255f037eb2edcd7bd6a0997a9aea200f7f0af16762f612de584b31b89d | R | 6,619 | 148 |
load_packages <- function(packages_list) {
# install required packages if they are not installed yet:
new_packages <- packages_list[
!(packages_list %in% installed.packages()[, "Package"])]
if (length(new_packages)) install.packages(new_packages)
# load all required packages:
invisible(lapply(packages_li... |
9395c2254351107372b50b4b02513a979f9f23152dab09c65ed9100174404d8b | R | 6,637 | 173 | #### create a single plot for the 3 samples MSE change with 30 bootstraps ####
wd <- "~/projects/chimp_human_opnmf/"
setwd(wd)
# load in libraries needed for script #
# need to install pacman if not already installed
if (!require("pacman")) install.packages("pacman")
pacman::p_load(dplyr, ggplot2, fs, neurobase, oro.... |
3bb2e823941e5c1485976d670706ce7a1f338e4690feeeb80b50f6e80cda9f59 | R | 6,657 | 214 | library(dplyr)
library(tidyr)
library(sccomp)
# Shared fast estimate for draw-file / portability checks (one factor, pathfinder).
estimate_for_draw_tests <- function(output_directory, portable) {
data("counts_obj", package = "sccomp", envir = environment())
counts_obj |>
sccomp_estimate(
formula_composit... |
f2c7a167878145706c1199425094680a8ca9dafb42d4e25ffa67d26dd3110b07 | R | 6,658 | 166 | #' Estimate a level 2 (subject) model using FSL FEAT with fixed effects integration of runs
#'
#' @param l3_df a data.frame containing cope inputs for a given l3 model, as well as metadata
#' that identify the model.
#' @param gpa a \code{glm_pipeline_arguments} object containing model specification
#'
#' @importFrom... |
e640f86a2e353bf4365b76bb62d23ccc18d3ca432a72d6dda5b71f0790532c52 | R | 6,665 | 162 |
# Greg Booth 2021
# This script takes the output from the BBI pipeline for sciATAC
# for each sample
# performs some filtering (by QC and doublets)
# returns a cds object of peak by cell data.
basepath = "/net/trapnell/vol1/HuBMAP/novaseq/210111_Riza_sciATAC3_split_sample/analyze_out/"
out_path = "/net/trapnell/vol... |
e5fa770f8f14becb3dcce396ed559ce780675d0a35dcc0c1bebeefe7ef97f044 | R | 6,673 | 208 | #!/usr/bin/R
# ----------------------------------------------------------
# Flag modules that may be due to contamination/ambient RNA:
# Updated 12/01/2021
# ----------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir... |
d86bd18996fee91b01664d8f29826fa3544662d4a9f96d283ba3a40a24305b59 | R | 6,676 | 130 |
#Smooth line plot to show the relationship between methylation and expression of global gene
library(dplyr)
library(ggplot2)
library(patchwork)
library(ggpubr)
library(magrittr)
dataExp <- read.csv("F:\\RNA\\RawTables\\OriginalRef\\GeneCountMatrix.tpmUnit.csv", header=T, row.names=1) %>% select(., contains("7... |
00c9369744770d3feac04e8e7574d5c04a079e07d145c64e169b0231202c84d8 | R | 6,684 | 240 | #!/usr/bin/R
# ----------------------------------------
# Collate all GEPs (broad, exc, inh, ast):
# Updated 02/04/2022
# ----------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadata.R'))
}
library(ComplexHeatmap)
libra... |
7218bd3f432a8229b17c7f47c0878a4dae8cd992ed93bf57ede08f73e50984fa | R | 6,705 | 170 |
#' ---
#' title: "Custom array sequence generation"
#' author: "Tomas Bjorklund"
#' output:
#' pdf_document:
#' highlight: tango
#' geometry: margin=0.7in
#' ---
#' This script generates all unique AA sequences for the CustomArray production
suppressPackageStartupMessages(library(knitr))
#+ setup, include=FALS... |
ec7c75f7457b703c5b4495190f41247f361d71da2f12e551aa56cea92a7120f6 | R | 6,721 | 231 | # Functions ------------------------------------------------------------------
.na.if.different <- function(x) {
if (length(unique(x)) > 1) NA else x[1]
}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.apply_workhorse <- function(data, MARGIN, FUN, ...) {
if (length(data$spc) == 0... |
cab9c38f0da5bed5d7cc1d797254ee272aab0adebe00cbcd7c4855f1d504e8e4 | R | 6,727 | 221 | library(testthat)
test_that("refresh_l1_cope_names populates cache from L1 contrasts", {
gpa <- create_mock_gpa(n_subjects = 1, n_runs = 1, include_l1_models = FALSE)
l1_cmat <- matrix(
c(1, 0),
nrow = 2,
ncol = 1,
dimnames = list(c("cope_face", "cope_house"), "Intercept")
)
gpa$l1_models <- l... |
e3ed938d295aafe69053e80f86358ecc4fd1a586d213f183581be72065ac3942 | R | 6,730 | 174 |
# Greg Booth 2021
# This script takes the output from the BBI pipeline for sciATAC
# for each sample
# performs some filtering (by QC and doublets)
# returns a cds object of peak by cell data.
basepath = "/net/trapnell/vol1/HuBMAP/novaseq/210111_Riza_sciATAC3_split_sample/analyze_out/"
out_path = "/net/trapnell/vol... |
26ab772a77379b7120ea7f546d82890641d776f24cbf80a2211c819d7e0fcba6 | R | 6,733 | 152 | # Load libraries
library(DESeq2)
library(tidyverse)
source('/E-P-INs/Scripts/DESeq2/DESeq2.R')
# DESeq2 Analysis
DESeq2(comparisons = '0hrs_3hrs.H3K27ac',
comparisons_dir = '/E-P-INs/H3K27ac/DESeq2/Comparisons/',
conditions = c('0hrs.H3K27ac', '3hrs.H3K27ac'),
conditions_dir = '/E-P-INs/H3K27ac/DE... |
aa87c72dae8b727dda191a844682a726e8ea7da5f8c0ee6934c4c606f9158a3d | R | 6,733 | 152 | # Load libraries
library(DESeq2)
library(tidyverse)
source('/E-P-INs/Scripts/DESeq2/DESeq2.R')
# DESeq2 Analysis
DESeq2(comparisons = '0hrs_3hrs.ATACSeq',
comparisons_dir = '/E-P-INs/ATACSeq/DESeq2/Comparisons/',
conditions = c('0hrs.ATACSeq', '3hrs.ATACSeq'),
conditions_dir = '/E-P-INs/ATACSeq/DE... |
d935c0984c1bb205178836a3486b2531cb9b252a9ef7c724aa7397cbda8a9f1f | R | 6,734 | 182 | library("Seurat")
library("tidyverse")
setwd("./Step5.FinalClustering")
Seurat.SNC.final <- readRDS("Seurat.SNC.final.rds")
# Step1: Update the marker genes for microglia
# marker gene expression
NormalizeData(Seurat.SNC.final, assay = "RNA")
Seurat.SNC.final$MajorCluster <- factor(Seurat.SNC.final$MajorCluster,
... |
f7383f0c40200b6c9fcc7aa0f8d9d7bdf327e9c8774559a8e57004c224bbeeec | R | 6,742 | 168 | data <- qs::qread("C:/SynologyDrive/Projects/scRNAseqR/results/sakshi_4/NSM-NS-NC-M/NSM-NS-NC-M.qs")
cds <- SeuratWrappers::as.cell_data_set(data, assay = "SCT")
# load match_clustering function
cds <- match_clustering(data, cds, match_seurat_clustering = FALSE)
cds <- monocle3::learn_graph(cds)
for (partition in s... |
3499897b236b28e97ed61a31c54072befb4e4174c75a5a711539d9c8265cbc0e | R | 6,758 | 197 | #!/usr/bin/R
# ------------------------------------------------------------
# See which vuln markers have carry over to inhibitory neurons
# Updated: 12/23/2021
# ------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
... |
2e57c984294ae8e9b80bee6e9a41707362a633002214655f2e7dae2f88980e82 | R | 6,763 | 130 | ```{r init}
library(Matrix)
library(tidyverse)
library(biomaRt)
library(monocle3)
library(rgl)
library(tricycle)
library(SignacX)
library(princurve)
library(ggplot2)
library(Hmisc)
library(pheatmap)
library("ComplexHeatmap")
library(circlize)
library(dplyr)
library(ggrepel)
library(latex2exp)
library(scales)
```
```{r... |
185ef513ad0f265fb2b4e860496f9c645c6dbe5ae25c01d63abefe6565d1647f | R | 6,777 | 274 | # First script to launch
# Process available PD prefrontal cortext scRNA-seq data from GSM6106340
#
# Direct download from: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE202210
#Need a lot of memory to run at least 200 GB
library(glmGamPoi)
# Need to install Seurat package first
if(!require('Seurat')){
... |
c4cf304f3cc5a0bb54a5223dc3b234e35ea98c89ac3714ae60e511f5a6baf6da | R | 6,780 | 169 | options(bitmapType='cairo')
args <- commandArgs(TRUE)
dir<-args[1]
inputFiles<-args[2]
jobName<-args[3]
setwd(dir)
fileArray<-unlist(strsplit(inputFiles,","))
nFiles<-length(fileArray)
# now plot scaling data
pngfile<-paste(jobName,".png",sep='')
png(pngfile,height=900,width=900)
par(mfrow=c(3,2))
... |
d599615e7b3df6750043375899a185737224a8e1303f251606e4b7cacdb852d8 | R | 6,786 | 163 |
#' archstabms_structure_metrics
#'
#' Add 3D structure metrics.
#'
#' @param input_file path to MoCHI thermo model fit results (required)
#' @param outpath output path for plots and saved objects (required)
#' @param pdb_file path to PDB file (required)
#' @param getcontacts_WT_file path to getcontacts WT file (requir... |
efa602c450024b405e9339e272e286ef12b08612135c492c96cd39b15d84a196 | R | 6,790 | 174 |
# Greg Booth 2021
# This script takes the output from the BBI pipeline for sciATAC
# for each sample
# performs some filtering (by QC and doublets)
# returns a cds object of peak by cell data.
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_03_24_reprocessHeartAlone_nobackup/analyze_out/"
... |
b2e66141ecd3c011b9b3cb33616602a6e46713f9bcda9eaa041b8a0b6ad77a07 | R | 6,794 | 151 |
#' ---
#' title: "Normalize Library counts"
#' author: "Tomas Bjorklund"
#' output:
#' pdf_document:
#' highlight: tango
#' geometry: margin=0.7in
#' ---
#' This workflow normalizes read counts between samples to compensate for variable read depth.
suppressPackageStartupMessages(library(knitr))
#+ setup, incl... |
e371072c28567c0599bc81c147835be82ce7f5105530d5cf88ae254105c9b89a | R | 6,800 | 215 | #' Loads and combines training and evaluation data
#' @param var_labels Optional labels for the variables in question
#' @return A tibble containing the data
.load_mlife_vs_eicu <- function(var_labels = NULL) {
vars_to_read <- c(
"case_id",
"age",
"sex_male",
"blood_pressure_systolic",
"blood_p... |
d41caa353c88da4d6509226b2000a6585d79b32f37e2ef7cc8bb1342010ca51f | R | 6,801 | 153 | # Load libraries
library(tidyverse)
library(DeepComBat)
library(neuroCombat)
library(CovBat)
library(latex2exp)
library(DescTools)
library(GGally)
library(ggfortify)
library(ggpubr)
library(umap)
library(caret)
library(matrixStats)
library(twosamples)
library(kBET)
library(gt)
library(gtsummary)
source("/home/fen... |
3ab5a972c3f85aab6e894f896cee3d2548fee0c2a79977ab5d283024ae07a150 | R | 6,805 | 113 | ## ----------Script-----------------
##
## Purpose: Generate post-sqanti plots for summary of Iso-Seq global mouse transcriptome datasets
##
## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk)
##
## ---------- Source function and config files -----------------
# source all general scripts related to long-read sequenci... |
1ba1b6e32a4a282c70cd9b8b9d4a2123634c8bf8be1609b8d956ac8af44f5381 | R | 6,822 | 159 |
#' ---
#' title: "Three sample pairwise sample analysis output"
#' author: "Tomas Bjorklund"
#' output:
#' pdf_document:
#' highlight: tango
#' geometry: margin=0.7in
#' fontsize: 10pt
#' ---
#' This is the final script presenting top candidates and overview plots.
suppressPackageStartupMessages(library(knitr))... |
1dc51a519bc8d9be08828474105d400f98005807d6fc18a7933e95b5141a56be | R | 6,862 | 177 |
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/"
dir.create(paste0(basepath, "archr/results/finalPlots/"))
out_dir = paste0(basepath, "archr/results/finalPlots/")
setwd(out_dir)
set.seed(7)
# load requirements
suppressPackageStartupMessages({
# librar... |
94cda3559034ed60633cabef5bed51553880d63299b04406947d44fd81963953 | R | 6,862 | 151 | pseudovalidate.lassosum.pipeline <- function(ls.pipeline, test.bfile=NULL,
keep=NULL, remove=NULL,
trace=1,
destandardize=F, plot=T,
exclude.ambiguous=T,
... |
f6b4867bb9bb1c2f376b0b46a6b3b10ec274448050ba18ce75b537186b4f1c62 | R | 6,866 | 170 |
#
# residualize_data <- function(std_list, is_split = TRUE) {
# if (all(c("data_raw", "cov", "batch") %in% names(std_list))) {
# y <- std_list$data_raw # outcome tensor for training data
# X <- cbind(std_list$cov, std_list$batch) # data matrix for training data
# beta_hat <- Ginv(t(X) %*% X) %*% t(X) %*... |
ac5c07b372b78e41d6a185a2783a03794a2ba86e6643cd0f1786cfe81ce6be17 | R | 6,869 | 159 | ---
title: "Phosphoproteomics data set of multiple mouse tissues"
author: "Patrick Forny"
date: "2023-10-01"
---
Pre-processing of data and gathering of meta data.
Load packages.
```{r packages}
# Load packages
library(pacman)
p_load(data.table)
p_load(tidyverse)
p_load(readxl)
```
Load the data. Negative sings... |
95c27a7807486f24ba0db3ede38d48e51452e1723038d131e022713f4149ddda | R | 6,877 | 176 | #' Main function for plotting ASE fits in single-cell data
#'
#' Takes in the result from scase and plots desired genes with beta distribution
#' overlaid on the histogram of allele1 proportion, confidence interval plot
#' for the desired genes, and the overall distribution of p and phi for all
#' genes
#'
#' @descript... |
1394c0ed6bfaa1e3076fbb49dc01c1e0ed4ea32ab3f07dad7f8739ce13cf46d1 | R | 6,880 | 203 |
# Function -------------------------------------------------------------------
.options <- list(
debuglevel = 0L,
gc = FALSE,
file.remove.emptyspc = TRUE,
file.keep.name = TRUE,
tolerance = sqrt(.Machine$double.eps),
wl.tolerance = sqrt(.Machine$double.eps),
plot.spc.nmax = 25,
ggplot.spc.nmax = 10
)
... |
fcd69cded4a1071dbcc5742bda48370ad29c9139401e232eb6b913fa14558fcb | R | 6,886 | 115 | # Description: In this script we are preparing the input for running metaplotR on m/k = 1 variants per cell type. The output is a bed file
library(tidyverse)
variant_filename <- "/GPFS/Magda_lab_temp/maitenat/scs/bullseye/6J-3M-2ws-V2-3-YTH_edit-sites_bc_filtered_all_yth_filt-all.bed"
cell_to_cluster_filename <- "/G... |
f3507d55a8086d69ea9ee531977b27448adcd34c3e8c09f6b6a31cbc9a8e90f9 | R | 6,890 | 220 | # Function -------------------------------------------------------------------
#' Convert between different wavelength units
#'
#' The following units can be converted into each other:
#' *nm*, \emph{\eqn{cm^{-1}}{inverse cm}}, *eV*, *THz* and *Raman shift*.
#'
#' For `hyperSpec` objects, values of `@wavelength` and l... |
2bd5c4e6e2c78ee841a81ae905f65caaa5a94ddc0bf0f5b976e37509a98b4395 | R | 6,940 | 218 |
library(Seurat)
library(dplyr)
library(ggplot2)
library(limma)
library(muscat)
library(purrr)
library(scater)
##########################################################################################################
# MCT
setwd("G:/PFC_429_final_Spring2021/Data")
pbmc=readRDS("In_integrated_bat... |
d979943520c2973e1587f177a76cbbfacbe036fb936f40fbcd7b71a099799c10 | R | 6,952 | 213 | #!/usr/bin/env Rscript
# Ensure Seurat v4.0 or higher is installed
if (packageVersion(pkg = "Seurat") < package_version(x = "4.0.0")) {
stop("Mapping datasets requires Seurat v4 or higher.", call. = FALSE)
}
# Ensure glmGamPoi is installed
if (!requireNamespace("glmGamPoi", quietly = TRUE)) {
if (!requireNamespac... |
d508b4b7f1beffc8c5d9b2490a4a3678ae17d1cf9b2ff59ba2c948c6681912f6 | R | 6,967 | 227 | #!/usr/bin/R
# -----------------------------------------------------
# Calculate the cross-ct module graphical lasso models:
# Updated 11/30/2021
# -----------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadat... |
e65aff58202bf817a50874731c2db0bb11d1fa5de80299e179828a44d390565b | R | 6,971 | 225 | library(testthat)
library(sccomp)
library(dplyr)
test_that("sccomp handles factor levels with hyphens correctly", {
skip_cmdstan()
# Load the included dataset
data("counts_obj")
# Create test data with factor levels containing hyphens
# Based on counts_obj but with renamed factor levels that include hy... |
1833cb66cdcf208702deebf8a2b249b6fe5ab75d354bddbe8e6596f765b6d23e | R | 6,972 | 181 |
##A example of genes that their expression increased or decreased monotonously at different stages of muscle development
library(dplyr)
library(stringr)
library(rlang)
OriExp <- read.csv("F:\\Manuscript\\RNA\\Ori\\data\\PCA\\featureCount_result\\GeneExpressionAllSamples.tpm.csv", header = T, row.names = 1)
O... |
52a31b07c8b40b35c02ffad56e68de71e2f86579eb9ca2089856e4767399beb8 | R | 6,992 | 220 |
library(scSeqComm)
library(Seurat)
library(topGO)
source("function_utils.R")
load("Sub_SEA_AD_cond_classcell.Rdata")#GET sub_SEA_AD from SEA-AD.R script
gc()
Idents(sub_SEA_AD)
table(sub_SEA_AD@meta.data$classcell)
sub_sub_SEA_AD <- subset( sub_SEA_AD,idents = "AD")
Idents(sub_sub_SEA_AD) <- "classcell"
sub... |
b598cbfb34363d703a61ca1b3e9b69735bf309d8b48be2a31f82b4d5dbd8021f | R | 7,013 | 193 | #!/usr/bin/R
# --------------------------------------------
# Plot umap with different metadata variables:
# TODO: Which are the HC and PFC individuals
# --------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_metadata.R'))
library(tidyr)
library(ggplot... |
ccb5a5e2d9acdc34fe95a6673bb5277b9b83b6373a89c26a5a8b8ac149681733 | R | 7,016 | 234 | # Function -------------------------------------------------------------------
.aggregate <- function(x,
by = stop("by is needed"),
FUN = stop("FUN is needed."),
...,
out.rows = NULL,
append.rows = NULL,
... |
1b3448f54c79db1f3427417ad980c29b65ef0aa49c8849420ee58b669c340bd9 | R | 7,018 | 137 | library(ggplot2)
library(ggsci)
library(readxl)
library(writexl)
library(Gmisc)
library(dplyr)
library(patchwork)
library(cowplot)
library(ggVennDiagram)
# Define tau status
bf2.all.olink$tau_status <- ifelse(bf2.all.olink$tnic_cho_com_I_IV<1.36 ,0, 1)
## Define AT status based on CSF Ab ratio and tau-PET
bf2.all.o... |
28ae296285c3d714026bdfb48df2ac49ed8e7a663fc5f284cb28c43054b06745 | R | 7,026 | 205 | #!/usr/bin/R
# ------------------------------------------------------------------------
# Vignette 01 - glycolysis associated metabolic changes across cell types:
# Updated 12/20/2021
# ------------------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exis... |
400aec00b8fe804379be9421eca5296f606c6f2b0911f9a81e943f5a3569274c | R | 7,032 | 164 | ## ---------- Script -----------------
##
## Script name:
##
## Purpose of script:
##
## Author: Szi Kay Leung
##
## Email: S.K.Leung@exeter.ac.uk
##
## ---------- Notes -----------------
##
##
##
##
##
## ---------- Packages -----------------
suppressMessages(library(reshape2))
suppressMessages(library(dplyr)... |
8de9cf688a83f58b1a21303c550acc6df85359826ef2ee8db205a24fff228841 | R | 7,034 | 218 |
library(tidyr)
library(ggplot2)
library("optparse")
# Get the passed parameters
option_list = list(
make_option(c("-p", "--pValFIMOcutoff"), type="numeric",
default=1e-6,
help="Max FIMO p value to retain match", metavar="character"),
make_option(c("-b", "--binarizeMotifs"), type="logical", ... |
4c94946cd062bbaf7eebd3edc8af1e10539bff0d52494e3962fc9392c1978177 | R | 7,043 | 164 | #This script integrate MOCA E8.5-13.5 mouse embryo dataset (Cao et al., 2019, Qiu et al., 2022) with mouse gastruloids at 120hr (Van de Brink et al., 2020) and human RA gastruloids at 120hr
#Link to MOCA and mouse gastruloid datasets are provided in https://shendure-web.gs.washington.edu/content/members/hGastruloid_web... |
605e1a96a4f93117b4330aaf03a5dc19a75a1d4fdbad041009b018e11d179cce | R | 7,049 | 166 | ---
title: "get_homogeneous_m6a"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
In this document we obtain the m6a variants with m/k = 1 in a cell that occur in at least 5 cells of other cell types with an m/k ratio < 0.9.
Let's start with some preliminary tests. The dis... |
3116fa37b0839c5b6b00742b10c96185602d94b2bc3d9228d360f6c9a924eee4 | R | 7,058 | 249 | library(jsonlite)
library(lme4)
library(lattice)
library(lmerTest)
library(MuMIn)
library(performance)
library(rstudioapi)
library(xtable)
library(emmeans)
library(car)
library(tibble)
library(dplyr)
library(tidyr)
library(ggplot2)
library(xtable)
# Set working directory and load configurations
setwd(dirname(rstudioap... |
de9c3c37fafe2ecb539f6b7a625e9902702df48c02b5d0c0e7e9a52c87131256 | R | 7,071 | 128 | library(data.table)
library(dplyr)
read_PRS <- function(){
### MetS PRS
file_in.prs_MetS <- "PRS_MetS_noUKB.csv"
df_prs.MetS <- fread(file_in.prs_MetS, sep=",", data.table = F, nThread = 5) %>%
mutate(FID = eid,
IID = eid,
PRS_scaled.MetS = scale(PRS),
percen... |
2d5c69d1fa8a93eedab6b313465f12ef325bf724c2b5ea53b1a8abd75f899b5e | R | 7,076 | 180 | source("./CovBat_Harmonization/R/R/utils.R")
covbat_fh <- function (dat, bat, mod = NULL, percent.var = 0.95, n.pc = NULL,
train = NULL, mean.only = FALSE, std.var = TRUE, resid = FALSE,
eb = TRUE, parametric = TRUE, score.eb = FALSE, score.parametric = TRUE,
... |
b9cdada375fd5733b6ff817c9ca6626ef0d5cd201f628d3a2b3b4e1afa86321a | R | 7,091 | 179 | ---
title: "figures_Nov23"
author: "T Attenborough"
date: "2023-11-01"
output: html_document
---
```{r}
library(Seurat) #Seurat v4.0.2
library(dplyr)
library(patchwork)
library(here)
library(ggplot2)
library(clustree)
library(SingleCellExperiment)
library(scater)
library(DoubletFinder)
library(zellkonverter)
library(b... |
c5115238e00e330ff7e1e0abe5f626d25592b1db22015776587eff06ad8cfb79 | R | 7,095 | 191 | #' Refresh GLM backend status for a given analysis level
#'
#' @param gpa a \code{glm_pipeline_arguments} object
#' @param level the level of analysis to be refreshed (1, 2, or 3)
#' @param lg an optional lgr logger object used for logging
#' @param glm_software optional backend(s) to refresh. If NULL, refreshes all
#'... |
5b676f7e6c52766957526442029bb2cd5e56a42b7836951266eddb9c9a34c4c6 | R | 7,142 | 248 | # DOWNLOAD HANDLER FUNCTIONS
fwrite_bed <- function(bed_file, file_name, DMR = FALSE, ...) {
if (!DMR) {
bed_file <- data.table::data.table(
chr = bed_file$chr,
start = bed_file$pos - 1,
end = bed_file$pos,
name = bed_file$cpg
)
}
bed_file$start <- as.numeric(bed_file$start)
bed... |
a5eaaaaef9ed868df735db82d7cf5d1a64b6cfa5650d8d56085ac4b0739d1aae | R | 7,152 | 218 | #' @title Parse the keep/remove/extract/exclude/chr options
#' @details \code{keep} and \code{remove} can take one of three
#' formats:
#' 1. A logical vector indicating which indivduals to keep/remove,
#'
#' 2. A \code{data.frame} with two columns giving the FID and IID of the indivdiuals to keep/remove (matching thos... |
5b38c6bb5e6ed355a1ea4c3f385b8dd9c515426eb7440f36b2f01c2fb06e6f21 | R | 7,156 | 173 | # Load the required libraries
library(ggplot2)
library(dplyr)
# Read the CSV file
data <- read.csv("tsnrvals.csv")
data_stan <- read.csv("tsnrvals.csv")
# Read the file containing the list of subjects for the new flip angle
new_flip_angle_subs <- read.csv("newflip.csv", header = TRUE)
# Create a new column in data i... |
54870bed443622465d3a7d1301fbb78bcdee48d1344b4735e2a461b5ac80693c | R | 7,157 | 202 | # tests for merging backend caches into shared gpa
# Helper to create setup objects with proper class
make_l_setup <- function(level, ...) {
setup <- list(...)
class(setup) <- c(paste0("l", level, "_setup"), "list")
setup
}
make_gpa <- function(...) {
gpa <- list(...)
class(gpa) <- c("glm_pipeline_arguments"... |
99d551f7769e12118611aa4446ca533a5444f1b568dafc937aa70e8dac536aee | R | 7,181 | 222 | library(dplyr)
library(sccomp)
data("seurat_obj")
n_iterations = 50
# Create test estimates if cmdstan is available
if (instantiate::stan_cmdstan_exists()) {
test_estimate =
seurat_obj |>
sccomp_estimate(
formula_composition = ~ type,
formula_variability = ~ 1,
"sample", "cell_group",
... |
f093a9e72c1fc1ea4368e6eef55fd02d0cbb3f97c7ce15e6fb22025d9c84b283 | R | 7,184 | 222 |
library(tidyr)
library(ggplot2)
library("optparse")
# Get the passed parameters
option_list = list(
make_option(c("-p", "--pValFIMOcutoff"), type="numeric",
default=1e-6,
help="Max FIMO p value to retain match", metavar="character"),
make_option(c("-b", "--binarizeMotifs"), type="logical", ... |
7ab91dee6889d35ced0234eb9835bd70086e1630679c55258835409540463faa | R | 7,186 | 190 | #!/usr/bin/env Rscript
# args = commandArgs(trailingOnly=TRUE)
print("Starting Now")
library("SymSim")
source("/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_29_simulations_and_power_nobackup/simFuncsDavidMod.R")
library(distr)
# source("/net/trapnell/vol1/home/readdf/trapLabDir/fibrosis/results/Heir... |
55df9f1f41bea9231912888794db2d7c77b332b2c516b92f4cd8e16da6d9c7c7 | R | 7,190 | 215 | library(TMB)
library(ggplot2)
library(optimx)
#################
# Simulate data #
#################
# Number of different tracers
n_tracer <- 4
# Number of subjects per anchor point group (0 and 100 CenTauR)
n_anchor <- 20
# Head-to-head combinations
h2h_combi <- rbind(c(1, 2),
c(2, 3),
... |
cccd1e427225b3fde44a9fa8fd76bca6c413b69f303725006b102df15ee9703d | R | 7,202 | 218 | # Preprocessing and QC of DS1 raw data
# input :
# data_raw/01_DS1x_raw_ssce.Rdata
# output:
# data/01_DS1x_DblFinder.Rdata : computed scDblFinder doublet detection results
# data/01_DS1x.ssce.Rdata : QC filtered, logNormalized dataset
# data/01_DS1x.ssce.MKNN20.Rdata : igraph k=20 MKNN graph used ... |
90a8485a047e3e19ddef6c23dc412b3b36840ca05f1717518d675bbe91953208 | R | 7,209 | 223 | library(Seurat)
library(dplyr)
library(ggplot2)
library(limma)
library(muscat)
library(purrr)
library(scater)
##########################################################################################################
# MCT
setwd("G:/PFC_429_final_Spring2021/Data")
pbmc=readRDS("In_integrated_batch_300... |
69c979021f42275706e9adc9f2b3b37b753b975ce2948b303c6d3007cd730f1d | R | 7,215 | 223 |
library(ggplot2)
library(dplyr)
library("optparse")
library(stringr)
library(tidyr)
library(tidyverse)
library(RColorBrewer)
print("Libraries loaded, starting now")
monocle_theme_opts <- function()
{
theme(strip.background = element_rect(colour = 'white', fill = 'white')) +
theme(panel.border =... |
b8e714ee37a576f36a621d3f7faadb14c0e934295ec9bdc46d6ff55acaff4277 | R | 7,255 | 218 | #!/usr/bin/env Rscript
suppressPackageStartupMessages({
library(utils)
})
parse_args <- function(args) {
out <- list(
repo = NULL,
label = NULL,
out = NULL,
base_lib = NULL,
n_datasets = 8L,
n_samples_per_group = 20L,
inference_method = "pathfinder",
max_sampling_iterations = 4000L... |
db117f5d86d8083f00e8749ee40303494ef3c9aa208c92187c03dff4be44e882 | R | 7,259 | 280 |
#### Plot images ####
## -------------------
# MSImagingExperiment
setMethod("image", c(x = "MSImagingExperiment"),
function(x,
formula = intensity ~ x * y,
i = features(x, mz=mz),
mz = NULL,
tolerance = NA,
units = c("ppm", "mz"),
...,
xlab, ylab)
{
if ( "feature" %in% ...names() ) {
.Deprecated(o... |
16c9098ea14ce937c14bff6a7dfdfc194801990a55b64fd2393f94eff3fa9781 | R | 7,263 | 193 | # For the specified k, investigate the relationship between the main and distance-based LVs,
# between the main and frequency-based LVs, and the first and second LVs of the main,
# distance-based, and frequency-based PLSCs. Also investigate normality of comparisons.
# Output:
# sepcorr.csv Correlations between main LV1... |
918907a072ba976fb10da441daccbd35fe1f98024b3671e608a18c4adcd6c0f2 | R | 7,266 | 260 | ---
title: "Melanoma single-cell DT data - Melanoma cell states analysis"
author: "Yingxin Lin"
date: "Created on 11 July 2023, last compiled on `r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
code_folding: hide
number_sections: yes
toc: yes
fig_height: 12
fig_width: 12
toc_float:
... |
41d63c8b84df00dbb15800149e6c26d5fef66206d77ab3bf4a6cb722466c851b | R | 7,280 | 215 | #!/usr/bin/R
# ---------------------------------------------------
# Look at the astrocyte + oligodendrocyte modules
# associated with plaque over NFT, plot glyc.
# Updated 11/04/2023
# ---------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
... |
ee092405b22a9bad415735b0ad7a219412ff3a4ce743a3ad17b4749fefc427a0 | R | 7,286 | 191 | #!/usr/bin/R
# -----------------------------------------------------------
# Use MAST + RE to run differential gene expression
# - Per region x per celltype subdivision
# Submit as chunks (2500 -> 8 chunks) per combination.
# TODO: Write separate script to batch and one to combine
# Updated: 01/21/2021
# OLD version of... |
a38b3cbaf11217ae681d6ce225f68b8a4fb4f47ac590dbd66280a537232bbd04 | R | 7,288 | 206 | library(data.table)
library(dplyr)
library(foreach)
library(doParallel)
### 0. Data files
gwas_dis <- "MetS_GWAS.csv"
gwas_val <- "KoGES_MetS_logistic_plink.MetS.glm.logistic.hybrid.modified"
reference_panel <- "EUR"
reference_panel_chr <- "EUR_chr"
plink_exe <- "./plink/plink"
window <- 500
r2 <- 0.1
p1_thres <- 5e-... |
3f098c5dace829c8d3d9a8ab4c11238e4994a7f35c900c320f56755bfdc8622f | R | 7,305 | 176 | install.packages("magrittr")
install.packages("dplyr")
install.packages("tidyr")
install.packages("broom")
install.packages("ARTool")
install.packages("vctrs")
library(vctrs)
library(broom)
library(magrittr)
library(ggplot2)
library(FSA)
library(car)
library(ARTool)
library(lme4)
library(emme... |
a1c53f5935a264bb33c294fa7fd9772b8093d2d30e64f5564d187353b954850f | R | 7,312 | 226 | # load the reshape2 package
library(reshape2)
library(dplyr)
source_list=c("Exc","Inh","Ast","Oli","OPC","Mic","CAMs","T cells","End","Per","Fib","Epd","CPEC")
target_list=c("Exc","Inh","Ast","Oli","OPC","Mic","CAMs","T cells","End","Per","Fib","Epd","CPEC")
##################################################... |
d874b0e040d20ad5ac2a9df8720e3b16bb19ae85aa977e74d1090244944ce1d4 | R | 7,316 | 168 | setwd("F:\\ATAC\\processFiles\\RNA-tissue_specific0711")
library(dplyr)
library(edgeR)
library(ggplot2)
library(stringr)
#Reads count based gene expression matrix
dataExp <- read.csv("F:\\RNA\\DEG_Tissues_Stages\\GeneExpressionAllSamples.csv", header = T, row.names = 1)
ref_tissue <- c("Br","Li","Mu","Pl")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.