sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
88b462dda160b9a971beea316c144524de82cfe3e086151964e5f8a1eda66dcb
R
1,527
43
test_that("neuroglancer annotations work", { skip_if_not_installed('purrr') xyz=matrix(rnorm(18), ncol=3) # layers with colour palette df=data.frame(point=xyzmatrix2str(xyz), layer=rep(LETTERS[1:3], 2)) colpal=c(A="red", C="green", B="blue") expect_is(ann <- ngl_annotation_layers(df, rawcoo...
939faae6b13359883102e72d141915383ed7cfd01ce71370ee6151ab3ed04008
R
1,530
40
# 06_pca_analysis.R # PCA plots for all samples and per brain region rm(list = ls()) library(ggplot2) library(FactoMineR) library(factoextra) library(RColorBrewer) library(openxlsx) data <- as.matrix(read.csv("data/峰面积表达谱_填充_排序.csv", row.names = 1)) data <- log2(data) # Sample groups (as defined before)...
4d8fc67b193477ba9b199ae64ef953e6eb640ccaf84b956c6d3e0bbe8aa5ca39
R
1,532
45
### Quantification of cholesterol concentration from GPMV lipidomics setwd(rstudioapi::getActiveProject()) rm(list = ls()) library(tidyverse) library(ggbeeswarm) library(ggpubr) load("./Output_Data/GPMV.MsD.ClassSum.Rdata") sum.df <- GPMV.class.sum %>% pivot_wider(., names_from = "Class", values_from = "ClassSum")...
a19769170a57ea047340978f4d7be7af381f2c97817fc8800af3357614849976
R
1,534
18
structure(list(url = "https://globalv1.flywire-daf.com/nglstate/123", status_code = 502L, headers = structure(list(server = "nginx/1.15.10", date = "Sun, 19 Jul 2020 21:47:52 GMT", `content-type` = "text/html", `content-length` = "157", connection = "keep-alive", `strict-transport-securi...
8e95eb92debee96c82cb970c39c4d902615f864b153675232fd48be5b47aa143
R
1,535
59
RNGkind("L'Ecuyer-CMRG") set.seed(123) # Set up fake events events <- data.frame( subjects = rep(1, 10), run = rep(1, 10), onset = seq(0, 90, by = 10), condition = rep(c("A", "B"), 5), rt = runif(10, 0.5, 1.5), accuracy = sample(0:1, 10, replace = TRUE) ) # Reshape events to long format reshaped <- reshap...
ab09ee543adb55a97418353c4d3615151729c3f1f6deb256835f72a229f11924
R
1,538
39
#' Dummy query marker data #' #' Data contains #' @format A dataframe with ...: #' \describe{ #' \item{X}{Running index of gene*cluster ID} #' \item{p_val}{Uncorrected p value for gene in cluster-of-interest vs. ALL} #' \item{avg_log2FC}{Average log2FC of expression for gene in cluster-of-interest vs. ALL} #' \ite...
b31a771e012d952884d0fd975a45dd054bcc168735a2b91798fb7607140082ec
R
1,539
52
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) exprpath = args[1] dbpath = args[2] resPrefix = args[3] # All_junction method = args[4] # gsva print(args) library(GSVA) parse_gmt = function(gmt_path){ db = readLines(gmt_path) geneset = list() for (line in db){ line ...
752e086d3c804215e2cbebfec83ba93f214de7bf57690d8a53ae11e5efd2bb5e
R
1,541
51
library(tidyverse) library(SummarizedExperiment) library(edgeR) library(nlme) library("XML") library(GEOquery) datExpr <- fread("Labonte_GSE102556_HumanMDD_fpkmtab.txt.gz")%>% as.data.frame() rownames(datExpr) <- datExpr$gene_id colnames(datExpr) <- paste("X", colnames(datExpr), sep = "_") # Read in metadata and cr...
3651a8164d547fa1c5a3da8350e35b68f78e6e581c049294e1a8e53b68871525
R
1,542
37
#' An S3 class constructor of representing Venn plot components. #' #' @param x data source of a VennPlotData object #' #' @slot shapeId shape id #' @slot type type of shape #' @slot nsets number of sets #' @slot setEdge a data.frame, the coordinates of set edges, can be retrieved by `venn_setedge()` #' @slot setLabel ...
e6d804d1c3b870e6bd3ed90c45c3c5362732d12af3bcdda06409ce901b8e907c
R
1,542
44
#!/usr/bin/env Rscript source("essential_functions.R") library(dplyr) #' Author: Sumaiya Nazeen (sumaiya_nazeen@hms.harvard.edu) #' This program generates the pairwise lookup table for #' a given gene network #' #' @param Network_matrix_file a .tsv file containing the network adjacency matrix. #' @param num_alpha_le...
5e5b4323860f2b04067b6e1a2a4b33bc1c86d516e25a962f775b45bf10d6958a
R
1,545
46
#' Register an external MLflow observer #' #' Registers an external MLflow observer that will receive a #' `register_tracking_event(event_name, data)` callback on any model tracking #' event such as "create_run", "delete_run", or "log_metric". #' Each observer should have a `register_tracking_event(event_name, data)` #...
3d8da7bf5cfbe4232567b955ccf5487e3fb2f3672d7fbc14246e1b1553a94edf
R
1,547
36
#' Plot the distribution of module sizes #' #' Plots the distribution of module sizes (i.e. the number of target genes assigned to each regulator) as a histogram. #' #' @param modules Data frame of the pruned modules, required columns: #' \describe{ #' \item{regulator}{Character, transcriptional regulator.} #' \item{mo...
0ea3d443e469bf93b52b0b4fb4b5ec7d2bfc80a6d6115cef8dc79c0895636472
R
1,548
45
#This code combines atc and covariates data frames to QT variants #projectID: VL20243010 #by: Aleksi Kristian Winstén #date: 20.11.2024 #University of Turku setwd("/home/ivm/Projects/VilleLangen/EKG-MachineLearning/") library(data.table) library(dplyr) library(tidyr) library(vcfR) #load qt variants vcf_file <- "./Data...
9bfd72e68a64774b214758325981eef4b9f0eb2b5fa377f182acbf289b766817
R
1,548
41
#' @title dotHeatmap #' @description Plots a dot-heatmap for enrichment results #' @param enrichmentDf Input data.frame #' @param var.x Variable (column) for the X axis #' @param var.y Variable (column) for the Y axis #' @param var.col Variable (column) that will determine the color of the dots #' @param var.size Varia...
bf5c2806c9dadade9fedca15dafcf5d61fa1663237fe127f8b2e0858758d45c6
R
1,550
68
dt.from.ps <- function(ps, glom_taxa=F, i=NA, t=NA, ignore_lineage = T, keep.all=T, melt = T, glom_samples=F, summarise.samples = NULL, by.var = 'sample' ) { if(glom_taxa) { if(is.na(i)) { i <- 2 } if(is.n...
7e1de6887042bd461df6b6dd86cfc20b14ed6567d640556712920d5992103d38
R
1,554
66
# Cast utility functions to replace deprecated forge functions # These functions use modern rlang/vctrs functions instead of deprecated ones cast_string <- function(x, allow_na = FALSE) { if (is.null(x)) { if (allow_na) return(NA_character_) else stop("Value cannot be NULL") } if (is.na(x) && !allow_na) { ...
6c8045beefcaf0c777ad1da1ae529c4443fc43f0afe71e1ceee54b63c1060384
R
1,555
40
#' banc-make-proofread-ids — Emit a txt file of proofread BANC root_ids. #' #' Used by the proofread-redo workflow: each downstream NBLAST script #' honours `BANC_TEST_IDS_FILE` and processes only the listed IDs. #' #' @section Reads: #' - `banc_meta.csv` (override path via `BANC_META_PATH`) #' #' @section Writes: #'...
113a3c2dfea53287c56b4196f6408489362496b237fdf543983794bed5c07085
R
1,561
50
#################################################################################### ###############--------------- DESCRIPTIVE STATISTICS ---------------############### #################################################################################### ### In this script: # (1) Demographics # (2) Psychiatric questi...
c219303a8aa4994306ffcf69bec86f35d08946f49e21ea9276c243e3889f92b3
R
1,564
41
ason_pk_rna = read_tsv('data/PRP230911.tsv', col_types=cols()) %>% mutate(animal = gsub('-','',animal)) ason_pk_rna %>% mutate(conc_ug_g = pk_ug_g) %>% mutate(day = as.integer(gsub('D','',day))) %>% mutate(dose_color = '#FF56AD') -> ason ason %>% filter(tx != 'PBS') %>% mutate(day = as.integer(gsub('D','...
e305cbea7ed84408a040a14f91701216f42cea4501ceeabcc552269a5f2e44b8
R
1,566
40
#!/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("-g", "--gene", required=TRUE, help="input gene symbol list") parser$add_argument("-o", "-...
669a60426d93607f95d7450d4901008b38b73781e9d63118610ea7a77c36efeb
R
1,567
43
#' Creates a dendrogram for self-similarity analysis #' #' This function generates a dendrogram based on the self-similarity matrix for either #' marker-based or average expression data. It also attempts to rename the dendrogram #' labels based on a provided annotation data frame. #' #' @param ann An object containing ...
3992ce40b6e17ce50765cd9d187181dc348f3f87e86bd202a355521a648ed30b
R
1,568
41
plot_beads_over_time <- function(beads.data, beads.normed, beads.cols) { beads.data <- data.frame(beads.data, type = "Before", check.names = F, stringsAsFactors = F) beads.normed <- data.frame(beads.normed, type = "After", check.names = F, stringsAsFactors = F) m <- rbind(beads.data, beads.normed) m ...
5fc14a73c54f0f59251016f4dee27e0fa80040546f3426bb644e1311963effaa
R
1,568
45
## ========================================================= ## Data-generating mechanisms for NL-HSIM simulations ## (continuous / SNP,lienar / nonlinear,CWSM / DSSM) ## ========================================================= #' Internal: AR(1) correlation matrix #' @keywords internal .ar1_sigma <- functio...
83f7b67daf5d449dfb4c97bda9b1dad7945491685d49a630bf6e47864456af33
R
1,569
57
setwd(Sys.getenv("HOME")) source("R_func/mutate_load.R") library(tibble) library(arrow) library(GenomicRanges) library(ChIPpeakAnno) # Load TEs all.human.TE <- read_feather( "project/multiomics/PeakAnlys/PeakAnnot/all.hg38.TE.feather" ) peak.df <- all.human.TE[, c('chr', 'start', 'end')] peak.df %<>% unique() %>...
bd576e55f17237e4c87632e72b0b6c2f3525c90f6af12b682ecc5524d622f5ae
R
1,569
43
#' Creates a dendrogram for self-similarity analysis #' #' This function generates a dendrogram based on the self-similarity matrix for either marker-based or average expression data. It also attempts to rename the dendrogram labels based on a provided annotation data frame. #' #' @param ann An object containing SAHA a...
e11f1d41d3c85681ffc7dddd9f4818a6936f07d1f14ccb03161fe2be2517c50c
R
1,570
65
setGeneric( "plotCorrDensity", function( object, filename = "pairwiseCorrDensityPlot.pdf", breaks = NULL, width = 15, height = 15 ) standardGeneric("plotCorrDensity") ) setGeneric( "plotNetwork",...
ae29292a88df84276799986736e6e9c255725ecc09b749f61febc83caaa7a6d6
R
1,571
77
# nocov start mlflow_swagger <- function() { def <- c( swagger_header(), swagger_paths(), swagger_defs() ) jsonlite::toJSON(def) } swagger_header <- function() { list( swagger = jsonlite::unbox("2.0"), info = list( description = jsonlite::unbox("API to MLflow Model."), version...
20b49dd7efc4df644b946cf38d55b5a16f5f428b818d205931fd120a7b967830
R
1,574
43
# =============================================================== # ?? Regression shared UI helpers # =============================================================== reg_detect_types <- function(df) { num_vars <- names(df)[sapply(df, is.numeric)] fac_vars <- names(df)[sapply(df, function(x) is.factor(x) || is.char...
44a038d3a0f57f2e5db5d5ea42bf31a8dd1edf7b4d12a86452fa2dfc034f0e45
R
1,579
54
```{r} library(dplyr) library(tidyr) library(psych) library(tibble) # Keep only baseline weeks and complete pairs, then widen (one row per subject per acid) df_icc_wide <- df_scfa_long_updated %>% filter(week %in% c(1, 9)) %>% select(study_id, group, acid_type, week, acid_value) %>% mutate(week = as.integer(wee...
1279f9cf39330085f18883d5f0e3fceab624259e55a8d16a7182b03b57058d29
R
1,581
47
library(paletteer) library(ggsignif) #------------- Negative network in DLPFC---------------- so <- readRDS("Astro_obj.rds") # FADS1 DLPFC pos DLPFC_FADS1_pos <- readRDS("my_big_positive_GTEx_DLPFC_list.RData") DLPFC_FADS1_pos <- DLPFC_FADS1_pos$ENSG00000149485_ DLPFC_FADS1_pos <- getBM(filters= "ensembl_gene_id", ...
70b1fa1e4786d32e4229ffe41e2fd892e023184476970f9f1cee40bd5d0cd121
R
1,589
40
#!/usr/bin/env Rscript ############################################################################### ## Regenerate all DE results tables from checkpoint ## ############################################################################### ## Purpose: Create consistent DE result CSV files from c...
622c75c637bab684dbee603b9ec264e7f1469b2b5634c198b4171ab28fd6df79
R
1,590
51
library(tidyverse) library(odbc) library(DBI) library(GSVA) library(qusage) rm(list=ls()) myinf1 <- "/projects/verhaak-lab/GLASS-III/results/kallisto/kallisto/final/gene_tpm_matrix_all_samples.tsv" myinf2 <- "/projects/verhaak-lab/USERS/johnsk/glassx/varnf/data/msigdb/h.all.v7.1.symbols.gmt" myinf3 <- "/projects/verh...
95753063afe1f686073f5329dfbdb9efff347619878ed8ff11dbbc1b718b02ae
R
1,595
51
# 加载必要的包 library(dplyr) library(tidyr) # 1. 读取数据 data <- read.csv("Immature_granule_CellChat_Prob.csv", stringsAsFactors = FALSE) # 2. 筛选出 Immature Granule 的数据 immature_data <- data %>% filter(celltype == "Immature Granule") # 3. 提取 CON 和 GCS 两组的 prob 值 prob_CON <- immature_data$prob[immature_data$Grou...
37a23a82929ea643895d6c03c8c004458073b58fd482cfd025a40a37c91927ed
R
1,597
59
#' Extract the XYZ coordinates from neuroglancer mesh objects #' #' @param x an ng_raw or ng_raw_list object #' @param ... additional arguments (currently ignored) #' @export #' @importFrom nat xyzmatrix #' @rdname xyzmatrix #' @aliases xyzmatrix #' @seealso \code{\link[nat]{xyzmatrix}} xyzmatrix.ng_raw <- function(x, ...
9af4cddc3726b840e7b6a13033f74148412224c2f965873e497a826e11c0c9b0
R
1,597
50
library(ArchR) library(parallel) addArchRThreads(threads = 20) addArchRGenome("hg38") library(ComplexHeatmap) library(ggsignif) library("RColorBrewer") projdir <- "projALL_rmDoublets" proj <- loadArchRProject(projdir) # add LSI proj <- addIterativeLSI(ArchRProj = proj, useMatrix = "TileMatrix", dimsToUse = 1:30, ...
d0c55fa9cec71ae8ff17a7dea09a60e9b51a602e2749a1f125d1561e8aaf1eaf
R
1,599
45
#' Export a column with cluster results #' #' This function creates a `clusters.csv` file similar to the ones created by #' SpaceRanger at `outs/analysis/clustering` but with the `key` column that #' combines the `barcode` and the `sample_id`, which is needed when the `spe` #' object contains data from multiple samples...
e48ff45752dfb0c65f585412fb6d258f306a7614c24409a77a3c77a9fb1c612f
R
1,599
28
# Increase the timeout length for `utils::download.file` because the default value (60 seconds) # could be too short to download large packages such as h2o. options(timeout=300) # TODO: Remove once pak 0.9.4 is live on packagemanager.rstudio.com's focal/latest mirror. # The mirror currently serves pak 0.9.3-1, which bu...
f21c0c7999bc31f13ea1cbe8f55984e36a1167efbea59bafe8d8d00ec81fe4ee
R
1,599
32
# Load necessary libraries library(dplyr) directory_path <- "/home/joonho345/1_Epilepsy_RNA/RNA_Animal/06.Deconvolution/06.DEG_02DESeq" cell_types <- c("ExN-M", "InN-M", "Astro-M", "Micro-M", "Oligo-M", "OPC-M", "Endo-M") # Loop through each cell type for (cell_type in cell_types) { cell_files <- list.files(path = ...
1857281f10fe0231c1e5b1bbd45a27949041e90e6df468905d0a384c22e12f45
R
1,604
51
# Computes path to Python executable from the MLFLOW_PYTHON_BIN environment variable. get_python_bin <- function() { in_env <- Sys.getenv("MLFLOW_PYTHON_BIN") if (in_env != "") { return(in_env) } # MLFLOW_PYTHON_EXECUTABLE is an environment variable that's defined in a Databricks notebook # environment. ...
2ffc7e173ad7cf12434cc5c7982eeef070364ae3f47659af52d6d4060d112174
R
1,612
32
################################# ## Create a final metaprogram table based on initial metaprogram derivation and iterative NMF for testing in the Undifferentiated compartment ## Author: Kevin Johnson ## Updated:2026.04.02 ################################# library(dplyr) proj_dir <- "/vast/palmer/pi/verhaak/kcj28/...
9b5154f8aa2bff6f63fb396dfa4487736083b2d0f0b4707fbcf070faf92eeda9
R
1,612
48
#### Section: Summary Calculations #### anova_summarise_stats <- function(df_subset, resp_name, factor1, factor2) { if (is.null(factor1) || !factor1 %in% names(df_subset)) { return(tibble::tibble()) } if (is.null(factor2) || !factor2 %in% names(df_subset)) { df_subset |> dplyr::group_by(.data[[fac...
09f4c78c0db79ebcfe87d6e6b97cb6d152e50ec9ad619918244db95cef06c7bf
R
1,617
46
#' Check input sce_layer #' #' This function checks that the `sce_layer` object has the appropriate structure. #' For more details please check the vignette documentation. #' #' @inheritParams run_app #' @param variables A `character()` vector of variable names expected to #' be present in `colData(sce_layer)`. #' #' @...
e995ddc9a3deece5705328ded99c6c178171778b9fbfe6bea5ae3a766e53621f
R
1,619
34
#' Computes Pearson correlations between query and database expression profiles #' #' This function calculates Pearson correlation coefficients between all query and #' database cell type expression profiles stored in the `ann@results$marker_free$norm_merge` data #' frame within the `ann` object. The results are stored...
01e3d4604dad8c2d9e696e285c697146d90259727615af4eb5c48cac9a103d36
R
1,622
49
#Add Interval between last cognitive visit and death #Alaina Durant - 5 2025 #directory directory <- "C:/Users/durantam/VUMC/Research - Hohman - CNT/" my_directory <- paste0(directory, "Team/Alaina_Durant/") #library and functions source(paste0(my_directory, "Scripts/load_libraries.R")) source(paste0(my_dire...
b17da6cfaba9b00893164fb4265fad7492c5c569814be87aa6d96ba20da72099
R
1,622
61
# # pliu 20150509 # # module for processing ChIP-seq data # main <- function() { name2func <- list( 'guessFqEncoding' = guessFqEncoding ) argv <- commandArgs(trailingOnly=T) name2func[[argv[1]]](argv[2:length(argv)]) } guessFqEncoding <- function(argv){ .libPaths(c(argv[4], .libPaths())) suppress...
b81fc9209c58c98dbf6bf87f86401e065bebdf5ea792e41f29a11ade6eba7f6d
R
1,622
67
--- title: "R Notebook" output: html_notebook --- This notebook complements `train.R` by enabling the same functionality from the MLflow tutorial using an R notebook. ```{r} library(mlflow) library(glmnet) set.seed(40) ``` Read the wine-quality csv file ```{r} data <- read.csv("wine-quality.csv") ``` Split the d...
f82efa56070f5eb9309457ff5e7a1478438fcbfa4eb693c54a5369ac880919dd
R
1,624
36
library(ArchR) library(Matrix) outp <- "/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318/cisTopic" projdir <- "/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318/projrmSubset_subPeak" proj <- loadArchRProject(projdir) dropSubCs <- c("undefined","ast.C6","mg.C8","mg.C10","mg....
bb71c3e232758a09fe1ff1012a9b9feca7b8a8f22b66c90b7b2251dc41d172ef
R
1,629
40
### Side Chain composition analysis setwd(rstudioapi::getActiveProject()) rm(list = ls()) library(tidyverse) source("./Scripts/Function_scripts/Pre-processing_functions.R") load("./Output_Data/M2PM_backtoRAW_MsD_Norm_Impt_397_lipids.Rdata") #from script #6 ## ==== Aggregate lipids with the same number of double bond...
b35c21f3a25bad93e93274a06d18835f97fe3228d03bc461820bd3e40ed4eb9d
R
1,630
69
library("SPOTlight") library(SingleCellExperiment) library(SpatialExperiment) library(scater) library(scran) library("anndata") st_path <- "./simulated_gene_expression_average.h5ad" sc_path <- "./SC.h5ad" celltype_key <- 'cell_type' output_path <- "output.csv" st<-read_h5ad(st_path) st$var_names <- make.unique(st$va...
a49e9cf7b8ae663d98bd72e5264b29cfec8d1e7822f5ae4bf32bafb6ebd296b8
R
1,631
43
### ----------------------------------------------------------------- ### Legacy exploratory analysis by a member of the Wilson Lab. ### Historical record only — not part of the bancpipeline release. ### ----------------------------------------------------------------- # Code to explore morphological classes of DNs #...
ac353f19c7c1a2ae9e20dfd86f77e4c2409663ccd4bef08a9133ecfa755f1871
R
1,632
53
library(scater) library(DropletUtils) library(scDblFinder) library(Seurat) library(dplyr) library(cowplot) library(ggplot2) library(hdf5r) library(tidyr) data<-list() setwd("~/mouse-nuc-seq/nodose/data/processed") files<-dir(pattern = ".RDS") for (i in files) { data[[i]]<-readRDS(i) } data<-lapply(X=data, assay = '...
79b7ed6d681d0886c89a0098e573cd599e1a4a375cd0a34de57973a8c3fb3c74
R
1,633
51
rm(list=ls()) library(data.table) peakLoader <- function(peakFolder = './Input_Data/Cleaned_title_all_spectra'){ #aggregate all files massDT <- rbindlist( lapply( list.files(peakFolder,full.names = T), function(i) fread(i,skip = 1)[,name:=gsub(".txt","",gsub(".*/","",i))])) setnames(ma...
bad62ffd6fc367c996fbf63f613d43c7f0fb35f463c7e66127866799c4c921d9
R
1,633
54
## Obtain the necessary data ## reference human pilot modeling results if (!exists("modeling_results")) { modeling_results <- fetch_data(type = "modeling_results") } ## query spatialDLPFC modeling results query_modeling_results <- fetch_data( type = "spatialDLPFC_Visium_modeling_results" ) ## Compute the corr...
98db07984a6e4d082e1b9948e18f57f1dc9189357a672a677b13aa968b434521
R
1,639
29
library("data.table") library("R.utils") library("GWASTools") library("dplyr") Args <- commandArgs(TRUE) resloc <- as.character(Args[2]) phenoname <- as.character(Args[1]) # Running the loop for(method in c("M1","M2")){ for(pn in phenoname){ res <- fread(paste0("/hihg/studies/AD/analysis/projects/ADGC/Neuropath/GWAS...
8db65c96f7f3155721a4a71f7404e59b832527cf7a4db483f5a6aa88ef377753
R
1,640
39
#!/usr/bin/env Rscript ### This script will calculate nearest sequenced taxon index (NSTI) between study ### sequences in a tree and the nearest reference sequence. # Read in quietly to avoid outputting "Loading required package: Rcpp" to stderr. library(castor, quietly = TRUE) Args <- commandArgs(TRUE) # Read in ...
2797461a7402e68aec4f30248e79a9ffc860bede61e8d1b645baa17d2525754b
R
1,641
39
## ----setup, include=FALSE---------------------------------------------------------------------------------------- ## ----Libraries and Data------------------------------------------------------------------------------------------ suppressWarnings({ library(vcfR) library(data.table) library(ggplot2) ...
3c8bd59f952e3d9fc4b07fb48637618ae3a5129ea5a8db0d53c89b9973d5b9e1
R
1,649
49
#!/usr/bin/env Rscript # read results from ksklearn 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="input statH") parser$a...
839d9e9b326ec745f982eefe0d974ac408f4a29b6752406b1a46857bcdc2032a
R
1,651
42
### Calculate Z score on lipids from 2 in vitro lipidomics rm(list=ls()) library(RColorBrewer) library(tidyverse) setwd(rstudioapi::getActiveProject()) source("./Scripts/Function_scripts/Pre-processing_functions.R") ####Load log2 transformed data from In vitro Experiment #2 dataset####################################...
31e457281ebc84a689f6227fab27bea3306c053f442b00851e4986db12132e03
R
1,659
47
#TODO: revrite for command line arguments library(epicalc) ####################### #Read PB final results# ####################### PB<-read.csv("prot.blastx_results",sep="@") PB<-PB[order(PB$Queryid,PB$positives, PB$alignment.length, PB$identity, decreasing = TRUE), ]; PB<- PB[match(unique(PB$Queryid), PB$Queryid), ]...
7f5e6072daf67aaeb035167443c7579ea81acb6a25a60d0eec2a6695f3eb13cb
R
1,660
55
library(tidyverse) library(doParallel) library(foreach) load("Microarray_MDD_Normalized_CR_regressed.RData") prsCor = function(i, gene, datExpr.local) { c <- cor.test(datExpr.local[i,], datExpr.local[gene,], use = 'pairwise.complete.obs') dfPrs <- data.frame(Gene = rownames(datExpr.local)[i], R = c$estimate, P = ...
319a045e47df28ede4878c4d58bad7513a387f9372e931e3c005a1fac70549cc
R
1,667
48
# 2025.12.27 # R codes for generating vignette data ####################### # # # Seurat analysis of the mouse brain Xenium data # download data # The (Fresh Frozen) Mouse Brain Tiny Xenium data from 10x Genomics website # was used in this analysis: # https://www.10xgenomics.com/datasets/fresh-...
1922b1d787e536dde24bb557d6a4b3fbfc17548c79c02882e2f96eb019e4334a
R
1,669
53
#!/usr/bin/env Rscript #------------------------------------------------- # Title: Write list of paths to GTFs # Author: Amanda Zacharias # Date: 2023-06-30 # Email: 16amz1@queensu.ca #------------------------------------------------- # Notes ------------------------------------------- # module load nixpkgs/16.09 gcc/7...
1c477367d3df05a995b4e08790e9672d041a5f25d39d4f65b3fbbf0ba721349b
R
1,671
50
#!/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 snap RData") parser$add_argument("-o", "--outpu...
1a14c7fac9ab8bfcf9587b7183800974718ca459afd146d6af6cfd92f09f9a64
R
1,672
58
# =============================================================== # 🔁 Multi-Response Selector Module (final simple version) # =============================================================== multi_response_ui <- function(id) { ns <- NS(id) tagList( with_help_tooltip( checkboxInput( ns("m...
17b600a30aaf3d63c3c2653c31daaae93c58f40438123a7bce602d0406a799b5
R
1,674
48
#' @include model-utils.R NULL #' @rdname mlflow_save_model #' @export mlflow_save_model.xgb.Booster <- function(model, path, model_spec = list(), conda_env = NULL, ...
2f643a1e612e9710f34e2c802c9cedcd0c0438c3960a3180c52ba1c797d8749d
R
1,674
38
#!/usr/bin/env Rscript ## Author: Luuk Harbers ## Date: 2022-10-22 ## Script to process allelic counts ## Load/install packages packages = c("data.table", "argparser") invisible(sapply(packages, function(x) suppressMessages(require(x, character.only = TRUE, quietly = TRUE, warn.conflicts = FALSE)))) ## Parse argumen...
a502f583954424da2cc30285b6b9620d94276e65595498514990d832fd064f4c
R
1,674
62
library(purrr) library(dplyr) library(RSQLite) # Get base directory for relative paths # base_dir = "path/to/project/root" base_dir = getwd() # Configuration settings CONFIG = list( train_name = "your_training_dataset_name", db_file_path = file.path(base_dir,"./PredictDB_LD/MODULE/"), ...
ef892af9339966dd716a4dcdb8148bb43dcf2439a8522ac66e7d81ffb7afc508
R
1,674
32
library(grDevices) library(here) library(ggplot2) library(reshape2) library(magrittr) library(dplyr) library(MetaMarkers) library(readr) library(conflicted) conflicts_prefer(dplyr::filter) conflicts_prefer(dplyr::first) conflicts_prefer(dplyr::count) Sys.setenv("VROOM_CONNECTION_SIZE"= 21000000) greedy_tests_Mac <- r...
67ad479d68cbc7c8c6fa80365d6f4597bcfd43ddd882fdf41350627d1c0319f2
R
1,677
45
library(dplyr) library(Seurat) library(patchwork) # Load the malt dataset # rename features.tsv to genes.tsv malt.data <- Read10X(data.dir = "MALT10k_filtered_feature_bc_matrix/") # Initialize the Seurat object with the raw (non-normalized data). malt <- CreateSeuratObject(counts = malt.data$`Gene Expression...
156ed2a72706738fdb1bfb3d8c0630f8e816590a4eb5192a74699e6d135c2e0d
R
1,680
52
library(dplyr) cohort <- 'GSE160189_186538_Integration' target <- paste0(cohort, "_scRNA_matrix_DEGs_CellType1") celltype <- "ExN_H" celltype <- "InN_H" celltype <- "Astro_H" celltype <- "Micro_H" celltype <- "Oligo_H" celltype <- "OPC_H" celltype <- "Endo_H" window <- 'Window28' # Set the working directory setwd(p...
d1c1946be152f47e7461e3118cb81d58b3ff7c72e4566702445d70c88e281eca
R
1,680
37
args<-commandArgs(TRUE) self_blast = sprintf("%s", args[1]) #Creat cytoscape network file self_blast<-read.csv(self_blast,sep="@",header=F) colnames(self_blast)<-c("Queryid","gi","identity","Coverage","Strain","alignment.length","Chimera","Strand","q.start","q.end","s.start","s.end","e.value","bitscore","Length") ...
7e2135d1347cffc6006cf7a0997406c46e1cac723645b920ad72b66565cf651c
R
1,681
48
#' Make plot data for the genome plot of plot.genome.regions function #' #' @export gggenome.from.dataframe <- function (plot.data, visfrom = NA, visto = NA, genename.toupper=T ) { require(gggenes) require(tidyverse) require(tidygenomics) require(fuzzyjoin) plot.data ...
038cbbc48d578e94c09f5fdfa0901edcbdeb3b9eeca8d0ac9a12ddf49d34432a
R
1,682
51
#!/usr/bin/env Rscript library(tidyverse) library(odbc) library(DBI) ####################################################### rm(list=ls()) #Establish connection con <- DBI::dbConnect(odbc::odbc(), "VerhaakDB4") dat <- read.delim("/projects/verhaak-lab/USERS/johnsk/glass4/results/mutect2/consensusvcf/CARE-MD/consens...
0f47b55c2a7b5f94b90825d5ce4805d3bc2da707bd7bf01bc5e8a77269f11497
R
1,682
51
#!/usr/bin/env Rscript library(tidyverse) library(odbc) library(DBI) ####################################################### rm(list=ls()) #Establish connection con <- DBI::dbConnect(odbc::odbc(), "VerhaakDB4") dat <- read.delim("/projects/verhaak-lab/USERS/johnsk/glass4/results/mutect2/consensusvcf/CARE-PS/consens...
6c6b04a7af9493b6dd794449860241eddc0887f848978985e1dfb388e87ca817
R
1,682
51
#!/usr/bin/env Rscript library(tidyverse) library(odbc) library(DBI) ####################################################### rm(list=ls()) #Establish connection con <- DBI::dbConnect(odbc::odbc(), "VerhaakDB4") dat <- read.delim("/projects/verhaak-lab/USERS/johnsk/glass4/results/mutect2/consensusvcf/CARE-PT/consens...
7e4a370d212ed1751d717aad5ec5b1035236039897e6da19fc2c6872da2516ee
R
1,682
51
#!/usr/bin/env Rscript library(tidyverse) library(odbc) library(DBI) ####################################################### rm(list=ls()) #Establish connection con <- DBI::dbConnect(odbc::odbc(), "VerhaakDB4") dat <- read.delim("/projects/verhaak-lab/USERS/johnsk/glass4/results/mutect2/consensusvcf/CARE-TO/consens...
b5f4bdabd356b44ae0b9580d2d317a26a4199acb61c4cca94117033a33e83177
R
1,682
51
#!/usr/bin/env Rscript library(tidyverse) library(odbc) library(DBI) ####################################################### rm(list=ls()) #Establish connection con <- DBI::dbConnect(odbc::odbc(), "VerhaakDB4") dat <- read.delim("/projects/verhaak-lab/USERS/johnsk/glass4/results/mutect2/consensusvcf/CARE-TK/consens...
0dd0ceb38923f54aa4acc93acc43e2538d5e872d443699e1ed56bacf5d3bed2d
R
1,683
55
require(tidyverse) require(ggplot2) require(clusterProfiler) require(org.Hs.eg.db) require(enrichplot) #input deseq2 file:the one for volacano plot DEG_3<- fam3_im_3110_uqcrc2_331_vs_321_ev_deseq2_padj0.05 head(DEG_3) genelist<-DEG_3$external_gene_name genelist<- genelist %>% bitr(fromType = "SYMBOL", toTyp...
5ad820e5a7098d4d065e24171422946a0a60592ef76286f9011a526742292120
R
1,685
47
# 01_data_preprocessing.R # Data input, missing value imputation, sample aggregation (technical replicates) rm(list = ls()) library(openxlsx) source("scripts/utils.R") # if needed for later, but not used in this script # Input all_protein_imput <- read.xlsx("data/protein_Samplematrix_imputeNA.xlsx", rowNames...
62b768688e92df1f80b3c34062d69985fe2612478a9ec363027c9dc623ee08ea
R
1,685
55
####################################### library(DESeq2) library(ggplot2) library(pasilla) #### Wihtout Outliers -> New DESeq #### ### Choose one matrix to analyze ### ### raw data dds_data <- adjusted_df_1 dds_coldata <- coldata_df_1 Target_comparison <- 'FILTERED_1_MTLEALL_NL' contrast_vector <- c("Diagnosis","MTLEAL...
7bea8da7504b0d73d601402cacebe094b8d1e52d15b280a755a50ea01033aa94
R
1,685
40
#' Combine multiple continuous variables by averaging Z scores #' #' To summarize multiple features, each is normalized to represent a Z-score. #' Scores are averaged to return a single vector. #' #' @param cont_mat A \code{matrix()} with spots as rows and 2 or more continuous #' variables as columns. #' #' @return A \...
20a9192f33d3f8dffe3d696e0f061d4fb1148a9b90585a2bb56f7196c6c4dd4b
R
1,686
50
--- title: "Capturing neuroglancer meshes from a browser scene" --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ## Background Originally **fafbseg** had no support for reading objects directly from a neuroglancer scene URL. The only approach was to capture an interactive ...
9ace12cbb16394ce2c84c539d592340a079b2d058d0d201393eb46ad4b47bc07
R
1,688
42
library(ggplot2) library(reshape2) library(viridis) # Create the data for sound sensitivity analysis (full distribution) data_exp3 <- data.frame( Near_Sound = c(2, 5, 5, 3, 1), Zone2 = c(6, 5, 10, 3, 9), Zone3 = c(11, 22, 11, 10, 19), Zone4 = c(40, 43, 31, 22, 49), Far_Sound = c(441, 425, 443, 444, 422) ) #...
2108c63ce02cb2bfdb8683f798b345dcf2facd0b6915e9dc55462400611281ad
R
1,691
40
#' Spatial registration: block correlation #' #' This function computes the block correlation using the sample ID as the #' blocking factor. This takes into account that cells in scRNA-seq data or #' spots in spatially-resolved transcriptomics data from Visium (or similar) #' have a sample ID batch effect. #' #' @param...
6f36169da6d5bffd09288cd4f3821b353337cece1774b01fbfa6e9c6e57b3a12
R
1,694
34
#' @title Compare headers between mask and other images #' #' @description #' Function to check if mask is in the same space as inputs #' #' @param lesions.list list of antsImages or character vector #' of filenames #' @param mask antsImage of mask to check #' #' @return Nothing is returned, function stops with error i...
72dc21c2b00356f393a91787712a87f67f8c2b9c6d99b00142b307cfeefad4f9
R
1,696
55
# Set working directory - adjust path as needed # setwd("path/to/STEP2.Training_cis/") library(purrr) library(dplyr) library(data.table) library(limma) ## Get unique snp_annot all chromosomes and convert genotypes files in RDAta walk(c("dlpfc"), function(region){ eqtls_all <- fread(sprintf("./output_LIB...
f041da77338dd7783e693b51d06f0c16f11daccf237253e35f19afa0b32d002c
R
1,703
52
#' Load Data for LK Searchlight Analysis #' #' Loads train/test datasets, embeddings, gradients, and searchlight IDs. #' Returns a list containing all loaded data. #' load_data <- function(H, g, scale, side, group = "train") { # Check that np and vgu are loaded if (!exists("np", envir = .GlobalEnv) || !exists("vgu...
829182e0ba95adb51972aba175e1686f0d995afc41022064c28506844e73aca3
R
1,708
63
#!/bin/Rscript args = commandArgs(trailingOnly=TRUE) if (length(args)<2) { stop("Two arguments must be supplied") } else { data_path = args[1] detail_regions = args[2] } library(GenomicRanges) library(htmltools) library(conumee2) library(sesame) library(plotly) message("Running: ", data_path) message("Loadi...
ea11d846350dbb0b5ff431642746e15dac013ce742a97f0ad12deb22d1a6e774
R
1,708
47
#' @title Determine type of variable passed by user #' #' @description #' Function to check a variable whether is composed #' of an antsImage, list of antsImages, or simply filenames. #' If none of the above, an error is returned. #' #' @param input the variable to be checked #' @param checkHeaders make sure all images...
0f946b71baf8436c46c1b4ce445ddbdb21319bf772da0cbb901ad57c6375ba8e
R
1,710
58
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = NA, fig.path = "man/figures/README-", out.width = "100%" ) ``` # SpNeigh <img src="man/figures/SpNeigh_logo.png" align="righ...
e5e425efdea6f823c1a4c5456d7c6c1d13590e4c6123ce8766f1708d81bbc54a
R
1,710
41
# Load necessary libraries library(Seurat) library(matrixStats) # For efficient row/column operations # Define the trinarize function trinarize <- function(counts, cluster_ids, f = 0.2) { # Extract count matrix from Seurat object (assumes RNA assay) #counts <- GetAssayData(seurat_obj, layer = "counts") #c...
dc7a4deda18676dc3987285b61750b599537a36f61a2476529b91acf65d9a40c
R
1,711
77
--- title: "1_data_import" output: html_document date: "2025-12-31" --- ```{r} library(dplyr) library(readr) library(tibble) library(readxl) library(purrr) ``` # import sample metadata ```{r} meta <- read_xlsx("/path/to/resources/metadata.xlsx") block_ids <- meta$Block block_lookup <- data.frame(Block = block_ids, ...
ed3ed721019c12a71bf7b6521b1265467eda427f2794544e81517e70b92d988f
R
1,711
49
here::i_am("scripts/1.neural_differentiation_dataset/1.1.mapping_and_QC/1.1.4.remove_small_contigs.R") library(glue) library(tidyverse) library(plyranges) library(here) wd <- here("data/neural_differentiation_dataset/genomes/") # load genome index fai <- read_delim(here(wd, "gorGor6.fa.fai"), col_names = F) # plot ...
490761831090a9faad4a3703386adb58d5255a22d9e92f6629ced0686bd1bb75
R
1,712
48
args<-commandArgs(TRUE) genome_species_list = sprintf("%s", args[1]) vir_taxa_file = sprintf("%s", args[2]) library(ape) ##### codes_species<-read.table("codes_ffp_file_list.txt",sep=" ") colnames(codes_species)<-c("ID","ffp_name") codes_species$ffp_name<-as.character(codes_species$ffp_name) ## family<-read.table(geno...
04a2e33c01f061bfad1899878b049dcc18411eb239e392bb52dd4e21abffc65b
R
1,714
45
#!/usr/bin/env Rscript #------------------------------------------------- # Title: run DRG deconvolution with Instaprism # Author: Christina Meier # Date: 2025-06-10 # Email: 19cm51@queensu.ca #------------------------------------------------- # Notes ------------------------------------------ # module load StdEnv/202...
88a10d1c0b23b455c4e17c18958fc2ed6f6705e036c6bae99f50136ed986283b
R
1,715
37
# Moderate effect size genes project # Author: Madison Caballero # Desription: Performs equilibrium test library(stringr) `%ni%` = Negate(`%in%`) args = commandArgs(trailingOnly=TRUE) # The input file is a merge of data from all cohorts. Header: #Gene1,Gene2,N_AB_ASD,N_AB_non_ASD,N_A*_ASD,N_A*_non_ASD,N_B*_ASD,N_B*_n...
ab76cbfdd1d61a311f77bbd14913377b39b0b739f428ad0a0449a5d9492ab0cc
R
1,718
49
# The data set used in this example is from http://archive.ics.uci.edu/ml/datasets/Wine+Quality # P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. # Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009. library(mlflow) library(glm...
b85a54e84b5f5d3bec814727684f8dc73b057f7719f1995e329a28ee08cd7cfe
R
1,718
33
# Please cite the following two papers if using CIE: # 1) Farahman, S., O'Connor, C., Macoska, J., Zarringhalam, K. 'Causal Inference Engine: A platform for directional gene set enrichment analysis and inference of active transcriptional regulators', NAR doi: https://doi.org/10.1093/nar/gkz1046 # 2) Fakhry CT, Choudhar...
a5f87414642b701699e16c477e2cb30e7cf5a4e76bfa69d54329a671102aa23b
R
1,724
46
op <- choose_malevnc_dataset('VNC') on.exit(options(op)) test_that("manc_nodespec", { mnc=manc_node_chain() expect_equal(manc_nodespec("clio"), manc_dvid_node('clio')) expect_equal(manc_nodespec("1ec355"), "1ec355123bf94e588557a4568d26d258") expect_equal(manc_nodespec("1ec355:c9c1d9", include_first = T), mnc[1...
0e3a3ddb5f20f43a0c77070a17e0a8db73d5d672db9dbc78c530d89877798ae9
R
1,728
48
library(dplyr) df <- read.csv("03_Results/02_Analysis/master_gsea_table.csv") # Check unique values of ever_significant cat("Unique values of ever_significant:", paste(unique(df$ever_significant), collapse=", "), "\n") # Create wide format pathways <- df %>% group_by(pathway_id, database, ID, Description) %>% s...