sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
e9fbceebfd6edfb347c418e568d74e3f82ecbc9e0dad67663d652a0379f836e8
R
2,561
70
# Load necessary libraries library(data.table) library(optparse) # Parse command line options option_list = list( make_option(c("--bamdir"), type="character", default=NULL, help="Directory containing BAM files", metavar="directory") ) opt_parser = OptionParser(option_list=option_list) opt = parse_args(opt_parser) ...
e4c1b606ea6a67c962fba0102ed6777c2c8e1852ad5228b482901fb3c7263806
R
2,562
92
# Siwei 05 Jul 2023 # plot 1MB proximal region of rs10792832 # chr11:86156833 # init ##### library(Gviz) library(rtracklayer) library(BSgenome) library(BSgenome.Hsapiens.UCSC.hg38) library(TxDb.Hsapiens.UCSC.hg38.knownGene) library(ensembldb) library(org.Hs.eg.db) library(grDevices) library(gridExtra) library(RColo...
a69a4a210973f5ceb01e52c51e6c005094f17509b1d88c64e25beb9a23b4bfd9
R
2,567
86
--- title: "exp042_neutrophils_trajectory" output: html_document date: "2023-03-30" --- Code for pseudotime analysis ```{r} setwd("/Users/mary/non_dropbox/exps/exp042_meninges_stress_dropseq/") library(ggplot2) library(tidyverse) library(magrittr) library(here) # Load sce object load(here("res/processed.RData")) `...
7a84c2fc587d5528e3fff6b90cd70c29cabc6bf8f551920bfeedd7ab33a99dea
R
2,570
89
## Annotate EWAS results with ATAC-seq peaks ## library(data.table) # Run either... # bulk fetal EWASres <- paste0(resultsPath, "ageReg_fetalBrain_EX3_23pcw_annotAllCols_filtered.rds") outputFile <- "ageReg_fetalBrain_annot_allTissuePeaks.rds" celltypes <- NULL Pcol <- 'P.Age' # FANS fetal EWASres <- paste0(resu...
43930bfd3e191ca2e015a768bf7d4b43ade8592b577fe51a8af13de58a162250
R
2,571
74
library(coin) library(exact2x2) tables = list() tables[[1]] = matrix(c(23, 15, 19, 31), ncol=2, byrow=TRUE) tables[[2]] = matrix(c(144, 33, 84, 126, 2, 4, 14, 29, 0, 2, 6, 25, 0, 0, 1, 5), ncol=4, byrow=TRUE) tables[[3]] = matrix(c(20, 10, 5, 3, 30, 15, 0, 5, 40), ...
e4d3232c530a4fde1b7d1833294ed33d3cadb6a3be482ff4c41bb61379e95f3f
R
2,572
75
--- title: "Plotting a CONSORT Flow Diagram" output: html_document: default pdf_document: default --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` CONSORT Flow Diagrams can be used to plot the flow of data selection of a patient cohort. For more details, see: [http://www.consort-statement...
2801bed99e3b7e0b54d30e3c8f6d7cbc3c1e03a2f708a107b1152e58963ab421
R
2,576
77
## Data Preparation WGCNA # Written by LZ 2021-07-14 # last change: LZ 2021-07-16 library(WGCNA) library(data.table) library(dplyr) library(readr) library(varhandle) library(matrixStats) library(DESeq2) DF <- data.frame setwd("/path/to/") options(stringsAsFactors = FALSE); get(load("WGCNA/log_counts.Rdata")) ...
d6fc3c4d44dee2a62aac27e54288b817b635080570951f93b4b5ceda1378ab95
R
2,577
51
#radius of gyration linear regression model radius_regression=read.csv('..data/radius_seperate.csv') model_radius<-lm(radius_difference~pLDDT+ES_ISO+ES_REF+ADS+ACS+MXE+IR_ISO+IR_REF+AFE+ALE+MXE_AFE+MXE_ALE,data=radius_regression) summary(model_radius) effect_size <- coef(model_radius) p_value <- summary(model_radi...
4712a4678184b684820eee5d2ec342c53b5d7c3a17dd501ca36043def9d47b9f
R
2,582
89
#' Install aif360 and its dependencies #' #' @inheritParams reticulate::conda_list #' #' @param method Installation method. By default, "auto" automatically finds a #' method that will work in the local environment. Change the default to force #' a specific installation method. Note that the "virtualenv" method is ...
fd789a1945c6190c8286d4e50c5223007d5a6fbbe968e9b01b3e59d636fc7b39
R
2,584
72
# load packages require(tidyverse) require(Seurat) # Load data -------------------------------------------------------------------- data.dir <- '/path/to/filter_multimap_counts/' setwd(data.dir) # get directory names subdir.names <- list.files(data.dir, pattern = 'filtered', recursive = T,...
1598a3882a6b167124c4bc28674cf5974bd2c982b15ad24f0a1550b421f1f4e2
R
2,592
92
# Helper functions for working with KFAS objects cbind.fill <- function(...){ nm <- list(...) nm <- lapply(nm, as.matrix) n <- max(sapply(nm, nrow)) do.call(cbind, lapply(nm, function (x) rbind(x, matrix(, n-nrow(x), ncol(x))))) } flatten <- function(m) { f <- t(apply(m, 3, c)) dm <- dim(m) df <...
44975ee2ec8ed5bf4c86067bd89189750486a6776113116b6bd14fa3006e9290
R
2,600
78
# ============================================================================= # 细胞类型差异表达分析脚本 # ============================================================================= # 功能:按细胞类型进行差异表达分析和GSEA富集分析 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf <- list.files("./"...
fd8344cf45d7779ffdf6bc65788695290748d96c3fc856822112fd76ff9e09d0
R
2,611
95
#' Use R to upload a file to the UK Biobank RAP #' #' @description Use R to upload a file to the UK Biobank RAP (really just a wrapper for `dx upload`) #' #' @return NA #' #' @author Luke Pilling #' #' @name upload_to_rap #' #' @param file A string. Filename of the file to be uploaded (character) #' @param dir A string...
0b07f8410b12c56bd11bd4ecb445a7749ac17554c824c8d6e94ceb19e999acd0
R
2,617
57
#' Small Subset of Tabula Muris FACS scRNA-seq data #' #' A subset of 4000 cells from the Tabula Muris FACS scRNA-seq data #' that has already been normalized using the `scran` package, providing #' the log-normalized counts. Cluster labels are under a labeled `cluster_name` column. #' #' @format ## `tmfacs_sce_small` ...
914d118160a9ed909b944e6de42bb3a05635374f8415ddb6a1af87f678e1538c
R
2,617
72
# load packages require(tidyverse) require(Seurat) # Load data -------------------------------------------------------------------- data.dir <- '/path/to/mmCortex_snRNA-seq/filter_multimap_counts/' setwd(data.dir) # get directory names subdir.names <- list.files(data.dir, pattern = 'filtered', ...
786d9ff4ffa7d83feb72244c3609be70864f9dc349a91e5fd79323ace4191b23
R
2,619
87
#This script applies a threshold to normCoverage and splits it in several sub files to execute with k fold batch strategy #coverage=read.csv(file="Y:/Microbiome/NDcollect/HQ/tablesBS/normCoverage.csv") load("E:/BackupInesLeave/ND/HQ/tablesBS/2018-12-07workspace.RData") coverage=agspeciesMat load("E:/BackupInesLeave/ND...
21c4bbace73c1e548af13a119311b50a88e28213f12e77a02f4c7be454347033
R
2,628
81
#script to compute the DEGs inside the PD brain organoids dataset #06/2024 Sophie Le Bars #LOAD the R package library(Seurat) library(scales) library(dplyr) PD_brain=readRDS("combined.all_norm_PCA_INT_ANOT_DB.rds")#READ the preprocessed and annotated Seurat object from Sarah Nickels paper DimPlot(PD_brain, ...
a1f2d1e9cb77423bc88ef95203ef85f3e9685894f358ded62f6e011dac5d99ba
R
2,638
74
library(readr) library(dplyr) library(optparse) option_list <- list( make_option(c("-s", "--samplesheet"), type = 'character', help="samplesheet à la CIRIquant, without paths"), make_option(c("-p", "--path"), type = 'character', help="source path to get gtf from"), make_option(c("-o"...
044254ebdfc878e22d00fb29d68c0bd1def4a0ba31fb85660309635bf8a91d94
R
2,639
45
#!/usr/bin/env Rscript library(rmarkdown) library(optparse) option_list = list( make_option(c("-r", "--report"), type="character", default=NULL, help="report template file", metavar="character"), make_option(c("-o", "--output"), type="character", default="RNAseq_report.html", help="output file name", metavar="cha...
157b86046d09bfc8f865a6185e1c268c999a873f47b5c2e91f2e7767a890336b
R
2,639
72
observeEvent(input$sideBarTab, { if (input$sideBarTab == "academic" && is.null(GLOBAL_VALUE$Academic[[1]])) { GLOBAL_VALUE$Academic <- list( onset_to_confirmed_map = fread(paste0(DATA_PATH, "/Academic/onset2ConfirmedMap.csv")) ) } # data <- fread(paste0(DATA_PATH, '/Academic/onset2ConfirmedMap.csv')...
55565bd3e21d622e668ec77bdd96c6146c2da64c609afd0b567240ed6381fde1
R
2,639
74
# Load packages library(tidyverse) # Clear global environment rm(list=ls()) dt.path = "/home/emba/Documents/EMBA/BVET" df.inc = read_delim("/home/emba/Documents/EMBA/VMM_analysis/FSL_dur/all_use-new", show_col_types = F) %>% filter(diagnosis != "pilot") %>% select(subID, diagnosis) # load raw data # columns of In...
e872988ca3e06fc9cd25a5480a4b360bebdc209bcd533cec78ab3a1b6550f3e2
R
2,643
106
# データの読み込み loadDataFromFile <- function(fileList, FilePath, fileName, object, index) { # 実際のファイル名を取得 dataName <- fileList[sapply(fileList, function(x) {grepl(fileName, x)})] # 保存 object[[index]] <- fread(file = paste0(DATA_PATH, FilePath, dataName)) return(object) } convertUnit2Ja <- function(x) { x <- as....
7198f6dae624d55b6d217589872e9837764ce0dd5298a2a943ec7c412794bd5f
R
2,644
65
setwd("MERFISH_Moffit/") library(liger) library(Seurat) library(ggplot2) # Moffit RNA Moffit <- Read10X("data/Moffit_RNA/GSE113576/") Moffit <- as.matrix(Moffit) Genes_count = rowSums(Moffit > 0) Moffit <- Moffit[Genes_count>=10,] # MERFISH MERFISH <- read.csv(file = "data/MERFISH/Moffitt_and_Bambah-Muk...
1de582b1bb5c03b02ff96545e7fb607cac8330a13889fbbf64009fd1915078e5
R
2,652
59
predict.multi.MM <- function (M, new_dat, pred_time = 180, alpha = 0.20){ # this function retrieves predictions of Selles MM for multiple patients. Since prediction function for Selles MM # (IndvPred_lme) only works for individual patients this function loops through patients and stores results. # # Arguments: ...
1cea1ba9bda74b5874a80bcc4c8d8743c8d478fb474818594e54b4ee2433855c
R
2,655
67
#' Prepare dynamic range data for a single source (LFQ or LBQ) #' #' Extracts and standardizes abundance information from input data for a specific source, #' ranks the values by descending abundance, and tags the data with the source label. #' #' @param data A data frame containing abundance values. For LFQ, must incl...
2c2a91751b364d88b5b65971ec1fb8042462fc07aa084b577e673569f9dbff21
R
2,660
76
# First run main.R until definition of Selles et al. Mixed Model (M_mm) # this scripts retrains a base XGB model and plots the relative feature importance # through a SHAP beeswarm plot library(SHAPforxgboost) # 1) create model formula for shap model shap_ftrs <- xgb_ftrs[xgb_ftrs != "Number"] dummy_ftrs <- c("SA.0",...
3b1d9333ea5a0adaf61cfa217db4f9ff9b72cc078d71bf9bc6d815072966c580
R
2,665
106
# Siwei 03 Nov 2022 # make plots for Alena library(ggplot2) library(readxl) library(stringr) Alena_table <- read_excel("Alena_table.xlsx") # add a small value to BinomFDRQ for -log10 transformation Alena_table$BinomFdrQ <- Alena_table$BinomFdrQ + 1e-301 df_to_plot <- Alena_table[1:20, ] df_to_plot$GO_disc <- ...
ffd5566e3619768c4d762bf16d3628771db19dbb9e092aba583c5053f1dd2db5
R
2,670
49
## Plot first principal component (PC1) vs Age for each WGCNA module ## plotAllModuleProbes <- function(betas, pheno, module, module_df, returnSubmod=FALSE, colour, toPlot=TRUE, loop=TRUE, i=NULL, axisTextSize=19, axisTitleSize=22, plotTitleSize=23, xAxisCol='Age'){ #1. Extract DNAm data for all probes in module =...
3eb0dc5b39bc21ce586bc9d70838ef19f2ddd03985127d5472cfa416807b2e48
R
2,671
46
#### Running DGE #### #### Oligodendrocytes analysis #### ### Pre work #### library(tidyverse) library(Seurat) library(SeuratObject) library(ggplot2) library(doParallel) library(future) library(cowplot) library(patchwork) library(monocle3) library(monocle) library(SeuratWrappers) library(Nebulosa) librar...
e378b822b059bbf83a2cda353279dc23fe905a4e602287f803c969607edcdaab
R
2,686
47
# this script serves to create a visualisation of the imputation predictor matrix and methods library(tidyverse) # version 2.0.0 library(MetBrewer) # version 0.2.0 # define colourblind-frinedly palette palet <- met.brewer("Hiroshige") # load predictormatrix with method column as df predmat <- read.csv("/data/pt_life/R...
00a46d41a12c52671e969a62033581904afff996c51b68a49d5dc56e154e50bc
R
2,687
66
## Comparison of Age linear regression statistics in an independent Illumina EPIC 450K fetal cortex cohort ## # Fetal 450K cohort: Spiers et al. (2015). DOI:10.1101/gr.180273.114 library(data.table) library(ggplot2) library(grid) library(gridExtra) #1. Load results ===============================================...
422a0773ad9be478d28ba6c106fd1439fa738dd6d0c7e98ec6f8fa853d716216
R
2,697
64
# utils/plink_utils.R # ----------------------------------------------------------------------- # Drop-in replacement for plink2R::read_plink(). # Zero external dependencies — uses only base R. # # Returns list(bed, bim, fam) with the same structure as plink2R: # $bed N×P numeric matrix; dosage = copies of A1 (first...
b839de24b42475e271cc96e1045cf4a0efbaf07f656662ba7dc80365452a5ead
R
2,698
62
# load packages require(tidyverse) require(Seurat) require(pbapply) require(tictoc) # load data and gene names sdata.align <- readRDS('sdata_align_pseudotime_minmin.rds') m.downsample <- readRDS('downsampled_counts_matrix.rds') gene.names <- read_csv('gene_names.csv') # get metadata, remove cells with NA pseudotime ...
b85cfc41377ae6c63c5cdaa1d85eb7a270d63ed5ccb6387ed5355c71a6c6b182
R
2,699
72
library("SingleCellExperiment") library("purrr") library("here") library("sessioninfo") # Tab-delimited tabular input format (.txt) with no double quotations and no missing entries. data_dir <- here("processed-data" , "08_bulk_deconvolution", "07_deconvolution_CIBERSORTx_prep") if(!dir.exists(data_dir)) dir.create(da...
5d750c48b1c8350dbba180c8ad61286fee4086492cce0446578d6e9f3eb77eca
R
2,700
90
# ============================================================================= # 单细胞代谢通路分析脚本 # ============================================================================= # 功能:使用AUCell方法计算KEGG代谢通路活性 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf <- list.files("./")...
98e72b98b5a5a6943774584e8ffab78a1ecd272a788b7937067e0b7c73551dd9
R
2,708
55
## Linear regression to test association of DNA methylation with Age and Sex in bulk fetal cortex ## library(data.table) library(doParallel) #1. Load data =================================================================================================================== load(paste0(PathToBetas, "fetalBulk_EX3_23p...
34a068244a1363f3faf16b3725adc40973767e9349f23ce708107b60443714b6
R
2,712
63
################################################################################# ################################################################################# ### Cell Type Composition Deconvolution Using Dampened Weighted Least Squares ### ##########################################################################...
01c576808a29d76c60d6aa69e73e86edf840304c895c7f6c9fa656306d7eb4ad
R
2,714
98
# 25 May 2022 Siwei # process new MG batch data (May 2022) # note that this batch of MG bulk ATAC-seq data has lower quality # since their original samples had been frozen-thawed. # init library(readr) library(plyr) library(dplyr) library(stringr) library(Rfast) library(ggplot2) library(RColorBrewer) # init lib...
b494a850d65d7e4880fcc36a0230018eb4e59bf6508a68810d604949224cd757
R
2,715
51
# function get_mv_exp_data <- function(l_full=l_full, min_pval = 1e-200, log_pval = FALSE, pval_threshold = 5e-08, clump_r2 = 0.001, clump_kb = 10000, harmonise_strictness = 2 ) { source(...
1730f7c7d0bbc9ace48ae72adcce27fa0acb54303466d9443627009941ef1e69
R
2,723
66
library(dplyr) library(Seurat) library(ggplot2) library(googleVis) # Set address setwd("/project/Campbell_Lab/yl7mfw/Data Analysis/20240811_Analysis for supplementary figures/FigS1/Comparison with Mouse sSC atlas") # Load TM.integrated and mouse sSC dataset sSC.integrated <- readRDS("/sfs/gpfs/tardis/project/Campbel...
32fc418aef88adeb0d50245b709074c41e981c40fc18ec3af83747de27c56133
R
2,723
83
fluidPage( fluidRow( column( width = 5, style = "padding:0px;", userBox( title = userDescription( title = i18n$t("茨城県"), image = "Pref/ibaraki.png", subtitle = i18n$t("関東地方"), type = 2, ), width = 12, status = "navy", ...
0128c5fbb1e3ade91047e68cab883ee12f2b9f4988211cad8cb4e527b3b478ee
R
2,726
72
library(tidyverse) library(fgsea) source("helpers.R") set.seed(123) ### GSEA on FC of different event types # i.e. are the subset of ALE event type genes that show consistent directionality significant with respect to random gene sets of the same size? plot_df_cryp_volc <- read_tsv("processed/2023-09-26_riboseq_vo...
03d4685eae1aa6bcad98becf76cc68bead0d28a9ce47669b04ca2f4f9a504f65
R
2,734
55
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) source(file.path(general_scripts_folder, "RNA", "create_seurat_from_cr_h5.R")) library(ggplot2) library(Seurat) library(qs) library(tidyverse) counts_folder <- file.path(project_folder, "...
9c562def6f067f9779166288cf6c55abe0f2a0de82a6262ac892c602fa378f50
R
2,734
78
library("SummarizedExperiment") library("tidyverse") library("here") library("sessioninfo") library("jaffelab") #### Load data #### ## marker_stats load(here("processed-data", "06_marker_genes", "03_find_markers_broad", "marker_stats_broad.Rdata"), verbose = TRUE) load(here("processed-data","rse", "rse_gene.Rdata"), ...
bdb50fccca6f01265c4b3a4f1a39132f989deed8f3089f510f8c9209234d90f7
R
2,737
55
library(stringr) library(data.table) # library(rvest) url <- "https://covid19.jsicm.org" # page <- read_html(url) # page %>% html_nodes("script") # list.files(url) source <- readLines("https://covid19.jsicm.org/_nuxt/a61a103ff0db7be8db27.js") jsonData <- str_extract_all(gsub('\"', "", source), "JSON.parse\\(.+?\\)")[...
a99016c7eec7882eaa97f9332e78d158c57e86c56ed7c4445a3d74b6665c1ff3
R
2,745
72
#!/usr/bin/env Rscript ### title: Diffusion component analysis of dendritic cells (DCs) ### author: Jana Biermann, PhD print(Sys.time()) library(Seurat) library(destiny) library(dplyr) library(ggplot2) library(gplots) library(viridis) library(scales) colBP <- c('#A80D11', '#008DB8') colSCSN <- c('#E1AC24', '#288F56...
45d1b20e41325fa2e38f24c5f7e42cf67f646da37e3cf8dd64f70c7bb5a8eac2
R
2,753
62
library(tidyverse) library(ggplot2) library(ComplexHeatmap) library(circlize) library(colorspace) # Setting working directory ----------------------------------------------- this.dir <- dirname(parent.frame(2)$ofile) setwd(this.dir) # Data paths -------------------------------------------------------------- proje...
fd90cfaa4c226e25de5169322bdf1f8dbf0ebdc113881e1c9686e2bec6ada961
R
2,755
68
# This tests the recoverDoublets function. # library(scDblFinder); library(testthat); source("test-recoverDoublets.R") set.seed(99000077) ngenes <- 100 mu1 <- 2^rexp(ngenes) * 5 mu2 <- 2^rnorm(ngenes) * 5 counts.1 <- matrix(rpois(ngenes*100, mu1), nrow=ngenes) counts.2 <- matrix(rpois(ngenes*100, mu2), nrow=ngenes) c...
025584d186e902e8a6d7401d61be146e4a82c99fcfaa43c01f062b59aff6c560
R
2,756
65
library("SingleCellExperiment") library("here") library("sessioninfo") ## Access Tran et al. # Download and save a local cache of the data available at: # https://github.com/LieberInstitute/10xPilot_snRNAseq-human#processed-data bfc <- BiocFileCache::BiocFileCache() url <- paste0( "https://libd-snrnaseq-pilot.s3.us...
e7a097496509f8d872b175f9cd68547abe86c80503b629f5a48f67bf7ad0d25c
R
2,756
99
ConfirmedPyramidData <- function(data) { # [todo] data.tableの次期バージョンがCRANに登録されたらfifelse()での処理を削除 # data.table (remote::install_github('Rdatatable/data.table@b1b1832')) if (packageVersion("data.table") > "1.12.8") { data[, `:=` ( 年齢 = data.table::fcase( 年齢 == "00代", "10歳未満", 年齢 == "10...
2586e7325f811337dbca20a5cab039d83b3e38b8d1854fd77788f8c23ae86164
R
2,758
84
fluidPage( fluidRow( column( width = 5, style = "padding:0px;", userBox( width = 12, title = userDescription( title = i18n$t("北海道"), subtitle = i18n$t("北海道"), type = 2, image = "Pref/hokkaido.png" ), status = "navy", ...
95f52645709ca690b815748c81f74a7b7242ecf6ae0c52bb0cc3e7d8465d4438
R
2,764
77
library(DESeq2) library(tidyverse) # Read Data --------------------------------------------------------------- # DDS object with allele-specific counts at the gene level dds <- readRDS("results/DESeqDataSet/dds_gene_allele.rds") # filtering out lowly-expressed genes and one sample with very few reads dds <- dds[row...
ad56dbfbed4259dbbe2e13f7d4bb98b750dd0d0e4aeaf5a1fd95c0dd71430eb0
R
2,768
66
source("src/libraries.R") load("report01/02.merge/COGA.merged.list.allPeaks.Rdat") if(T){ ATAC.list = dd.list # Assays(ATAC.list[[1]]) cat("================ Normalization ===================") ATAC.list <- lapply(X=ATAC.list, FUN=function(x) { DefaultAssay(x) = "ATAC_Allcomm...
0ca644b0c9f541a9db6e0c4ada417382f374a9b1206f7765c7edc7d6d25f2eba
R
2,779
77
# 03 Batch Correction De.R # 03 Batch Correction De.R ####################################################################### ####################################################################### # Create a DE matrix ####################################################################### ###########################...
6f8df13a3cb30668f3339709bc3d7e4626e294ad3c5b73edf30ea791cd97db96
R
2,782
65
split_violin_pbd <- function(brain_region){ kznf_cortex <- kznf_exp_longer %>% filter(region==brain_region) kznf_cortex <- kznf_cortex %>% filter(value>0) kznf_cortex$species <- factor(kznf_cortex$species, levels = c("Human", "Chimpanzee", "Bonobo", "Macaque")) kznf_cortex_v <- ...
651a9c71e1fb2f7ec88deb71e01a0fc335508afc6657f2a082af4983f345c7ca
R
2,786
59
library(Matrix) library(ggplot2) library(Seurat) library(dplyr) library(stringr) library(qs) library(SoupX) # replace any *...* with respective text # Opening files and removing background mRNA using SoupX ---- samples <- paste0("Syn", c(1:17)) # lucicompen for (sample in samples) { print(paste0("Proce...
2b9483851eb78399d57bc69bf8531c9990200ff14f6e718015efe69040564f21
R
2,793
76
# GPT social perception: Preprocess the GPT4.1 data for video experiment # 1. Read data for each batch and add the video names to the dataframes # 4. Calculate mean datasets of all possible combinations of the datasets # 5. Store results for analyses. # Severi Santavirta 14.05.2025 library(psych) library(string...
b5ba4f5eae000bf0929a2b6203f69089474490275435ef2c9a5b4d0c45e6eab6
R
2,798
93
run_DE <- function(rse, model, run_voom = TRUE, save_eBayes = FALSE, coef, plot_name = NULL){ print_plots <- !is.null(plot_name) if(print_plots) pdf(plot_name) ## limma eBayes_out = get_eBayes(rse = rse, model = model, run_voom = run_voom, print_plots) #### because of more than 1 component, compu...
1cfcaf52ae62267c2bc0732a5ebb30bb9399f27b88c74e1a5a5a1248f59f692c
R
2,801
87
# Warning! R 3.4 and Bioconductor 3.5 are required for splatter! # library(BiocInstaller) # biocLite('splatter') library(splatter) # requires splatter >= 1.2.0 save.sim <- function(sim, dir) { counts <- counts(sim) truecounts <- assays(sim)$TrueCounts drp <- 'Dropout' %in% names(assays(sim)) if (drp) { ...
1f8d6ba155181d4d60dc7cedcda16496dda4f0437d34558bfe3353a489627e56
R
2,803
83
#!/usr/bin/env R # Author: Sean Maden # # Read in HALO settings files. # # Notes: # * Returned table has the following columns: # - "parameter_name" : value from "Parameter Name" tag, where available. # - "value": value from "Value" tag, where available. # - "priority": value from "Priority" ...
47e73fe6878a655ed73cd60b840270f14a748082226fee5525b45c5693b33675
R
2,805
69
#Run GO-BP enrichment analyses ################################################################### #Load libraries library(clusterProfiler) library(org.Hs.eg.db) library(tidyverse) #List files files = list.files(path=".", pattern="exclusive_") #Create empty dataframe to store results final = data.frame(GO.id=charact...
f74b0df2719e99fe5c38b7424f57a4689b3edcf2a92e91586a24753d39ccae64
R
2,809
74
library(tidyverse) bed_dir <- "data/dapars_comparison/apaeval_dapars2_snakemake/seddighi_i3_cortical/exts_elk1_six3_tlx1/rel_quant_beds" bed_regex <- "_04\\.bed$" ctrl_regex <- "^NT_" kd_regex <- "^TDP43_" outdir <- "processed/dapars_comparison/" # list full paths to files in a directory matching a regex (and name v...
db221e9638ed780be2106afd8be1e0199e10c0798f2c8b40ee7295ee6419cd50
R
2,825
63
## Filter probes on IQR ## # path.betas = full path of DNAm matrix (betas), including filename. Can take .rdat or .rds. If .rdat, function assumes DNAm matrix object contains 'betas' in name. # path.output = directory path of output file # name.output = filename of output file. Will be appended to path.output # npro...
6f89268a157f3269b9187202ef3038e701fb53c9f0a1dc0ab275ef7f204d26e3
R
2,830
90
#!/usr/bin/env R # Author: Sean Maden # # Read in HALO settings files. # # Notes: # * Returned table has the following columns: # - "parameter_name" : value from "Parameter Name" tag, where available. # - "value": value from "Value" tag, where available. # - "priority": value from "Priority" tag, where ava...
a9f65231ac9a6d98dc1e675b48a50752ef03561f050f2866cd810bb4d885c932
R
2,836
94
#!/usr/bin/env Rscript # in IsoLamp main, if grouping_variable is NULL, don't run Rscript suppressPackageStartupMessages({ library(reshape) library(dplyr) library(rstatix) library(purrr) library(optparse) }) # importing option_list = list( make_option(c("-i", "--input"), type="character", default=NULL, ...
b6f615a5be38ba2e88031b0e645714890c02e54b56f544c73a5bd86a670d2108
R
2,837
67
sce <- mockDoubletSCE(ncells=c(100,200,150,100), ngenes=250) sce$fastcluster <- fastcluster(sce, nfeatures=100, verbose=FALSE) sce$sample <- sample(LETTERS[1:2], ncol(sce), replace=TRUE) test_that("fastcluster works as expected",{ expect_equal(sum(is.na(sce$fastcluster)),0) expect_gt(sum(apply(table(sce$cluster, s...
fdf28e06de733c0b4a6ded42a5ac6efbd75d49f78942b5aa15aa27a2f8876e55
R
2,839
56
options(stringsAsFactors = FALSE) library(ggplot2) library(reshape2) library(dplyr) library(stringr) library(lme4) library(lmerTest) library(RColorBrewer) library(ggpubr) library(MutationalPatterns) #### COSMIC decomposition by clinical groups #### # load COSMIC signatures cosmic_signatures <- as.matrix(read.table("d...
8390d9b08a77faa2fb2c90c4905fc8c7cc6aee0644b05bb1578f27778cac156b
R
2,842
69
## Apply epigenetic clock functions to late fetal, child and adult samples aged between 26 pcw - 104 years. # Hovath Clock function (https://www.rdocumentation.org/packages/wateRmelon/versions/1.16.0/topics/agep) # Cortical Clock function (https://github.com/gemmashireby/CorticalClock) library(ggplot2) library(wateR...
95b4ef7c24e8c0b38b5eab81695324c5507947ce2b83575c3ff9beb5c1df5115
R
2,844
95
--- title: "Investigative needle core biopsies for multi-omics in Glioblastoma" author: "Gerard Baquer" date: "7/31/2023" output: html_document --- ```{r} #Libraries library("ggplot2") library("ggrepel") ``` ```{r} #Read pks<-GBMSpatialOmics:::load("PATH/TO/MSI_DATA") #Load annotations pks<-GBMSpatialOmics:::exp.loadA...
5c8f3090e2c527327ba18a32eababd1bbf9b821c681d73d313ccbcb353ebeb6b
R
2,846
112
library(ggplot2) library(DESeq2) raw_counts <- read.table("rc_WTd3_WTBMP_D6.txt", header = TRUE) row.names(raw_counts) <- raw_counts[,1] raw_counts <- raw_counts[,-1] raw_counts <- as.matrix(raw_counts) data <- raw_counts[rowSums(raw_counts) >= 0, ] meta <- read.table("info_WTd3_WTBMP_D6.txt", header = T...
6e25f3f24ded3b7a7247d46234be87e2bdec6328a0d25dacf78b956791b51c6e
R
2,847
96
library("SummarizedExperiment") library("edgeR") library("variancePartition") library("purrr") library("here") library("jaffelab") library("sessioninfo") #### Set up #### ## dirs # plot_dir <- here("plots", "09_bulk_DE", "08_DREAM_library-type") # if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) ## d...
f9740c98f55e00a9e7522a95aa451e99dca8b5acecdbfe135ad998574116e345
R
2,848
59
library(topr) library(tidyverse) library(data.table) library(dplyr) results_log <- fread("geno_assoc_tfLFall_ukb.fastGWA", head=TRUE)#read in the dataset with merged latent factor sumstats (minimum p-value for each SNP) reg <- fread('LF_final_GP3.csv', head=TRUE, sep=',')#read in the dataset with the latent factor ...
c97a5e5f077779acce94f141e9af91d7d6f8ac0bc75e0b8351d1c9de88e2e6bb
R
2,849
77
# Reference values for PyMARE's correlated-effects implementation. # # Writes pymare/tests/data/robumeta_reference.json, which # pymare/tests/test_robumeta_alignment.py reads. Run it through the harness in # this directory rather than directly, so the R and robumeta versions are the # pinned ones: # # validation/ro...
9b7870cabe261a5f4a807e9e99785d21b8ebbdfe1b3c79bffa3d4b7d814628c5
R
2,850
87
# ============================================================================= # 巨噬细胞代谢通路VISION分析脚本 # ============================================================================= # 功能:巨噬细胞亚群代谢通路分析,使用VISION方法计算KEGG代谢通路活性 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf...
794a1d53931a0ec36451398154ce99bdff951ac8c16ed22acf8424088db91e85
R
2,852
99
library(tidyverse) library(scattermore) library(Seurat) library(here) #load and wrangle data meta <- readRDS(here("data", "human_meta.RDS")) reductions <- readRDS("data", "human_all_umap_coords_2d.RDS")) to_plot <- reductions %>% as_tibble(rownames = "sample_id") %>% filter(sample_id %in% meta$sample_id) %>% ...
9cd14b348471012401f99adf65178bf382a4a4dec152818f97ca59cdf3a866c9
R
2,852
67
--- title: "R Notebook of rV2 manuscript figure S1 plots" output: html_notebook --- ```{r Packagies} library(tidyverse) library(Seurat) library(Signac) library(qs) source("local_settings.R") ``` ```{r Set parameters} cores <- 6 ``` ```{r Load qs objects} e.e12.r1 <- qread("../scRNA_data/e.e12_r1_200623.qs", nthreads...
b72114be2c3d3bbb3c3b07b63129b5e6f2dfcc9b5bb5fb339a1cd2f59182fa03
R
2,858
92
suppressPackageStartupMessages(library(GEOquery)) library(magrittr) library(oligo) library(pd.mogene.1.0.st.v1) library(mogene10sttranscriptcluster.db) library(dplyr) GEO <- "GSE52333" chip <- "mogene10st" org <- "mm" annot <- "ensg" gse <- getGEO(GEO)[[1]] base_dir <- paste(base::getwd(), "data-raw", sep="/") if (...
656ed29c8d214bce08a7286df17bc7a6a3c0f2d3ec073e7dcad610df889aa9b3
R
2,859
75
library(mapgen) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") bigSNP <- bigsnpr::snp_attach(rdsfile = '/project2/xinhe/1kg/bigsnpr/EUR_variable_1kg.rds') data('Euro_LD_Chunks', package='mapgen') folder_gwas_mapgen <- "/project2/xinhe/xsun/psych_analysis/1.torus/data/gwas/" file_gwas <- list.files(folder_gw...
b00b21b1bff79733c8ed514216faeba3a7d71534486503540ac6f7bb5f6e8450
R
2,859
73
# load packages require(tidyverse) require(seriation) # load data bin.paa.sax <- readRDS('bin_paa8_alpha9.rds') # get SAX sax.tb <- bin.paa.sax %>% filter(!na.expression) %>% # remove empty genes transmute(time_point, genotype, mouse_id, mouse_name, sax9) %>% unnest_wider(col = sax9, names_sep = '_') # subse...
d84daa4b1a1b9aeb464593749c2af272b17f451f3ad5c2049be4f800ecc91511
R
2,865
75
library(mapgen) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") bigSNP <- bigsnpr::snp_attach(rdsfile = '/project2/xinhe/1kg/bigsnpr/EUR_variable_1kg.rds') data('Euro_LD_Chunks', package='mapgen') folder_gwas_mapgen <- "/project2/xinhe/xsun/psych_analysis/1.torus/data/gwas/" file_gwas <- list.files(folder_gw...
be97ee1ae27676264092d42a057fec6dd19d914eb4928cfe8a98014ff12ff646
R
2,869
76
library(mapgen) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") bigSNP <- bigsnpr::snp_attach(rdsfile = '/project2/xinhe/1kg/bigsnpr/EUR_variable_1kg.rds') data('Euro_LD_Chunks', package='mapgen') folder_gwas_mapgen <- "/project2/xinhe/xsun/psych_analysis/1.torus/data/gwas/" file_gwas <- list.files(folder_gw...
9b3c4e8b991d07b2854830cfcb8cbe8b81ab646524481c3590bb2d3f800a19ed
R
2,872
90
dev <- FALSE if(dev) { library(openxlsx2) meta_data <- read_xlsx(file = "./data/Database/SampleMasterfile.xlsx", sheet = 1, skip_empty_rows = TRUE) experiments <- sort(unique(meta_data$experimentId)) # remove all NLA stuff experiments <- experiments[!grep...
34ba54e848636ca8698643c2f4ba1edf87ca5c42e357416341e6907afb9271b3
R
2,873
75
library(mapgen) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") bigSNP <- bigsnpr::snp_attach(rdsfile = '/project2/xinhe/1kg/bigsnpr/EUR_variable_1kg.rds') data('Euro_LD_Chunks', package='mapgen') folder_gwas_mapgen <- "/project2/xinhe/xsun/psych_analysis/1.torus/data/gwas/" file_gwas <- list.files(folder_gw...
4c7f934df2e29e8a366385a5ac3f6f2e7fa9cc83535fabb1dbdbea79b5e59547
R
2,876
84
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) library(Seurat) library(qs) library(foreach) library(ggpubr) library(Signac) objects_folder <- file.path(project_folder, "objects", "R", "seurat") qc_folder <- file.path(project_folder, "...
b277575a61ad7788003c969adf86028bea39b1fbeec7f7ed0b4babe72e94b353
R
2,876
89
library(Seurat) library(BPCells) blacklist <- c("BTRC_17_BTRC_17", "BTRC_26_BTRC_26", "BTRC_15_BTRC_15", "BTRC_34_BTRC_34", "BTRC_44_BTRC_44", "BTRC_39_BTRC_39", "BTRC_87_BTRC_87", "BTRC_41_BTRC_41", ...
995ca02946e2c4e06ceead70660c37a56e3aef65b56094563bdf5f01074e01f1
R
2,878
76
library(mapgen) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") bigSNP <- bigsnpr::snp_attach(rdsfile = '/project2/xinhe/1kg/bigsnpr/EUR_variable_1kg.rds') data('Euro_LD_Chunks', package='mapgen') folder_gwas_mapgen <- "/project2/xinhe/xsun/psych_analysis/1.torus/data/gwas/" file_gwas <- list.files(folder_gw...
9c2c9f3dd591795dafe39de251735057c4332e55b8230e3dda571cb6f5ec8fb4
R
2,878
76
library(mapgen) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") bigSNP <- bigsnpr::snp_attach(rdsfile = '/project2/xinhe/1kg/bigsnpr/EUR_variable_1kg.rds') data('Euro_LD_Chunks', package='mapgen') folder_gwas_mapgen <- "/project2/xinhe/xsun/psych_analysis/1.torus/data/gwas/" file_gwas <- list.files(folder_gw...
dca60e79500f1890538c4e5064236aaa28331a2bdfb05a01c716164d90e0c4fc
R
2,878
76
library(mapgen) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") bigSNP <- bigsnpr::snp_attach(rdsfile = '/project2/xinhe/1kg/bigsnpr/EUR_variable_1kg.rds') data('Euro_LD_Chunks', package='mapgen') folder_gwas_mapgen <- "/project2/xinhe/xsun/psych_analysis/1.torus/data/gwas/" file_gwas <- list.files(folder_gw...
b7666149e7ed940ee9a0cbc799b6a7fa1c095f7a9f4aa9c0185d983101725fb3
R
2,896
59
options(stringsAsFactors = FALSE) library(ggplot2) library(reshape2) library(dplyr) library(stringr) library(lme4) library(lmerTest) library(RColorBrewer) library(ggpubr) #### Correlation btw high Indels and high SNVs #### df <- read.table("data/TableS3_PTA_burden.tsv", header=T, sep="\t") df$Case_ID <- as.character(...
67153da5a007b233a84435c34cd45e8192405a7af91d2346f3e6fc4aa0e0093e
R
2,903
90
#!/usr/bin/env Rscript suppressPackageStartupMessages({ library(FactoMineR) library(factoextra) library(ggplot2) library(ggrepel) library(optparse) }) option_list = list( make_option(c("-i", "--input"), type="character", default=NULL, help="input count_data"), make_option(c("-o", "--ou...
9ed182d7a91eb81b95e1121aa561e55758f58afcfe9f763d36431d6cf06aea96
R
2,904
72
#' Check magma object / file is usable and returns it as a data.table #' #' @param magma input magma object / file #' @param magma_gene_col character string corresponding to the column name #' in the MAGMA data containing gene identifiers #' @param magma_z_col character string corresponding to the column name #' in the...
26410b434bbb96305f6a69d0e506f4aa95a1b5fb9eac91cdf43622aaf0916189
R
2,907
98
#------------------------Postprocessing------------------------ # Takes APAlyzer output and generates differential challenge # output tsv file # load libraries if ( suppressWarnings(suppressPackageStartupMessages(require("optparse"))) == FALSE ) { stop("[ERROR] Package 'optparse' required! Aborted.") } if ( suppressWa...
9745ccea72267fda3fa7fd105deffc4bf503030b58bb166166e512a1c1ce4d9e
R
2,907
112
output$currentActive <- renderEcharts4r({ dt <- simpleMapDataset() # 本日増加分 todayTotalIncreaseNumber <- sum(dt$diff, na.rm = T) subText <- i18n$t("各都道府県からの新規報告なし") if (todayTotalIncreaseNumber > 0) { subText <- paste0( sprintf( i18n$t("発表がある%s都道府県合計新規%s人, 合計%s人\n\n"), sum(dt$diff > 0)...
1431638061ab075fe23695a92a76f9a642aa620911811730b3173bfeeba377ca
R
2,912
66
seven_mr_res <- function(dat){ ###MR library(TwoSampleMR) res <- TwoSampleMR::mr(dat) # check the least SNP counts #print(paste0(id,"_SNPÊý_",res$nsnp[1])) ##Ôö¼ÓContamination mixtureºÍcML-MA-BIC·½·¨ ##Contamination mixture£º£¨1£©robust£»£¨2£©Òì¹¹...
a807903fb8a03dc82b158936632dc49346754e74d3dc6b43b2efeaee975165f8
R
2,916
99
#!/usr/bin/env R # # Get marker genes for cell types using mean ratio expression (log counts). # Uses DeconvoBuddies::get_mean_ratio2() function. # # devtools::install_github("https://github.com/LieberInstitute/DeconvoBuddies") library(DeconvoBuddies) # contains get_mean_ratio2() to get marker genes library(SingleCel...
18d2f6c5d25b90d0b173640824b6f311e18fcc0ab563bdb27644dd80c294a1c5
R
2,917
71
prepareFluxforRegressions <- function(fluxesPruned, SCALE) { # Prepare flux data for regression analyses. # # INPUTS: # fluxesPruned: A data frame of pruned flux data. Expected to include 'ID' and 'Sex' columns. # SCALE: A logical flag indicating whether flux data should be log-transformed and scaled. # # OUTPUT: #...
bd301dc6532a8bff625793a7400eb728a0d020e435c84863d73196a77b7f5d97
R
2,919
71
# NGÒѾ­¶¨ÒåÁËËÄÀàdevAS£¬Í³¼ÆÒ»ÏÂÿÀàdevASµÄÊýÄ¿ # »ñµÃËùÓÐpatternΪ¡°d¡±µÄdevAS£¬²é¿´ÕâЩASÉÏÊÇ·ñ¸»¼¯SRSF1µÈµÄ½áºÏmotif setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) human_devAS <- read.table(file = "01-data/19-Development_alternative_splicing/human.devAS", s...
7115658897bc45e531b441c5788167d661788ffb17d608c57677ea802b6ca622
R
2,922
44
--- title: "Power Simulation results" author: "LL" date: "2024-05-31" output: html_document: default pdf_document: default word_document: default --- ```{r, echo=FALSE, message=FALSE, warning=FALSE} library(flextable) library(tidyverse) setwd("/data/pt_life/ResearchProjects/LLammer/gamms/Analysis/Simulations/") d...
97f09a061cabd3bb1b0197a54fcfbd9e533bed823aaf0df2879f32aba25c3950
R
2,932
94
rm(list=ls()) set.seed(123) source('load_libraries.R') source('aux_functions.R') detect_delimiter = function(filepath) { first_line = readLines(filepath, n = 1) # Check for common delimiters if (grepl("\t", first_line)) { return("\t") } else if (grepl(",", first_line)) { return(",") } else { sto...
ef5c7c4f57bf2670411896f9479688880e91c8b9a5aad791e369812f403cb6b4
R
2,933
60
library(Seurat) library(SeuratObject) library(SeuratDisk) ### USED TO CONVERT RDS TO H5AD FOR USE IN SCANPY #### s <- readRDS("Human_M1_10xV3_Matrix.RDS") s <- CreateSeuratObject(s) SaveH5Seurat(s, "Human_M1_10xV3_Matrix.h5seurat") Convert("Human_M1_10xV3_Matrix.h5seurat", dest="Human_M1_10xV3_Matrix.h5ad") ...