sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
39d919e45f500337833e89359c23205cc250bd3a703914828bd6288028bf4091 | R | 4,156 | 86 | #### Figure S19 ####
#### Human gene expression divergence of synaptic compartments and processes across consensus cell types ####
library(stringr)
library(reshape2)
library(ggplot2)
library(here)
# syngo:
syngo_terms <- read.table(here("data/syngo_analysis", "syngo_terms_id.txt"), sep="\t", header=TRUE)
syngo_genes... |
4f911c22a5b6ff59404826c28fb96c16000fddb49676cb12236e4a5f6daf87cf | R | 4,156 | 142 | # make disease/gene group plots
# Siwei 16 Mar 2022
# init
library(ggplot2)
library(readr)
library(RColorBrewer)
library(stringr)
##
raw_data_df <-
read_delim("df_load.txt", delim = "\t",
escape_double = FALSE, col_names = FALSE,
trim_ws = TRUE)
diseases_list <-
read_csv("disease_order.t... |
6b773220a6c1094a84011c03a702f5a68b68a298a6c2445997ba22ba44c50e32 | R | 4,163 | 80 | tabPanel(
# PCR検査数推移
title = i18n$t("PCR検査数の推移"),
icon = icon("vials"),
value = "pcr",
fluidRow(
column(
width = 8,
tags$br(),
fluidRow(
column(
width = 4,
sliderInput(
inputId = "testDaySpan",
label = i18n$t("移動平均時間間隔"),
mi... |
716c0a39f17c5fe59b0d6eefccf5bb97780e7c291f8e3ee08610d87b5a88d474 | R | 4,170 | 125 | #!/usr/bin/Rscript --slave
# example_IHI_processing_script.R
# 20th October 2025
# Modified: 20th October 2025
# Author: Richard G. Carson (richard.carson@tcd.ie)
#################
# load the necessary libraries
library(car)
library(correlation)
library(rms) # for orm() function
library("PResiduals") # for presid(... |
ba691e8b0c91ae38ae489a78d7554e7261e0879ba44d88d8669f3ac1ce23c074 | R | 4,170 | 130 | # -----------------------------------------------------------------------------
# Visualization of classification results for adjusted methylation profiles
# -----------------------------------------------------------------------------
dir.create("plots")
# Set to TRUE to plot scores for methylation class (MC), methy... |
37ae4590bad8199148ab8c9261502b1792f02527c0b6b4c8a6a021ae15bab41c | R | 4,186 | 98 | #!/usr/bin/env Rscript
args <- base::commandArgs(trailingOnly=TRUE)
base::suppressMessages(expr = {
library(DropletUtils)
library(dplyr)
library(ggplot2)
})
.reorder <- function(vals, lens, o) {
out <- base::rep(vals, lens)
out[o] <- out
return(out)
}
# Source barcodeRanks (DropletUtils R package)
# E... |
48f1015dcd3bd9ec39a9c4b0f5451f65fdee69a1e1eb826b7e09be97e58a5e65 | R | 4,187 | 105 |
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... |
253a5c5e99fde27fc99d0ab085e235a1deea48fb1aef0e4e03503366d5bdc808 | R | 4,198 | 110 | #!/usr/bin/env Rscript
#### Baseline for integration analysis (raw) and LISI score
#### Author: Jana Biermann, PhD
library(Seurat)
library(dplyr)
library(ggplot2)
library(ggrastr)
library(gplots)
library(lisi)
library(tidyr)
library(magrittr)
library(viridis)
library(scales)
colBP <- c('#A80D11', '#008DB8')
colSCSN ... |
de6269826f49969627fdefe7c5b4b6153955fc2ebb56a8297d11b5b1dc65fbe2 | R | 4,198 | 150 | add_label_attr <- function(dend) {
labelDend(dend)[[1]]
}
labelDend <- function(dend,n=1)
{
if(is.null(attr(dend,"label"))){
attr(dend, "label") =paste0("n",n)
n= n +1
}
if(length(dend)>1){
for(i in 1:length(dend)){
tmp = labelDend(dend[[i]], n)
dend[[i]] = tmp[[1]]
... |
ccb68b97a0ece488fe8280cbaeb5fff36725d4d96432b857179cc6065d245d91 | R | 4,201 | 156 | # Siwei 19 Sept 2024
# Import scRNA-seq data of GSE254025
# found another source of raw_h5ad, claimed to be annotated
# Check the expression of PICALM in risk vs non-risk cells
# also compare Alena's iMG snRNA-seq with GSE254025's HOMEO, LDAM, DAM populations
# run hierachical clustering
# init ####
{
library(Seurat... |
471c1119ce1bb4fc7df16eaaafafd981c71f292023c9904ab873d50f1faf0dd5 | R | 4,203 | 107 | 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, "... |
4bf29fff5941bab7ada7a9f69716a42ab7999b2a24016b8f8de5b091d9b5f22a | R | 4,204 | 137 | fluidPage(
# Component.Notification(
# status = "danger",
# context = paste0(
# "当サイト使っているサーバーの性能が限られているため、一部のキャッシュをブラウザーに保存しております。",
# "画面表示がおかしくなったり、数値が更新されていない場合はリロードまたはキャッシュをクリアして再度アクセスしてください。",
# )
# ),
# メイン部分、Valueboxを含むなど
source(
file = paste0(COMPONENT_PATH, "/Main/FirstRow.... |
f9f4bd51805d351be286bbce4ba1c7758760486f5cc9e55a0d5e2d9540b683ac | R | 4,204 | 113 | # Run as: Rscript generate_results_samplesize_rank_compare_onetail.R --output_path path/to/results_samplesize_rank_compare_onetail.csv
if (!require(rankFD)) {
install.packages("rankFD")
library(rankFD)
} else if (!require(argparse)) {
install.packages("argparse")
library(argparse)
} else if (!require(data.table... |
235422d4881e7f5527fe1c2c2daed8c4297ab5466ad6acbc91164a7717376f48 | R | 4,206 | 108 | #This part of the code references the harmonise_data function of the TwosampleMR package and the Linkage Disequilibrium information information of 1000G(http://grch37.rest.ensembl.org/documentation/info/ld_id_get and http://rest.ensembl.org/documentation/info/ld_id_get), as well as the functions by Jianfeng Lin(https:/... |
676d452052e8c40034bdf8ea9aae0348a318519a1f7e5ae4d202b1d289b573fd | R | 4,207 | 64 |
system("bedtools intersect -a \
output/liftover/dunnart_promoter_50bpsummits_annotation_smiCraTOmm10.bed \
-b output/filtered_peaks/E15_cluster1_peaks.narrowPeak -wo > \
output/liftover/E15.5_mm10intersect_dunnart_promoter_50bpsummits_annotated.bed")
system("bedtools intersect -a \
output/liftover/dunnart_promoter_50b... |
96507d6827f5e8abc10d6e76b6227f42b93320e1854f54e4c8f112dad6211e7c | R | 4,216 | 136 | library("hspe")
library("SingleCellExperiment")
library("jaffelab")
library("tidyverse")
library("here")
library("sessioninfo")
library("spatialLIBD")
task_id = as.integer(Sys.getenv("SLURM_ARRAY_TASK_ID"))
set.seed(task_id)
marker_label <- "MeanRatio_top25"
sce_path = here(
"processed-data", "08_bulk_deconvoluti... |
caa1a86315b099e373f5b70aa053641c7109b3cb7dac2a3c1c822112f64f6f66 | R | 4,219 | 103 |
## Compare mean DNA methylation at the start of early fetal, the end of mid-fetal, and adult ##
library(data.table)
library(pbapply)
library(ggplot2)
library(viridis)
'%ni%' <- Negate('%in%')
avDNAm <- function(x){
return(mean(as.numeric(x)))
}
#1. Load data ====================================================... |
70adcb268991486931d2a72548ad1da0b830645be0db549b26cda39358fb6913 | R | 4,222 | 93 | setwd("osmFISH_AllenVISp/")
library(liger)
library(hdf5r)
library(methods)
# allen VISp
allen <- read.table(file = "data/Allen_VISp/mouse_VISp_2018-06-14_exon-matrix.csv",
row.names = 1, sep = ',', stringsAsFactors = FALSE, header = TRUE)
allen <- as.matrix(x = allen)
genes <- read.table(f... |
6b0a2c2f1eb4231f4d31e2206be804533139c8f4523ec2e4cb4ef8aaf5b02f51 | R | 4,228 | 112 | #' Get variant info from UK Biobank imputed genotype MFI files
#'
#' @description For a given set of genomic coordinates (position in build 37) get the UK Biobank imputed genotype variant IDs from the MFI files.
#'
#' @return A data frame of variants with added "ukb_rsid" column (also returns alleles, MAF and INFO)
#'
... |
58937d95f360c3276694c049dff339be10714f5ce0d3fd4860479fa85e756880 | R | 4,236 | 93 | options(stringsAsFactors = FALSE)
library(ggplot2)
library(reshape2)
library(dplyr)
library(stringr)
library(lme4)
library(lmerTest)
library(RColorBrewer)
library(ggpubr)
library(pheatmap)
library(grid)
library(parallel)
library(MutationalPatterns)
ref_genome="BSgenome.Hsapiens.UCSC.hg19"
chr_orders=c(paste("chr",1:22,... |
f6380a530c93158450cebc18ac479d1d7bbd3ddca528914ac5d5e5ce64aa54b1 | R | 4,236 | 145 | # Siwei 07 Mar 2024
# plot FRiP sumstats of 5 cell types
# init ####
library(readr)
library(ggplot2)
library(RColorBrewer)
library(stringr)
library(reshape2)
library(plyr)
# load raw data ####
df_raw <-
read_delim("FRiP/FRiP_sumstat.sumstat",
delim = "\t", escape_double = FALSE,
col_name... |
e275596920c05a7cb0f776fe748a60ff9ed8936120dfb1599c41656a33ba1959 | R | 4,249 | 85 | #' Reject option classification
#'
#' @description Reject option classification is a postprocessing technique that gives
#' favorable outcomes to unpriviliged groups and unfavorable outcomes to
#' priviliged groups in a confidence band around the decision boundary with
#' the highest uncertainty.
#' @param unprivilege... |
7580c488ba4bb9951e5409487a3ec92f22a91c854f53972db1fa820fc92eef9c | R | 4,258 | 105 | groupFluxes <- function(fluxesPruned){
# groupFluxes identifies and groups metabolites with identical flux distributions based on near-perfect correlations.
#
# USAGE:
# results <- groupFluxes(fluxesPruned)
#
# INPUTS:
# fluxesPruned - A data frame of metabolite fluxes, with columns representing metabolites
# ... |
4a565a6e85f36debe4f9252128939a112f686d6025858d5c62c23cfb99530e91 | R | 4,259 | 102 | ###################################################################
###################################################################
### Generate Scaled Heatmap of Top 25 DEGs for Each Comparison ###
###################################################################
#################################################... |
9dad1b7573dfd00197edb6d9f700e62cd44dc1534641833c8f6d2d079943ca9d | R | 4,259 | 134 | source(
file = "global.R",
local = TRUE,
encoding = "UTF-8"
)
shinyServer(function(input, output, session) {
source(file = paste0(COMPONENT_PATH, "Main/NewsList.server.R"), local = T, encoding = "UTF-8")
source(file = paste0(COMPONENT_PATH, "Main/Tendency.Discharged.server.R"), local = T, enco... |
5cf58c007b6e8f706762baf2d52c680fcef1ff1a642258f79eb7e5542ce292d3 | R | 4,267 | 122 | if (!require("reshape2")) {
install.packages("reshape2")
library("reshape2")
}
if (!require("here")) {
install.packages("here")
library("here")
}
if (!require("magrittr")) {
install.packages("magrittr")
library("magrittr")
}
if (!require("scran")) {
if (!requireNamespace("BiocManager", quietly = TRUE))... |
ecaadf20553cb0a3b0a1aabf13957d96f0f351b6fe1796789f0ec8d0114af035 | R | 4,267 | 121 | #!/usr/bin/env Rscript
#### Title: DEG, heatmap and signature scores of our MBM/ECM tumor signatures on xenografts
#### Author: Jana Biermann, PhD
library(dplyr)
library(ggplot2)
library(gplots)
library(singscore)
library(DESeq2)
library(RColorBrewer)
library(pheatmap)
library(viridis)
library(reshape2)
library(ggpu... |
ee753661f95ab08ec53a767ed8595e9155a9cdfa7576cb7c8c4a34fe065ba4a1 | R | 4,273 | 105 | # ----------------------------------------------------------------------------
# Libraries and setup ----
library("argparse")
library("Seurat")
library("tidyverse")
# Command line arguments ----
parser <- ArgumentParser(description = "Differential expression analyses")
parser$add_argument('--seurat', help = 'Seurat ... |
7b9b7a0ae34bd5873da59f4488684b0c5f43afda300d7dbe572700fe99db2a9b | R | 4,283 | 138 | # 在之前的19个物种(包括human,不包括mouse和rat)的基础上增加15个物种
# 文昌鱼 七鳃鳗 日本鲎 小型狗鱼 大白鲨 尼罗罗非鱼 大西洋鳕鱼 虹鳟
# 青蛙 平塔岛象龟 缅甸蟒
# 斑胸草稚 家鸽 鹦鹉
# 海豚
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(stringr)
UCR_location <- read.table(file = "01-data/UCR_raw/UCR_location_refseqid.t... |
b51cb4ddb74541f3cde8d16b088d2100bfb83b92056d52b4b78460d9bca7570c | R | 4,291 | 107 | ---
title: "Integration - full experiment"
author: "Anne Hoffrichter, Eric Poisel, Lea Zillich"
date: "2022/02/11"
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)
```
... |
c3d8bf85d1b49ca776e4e6ddd4146594a7dff9061837bf01b17087c7b0bb8d04 | R | 4,293 | 91 | #----02_variables_and_exp_info_v01_single_experiments---------------------------
#-------------------------------------------------------------------------------
# Locomotor activity analysis for Reinhard et al. 2025 (10.1073/pnas.2506164122)
#
# Requirements:
# 1)scripts:
# 01_setup_v01
# 2)variables:
... |
ae24caae4e3be592860bfb576a734b2e11d0d95cad5aad14b2ac01bc430ebf6c | R | 4,295 | 111 | #########################################################################
#########################################################################
### Perform Principal Component Analysis by Multi-Dimensional Scaling ###
#########################################################################
########################... |
3ef23068702ca6d79f9965aeb23f09824e44e29cd8a268e6db908c676d25b312 | R | 4,296 | 93 | setwd("STARmap_AllenVISp/")
library(liger)
library(Seurat)
library(ggplot2)
# allen VISp
allen <- read.table(file = "data/Allen_VISp/mouse_VISp_2018-06-14_exon-matrix.csv",
row.names = 1, sep = ',', stringsAsFactors = FALSE, header = TRUE)
allen <- as.matrix(x = allen)
genes <- read.table(... |
55d196dabe8177bfb5d8aa30521273c28b5dccdae1a95506dba18c5845bb8fcc | R | 4,300 | 105 | pred.vizC <- function (cur_pat){
# Design C: Ystar histogram on outside of ARAT recovery plot.
# Arguments:
# <cur_pat> an integer specifying the patient number
# Requires:
# <pred_xgb> data frame with bootstrap prediction results (output predict.XGB)
# <dat_plot> long format data frame with all a... |
bf3178978b22f39433916ec56db9374fbd70112386575e0f1000760d8ba9796a | R | 4,301 | 152 | ---
title: "R Notebook of rV2 manuscript figure 2"
output: html_notebook
---
```{r Packages, echo=FALSE}
library(tidyverse)
library(Seurat)
library(Signac)
library(qs)
library(rtracklayer)
library(gUtils)
source("local_settings.R")
```
```{r Set parameters}
cores <- 6
region.of.interest <- "chr6-88188000-88250000"
``... |
2a9019ad4235411df3c42f30c0ba24687e5efbd98b61aafad03c7d2dc5df045f | R | 4,305 | 109 | install.packages("Seurat")
install.packages("harmony")
install.packages("SingleCellExperiment")
library(Seurat)
library(dplyr)
library(harmony)
library(ggplot2)
library(SingleCellExperiment)
setwd("E:/005---ThirdProject/ThirdObject/0.RealData/")
# 1. Load raw matrix
raw_matrix <- read.table("ESCC/GSE199... |
cd8cf890173fbaf10b7223920e75aba05f3c570462a616dc65fd516f684a2184 | R | 4,305 | 94 | options(stringsAsFactors = FALSE)
library(ggplot2)
library(reshape2)
library(dplyr)
library(stringr)
library(lme4)
library(lmerTest)
library(RColorBrewer)
library(ggpubr)
library(pheatmap)
#### META-CS ds/ssIndel spectrum robustness ####
cutoffs <- c("a2s1S1","a3s1S2","a4s2S3","a5s2S4","a6s3S5","a7s3S6","a8s4S7","a9s... |
496be71c22cf495a318c9d94b5bf3fb73faf36cb11680dff4879c296d1c506c9 | R | 4,317 | 120 |
library("SummarizedExperiment")
library("tidyverse")
library("EnhancedVolcano")
library("here")
library("sessioninfo")
library("ggrepel")
#### Set up ####
## dirs
plot_dir <- here("plots", "09_bulk_DE", "07_DE_plots")
if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE)
## load colors
load(here("process... |
0b42be0262fee2e741ac8b3949453342d189ec2232a308b95aedfc6132d831cb | R | 4,323 | 140 | Sys.setenv(VROOM_CONNECTION_SIZE='100000000')
require(optparse)
require(tidyverse)
require(clusterProfiler)
require(BiocParallel)
##### FUNCTIONS #####
load_ontologies = function(msigdb_dir, cosmic_genes_file){
ontologies = list(
"reactome" = read.gmt(file.path(msigdb_dir,"c2.cp.reactome.v7.4.symbols.gmt")... |
58a28b1196e0b79c70e93fde3bcf961df0057e4839ff4c75197aaa7355dc87c8 | R | 4,327 | 63 | library(reshape2)
library(dplyr)
chrom.state = c("E",paste0(c(1:22,"X","Y"),"T"),paste0(c(1:22,"X"),"M"))
combine.DE = readRDS("../../combine.aneuploid-vs-E.GLMM.DEG.result.rds")
combine.DE = combine.DE[which(rowMax(as.matrix(combine.DE[,c("pct1","pct2")]))>0.1 & rowMax(as.matrix(combine.DE[,c("log.mean1","log.mean2")... |
23fd89a9355727947919e4962cb08887645817d90feca73b79c680056ce47e3d | R | 4,333 | 104 | ### 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
source("/mnt/data/lijincheng/mGWAS/result/02MRBMA/MRBMA_function/... |
cfc5aa96496957ceadb3ec8283aa7faa2b03fbc2bdd5c9457b5db8febdb489a5 | R | 4,333 | 108 | # Standalone script to export tracks to IGV-compatible formats
# Load required libraries
library(tidyverse)
library(Seurat)
library(Signac)
library(qs)
library(rtracklayer)
library(gUtils)
library(GenomicRanges)
# Set parameters
cores <- 6
# Load the rV2.data object
rV2.data <- qread("../scATAC_data/nmm_rV2_subset_... |
ea64ff046681431facdf4c61ce222dca8bad3bd4cc3e89115057f389502da527 | R | 4,336 | 143 |
```{r}
library(dplyr)
library(tidyr)
library(readr)
library(EZbakR)
library(data.table)
library(ggplot2)
library(nls2)
```
```{r}
# Function to estimate half-life using weighted regression
estimate_half_life_weighted <- function(data,
time_col = "tl",
... |
db53b7f1a284283affa87c856a4b4247459016e5dd2e033256dff1a956fe8707 | R | 4,337 | 132 | library("SummarizedExperiment")
library("tidyverse")
library("sessioninfo")
library("here")
library("readxl")
library("ggrepel")
library("jaffelab")
library("plotly")
## prep dirs ##
plot_dir <- here("plots", "02_quality_control", "02_bulk_qc_plotly")
if (!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE)
... |
8af3cf93d5f22faabcfd58bdf3e4556a8388cb8b31e80f6d4d07230e48972f46 | R | 4,338 | 95 |
## Annotate EPIC manifest with gene lists ##
library(data.table)
library(tidyr)
uniqueAnno <- function(row){ if(is.na(row)){row=''}; if(row != ""){ return(paste(unique(unlist(strsplit(row, "\\;"))), collapse = ";")) } else { return(row) } }
#1. Load gene list files ================================================... |
88eb0b20c3005372777fb22733a6a4d7f53c8b6e0f16630635e9b1eb0c78527a | R | 4,340 | 123 | #!/usr/bin/env Rscript
# =========================================================================
# Script: atac_diff_analysis_consensus_in_r.R
# Author: Alireza Ghahramani
# Contact: aghahram@uwo.ca
#
# Purpose:
# 1. Load all sample MACS2 narrowPeak files
# 2. Merge/union them to create a consensus peak set (BED)... |
a1ebcd0a2273beb8bfce1ca92ddc9380873cc41e352e5bb30b29156403461451 | R | 4,340 | 87 | # Load matrices ####
withoutDropout <- read.csv("../data/francesconi/francesconi_withoutDropout.csv", row.names = 1)
withDropout <- read.csv("../data/francesconi/francesconi_withDropout.csv", row.names = 1)
dca <- read.csv("../data/francesconi/francesconi_dca.csv", row.names = 1)
magic <- read.csv("../data/francesc... |
3c0320c7e199a10e534fa7feef80e4a496302ffead4cd3a2d42f93aec5c78c5e | R | 4,348 | 112 | # AIM ---------------------------------------------------------------------
# perform the new cleaning "hard" cleaning to see if I can get rid of all the problematic cells
# LIBRARIES ---------------------------------------------------------------
library(scater)
library(Seurat)
library(tidyverse)
library(robustbase)
... |
64ec388da6531a6269deaf8293e5d39a315fb8965b405a6b17e8d634b4431f73 | R | 4,351 | 76 | library(lavaan)
## UKB
UKB <- read.csv(".csv") # This file contains demographic information, and the cognitive test results from the 11 tests included to estimate a latent g factor
UKB$cog_trailB_log[which(UKB$cog_trailB_log == 0)] <- NA # prepare cognitive test data
UKB$cog_prosmem[which(UKB$cog_prosmem == 2)] <- 0
U... |
21c5b9143afe1170794e29b00cf1ee11697bab9471235fdc9ab788e231c09f77 | R | 4,352 | 142 | #!/usr/bin/env R
#
# Upset plot summaries of marker gene sets using upsetR. This reads in outputs from
# (1) scran::findMarkers() and (2) DeconvoBuddies::get_mean_ratio2(), performs light preprocessing,
# then outputs marker gene lists and upset plot figures.
#
# Note, method (1) returns all available genes ranked, s... |
76eaf3a22ea8685b60844bda8498db805115be51c808d68418c21171dcca806d | R | 4,353 | 148 | # Siwei 01 Mar 2024
# plot TSS sumstats of 5 cell types
# init ####
library(readr)
library(ggplot2)
library(RColorBrewer)
library(stringr)
# load raw data ####
df_raw <-
read_delim("tss_sumstats/tss_sumstat.sumstat",
delim = "\t", escape_double = FALSE,
col_names = FALSE, trim_ws = TRUE)... |
19283acf35edd6b17036d53336407b7acd88e6841e4c679de50c40483eeed1be | R | 4,356 | 103 | #' Calculate statistics for the second-tier projection
#'
#' Calculate statistics for the second-tier projection
#'
#' @param seu Modified query Seurat object from \code{mapToMB()}.
#' @param group.by Name of one metadata column to group cells by.
#'
#' @return A matrix of 154 rows. Each column corresponds to one gr... |
e60f1a70b94736a33e9ee8ae44407d0260aaaf9b5a2d5c7913df16042ae888f0 | R | 4,359 | 92 | # UCR×óÒíºÍÓÒÒí£¬ÒÔ¼°Ëæ»úƬ¶ÎÉÏpathogenic SNPµÄÊýÁ¿ºÍ³¤¶ÈµÄ±ÈÀý
rm(list = ls())
setwd(dir = "D:/R_project/UCR_project/")
library(tidyverse)
library(ggplot2)
library(reshape2)
# ×¼±¸UCR flankºÍrandom fragmentsµÄbedÎļþ --------------------------------------
# ×¼±¸UCR flankµÄbedÎļþ
UCR_location <- read.table(file = ... |
6cde39183e7e3c9c34436995cc36e050f089b56c1631fe23174e65bd71e78fe9 | R | 4,360 | 130 | ---
title: "Plot muliplexing results"
author: "C-M Svensson"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
rm(list = ls())
knitr::opts_chunk$set(echo = TRUE, fig.width = 12, fig.height = 12)
library(dplyr)
library(latex2exp)
library(tidyverse)
library(ggplot2)
library(readx... |
a87e303410c224a9e6c4f898ba5cde654a1383262515ec812f2c5a380eaf6541 | R | 4,361 | 132 | #####
# Script for training of the MARLIN classifier,
# as in Steinicke, Benfatto, et al., manuscript in preparation
#
# The neural-network architecture is composed of three fully connected layers:
# the input layer has input size 357,340, equal to the number of high-quality CpGs sites of the reference cohort.
# the fi... |
defe39811f6372d839dc0e8fdd51bb3196bf5d40ca60f2162ad282398f5e9d35 | R | 4,364 | 140 | # ²é¿´UCRÏà¹ØµÄcoding geneÔÚ³ýÈËÀàÒÔÍâµÄÆäËûÎïÖÖµ±ÖеÄexp pattern
# »æÖÆÈÈͼ£ºÖ÷Òª¹Ø×¢³öÉúǰºóAS»ùÒòµÄ±í´ï
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(pheatmap)
# rat ---------------------------------------------------------------------
# ÏȶÁÈërat coding genes
rat_coding_UCR... |
0a889cb76b6a5503bc61a507b033d3ecd08ad21698a2a785f373dfd861a96f67 | R | 4,365 | 127 |
# install.packages("hspe_0.1.tar.gz")
library("hspe")
library("SingleCellExperiment")
library("jaffelab")
library("spatialLIBD")
library("here")
library("sessioninfo")
## get args
args = commandArgs(trailingOnly=TRUE)
marker_label <- args[1]
marker_file <- NULL
## not using txt list of marker genes, methods needs n... |
7251be49264be3954a7b1d9a77b222eeaa71d8301162bb97895fa147c26472f3 | R | 4,366 | 121 | # Project Title: Selective retroactive and proactive memory enhancement: insights from over 600 participants
# Scripted by Leo Chenyang Lin, Boston Unviersity, June 4, 2024. Correspondence: clin25@bu.edu
library(reshape2)
library(dplyr)
library(pwr)
library(ggplot2)
library(hrbrthemes)
library(dplyr)
library(tidyr)
li... |
0d366e46f933b95118e57dab4a51f3915bd642c34e5384eae3c40dce0cad82ed | R | 4,368 | 122 | # Siwei 08 Mar 2024
# Plot a list of genes from Alena's iMG expression data
# init ####
{
library(edgeR)
library(readr)
library(readxl)
library(Rfast)
library(factoextra)
library(dplyr)
library(stringr)
library(ggplot2)
library(RColorBrewer)
library(reshape2)
library(sva)
}
# load data ####... |
3d999218f34dbb68afeecf2ace3f0b6108ca90c77f9c8517f232ab7266845377 | R | 4,369 | 101 | # Modified from EnhancedVolcano for better control over labels
# note - drawConnectors determines whether geom_text_repel or geom_text is used
# Argument force in geom_text_repel controls overlaps,
# max.overlaps = Inf forces all requested labels to be shown
# min.segment.length = 0 forces all lines to be drawn
# defau... |
1f5ea8dd852942497b43d3e788db781f48a4dc0cd26fe40abe38139efd981574 | R | 4,370 | 116 |
# install.packages("DWLS") ## Use cran version
library("DWLS")
library("SingleCellExperiment")
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 <- a... |
8b240c458bcaa9025725800b3169edb6e86d5a69e3bdb99631990fa173c72328 | R | 4,374 | 102 | library(magick)
library(tidyverse)
#Set working directory (Update this path to your folder with images and coordinates file!)
setwd("~/your/directory/path")
#Load in coordinates file
coordinates <- read.csv("File S3.csv")
x_dim=coordinates$X.coordinate
y_dim=coordinates$Y.coordinate
row_names = rep(c("01","02","03","... |
e340a97db5f2ae882bdd7f1370e78354e6a7b313813f0d8a95a9325eb11d80b5 | R | 4,392 | 107 |
library(ggplot2)
age_scatter <- function(res, pheno, betas, i, age.column){
# extract info
probe <- rownames(res)[i] # the i_th probe in res
betas.plot <- (betas[probe,])*100 # corresponding DNAm values for probe. Multipli... |
306ebe07baf230b3c04a4fa05e40275cfa286ae78f8aed333c235c08c7c5efd8 | R | 4,393 | 37 | libs <- c("dplyr", "readr", "ggplot2", "tidyr", "circlize", "ComplexHeatmap", "correlation", "patchwork")
sapply(libs, require, character.only = TRUE)
source("Scripts/utils.R")
# read in the data
starts <- read_csv("Data/starts.csv") |> mutate(MouseID = stringr::str_extract(NetworkFilename, "[0-9]{6}"), duration = (e... |
83ff4313885a0abca889a578aea5581d6ffeaa2c740ad90f73c377c162e1da2c | R | 4,394 | 136 | library("SingleCellExperiment")
library("MuSiC")
library("here")
library("sessioninfo")
library("HDF5Array")
library("tidyverse")
# Later controls the argument to 'cell_size' parameter for music_prop
cell_size_opt = c("nuc_area", "akt3", "nuc_area_akt3")[
as.integer(Sys.getenv("SLURM_ARRAY_TASK_ID"))
]
marker_l... |
e31704a6a91e0204df0042ee64009a84ee9c8bc9d08899f72214f69f69ff6f48 | R | 4,395 | 80 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(readr)
library(plotrix)
library(GenomicRanges)
library(scales)
getCGContent <- function(seq){
cg.len = length(grep("C|G", strsplit(seq, "")[[1]]))
return(round(cg.len/nchar(seq), digits = 4))
}
load('GO_KEGG_n_100_1000.RData')
annovar = read.del... |
f775dde68ac7d2b4d3af929cb1fdbbf45265ef85a1a9c992ba38b0555561b25f | R | 4,397 | 107 |
library("tidyverse")
library("sessioninfo")
library("here")
## prep dirs ##
data_dir <- here("processed-data", "08_bulk_deconvolution", "10_get_est_prop_subset")
if (!dir.exists(data_dir)) dir.create(data_dir, recursive = TRUE)
#### data details ####
## dataset properties
dataset_lt <- tibble(Dataset = c("2107UNHS-0... |
fa2b3e6883ce9b9d45ab1dc04f5a4958e9ad1a0d4fcff6cdbfb336766482e080 | R | 4,398 | 160 | # Siwei 24 Jan 2025
# plot new Ex Fig. 3c
# init ####
{
library(readxl)
library(stringr)
library(ggplot2)
library(scales)
library(reshape2)
library(RColorBrewer)
library(ggpubr)
library(dplyr)
library(data.table)
library(DescTools)
library(multcomp)
}
df_raw <-
read_excel("Batch_2_of_new_... |
717ccb674ecdbf10df45aab6573b272d5553bb2b24cfc4b7d63c37d9f9ad1c50 | R | 4,403 | 150 | ---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(aif360)
```
# AI Fairness 360 (AIF360) R Package
<!-- badges: ... |
20b1bcb51dce2251ab3152647d2101b569a8247d31a8f0c5a43c0a05a38dcbd8 | R | 4,404 | 69 | # function for plotting
make_assembled_plot <- function(cell_type, x_offset_1 = 10000, x_offset_2 = 10000, ylimit = 800) {
# aTrack <- AnnotationTrack(range = cell_type, genome = genome(cell_type),
# name = "Marker Genes",
# chromosome = as.character(unique(seqn... |
ce4da5e128b680a59d12d650c3583c23e344309a05b1b9dd5b8b623b3be9f5d0 | R | 4,411 | 116 | # -----------------------------------------------------------------------------
# This script demonstrates the framework for removing non-malignant cell-type
# signatures from tumor methylation profiles, followed by classification of
# the adjusted profiles.
#
# The approach is model-agnostic, but this script uses th... |
5fda81c73ce4ccacab8d9554a471c248d43257f6a76107e4bfe2a68e087c7579 | R | 4,426 | 106 |
## Annotate and resave EWAS results ##
#1. Load libraries & define functions ===========================================================================================
library(data.table)
# function to split UCSC_RefGene_Name into unique mentions of genes
uniqueAnno <- function(row){
if(is.na(row)){
row = ''
... |
2d4b4fe300c19193155f2e6d790851734408beb41ac7ad0f0e7a8288253b5f40 | R | 4,440 | 128 | #!/usr/bin/env Rscript
# Command line arguments
args = commandArgs(trailingOnly=TRUE)
input <- as.character(args[1:length(args)])
# Load / install required packages
if (!require("limma")){
source("http://bioconductor.org/biocLite.R")
biocLite("limma", suppressUpdates=TRUE)
library("limma")
}
if (!requir... |
2c188d78c3da8cdc68059b650021eb5d5d29a6f71a345c10ff7665510ca10643 | R | 4,441 | 111 | #!/usr/bin/env Rscript
suppressPackageStartupMessages({
library(optparse)
library(dplyr)
})
options(dplyr.summarise.inform = FALSE)
# Command-line options
option_list = list(
make_option(c("-e", "--ens_var"), type="character", default=NULL,
help="Gene/ENS_ID variable"),
make_option(c("-m", "--p... |
0252ccb0b2a76fedd84f14157da9635ed8769b7dda02b96f8b29243a6e755d75 | R | 4,443 | 138 | # Siwei 06 Nov 2023
# 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.maxSize = 207374182400)
options(future.seed... |
dbf3e5722b215ea204c91fdcf79e8dc6d5ba56ab65cab5e4e9d2342138fd5ff2 | R | 4,446 | 130 | library(tidyverse)
library(here)
# load in metadata
human <- readRDS(here("data", "human_meta.RDS"))
chimp <- readRDS(here("data", "chimp_meta.RDS"))
gorilla <- readRDS(here("data", "gorilla_meta.RDS"))
rhesus <- readRDS(here("data", "rhesus_meta.RDS"))
marmoset <- readRDS(here("data", "marmoset_meta.RDS"))
meta <-... |
8f5189f2a4437c15c734107ef32a19b69339d94b3ef0921b7fe26c34f6a9fd20 | R | 4,448 | 154 |
find_module_GO_enrichment=function(module_df,geneset_db,universe)
{
GO_tbl=data.frame(label=character(),pval=numeric(),fdr=numeric(),
signature=numeric(),geneset=numeric(),overlap=numeric(),background=numeric(),hits=character(),module=character())
module_df=module_df[as.character(module_df$module) != "0",]
... |
880ad034339c1dfe1feea659ca4aa9b93dd00ba65e10e92b616ea21ef5f92fde | R | 4,449 | 90 |
## 3. WGCNA - visualise modules ##
library(WGCNA)
library(data.table)
library(tidyverse)
library(magrittr)
#1. Load data used in GPMethylation =============================================================================================
load(paste0(dataPath, "FetalBrain_Betas_noHiLowConst.RData"))
betas <- betas.... |
adffd4af7fc0d65dd73a06530230abfc4647af8a1db6ca60b2d508e37fc7139c | R | 4,462 | 90 | #inputFile='all.tag.pks.acp.tab';
#inputDirectory='/home/yli4/development/JUMPg/JUMPg_v2.3.4/gnm_stage1_test1/intermediate/qc_accepted_PSMs';
#recoveryPct=99
setwd(inputDirectory);
library(MASS);
## Data loading
tb=read.table(inputFile,head=T,sep="\t")
tb=tb[tb$PPI==1,]
tb$topTagEvalue[... |
bd68fed8c6bb500b258fa4c1816470257933b956def2789354a76742430e8f1c | R | 4,464 | 138 | #!/usr/bin/env R
# Author: Sean Maden
#
# Format ROSMAP data, downloaded from Synapse, as SingleCellExperiment. All data
# were downloaded from Synapse website.
#
# * Data includes tall-formatted counts, cell name metadata, and gene name
# metadata, as 3 separate files. Counts data includes 3 variables with names x... |
ceaec4449ecebabd9f95d5765f67c61e20507a91e534b004d43c375422301a3a | R | 4,480 | 76 | # Load pre-calculated Seurat object ####
library(Seurat)
load("../data/stoeckius/CBMC.seurat.RData")
# Generate tSNE visualization showing celltype clustering (Fig Panel A) ####
panelA <- TSNEPlot(cbmc, do.label = TRUE, pt.size = 0.5)
panelA
# Load imputed data ####
dca <- read.csv("../data/stoeckius/stoecki... |
eb944e683007ce6f56f7748f316325801f323dc112b7a6d1501745e0ae738715 | R | 4,483 | 141 | library("SingleCellExperiment")
library("BisqueRNA")
library("here")
library("tidyverse")
library("sessioninfo")
library("BiocParallel")
n_runs = 100
n_total_donors = 52
n_donors = round(1.4**(1:10) * n_total_donors / 1.4**10)[
as.integer(Sys.getenv('SLURM_ARRAY_TASK_ID'))
]
marker_file <- here(
"processed-da... |
ea5fb9bf0b3f448ae44c6a9d10f41a2d662a47f76709f8c98a8a19cb5f9bffd9 | R | 4,485 | 121 | # coding UCRÏà¹Ø»ùÒò²ÎÓëµÄphase separated condensates
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(readxl)
library(biomaRt)
library(curl)
coding_UCR_ensembl_id <- read.table(file = "02-analysis/16-New_classification/coding_UCR_ensembl_id.txt")
# ÀûÓÃuseMartÁ´½Óµ½ÈËÀàµÄÊý¾Ý¿â£¬... |
ebe4dbf51840f43a70f0cc287aed6bd3194991f8f3cac6533e3cbdbd8425c464 | R | 4,486 | 121 | runAPOEanalyses <- function(input,type,file){
## runAPOEanalyses - Run comprehensive APOE genotype statistical analyses
#
# Performs statistical analyses of APOE genotype effects on metabolic or microbiome
# data, including Kruskal-Wallis tests, Dunn's post-hoc tests, and regression
# analyses while account... |
6fe8df59f6febb1a700097a2da610b6b63b51bd95d014663e5a10d7f597022de | R | 4,491 | 151 | # Siwei 03 Jun 2022
# make PCA plot of AST, GA, MG, and NGN2-RGlut
# intervals used summit +/- 250 bp of 4 cell
# type-specific peaks
# init
library(sva)
library(edgeR)
library(readr)
library(factoextra)
library(Rfast)
library(ggplot2)
library(ggrepel)
library(gplots)
library(RColorBrewer)
library(stringr)
# loa... |
9664ceb5703b48377206144d59dc18a10a9f9a07b4deff1a49b5fb4fff0a5940 | R | 4,492 | 97 | #!/usr/bin/env Rscript
### title: Differential gene expression (DGE) in TOX+ CD8+ T cells
### comparing single-cell (sc) and single-nuclei (sn) RNA-seq
### authors: Jana Biermann, PhD; Yiping Wang, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(ggrepel)
library(DropletUtils)
library(scal... |
cd3245ec172420fd66eaf0e239e669032e78f067c1cd8a430b4a61e3c523d107 | R | 4,493 | 147 | Sys.setenv(VROOM_CONNECTION_SIZE = 500000)
require(optparse)
require(tidyverse)
require(viper)
##### FUNCTIONS #####
as_regulon_network = function(regulons){
regulators = regulons[['regulator']] %>% unique()
regulons = sapply(regulators, function(regulator_oi){
X = regulons %>%
fil... |
2f3694798b4c5faaefe8d3ae505d7bbc32b9d4e48374d2d17a6c74f28ab70d34 | R | 4,498 | 124 | #!/usr/bin/env Rscript
##
## Extract and plot fragment size distribution from a BAM file.
##
## usage: Rscript --vanilla fragment-sizes.R sample_name file.bam
##
# increase output width
options(width = 120)
# print warnings as they occur
options(warn = 1)
# get scripts directory (directory of this file) and load r... |
1bc4ae76c06e21033bddaba965c816306131f42b8c7d0efbff61b67e712259c3 | R | 4,500 | 129 |
# install.packages("hspe_0.1.tar.gz")
library("hspe")
library("SingleCellExperiment")
library("jaffelab")
library("spatialLIBD")
library("here")
library("sessioninfo")
## get args
args = commandArgs(trailingOnly=TRUE)
marker_label <- args[1]
marker_file <- NULL
## not using txt list of marker genes, methods needs n... |
c590c61bc5662b4594dd13591185db2b3fcee4e60acaea9be2c99e77903253d6 | R | 4,506 | 82 | options(stringsAsFactors = FALSE)
library(ggplot2)
library(reshape2)
library(dplyr)
library(stringr)
library(lme4)
library(lmerTest)
library(RColorBrewer)
library(ggpubr)
library(pheatmap)
library(grid)
#### META-CS ID4 contribution by case mean +/- sd ####
df <- read.table("data/TableS3_PTA_burden.tsv", header=T, se... |
506e29cc6dfff61225a2ff0d2df721e603c6d215ac2fc0b8f13ab828d6fb0d31 | R | 4,507 | 148 | library(magrittr)
library(data.table)
library(dplyr)
library(tidyr)
library(ggplot2)
library(ggrepel)
library(Hmisc)
library(cowplot)
library(pROC)
library(stringr)
library(RColorBrewer)
library(netresponse)
library(igraph)
library(Rtsne)
#genes that are relevant across drugs? sensitivity genes? essentiality?
setwd... |
b323e40f7ec979e2b14bcf58666213c0d1317fea8a6a6b76ebfef36d94c9f809 | R | 4,519 | 120 | # load packages
require(tidyverse)
require(Seurat)
require(phateR)
require(princurve)
require(scales)
# raw counts and metadata downloaded from solo.bmap.ucla.edu/shiny/webapp/
# load data
load('sc_dev_cortex_geschwind/raw_counts_mat.rdata')
meta.data <- read.csv('sc_dev_cortex_geschwind/cell_metadata.csv', row.names ... |
2a53a126cf5b494f886f923ead35a59fa75669de0c8b3157a289a4023e8e0cd4 | R | 4,520 | 143 |
library("SingleCellExperiment")
library("dplyr")
library("here")
library("sessioninfo")
#### load data ####
## load bulk data
load(here("processed-data","rse", "rse_gene.Rdata"), verbose = TRUE)
dim(rse_gene)
# [1] 21745 110
rownames(rse_gene) <- rowData(rse_gene)$ensemblID
## sce data
load(here("processed-data",... |
db2932684b595a7f758ea05f6df994ed943c8b4b3250f3644625426aa2b4e64d | R | 4,520 | 124 | ## Code in this file from:
##
## Jaffe AE, Murakami P, Lee H, Leek JT, Fallin DM, Feinberg AP, Irizarry
## RA (2012). Bump hunting to identify differentially methylated regions
## in epigenetic epidemiology studies. International journal of
## epidemiology, 41(1), 200?209. doi: 10.1093/ije/dyr238.
##
## https://github... |
01bc53728259448eb11bae9be8784c377c21e958f594664ca426a74490f5e793 | R | 4,523 | 147 | # type III UCRs nearest PCGs GO
# human
# mouse
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(stringr)
library(readxl)
library(ggplot2)
library(cowplot)
library(ggview)
# human -------------------------------------------------------------------... |
46aec9f7af5e3d890c433a15e0eb9bd3a6169d35e8ed97aa8b2318b5e4f311b1 | R | 4,530 | 90 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(readr)
library(plotrix)
library(GenomicRanges)
library(scales)
### Test functional elements
exp = kgp.str
dt.out <- data.frame()
for(typeseq in unique(as.character(exp$typeseq_priority))){
variable.count <- sum(exp$typeseq_priority == typeseq & ex... |
df0ef7faaacac2c9d168ed823dfd56d32ee156e477da1114ba49e83cc2dcec3c | R | 4,533 | 119 | # GPT social perception: Preprocess the GPT4 pilot data for video experiment when temperature is set to 0
# 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... |
4ed2a8d9419a4f4feacdde84304478c29c9b10894caa041524bc6c232d35fefb | R | 4,535 | 114 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
list2env(rjson::fromJSON(file = "00_configs.json"), envir = .GlobalEnv)
library(Seurat)
library(Signac)
library(ClustAssess)
library(qs)
library(rhdf5)
library(dplyr)
library(future)
library(doParallel)
library(ComplexHeatmap)
figures_path <- file.path(projec... |
5a5045cf4753491f8a9d63d5eaf646ee30108e099f11569b56d8f213208018eb | R | 4,539 | 169 | # Siwei 24 Jan 2025
# plot new Ex Fig. 3b
# init ####
{
library(readxl)
library(stringr)
library(ggplot2)
library(scales)
library(reshape2)
library(RColorBrewer)
library(ggpubr)
library(dplyr)
library(data.table)
library(DescTools)
library(multcomp)
}
# TREM2, IBA1, PY2 #####
df_raw <-
r... |
f733716c00fcfd4c1e93e748d2d172a11887121ed265e0a26d89b6891c9ea5ab | R | 4,542 | 128 | #!/usr/bin/env Rscript
### title: Differential gene expression (DGE) of tumor cells comparing MBM and MPM
### author: Jana Biermann, PhD
print(Sys.time())
library(dplyr)
library(Seurat)
library(pheatmap)
library(ggplot2)
library(gplots)
library(scales)
library(viridis)
library(ggrastr)
library(ggrepel)
colBP <- c('... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.