sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
41df69b029b9db0bfb5ae1e093440acf77d34e795d566c19d6e8386053b53bad | R | 9,583 | 134 | ---
title: "Doublet identifiation in single-cell ATAC-seq"
author:
- name: Pierre-Luc Germain
affiliation: University and ETH Zürich
package: scDblFinder
output:
BiocStyle::html_document
abstract: |
An introduction to the methods implemented for doublet detection in single-cell
ATAC-seq.
vignette: |
%\Vignett... |
3bbf85aeeff04a5deabcbb812303c10836c69f87a124260582e58d12d81b0abb | R | 9,601 | 204 | #' Get UK Biobank participant self-reported illness/year data for specific codes
#'
#' @description For a specific self-reported illness code or codes, identify whether the participant has self-reported at any visit, and identify the year.
#' Intended for use on the UK Biobank DNnexus Research Analysis Platform, but if... |
784579b79a02c15d24e406c03adca93d865c4db39373642fd80718911630623a | R | 9,606 | 255 | #!/usr/bin/env R
# Author: Sean Maden
#
# Make plots showing the brain region across assay types.
#
#
library(ggplot2)
library(reshape2)
#----------
# load data
#----------
# sce.fpath <- file.path("DLPFC_snRNAseq", "processed-data", "sce",
# "sce_DLPFC.RData")
# sce <- get(load(sce.fpath))
# cd <- colData(sce)
c... |
a0776c8855c1c78ef5935b35f49319483b4e442684f31f7d2ad056fac3a00bf5 | R | 9,623 | 209 | # plots for Fig. 6E, S24
library(universalmotif)
library(ggseqlogo)
library(motifStack)
library(cowplot)
library(GenomicRanges)
library(karyoploteR)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
library(tidyverse)
library(here)
# defaults ----
HAR.ID <- "HARsv2_1818"
font <- "Helvetica"
human_color <- "#4876FF"
chimp_co... |
738b721893a7ae5c2a91488f07002da613e70649ebbc8bfef2fc1deab1a4ca12 | R | 9,624 | 222 | #' Plot statistics for the second-tier projection using \code{ComplexHeatmap}
#'
#' Plot statistics for the second-tier projection using \code{ComplexHeatmap} (Fig 4)
#'
#' @param inpMat A matrix from \code{getMBstats()}, or a list of multiple matrices. If names detected in the list, they are shown in the legend as s... |
24261b5e0c548cef98fec54cfae69f3280ba905b65158f0f2ec48230d5278710 | R | 9,625 | 253 | # Load necessary libraries
library(tidyverse)
library(rtracklayer) # For importing GTF files
# --- Configuration: Define Base Paths ---
# Define the base directory for your results to avoid repeating long paths
results_base_path <- "/Volumes/T9/drosophila_nanopore/DRS_compairison/results/"
# --- Helper Function: Load... |
ed5d3d5c0c9815ce132119dfc0ef1f62c510d0311a0cde983337e23c50b5310f | R | 9,643 | 222 | #' Plot statistics for the second-tier projection using \code{ComplexHeatmap}
#'
#' Plot statistics for the second-tier projection using \code{ComplexHeatmap} (Fig 4)
#'
#' @param inpMat A matrix from \code{getMBstats()}, or a list of multiple matrices. If names detected in the list, they are shown in the legend as s... |
a5feab6a0f03c902d9a974b6dd8ed94d4346941517aff9af4e867fcb3ad7bbb7 | R | 9,648 | 276 | # Replace sample1 with your file name or sample name
# Usage: Rscript BamSlam.R rna/cdna yourfile.bam ouputprefix
# GenomicAlignments/Features package is from bioconductor, need to install bioconductor then run:
# BiocManager::install("GenomicAlignments")
# Function for importing BAM file
import_bam_file <- function(... |
65533d2711c440f453ee6a247089b0c5076a35b6607cd1c2351cd28fa98ab8bd | R | 9,675 | 242 | suppressPackageStartupMessages(library(optparse))
option_list <- list(make_option(c("-s", "--sample-table"),
type="character",
dest="sample_table",
help="Path to sample table CSV file used as input to PAPA pipeline. By defa... |
a7efcfce9369c083b7792eee15169d9b686d3f91186cf8ae81b87e2baeb0d47a | R | 9,675 | 211 | library(plyr)
library(vars)
# library(MTS)
library(readstata13)
options(digits=15, scipen=999)
dta <- read.dta13('~/projects/statsmodels/statsmodels/tsa/tests/results/lutkepohl2.dta')
# TODO
# predict(res, dumvar=exog_fcast)
# vars::fevd(res)
# vars::irf(res)
extract_var_output <- function(res, k_trend=0, k_exog=0) ... |
9b52607bd92489a2c8a96b61338c56ea46119199749ad0d7c7187e9c48869b55 | R | 9,681 | 177 | ####################################################################################################
## Package : CARD
## Version : 1.0.1
## Date : 2021-1-7 09:10:08
## Modified: 2021-12-13 16:18:07
## Title : Spatially Informed Cell Type Deconvolution for Spatial Transcriptomics by CARD.
## Authors : Ying Ma
## C... |
0aea383179a1e16c7bf25aad57f0fbff9f43ec9c658ec75485c6d271f6d59917 | R | 9,697 | 218 | #' getFragmentOverlaps
#'
#' Count the number of overlapping fragments.
#'
#' @param x The path to a fragments file, or a GRanges object containing the
#' fragments (with the `name` column containing the barcode, and optionally
#' the `score` column containing the count).
#' @param barcodes Optional character vector... |
f55d73b9f317f5b35e4ac9905bcecddc57cc1f32b56f78861b6f73fd75474d8e | R | 9,705 | 260 | ---
title: "SBM fitting"
output: html_notebook
---
```{r include=FALSE}
# Install the required packages
install.packages("resources/sbm_0.4.7.tar.gz", repos = NULL, type = "source")
```
```{r include=FALSE}
# Import libraries
library(sbm);
```
```{r include=FALSE}
# Load matrices
# Youth symptom layer
youth_symptom... |
b7dc7d91dfdc9db020f4ea691c9016d535acae1f144377711e1739780609d146 | R | 9,727 | 321 | # Siwei 04 Feb 2025
# plot new Fig Ex 7bc
# init ####
{
library(readxl)
library(stringr)
library(ggplot2)
library(scales)
library(reshape2)
library(RColorBrewer)
library(ggpubr)
library(dplyr)
library(data.table)
library(DescTools)
library(multcomp)
library(gridExtra)
}
df_raw <-
read_... |
46d9b681f04f72fa4985660a722b390e74e8610e2ed33e2b9699a4b9487801df | R | 9,735 | 293 | # Figure 2: Creates multi-panel figures showing APOE-related metabolic analyses
#
# USAGE:
# createAPOEFigures(fluxAllpruned, microbiome, metabolome)
#
# INPUTS:
# fluxAllpruned DataFrame containing metabolic flux data
# microbiome DataFrame containing microbial abundance data
# metabolome ... |
090f10f8d1b694d90e7de325a4a242bad2a51a01268aa62e1070f1820d465a02 | R | 9,742 | 308 | setwd("/mnt/data/lijincheng/mGWAS/result/02MRBMA/hyprcoloc/")
rm(list = ls())
library(tidyverse)
library(openxlsx)
library(data.table)
library(openxlsx)
library(MendelianRandomization)
library(TwoSampleMR)
library(hyprcoloc)
source("/mnt/data/lijincheng/mGWAS/result/02MRBMA/MRBMA_function/function/mv_harmonise_data_... |
6ab318a6062493febf456ec7135f1fe17ffe8cb3672ec91c6739f02085af6138 | R | 9,743 | 387 | # Load required libraries
library(clusterProfiler)
library(org.Hs.eg.db)
library(enrichplot)
library(dplyr)
library(ggplot2)
library(enrichR)
library(xlsx)
# Function to perform pathway enrichment analysis
perform_pathway_enrichment <- function(de_genes, pathway_type, sig_threshold = 0.05) {
if (pathway_ty... |
ef05411af4a77ea4cc1c9bb064ece913b9b192e87c576b156b80db6f603a4331 | R | 9,775 | 217 | library(tidyverse)
library(dendextend)
library(jsonlite)
library(plotly)
library(reticulate)
use_python("~/anaconda3/bin/python")
# Utility Functions -------------------------------------------------------
source_python('pickle_reader_for_R.py')
data_path <- file.path(getwd(),'..','..','assets','aggregated_da... |
cde9b72b60868778abf93286eef5f678d8a31d2783b01c7c63d7a858ad4e428d | R | 9,779 | 256 | # =============================================================================#
# RepMake Reproducible Manuscript Toolkit with GNU Make #
# =============================================================================#
# COMMON =======================================================... |
971e89f7622aa1131fecf66b844b566270f080c0e7d457582b07d9098343f546 | R | 9,791 | 339 | # Siwei 26 Jan 2025
# plot flow cyto
# need to downsample each subset to 5800
# init ####
{
library(readxl)
library(stringr)
library(ggplot2)
library(scales)
library(reshape2)
library(RColorBrewer)
library(ggpubr)
library(ggridges)
library(dplyr)
library(data.table)
library(DescTools)
libr... |
28b14923066befa4bea008f14c3503a6b05aeb5bafb6786f654452a85ecda177 | R | 9,807 | 288 | #!/usr/bin/env R
# Author: Sean Maden
#
# Inspect properties of recount3 datasets for DLPFC RO1 deconvolution project.
#
#
library(recount3)
dir.name <- "datasets"
#----------
# load data
#----------
# get dataset
# note: csv obtained using "human", "dorsolateral" search terms
csv.fname <- "recount3_selection_2022-... |
981e75e9efde9d5350ec65070f1fdbf7026fa0f9ab94784a6bfa83798e26b4c0 | R | 9,809 | 214 |
library("tidyverse")
library("sessioninfo")
library("DeconvoBuddies")
library("here")
library("viridis")
library("GGally")
## prep dirs ##
plot_dir <- here("plots", "08_bulk_deconvolution", "13_deconvo_plots_MuSiC_cell_size")
if (!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE)
## load colors & shapes
l... |
617e902c631e4e2dbbb83c538a89b6cb29a81384951a0244052559179cb3d9e9 | R | 9,821 | 215 | ```{r}
# BAR-seq coronal data
# data is shrunk by removing image stitching-related artefacts (cf. Xiaoyin's email)
# data is quality controlled by keeping cells with genes/cell >= 5 and reads/cell >= 20
# data alongside CCF and slide coordinates are saved and can be used for analysis
# load libraries
suppressPackageS... |
6e9bbf7cb544253e1c76686f6e9558115fb0e26b303ee648251ad3f079754dd3 | R | 9,852 | 237 | #!/usr/bin/env R
# Author: Sean Maden
#
# Compare initial cell proportions from snRNA-seq and RNAscope.
#
# This script compares cell proportion, count correlations across the binned
# data (i.e. median values), with the following details:
#
# * snRNAseq: Binning performed across replicates within each sample, which... |
c80c6492688e93fbc539b954fe12a48610292167a23e11c697c0fcdfd97d064c | R | 9,867 | 242 | library(tidyverse)
source("scripts/fncs_plot_iclip.R")
#####
#' Summarise iCLIP coverage information to binary column across each interval
#'
#' This function processes a single input path to compute binding coverage statistics.
#' It parses the coverage data, groups it by `name`, and determines if any positions
#' ... |
f771dc4216232760afdded5fdd93f2789d28a9be6ab64cde8cf55bcf6fb2dcd7 | R | 9,871 | 344 | # Siwei 02 Feb 2025
# plot new Fig 7b-c
# init ####
{
library(readxl)
library(stringr)
library(ggplot2)
library(scales)
library(reshape2)
library(RColorBrewer)
library(ggpubr)
library(dplyr)
library(data.table)
library(DescTools)
library(multcomp)
library(gridExtra)
}
# load raw data ###... |
a7c4bc81551b091fe5be5478ee26c480e484e48f0516a1cf4738a40efffc8f5b | R | 9,875 | 242 | library(tidyverse)
library(scrattch.hicat)
library(here)
#read in data and calculate expression means
orthologous_genes <- readRDS(here("data", "orthologous_genes.RDS"))
human_mat <- readRDS(here("data", "human_mat.RDS"))
human_meta <- readRDS(here("data", "human_meta.RDS"))
human_meta <- human_meta %>% filter(specie... |
0c2af6a600ae1ea5e6fa34d1ea4ce4d17ff67e21b4af7595c3453f6c961ebc4e | R | 9,894 | 336 | # ͳ¼ÆÈËÀàÆßÖÖÆ÷¹ÙÖв»Í¬Àà±ðµÄdevASµÄÊýÄ¿µÄÊýÄ¿ºÍÕ¼±È
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(dplyr)
library(tidyverse)
library(reshape2)
library(ggplot2)
library(cowplot)
library(ggprism)
library(sysfonts)
library(showtext)
library(ggview)
human_devAS <- re... |
62dc3615e8d5da1339a7a07433caa7a70a205e40bad2f644ee179299bb7f9cb3 | R | 9,909 | 345 | # Siwei 29 Jan 2025
# plot new lipidomic volcano plot
# init ####
{
library(readxl)
library(stringr)
library(ggplot2)
library(ggrepel)
library(scales)
library(reshape2)
library(RColorBrewer)
# library(cm.)
library(ggpubr)
library(dplyr)
library(data.table)
library(limma)
library(DescTo... |
a328c1187ed635837b4f2fe062b0c364f07c7614a1009cd39ccca8e676da100f | R | 9,913 | 327 |
# Author: Somnath Tagore, Ph.D. Title: Master Regulator Analysis of Melanoma data
# Script Name: protein_activity_melanoma.R
# Last Updated: 03/19/2022
# Packages required for this analysis
formatR::tidy_app()
library(cluster)
library(ggplot2)
library(viper)
library(annotate)
library(dplyr)
library(Seurat)
library(... |
f8a68f259e22e648d3331ef809f7d49b17e90b5298dde8d501223ca1db85b8c3 | R | 9,927 | 263 | library("tidyverse")
library("data.table")
library("stringr")
library("openxlsx")
library("grDevices")
library(readxl)
library(dplyr)
library(MRcML)
library(MendelianRandomization)
library(TwoSampleMR)
library("doParallel") #¼ÓÔØdoParallel°üÓÃÓÚÖ®ºó×¢²á½ø³Ì
library("foreach") #µ¼Èëforeach°ü
###
filelist ... |
33cb76e438caeaec3da5d0efa16e321b00f62da9241040e440b90e2a5084f426 | R | 9,939 | 166 | #generate plots for results of the Tabula Muris droplet dataset
##### load packages and results from scdrs/ours/fuma/magma #####
if (!require("here")) {
install.packages("here")
library("here")
}
if (!require("tidyverse")) {
install.packages("tidyverse")
library("tidyverse")
}
if (!require("magrittr")) {
inst... |
07bea3c28be7c40d59623af930bee3f81198a49762e32a0a258791e2c21fbf47 | R | 9,957 | 310 | #!/usr/bin/env Rscript
in_formats = c("seurat_rds", "10x_cellranger_mex")
out_formats = c("h5ad", "sce_rds")
library("argparse")
parser <- ArgumentParser(description='Conversion script between single-cell data formats.')
parser$add_argument(
'input',
metavar='INPUT',
action="store",
type="character"... |
750d783259667d191bbea5e88664a9930d0b354710d15e1f1fc6187d80b3782b | R | 9,999 | 212 | #!/usr/bin/env Rscript
### title: Analyze gene expression signatures and individual genes with spatial
### patterns in four slide-seq pucks author: Yiping Wang date: 09/27/2021
library(Seurat)
library(ggplot2)
library(rlist)
library(grid)
pucks = c("puck5", "puck6", "puck7", "puck8")
puck_store_folder = "/data"
file... |
2a3391d652ec89b74ed8bf2af75b5edba3193e8bf3de2c7e2da82186daa99aaa | R | 10,011 | 229 | ### for MAGMA with LIBD 10x pilot analyses
# - plotting results/heatmaps
# MNT 24Aug2020 ======================
library(readr)
library(stringr)
library(RColorBrewer)
library(ggplot2)
library(fields)
library(jaffelab)
#
# x <- paste0("./Results/",i,"_clozuk_pgc2.gsa.out")
#
# ## From AnJa
# parse_magma... |
4890c5ceb9fae9590aabc52629826182ddf3e24f92ecc51ffdc5d4bfe4f7e856 | R | 10,014 | 233 | # function for plotting
plot_rs1532278 <- function(chr, start, end, gene_name = "",
SNPname = "", SNPposition = 1L,
mcols = 100, strand = "+",
GWASTrack = "",
lineWidth = 1,
minHeight = 10,
... |
f04ea4d7ac0832f61e7d79f05cda02de442c2c276a434b50478391948d33dafe | R | 10,021 | 201 | #----significance_test----------------------------------------------------------
#-------------------------------------------------------------------------------
# This script tests the experimental group against the control groups for the
# locomotor activity analysis for Reinhard et al. 2025 (10.1073/pnas.2506164... |
586d6110b3a7e6735f4e889db7c26f0574f6b720752fe5004cda74fbd56d7350 | R | 10,034 | 187 | # function for plotting BCL11B site
# SNPname = "rs12895055", chr = 14, SNPposition = 99246457,
# revised from plot_anywhere
# Use OverlayTrack to combine data tracks
plot_AsoC_composite_BCL11B <- function(chr, start, end, gene_name = "",
mcols = 100, strand = "+",
... |
80a204934f4759628c002619344bd9154afc9d90877a1287abed8830ef6af548 | R | 10,051 | 235 | ####################################################################################################
## Package : CARD
## Version : 1.0.1
## Date : 2021-1-7 09:10:08
## Modified: 2021-5-20 15:25:07
## Title : Spatially Informed Cell Type Deconvolution for Spatial Transcriptomics by CARD.
## Authors : Ying Ma
## Co... |
77a9c16b0c5f67839eb1a9f9e2e8e8f3a540d1b511cb25968636479a02b152f9 | R | 10,082 | 366 | # Siwei 25 Sept 2024
# clustering was done by scanpy, seems good
# init ####
{
library(Seurat)
library(Signac)
# library(remotes)
# library(SeuratDisk)
library(anndata)
library(edgeR)
library(future)
library(stringr)
library(harmony)
library(MAST)
library(SingleCellExperiment)
library(sc... |
ec4a84e008d108588585fca757c6f61e6414920d73b9a7807feede382f224a30 | R | 10,095 | 152 | ---
title: "Dunnart ChIP-seq experiment"
author: "lecook"
date: "2022-02-23"
output: workflowr::wflow_html
editor_options:
chunk_output_type: console
---
# Dunnart ChIP-seq experiment
## Experimental design
__H3K4me3__
- Signature of active promoters.
- Closely linked with TSSs.
- Active, and prefers promoters ... |
b66a776e683af71463b742dbf42df4f69b84ccd8de9d6847a9631f4d691799b5 | R | 10,112 | 165 | #!/usr/bin/env Rscript
#### Final fine cell type annotation of integrated Seurat object
#### Author: Jana Biermann, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(viridis)
# Read-in integrated object
seu <- readRDS('data/MBPM/MBPM_scn/data_MBPM_scn_anchor2000_dims50.rds')
# Read in cell... |
c6561dd2012a8deb1647cd117265f0ea4c6db8f6c18217e1778f49a53ddc728d | R | 10,112 | 259 |
xlsx.addHeader<-function(wb, sheet, value="Header", level=1, color="#FFFFFF",
startRow=NULL, startCol=2, underline=c(0,1,2))
{
library("xlsx")
if(color=="black") color="white"# black and white color are inversed in xlsx package. don't know why
# Define some cell styles within that wor... |
1d8a0ae1b6015c7438e4d7d5093e960be97707af70a7c663cab0d66b5478dc7e | R | 10,129 | 242 | # function for plotting
plot_rs1532278 <-
function(chr, start, end, gene_name = "",
SNPname = "", SNPposition = 1L,
mcols = 100, strand = "+",
GWASTrack = "",
lineWidth = 1,
minHeight = 10,
x_offset_1 = 0, x_offset_2 = 0, ylimit = 800) {
cell_type ... |
a841dc1b527ed4dcd73cdf117c2364b9c02943e29fd269709e968fecffbe09a9 | R | 10,141 | 256 |
library(NMF)
library(vegan)
library(RColorBrewer)
library(gplots)
library(ggplot2)
library(pheatmap)
library(bigmemory)
library(rstudioapi)
currPath <- dirname(rstudioapi::getSourceEditorContext()$path)
setwd(currPath)
dir.create("R_plots")
resourcePath <- paste0(currPath, "/inputFiles/", collapse = NULL)
fluxPath ... |
e6ce73509e1627883e4a6d2545d21eefd02ecd170aa8617d2169bd08b2a092fd | R | 10,153 | 276 | ```{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"... |
1547c11c5750b7abb7c5e921ccd0ac5c61fec93aa320d3ba1c99e398362cc458 | R | 10,155 | 207 | setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(readr)
library(plotrix)
library(GenomicRanges)
library(scales)
### Mobile elements
####################
#### mobile elements
mle <- fread("../UCSC_hg38_repeatMasker.tsv", data.table = F)# 5,633,664
mle <- mle[mle$repFamily == "Alu" | mle$repClass == ... |
ef737dec2b0a19c49301ddf91c07be79f8c16af688760103c0748250d1a763cc | R | 10,165 | 405 | ##Finding documents [not to execute if inputs already set]
#path="P:/Documenti/HMP_cov/Mapped/Ear"
#out="P:/Documenti/HMP_cov"
btThr=0.80
############# Dependencies
if (!exists("btThr")){
}else{
warning("bootstrap value found")
}
require(stringr)
#Function to move files
my.file.rename <- function(from, to) {
to... |
bb49269b6a108b47f3e6e7dc1d38117ded6f1ab09580dec31a29af37b504a1d3 | R | 10,194 | 257 | ```{r}
# 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")
```
```{r}
# cross-expression profiles
dirr = "/inkwell05/ameer/d... |
ae6c3c8137a830122473c5c16bc98c8776d9915b92195d80a6f85afa23607839 | R | 10,198 | 326 | ### R code from vignette source 'bms.Rnw'
###################################################
### code chunk number 1: bms.Rnw:16-17
###################################################
options(width=75)
###################################################
### code chunk number 2: bms.Rnw:64-65
#######################... |
1064c9793ac3771a1f95a73e0801ddbfe663a7e3acbf688cf69f86316c0019c2 | R | 10,204 | 242 | library(tidyverse)
library(nullranges)
library(cobalt)
set.seed(123)
# Function to calculate Szymkiewicz–Simpson coefficient ('overlap coefficient')
calculate_szymkiewicz_simpson <- function(set1, set2) {
intersection <- length(intersect(set1, set2))
min_length <- min(length(set1), length(set2))
return(intersect... |
51e13ea322e260f46be4ef2da59be3cca64720dd77cfb9bc4cd3c2d4af2cfd34 | R | 10,219 | 214 | #------{00 load functions and data input}----------
library(data.table)
library(dplyr)
library(openxlsx)
library(MendelianRandomization)
library(TwoSampleMR)
library(stringr)
library(grDevices)
library(readxl)
library(MRcML)
library(tidyverse)
library(openxlsx)
rm(list=ls())
source("/mnt/data/lijincheng/mGWAS/result/... |
450e155fb6d7e838cfcd705ecbaaa6827d28298fbc21e6e967ab1fddfdb6e04b | R | 10,237 | 318 | #read GRNs, find coreg matrix, find modules
rm(list=ls())
set.seed(123)
source('load_libraries.R')
source('aux_functions.R')
library(clusterProfiler)
#set min mod size
msize=10
library(aricode)
library(ggnewscale)
library(org.Hs.eg.db)
#funciton for NMI
get_nmi=function(dis.df,ctrl.df)
{
colnames(dis.df)=c("gene_... |
d3ca18fb57cef7acede44c4104ae98b22b6e33491b41e9a0e10f65185573d923 | R | 10,240 | 259 | #!/usr/bin/env Rscript
#### Fine cell type annotation of myeloid cell subset for MPM_sn
#### Author: Jana Biermann, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(viridis)
'%notin%' <- Negate('%in%')
path.ct <- 'data/cell_type_DEG/MPM_sn/myeloid/'
filename <- 'MPM_sn_myeloid'
seu <- rea... |
35d64fc26f66070545217b05588d9b518cd9fabddf5b1e43a160aeb6cd8502d6 | R | 10,268 | 330 | # Siwei 21 Jun 2024
# Import scRNA-seq data of previous microglia to identify potential samples
# init ####
{
library(Seurat)
library(Signac)
library(edgeR)
library(future)
library(parallel)
library(stringr)
library(harmony)
library(readr)
}
plan("multisession", workers = 6)
set.seed(42)
options(... |
5a3dc0aa6884639198d5536501c401dbe017de9a11056c44ccb3f5ff19f3934e | R | 10,289 | 293 | # ʹÓÃcell reportsµÄmolecular interactionsÍøÂç±È½ÏUCRºÍRFµÄinteraction numÊÇ·ñÓÐÏÔÖø²îÒì
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(readxl)
library(biomaRt)
library(curl)
library(ggprism)
coding_UCR_genes <-
read.table(file = "02-analysis/... |
c7937ac4b9972eb5e89cc681c8db30df26628947e058f36b081fef47093f6ff3 | R | 10,338 | 261 | #!/usr/bin/env Rscript
##
## Differential gene expression with DESeq2.
##
## usage: Rscript --vanilla dge-deseq2.R genome_build genes.gtf counts.txt groups.csv
##
# increase output width
options(width = 120)
# print warnings as they occur
options(warn = 1)
# java heap size
options(java.parameters = "-Xmx8G")
# get... |
9809ddb508430ddad17f6f3394218b0b8544aa9346c3d153ba415576ca0fd482 | R | 10,345 | 262 | library(tidyverse)
library(patchwork)
library(fgsea)
load("processed/ferguson_hela/2023-11-29_hela_ko_tf_activity_gsea.Rdata")
find_cross_0_idx <- function(x) {
# Find the index of the last positive value
last_positive_index <- tail(which(x > 0), 1)
# Find the index of the first negative value
first_neg... |
155aaf24b3e4e184f436d4a7ff41296e76e3376aa1e7fe667acc96c91416db2e | R | 10,346 | 250 | # load libraries
library(tidyverse)
library(data.table)
library(Matrix)
library(Rfast)
library(matrixStats)
library(ggridges)
library(reticulate)
library(anndata)
library(scales)
library(ComplexHeatmap)
library(forcats)
library(igraph)
library(mclust)
library(future.apply)
library(UpSetR)
library(gtools)
library(patchw... |
060e1dec23635fa7cb30daaa136f709cf2b446fb73152f33005e719a7a397bb1 | R | 10,396 | 334 |
#### ====================================================================
#### hdWGCNA
#### ====================================================================
#### Load Packages
library(Seurat)
library(tidyverse)
library(cowplot)
library(patchwork)
library(WGCNA)
library(hdWGCNA)
library(igraph)
library(qlcMatrix)
l... |
27a01825141fb34d8668294bb5041031126c5bc6872eec318158d9a0778fd8fb | R | 10,419 | 258 | # Siwei 05 Aug 2022
# calculate ASoC ratio from the aggregation
# init
library(ggplot2)
library(ggrepel)
library(readr)
library(stringr)
library(RColorBrewer)
# df_raw <- read_delim("bwa_call_test/NEFM_pos_glut_scATAC_0hr_rededup_no_VQSR_MAPQ_30_05Aug2022_4_R.txt",
# delim = "\t", escape_double... |
fa2795c03f79269f785d976c504a7fc6e88263c8d5cea750cc8c706a495ab0d4 | R | 10,423 | 255 | # Parse Salmon quantification outputs into count matrices
# 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 Software Foundatio... |
ea7212ad7b5e917f7ca496eb22b6646cf99b169e90ca9f1b53dca96a8f660713 | R | 10,436 | 157 | # plot HiC track together with sites proximal to RERE gene
# input as BEDPE format
# need to lift hg19 to hg38 genome coordination
# process hippocampal data
# init
library(Gviz)
library(GenomicInteractions)
# library(GenomicRanges)
library(InteractionSet)
library(rtracklayer)
# library(ChIPseeker)
library(BSgenome)
l... |
f1a2e76b5739b712bbfc05d9fd430e5e888f96ea9b3ed0cd34bac4624eedf0ee | R | 10,494 | 186 | #import relevant packages
library(mice) # version 3.17.0
library(miceadds) # version 3.17-44
library(lattice) # version 0.22-6
library(ggmice) # version 0.1.0
library(tidyverse) # version 2.0.0
library(MetBrewer) # version 0.2.0
library(patchwork) # version 1.3.0
# read in the assembled data for the study
data <- read... |
21e4406b0765015675b86e623d55b920ab782cdda79b4016b84df6e6fa7820e1 | R | 10,506 | 194 | #! /work/home/sdxgroup01/00envs/anaconda3/envs/sc_cellchat/bin/Rscript
library(optparse)
library(Seurat)
library(CellChat)
library(cowplot)
options(stringsAsFactors = FALSE)
op_list <- list(
make_option(c("-i", "--input"), type = "character", default = NULL, action = "store", help = "The input of Seurat RDS",metavar=... |
289ed6a19388f7b39e104d16df2396850feba7d199735eee6d3d64b50a401447 | R | 10,521 | 248 | #!/usr/bin/env Rscript
### title: Individual diffusion component (D.C.) analysis of tumor cells
### and overlap of drivers in DC1-3 between samples
### author: Jana Biermann, PhD
library(dplyr)
library(Seurat)
library(ggplot2)
library(gplots)
library(reshape2)
library(viridis)
library(destiny)
library(ggthemes)
libr... |
efe15c5ef80c0641775ff52ae73298dceae08087a63ed516a9d888f55f6ea04f | R | 10,530 | 216 | #!/usr/bin/env Rscript
### Generate PIR (percent intron retention) tables from normalized count files containing
### EIJ1, EIJ2, EEJ, I read counts. All such files in the given collection will be merged.
### Also required is a template containing the introns to be merged to.
### Which samples are combined depends on w... |
447894ca9effea13abcab5be9191653640baa1bc0eb536b06c98e4e600ae82dc | R | 10,545 | 188 | library("SingleCellExperiment")
library("rafalib")
library("iSEE")
library("lobstr")
library("here")
library("whisker")
library("usethis")
library("withr")
library("rsconnect")
library("sessioninfo")
load(here("rdas", "revision", "regionSpecific_Amyg-n5_cleaned-combined_SCE_MNT2021.rda"), verbose = TRUE)
source(here(... |
7e4efdb8877feefba1173c2e553f32d893b2532e96c8e077398688584e1d7a7f | R | 10,569 | 256 | #########################
# Packages to install and load #
#########################
# install.packages("nlme")
# install.packages("splines")
# install.packages("lattice")
library(nlme)
library(splines)
library(lattice)
########################################
# Functions needed for the dynamic predictions #
########... |
6c1e9594aa6e3184e21d2d9156172f42706ee9692fb19ff326635cfda239e5c7 | R | 10,580 | 364 | # Siwei 27 Jun 2024
# Import scRNA-seq data of previous microglia to identify potential samples
# try different DEG analysis methods
# init ####
{
library(Seurat)
library(Signac)
library(edgeR)
library(DESeq2)
library(MAST)
library(future)
library(stringr)
library(harmony)
library(readr)
lib... |
21839ec5690be359f07276d0d180042fba7b98601b14ba82559a15b70b34ca08 | R | 10,582 | 190 | # 20 Dec 2019 Siwei
# plot all 6 AA/AG/GG isogenic lines of VPS45
plot_VPS45_6_lines_q20_45M <- function(chr, start, end, gene_name = "VPS45",
mcols = 100, strand = "+",
x_offset_1 = 0, x_offset_2 = 0, ylimit = 400,
... |
911bc9a1e19af6934cef3b7f30e8c93e783818b9064f340b3954aebd5c22d05f | R | 10,588 | 191 | 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))
}
gtex = read.delim('../meta/GTEx_metadata.tsv', stri... |
67b61892c6296aefd722e3ce31bc04fc71f61bac9b1fb2de76f9e8c2bfbf6e8b | R | 10,601 | 243 | library(dplyr)
library(Seurat)
library(ggplot2)
library(hdf5r)
library(reshape2)
library(googleVis)
setwd("/project/Campbell_Lab/yl7mfw/Data Analysis/20240811_Analysis for supplementary figures/FigS1")
sSC.integrated <- readRDS("/sfs/gpfs/tardis/project/Campbell_Lab/yl7mfw/Data Analysis/20240419_Three Species Integra... |
8af896b07c38a013217d348125dd6c076ff57c5e4bd19efe156c38a3d07430dc | R | 10,608 | 204 | # Data from Kirkby et al 2013 data assumed to be in same directory as this file
source("processing_functions.R")
dt=0.1
#Store data separately by phenotype- can be done in one big data frame, but this is more readable
WT_files=c("Kirkby2013_02_WT_P5","Kirkby2013_03_WT_P5","Kirkby2013_04_WT_P5","Kirkby2013_07_WT_P5"... |
80845088c4f5a9d63a8468f9fdfb7651896f11fdb936e299952caf60c7eb364a | R | 10,609 | 215 | #' Compute the density of simulated doublets
#'
#' Identify potential doublet cells based on the local density of simulated doublet expression profiles.
#' This replaces the older \code{doubletCells} function from the \pkg{scran} package.
#'
#' @param x A numeric matrix-like object of count values,
#' where each co... |
2adbf7090991330fdb32caca4dd1cf8fd35155280eaf1b7616447923ab9ff588 | R | 10,618 | 246 | library(nipals)
library(parallel)
library(reshape2)
library(scales)
library(ggrepel)
library(grid)
library(dplyr)
library(Seurat)
library(ggplot2)
library(gridExtra)
numCPUs = 4 # parallel testing of celltypes
dataPath = "data/"
figurePath = "Figures-and-Tables/"
integrSeuratFile = paste0(dataPath,"seurat-integr-with... |
40a08d41eb8295a00ef518283f5e1777cf73cf8e3e21c71e028e8072caf1c5b9 | R | 10,623 | 360 | # human brain up&down devCE hexamers summary
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(Biostrings)
library(ggplot2)
library(ggrepel)
library(ggview)
# up ----------------------------------------------------------------------
# up
human_brain_up_devCE <- readDNAStringSet(
... |
876526f06c18e13a9bc825cf1732f6deb384b30f22bea86635b5b0e39e2a3cf1 | R | 10,655 | 255 | # ¼ì²éÒ»ÏÂcoding UCRÏà¹Ø»ùÒòµÄÔÚÈËÀ࣬´óÊóºÍСÊóµ±ÖÐÊÇ·ñÊÇͬԴ»ùÒò
# ÊÇ£ºUCRÈ·±£ÁË»ùÒòµÄ¹¦ÄÜ
# ·ñ£º¿ÉÄÜÊÇUCR±¾ÉíµÄ¹¦ÄÜ
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(dbplyr)
library(stringi)
# mouse -------------------------------------------------------------------
# mouse£ºmou... |
df1c63b7a6b11a6baeef846c335e6da65d20d22bcae3f1e274df95886c80f56d | R | 10,658 | 190 | # 20 Dec 2019 Siwei
# plot all 6 AA/AG/GG isogenic lines of VPS45
plot_VPS45_6_lines_q20 <- function(chr, start, end, gene_name = "VPS45",
mcols = 100, strand = "+",
x_offset_1 = 0, x_offset_2 = 0, ylimit = 400,
tr... |
99538722520fb437cc30e7ded5349aa30aa814b81090f94baf1b0c0f4d116c02 | R | 10,659 | 296 | require(optparse)
require(tidyverse)
require(ggpubr)
require(cowplot)
require(ggvenn)
require(extrafont)
require(scattermore)
# variables
# formatting
LINE_SIZE = 0.25
FONT_SIZE = 2 # for additional labels
FONT_FAMILY = "Arial"
PAL_SINGLE_DARK = "darkgreen"
# Development
# -----------
# ROOT = here::here()
# RAW_D... |
06e4057ce9068d428e147fec919ec48b7fdad990923ab25515eac50fe9afb2ab | R | 10,680 | 334 | #Antennal recordings stats
# Libraries
library(dplyr)
library(ggplot2)
library(lme4)
library(emmeans)
library(car)
library(tidyr)
library(glmmTMB)
library(gridExtra)
## load data
loca = '~/OneDrive/Desktop/Beelab/Mike_paper/2024-Nov-data/stats'
setwd(loca)
filename = "df_antennal_data_2024_named.csv"
df = read.csv(f... |
631ad55b436944dbd3e7e324bc951084e196aa61edfab623ca63d691a584a7db | R | 10,742 | 301 | ####
library(readxl)
library(jaffelab)
library(readr)
library(pracma)
library(RColorBrewer)
options(width=100)
dir.create("swirl_pdfs")
## read in reference data
ref = read_excel("raw_data/Swirl_expected_expression_revisionMNT.xlsx")
ref = as.data.frame(ref[,1:5])
ref_mat = as.matrix(ref[,2:5])
rownames(ref_mat) = r... |
4d1f46062267ca780e67f156bb14bd7d496e68dee8c28a05baf92559ee719652 | R | 10,758 | 207 |
## Effect size scatter plots for bulk/neuronal/non-neuronal Age effect sizes ##
library(ggplot2)
library(viridis)
library(grid)
library(VennDiagram)
'%ni%' <- Negate('%in%')
ES.plot <- function(res.df, col1, col2, xlim, ylim, xlab, ylab, scale.factor=100){
X <- res.df[,col1]
Y <- res.df[,col2]
df <- data.frame(... |
b40010a3f2226dbd99a1e3593f6b3ddffbc1c6730574d8c2cc62a6ab77a4cf63 | R | 10,783 | 253 | library(DESeq2)
library(tidyverse)
library(regionReport)
library(IsoformSwitchAnalyzeR)
library(stringi)
directory <- 'results/flair/4_quantify/'
#directory <- 'results/flair/5_diff/'
flair_df <- read_table(paste0(directory,'tau_control.counts.tsv'))
colnames(flair_df) <- c("gene","tau1", "tau2", "tau3", "ctrl1", ... |
ed881900f5e15f48451bbade95b716f1a94598b7bd75cbd1a18ab37ed16d7b55 | R | 10,791 | 223 |
# Contains the functions to plot DNA methylation against a continuous variable e.g. Age.
# Option to colour points (`colourBy`) and change plot character (`pchBy`) by a discrete variable e.g. Sex.
# Option to add loess fitted lines over data. Multiple lines can be fitted based on discrete variable specified in `loessB... |
6d88549cc51adcfb968418e78047beb3178e2c53961906576ac23fc18c575362 | R | 10,804 | 319 | # Siwei 27 Sept 2023
# Make Jubao's table into bubble plot
# init
{
library(readxl)
library(ggplot2)
library(RColorBrewer)
library(stringr)
library(scales)
}
df_raw <-
read_excel("MAST_case_control_diff_Gene_to_R.xlsx")
df_raw <-
df_raw[-(24:33), ]
# split into ups and downs, since downs require their... |
0d1cc8976a4be1d7882e6036b67b57039f89f78176e812011a6bc9fcb1113520 | R | 10,818 | 343 | library(data.table)
library(dplyr)
library(devtools)
setDTthreads(1)
# Load snpMap
load(
"/dcl01/lieber/ajaffe/Brain/Imputation/Subj_Cleaned/LIBD_merged_h650_1M_Omni5M_Onmi2pt5_Macrogen_QuadsPlus_dropBrains_maf01_hwe6_geno10_hg38.Rdata"
)
snpMap <- as.data.table(snpMap)
# Read the GWAS files
hg19_gwas_si <-
... |
cc082c3038ddb3426318c4c9f9d014332de20fce4230b57dd1579d5762a6885f | R | 10,879 | 308 |
## Created by Dr Rebecca Smith ##
# Edited by Alice Franklin #
miniman <- function (data = NULL, chr = NULL, cpg = NULL, range = NULL, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, pch = 1, main = NULL, col = "black", cex = 1, result = NULL, pad = 30000, multiply = NULL, nullcol = "black", negcol = "black", p... |
089e97eae85b3b64f6db5d6a1477db315f49b3931546550d05d4f35c7a2de270 | R | 10,883 | 315 | rm(list = ls())
library(PanomiR)
library(dplyr)
# Covariate definition
data.dir <- "data/preprocessed/"
output.dir <- paste0("output","/")
input.dir <- paste0(output.dir,"preprocessed/")
output.DEG <- paste0(output.dir,"DEPaths_bulk_update/")
if(!dir.exists(output.DEG)) dir.create(output.DEG,recur... |
a845160055c361b9d09eab7ce66b410bd1b958d33709ee8177bfba13405bb985 | R | 10,883 | 250 | #load arguments
#1: parameter df file path
#2: summarized output file header
#3: which column (name) indicates the final output file header?
#4: regular expression contains the pattern of target cell types
#5: if the statistics of the target cell type should be extracted or not
#6: if the influential gene analysis sho... |
8603347a1e1a629a381cfdf81c67625bc9a20e099be475932af5ebf00fe80975 | R | 10,898 | 271 | library(tidyverse)
#' read in and combine tables containing per-sample PATR statistics
process_combine_tbls <- function(stats_path, stbl_path, overlap_path,
stbl_cols_to_drop = c("strandedness", "bam")) {
# read in per sample 'stats' table containing PATR counts passing filters
... |
b6078482e0419e6f99bf7cc32544e825511729f70b4fdc4341a17de2b976cd80 | R | 10,920 | 314 | # ÕâÀïÊÇSNPµÄµÚ¶þ²½QC£ºÉ¸Ñ¡ËùÓдæÔÚÖ¤¾ÝÖ§³ÖµÄSNP·ÅÔÚÎļþpassed_XXX_SNPs.RdataÎļþÖÐ
rm(list = ls())
setwd(dir = "D:/R_project/UCR_project/02-analysis/04-SNP_Quality_Control/")
library(tidyverse)
load("D:/R_project/UCR_project/02-analysis/03-SNP_INFO_Retrieval/filtered_UCR_SNP_with_evidence_v1/filtered_ucr_snp_info_c... |
880ac63e6934faac7ffb01fd65a3aa4f12cf30c57b346d88ffe10ba4745e7a3e | R | 10,944 | 279 | # ================================================================
# DEG Overlap Analysis: Organoids vs Post-mortem Tissue for the categorized DEGs
# This script:
# 1. Loads categorized DEG CSVs from organoid and postmortem studies
# 2. Filters DEGs by adjusted p-value < 0.05
# 3. Creates Venn diagrams with Fish... |
100c715cc31f3f2f3ff36c13856c7af5262a12c90898ad86c726c6bb446f20e8 | R | 10,948 | 279 | #actual RNAseq QC
library(cqn)
library(sva)
library(biomaRt)
library(preprocessCore)
library(Hmisc)
library(CovariateAnalysis) # get the package from devtools::install_github('th1vairam/CovariateAnalysis@dev')
library(data.table)
library(plyr)
library(tidyverse)
library(psych)
library(limma)
library(edgeR)
library(bio... |
f4d5a7bd855338761c754f91f5d4034f995cff6a3f296e4dcd57732be6822311 | R | 10,954 | 223 | # lm model
library(car)
results <- list()
for (gene in rownames(combat_data)) {
model_formula <- as.formula(paste("`", gene, "`", " ~ Age + Sex2",sep = ''))
model <- lm(model_formula, data = combined_data)
# b Slope
coefficients <- coef(model)
# p
anova_result <- Anova(model, type = "II")
#
diff_... |
64554ff3b1a2fef0ec7d883cc8ed77c29cd855f86bae2a6e6ac90f6f37659f31 | R | 10,992 | 294 | ############################################################
# DEG Overlap Analysis (Less Stringent)
#
# This script:
# 1. Loads DEG CSVs from organoid and postmortem studies
# 2. Filters DEGs by adjusted p-value < 0.05
# 3. Creates Venn diagrams with Fisher’s Exact Test
# 4. Saves statistical summaries and su... |
43a4ec17380022eab812ecaa31c0e8f5c2b12f3e5aba1566838ccc07a52cef90 | R | 11,013 | 359 | library("SummarizedExperiment")
library("tidyverse")
library("sessioninfo")
library("here")
library("jaffelab")
library("recount")
library("viridis")
library("ggrepel")
library("GGally")
library("vsn")
## prep dirs ##
plot_dir <- here("plots", "09_bulk_DE", "02_bulk_pca")
if (!dir.exists(plot_dir)) dir.create(plot_dir... |
191640f0f72c675021c6393b179954f1b2584522acea36e55f8256eb8cd4a745 | R | 11,026 | 222 | ---
title: "20240614_Integration_ThreeSpecies"
author: "Yuanming Liu"
date: "2024/6/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
# BLAS/LAPACK: /sfs... |
bd5d67f95753c40056e76c5e8af9c52c00d60f2c08755cdca26939af5ff5cc33 | R | 11,039 | 337 | ---
title: "Custom bar plots for EWCE results from rare variants - Mathys 2019"
author: "Isabel Castanho"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
toc_float:
collapsed: false
toc_depth: 4
code_folding: hide
---
---
Mathys et al. 2019 single-nucleus RNA-seq data
singl... |
8490a651b5a190cc0955d7155689152c06902b5a7741436e0441a74b9db42f57 | R | 11,048 | 396 | library(rmarkdown)
library(markdown)
# shiny app
library(shiny)
library(shinyjs)
library(bs4Dash)
library(shinyWidgets)
library(shinybrowser)
# library(shinymanager)
library(shinyvalidate)
# Plotting
library(ggplot2)
library(gridExtra)
library(plotly)
library(heatmaply)
library(ggpubr)
library(ggupset)
library(ellipse... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.