sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
35f7722b65cc60f42feab99615558f8af1ee6458fb8020afe4d9cae9704c1bf0
R
2,618
91
library(ArchR) library(parallel) addArchRThreads(threads = 20) addArchRGenome("hg38") library(ComplexHeatmap) library(ggsignif) library("RColorBrewer") setwd("/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318") projdir <- "projrmSubset_subPeak" proj <- loadArchRProject(projdir) if(T){ projmet...
adf61a0b60834d26fe8ef7a8d2d09b4f5d407cb1a134ac9ac570969aac730f6a
R
2,620
66
#' phenocov_mvmr #' #' Uses an external phenotypic covariance matrix and summary data to estimate covariance matrices for estimated effects of individual genetic #' variants on each exposure. The phenotypic covariance matrix should be constructed using standardised phenotype measures. The function returns a number of c...
4544e5fc2a7d7ba951bf449abbb97825293182f179b3ee661e590fbb29ff52df
R
2,621
73
# ============================================================================== # Load Single Nucleotide Variation (SNV) Data # ============================================================================== # This script loads and prepares SNV/mutation data from WES # # Author: Osama Shiraz Shah # ====================...
6e51e12c124988202ad2befa3078632bea7cd72bbb9178be37b713ac667ae42d
R
2,621
48
library(malevnc) #library(googlesheets4) library(neuprintr) library(Rvcg) wing_haltere_mns = neuprint_list2df(neuprint_fetch_custom(cypher=paste0("MATCH (a:Neuron) WHERE a.class = 'motor neuron' AND a.subclass IN ['wm','hm'] RETURN a.bodyId AS bodyid, a.class AS class, a.group AS group, a.subclass AS subclass, a.type...
aca045a0bd65b33f94326ae0732c1663e92d1851812eb7a821bf93423a28b808
R
2,622
43
library(R.matlab) library(ggplot2) hcp_gar_rss <- readMat("./hcp_fd_rss_rfMRI_REST2_RL.mat"); Data1 = data.frame(Group = hcp_gar_rss$label.all, Value = hcp_gar_rss$coef.all) Data1$Group = factor(Data1$Group,levels = c(1,2)) color_arr <- array(data = NA, dim = 7, dimnames = NULL) color_arr[1] <- rgb(120/255, 154/255...
8d0c918321929f753e615307027c4a6421e7275fcca458c957399fe9cf2cbfd8
R
2,624
84
--- title: "Mixed ANOVAS" author: "Mona Zimmermann" date: "2026/04/30" --- #### Email: m.l.m.zimmermann@amsterdamumc.nl #### Purpose of script: Running a type 3 mixed ANOVA. #### Status: #### Load libraries library(tidyverse) library(ggpubr) library(rstatix) library(MASS) library(dplyr) fil...
476f3a4e0b7984d2a8b959c805089a729349da1ded535770f47452b4baf3ffa5
R
2,625
81
#setwd("E:/Rworkplace/01-17") #remove.packages("rlang") #BiocManager::install(c("lifecycle")) #install.packages("BiocManager") #library(BiocManager) #.libPaths(c("","")) #BiocManager::install("ggplot2",force=TRUE) #BiocManager::install("rlang",force=TRUE) #BiocManager::install(c("ggplot2","ggpubr","ggsignif")) library(...
980fd4b655cb6ff848bc3f6a6cb99f16e06732bc2679c5ddcfcbb0bf9248ef3d
R
2,625
59
################################################### ## sequencing statistics ## a) total amount of reads ## b) mapping hits ## c) number of splicing spanning reads ################################################### system('mkdir plots') expname = paste("_", basename(getwd()),sep='') ## star stats files files = li...
d77dea6e170d0725c831774a14aca43a12eb766d2b747855e6ecd135d1e8abc5
R
2,626
92
# Load libraries library(ChIPseeker) library(org.Hs.eg.db) library(GenomicFeatures) library(dplyr) library(rtracklayer) library(ggplot2) library(biomaRt) library(clusterProfiler) library(msigdbr) txdb_ensembl <- makeTxDbFromEnsembl(organism="Homo sapiens", release='113') # Hallmark gene sets hallmark <- msigdbr(spec...
62e46a10aa3a876ce578a1819c42a101c5c02043384b83b502ea41ce19eea6e9
R
2,628
83
library(ArchR) library(parallel) addArchRThreads(threads = 10) addArchRGenome("hg38") library(ComplexHeatmap) library(ggsignif) library("RColorBrewer") setwd("/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318") projdir <- "projrmSubset_subPeak" proj <- loadArchRProject(projdir) projmeta <- rea...
5430c1ba8a558344ec669840351e855b0eb42abeefc0f3d32b05254257eff5c2
R
2,630
86
example("registration_pseudobulk", package = "spatialLIBD") sce$batches <- sample(1:3, ncol(sce), replace = TRUE) test_that("NA check works", { expect_error( registration_pseudobulk(sce, "Treatment", "sample_id", c("age", "batches")), "has all NAs after pseudo-bulking" ) expect_error( ...
e8708e181ee3be6a15488d206a7c5d06a886465a5ba4d2cb5dabe5d59aa60987
R
2,641
111
#!/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 clustered RData") parser$add_argument("-n", "--...
7a9a49ff4cb857d28ae98ad5c0c27a7cb3b8e47fe7273180da13786fde8f96a6
R
2,645
74
#' Inner Nested-CV loop #' #' @param #' #' @return #' #' @export xgb_inner_loop <- function(data, group, outcome, seed = 42, n_inner_folds = 3, eval_metric = "rmse", ...
57ae21aa4696184f8019f9dfa7cbdd3870a7a2ff90ffe698427e0e0e02753eaf
R
2,654
63
######################################### # Plotting variance explained by factor # ######################################### library(MOFA2) library(ComplexHeatmap) library(dplyr) library(circlize) library(reshape2) library(ggsci) # Retrieving MOFA load("C:/Users/User/Documents/Drive_PC/Lucas/GitHub/ROSMAP-...
605337345227f875f8132028753cbeb65dba40dd12b032fd8d99bafef01a29c4
R
2,654
29
## code to prepare `DATASET` dataset goes here da2ids=c("720575940639337461", "720575940628259407", "720575940611849187", "720575940622364184", "720575940624106442", "720575940622734835", "720575940622762995", "720575940626937617", "720575940622311704", "720575940610052266", "720575940638719104") aids=da2ids aids=unio...
ef2fd570ca7b83f94dcaebe58a1513ed4c75ac5993f4e223db8e7392b4ce30c6
R
2,660
66
test_that("key_point_from_neuron picks the principal branch point", { # synthetic Y-shaped neuron: single branch point at (0, 10, 0) swc <- data.frame( PointNo = 1:7, Label = c(1, 3, 3, 3, 6, 3, 6), X = c(0, 0, 0, 5, 10, -5, -10), Y = c(0, 5, 10, 15, 20, 15, 20), Z = 0, W = 1, Parent = c...
fb7bb963a7aa2610f3172a9ee7c09e840e34d37e9a62e93312fff663de05a6b5
R
2,665
56
####海马体与颞叶皮层细胞类型间差异基因功能富集点图+热图----------------- temp <- read.table("./temporal_lobe\\enrich\\celltype_EX_IN_Astro_Micro_Oli_Opcs_Endo.go.txt",sep = '\t',header = T) colnames(temp) <- c(colnames(temp)[1],paste0(colnames(temp),"_Temp","")[2:15]) hippo <- read.table("./Hippo\\enrich\\celltype_EX_IN_Astro_Micro_Oli_Opcs_E...
b2c32b52d2c4e427e251429bc4f496964302b2e860be101bf5d33373bc79be54
R
2,666
125
--- title: "Further exploration of goseq analysis resutls" author: "Wei Sun" date: "`r Sys.Date()`" output: html_document: theme: journal highlight: tango toc: true toc_depth: 3 toc_float: collapsed: true smooth_scroll: false number_sections: false df_print: paged --- ```{r set...
bc00ca4aa1e5010046bdeca9194efc6da767997b2779b2d71cc3abebc7bdc105
R
2,666
70
output <- "/Users/..." # Output Folder setwd("/Users/...") # Folder with Images Proteins <- c("TrkA", "Ncad") # Replace TrkA and Ncad throughout code with proteins of interest Overlap.Threshold <- c(0, 10, 33) Folder <- "Explant" # "Explant" "InVivo" Dirs <- list.dirs(path = paste(Folder,sep = ""), full.names = TRUE, r...
ada8dc95cb848f68ac11b355475b9a0bf836b09bbb4651972ea0a41d2b9db7b3
R
2,668
45
#' Retrieves plot data from a SAHA analysis object #' #' This function returns plot data based on the specified plot type and data type. #' If `data_type` is not provided, it attempts to determine the data type from the `ann` object. #' #' Supported `plot_type` values include: #' - "self-similarity": Retrieves self-sim...
f223efbbfe9ece3891528633a260199ffb9903a6475825bd158950f6647480ba
R
2,669
78
#!/usr/bin/env Rscript ################################################ ################################################ ## LOAD LIBRARIES ## ################################################ ################################################ library(optparse) library(UpSetR) ###############...
c1c35bd6113b5ab351bb010a5443e7fc953565b751975b14dbd8757a5b481d73
R
2,670
59
# wd <- '/net//mraid20//export/tgdata/users/yonshap/proj/mmcortex/' wd <- '.' # setwd(wd) library(vioplot) source(file.path(wd, 'scripts/util.r')) load(file = file.path(wd, 'output/methylation/fig4_meth_data.rda')) load(file = file.path(wd, 'output/hic/figS5_data.rda')) mcmd <- readr::read_tsv(file.path(...
adba7a9bad344d56844283585ce043ef79bcdf6b04a7f15310ee8cb519a29856
R
2,672
98
context("rest") library(withr) test_that("user-agent header is set", { config <- list() config$insecure <- FALSE config$username <- NA config$password <- NA config$token <- NA rest_config <- mlflow:::get_rest_config(config) expected_user_agent <- paste("mlflow-r-client", packageVersion("mlflow"), sep...
1dfd44c1cea9b1f4de2e35ce44e3e3bb92ace0ebbe9113506407e58113c504d7
R
2,676
56
#This code builds the atc data frame from finngen data #projectID: VL20243010 #by: Aleksi Kristian Winstén #date: 12.11.2024 #University of Turku setwd("/home/ivm/Projects/VilleLangen/EKG-MachineLearning/") library(data.table) library(dplyr) library(tidyr) #load the ecg_data and modify it ecg_data <- fread(file = "./D...
cc9c92ad1ed54acd8b6c28beab24d662f18235f8f0585ef3303338f4dc31f462
R
2,677
70
### preparing input files for cafe from OrthoFinder 2.x results ### adapted from https://www.biostars.org/p/9553290/ library(ape) library(data.table) library(tidyverse) setwd('/Volumes/laur/data/renckens/projects/genome/gene_families/cafe_2026/') tre <- read.tree('SpeciesTree_rooted.txt') stopifnot(is.binary(tre)) s...
cdb4aa73ef7777adc66ee85f011346c33ff091651b61c978b99b1897e7418cd6
R
2,677
118
rm(list = ls()) ############################################ # Packages ############################################ if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("DESeq2") library(DESeq2) install.packages("tidyverse") library(tidyverse) library(Enhanced...
6817ea3a5e55b0425a3df65fb3495ff3cbc3594b6c1552762bcd8abfb2b18818
R
2,678
79
################################################################################################### ISR <- read.csv(here("Data", "Fibroblast_lifespan", "ISR_Gene_Lists_updated.csv")) # using isr list that includes all of the genes for FB data (igtp is IRGM, NARS to NARS1, WARS to WARS1) #############################...
0c22c0f23182e5f581ad67ce580fdf4bd6cb32f97b32d7cede1325aad5b495f0
R
2,679
67
# This script takes the output of the annotate_vep rule in the Snakemake mutect2-post.smk module reformats it for uploading to the db (variants.vep table) # Additionally generates a .tsv file for backup #----------------------------------------------------- library(VariantAnnotation) # I believe this is only needed fo...
8c206d2c63f98de9f3bab78da366a3764beda6f46561ef7c919720883ebb8982
R
2,679
67
# This script takes the output of the annotate_vep rule in the Snakemake mutect2-post.smk module reformats it for uploading to the db (variants.vep table) # Additionally generates a .tsv file for backup #----------------------------------------------------- library(VariantAnnotation) # I believe this is only needed fo...
b177326a9f20b73910e93e2b478c45a99bc61922ab8a3d6f157faa6bd9df9129
R
2,679
67
# This script takes the output of the annotate_vep rule in the Snakemake mutect2-post.smk module reformats it for uploading to the db (variants.vep table) # Additionally generates a .tsv file for backup #----------------------------------------------------- library(VariantAnnotation) # I believe this is only needed fo...
c2445d42e952d366b680e738995661f83e28317f2efaefd315c1e8898e10cb59
R
2,679
82
# Script: 1.Make_lst_for_LM.R # Purpose: Prepares testing data for linear modeling analysis by: # 1. Loading and processing RNA-seq expression data # 2. Processing predictions from different methods (MODULE, INGENE, EpiXcan, CIS) # 3. Combining predictions and real data for each brain region ############...
4cc5be4aa4489c04b7c8fb7523adf3e6c8b4be100182bdefd7a394686b0ec865
R
2,683
108
# Load Packages setwd(Sys.getenv("HOME")) suppressPackageStartupMessages(library(argparse)) suppressPackageStartupMessages(library(Seurat)) suppressPackageStartupMessages(library(qs)) source("R_func/mutate_load.R") source("R_func/future_load.R") suppressPackageStartupMessages(library(CellChat)) # load parameters p...
37a7825db7ebdc5128592286ebceee102f465ec757c54b2432b2987eb09c7bba
R
2,686
77
#' Print EMC2 build configuration #' #' Prints the compiler flags and options that were active when the package #' was installed. Useful for debugging performance or numerical issues. #' #' @export emc2_build_info <- function() invisible(.emc2_build_info()) # # Last observation carried forward # # Replaces NA values ...
014ff541c4e6842d5e6260fb5bdb4ac3b136383156a7d32037d1d8242f7cff77
R
2,690
75
# Install and load dplyr if not already installed # install.packages("dplyr") library(dplyr) GSE <- 'GSE185862' target <- paste0(GSE, "_10X_scRNA_matrix_DEGs_CellType1") celltype <- "ExN-M" celltype <- "InN-M" celltype <- "Astro-M" celltype <- "Micro-M" celltype <- "Oligo-M" celltype <- "OPC-M" celltype <- "Endo-M" ...
54cbfd998eb9c3e3c850ff263a69acfcccc85990822e57881eb071c996f2db2c
R
2,692
66
here::i_am("scripts/2.validations/2.4.sequence_divergence/2.4.3.calculate_phastCons_scores.R") library(tidyverse) library(plyranges) wd <- here("data/validations/sequence_divergence/") ## Get the longest (C)CDS of each regulator -------------------------------------------------------- # GTF hg38_gtf <- plyranges::...
8d622e9bc717ef82b4ac0431b46c30b11a4186ae521c87bd31cbb997625de90a
R
2,692
72
#' Add analysis data from a 10x Genomics Visium experiment to a SPE object #' #' This function adds to a SPE #' ([SpatialExperiment-class][SpatialExperiment::SpatialExperiment-class]) #' object the output from `read10xVisiumAnalysis()`. #' #' You might want to use `read10xVisiumWrapper()` instead of using this #' funct...
2151eb4fd6fde64fc0a93df8ebee4a959fa5617841a485a8e4c27823f7d41026
R
2,694
65
### Match annotated DESI lipids with In vitro and In vivo LC-MS/MS datasets rm(list = ls()) library(tidyverse) library(stringi) source("./Scripts/Function_scripts/Effect_size_functions.R") source("./Scripts/Function_scripts/Pre-processing_functions.R") ##====match In vitro ==== Invitro.new.peak <- read.csv("./Input_...
ac6039d351a6809e8d4a8b7bbe068b0ce3782c51708fac26584e2c1c32475586
R
2,695
95
setwd(Sys.getenv("HOME")) source("R_func/mutate_load.R") library(tibble) library(arrow) # Load background peaks avail_metric <- read_feather( "project/multiomics/SCENIC/Data/Regional_DA/agg.avail.mdf.feather" ) name_key <- 'cluster' tmp.list <- avail_metric %>% group_split(!!sym(name_key)) avail.list <- tmp.list...
7593c402b4b946077d7befab5a4791a2d05fb77cdedae41315234a064600b35e
R
2,696
92
--- title: "Fig_S3G_MalignantCell_EGFR_expr" output: html_document date: "2026-02-17" --- ```{r} library(Seurat) library(tidyr) library(ggplot2) library(ggpubr) library(dplyr) library(harmony) library(purrr) library(cowplot) library(rstatix) library(ggbeeswarm) library(ggbreak) ``` # Set up and adjust metadata ```{r...
3cc46dfa1e8e40a2b9302c55805b31cd4e307fe647f1de96a5098198071d78cd
R
2,697
71
wigToRangedData <- function(wigfile, verbose = TRUE) { if (verbose) { message(paste("Slurping:", wigfile)) } input <- readLines(wigfile, warn = FALSE) breaks <- c(grep("fixedStep", input), length(input) + 1) temp <- NULL span <- NULL for (i in 1:(length(breaks) - 1)) { data_range <- (breaks[i] + 1):(br...
6ab9f91e7320aaa21aaef9188c3fbb01175b4fb2a25e9fc7178603a19f9b3dc6
R
2,699
69
####################################################### # Enumerate cumulative coverage per aliquot for WGS/WXS # Date: 2018.11.06 # Author: Kevin J., modified by Fred V on 10/14/2020 for GLASSv3 ####################################################### # Directory for GLASS analysis. datadir = 'results/align/wgsmetr...
5c219161257f377e2fc3339f4754a9ab748a5adc7ac74d449f47dbd0fa92b0fa
R
2,700
68
################################# # Plot the longitudinal change in mutation burden for the cohort cases with matched normal - initial vs recurrence. # Author: Kevin Johnson ################################# library(tidyverse) library(ggplot2) library(ggpubr) library(EnvStats) proj_dir <- "/vast/palmer/pi/verhaak...
ec5c8ef4fa670141baa0ddef88c6c00eb8126f38feb2299c797bfa8f37cbbb58
R
2,702
72
#Code adpated from the STAR package https://github.com/xihaoli/STAAR/blob/dc4f7e509f4fa2fb8594de48662bbd06a163108c/R/CCT.R wtih a modifitcaiton: when indiviudal p-value = 1, use minimum p-value #' An analytical p-value combination method using the Cauchy distribution #' #' The \code{CCT} function takes in a numeric ve...
aa562e618df2bbd1a38a25b284b9417490f7b2a406074f9e160afb073fbb0a68
R
2,703
68
get_top_taxa <- function(ps, top = 20, method = 'sum', overlap = 'union', threshold_prevalence = 0.75) { require(phyloseq) require(data.table) # Validate input if (!method %in% c('sum', 'individual')) stop("method must be 'sum' or 'individual'") if (!overlap %in% c('union', 'intersect', 'core', 'mean')) st...
a295a36aadbcdffafbeba220c39d993ce0724def344d66d561422dee61e26039
R
2,705
92
check_package_available <- function(pkg) { if(!requireNamespace(pkg, quietly = TRUE)) { stop("Please install suggested package: ", pkg) } } #' Status report for the malevnc package #' #' @description \code{dr_manc} gives a very useful status report for the malevnc #' package. #' #' #' @return Called for its...
f0c3c8f44e783e5be029e93985c0b0e6cae15b1c48007898c57c8b754e64dacb
R
2,705
50
#' Source the Protein-Protein interaction in STRING database #' #' This function uses a list of Transcription Factors (TF) of interest to source the Protein-Protein interactions (PPI) from STRING database using all types of interactions not only the physical subnetwork #' Important: this function produces a simple unw...
9751fa796e1b3f2097045641c54d2a3f22933f9ec564c3d865e9f0271fed53e0
R
2,707
88
library(DESeq2) library(ggplot2) cnts <- iPSCsignal #input peak counts rownames(cnts) = paste(cnts$chr, cnts$start, cnts$end, sep=":") cnt1 = cnts[,-(1:4)] # alternative way rownames(cnts) <- paste(cnts$chr, cnts$start, cnts$end, sep = ":") rownames(cnts) <- gsub(":", "-", rownames(cnts), fixed = TRUE) rownames(cnts...
c8101ba5cdb35734903b4ce3ba94f1faeb5e02c21c8ca687269aa577d3f8b980
R
2,707
79
context("test CONDOR result") test_that("Test CONDOR functions", { set.seed(1619) r = c(1,1,1,2,2,2,3,3,3,4,4); b = c(1,2,3,1,2,4,2,3,4,3,4); reds <- c("Alice","Sue","Janine","Mary") blues <- c("Bob","John","Ed","Hank") elist <- data.frame(red=reds[r], blue=blues[b]) condor.object <- createCondorOb...
0e3322c9c79c20b3a3c0253ffc59e8e7fc802be353b2f3fd714aee22173b93e5
R
2,717
51
#!/usr/bin/env Rscript library(tidyverse) ################################################################################################### analysis.dir <- "path/to/analysis/dir" OrthDEG.logFC.unipattern <- readRDS(file.path(analysis.dir, "OrthDEG.logFC.unipattern.RDS")) ##########################################...
3d11d790bf95c8e9d22e6262d87662f35e015838b3f78b5593d2e4727aa2b2f4
R
2,720
106
# Tests for functions in src directory # change in random number generation in R3.6, this ensures tests will pass under older and newer Rs # (this was implemented in Seurat's testthat) library(ArchR) library(testthat) library(Matrix) library(chromVAR) suppressWarnings(RNGversion(vstr = "3.5.3")) set.seed(1) #Context ...
a6ca683d064595f6ab5d4b5890fa0befeb96239e4011dc0040eef6f2b99d0594
R
2,721
83
library(tidyverse) library(qs) library(maftools) maf = qread('data/TCGA_GBM_maf.qs') surv_df = qread("data/TCGA_GBM_meta.qs") samps = intersect(maf$Tumor_Sample_Barcode,surv_df$Tumor_Sample_Barcode) maf = maf[maf$Tumor_Sample_Barcode %in% samps,] maf_obj = read.maf(maf = maf, clinicalData = surv_df) somaticIntera...
07538737385946ff5aaff8a8a5424d4a4606aaa8d37d47a907af15e3b29bc10d
R
2,723
101
# 加载必要的包 library(readxl) library(dplyr) library(tidyr) # 读取 Excel 文件 data <- read_excel("P60-qRT-PCR-unpaired-t-test.xlsx", sheet = 1) # 查看实际列名 col_names <- colnames(data) cat("实际列名:\n") print(col_names) # 数据清洗:将基因列转换为字符 data$gene <- as.character(trimws(data$gene)) # 根据实际数据结构提取CON和GCS组的列 # 第1列是gene...
aa32a935c2ee1accdf4b15f80af3c0303488556bedc126ba56d48a20272484a2
R
2,724
89
--- title: "plot_cpm_CAR_Targets" output: html_document date: "2026-01-01" --- ```{r} library(dplyr) library(tidyr) library(readr) library(tibble) library(readxl) library(purrr) library(ggplot2) library(cowplot) ``` # load data ```{r} set.seed(1234) cpm_df <- read_tsv("/path/to/resources/cpm_gene_symbol_dedup.tsv") #...
43e7da9bb435208603ec37ef85be63e393d11965d74adaec31e474787222651f
R
2,730
83
#' Plot spatial weights for cells on a spatial plot #' #' Visualizes spatial weights by plotting cell coordinates colored by #' a numeric weight value. #' Only cells in `data` that match the names in `weights` will be included. #' This is useful for visualizing spatial trends such as proximity to #' boundaries or centr...
3236a5831aec40ac00c1932a65ecaaa1d15d752fabaf403f3f73af154e8d1244
R
2,732
81
#' Sort clusters by frequency #' #' This function takes a vector with cluster labels, recasts it as a `factor()`, #' and sorts the `factor()` levels by frequency such that the most frequent #' cluster is the first level and so on. #' #' @param clusters A vector with cluster labels. #' @param map_subset A logical vector...
a47beaac6cf9b4978e0558c2bbb64c6a997940d9662b86c2ae31e61f2a2c3960
R
2,734
83
#' Plot spatial weights for cells on a spatial plot #' #' Visualizes spatial weights by plotting cell coordinates colored by #' a numeric weight value. #' Only cells in `data` that match the names in `weights` will be included. #' This is useful for visualizing spatial trends such as proximity to #' boundaries or centr...
3a9042d5da90e9895e8e75371184876ea73685750769d89496bd20f386dd4b23
R
2,735
66
# R script for generating a scatter plot comparing predicted and true atrophy rates # Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi) # Last updated: 20-Feb-2025 # # Description: # This script loads an RData file, extracts relevant data, and creates a scatter plot # comparing pred...
f9b4ffd4d09598278b7eba17604198bce72d83c423e4c0376ab8094d26f915b2
R
2,735
70
#' Marker Diversity Function #' #' This function calculates the Shannon diversity index for markers within clusters and categorizes the diversity into "High", "Within 95% CI", and "Low" categories. #' #' @param ann An object containing annotation data. #' #' @return A ggplot object showing the Shannon diversity by clu...
fef500ef6897731be49be9d00c9a5fd50ed7364f44a1b6ecaa4329e7808cdfaa
R
2,736
81
input_folder <- "/Users/jks6575/Dropbox/Jiawan/Analysis/Genetic_enrichment/DEGs_for_fisher/test_gene/CRISPR/" reference_folder <- "/Users/jks6575/Dropbox/Jiawan/Analysis/Genetic_enrichment/DEGs_for_fisher/reference_gene/" # List all CSV files in the input folder csv_files <- list.files(input_folder, pattern = "\\....
1a54338c0709967469d4fe1a763a786747064460434822c68349ae185f787e3e
R
2,741
73
## Need to run the following script first ### 'Fig3.SideChain_Invitro.vs.GPMV.R' setwd(rstudioapi::getActiveProject()) rm(list = ls()) library(tidyverse) library(ggpubr) library(ggrepel) ### ==== 39 side chain features are too many to label, add text to only top 30% that go up and down with age ==== ### ==== color cod...
196dc1d9f23abc2b43ac4172a72c2cd995a800e8c71116e54db3e1e34d2d036e
R
2,747
97
--- title: "Fig_S4T_HallmarkEMT_by_sample_postinfusion" output: html_document date: "2026-02-17" --- ```{r} install.packages("msigdbr") library(devtools) install_github("alserglab/fgsea") # dependency for clusterprofiler devtools::install_github("YuLab-SMU/treeio") devtools::install_github("GuangchuangYu/ggtree") #...
19ee13e32712a1f4ffeb35fd86a7b08bb56114566697e9ee3d7acfbaa5be126c
R
2,747
73
# Written by Yapei Xie and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md # Helper function to install and load packages personal_lib <- Sys.getenv("R_LIBS_USER", unset = path.expand("~/R/library")) dir.create(personal_lib, recursive = TRUE, showWarnings = FALSE) .libPaths(c(person...
2d0b653d8f4dee451eb0e3270c7b7147ff69cae1beb56a199ab8b9358527f700
R
2,748
45
library(R.matlab) library(ggplot2) hcp_noise_rss <- readMat("../results_bins/noise/fd_gs_ds_avg1_global_rss_corr.mat"); noise <- "FD" Data1 = data.frame(Value = hcp_noise_rss$fd.corr.mean.all) noise <- "GS" Data1 = data.frame(Value = hcp_noise_rss$gs.corr.mean.all) noise <- "RV" Data1 = data.frame(Value = hcp_noise_...
f88704ba85e0ed550351d92b54786106f0a743747934dc2b4b3a74ba1214f864
R
2,750
68
#' Pretrains model for the unsupervised version of MetaNeighbor #' #' When comparing clusters to a large reference dataset, this function #' summarizes the gene-by-cell matrix into a much smaller highly variable #' gene-by-cluster matrix which can be fed as training data into MetaNeighborUS, #' resulting in substa...
15a4067173c87772ab5e0ba43652fa69db778d17a49bd60673b51c8184bfb155
R
2,758
49
######################################################################################################## #### Trial dataset for this R script can be downloaded from #### #### https://data.mendeley.com/datasets/454s2vw255/1/files/87ff9c3d-9734-47b8-b483-de122e00775d #### ##...
2e43c9dc1461f7f1f3fa2a17e846ebe92a618073ec1d59deac723f41118ceb61
R
2,760
60
options(stringsAsFactors=FALSE) setwd('~/d/sci/src/mrm_prp/') # read in list of samples from Parchi & Zerr cohorts, with data from previous ELISA study samples = read.table('data/samples/samples.tsv',sep='\t',header=T) # set random seed so this script produces the *same* random result every time set.seed(1) # each b...
d7cc2be4c89596d6b6354fd65ace48606fcff358a1e2ec94743b5006cb81474e
R
2,760
76
# Description: This script is used to compress the time and status of all # complications into a complication whole library(dplyr) t2dCompMststy2ndEd <- "D:\\work2\\t2dAndComplicationsUkb\\data\\processed\\t2dCompMststy2ndEd.rds" %>% readRDS(.) t2dCompMststy <- t2dCompMststy2ndEd # Some of the study subje...
c6e8c2ae4e5d9d91d47a23bdbb0a2c991d910d0a578e556667293a85fdae51a8
R
2,767
68
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir <- "/WORKING_DIR" source("00_settings.R") dataDir <- file.path(baseDir, "data") outDir <- file.path...
eed165b531ed006fc9b83520e47206d7184fb8d4e1fa668e7fef6038421ce4d2
R
2,770
149
--- title: "Use PCAs to filter out outliers" author: - David lukacsovich^[University of Miami] - Lily Wang^[University of Miami] date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: pygments theme: yeti toc: true number_sections: true df_print: paged code_download: false ...
a9b1d0015e7313821c5b249a020673f7f23db1dce38cfdb1cede577b0ba797ce
R
2,773
61
#' Combine multiple continuous variables through PCA #' #' PCA is performed on \code{cont_mat}, the matrix of multiple continuous #' features. The first PC is returned, representing the dominant spatial #' signature of the feature set. Its direction is negated if necessary so that #' the majority of coefficients across...
3c317d28240c833c8cf5455836c8373fad983cfb8eff521396652bf2664cc170
R
2,774
60
library(stringr) library(dplyr) ## Merge all measures into one file setwd('/home/huyang/Projects/HuYang/HY_20250708') sublist <- scan('./PROCDATA/LIST/t1_sublist_postqc.txt', what = '') meas_names <- c('thickness', 'area', 'volume', 'sulc', 'meancurv', 'gauscurv', 'curvind', 'foldind', 'lgi') atlas_names <- c('Schaefer...
53c8ae0aaa229fbe038333a762ddc6809422140f8d414b00c4cab8253fa764b7
R
2,775
84
# Script: 1.Make_lst_for_LM.R # Purpose: Prepares testing data for linear modeling analysis by: # 1. Loading and processing RNA-seq expression data # 2. Processing predictions from different methods (MODULE, INGENE, EpiXcan, CIS) # 3. Combining predictions and real data for each brain region ############...
9683ab38fda98191cb398ea45716ee6500d9a6d14fc488862a7d42467c5e23ae
R
2,776
71
test_that("Python wrapper functions are available", { # These tests only check function availability, not execution # since Python environment may not be set up in testing expect_true(exists("set_python_env")) expect_true(exists("influence_calculator_py")) expect_true(exists("calculate_influence_py")) }) ...
86f1df8398261d44cb2555406df649c394530d4de8b5cf6f1d22701343351124
R
2,777
91
library(dplyr) library(tibble) library(readr) library(ggplot2) library(lme4) library(rstatix) data <- read_csv("data/TREC_KREC_combine_Baby_4.csv") %>% filter(type == "Baby", baby_age > 0) %>% # remove cord blood mutate(log10age = log10(baby_age)) m <- glm(log10TREC ~ log10age + SNP_merge + sex + mode_delivery...
e2e963f87881bcd96b488f392685535d61ecce6ef8eff8068f4062a52a2a4000
R
2,779
68
# This script takes the output of the annotate_vep rule in the Snakemake mutect2-post.smk module reformats it for uploading to the db (variants.vep table) # Additionally generates a .tsv file for backup #----------------------------------------------------- library(VariantAnnotation) # I believe this is only needed fo...
10cd584844305261ea8f75971e211ead61169e2aff0631fdb8d7e18c28fee09b
R
2,780
69
# This script takes the output of the annotate_vep rule in the Snakemake mutect2-post.smk module reformats it for uploading to the db (variants.vep table) # Additionally generates a .tsv file for backup #----------------------------------------------------- library(VariantAnnotation) # I believe this is only needed fo...
931ca03ee8dcffea3187bbcf64ef828012f6c81f40259e0344a6da9288d8c01f
R
2,780
81
# R script for identifying stable, converter, and unsure MCI and CN subjects based on longitudinal ADNI data # Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi) # Last updated: 21-Feb-2025 # # Description: # This function loads baseline and longitudinal ADNI data, identifies stable s...
8fa4b997756be18dfb01e067429fb14236ab277cca5d395f82bbf2b65cb449d3
R
2,784
85
#conda activate cistopic # ***!!!! mutate .bashrc R 4.2.2 !!! all versions of R # Identify modules for CREs contain frVar+eQTL # XH Sep 8 2025 library(data.table) library(dplyr) library(GenomicRanges) library(cisTopic) outp <- "/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318/cisTopic" dxs <- ...
2d9e9dc41716d62c043e8c5958547ba12ff40aed606243cc4234d0dc6fd73ba8
R
2,787
70
library(tidyverse) library(lme4) library(DHARMa) library("visreg") get_ran_df <- function(intro){ ran_pi <- data.frame() for (n in 0:99){ t <- read.table(paste0("data/introgression_scans/", intro, "_randomwins/random_windows.", n, ".diversity.bed"), col.names = c("chrom", "start", "end", "p...
fb8da660dbb96a18fafa223a27c74d7d865a4a80d02bd5f668df91ce3854b452
R
2,791
78
##################################################################### # Brain Tissue Module coeQTL Analysis Pipeline ##################################################################### # This script performs co-expression QTL analysis for brain tissue modules. # It processes the output from the mapping pipeline t...
b5f9f5f098e5d76ceb3ca8fad10a62b906897ef454fae74806aad910567812e2
R
2,792
91
#!/usr/bin/env Rscript #------------------------------------------------- # Title: Download genes in KEGG pathways of interest # Author: Amanda Zacharias # Date: 2023-08-10 # Email: 16amz1@queensu.ca #------------------------------------------------- # Notes ------------------------------------------- # module load nix...
20b836b6fd4d55790aa7a97362e8953353fb7b3d511b0c05991301036668b51d
R
2,794
72
#!/usr/bin/env Rscript # Import TPM matrix for CIBERSORTx # Copy TPM matrix from 03.Normalization, add GeneSymbol header, and save to 01.IMPORT_MIXTURE # Source and destination directories source_dir <- "/home/joonho345/1_Epilepsy_RNA/RNA_Animal/03.Normalization" dest_dir <- "/home/joonho345/1_Epilepsy_RNA/RNA_Animal/...
c6046d97a29901ccc1c58e946ef0dea504aba2e919527097f0e811857d05ec1f
R
2,796
103
#!/usr/bin/env Rscript ############################################### # Manoj M Wagle (USydney, MIT CSAIL) ############################################### suppressPackageStartupMessages({ library(ggplot2) library(data.table) }) args <- commandArgs(trailingOnly = TRUE) dataset_path <- args[1] modality <- a...
7ae0f6fdb29f7d369a24622d3c520ddd0a87b5721851e471daa34834c7fa2850
R
2,797
91
library(dplyr) library(tibble) library(readr) library(ggplot2) library(lme4) library(rstatix) data <- read_csv("data/TREC_KREC_combine_Baby_4.csv") %>% filter(type == "Baby", baby_age > 0) %>% # remove cord blood mutate(log10age = log10(baby_age)) m <- glm(log10KREC ~ log10age + SNP_merge + sex + mode_deliver...
25df9138a848acf55fcd5a706aeb0b8f3cb135de638c6879b227caa27f509939
R
2,800
62
###细胞活性基因在细胞中的表达------------------ Neuronal_activation <- toupper(c("Arc", "Btg2", "Coq10b", "Crem", "Dusp1", "Dusp5", "Egr1", "Egr3", "Fbxo33", "Fos", "Fosl2", "Gadd45g", "Gmeb2", "Grasp", "Junb", "Nr4a1", "Nr4a2", "Nr4a3", "Per1", "Rgs2", "Sertad1","Ti...
49711d65c21f111c7b3db56a02157e2e98ad1ee3ee81aff4d20e2efd5d9c84d7
R
2,800
76
#' Spatial registration: model #' #' This function defines the statistical model that will be used for computing #' the block correlation as well as pairwise statistics. It is useful to check #' it in case your sample-level covariates need to be casted. For example, an #' `integer()` variable might have to be casted in...
b2ef4138e538b98f50e2452fc60c98d82ba4ba200a2cf2ff5d2cd92a8993f451
R
2,802
119
# Tests for ArchR # change in random number generation in R3.6, this ensures tests will pass under older and newer Rs # (this was implemented in Seurat's testthat) library(ArchR) library(testthat) library(Matrix) suppressWarnings(RNGversion(vstr = "3.5.3")) set.seed(1) #Context context("test_workflow") #Genome addAr...
e667c83cb89d9b59bb2547f46ff81bd6702333653eca1b30da5b644e0611c26e
R
2,804
124
rm(list = ls()) ############################################ # Packages ############################################ if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("DESeq2") library(DESeq2) install.packages("tidyverse") library(tidyverse) BiocManager::in...
604fd91ac24796c4dc7449ca4972e37ae44452422024d120c90bb667d73f7f4b
R
2,805
88
rm(list = ls()) ############################################ # Packages ############################################ pkgs_cran <- c("readxl", "openxlsx", "ggplot2", "reshape2") for (pkg in pkgs_cran) { if (!requireNamespace(pkg, quietly = TRUE)) { install.packages(pkg, dependencies = TRUE) } library(pkg, c...
fd932133b95985d5ce4fa750bf37a90d56e6d0607e1de72fbdcab44d8768ecbe
R
2,806
78
--- title: "Volcano Plots" author: "Hannah Serio" date: "2025-04-15" output: html_document --- ```{r libraries, include=FALSE} library(ggplot2) library(readxl) library(openxlsx) library(dplyr) ``` ```{r volcanoPlots, warning=FALSE, fig.width=9, fig.height=6, fig.path='R_plots_volcanos/', dev=c('png', 'pdf')} setwd...
fed322bfca5489619486e9d1862e413af410a96a5a93d53e0609028d57fd0ba3
R
2,807
69
library(data.table) rm (list=ls ()) gc() gc() # Read in list of RDat files rdat_list<-list.files(path='D:/Work/Ten/brain/brain_cell_TWAS_Fujita et al/Astrocytes', pattern='.RDat') # Start making pos file pos<-data.frame(PANEL='Astrocytes', WGT=paste0('Astrocytes/',rdat_list), ...
760561fb6498ebc5dd55a8b445471b4a9b3ceb85dac45367e361d6771ae750db
R
2,809
79
# This script identifies SNPs that are present in the EpiXcan database but missing from the target genotype data # It is typically used as a preprocessing step for genetic analysis to identify variants that need proxy SNPs # Load required packages if (!require("data.table")) install.packages("data.table") if (!...
fc12fab5e6d0a3e2bda0912c6a82f427c430fda1ba91b4e31abad4699b1cf493
R
2,809
75
library(dplyr) library(survival) library(stringr) all_file_paths <- "D:\\work2\\t2dAndComplicationsUkb\\data\\processed\\LassoCox" %>% list.files(path = ., pattern = ".*", full.names = TRUE, recursive = TRUE) compIndex <- which(str_detect(all_file_paths, "Comp.rds")) comp_path <- all_file_paths[compIndex] ...
9e4fa389843c6eac674b7be089beb6e680c9908723042af77ee692ee4e8698b6
R
2,814
61
library(ggplot2) library(tidyverse) library(ggtext) library(dplyr) ####read mean spreadsheet########## mean = read.csv("/Users/guangli/Library/CloudStorage/OneDrive-UniversityofPittsburgh/Haoting/Curioseeker_output/code/update-for-normalized_e14_1/E14_1_eGFP_upk3b/lig_rec_means.csv",skip = 2) mean = mean[,c(1,2,5)] col...
82a12a876a1e3cb12af9805b35c3dbb01434fe7fa4c476a3d21f336344358357
R
2,815
68
# This script takes the output of the annotate_vep rule in the Snakemake mutect2-post.smk module reformats it for uploading to the db (variants.vep table) # Additionally generates a .tsv file for backup #----------------------------------------------------- library(VariantAnnotation) # I believe this is only needed fo...
d09444816484ceee59b58c6f71a459d209b7319de9055b9a15d25292ea2ce1cf
R
2,833
81
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir <- "/WORKING_DIR" source("00_settings.R") dataDir <- file.path(baseDir, "data") nmfDir <- file.path...
2023a35c61c26064cffe884e65a4a1f0bac09b9e58ceb581d4fe0cc2f552663e
R
2,834
94
# ----- # UMS IPSIT BIOINFO - Licence GPL-3 # https://github.com/fdumbioinfo/moal # ----- # # moal install source("https://raw.githubusercontent.com/fdumbioinfo/rtools/main/moal-demo/0-moal-install-r-universe.r") library(moal) # DESeq install if(!require("BiocManager",quietly=TRUE)){install.packages("BiocManager")} if(...
8940382a66942b6660208cc4ce83692c726613de4cba4652b381554cae0c6eff
R
2,838
74
### In vitro #2 effect size calculation on lipids and double bond composition setwd(rstudioapi::getActiveProject()) rm(list=ls()) source("./Scripts/Function_scripts/Effect_size_functions.R") library(tidyverse) ######################################################################################### ## ====calculate e...
857064ca6e93561d650ed28d97d07308ffbb645428d9af91f0f7445cb84e11ed
R
2,842
88
#!/usr/bin/env Rscript suppressPackageStartupMessages({ if(!require(data.table)){ install.packages("data.table"); library(data.table) } if(!require(tidyverse)){ install.packages("tidyverse"); library(tidyverse) } if(!require(optparse)){ install.packages("optparse"); library(optparse) } }) #######################...
e2a169905edff479adbae367e667a28f26c6b0774e4bb8ef1fdc56a1091d6dd8
R
2,845
83
# R script for identifying MCI converters based on longitudinal data # Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi) # Last updated: 21-Feb-2025 # # Description: # This script identifies stable and converting individuals in the MCI group # based on their longitudinal diagnosis da...