sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
793c1e9c6378c1963455122a2e1f7e6b2b02fcc60376118134f995bc11276606 | R | 4,459 | 92 | library(zoo)
library(tidyr)
library(dplyr)
library(ggplot2)
library(readr)
library(readxl)
library(here)
library(magrittr)
library(MetaNeighbor)
library(reshape2)
library(gplots)
library(conflicted)
conflict_prefer("first", "dplyr")
conflict_prefer("rename", "dplyr")
conflict_prefer("filter", "dplyr")
conflict_prefer("... |
7251e074008f23a885a7fd54ac6320cd7b0d27bdebc9fdea33c2ec8924ed6d9e | R | 4,463 | 99 | library(readr)
library(tidyverse)
library(dplyr)
#### import TPM Count matrix with gene id ####
adjusted_TPM_id_df_R <- read.table("/home/joonho345/1_Epilepsy_RNA/RNA_Animal/08.Enrichment/GSEA_01.Matrix_GTF/adjusted_merged_matrix_id_TPM_R.txt",
sep = "\t", header = TRUE, row.names =... |
cf98a76bca631a8f53d925b53a97158b9f99f9952659fd6db204a4d2888bc9f9 | R | 4,463 | 112 | # R script for generating a bar chart comparing correlation values for different models
# Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi)
# Last updated: 17-Feb-2025
#
# Description:
# This script generates a grouped bar chart with error bars to compare correlation values
# across... |
27b42f4f6b73ec4a259f682855c6026b27bfe2ad5feb64236c30beefc0dd2150 | R | 4,471 | 136 | setwd("/projects/radlab/Wan//NSF/CoMemEmpirical/")
options(Seurat.object.assay.version = "v3")
library(tsImpute)
library(aricode)
library(Seurat)
library(mclust)
calc_acc <- function(true_labels, clusters) {
error_rate <- mclust::classError(clusters, true_labels)$errorRate
return(1 - error_rate)
}
calc_f1 <-... |
47f69663ccb1edb6f4bc3f819ac31a22f08adb0fb3fa8f4110b122ecff9e6c0f | R | 4,471 | 106 | #' banc-fanc-mesh-transform — Transform FANC neuron meshes into BANC space.
#'
#' For each FANC v1.116 root_id, fetches the OBJ mesh via `fancr` and
#' applies the FANC → JRCVNC2018F → BANC registration chain. Saves to the
#' per-version BANC NBLAST mesh tree.
#'
#' @section Reads:
#' - `<banc.meta.save.path>/fanc_me... |
86b2e22d77d40b7faaab580d938a57af7ca679fd6402719d9a5d714a251f7ef0 | R | 4,485 | 101 | library(foreach)
library(doParallel)
## Calculate the significance proportion of real, bootstrap and jackknife group difference
setwd('/home/huyang/Projects/HuYang/HY_20251111')
## Set parallel cluster to speed up
n.cores <- 20
my.cluster <- parallel::makeCluster(n.cores, type = "FORK")
doParallel::registerDoParallel(c... |
9e2f58749d897f5d0acd9aae4717bb78b0ab6576c866405c98791a5195866776 | R | 4,486 | 162 | suppressPackageStartupMessages(require(fs))
suppressPackageStartupMessages(require(magrittr))
my_FindM <- function(
object, ident.1, ident.2=NULL, features=NULL,
p.thres=0.05, padj.thres=0.05, ...
) {
M <- suppressMessages(Seurat::FindMarkers(
object = object, ident.1 = ident.1, ident.2 = ident.2,
features = f... |
39b3695d3d7cae66101804da15792c4f6a182e1dc69f437b1b3e7a73ca7de6d5 | R | 4,487 | 76 |
library(arrow)
library(Seurat)
library(dplyr)
gene_info <- read.delim("0.human_gene_info_from_Ensembl.mod", header =T, sep = "\t")
feather1 <- read_feather("cisTargets/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather")
feather2 <- read_feather("cisTargets/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feathe... |
1b01fb88fcaa789d5263e733a8d5b3d7b09bd127a2f00385113c97d1af85fd0b | R | 4,498 | 135 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
1afe26b3e73cef22fc6864869f96306884fb59f30c738e703651e2f26f939559 | R | 4,507 | 138 | #!/usr/bin/env Rscript
suppressPackageStartupMessages(library("argparse"))
# create parser object
parser <- ArgumentParser()
# specify our desired options
# by default ArgumentParser will add an help option
parser$add_argument("-i", "--RData", required=TRUE, help="clustered RData with pmat")
parser$add_argument("-n"... |
c9d965b36c40cfea1d84958c4f14dd21a4efa14fadc60a080d12a195cd63e2ca | R | 4,507 | 123 | library(RSQLite)
library(purrr)
library(dplyr)
library(limma)
library(parallel)
library(DBI)
# Set working directory to project root
# setwd("path/to/project/root")
###############
## PARAMS
###############
models = c('MODULE')
target_file_path = c("./genotype/")
name_site = "your... |
e3103be0039beb92684238dc6007cb33b9f7962f05a5c818ee026df9477e671d | R | 4,513 | 117 | # ========= CHCHD10 vs Age (pooled; AD vs NC only, no other covariates) =========
suppressPackageStartupMessages({
library(dplyr); library(readr); library(ggplot2); library(broom)
})
# --- paths ---
BASE <- "/home/cxy605/Synapse/ROSMAP_scRNAseq/Excitatory_Neurons"
OUT_DIR <- file.path(BASE, "CHCHD10_pathology_p... |
d77a664fbe9cbc667586b4e2609ae592e1c76b140e187b5ab501b60f136be2d7 | R | 4,515 | 129 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
96e650fce221b931535ff20ae13c904ac234c7c9a8af2b47d1f7f9cf86c44b7b | R | 4,517 | 109 | here::i_am("scripts/1.neural_differentiation_dataset/1.3.CroCoNet_analysis/1.3.2.CroCoNet_analysis_with_top50_pruning.R")
library(CroCoNet)
library(tidyverse)
library(here)
input_dir <- here("data/neural_differentiation_dataset/CroCoNet_analysis/")
output_dir <- here("data/neural_differentiation_dataset/CroCoNet_anal... |
65793041ceb1c9aa07f42bf2ead588a3e0c5fe63e0258f060ea57769506184d7 | R | 4,518 | 131 | #' @title Support Vector Regression for symptom mapping
#'
#' @description
#' Lesion to symptom mapping performed on a prepared matrix.
#' The SVR method is used. The function relies on the
#' \code{\link[e1071]{svm}} function of the e1071 package. The
#' analysis follows a similar logic found in the SVR-LSM code publi... |
e7d24c4fc02f243b928b40b1d1515bd1c88c636863c6d7b9ad5495aa558c92e7 | R | 4,519 | 143 | ########################################################################################
### Cladogram - Endobiotics Cohort Metagenomic GUSome
########################################################################################
### Usage
# Rscript ggtree_Endo_14_MGX_v3.r
##########################################... |
e71d94f04e1da6913c8a8120c250c9ae3b85d80a2b1d35996649cbc48b87d8f5 | R | 4,523 | 48 | ---
title: "SAMBAR: Subtyping Agglomerated Mutations By Annotation Relations"
author: "Marieke L. Kuijjer"
date: "2018-06-05"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{SAMBAR: Subtyping Agglomerated Mutations By Annotation Relations}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UT... |
2ceefbddc064c08eeab1426a0d554a61fc307926c718c1ff9e8b6c7f8755cd9d | R | 4,527 | 139 | #!/usr/bin/env Rscript
#-------------------------------------------------
# Title: Summarize alignment rates
# Author: Amanda Zacharias
# Date: 2023-06-30
# Email: 16amz1@queensu.ca
#-------------------------------------------------
# Notes -------------------------------------------
# module load nixpkgs/16.09 gcc/7.3... |
1edd6d2e17952058b9f500fed366aa88c0ac58cff6fa7a2c7e924da16c1397b7 | R | 4,528 | 90 | # NL26-1 did not have any non-malignant cells identified so I will be using the reference cells from its initial tumor
library(infercnv)
# Sample-level counts matrix for both initial and recurrent tumors
counts_initial <- readRDS("/vast/palmer/pi/verhaak/kcj28/care_mut/processed_data/rna/infercnv_inputs/astrocytomas... |
384502d699b6d73461294d916ec5774fb84252c39fe978fbbfd9ac6d00763220 | R | 4,529 | 162 | # Proteomic Analysis for Ferret Brain samples
# Jordan Wight, PhD
# jordan.wight@phac-aspc.gc.ca / jordan.wight@mun.ca
# Public Health Agency of Canada, National Microbiology Lab, Special Pathogens
###############################################################################
# Load required packages
library(data... |
5c1a33555905184512c50e50dbc4b029af7c49c2014dd0f262603a6bebad7947 | R | 4,532 | 139 | #!/usr/bin/env Rscript
suppressPackageStartupMessages(library("argparse"))
# create parser object
parser <- ArgumentParser()
# specify our desired options
# by default ArgumentParser will add an help option
parser$add_argument("-i", "--input", required=TRUE, help="load subset RData")
parser$add_argument("--cpu", def... |
7a1fa1774138517a17d7ddb16d758d74dffd3c896397e402f6cb7b33015cbad9 | R | 4,536 | 155 |
new_mlflow_client <- function(tracking_uri) {
UseMethod("new_mlflow_client")
}
new_mlflow_uri <- function(raw_uri) {
# Special case 'databricks'
if (identical(raw_uri, "databricks")) {
raw_uri <- paste0("databricks", "://")
}
if (!grepl("://", raw_uri)) {
raw_uri <- paste0("file://", raw_uri)
}
... |
80b02c637591a072063f0c90070a2c4f5bbd3246a30a6b49e39fe6378a33a8d4 | R | 4,536 | 127 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
a84af7b77bdef67c9783d0179c0cb452d9bf84a967adad1466fbebee670c94cb | R | 4,537 | 139 | #!/usr/bin/env Rscript
suppressPackageStartupMessages(library("argparse"))
# create parser object
parser <- ArgumentParser()
# specify our desired options
# by default ArgumentParser will add an help option
parser$add_argument("-i", "--input", required=TRUE, help="load subset RData")
parser$add_argument("--cpu", def... |
d837e4a5c56335d6eb2b199e06ddc468895bcb848912d6ee72ffe29daec2a36c | R | 4,537 | 139 | #!/usr/bin/env Rscript
suppressPackageStartupMessages(library("argparse"))
# create parser object
parser <- ArgumentParser()
# specify our desired options
# by default ArgumentParser will add an help option
parser$add_argument("-i", "--input", required=TRUE, help="load subset RData")
parser$add_argument("--cpu", def... |
e4e58bf03ac357636b15cbfc4bdc55f51c007ceb4a1a7c2cb680110994f71298 | R | 4,537 | 130 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
cf41b795b249e5a3bf28c04cac2f07c85f5fc24da4d15b3b97dd412619728b35 | R | 4,540 | 140 | #!/usr/bin/Rscript
# ------------------------------------------------------------------------------
#
# Author: Gabriele Girelli
# Email: gigi.ga90@gmail.com
# Version: 2.0.0
# Description: filter and deduplicate UMIs
#
# ------------------------------------------------------------------------------
# DEPENDENCIE... |
b4b7b3ee4a32d6195dd33644b57a110555c21dab2df405470115e204990b0b6e | R | 4,541 | 125 | sample_store_diag_gamma <- function(data, par_names, iters = 1, stage = "init", integrate = T, is_nuisance, ...) {
subject_ids <- unique(data$subjects)
n_subjects <- length(subject_ids)
base_samples <- sample_store_base(data, par_names, iters, stage)
par_names <- par_names[!is_nuisance]
n_pars <- length(par_n... |
b4a161049143a0bd80a6b4c32cb64fcc7b8b167b77f0909b9f34efe822545ad6 | R | 4,545 | 130 |
# Load required libraries
required_packages = c("purrr", "limma", "dplyr", "tidyr", "tidyverse","data.table")
for(pkg in required_packages) {
if(!require(pkg, character.only = TRUE)) {
install.packages(pkg)
library(pkg, character.only = TRUE)
}
}
# Set working directory and base directory
# set... |
ee646c8d9640cd288fa7cb3965f09298f4da48ca85b92da5966cf7d4aae3d7e9 | R | 4,547 | 128 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
5c28e99d1d713caf2d641f345cdae0c0fea27418916a252150b518cb6eea1ea4 | R | 4,551 | 138 | ### -----------------------------------------------------------------
### Legacy exploratory analysis by a member of the Wilson Lab.
### Historical record only — not part of the bancpipeline release.
### -----------------------------------------------------------------
# Get list of DN/AN inputs and outputs from pC1s ... |
528da76760219c30bf75bfae5f03759c1a8daaa424b4083377569381450ac8e4 | R | 4,553 | 201 | ---
title: "Batch correct data using Harman"
author:
- David lukacsovich^[University of Miami]
- Lily Wang^[University of Miami]
date: "`r Sys.Date()`"
output:
rmarkdown::html_document:
highlight: pygments
theme: lumen
toc: true
number_sections: true
df_print: paged
code_download: false
... |
fc4b9ef2509dfadbc7e688d346c67b9df1eb034f93c2ab02eaf1d648dd40ee0b | R | 4,553 | 113 | # Hai Wang
# Explore the relationship between p-values and importance scores
library(data.table)
args <- commandArgs(trailingOnly=T)
tissue <- args[1]
############################################################################################
# load eQTL data
##############################################... |
90f3f1b01313a2655c0f13e58bfdc0762fa1c0b3e84659e145d7dc36d8f641e7 | R | 4,556 | 110 | #!/usr/bin/env Rscript
## Author: Luuk Harbers
## Date: 2022-10-22
## Script to plot GPSeq Pizza plot
# Function for saving
# Function to save a plot in different file formats and show it within the notebook
save_and_plot <- function(x, bname, width, height, dpi = 300,
use.cowplot = FALSE, ... |
40cb6c6417c8743e0c7a0807e5686646ad1f1798f6f4bd4cc0889b011f0b8cb6 | R | 4,557 | 80 | #NOTE: the Java wrapper for this script first sources CNVPlottingLibrary.R
options(error = quote({dump.frames(dumpto = "plotting_dump", to.file = TRUE); q(status = 1)})) # Useful for debugging
library(optparse)
library(data.table)
option_list = list(
make_option(c("--sample_name"), dest="sample_name", action="... |
22d3ac70a4520f8e971e055a6a6f1b8d263b4d5a3b3e556fa4c7f57df53d882e | R | 4,562 | 136 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
0e122c1921b675f8df695279301e2981f733a7a6d5410dbb53ea98b452807f30 | R | 4,564 | 118 | library(ggplot2)
#### Define TPM matrices to process ####
tpm_matrices <- c(
"merged_matrix_TPM_R",
"adjusted_merged_matrix_TPM_R"
)
#### Read coldata (once, before loop) ####
coldata_df <- read.table("/home/joonho345/1_Epilepsy_RNA/RNA_Animal/02.Quantification/filtered_coldata_R.txt",
se... |
1a6326d8fb2e56f6181dc2cb5c44a2eb17f29477d170bcaef758de3595db2718 | R | 4,564 | 132 | ################################################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#DESI in-vivo Lipid Mass Spec Decomposition
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#################################... |
f0ccc2ffc3559201b2458cb9ec8fe759331b7226b72d7dcb9ff3f26a3399417e | R | 4,572 | 71 |
library(arrow)
library(Seurat)
library(dplyr)
gene_info <- read.delim("0.mouse_gene_info_from_Ensembl.mod", header =T, sep = "\t")
feather1 <- read_feather("/mnt/data01/yuanzhen/01.Vertebrate_cell_evo/09.GRNs_detection/1.mouse/0.bin/cisTargets/mm9-500bp-upstream-7species.mc9nr.feather")
feather2 <- read_feather("/mnt/... |
186e315b130c1d2279c8eee150258d4864de81b9fdaf693a410ade156c394140 | R | 4,580 | 129 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
9c3072e35f319167bff018ac0e61da7c34a4b23b40270a05ad289dbfdd89de0f | R | 4,582 | 131 | # ==============================================================================
# Load RNA-seq Data
# ==============================================================================
# This script loads and prepares RNA-seq expression data
#
# Author: Osama Shiraz Shah
# =================================================... |
b3dcb881e0e87d83f22d00a20af383860aa9a918f17b2a775fb31def8fe2d697 | R | 4,586 | 135 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
e2eb918d6e23a02a82cd194933caf9ffc2f9236208cb6953ce888ec61c2dc21f | R | 4,589 | 152 | library(tidyverse)
library(ergm.ego)
library(lubridate)
library(igraph)
library(intergraph)
library(matrixStats)
library(mice)
data <- readRDS("baseline_data.rds")
data <- data[which(data$redcap_event_name=="baseline_arm_1"),]
data$elig_date <- ymd(data$dg_date)
data$elig_age[is.na(data$elig_age)] <- data$elig_age2[is... |
ffda420dc2c6c8e13353749bd2f6b3fb0b9d80093a39b2165dbf2b94e7f30fb6 | R | 4,598 | 139 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
8541e70e4ef39d2486b867bc3fa5ca53dea5d40e021d648b93b9b739dfcafe55 | R | 4,603 | 132 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
0982d69a4bb09c8a707cf0f4611d34505bf25ba0459dbb44b7c705d7587d24fa | R | 4,607 | 70 | #' Assign initial modules
#'
#' Assigns initial modules by taking the top \code{N} target genes of each provided transcriptional regulator.
#'
#' In the CroCoNet approach, the center of each network module is a transcriptional regulator. The modules are assigned in 2 main steps: 1) large initial modules are created by ... |
8a5c180bc95c69da15378cff1da483af755f16c5c40df63d92527e62b374433a | R | 4,607 | 126 | #' Add a transformation to one or more layers in a neuroglancer scene
#'
#' @param x A neuroglancer scene as produced by \code{\link{ngl_decode_scene}}
#' @param reg A registration either as a \code{\link[nat]{reglist}} containing
#' multiple registrations or a single registration in any form handled by
#' \code{\l... |
e3a479cf16a53c5174f517fccd26f81173bad8bf96411d8adf5caf90a4da7df1 | R | 4,609 | 118 | #' banc-fafb-mesh-transform — Transform FAFB (FlyWire v783) meshes into BANC space.
#'
#' For each FAFB-v783 root_id, fetches the OBJ mesh and applies the
#' FlyWire-JRC2018F-BANC registration chain. Saves the transformed OBJ to
#' the per-version BANC NBLAST mesh tree. Resumable.
#'
#' @section Reads:
#' - `<banc.me... |
3580671fde635471e0001b81c3b491bbe54e6fd4326f83f597060b6c122309b8 | R | 4,612 | 135 | #' banc-csv-feather-convert — One-time migration: CSV → per-metric feather files.
#'
#' Reads the legacy monolithic `banc_root_positions.csv` and splits it
#' into the per-metric feather files the modern pipeline expects.
#' Run-once migration; safe to invoke idempotently.
#'
#' @section Reads:
#' - `<banc.save.path>... |
5aef284448de44e3ceb9cdf9206986cea2cd607bc3c5aa480897285647813dc0 | R | 4,615 | 99 |
#install.packages
library(Seurat)
library(ggplot2)
library(DoubletFinder)
library(dplyr)
library(cowplot)
library(reshape2)
library(MAST)
setwd("/athena/ganlab/scratch/lif4001/DVPV/integration_both")
DVPV_integrated <- readRDS("DVPV_integrated_PCA_0.1.rds")
Idents(DVPV_integrated) <- "seurat_clusters"
#Remove cluster ... |
3fba272badf8bc63b3809e1100583e2323b92071a9c8fd4bb63f519771f17844 | R | 4,616 | 116 | ### -----------------------------------------------------------------
### Legacy exploratory analysis by a member of the Wilson Lab.
### Historical record only — not part of the bancpipeline release.
### -----------------------------------------------------------------
# Script to load query neurons from BANC (using f... |
cf40951ac0635ab048f206908a57a7b9aa2fba251264e71c30211c0a88c7a52c | R | 4,624 | 113 | #' banc-ids890 — Standalone root_890 backfill for SeaTable banc_meta.
#'
#' Cloned from `banc-ids888.R` for the v888 → v890 migration. Runs
#' independently of `banc-ids.R`. Resolves `root_890` from `supervoxel_id`
#' via CAVE and pushes back to SeaTable. Idempotent. Includes a clear
#' fallback if the `root_890` SeaTa... |
fabc516424b972c17af7060d87ec60bc10cf0c80181920f8ad09cb8103f09b3d | R | 4,629 | 165 | .multinomial_softmax_probs <- function(trials, utility) {
max_u <- ave(utility, trials, FUN = max)
exp_u <- exp(utility - max_u)
denom <- ave(exp_u, trials, FUN = sum)
exp_u / denom
}
.multinomial_probit_trial_probs <- function(utility) {
n_alt <- length(utility)
if (n_alt == 1L) return(1)
if (n_alt == ... |
8ba13c2403b4309825106755aa955f0d647873bc85cc1dc95d134c64e1723f33 | R | 4,632 | 100 | ### Extract internal standards from all samples of _In vitro_ lipidomics
## ------------------------------------------------------------------------------------------------------
rm(list = ls())
library(tidyverse)
library(ggthemes)
library("scales")
library(ggpubr)
library(ggbeeswarm)
library(stringi)
library(openxlsx... |
b0892bc8521b36d16f3f085c617051a9255f044c589815680359199a03dfab7c | R | 4,633 | 113 | #!/usr/bin/Rscript --slave
# QR_example_code.R
# 16th January 2026
# Modified: 16th January 2026
# Author: Richard G. Carson (richard.carson@tcd.ie)
#################
# Read the data file
data <- read.csv("example_data.csv", header=TRUE, stringsAsFactors=FALSE)
# Ensure data are numeric
data["mep_amplitude"] <- a... |
c184f054ea6b2916dfca63e79cfedccf4be69fea52be8a1320ed7a3b9fa59ca5 | R | 4,636 | 136 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
8a3c3ef16d9560389c4e1721123d86df35d73b8b45d324ddfd03f9ad82f07e7b | R | 4,637 | 71 | blast_global_sort<- function(bl_local_fileloc,bl_global_fileloc,writeblast_fileloc){
if (length(readLines(bl_local_fileloc))>0) { #check is there any hits in the output
local_bl_tmp<-read.csv(bl_local_fileloc,sep="@",header=F);
bl_global<-read.table(bl_global_fileloc,sep="\t")
... |
22b30616e8aa269360153788e40251f48bbb92b5b5d58b0b31227a40d642814c | R | 4,639 | 150 | ---
title: "FAFB-FlyWire"
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
rgl::setupKnitr()
havelmr=require('elmr', quietly = TRUE)
options(nat.plotengine = 'plotly')
```
## Introduction
This articles gives a quick overview of mapping points between FAFB14 (as used
by the "wal... |
58656309bd5b6a1b4ced69a29771c5ad28e894eebf02c7670d8571657c7ae749 | R | 4,639 | 86 | here::i_am("scripts/4.paper_figures_and_tables/suppl.figureS6.R")
library(tidyverse)
library(ape)
library(ggsignif)
library(patchwork)
wd <- here("data/neural_differentiation_dataset/Spearman_network_inference_and_analysis/")
# load pruned modules
pruned_modules <- readRDS(here(wd, "pruned_modules.rds"))
# plot pru... |
2959b62567d59f4daca2c641582fc2b34022b34caaefc9aacbcf745419277fb7 | R | 4,640 | 155 | # Load necessary libraries
library(sf)
library(dplyr)
library(tidyr)
# Define helper functions
create_windows <- function(data, window_size, step_size) {
bbox <- st_bbox(data)
x_breaks <- seq(bbox["xmin"], bbox["xmax"] - window_size, by = step_size)
y_breaks <- seq(bbox["ymin"], bbox["ymax"] - window_size, by = ... |
6aa11501a0c578d23e772df85eb466c2e588871d52082c3eee89a8cc3188eb13 | R | 4,640 | 90 | library(data.table)
library(parallel)
library(dplyr)
library(purrr)
library(limma)
# Set working directory to project root
# setwd("path/to/project/root")
#####
### Params
####
### Params
target_file_path = c("./genotype/")
site = "your_geno_bim"
name_site = "your_geno_name"
... |
4ec856e6df510021fc1c49c4bfa7ece05b53e65c15a323218ced5239e059a851 | R | 4,641 | 97 | library(DESeq2)
library(ggplot2)
library(pasilla)
### Choose one matrix to analyze ###
coldata_df_M_KAI_IH_IPSI_A_HA <- coldata_df_M %>% filter(TYPE_2 == "M_KAI_IH_IPSI_A_HA")
filtered_samples_M_KAI_IH_IPSI_A_HA <- rownames(coldata_df_M_KAI_IH_IPSI_A_HA)
adjusted_df_M_KAI_IH_IPSI_A_HA <- adjusted_df_M[, colnames(adju... |
d909852eff58e751aaa3378092020576a4f52baabdf6338f90563d351c89ddab | R | 4,644 | 113 |
dLNR <- function(rt,pars){
rt <- rt - pars[,"t0"]
out <- numeric(length(rt))
ok <- rt > 0
ok[is.na(ok) | is.infinite(rt)] <- FALSE
out[ok] <- stats::dlnorm(rt[ok],meanlog=pars[ok,"m"],sdlog=pars[ok,"s"])
out
}
pLNR <- function(rt,pars){
rt <- rt - pars[,"t0"]
out <- numeric(length(rt))
ok <- rt > 0
... |
0ac87a485f1183abc238e7e5cb029777eba1d6860364f744d310600fc3e7cb49 | R | 4,645 | 142 |
```{r}
# Notes:
# - This script estimates GAMMs for SCFA outcomes using mgcv::gam() with a random intercept
# (s(study_id, bs = "re")) and a smooth for time (s(week_corrected)).
# - Nakagawa marginal/conditional R² are obtained by refitting an equivalent model via gamm4()
# (lme4 backend) and passing the mixed-mod... |
5bb03a61c053990c9b8eaa13c6fcb82b4b1a596addf9d0f7a6c2709372262385 | R | 4,646 | 120 | library(ggplot2)
#### Define TPM matrices to process ####
tpm_matrices <- c(
"merged_matrix_TPM_M",
"adjusted_merged_matrix_TPM_M"
)
#### Read coldata (once, before loop) ####
coldata_df <- read.table("/home/joonho345/1_Epilepsy_RNA/RNA_Animal/02.Quantification/filtered_coldata_M.txt",
se... |
46d4821311d32427813d5e41614b0a63443733296f0d2be3aa65367399f6e559 | R | 4,648 | 104 | library(foreach)
library(doParallel)
library(emmeans)
## Calculate the Cohen's D of real, bootstrap and jackknife group difference
setwd('/home/huyang/Projects/HuYang/HY_20251111')
## Set parallel cluster to speed up
n.cores <- 20
my.cluster <- parallel::makeCluster(n.cores, type = "FORK")
doParallel::registerDoParalle... |
a8540ff1c614a94b5af8f9b3af769725bdb67336677c79a891b187394181ab63 | R | 4,653 | 107 | ##
##Load regNet package
##
#- See https://github.com/seifemi/regNet for details how to install regNet.
library( regNet )
##
##Set the following paths according to your system
##
#- Must be modified to fit to your own system
#- Central project path prefix for regNet to store outputs of regNet
centralProjectPathPrefix... |
8824e9c82d5e601543f18affdd4ef8ac294317ea8b3e2616868f1dcefb1bd306 | R | 4,665 | 134 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
855af10c8b7bc98ed1d2c5470feff30e2e90384d196c7d8b6dddaab93329a05b | R | 4,669 | 135 | #' Sample spatial cluster visualization workhorse function for Visium data with
#' pixel based spatailCoords aligned to images.
#'
#' This function visualizes the clusters or categorical variables for one given
#' sample at the spot-level using (by default) the histology information on the
#' background. This is the... |
197b9a6eaf9657257b194b8cecda9c62a0491997f45016bafc687cecdb889939 | R | 4,677 | 134 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
6e6798091e6fd9a84727f5c399848a6ae05264db95f9023991f0a91be913f0c7 | R | 4,677 | 89 | # Load necessary libraries
library(dplyr)
library(pheatmap)
library(Cairo)
library(ComplexHeatmap)
library(circlize) # For colorRamp2
################################################
################ Cell types ###################
################################################
# Define cell types to be analyzed
cell... |
9f9307e08fb602af7bd9d2b6420faac9d297517eb19ee672c82f1b8c2d5dcf19 | R | 4,683 | 126 | #Generate a table of dynamic CREs associated with GWAS SNPs,
#including SNP p-values and effect sizes (betas), using three criteria:
#(1) CREs that directly contain GWAS SNPs, (2) CREs located within 2 kb of GWAS SNPs,
# and (3) CREs that contain SNPs in linkage disequilibrium (LD) with GWAS SNPs
library(GenomicRan... |
6ba68968b04e35f1c2992f72a127134423124c81c57f0e15da779befbbd4d2af | R | 4,685 | 136 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
841b8968c5c8b2d1b0f1a666eb2e241bb6edd71ebb4451b90a3f727a73b8748d | R | 4,686 | 144 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
3629affea8f08be6cfad3b1573f8185ec9865ee13ef0df0c308a309095a89000 | R | 4,689 | 152 | # Load libraries
suppressPackageStartupMessages({
library(ggplot2)
library(ggrepel)
library(ggpubr)
library(data.table)
library(RColorBrewer)
library(tidyverse)
library(preprocessCore)
library(future.apply)
library(DESeq2)
library(pheatmap)
library(sva)
})
dir.create("dge")
load("futcounts/Expression_Input.RData")
... |
1b6d4b064827f9fda3633884b05c33217b7694f983ebc462feaabda27ea544a4 | R | 4,691 | 196 | ---
title: "Fully Customed Venn Diagram"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Fully Customed Venn Diagram}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup}
library(g... |
8b99e2d9046a0b670071352a49bd7cb76f04a95b702d40139dd18fd2120febab | R | 4,694 | 162 | # banc/curation init: shared helpers + library loads for the curation
# scripts in this directory (banc_meta_*, banc_cell_representative_point,
# make_codex_annotations_flat_table_v888). source() this file from any
# curation script with:
# source("banc/curation/banc_curation_init.R")
# Originally authored by Helen... |
51de3eeebcd3bc062e3f21fef23ac197f8b6465cf88f04e917a005be59269d8e | R | 4,696 | 104 | # Set working directory to project root
# drive = "path/to/project/root"
# setwd(drive)
base_dir = getwd()
load("./predictions/LIBD_training/GTeX.v9/Combined/predictions_testing_data_lst.RData")
gtex = readRDS("../../dataset/GTEx/expression/rse_GTEX_cleaned_gtex.rds")
gtex$sACC = gtex$ACC
gtex$dACC = gtex$ACC
... |
d960f5c54dfd969140528a905d72617c87f0cf99dff12d9e288b7ad528eeb3ec | R | 4,697 | 125 | #' Filter reads for the highest mapq, and/or filter out supplementary and/or secondary alignments.
#' Requires data.frame containing bam flag information
#' Can remove whole the read that has a supplementary and/or secondary alignment or that particular alignment only.
#' @export
#'
get.best.aln <- function(bam, bam.f... |
559d1421a3537b646db88677b4a9434beebcd68a552e6da906ca2cfca800c088 | R | 4,703 | 142 | #' Load analysis data from a 10x Genomics Visium experiment
#'
#' This function expands [SpatialExperiment::read10xVisium()] by reading
#' analysis outputs from SpaceRanger by 10x Genomics.
#'
#' You might want to use `read10xVisiumWrapper()` instead of using this
#' function directly.
#'
#' @inheritParams read10xVisiu... |
d7bcc3c673d637d3c88f5d9b9b6796a0c32659442857d3c65f027f3b1989eb16 | R | 4,707 | 96 | setwd('~/d/sci/src/prp_mrm')
options(stringsAsFactors=FALSE)
library(sqldf)
library(reshape2)
peptides = read.table('data/ref/peptides.tsv', sep='\t', header=T, quote='', comment.char='')
metox = read.table('data/ref/metox.tsv', sep='\t', header=T, quote='', comment.char='')
runs = read.table('data/meta/runs.tsv', se... |
d8ed6878fdfc86290545437103b7f7f4479cdbfef5203454381107ef4cedf08c | R | 4,708 | 219 | ---
title: "Check genes associated with case-control status"
author: "Wei Sun"
date: "`r Sys.Date()`"
params:
cell_type_name: "CD8T"
output:
html_document:
theme: journal
highlight: tango
toc: true
toc_depth: 3
toc_float:
collapsed: true
smooth_scroll: false
number_sections: fal... |
411677cf142659b90ca8ef63da51be563df187cf69fedf5dc66be01436eae46b | R | 4,710 | 127 | #' Edit a background image
#'
#' This function uses the `magick` package to edit the color and perform other
#' image manipulations on a background image. It can be useful if you want to
#' highlight certain features of these images.
#'
#' The `magick` functions are used in the sequence represented by the arguments
#' ... |
e5b8e7b029d88a0c3edb4a70115cfb5292fbf7769b07e9b5069494d835ae2972 | R | 4,710 | 170 | #!/usr/bin/env Rscript
# Inspecting DE threshold analysis across all contrasts
# Analyzes gene counts at FDR: 0.5, 0.1, 0.05, 0.01
library(here)
library(dplyr)
library(tidyr)
# Configuration
config <- list(
out_root = here("03_Results/02_Analysis"),
thresholds = c(0.5, 0.1, 0.05, 0.01)
)
# Define all contrasts i... |
c71c716bae49f0c674eea001f3b8a79047ad745e97894145ab805e97d7ea149d | R | 4,715 | 144 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
258205dc8543b772cd7e6ff0176dc38ce494d6cc1aa7afd0c68a29c207defcfc | R | 4,718 | 116 | #'Shorten a Neuroglancer URL using the Janelia FlyEM link shortener
#'
#'@details The default filename for these fragments consists of the date and
#' time to the nearest second. For this reason you will have trouble generating
#' many of these links in quick succession. To overcome this limitation, you
#' can speci... |
42507b30b73143ed6700169126f4e6435c2b8506736f3c8b86a254634b223de8 | R | 4,719 | 106 | #' Investigates marker overlap between query cluster and database cell types
#'
#' Generates visualizations or summaries to explore marker overlap between a specified
#' cluster in the query data and cell types within the database.
#'
#' @param ann An object containing `ann1$query` and `ann1$db` data frames.
#' @param ... |
246b64ed07f045a95e6474a5a60bc4574963b0d43664cc515c081fa1e137cc88 | R | 4,720 | 142 | ---
title: "Conos alignment of all datasets"
output: html_notebook
date: "`r format(Sys.time(), '%d %B, %Y')`"
---
```{r, message=FALSE, warning=FALSE}
# library(Epilepsy19)
library(dataorganizer)
library(magrittr)
library(Matrix)
library(pbapply)
library(conos)
library(readr)
library(tidyverse)
theme_set(theme_bw())... |
ef9b016b5dc02eb25a65e92223e91dcf698b836fe9354768cebdb6e426bc5dec | R | 4,721 | 108 | #!/usr/bin/env Rscript
# verify_design_matrix.R
# Reproduces the DGEList + design matrix exactly as 1.1.main_pipeline.R does.
# Run: Rscript 02_Analysis/verify_design_matrix.R
# ------------------------------------------------------------------
suppressPackageStartupMessages({
library(edgeR)
library(dplyr)
})
# ─... |
2d08aa6ee13399ec0b2597a642e47a33badd772b74609dc4c8449d6d601f1b1f | R | 4,725 | 149 | #' Read draco encoded 3D meshes from tarballs (as used by Janelia FlyEM)
#' @description the low-level \code{read_draco_meshes} reads meshes from tarballs
#' @param x A URL to a remote location or path to a file on disk
#'
#' @return A \code{\link{neuronlist}} object containing
#' \code{rgl::\link[rgl]{mesh3d}} obje... |
2ccc08bbd89a3dc0b6014ea93eda48a39d7710103ba915788f3ed286ad26258e | R | 4,726 | 141 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
82c87aee1acad494eca156f6a8537798b0d4f857802d196bb086488e47ebd7f9 | R | 4,735 | 125 | #!/usr/bin/env Rscript
## 5b.highlighted_upset.R
##
## Concern: add a highlighted bar to the nine-contrast UpSet
## plot (Supplementary Fig. S6) AND a maturation-only three-contrast UpSet
## as an alternative view. Both outputs go to a NEW directory — the original
## UpSet_plot_all_contrasts.pdf is NOT modified.
##
## ... |
1936ca76331a792a6035c4bc84604ccbc4fbd9bcd23e46518096390636081a6c | R | 4,748 | 133 | library(haven)
library(DataExplorer)
library(dplyr)
# Load data
prevent_file = "./data/raw/prevent_st2.sas7bdat"
prevent <- read_sas(prevent_file)
# Replace empty strings with NA
prevent[prevent == ""] = NA
prevent |>
group_by(CENTER) |>
summarise(cnt = n_distinct(PID))
# Step 1: Filter out patients where `URTI... |
4475d1ab6a479fa7c948201aea58115c0f9806a3634aac24ddb815b5d0f07e02 | R | 4,749 | 155 | ---
title: "table2"
author: "Marlene Lin"
date: "4/8/2025"
output: html_document
---
# read in
```{r read in}
library(dplyr)
library(stringr)
library(readr)
library(jsonlite)
setwd("/Users/linlin/Desktop/brain stuff/data/")
subject_counts <- jsonlite::read_json("subject_counts_long.json", simplifyVector = TRUE)
```
... |
543cb54ed69e6b1844b59f31e1a1d473db4c095437a43bb399d6ae79bf5d6706 | R | 4,750 | 134 | # Startup ####
overall_start_time = Sys.time()
tell_user = function(...) { cat(file=stderr(), paste0(...)); flush.console() }
# Dependencies ####
tell_user('Loading required packages...')
suppressMessages(library(tidyverse))
suppressMessages(library(janitor))
suppressMessages(library(openxlsx))
suppressMessages(li... |
e5e3ffc280801538d1b8039b08b89ad1a90b1c888e0b13149b18b8c020a9b4bd | R | 4,752 | 120 | ---
title: "Convert Conos Object to ScanPy"
output:
rmarkdown::html_vignette:
vignette: >
%\VignetteIndexEntry{"Convert Conos Object to ScanPy"}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
## Install Auxilliary Data Packages
First install the auxilliary packages for conos, [conosPanel](... |
209372a95914b0f11fc023994ba1aa7e6047e332208caaaf08fa3fc9c438e43e | R | 4,755 | 115 | library(ggplot2)
library(SingleCellExperiment)
library(magrittr)
library(dplyr)
library(S4Vectors)
library(here)
library(readr)
library(tibble)
library(conflicted)
conflicts_prefer(base::setdiff)
conflicts_prefer(base::intersect)
conflicts_prefer(dplyr::filter)
conflicts_prefer(dplyr::rename)
conflicts_prefer(dplyr::co... |
303ab0a8cf543bc99028676109d7041bee8065e448d2b4e7924df2352b1804dc | R | 4,758 | 128 | ##########################################################################################
# Cell Filtering Methods
##########################################################################################
#' Subset cells in an ArchRProject.
#'
#' This function returns an ArchRProject object that contains a specifie... |
88cb278c45264c07b85509f173921ee181060533567babddc528ae8e7bd3cb23 | R | 4,768 | 90 | library(Seurat)
library(Matrix)
setwd('/home/joonho345/1_Epilepsy_RNA/scRNA_Human/')
GSE <- 'GSE186538'
#########################################################
#### Create Seurat Object ####
metadata_path <- "/data/project/1_Epilepsy_RNA/scRNA_Human/Raw_Data/GSE186538/GSE186538_Human_cell_meta.txt"
genes_path <- "/... |
3d2fe01e3e7df1887a27f9a99602f9c174503cec7a85c0431198c7d3dba80c3e | R | 4,770 | 104 | library(dplyr)
library(tidyr)
##################### MOUSE ##########################
#### Create GTF Matrix ####
gtf_path <- "/data/resource/reference/mouse/Mus_musculus.GRCm39.112.gtf"
gtf_table <- read.table(gtf_path, header = FALSE, skip = 5, sep = "\t", quote = "", comment.char = "")
gtf_table <- gtf_table %>% dp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.