sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
0e547f36e0551a66ceb26e3eb2bbf5bb3083798939e67244076ac31dbefebd1b | R | 6,255 | 114 | ### Give a list of VMR, map them to overlapping genes
Methylation_genes <- function(vmr_list){
coordinates <- t(sapply(vmr_list, function(x) {
parts <- unlist(strsplit(x, split = "[.]"))
return(list(chr = parts[1], start = as.integer(parts[2]), end = as.integer(parts[3])))}))
coordinates_df <- as.data.frame... |
c1fa6ca3d25e7ca798c76b033deb2eee67de222624e55e6e7f3b7334dcd81047 | R | 6,258 | 137 | # participantStatistics.R
#
# Description:
# This script calculates and formats summary statistics for participant data, grouped by sex
# and across the entire cohort. It produces mean, standard deviation, and sample counts for
# various demographic and cognitive variables, as well as statistical comparisons be... |
d174af2d8914b26ecff2167c055aae021a83aee2868c1212ca2798476a089538 | R | 6,270 | 173 |
#' Tidy up DESeq2 results table for analyses of enrichment
#' Removes low count genes (those filtered out by DESeq's independent filtering) & ensures 1 row per gene
clean_deseq_df <- function(df, padj_col = "padj", id_col = "gene_name") {
# Remove genes with NA padj - i.e. too low counts for stat testing &/ fil... |
8be38a801867f578f4f5ab84aceb6f7c1c14214080dc6055c646a8bfbf7b04bb | R | 6,279 | 132 | dev <- FALSE
if(dev) {
library(openxlsx2)
# get all meta data
meta_data <- openxlsx2::read_xlsx(file = "./data/Database/SampleMasterfile.xlsx",
sheet = 1,
skip_empty_rows = TRUE)
# get the grouped datasets
grouped_data <- openxlsx2::re... |
0e13e09158fd525d9880af0f3f6272cda9c7fc10bd855761f95edc1aa8b43cc7 | R | 6,284 | 196 | ---
title: "Identifying differentially methylated regions using dmrff"
output:
pdf_document: default
word_document:
highlight: tango
html_document:
toc: true
---
# Identifying differentially methylated regions using dmrff
## Download and prepare an example DNA methylation dataset
We'll use a small cord... |
32af1593f4172a6df5f8ced223a9e7570bb4c342751aff07716ff44ec7f61a19 | R | 6,298 | 159 | predict.XGB <- function (dat_train, new_dat, X, grd, nb = 200, alpha = 0.20, seed = 137985){
# This function computes point predictions for individual patients based on an
# ensemble of bootstrap models. It accepts a dataframe with multiple
# measurements, but only the latest measurement for each model will be u... |
4107c3ede41daf2a5fcc7e9d719ba84dce1ccc7ffe912561688fa6ce4727af81 | R | 6,299 | 192 | # 09 Nov 2023 Siwei
# sample GABA, nmglut, and npglut neurons
# Use 2000 cells per type each
# init ####
{
library(Seurat)
library(Signac)
library(readr)
library(future)
library(parallel)
library(ggplot2)
library(RColorBrewer)
library(stringr)
}
plan("multisession", workers = 2)
options(expressions = ... |
9ffc30965c2d6d4465cbd1ac88e4e5bfc644e869033a923136668cb88ba7b068 | R | 6,309 | 143 | ---
title: "R Notebook of rV2 manuscript figure 1 plots"
output: html_notebook
---
```{r Packagies}
library(tidyverse)
library(Seurat)
library(Signac)
library(qs)
library(viridis)
library(future)
source("../../AuxCode/AuxFunctions.R")
```
```{r Set parameters}
threads <- 6
plan("multisession", workers = 8)
plot_loc <... |
1c472383874d99b7db461f5af5fc6f04f2546d36b73f31f9ba9dff51f9e088a2 | R | 6,315 | 197 | ---
title: "Preprocessing Ctrl"
author: "Anne Hoffrichter, Eric Poisel, Lea Zillich"
date: "2021/11/23"
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)
```
```{r loadL... |
a6ace5aa3e9aae4ea6a19db5a6c1f2c3d461c3ebce7e3086ff5f4af4087ca096 | R | 6,318 | 151 | # PlotGenome_noxy
#
# Plot Allelic ratio along the genome for duplication detection.
# @param orderedTable The variable containing the output of the MajorMinorCalc function
# @param Window An odd number determining the window of the moving average plot, usually 151
# @param Ylim The plot y axes maximal limit, usually 3... |
df0f4432e9eee70057a847678f1361f3d5751e2aff49500d0d33f3ce99dc163d | R | 6,321 | 129 | ### import library
library(lmerTest) # for multilevel analysis
library(emmeans) # for post-hocs
library(ggplot2) # for interaction plots
### set data path, please set your data path here
# DataPath <- "***/Fig04_HCxEC_DE_FisherZ"
### For good trials-----------------------------------------------------... |
01fc879046dcb5c572f6ec84452d6b07a1d6435e1077cb3a42f375c743a3039d | R | 6,326 | 157 | # Siwei 29 Mar 2024
# Plot CLU1 SNP rs1532278
# 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... |
b85863e530e9234564d164fe180640cf422a5ce8762706f1638097f02a706ef9 | R | 6,328 | 125 | # function for plotting rs2027349 site
# revised from plot_anywhere
# Use OverlayTrack to combine data tracks
plot_AsoC_peaks <- function(chr, start, end, gene_name = "",
mcols = 100, strand = "+",
x_offset_1 = 0, x_offset_2 = 0, ylimit = 400,
... |
41af843bab96b5917adfbee23a6a0c6ae2fbafdb556c902f482d075d5aedf962 | R | 6,332 | 125 | # function for plotting rs2027349 site
# revised from plot_anywhere
# Use OverlayTrack to combine data tracks
plot_AsoC_8_peaks <- function(chr, start, end, gene_name = "",
mcols = 100, strand = "+",
x_offset_1 = 0, x_offset_2 = 0, ylimit = 400,
... |
18e3f44dbe7628fb20d36ddad20dbdb11e2e4e7bddc2ba267ca470c0a95fec00 | R | 6,337 | 205 | output$TableOfEachPrefectures <- renderDataTable({
# dt <- dt[count > 0] # TEST
dt <- totalConfirmedByRegionData() # [count > 0]
# 0の値を非表示するため、NAに設定るす
columnName <- c("today", "doubleTimeDay")
dt[, (columnName) := replace(.SD, .SD == 0, NA), .SDcols = columnName]
displayColumn <- list(
"region" = i18n$... |
f5a82c0a55a52f458fabed8b2a6e9c6213f4a1191ebd656c5b22e984401dcd58 | R | 6,340 | 197 | ---
title: "Preprocessing Mild"
author: "Anne Hoffrichter, Eric Poisel, Lea Zillich"
date: "2021/11/23"
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)
```
```{r loadL... |
67675cb51f0e05ed36aed3269ce56d644f9a7c377a3753d7c4374302f10b05a0 | R | 6,364 | 204 | # annotate the distribution of type I UCRs: exonic & intronic?
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(ggprism)
library(ggsci)
library(ggview)
library(ggalluvial)
library(readxl)
library(cowplot)
lwd_pt <- .pt*72.27/96
exonicUCRs <- read.... |
1fb5427953b6b8ed2a1b06d6095fc015c5bfbbb87b54c90c65c6acc0f60e68eb | R | 6,366 | 194 | #OPEN LIBRARIES
```{r}
library(kronos)
library(tidyverse)
library(ggplot2)
library(corrplot)
library(gprofiler2)
```
# IMPORT DATASET
```{r}
library(readxl)
bigdata_pd60_HPC <- read_excel("/Users/mariareinacampos/Documents/00_MASTER/TFM/Resultats/Results_PD60_HPC/bigdata_pd60_HPC.xlsx")
bigmeta_pd60_HPC <- read_exc... |
8dce69bdab4dcf415a820cf6d9a9a85205eaf57f3eb407599b351038588c3a8d | R | 6,369 | 86 | library("googlesheets4")
info <- read_sheet(
"https://docs.google.com/spreadsheets/d/1bld6g-7MN2G18b8hwXEkC0dDOhWlzmFTAmpcPYdgXjI/edit?usp=sharing",
"Sheet1"
)
info <- info[seq_len(42), ] ## Drop the extra rows with info
stopifnot(max(table(with(info, paste(Section, "_", Combination)))) == 1)
jhpce <- c(
"raw-da... |
3531323e5255c359232cb79e9d5c604a83ef3f74782cd1adbe8152d8a071b0f1 | R | 6,372 | 129 | ###############################################
###############################################
### Volcano Plot of Proteins in Top 5 Terms ###
###############################################
###############################################
# load required packages
if (!require("BiocManager", quietly = TRUE)) {install.... |
c5fb266e771261b6aaec70220429bd14ee87179053a8823d00a6be6a5049e044 | R | 6,374 | 195 |
library("tidyverse")
# library("miQC")
library("flexmix")
library("here")
library("sessioninfo")
#### Set-up ####
plot_dir <- here("plots", "03_HALO", "10_flexmix")
if (!dir.exists(plot_dir)) dir.create(plot_dir)
#
load(here("processed-data", "00_data_prep", "cell_colors.Rdata"), verbose = TRUE)
#### Load RNAscope ... |
a0936bc4d54eac77c92c60ecbefd75088a0b0772d4e5251630951f8b4311f730 | R | 6,376 | 204 | # Siwei 16 Jan 2024
# plot fig. 6b
# init ####
library(ggplot2)
library(RColorBrewer)
library(readxl)
library(stringr)
# function to plot excel-type quantile #####
xl.type.whisker <-
function(d) {
xl_median <-
stats::quantile(d,
probs = c(0.5),
type = 6,
... |
2a1766bd103d0be1b058728c41f881f57578d3f2bb4e1908c3476a20a69c30a8 | R | 6,378 | 188 | ---
title: "iCLIP Intron enrichments in features"
author: "Michael Rauer"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
rmd: "iCLIP.introns_analysis.Rmd"
output:
html_document:
code_folding: hide
df_print: paged
fig_caption: yes
number_sections: yes
tables: yes
toc: yes
toc_float:... |
b9e2fc3fdc7a9b2c7dc58036ddef13dd96649ab64404e8e754a41f4f1a9f05aa | R | 6,387 | 151 | #Analysis of Tabula muris data set - split the data by donor ID
##### 1. load packages and data#######
###load packages
if (!require("here")) {
install.packages("here")
library("here")
}
if (!require("magrittr")) {
install.packages("magrittr")
library("magrittr")
}
if (!require("tidyverse")) {
install.packag... |
fd054f470254b1ab97692b6cf187830f9dc5d7ed31cbe0c9cec3a37de9cd5ac4 | R | 6,399 | 235 |
DEG_185_agg <-
DGEList(counts = agg_185_samples,
# genes = rownames(agg_185_samples),
# samples = colnames(agg_185_samples),
group = agg_185_metadata$rs561655_G_A,
remove.zeros = T)
# table(filterByExpr(DEG_185_agg))
# DEG_185_agg <-
# DEG_185_agg[filterByExpr(DEG_185_agg)... |
0cf8be84adf7225e16d7122402020e720e300b42b6fe5ad628a4d77c19148854 | R | 6,405 | 201 | library(data.table)
library(tabulizer)
#### Update vaccine data by prefecture ####
# Define data path
data_path <- "50_Data/MHLW/vaccineByRegion.csv"
# Read exist data
vaccineByRegion <- fread(data_path)
# Define origion
definition <- list(
# 医療従事者等は、令和3年7月30日で集計を終了。
# list(
# category = "medical",
# ur... |
f91b8aa2a5b25a905a70625262890cf3ec0fdac0dac81365d32c840ccc25bf86 | R | 6,412 | 149 | #' Plot a region
#'
#' dmrff.plot
#'
#' Calculate statistics for a set of genomic regions.
#'
#' @param region.chr/start/end Genomic region to plot.
#' @param estimate Vector of EWAS effect estimates
#' (corresponds to rows of \code{methylation}).
#' @param se Vector of standard errors of the coefficients.
#' @param me... |
faf8f0edf8efafd083540fe22e03f3127f8e7d29d92358557ea633c225b33cb5 | R | 6,413 | 143 | # AIM ---------------------------------------------------------------------
# perform the new cleaning after the exploration of the NEU subcluster
# LIBRARIES ---------------------------------------------------------------
library(scater)
library(Seurat)
library(tidyverse)
library(robustbase)
# library(SeuratData)
lib... |
cf0b41afd466d78c7734b28ed51355c16445fd736c594731c90532d1792d8f5a | R | 6,423 | 135 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(readr)
library(plotrix)
library(GenomicRanges)
library(scales)
library(data.table)
#### mobile element alu sub family
####################
#### mobile elements
mle <- fread("../UCSC_hg38_repeatMasker.tsv", data.table = F)
mle <- mle[mle$repFamily == ... |
d44362c50f6e04c08ecb89035128d6000518c9f0e21eb4cfa7d9741f86fc35c6 | R | 6,427 | 160 | #!/usr/bin/env Rscript
#gratefully stolen from github
library(tidyverse)
#' Parse sample from file names
#'
#' Sample names are parsed from file names without the extension. If the file name is not unique,
#' the parent directory is used.
#'
#' @param files file name with path
#'
#' @return A vector
#'
#' @author ... |
8f83c4f2dc383844cd5fdb0d97536b1f7d0725021f42979fc9a1eefc71217eac | R | 6,431 | 140 | #!/usr/bin/env Rscript
### title: Differential pathways compared between MBM and MPM tumor cells
### author: Jana Biermann, PhD
library(hypeR)
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(DropletUtils)
library(msigdbr)
library(scales)
library(viridis)
library(plyr)
library(ggrastr)
library... |
7a7cf62d44fff49c4db449bb8419eac8cf007205340ed6ceacef73cd60a20045 | R | 6,447 | 144 | 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")
DefaultAssay(starmap.imputed) <- "RNA"
gen... |
674cba01fe02085ddb8c58b080c4eeedd63362230b6db40638df83966bad7419 | R | 6,448 | 216 |
# Function to detect delimiter
detect_delimiter = function(filepath) {
# Read the first line of the file
first_line = readLines(filepath, n = 1)
# Check for common delimiters
if (grepl("\t", first_line)) {
return("\t")
} else if (grepl(",", first_line)) {
return(",")
} else {
stop("Unknown del... |
e0964af8faae3966b3f4bc43436e13b7e38ecfe0359107579b03fc107a04ee56 | R | 6,455 | 174 | ---
title: "scRNA-seq data preprocessing for _seismic_ input"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{scRNA-seq data preprocessing for seismic input}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comm... |
f3f77d4fde368cfbe293f4ddd9ce26c5ba6b9321755a06d632fc6a5a0d9c8a6d | R | 6,455 | 173 | library(tidyverse)
#' Calculate nucleotide proportions across positions from a wide-format position-frequency matrix (output of get_position_nucleotide_frequency.py)
#'
#' @description
#' Takes a position frequency matrix in tibble format and calculates nucleotide
#' proportions across all positions. Optionally filt... |
70b145592fab742fe786c5390aef95ea4c9e10f348fb5ea04f08bfb8c90a0419 | R | 6,473 | 112 | get_UVMR_collected <- function(inputpath = inputpath,
outpath = outpath,
outfilename = outfilename)
{
message("inputpath = /path to UVMR results of all individual features/ ")
message("outpath = /path to where to collect all the results into one xlsx file/... |
5d6e8e85dc507a1cf596767fe50af1e61d97d29220860ab38898f5ac86dbe2ba | R | 6,478 | 197 | ## dmrff and CpG site correlation
Here is common question about `dmrff`:
> My EWAS identifies several regions filled with
> CpG sites all weakly associated with my variable of interest.
> Why does dmrff identify some but not all of them
> as differentially methylated regions?
The short answer is that the regions that... |
5e536862c6b80b54f4e30d3aaf03b7747bfdc49364d4b82e4d7afdf119fefc15 | R | 6,481 | 232 | #' DeletionTable
#'
#' Intersect the observed SNPs with the common SNPs table from dbSNPs, Creates file with the LOH data called Deletions.txt
#' @param Directory The Path of to the BAM Directory, containing the variantTable.csv file
#' @param Table The variable containing the output of the MajorMinorCalc function
#' @... |
ce1efb03d8d37db67e18109a9291617df8455c0e4ec436eb0bfc4b3201243580 | R | 6,487 | 146 | #!/usr/bin/env Rscript
### title: Load results of slideseq-tools pipeline for pucks 5-8, and convert to
### Seurat rds format author: Yiping Wang date: 09/27/2021
library(Seurat)
library(ggplot2)
library(patchwork)
library(dplyr)
library(SingleR)
library(SingleCellExperiment)
library(scater)
library(pheatmap)
library... |
dea06c6fca7d1916a8aeccb12e47fdca9a008850734dec142f860cc7e836a801 | R | 6,500 | 164 | # library -----------------------------------------------------------------
library(tidyverse)
library(fgsea)
library(msigdbr)
library(GSEABase)
library(patchwork)
# prepare the dataset with all the annoration needed ----------------------
# locate the files
# file <- dir("out/") %>%
# str_subset(pattern = "res_")... |
6aaa0cbb2a5c9799ba0ab3485c01d3bcf3e5c8093cad335ebdfb4b32f7f92a9f | R | 6,508 | 236 | # 06 Nov 2023 Siwei
# sample GABA, nmglut, and npglut neurons
# init ####
{
library(Seurat)
library(Signac)
library(readr)
library(future)
library(parallel)
library(ggplot2)
library(RColorBrewer)
library(stringr)
}
plan("multisession", workers = 2)
options(expressions = 20000)
options(future.globals.... |
ed932e9d8ab5714aad4beb4e665a26f30be4529b50167ea607ebffa7cdbb8741 | R | 6,509 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
f554c3ede0cf729e03fd062b562d726346fd185a5c6c098c57104a141785d0e8 | R | 6,509 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
84703cd191c31ace9e1fb8b3c6214325e005e63a7abf089362f6d359c7ffe9d0 | R | 6,515 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
ee69512bd180f843767741b324261c25b3c0051d24dc84d54610aca103633f64 | R | 6,515 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
5ef32672a947d3d0b089d1767c9db5b18ebd3c3f128ac02e79ea883822ceac94 | R | 6,518 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
e2c8edcab412d11a362d564b1fd0b68867ebe576f43bac3db37a410f1a5f3a0c | R | 6,518 | 208 | # get human/mouse type III UCRs nearest upstream and downstream protein coding genes
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(readxl)
library(stringr)
library(ggplot2)
library(ggview)
library(cowplot)
mouseUCRs <- read.table(
file = "02-a... |
c3e47f09d6721243dc54af34f51a011e490e723a6fd1dae4686519a939592b47 | R | 6,519 | 230 | # the overlap relationship of type I UCRs and as genes
# get the bed file of exonic UCRs, intronic UCRs, AS genes and chr length
# plot circle plot by TB-tools
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(readxl)
library(circlize)
lwd_pt <- .pt... |
126bc60b8e78bc4a699030cea0cd192d0e9350df465831b4e216bb2e01d55f06 | R | 6,521 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
5adccb598736476379b1e8e2b1690052b9f77cd55da6b0dca60c399598e80497 | R | 6,521 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
4eebdbbef7727d83df0aaad2c301127a90b3920b29a2cf08d4326fdb58f8646e | R | 6,524 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
8db1ce9a81aaa73e9c0d8f033e1a9e7d7b56b38c51b97e0ef43bacced5d5c603 | R | 6,530 | 143 | # Run CellChat to explore cell-cell communication - major cell types (continued)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# March 2024
# https://github.com/sqjin/CellChat
## Tutorial: https://htmlpreview.github.io/?https://github... |
bb21136307dcf9c7c066800d14fc65e9d6848d5f3a7f5ee336b85f368bc865a9 | R | 6,533 | 214 | # library
library(zoo)
library(gplots)
library(stringr)
library(data.table)
library(optparse)
# Parse options
## Set up command line argument parsing
option_list = list(
make_option(c("--vcfdir"), type="character", default=NULL, help="Directory containing vcf files", metavar="directory")
)
## Parse the command lin... |
e8d29e45be19267f948c23517d29855351ec506e3fb2a68e0e11d1a9c5f3ad30 | R | 6,539 | 121 | library(Seurat)
library(dplyr)
library(monocle)
library(cowplot)
library(ggplot2)
library(viridis)
library(RColorBrewer)
bg<-theme(panel.grid.major =element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(),axis.line = element_line(colour = "black"))
xbg<-theme(axis.text.x = element_text(an... |
0cdb76c1583b80fa046e569bd79e19ff2e36d9ec456cd08bec8ed5d705aaef96 | R | 6,540 | 197 | ---
title: "Preprocessing Severe"
author: "Anne Hoffrichter, Eric Poisel, Lea Zillich"
date: "2021/11/23"
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)
```
```{r loa... |
fdc110fb9f55b65a9d3a74102dfca7250fc2b1ce836efad983387cd599f48df9 | R | 6,541 | 149 | # Combine DEXSeq output tables with last exon metadata generated by PAPA
# Copyright (C) 2024 Sam Bryce-Smith samuel.bryce-smith.19@ucl.ac.uk
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... |
a96126b82e6ffcc81d03343d244103eff11181ae252633a02292dd69d2982a21 | R | 6,562 | 142 | library(infercnv)
library(ComplexHeatmap)
library(RColorBrewer)
library(ggplot2)
color = c(brewer.pal(9, "Set1"),brewer.pal(8,"Set2")[1:8],brewer.pal(12,"Paired")[1:12],brewer.pal(8,"Dark2")[1:8],brewer.pal(8,"Accent"))
celltype.color = brewer.pal(8,"Set2")[c(4,2,3,1)]
celltype.color = c("#DB6260","#B4B13E","#336AAD","... |
ab151be1390f01879ca94e20f557abed294849533375caf993f22e0f140bf145 | R | 6,562 | 186 | library("ComplexHeatmap")
# pseudobulk heatmap (for figure 4f and 5c-h) ----
# deseq2_fpm ----
deseq2_fpm <- function(pseudo, cats, group_by, offset = 1, out_fname = NULL){
dds1 <- DESeq2::DESeqDataSetFromMatrix(countData = pseudo,
colData = cats,
... |
9948e0e1e390cb0fbd020193ea79d128917dc5b457ebeb7bc14d028ef7b07c6d | R | 6,572 | 170 | #!/usr/bin/env Rscript
#### Seurat analysis using CellBender output with sample name provided as argument
#### Author: Jana Biermann, PhD
print(paste('Start:', Sys.time()))
library(dplyr)
library(Seurat)
library(purrr)
library(DropletUtils)
library(SingleR)
library(celldex)
library(SingleCellExperiment)
library(scat... |
5140177e9ba479c845ab64b7390e14c418e136b254c57600d8a9aeeb60b3b2d3 | R | 6,573 | 206 | # Extract Microglia only, of the 185 Sun et al samples.
{
library(stringr)
library(Seurat)
library(parallel)
library(future)
library(glmGamPoi)
library(edgeR)
library(data.table)
library(readr)
plan("multisession", workers = 3)
# options(mc.cores = 32)
set.seed(42)
options(future.globa... |
84d620a61a4a45126752e60dfbaf0a16d20693bf2d2c7556f6171f1478152560 | R | 6,576 | 171 | library(tidyverse)
# read in formatted NYGC metdata used for analysis, plotting
nygc_metadata <- read_tsv("processed/nygc/NYGC_all_RNA_samples_support_formatted.tsv")
# raw metdata (for )
raw_nygc_metadata <- read_tsv("data/nygc/NYGC_all_RNA_samples_support.tsv")
# extract gender for each individual
indiv_gender <- ... |
4f18e0966a65602cc922ba4ddaf435e9b7c14f75193d36332be99a4c979b54c5 | R | 6,580 | 234 | # Siwei 11 May 2023
# Process all MGs (May 2022 + May 2023)
# init
library(readr)
library(vcfR)
library(stringr)
library(ggplot2)
library(parallel)
library(MASS)
library(RColorBrewer)
library(grDevices)
# load the table from vcf (the vcf has been prefiltered to include DP >= 20 only)
df_raw <-
read.vcfR(file = "... |
b44f8f234f341f43db1e83993a81dba36faa889ca130add06b835db85524730b | R | 6,583 | 225 | # Siwei 31 Jan 2025
# plot Fig. 6b
# init ####
{
library(readxl)
library(stringr)
library(ggplot2)
library(scales)
library(reshape2)
library(RColorBrewer)
library(ggpubr)
library(ggridges)
library(dplyr)
library(data.table)
library(DescTools)
library(multcomp)
library(gridExtra)
libr... |
e0903f6bbc25bd6d8c15d0b0b423d0f44826d33d7839b8f3a1f1c0fcb97da832 | R | 6,585 | 163 | ```{r}
# enucleation data for controls and experiments
suppressPackageStartupMessages(library(xfun))
pkgs = c("SingleCellExperiment","tidyverse","data.table","dendextend","fossil","gridExtra","gplots","metaSEM","foreach","Matrix","grid","spdep","diptest","ggbeeswarm","Signac","metafor","ggforce","anndata","reticulate"... |
9c225e22a1c5e8ee16717d5c79814e3de3109782797369af85f2db1be7954992 | R | 6,587 | 207 | # followed tutorial from:
# https://ryjohnson09.netlify.app/post/how-to-make-a-heatmap-in-r/
# Set-up ------------------------------------------------------------------
# load libraries
library(tidyverse)
library(magrittr)
library(gplots) # makes pretty correlation plots
library(viridis) #nice color palette
library ... |
b2d7585199779fd7a5d508662535815b8a4dc81e7e61cf6c4851a51fb21c71a6 | R | 6,601 | 142 |
calc_spec_two_comp <- function(sce, assay_name = "logcounts",
ct_label_col = "idents", min_uniq_ct = 2,
min_ct_size = 20, min_cells_gene_exp = 10,
min_avg_exp_ct = 0.1) {
ct <- N <- nz.count <- ave_exp_ct <- NULL # due to non-stan... |
11cc4cca5ce4cd3f63af14ce0b444c6a5c8e93de6be49f79ab2ce4a766a50671 | R | 6,604 | 179 | library(Seurat)
library(scCustomize)
library(dplyr)
library(tidyr)
set.seed(1234)
snRNA <- readRDS(file = "MAST_round1/snRNA_final.RDS")
table(Idents(snRNA))
snRNA_glia <- subset(snRNA, idents = c("Oligo", "OPC", "Astro", "Micro"))
snRNA_neuron <- subset(snRNA, idents = c("Exc_upper", "Exc_int", "Exc_deep", "Inh"))
c... |
ebc6753a5d6b382d3208fffdb6c1a32786f85e926d8fb59745ac65003a9434ec | R | 6,607 | 121 |
## Boxplot script for lifecourse ##
plotBoxes <- function(res, pheno, betas, plot.column, res.column, p.age=NULL, i, colourBy, colours=NULL, pchBy=NULL, gene=NULL, chr=NULL, subsetTo=NULL, subsetToCol=NULL, cexAxis=1.7, cexMain=1.8, cexLab=1.5, pch=16, ablinePos=40, ylim=c(0,105), extraDetails=TRUE, inter=FALSE, int... |
146ba993dcb98313546b9b22a1625a0eee3b2a98a665aa6ab2a5f2d4cc26f37d | R | 6,625 | 128 | ---
title: "EIB_behavioural_dprime"
author: "Barbara Cassone"
date: "AUTOMATIC"
output: html_document
---
```{r echo=FALSE, message=FALSE}
if(!require("pacman")) install.packages("pacman")
library(pacman)
p_load("reshape2","ez","dplyr","lme4","lmerTest", "rmarkdown", "lattice", "ggplot2", "DACF")
select <- ... |
57ca962061fc0d8069844797ebf841a2f872d55420a95f99048a78a765fa3814 | R | 6,630 | 154 | ```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(WVPlots)
library(clue)
library(tidyverse)
library(dplyr)
library(tidyr)
library(ggplot2)
library(ggExtra)
library(cowplot)
theme_set(theme_cowplot())
library(corrplot)
library(visreg)
library(ggcorrplot)
library(ggseg3d)
library(ggseg)
library(scale... |
0a9af43e7a57d977c67bd650d20f9969da39108da36768decd36140331d8392a | R | 6,638 | 249 | #' DeletionTable
#'
#' Intersect the observed SNPs with the common SNPs table from dbSNPs, Creates file with the LOH data called Deletions.txt
#' @param Directory The Path of to the vcf Directory
#' @param Table The variable containing the output of the MajorMinorCalc function
#' @param dbSNP_Data_Directory The path fo... |
aa3bb2e3e054e4d7db25fe76d325c50c590d1f2aaf8ca5f818dc89cadc84c002 | R | 6,642 | 178 | get_UVMR_exp_mediator <- function(dat = dat,
outcome = "",
outpath = "")
{
source("/mnt/data/lijincheng/mGWAS/result/02MRBMA/MRBMA_function/function/seven_mr_res.R")
source("/mnt/data/lijincheng/mGWAS/result/02MRBMA/MRBMA_function/function/r... |
79e23956585850ba857b04a2c27547cb45a82b82a977e4bb100f22f17d95c882 | R | 6,644 | 145 | ---
title: "upset"
author: "Allie"
date: "8/5/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
#Load dependencies
library(dplyr)
library(UpSetR)
library(ggplot2)
library(reshape2)
library(RColorBrewer)
library(ggrepel)
library(reshape)
sessionInfo()
```
R... |
693ec58ef072eea71ba26fe122e349397ddb7c2cea149be753788a5de9a0e27d | R | 6,645 | 234 | # Siwei 26 Jul 2023
# Adjust vcf tranches to 99.9 to solve rs2027349 absence
# in new sequencing output issue
# Siwei 21 Jun 2023
# Process all NGN2s (FASTQs trimmed and the original NGN2-20
# + from 2019)
# note the sample names are complex, need processing (NGN2 and R21)
# Jun 2023
# init
library(readr)
library(vc... |
2469ec61de4f7244af4aa0af67250080690202843ea3995afd937f76d0e7850a | R | 6,647 | 198 | # SNPs Pathogenicity Scores Distribution Visualization
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(ggplot2)
library(stringr)
library(ggview)
library(ggprism)
library(sysfonts)
library(showtext)
library(data.table)
lwd_pt <- .pt*72.27/96
font... |
e6bd9d0ef696dca2057221846f2c2df3de30ab01c990393fe257611d1c787a83 | R | 6,654 | 203 |
library("tidyverse")
library("scales")
library("patchwork")
library("here")
library("sessioninfo")
#### Dir Set-up ####
plot_dir <- here("plots", "03_HALO", "11_HALO_hex_plots")
if (!dir.exists(plot_dir)) dir.create(plot_dir)
#### Load Data ####
load(here("processed-data", "03_HALO", "halo_all.Rdata"), verbose = TRU... |
74f3723068aaefd792c9267b8a44f0369d020981ca71945e47388114035abf63 | R | 6,655 | 167 | library(Seurat)
library(parallel)
library(limma)
library(dplyr)
library(ggplot2)
library(scales)
dataPath = "data/"
SupplFigure4File = "Figures-and-Tables/Suppl-Figure-4-non-integrated-log2fold-changes.png"
minNumCells = 10
cellTypeGranularity = "cell_type_int"
numCPUs = 10
infile = paste0(dataPath,"seurat-allSample... |
6e72f7e35c7d8ac8f36e7915b6c3c6767bf65e2ccf80bfd02dce966efff5db09 | R | 6,662 | 199 | library(tidyverse)
library(ggVennDiagram)
source("scripts/utils_liu_facs.R")
nygc_summ_ale <- read_tsv("processed/nygc/expression_by_pathology_ale_all.tsv")
nygc_sel_ale <- nygc_summ_ale %>%
filter(selective)
liu_min5_all <- read_tsv("processed/liu_facs/2024-11-22_liu_facs_median_delta_5.delta_ppau.all_samples.cryp... |
1d1a7b20dd9185c8f0374b66517c92411a54dfdbaf1d3e17e37b23756146e086 | R | 6,668 | 129 | # function for plotting rs2027349 site
# revised from plot_anywhere
# Use OverlayTrack to combine data tracks
plot_AsoC_fine_dtails <- function(chr, start, end, gene_name = "",
mcols = 100, strand = "+",
x_offset_1 = 0, x_offset_2 = 0, ylimit = 400,
... |
6866bbdc258f04b3f94385037693fd0f19ec2a59724544af5a36227e163e6b2f | R | 6,678 | 130 | ---
title: "20240514_HumanSC_Neurons_LogTransformation"
author: "Yuanming Liu"
date: "2024/5/14"
output: nl_document
---
# sessionInfo()
# R version 4.3.1 (2023-06-16)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Rocky Linux 8.7 (Green Obsidian)
# Matrix products: default
# B... |
7651699d09c837c0725a3c0fce0ca3526e8ea44fc7bbdf13776d329334f51668 | R | 6,689 | 247 | # Siwei 21 Sept 2023
# Merge Steffi's 4 libraries by Seurat
# put all h5 files under ./h5_input/ like below:
# > h5list
# [1] "h5_input/CD_IgG_filtered_feature_bc_matrix.h5"
# [2] "h5_input/CD_PDL1_filtered_feature_bc_matrix.h5"
# [3] "h5_input/MCD_IgG_filtered_feature_bc_matrix.h5"
# [4] "h5_input/MCD_PDL1_filtered_f... |
74be810e983b33edb72a41b5ad3c023ef699fa53775c86b8cf5eecbf2bfcdf75 | R | 6,690 | 214 | output$comparePrefP1 <- renderEcharts4r({
pref <- input$comparePref
dt <- compareDataset()
dt %>%
e_chart(日付) %>%
e_line(
速報陽性累積,
name = i18n$t("速報値:陽性者数"),
itemStyle = list(color = darkRed),
symbol = "circle",
symbolSize = 1
) %>%
e_line(
陽性者,
name = i18n... |
7b00a037406e4620263640348172aea1d1fc3a82aa7b282866f39cb12815426e | R | 6,694 | 226 | # ¶ÔÓÚlncRNAµÄÑо¿£¬ÎÒÏëÓ¦¸ÃÏÈÔ¤²âһϵ°°×±àÂëÄÜÁ¦
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(Biostrings)
library(stringr)
# get ncRNA UCR related ncRNA bed
ncRNA_UCR <- read.table(file = "02-analysis/16-New_classification/ncRNA_UCR(66)_ensembl_id.txt", sep = "\t")
ncRNA_UCR ... |
16cf0619c9f20292d22aa5dea5047e400637a707bb6bbd81bdcc4ac448de375e | R | 6,711 | 128 | library(fpp)
library(forecast)
library(gdata)
options(digits=16)
# Simple exponential smoothing
oildata <- window(oil,start=1996,end=2007)
oil_fpp1 <- ses(oildata, alpha=0.2, initial="simple", h=17)
oil_fpp2 <- ses(oildata, alpha=0.6, initial="simple", h=17)
oil_fpp3 <- ses(oildata, h=17)
oil_ets <- forecast(ets(oilda... |
931611b676a47561468fe30c36ef682a7bf3ca8b0096f86a13b29049142333fa | R | 6,714 | 177 | # libraries ---------------------------------------------------------------
library(tidyverse)
library(enrichR)
library(scales)
library(patchwork)
# run enrichr with the list of genes in the module
# DB selection ------------------------------------------------------------
dbs <- listEnrichrDbs()
# filter fo the db of... |
53421d12a945e52f8f8992b22daa2d18e28aeb081c77b7eaa8d5993f7a192951 | R | 6,716 | 168 | # Differential expression analysis using Seurat - MAST AD/CTRL, AD/RES, RES/CTRL (cell types)
# CIRCUITS Multiregion single-nucleus RNA-seq data - single cell resilience project
# Isabel Castanho (icastanh@bidmc.harvard.edu)
# July 2022
# Based in the Seurat Vignettes by the Sajita Lab
# activate conda environment in... |
ca88a5f534d74fbde1d3064c721a3e586de4646becd81677ea836d0419c6d149 | R | 6,718 | 146 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(readr)
library(plotrix)
library(GenomicRanges)
library(scales)
library(data.table)
#### mobile element LINE sub family
####################
#### mobile elements
mle <- fread("../_Bank_files/UCSC_hg38_repeatMasker.tsv", data.table = F)
mle <- mle[mle$... |
809496459e90bb7d7e3b656fdc9e784b4e39b811613d8fa950f7228e9f47c006 | R | 6,727 | 179 | # libraries ---------------------------------------------------------------
library(tidyverse)
library(enrichR)
library(scales)
library(patchwork)
# run enrichr with the list of genes in the module
# DB selection ------------------------------------------------------------
dbs <- listEnrichrDbs()
# filter fo the db of... |
bca8b694f4a6c5cacaa5cdd01073e42de3d15633a4e7ad703f357c01c50a3805 | R | 6,740 | 156 | library(data.table)
DATA_PATH <- "Data/"
# =====SIGNATE データ処理=====
provinceCode <- fread(paste0(DATA_PATH, "prefectures.csv"))
# svgIcon <- fread(paste0(DATA_PATH, 'svg.csv'))
# clusterPlace<- fread(paste0(DATA_PATH, 'SIGNATE COVID-2019 Dataset - 接触場所マスタ.csv'), header = T)
signateDetail <- fread(paste0(DATA_PATH, "S... |
169588cf2be6515b535e4767ed660cfc496da4af010a74b30538589eccd89cc3 | R | 6,741 | 157 | # Reference values for PyMARE's rma.uni-equivalent output.
#
# Covers the whole of what rma.uni reports and PyMARE also computes: the
# fixed-effect inference path under each of metafor's three `test` settings
# (which is PyMARE's small-sample correction), the tau^2 estimate itself, the
# heterogeneity statistics, and ... |
c87a6665fbf2fab26c6d4cc799016f5198042e60fc64da8e8bac99c28455e2ec | R | 6,761 | 197 | ---
title: "Preprocessing Moderate"
author: "Anne Hoffrichter, Eric Poisel, Lea Zillich"
date: "2021/11/23"
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)
```
```{r l... |
8ffeea52e29fec1839d6897922741e7b37a38c548260289cabeed8ecc8de9a7f | R | 6,762 | 188 | library(Rtsne)
library(tidyverse)
library(twice)
library(ggpubr)
theme_set(theme_bw(18))
data("hmKZNFs337")
# set the path to your expression raw count data
read_rds_files <- function(file_path){
file_list <- list.files(path = folder_path, pattern="\\.rds$", full.names = TRUE)
for (file_path in file_list){
... |
16c27bf3d68bd6a69d596b4a4a9ecf402c05e841e4787c05faf049f99ab2e7de | R | 6,767 | 160 | ```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(WVPlots)
library(clue)
library(tidyverse)
library(dplyr)
library(tidyr)
library(ggplot2)
library(ggExtra)
library(cowplot)
theme_set(theme_cowplot())
library(corrplot)
library(visreg)
library(ggcorrplot)
library(ggseg3d)
library(ggseg)
library(ggseg... |
6594e2d55aa472a8e3cdb874f9f09fbb775ad3584e8ffcacbe16b9b3aae006b3 | R | 6,770 | 198 | # AIM ---------------------------------------------------------------------
# this script will split the object as requested. in particular we are focussing on the CA samples only. In one object put all the cells from CA and the IMM cells called as senescent by SIT, in the other object the same cells, but the
# libra... |
656963e74dfc299763efb5b6aaef9773db1e1fd3b0e776dbe7e0e5d10c40f7b5 | R | 6,774 | 142 | ---
title: "Doublet Detection"
output:
html_document: default
pdf_document:
latex_engine: xelatex
date: "2025-07-07"
author: "Lauren Rylaarsdam"
---
Multiplets occur when two or more cells receive the same molecular identifier. High doublet rates can
complicate analysis as they dilute cell type-specific methy... |
17c67313526ac3e9b94a9d3bc3f156dd2d9f5a01a43985ceb6c02f6081a58bcc | R | 6,776 | 145 | #########################################################
#########################################################
### Identification of Striatum Enriched Gene Pathways ###
#########################################################
#########################################################
# load required libraries
if ... |
12db1fac37262222c2699f2625b69749cc9fd673668461e203ccc97a8d3df199 | R | 6,787 | 193 | get_six_UVMR_from_bulk_outcome <- function(dat = dat,
exposure = "",
outcome = "",
outpath = "")
{
source("/mnt/data/lijincheng/mGWAS/result/02MRBMA/MRBMA_function/function/seven... |
535b6f28af45bd7c7ddfa3858bf3c565a73f09a4337275e3393bd71454b0d54c | R | 6,795 | 221 | # Extract Microglia only, of the 185 Sun et al samples.
{
library(stringr)
library(Seurat)
library(parallel)
library(future)
library(glmGamPoi)
library(edgeR)
library(data.table)
library(readr)
plan("multisession", workers = 3)
# options(mc.cores = 32)
set.seed(42)
options(future.globa... |
760f92f6bbdd39a5f1deec2dc1169caf940e2f0d9c9feb325a9a6fb119234867 | R | 6,800 | 199 | ```{r}
library(Seurat)
library(dplyr)
library(schard)
library(svglite)
```
```{r}
# Download atlas data and metadata using python according to these instructions: https://alleninstitute.github.io/abc_atlas_access/descriptions/WMB-10Xv3.html
meta <- read.csv('metadata/WMB-10X/20231215/views/cell_metadata_with_cluster_a... |
d7d2765e77ca4c2033cea4fdff1c9c11e3f06dc458abd7a69753f94252871014 | R | 6,802 | 127 |
## Characterise and refine nonlinear probes identified with GPMethylation ##
library(data.table)
library(ggplot2)
library(gridExtra)
#1. Load data used in GPMethylation =============================================================================================
load(paste0(dataPath, "FetalBrain_Betas_LOOZ_EX3_no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.