sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
8399014d5b5311cf03c1b4df1439e0822cf0054c5e15fa0b51835cd49201361f
R
2,936
71
--- title: "R Notebook of rV2 manuscript figure S2 plots" output: html_notebook --- ```{r Packagies} library(tidyverse) library(Seurat) library(Signac) library(qs) source("AuxFunctions.R") ``` ```{r Set parameters} threads <- 6 ``` ```{r Load qs objects} r1.data <- qread("../scATAC_data/E12_R1_DownstreamReady_nmm_.2...
f8219a87ca5ccf339e9bc56630678b3bc0e2558a7d4b99e89bcbaaa7f7dc14e9
R
2,936
84
# merge Biermann et al. meta data to the preprocessed data # takes some minutes library(Seurat) library(ggplot2) dataPath = "data/" mergedOutFile = "seurat-allSamples-withMeta.rds" mergedOutFile = paste0(dataPath,"seurat-allSamples-withMeta.rds") rdsFiles = list.files(path = dataPath,pattern = "_sn_cb_DF.rds",recurs...
ee5e78b8e510f8cda0697b50f276d4a98e45ed4511aeaa7558e3df51bf4cf7cb
R
2,941
94
library(DESeq2) library(tidyverse) library(Matrix) library(igraph) theme_set(theme_minimal(base_size = 16)) # vector of colours for plotting developmental stages stage_colours <- c("nulliparous" = "grey", "gestation d5.5" = "#a6cee3", "gestation d9.5" = "#9ecae1", ...
bf425313d0346ccfd8094afcd35e00e09d6c34b95037fceed3cc01cea0bc11a7
R
2,948
98
rm(list=ls()) source('load_libraries.R') source('aux_functions.R') # bin data and compare overlap compare_bins_overlap = function(data1, data2, bins = 10) { data1 = data1 %>% mutate(importance = as.numeric(importance)) %>% arrange(desc(importance)) %>% mutate(bin = ntile(-(importance), bins)) data2 = dat...
6caf719c02d4c0c9135afed04d9ff03fb3a28a5ffa2cfd79fdd40762ddc1ea7f
R
2,953
101
fluidRow( column( width = 12, box( title = i18n$t("プロジェクトメンバー"), icon = icon("users"), width = 6, userList( UserListItemWrappter( image = "Icon/wei_su.jpg", href = "https://twitter.com/swsoyee", icon = "twitter", title = "Wei_Su", ...
6867c7cd143f3a26369801910dbf38dfab4fd4e10ba15e918d58ae0ea6a7f6c6
R
2,954
71
#' AIF360 dataset #' @description #' Function to create AIF compatible dataset. #' @param data_path Path to the input CSV file or a R dataframe. #' @param favor_label Label value which is considered favorable (i.e. “positive”). #' @param unfavor_label Label value which is considered unfavorable (i.e. “negative”). #' @p...
2f74175cd11dddf2f8e24fde41d32fd315a36731ade436d5536563608bf3c7f5
R
2,957
96
# 25 May 2022 Siwei # process new astrocyte (AST) batch data (May 2022) # note that this batch of AST 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(RColorBrewe...
19f628f5efc6f115544dc0b8397748daebb628111d1cada95da6bc8016c2c2a2
R
2,959
105
# Siwei 18 Jun 2024 # test LDlinkR # install.packages("LDlinkR") # init #### library(LDlinkR) library(vcfR) library(stringr) rs10792832_proxy_hg38 <- LDproxy(snp = "rs10792832", pop = "CEU", token = "ed9e7f4a5d87", genome_build = "grch38", r2d = "r2") # The master SNP genotype file ...
6d2f830326c71ee6bcf41e1e21997ab7ed41b44c6db0e8dd94735ba7ada59355
R
2,960
68
## Comparison of Age linear regression statistics in an independent Illumina EPIC 27K fetal cortex cohort ## # Fetal 27K cohort: Numata et al. (2012). DOI:10.1016/j.ajhg.2011.12.020 library(data.table) library(ggplot2) library(grid) library(gridExtra) #1. Load results ============================================...
a931a8e06e3463b6ec07e9f382d960d3a8bc19d71ae4bdb4d21c7729146c2204
R
2,962
99
rm(list=ls()) source('load_libraries.R') source('aux_functions.R') compare_bins_overlap = function(data1, data2, bins = 10) { # Add bin column to each dataset based on the importance data1 = data1 %>% mutate(importance = as.numeric(importance)) %>% arrange(desc(importance)) %>% mutate(bin = ntile(-(importa...
a8f16c4c4a225cc2ba694d9815fb0b1f24c3c0eccd9744446f05da6c94eac0c1
R
2,966
79
#R version 3.6.1 quartz<-function(width,height){windows(width, height)} setwd("D:/2020 RV projection/wholebrain/RV SC no in situ/5432") setwd("C:/SKS_Drive/2020 RV projection/Wholebrain/RV SC VGLUT2") folder<-'D:/2020 RV projection/wholebrain/RV SC no in situ/5432/slide 4 section 2_2_1' library(wholebrain) flat.f...
bca49e6cb4d2c89547c3ff305ba823fad8dd927670c3a84c3ddec00612454736
R
2,969
68
# *********************************************** # script to generate data for causal simulation # # Note: need to run null_sim_all.sh first # *********************************************** if (!require("here")) { install.packages("here") library("here") } if (!require("magrittr")) { install.packages("magritt...
c602e3b48d169b3a73d7feae18289a3c617b7dfd8816612fce618fd0544c4549
R
2,970
126
--- title: "QC & filtering P5" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2021/11/02" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$...
31e6e47db5cb78dfb25feae0a0ee1f783bebcc4bf0151666391e1ec707a5267b
R
2,971
126
--- title: "QC & filtering P1" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2021/11/02" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$...
36f62b261339371e97909d282a9fd9ef574cdf08e71ad7e3a133d6a8f2f572dc
R
2,971
70
source("/projects/ren-transposon/home/chz272/transposon/R_projects/Paired-map/R/cxzhu.R") source("/projects/ren-transposon/home/chz272/transposon/R_projects/Paired-map/R/Paired-map.R") library(Seurat) setwd("/projects/ren-transposon/home/chz272/transposon/05.Paired-ChIP/20.NovaSeq/16.Integration/2020_10") meta<-read.c...
752a6973fd1edff3dabba1ebdbed362ba301a8f95a791b6a84460cf9237f010c
R
2,971
126
--- title: "QC & filtering P3" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2021/11/02" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$...
c28b2a85c088517e8aa9c5ff87f73b027bef853ce2d265b676ac159aae4a355d
R
2,971
126
--- title: "QC & filtering P2" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2021/11/02" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$...
e204029524d582af5ad1ee477cc44dd22ebeaa05e242061398919f103a370099
R
2,971
126
--- title: "QC & filtering P4" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2021/11/02" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$...
f0281aad6ae269515aa8b2463b0db17853df6a8f1c65a56f17d3d3a9ab6db56e
R
2,971
126
--- title: "QC & filtering C7" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2021/11/02" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$...
155d902f0f618c8005aae88cc10205141ddd043e12f4f1155b6b799b2838506f
R
2,973
126
--- title: "QC & filtering P6" author: "Anne Hoffrichter, Eric Poisel, Lea Zillich" date: "2021/11/02" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, tidy.opts=list(width.cutoff=80),tidy=TRUE, fig.asp=0.5, fig.width=12, warning = FALSE) knitr::opts_knit$...
6c638c098ef296071e1a72dc3baedbb12416c5fed6e5910a659d882387a1bc78
R
2,976
73
## Show the loading biases over reporter ions ## based on trimmed-mean of log2(intensity) ## Input arguments ## 1. inputFile: the path and name of "raw..._scan.txt" file ## 2. noiseLevel: currently, it is hard-coded as 1000 ## 2. SNratio: signal-to-noise ratio for the loading-bias correction (specified in the ju...
fd706c4fee468b52c61818251e3b92e69db48c19409f81fd3d779ebdde09a050
R
2,987
81
library(tidyverse) library(DESeq2) sample_tbl <- read_csv("data/liu_facs/liu_facs_sample_sheet_dexseq_meta.csv") counts <- read_tsv("processed/gene_exprn/2023-09-07_liu_facs_salmon_summarised_counts.tsv") base_key="TDPpos" contrast_key="TDPneg" contrast_name="TDPneg_vs_TDPpos" covs <- c("gender", "patient") # convert...
5de4ca298c4bce95df4f32205aeb8303a41d32212dc0c73822a95f9790a5ae86
R
2,988
89
# integrate the preprocessed patient samples with RPCA # takes a few hours library(dplyr) library(Seurat) library(ggplot2) library(parallel) dataPath = "data/" infile = "seurat-allSamples-withMeta.rds" outfile = "seurat-integr-withMeta-neededCTs.rds" paste0(dataPath,infile) paste0(dataPath,outfile) '%notin%' = Negat...
231d8f6029a8897b7e6b5f541e3822abe5af0c9c5330e612cc5ba10169ccfe0d
R
2,989
79
## Perform DMR analysis on bulk fetal Age EWAS results ## #1. Load data =================================================================================================================== load(paste0(PathToBetas, "fetalBulk_EX3_23pcw_n91.rdat")) #2. Run DMR script =================================================...
4e6d4bf6de05bc02395f2e2d857c4f186bcb46840457f70458f733356c7c01a4
R
2,991
80
# GPT social perception: Preprocess the GPT4.1 data for frame experiment # 1. Read data for each batch and add the frame names to the dataframes # 2. Exclude rows that have nan data in at least one dataset # 3. Exclude columns that dont have any variation from zero in at least one dataset # 4. Calculate mean da...
858883524fea0f4b443bc73301a7b276587e14ca3968a3702a3e10cb44542291
R
3,002
82
#plot for the simulation results ##### load packages and results #### if (!require("here")) { install.packages("here") library("here") } if (!require("tidyverse")) { install.packages("tidyverse") library("tidyverse") } if (!require("magrittr")) { install.packages("magrittr") library("magrittr") } #color c...
96bd8821a7c98c7796d437409c049c61816c957491e316379177d5b24cefdd9a
R
3,002
106
library("splatter") library("scater") library("DeconvoBuddies") library("SingleCellExperiment") library("tidyverse") library("sessioninfo") library("here") ## prep dirs ## plot_dir <- here("plots", "06_marker_genes", "02_splat_example") if (!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) ## load our D...
b3d52fdc0144a270272ad8d5a187b851fa237d7ece094b99b0d4a90775b6a5fa
R
3,014
116
#' EditVCF #' #' Edit the VCF (Variant Call Format) file, Creates file with SNPs data at the BAM directory called variantTable.csv #' @param Directory The Path of to the BAM Directory, also the VCF file #' @param Organism "Human" or "Mouse" #' @param temp_dir "temp directory #' @export #' @return None EditVCF <- fun...
89a402a60f9392107a91c5ae34a071e27e2eb857b8bf9212b3c580dc944deb86
R
3,016
59
### All the SNPs in the output from the exposure data will be queried against the requested outcomes ### Locally or in remote database using API ### several functions are required for harmonizing data: TwoSampleMR package, get_proxy, snp_replace_proxy get_mv_harmonise_data_modifed <- function (exposure_dat, outcome_d...
56a252967bf2ccbda49dc9ef221f99bda41a3828338434f538c6ff5c794dcd9a
R
3,017
69
# load packages require(tidyverse) require(Seurat) # load Seurat object sdata.align <- readRDS('sdata_align_snRNA-seq_singlet.rds') # for each sample, count number of singlets per cell type cluster.data <- sdata.align %>% FetchData(vars = c('sample_id', 'genotype', 'sex', 'batch', 'cluster_label')) %>% mutate(clu...
50a812afbad048e19799154376f7309499a81989c13f64f111c2668278d57e3d
R
3,018
67
#' Calculate influential genes for a given trait and cell type using DFBETAS. #' #' @param ct A character string containing a valid cell type name in sscore. #' @param sscore A dgeMatrix of seismic specificity scores where #' each column is a cell type and row names are gene identifiers. #' (Note: the identifiers used ...
eed0b4d414563e629d5b444de5380e10dd9a736f633ff361e578470356127b15
R
3,021
100
# install packages, if they're not already installed packages <- c('argparse', 'psych', 'GPArotation') new_packages <- packages[!(packages %in% installed.packages()[,"Package"])] if(length(new_packages)) { install.packages(new_packages, repos = "http://cran.us.r-project.org") } library('argparse')...
1f93ca8e62066bae8f78dfc52ebf5db5f1508517f3ade0130e6478b53cb82e9e
R
3,024
96
library("tidyverse") library("here") library("jaffelab") #### Get Data info #### fastq <- list.files(here("raw-data", "bulkRNA"), recursive = TRUE, pattern = "*1.fastq.gz$") fastq1_fn <- list.files(here("raw-data", "bulkRNA"), recursive = TRUE, pattern = "*1.fastq.gz$", full.names = TRUE) fastq2_fn <- list.files(here...
ba2381a617d3b87fe899d4bdd28a443d1c2b6b034bd98a494597cfd68a2853db
R
3,032
113
#!/usr/bin/env R # # Get the data and images for heatmap summaries of marker genes library(pheatmap) #----------- # set params #----------- projid <- "dlpfc-ro1" # id of the current project celltypevar <- "cellType_broad_k" # cell type from cluster assignment donoridvar <- "BrNum" # brain id num corresponding to the...
5d840076c922f9db9fb056c9fdac602ad1f17fe11252d343d2ed79c02d999c13
R
3,035
86
# pec_data = list(CMC = c(33792, 456460), # DevBrain = c(33201, 102936), # IsoHuB = c(33339, 29675), # LIBD = c(33783, 52214), # MultiomeBrain = c(33818, 141277), # PTSDBrainomics = c(33877, 198572), # SZBDMulti = c(34361, ...
90e1bec1c6507adb8e0676e64711c5913bb47c16ff84c57ec193eb3884b3ee50
R
3,039
100
library(ggplot2) library(stringr) library(plyr) library(dplyr) library(lubridate) library(reshape2) library(scales) library(ggthemes) library(Metrics) data <- read.csv("r2plus1d_18_32_2_pretrained_test_predictions.csv", header = FALSE) str(data) dataNoAugmentation <- data[data$V2 == 0,] str(dataNoAugmentation) dat...
9978bfbec0661ac6efa6076fcc748efcb1c5548cfd3dd7fce629dbc7a337fcee
R
3,046
75
library(tidyverse) outdir <- "processed" # find paths to per-event binding summaries summary_paths <- list.files(path = "data", pattern = "^2024-11-13_event\\.",full.names = T) # extract event type from file name summary_paths <- set_names(summary_paths, str_split_i(basename(summary_paths...
9afc56e310e8fdfc187c379d6dbab6b1a6054d6584c37bcaf567e0dd0832cacd
R
3,058
73
# First run main.R until definition of Selles et al. Mixed Model (M_mm) # this scripts store prediction performance of the XGB ensemble applied at # different times post-stroke weeks <- c(1, 6, 13) names <- c("Week 1", "Week 6", "Week 13") perf_wks_xgb <- data.frame() baseline_ARAT <- test_xgb %>% group_by(Number)...
b010ca9aa9fe5aa78307364ad834e98ced42fd2703c008616b32cab64dd63b4d
R
3,062
116
# ÓÃbedtools closest²éÕÒintergenic UCR×î½üµÄcoding»ùÒò£¬×öGO¸»¼¯·ÖÎö # ûÓп¼ÂǷDZàÂë»ùÒòÊÇÒòΪ·Ç±àÂë²»ÄÜ×ögo·ÖÎö£¬¶øÇҷDZàÂëÒ²ÊÇͨ¹ý²éÕÒtarget coding gene×ögo setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(ggplot2) intergenic_coding_gene <- read.table( file = "01-data/11.1-Get...
9014a9130af45236bfb9d3c96eb1743793416ad7b7746a055e887cc716f984d2
R
3,063
97
library(tidyverse) library(here) meta_human <- readRDS(here("data", "human_meta.RDS")) meta_chimp <- readRDS(here("data", "chimp_meta.RDS")) meta_gorilla <- readRDS(here("data", "gorilla_meta.RDS")) meta_rhesus <- readRDS(here("data", "rhesus_meta.RDS")) meta_marmoset <- readRDS(here("data", "marmoset_meta.RDS")) me...
8112bc6dd2105c5c3679c9e0ce6174f60f87f087e8aa7306f5929d0235662aca
R
3,064
97
# make disease/gene group plots for LDSC enrichment on scARC # peaks enriched from psedobulk exp # Siwei 28 Jul 2022 # init library(ggplot2) library(readr) library(RColorBrewer) library(stringr) # import data df_raw <- # read_delim("results_4_R.txt", # delim = "\t", escape_double = FALSE, # ...
c046031f1f9c64aee575a73e9853e2b2c8c284851ffb6e69120438d221870ab2
R
3,065
88
#File to identified enriched terms in DE genes between neuronal types using the pathfinR algorythm. library(pathfindR) library(openxlsx) library(biomaRt) library('org.Hs.eg.db') library(writexl) library(plyr) library(tidyverse) library(ComplexHeatmap) library(circlize) library(STRINGdb) library(igraph) #regions ref...
c24662d354c350596edb61d31faf01ce3bf28c1b739b464fa8df6995f861d649
R
3,071
58
#### Figure S5H - Heatmap #### #### Expression changes of neurotransmitter receptors and transporters in astrocytes #### library(matrixStats) library(gplots) library(stringr) library(here) # human astrocyte DEGs: h_c <- read.table(here("data/astrocytes", "Astro_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) h...
d54c08fe12fe3754a4b326464c9e6b47791a7661d7054442cc1295b367162b39
R
3,078
79
library("DeconvoBuddies") library("SingleCellExperiment") library("tidyverse") library("ggrepel") library("here") library("sessioninfo") #### prep dirs #### data_dir <- here("processed-data", "12_other_input_deconvolution", "07_find_markers_Mathys") if(!dir.exists(data_dir)) dir.create(data_dir) plot_dir <- here("plo...
cb50a40940c5f406839f7277483c157b8f4472f2c75a192912466aae43730d55
R
3,082
82
library("DeconvoBuddies") library("SingleCellExperiment") library("tidyverse") library("ggrepel") library("here") library("sessioninfo") #### prep dirs #### data_dir <- here("processed-data", "12_tran_deconvolution", "01_find_markers_Tran") if(!dir.exists(data_dir)) dir.create(data_dir) plot_dir <- here("plots", "12_...
79e0eb96acb96f53de2ccf6279a237ef404997f1ded9f469c2236389feae0ea2
R
3,086
90
library(lme4) library(R2nparray) files = list.files(path="results", pattern="lme...csv") rslt = list() # Check the code with a sequence of data files with different # dimensions and random effects structures. for (file in files) { # Fit a model with independent random effects (irf=TRUE) or # dependent rando...
cfb0ed66a1edcc97b6818e0d1520704fefaebd110cfcfcf23206cf06be60b1e0
R
3,086
101
# ÀûÓÃSEEKR̽Ë÷ncRNA UCRÏà¹ØµÄlncRNAµÄ¹¦ÄÜ setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(Biostrings) # get bed file lncRNA_with_name <- read.table( file = "01-data/33-SEEKR_exploration_of_lncrna_function/Homo_lncRNA_with_gene_name_1.bed", sep = "\t" ) # 5757 lncRNA_without_...
7453215d4e0928349f72ccde4b11547deefbd94f0de442e191c68eb870d5481b
R
3,100
77
library("SingleCellExperiment") library("MuSiC") library("here") library("sessioninfo") ## get args args = commandArgs(trailingOnly=TRUE) marker_label <- args[1] marker_file <- NULL if(marker_label == "FULL"){ message("Using FULL gene-set") } else { marker_file <- args[2] stopifnot(file.exists(marker_file)) ...
9d63fb8da6b285ec9081e082a0db1e3e1d147881902690e0f7453b288010a022
R
3,108
85
library(data.table) library(sparkline) source(file = "01_Settings/Path.R", local = T, encoding = "UTF-8") jMobility <- fread(paste0(DATA_PATH, "Google/Global_Mobility_Report.Japan.csv")) nameJa <- unique(jMobility$nameJa) prefResultList <- data.table() for (pref in nameJa) { prefDt <- jMobility[nameJa == pref] c...
72b77ed583d58668cada28de917ef6eb97d1edfd8da41e2397e9d932172faf4d
R
3,110
101
library(dmrff) options(mc.cores=4) source("functions.r") library(peakRAM) stats <- read.csv(text="n.sites,n.samples,dat,peak,coverage 10000,100,NA,NA,NA 10000,200,NA,NA,NA 10000,400,NA,NA,NA 20000,800,NA,NA,NA 40000,1600,NA,NA,NA 40000,3200,NA,NA,NA") for (i in 1:nrow(stats)) { cat(date(), stats$n.sites[i], st...
e8e5ba347bf727be8983795bdd278069b438a9489590e1e7a1621f28fa05e7a5
R
3,113
97
snp_replace_proxy <- function(dat, snp_proxy, type = "exposure", build = "37", pop = "EUR") { stopifnot(nrow(dat) == 1) stopifnot("SNP" %in% names(dat)) stopifnot(paste0("effect_allele.",type) %in% names(dat)) stopifnot(paste0("eaf.",type) %in% names(dat)) stopifnot(build %in% c("37","38")) # Create and ...
ee6ccaf47995cd0e10787a6e44f7af17891b97aab7cd0f220ecb7b9cb0e50de0
R
3,119
80
#!/usr/bin/env Rscript ### title: DGE (Differential gene expression) in CD8+ T cells comparing expanded vs non-expanded TCRs ### author: Jana Biermann, PhD library(dplyr) library(Seurat) library(ggplot2) library(gplots) library(ggrepel) library(hypeR) library(DropletUtils) '%notin%' <- Negate('%in%') colExp<-c('#C82...
4381b99863a0bd798d63caa3ceba6958d28c020816609162f76984d21cbc0da6
R
3,127
72
munge_sce_mat = function(data_obj, mapping_df, assay_name = "all",multi_mapping = "sum") { #check if the assay exists if ( assay_name != "all" & !assay_name %in% SummarizedExperiment::assayNames(data_obj)) { stop("The assay you are indicating does not exist") } #check if the feature name is correct if( i...
07fc1c8c3b365880bc761ab1797beaae5eb34b2c865e33fe609a12fe0198f292
R
3,129
105
# ============================================================================= # 巨噬细胞与CPTC细胞通讯分析脚本 # ============================================================================= # 功能:巨噬细胞亚群与CPTC细胞的细胞通讯分析,识别特定细胞类型间的通讯模式 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf ...
a5beaee5025da9e5c7d407037a4915098b272cb7b32d06727b9d2c682b745aa8
R
3,136
102
set.seed(123) library(DESeq2) library(dplyr) library(readr) library(tidyr) library(purrr) library(ggplot2) library(stringr) library(tibble) library(ggrepel) library(apeglm) cds_counts <- list.files("data/gene_cds_counts", pattern = "_results.txt$",full.names = T) %>% set_names(str_remove(basename(.), "_featureCounts...
4c7a123c90d7f818732218a8d03bcde68648aa39a2aac6af1bb223b1462aa378
R
3,140
104
# ============================================================================= # 差异表达分析脚本 # ============================================================================= # 功能:进行差异表达分析 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf <- list.files("./") for (file in lf)...
69649942ea2c1657f10f25ff43205d4b42c5b8e95f06ef0dbeb83f37f72f753c
R
3,147
87
library("SingleCellExperiment") library("BisqueRNA") library("here") library("sessioninfo") ## get args args = commandArgs(trailingOnly=TRUE) marker_label <- args[1] marker_file <- NULL if(marker_label == "FULL"){ message("Using FULL gene-set") } else { marker_file <- args[2] stopifnot(file.exists(marker_file)...
fc80cb3219c0b46993a9f86934366a55b832f089c076f852f10d9f137429ecac
R
3,150
102
## ## Generate a heatmap for a matrix of values with specified genes/rows and samples/columns. ## plot_heatmap = function(mat, row_subset, col_subset, title, col_groups = NULL, file_prefix = "heatmap") { suppressPackageStartupMessages({ library(glue) library(pheatmap) library(RColorBrewer) }) # c...
879b130bf672b54ef693ca55f3cfb22728dc29a58e7351c1a8b7ccba076f497c
R
3,151
87
setwd("STARmap_AllenVISp/") library(Seurat) library(ggplot2) starmap <- readRDS("data/seurat_objects/20180505_BY3_1kgenes.rds") starmap.imputed <- readRDS("data/seurat_objects/20180505_BY3_1kgenes_imputed.rds") allen <- readRDS("data/seurat_objects/allen_brain.rds") # remove HPC from starmap class_labels <- ...
7635a8c3ba61226c771d8452e134b36fcb2d41cfdf9be500bbef054186cced57
R
3,154
93
# test_lowess_r_output.R # # Generate outputs for unit tests # for lowess function in cylowess.pyx # # May 2012 # # test_simple x_simple = 0:19 # Standard Normal noise noise_simple = c(-0.76741118, -0.30754369, 0.39950921, -0.46352422, -1.67081778, 0.6595567 , 0.66367639, -2.04388585...
ad2c777c3ed5e3590ed83fedab253bf063be9d7809a1442fef26c721a00128b3
R
3,155
95
# ---------------------------------------------------------------------------- # Libraries and setup ---- library("argparse") library("ggplot2") library("tidyverse") # Command line arguments ---- parser <- ArgumentParser(description = "Differential expression analyses") parser$add_argument('--metadata', '-m', ...
70d88c816fe14f10b572715f67a2426d06227b8f6d1fd26915882b0fa6b90d54
R
3,158
64
preprocess_mutation <- function(metadata, mutation_path, output){ # read in metadata metadata <- read.table(metadata, sep="\t", header=T) # read in annotated mutation table mutation <- read.table(mutation_path) colnames(mutation) <- c("region", "gene", "chr", "start", "end", "ref", "alt", ...
1bd7df6e6627606be1f351a1350788d52654a10169bd1719964bcd557781c6b6
R
3,161
93
library(tidyverse) library(formattable) # Setting working directory ----------------------------------------------- this.dir <- dirname(parent.frame(2)$ofile) setwd(this.dir) # This function is taken from https://github.com/renkun-ken/formattable/issues/26 export_formattable <- function(f, file, width = "100%", h...
3e3c913373fba272ca05ba21b057504f49557b1f477bbbc4e3c2502c3105406d
R
3,171
64
pred.viz.ann <- function (cur_pat){ # Interpretable, annotated visualisations of model output. # Arguments: # <cur_pat> an integer specifying the patient number # Requires: # <pred_xgb> data frame with bootstrap prediction results (output predict.XGB) # extract/init data Tout <- 180 # day number...
24dee76893461bc49f46cc404e9743956eee9007b7587669d987acd696e474cf
R
3,176
66
library(SingleCellExperiment) library(tidyverse) library(here) library(magrittr) ##### generate random seed for real data #### load(here("data","expr","Tabula_muris","facs_clean.rda")) #random sample cell types facs_obj_sce <- facs_obj_sce[,!is.na(facs_obj_sce$cell_ontology_class)] facs_obj_sce$cellid <- paste0("cell...
18d1916dba74e055cc3e4fcc68448a3452eec6e0371c365aa164c213030b7538
R
3,183
87
# AnJa/MNT segment for lifting coordintes from hg38 > hg19 # 21Aug2020 === === === ### library(rtracklayer) library(GenomicRanges) BiocManager::install("liftOver") gene_df = read.delim("GRCh38_Ensembl-93_GENES_all-33538.gene.loc",header=FALSE) colnames(gene_df)= c("GeneID", "Chr", "Start", "End", "Strand", "Symbol") ...
fd7b2b03a80f1b8e7cb8f750f172c8a60391e845d653f0e6cd1a6dd74a7cf1b5
R
3,190
86
mapMetabolomes <- function(fluxAll) { # Map metabolome data onto fluxes # # INPUT: # fluxAll: A data frame containing flux data, assumed to have an 'ID' column # OUTPUT: # A data frame containing mapped metabolome data, with associated metadata # Load metabolome data and filter based on flux results # # .. Autho...
1c4f1185a0e8c3e5456e76bb7f1c04f631fca71ddb1dbcdac13e86b623f608e5
R
3,191
82
## Plotting functions specific to FANS EWAS results ## library(ggplot2) library(viridis) library(dplyr) options(scipen=999) #remove scientific notation ESscatter_fetalVSadult <- function(df, age.group, type='Point', bins=120){ # scatter if(type=='Point'){ p <- {if(age.group=='Fetal'){ ggplot(df %>% arrange(Sign...
7fcd270eec3f901a2b909b8f173f0200e3c72a63d841c593a676c71c25fcc05b
R
3,195
90
library("DESeq2") library("edgeR") library("limma") library("tidyverse") library("PCAtools") source(file.path(".", "scripts/markers_sp1.R")) source(file.path(".", "scripts/funcs_custom_heatmaps.R")) fig5_markers <- fig_5_markers() all_markers <- unname(unlist(fig5_markers)) marker_df <- tibble(gene = unlist(fig5_mark...
a7bdd637ff09198027108da96b1891d9ba08b8b32d2e198ad0ce9bd53d43c5ab
R
3,195
98
ls.packages = c( "brms", # Bayesian lmms "tidyverse", # tibble stuff "SBC" # plots for checking computational faithfulness ) lapply(ls.packages, library, character.only=TRUE) # set cores options(mc.cores = parallel::detectCores()) # set...
bde9c5ebbff3458a32cfa1a69d1517ac3932ab4b4606962760bab39259e50fb5
R
3,198
64
#### Figure S6F #### #### Heatmap of human microglia divergent genes in SynGO database #### library(matrixStats) library(gplots) library(stringr) library(here) # human astrocyte DEGs: h_c <- read.table(here("data/microglia", "Micro-PVM_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) h_c <- h_c[h_c$padj<0.01 & ...
11ea15070656b403f39a017cc315afcbf40d23a3e10ac36c03c276acac5bd49c
R
3,200
147
library(EpiEstim) library(incidence) library(data.table) createRtColumn <- function(data) { RtTable <- t(data.frame(sapply( colnames(data)[2:ncol(data)], function(pref) { createRtValue(data, pref) } ))) colnames(RtTable) <- c("Rt", "display") RtTable <- data.table(RtTable, keep.rownames = TR...
7b5391cb160a7840e01979194902ab0b59c5cb7cda7d73722c225d7e7a1abc7c
R
3,207
108
process_micro_outcome_bulk_harmonsed <- function(i) { source("/mnt/data/lijincheng/mGWAS/result/01UVMR_immune_BBB/get_bulk_harmonised_data.R") message("input = a table containg local microbiome GWAS summary data, names including:exposures name id path") if(micro_exp$exposures[i] == "FR02") { sp <- fread(mi...
08d8a744a0928f4ff9a003f4e22f0769424a7d9c5b09b59d936f3d3161166dc9
R
3,210
130
#!/usr/bin/env R # # Author: Sean Maden # # Tests the difference in between-cell type dist for different marker sets. # # Note: this is part of the project "scprism.findtypes" # # Note: lapply() is unhappy without some placeholder arg (e.g. function() versus function(ii)) # when it is called from inside of a function,...
b7720a8eedbb5a331b43bfe07bf6c697363970e5934400ff21df55464652cbb3
R
3,218
94
# ÓÃintergenic/intronic/type II×öGO¸»¼¯·ÖÎö setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(dbplyr) library(readxl) library(stringr) library(ggprism) # coding UCR GO ----------------------------------------------------------- coding_UCR <- read_xlsx(path = "01-data/10-GO_enrichme...
0131495e6d43d03f20bcd4efd783aa20c363490e20b1f5de6c12d39bdcdaef11
R
3,222
66
## Test assocation of global DNA methylation with Age in bulk fetal cortex ## library(data.table) epicManifest <- fread(paste0(refPath, "MethylationEPIC_v-1-0_B4.csv"), skip=7, fill=TRUE, data.table=F) # Illumina EPIC manifest #1. Load data =========================================================================...
15a422c2b829fcfa3b28d34a83da63b17ad20417e90fad696306064fe373d5a2
R
3,226
84
library(tidyverse) parse_coverage <- function(file, flank_interval, average = TRUE) { f <- read_tsv(file, col_names = c("chr", "start", "end", "name", ".", "strand", "position", "coverage"), show_col_types = F) # make sure positions are strand-aware f$position[f$strand == "-"] <- (2 + flank_interval*2) - f$posit...
3dba3df1ae8065087ad907d4ddabaf1477c2bc60ba3e310fd4e7b3077cce09c2
R
3,239
92
dta <- read.table('data.dat', header=TRUE) dta$Duration <- factor(dta$Duration) dta$Weight <- factor(dta$Weight) dta$logDays <- log(dta$Days + 1) # Use log days to "stabilize" variance attach(dta) library(car) source('/home/skipper/statsmodels/statsmodels/tools/topy.R') sum.lm = lm(logDays ~ Duration * Weight, contra...
7c8fda8636385ef77c6962cbb2640942662f7885298a7bc01bd0690a42130c07
R
3,240
76
#' Render Table of Contents #' #' A simple function to extract headers from an RMarkdown or Markdown document #' and build a table of contents. Returns a markdown list with links to the #' headers using #' [pandoc header identifiers](http://pandoc.org/MANUAL.html#header-identifiers). #' #' WARNING: This func...
cd1a32866c6fbc71a1aff9f81accbdbda11c6ce2b98a9c5660021767f86d0262
R
3,241
189
prefectureNameMapJa <- c( "北海道", "青森県", "岩手県", "宮城県", "秋田県", "山形県", "福島県", "茨城県", "栃木県", "群馬県", "埼玉県", "千葉県", "東京都", "神奈川県", "新潟県", "富山県", "石川県", "福井県", "山梨県", "長野県", "岐阜県", "静岡県", "愛知県", "三重県", "滋賀県", "京都府", "大阪府", "兵庫県", "奈良県", "和歌山県", "鳥取県", "島根県", "岡...
9e2d1b49da02a002e2812c9e373837f84b72ae8eb8239dbb9936cac9d39a3a8c
R
3,243
66
options(stringsAsFactors = FALSE) library(ggplot2) library(reshape2) library(dplyr) library(stringr) library(lme4) library(lmerTest) library(RColorBrewer) library(ggpubr) library(grid) library(pheatmap) #### PTA unsupervised clustering #### df <- read.table("data/TableS3_PTA_burden.tsv", header=T, sep="\t") df$Case_I...
774907687a1dbe3b4b520a71a975cd54e5e80ac33bf20995c5bda969fdbc84a1
R
3,244
89
# Normalization and Scaling using Seurat # CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project # Isabel Castanho (icastanh@bidmc.harvard.edu) # July 2022 # Based in the Seurat Tutorial by the Sajita Lab # activate conda environment in ITHACA # conda activate use_seurat_r4 # Open R # R s...
e0e61292bc7260810a32bb5fadf50d6abba79c1a210e697c1ea1179f84978169
R
3,247
103
# setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) setwd(".") list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv) library(Seurat) library(qs) library(foreach) library(Signac) library(ClustAssess) objects_folder <- file.path(project_folder, "objects", "R", "seurat") qc_folder <- file.path...
838b4c1f0fb1d60c504fd9035a753bf4e0a97a89d241edbdcc0fa981cffe8357
R
3,248
91
# ============================================================================= # 疾病样本质控脚本 # ============================================================================= # 功能:读取疾病样本(Dys_fascia)的10X数据,创建Seurat对象,进行质控过滤 print("Hello world!") rm(list = ls()) # 加载配置文件 source("../config.R") # 设置工作目录 setwd(ENV_DIR) lf <-...
8e28552a9784f73ff4e55e0736cf6916856c271d73e8f8249e2642ad4ce9e39a
R
3,253
85
args=(commandArgs(TRUE)) var1 <- args[1] var1 options(echo=FALSE) setwd(args[2]) filename <- paste("all",var1,".txt",sep="") myData <- read.table(file = filename, sep="\t", header=FALSE) colnames(myData) <- c("Gene_Expr", "Tumor_Type", "Group") myData$`Tumor_Type` <- as.character(myData$`Tumor_Type`) myData$`Tumor_T...
a33fde3ae08bed3079516409b85ea74e7778cf79b85526ea9d0e009c02f2e288
R
3,254
87
# load libraries library(tidyverse) library(data.table) library(Matrix) library(Rfast) library(matrixStats) library(ggridges) library(reticulate) library(anndata) # source functions source("/inkwell05/ameer/functions/0_source_functions.R") # our purpose is to compute and save cross-expression profiles (p-values and c...
c7fa88bd8fd2a9e3b1e66328a701f366700bf32a68f3cd001c9d41e8701236b1
R
3,256
123
--- title: "DP01 Create Seurats" author: "Daniel Zucha" date: "2025-04-22" output: html_document --- Hi, In this markdown we will load the published data and create seurat objects as deposited by Alsema et al 2024. ```{r libraries} library(Seurat) library(tidyverse) library(qs2) ``` Load Samples and create individ...
b4a71bd17c024cf1cbb2aba106192ee0d3dfc23c94fc43aa44f83e3e7b3b89bd
R
3,260
65
#### Figure S5B #### #### Heatmap of human astrocyte divergent genes in SynGO database #### library(matrixStats) library(gplots) library(stringr) library(here) # human astrocyte DEGs: h_c <- read.table(here("data/astrocytes", "Astro_human_vs_chimp_sig_genes.csv"), sep=",", header=TRUE) h_c <- h_c[h_c$padj<0.01 & (h_...
bd643f8c94f0fa585194b1d81db1622108fc925f54de36ab1abf19939f3495eb
R
3,263
88
options(max.print = 1000) options(stringsAsFactors = FALSE) options(scipen = 999) library(data.table) library(openxlsx) args = commandArgs(trailingOnly=TRUE) # bam file name, class annotations ## load class annotations class_anno <- read.xlsx(args[2]) rownames(class_anno) <- gsub(" ", ".", gsub(":", ".", gsub("-",...
69b1fd54785c77fcfde9102e325098aa6c2b04148587ab991b6be179cf2dee7a
R
3,265
94
library("SingleCellExperiment") library("Matrix") library("dplyr") library("here") library("sessioninfo") library("scater") library("org.Hs.eg.db") #### load Mathy's data ##### ## read in data mathys_dir <- "/dcs05/lieber/marmaypag/legacySingleCell_Tran_Maynard_Neuron_2021_LIBD001/Mathys/" list.files(mathys_dir) pd ...
c9cc82050b95c431828fcd8994f9d2668d2b0f696ebf95b9f601cbdc1e04ed2c
R
3,270
117
## ## Replacement for DESeq2::plotPCA() with sample labels and custom condition colors. ## Sample names will be shown next to each dot with minimal overlap. ## The axis will display proportion of variance for each principal component. ## Tested using DESeq2 versions 1.12 to 1.26. ## deseq2_pca = function(object, intg...
4c51c951b1b1c34c619439bb230676ea88be2c898ac350e7e682f5284cb26af5
R
3,271
86
#!/usr/bin/env Rscript #### Fine cell type annotation of B cell subset for MBM_sn #### Author: Jana Biermann, PhD library(dplyr) library(Seurat) library(ggplot2) library(gplots) library(viridis) '%notin%' <- Negate('%in%') path.ct <- 'data/cell_type_DEG/MBM_sn/bcells/' filename <- 'MBM_sn_bcells' seu <- readRDS('da...
eb48a02f9e1d88165622644b613d1ba87548dc86c77286877f445870a392064c
R
3,271
95
#Install and load packages required_packages <- c("networkD3", "htmlwidgets", "dplyr", "tidyverse", "webshot", "jsonlite") for (pkg in required_packages) { if (!requireNamespace(pkg, quietly = TRUE)) install.packages(pkg) library(pkg, character.only = TRUE) # Load package (with messages) } #Required data df <- r...
5eb807973eb4a7a58dac1fdc384a3ae0bd7a817d94426ed47e9f65992e79407e
R
3,280
85
library(tidyverse) library(ggrepel) set.seed(123) corticali3_kinetic <- read_tsv("processed/2023-08-22_i3cortical_slamseq_grandr_kinetics.tsv") # ranks GW corticali3_kinetic %>% mutate(hl_rank = rank(desc(log2FoldHalfLife)), synth_rank = rank(desc(log2FoldSynthesis))) %>% arrange(synth_rank) %>% View() ...
3165a7e7649ad952fdcd0e90fc6cfa746893470a0f139180e00fb577559fb028
R
3,287
112
# 14 Jan 2024 # make Fig 3A/B # init #### library(readxl) library(ggplot2) library(RColorBrewer) library(reshape2) # load data #### df_raw_Fig3a <- read_excel("Fig_3a.xlsx") df_to_plot <- df_raw_Fig3a colnames(df_to_plot) <- c("Gene", "CW20107", "KOLF2.2J", "CD-14") df_to_plot <- melt(df_to_plot) colnames(...
704fd854bc94f3495dffbfc4d47c6d5a8e0a56f6a4ce340a84f408123ed9c5d1
R
3,293
118
# 25 May 2022 Siwei # merge new (May 2022) + old (Jun 2021) MG batch data # init library(readr) library(plyr) library(dplyr) library(stringr) library(Rfast) library(ggplot2) library(RColorBrewer) # load data ASoC_df_raw <- read_delim("DP20_data_files/non_500bp_intersected/MG_28_lines_merged_peaks_filtered_03J...
5309fbbe9ead0b5d321e41bf1bb5274763f67d75a6e06bb6175690eaff153de9
R
3,303
85
library(dmrff) options(mc.cores=4) source("functions.r") ## construct a random dataset set.seed(20180220) n.sites <- 1000 n.samples <- 100 manifest <- generate.manifest(n.sites) dataset <- generate.dataset(n.samples, manifest) ## show methylation correlation structure r <- sapply(2:nrow(dataset$methylation), functi...
eb0866ff3569eec18df861f5368228d4150484b467740efe548e00f5d9098c05
R
3,311
102
#----------------------------------# # Fit DESeq model for standard # # differential expression analysis # #----------------------------------# library(DESeq2) # Read Data --------------------------------------------------------------- # DDS object with gene-level quantification dds <- readRDS("results/DESeqData...
11aed2e5b4e917a2561c020894ae372a6f869a6a514c8e0cb7a1a4a6573b7996
R
3,318
85
######################################################################### ######################################################################### ### Perform Principal Component Analysis by Multi-Dimensional Scaling ### ######################################################################### ########################...
dce05e082d3bf61f3a44b07a234673e10526e7fe96d005139b702c4ae09769b5
R
3,319
88
# Aggregate single cell expression to pseudobulk expression by cell type and patient # In each case, only keep genes with min. 10 cells with real expression values options(java.parameters = "-Xmx32g") # to write excel sheets library(Seurat) library(parallel) library(xlsx) cellTypeGranularity = "cell_type_int" minNum...