sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
b851d321c220c077d8e13f4e67f6e5c71f6f546b5f6ecb14702e06ed42e03538 | R | 3,658 | 75 | library('ggpubr')
stringsAsFactors=FALSE
library(grid)
library(forcats) ### for fct_reorder()
library(optparse)
library(cowplot)
############################################################### Combining Histology with EXTEND Scores (Figure 3) #############################################################################... |
cf5be137bfdfce4757b050a715c8dd5d2cbf0126b1821046292c06074d1a3e1e | R | 3,661 | 98 | ---
title: "Patient_splits"
author: "HannahSavage"
date: "2023-08-15"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
#Set env
```{r, include = FALSE}
library(readxl)
library(dplyr)
library(tidyverse)
library(ggplot2)
library(grid)
library(reshape)
library(scales)
library(... |
1d80af3280ced7fc0e622b66ae48a68ba7639b3c8cc5bd505c99b7cd913e18a5 | R | 3,662 | 77 | ---
title: "Frequently Asked Questions"
date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`'
output: rmarkdown::html_vignette
theme: united
df_print: kable
vignette: >
%\VignetteIndexEntry{Frequently Asked Questions}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
***
<style>
p.caption {
font... |
40b5e005280eb3e52c6363cd39e5f6962d5c5ce668c87f0e914a1d5b002e60da | R | 3,666 | 116 | library(Seurat)
library(miloR)
library(scater)
library(patchwork)
library(dplyr)
library(scran)
library(knitr)
library(ggrepel)
querySeurat <- readRDS("saved/toZenodo/mlo_resolution075_Annot.RDS")
querySeurat$condition <- gsub("[0-9]+","", querySeurat$donorId)
suppTab14 <- querySeurat@meta.data[,c("midBrainId", "do... |
685735a8f4a9feb1e309cf34cc130c94869592606c5e1b4f62b2ccad3340df56 | R | 3,669 | 94 | #' Helper function to prepare input data used for model fitting and motif activity estimation
#' @description
#' This function generate the appropriate input for the STAN model used to estimate motif activity.
#'
#' @param in_seq_motif_data list containing FC_rank (seq X sample/cell), motif_probs (1 X seq), motif_count... |
793c858504d146c447e426adb02e85dc846faa4fe70e2d9362dc3e8c2741ec1a | R | 3,670 | 106 | #!/usr/bin/env RScript
args=commandArgs(trailingOnly=TRUE)
#Alias
rn<-rownames;
cn<-colnames;
#check args
if(length(args)!=5){
stop("5 arguments needed: Rscript filter.R <expression_file> <output_folder> <number_of_replicates> <min genes> <min cov>\n",call.=FALSE)
}
# reading function
lire<-function(x, character=F... |
f20ec5301abd21745dc4a1759fdc8c74401b7c3e1ddf9a78404426dbdf4ba087 | R | 3,670 | 125 | if (!requireNamespace("here", quietly = TRUE)) install.packages("here")
source(here::here("stats","permutation_tests","palm_code","_setup.R"))
# Load the extinction matrices into the environment
palm_load("ext") # gives amygdala_sham_threat_df_wide, amygdala_active_threat_df_wide, etc.
# --- Define output folder (pr... |
11b6b8ee5a03f9339595445f2a1eb67caecabfd1d27142327301d8ac14786c0a | R | 3,671 | 125 | if (!requireNamespace("here", quietly = TRUE)) install.packages("here")
source(here::here("stats","permutation_tests","palm_code","_setup.R"))
# Load the ACQUISITION matrices into the environment
palm_load("acq") # gives amygdala_sham_threat_df_wide, amygdala_active_threat_df_wide, etc.
# --- Define output folder (p... |
a524606add06f3ce0722b7e3ea745aeba91491ea66880dcf7475524ca2faaa9b | R | 3,675 | 87 | library(pROC)
data(aSAH)
context("ci.coords")
test_that("ci.coords accepts threshold output with x=best", {
expect_error(ci.coords(r.wfns, x = "best", input = "specificity", ret = c("threshold", "specificity", "sensitivity"), boot.n = 1), NA)
})
test_that("ci.coords rejects threshold output except with x=best", {
... |
b5abc00429f6ed40348bef2e7e4e88287c9073e452ca42249b692e0595035b77 | R | 3,678 | 97 | #' @export
#function
NCBI_synonyms<-function(inputDF, input_col){
#NCBI_synonyms example####
# inputDF<- data.frame( symbols=c('ONECUT2','NEBL','SNTB2','USP9Y','KAT6A','CRIM1','IGSF10'), values=c(0.01,0.5,0.05,0.001,0.9,0.03,0.06))
# input_col<- "symbols"
# output<-NCBI_synonyms(inputDF, input_col)
#names(ou... |
a145d649837f82103d0b73e692c9fb8d830e6b26ddb5debda3689380e458b22f | R | 3,684 | 64 | suppressPackageStartupMessages({
library(GenomicRanges)
library(dplyr)
})
process_annotate_overlaps <- function(cnv_df, exon_granges, gene_df) {
# This function takes a standardized data.frame that contains genomic range
# information (cnv_df) and finds the overlaps with a GRanges object (exon_granges).
#
... |
738c9fc782560c6b146a148879adf5115813da01ac27390d1aed93a3eb7a92ff | R | 3,687 | 125 | if (!requireNamespace("here", quietly = TRUE)) install.packages("here")
source(here::here("stats","permutation_tests","palm_code","_setup.R"))
# Load the re-reextinction matrices into the environment
palm_load("reext") # gives amygdala_sham_threat_df_wide, amygdala_active_threat_df_wide, etc.
# --- Define output fol... |
6c1038eb40b827114dc444fc362cb6b3d203d86b26b7edd324a1568ea5f19bbb | R | 3,688 | 125 | if (!requireNamespace("here", quietly = TRUE)) install.packages("here")
source(here::here("stats","permutation_tests","palm_code","_setup.R"))
# Load the extinction matrices into the environment
palm_load("ext") # gives hippocampus_sham_threat_df_wide, hippocampus_active_threat_df_wide, etc.
# --- Define output fold... |
2c59572359999624e6b95a787e7a2c8d0301ac77eb94ca0da930ac9acdcb7c6d | R | 3,689 | 125 | if (!requireNamespace("here", quietly = TRUE)) install.packages("here")
source(here::here("stats","permutation_tests","palm_code","_setup.R"))
# Load the ACQUISITION matrices into the environment
palm_load("acq") # gives hippocampus_sham_threat_df_wide, hippocampus_active_threat_df_wide, etc.
# --- Define output fol... |
ce20e9566a90abfb0ee90cf7e9955fe1d086b9e73811273de878cc671f744f6b | R | 3,697 | 118 | ###############################################################
# Example script illustrating how to generate a heatmap
# with row/column annotations using pheatmap.
# This script uses only simulated data for demonstration purposes.
# It does NOT contain real data or metadata from the study.
######################... |
75e6ab3556dd650efbfbdfcd3b6fa9bfed33180cc7ba3d74d740389152813a66 | R | 3,698 | 90 | ---
title: "How to assess model robustness and select a MOFA model for downstream analysis?"
author: "Britta Velten"
output:
BiocStyle::html_document:
toc: true
package: MOFA2
vignette: >
%\VignetteIndexEntry{MOFA2: How to assess model robustness and do model selection}
%\VignetteEngine{knitr::rmarkdown}
%\... |
f5a3949687d08d964746d61d183c89422de1e49ea1ad95702943fd938a9809a2 | R | 3,703 | 97 |
norGeneExp <- readRDS('norGeneExp.rds') # rows = genes, cols = samples
phenotypeDF<- readRDS('phenotype.rds') # one row per sample
safescale <- function(v) {
v <- as.numeric(v)
if (!any(is.finite(v))) return(rep(NA_real_, length(v)))
m <- mean(v, na.rm = TRUE); s <- sd(v, na.rm = TRUE)
if (!is.finite(s... |
1f13417548692c6afa0ed34b1c5332ecccb7f1f76b7f53e00d911132c8b81d69 | R | 3,705 | 125 | if (!requireNamespace("here", quietly = TRUE)) install.packages("here")
source(here::here("stats","permutation_tests","palm_code","_setup.R"))
# Load the re-reextinction matrices into the environment
palm_load("reext") # gives hippocampus_sham_threat_df_wide, hippocampus_active_threat_df_wide, etc.
# --- Define outp... |
a2edc16771963c003eee7c7b37aaf69884775e7f6a07f168429200087d2b33b7 | R | 3,708 | 93 | library('ggpubr')
stringsAsFactors=FALSE
library(grid)
library(forcats) ### for fct_reorder()
library(optparse)
############################################################### Comparing EXTEND Scores of Medulloblastoma molecular subtypes (Figure 4) ######################################################################... |
3fb99dd5ab2216687632c80b096aabb221e3de301cae4a5e4f19d39e3be7d7e6 | R | 3,711 | 84 |
# Obtain the gene names from SKAT results with Benjamini-Hochberg correction
get_gene_from_SKAT <- function(skat_results_path, pvalue_threshold) {
gene_result <- read.csv(skat_results_path, sep = "\t")
# Apply the Benjamini-Hochberg correction
gene_result$adjusted_pvalue <- as.numeric(p.adjust(gene_result$pvalu... |
4b0a789129bd7bb671abd72a4f1a0e33c2912b8efb341a873de406a3626f2306 | R | 3,714 | 115 | # This script addresses the issue of molecular subtyping ATRT samples by
# plotting the filtered ATRT data produced in the `ATRT-molecular-subtyping.R`
# script.
#
# Chante Bethell for CCDL 2019
#
# #### USAGE
# This script is intended to be run via the command line from the top directory
# of the repository as follows... |
c838d9b9b7feb12231de90d82313b05ad85546e3bcaadb247004d3a6ab3a1892 | R | 3,717 | 108 | #'---
#' title: Aberrant Expression
#' author:
#' wb:
#' log:
#' - snakemake: '`sm str(tmp_dir / "AE" / "Overview.Rds")`'
#' params:
#' - annotations: '`sm cfg.genome.getGeneVersions()`'
#' - datasets: '`sm cfg.AE.groups`'
#' - htmlDir: '`sm config["htmlOutputPath"] + "/AberrantExpression"`'
#' input:
#'... |
546423f9d13a776fc1cbe7c83137291a89b814e8c83911c6a1fc0d096f276b5f | R | 3,726 | 88 |
## run example:
## /opt/R-3.4.3/lib64/R/bin/Rscript MAPS_regression.r /home/jurici/work/PLACseq/MAPS2/results/bing_mESC_intersect_subsamples/
## MY_113.MY_115 19 RH_129-130.uniq.paired.sorted.nodup.nsrt.5k.MAPS2_filter
##
## arguments:
## INFDIR - dir with reg files
## SET - dataset name
## chroms - number of chromos... |
49779cbde856f7994c7e37a515ccafea78e8212eca5b5a0c3f54d0602ffcd3e8 | R | 3,728 | 115 | .sigmoid <- function(x) {
1.0 / (1.0 + exp(-x))
}
.logit <- function(x) {
log(x / (1.0 - x))
}
test_that("lgb.interpret works as expected for binary classification", {
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
set_f... |
3a432b34766125c520f2a292cb986caabca00e89c8ad8d9d982b0ca1256a1eef | R | 3,732 | 116 | # Script for plotting pH measurements ++++++++++++++
# Authors: Meike Bielfeldt, Kai Budde-Sagert
# Created: 2025/11/12
# Last changed: 2025/11/12
# Delete everything in the environment
rm(list = ls())
# Close all open plots in RStudio
graphics.off()
# Show warnings as they appear
opt... |
0755bece641417704be58603776cf4b181dd1d27537ae8df62d847d78b9391a2 | R | 3,734 | 106 | ########################### Internal Validation #########################################
#
# Objective: Validate IMABC posteriors by plotting fit of calibration outputs
########################### <<<<<>>>>> ##############################################
rm(list = ls()) # Clean environment
options(scipen = 999) # ... |
38c5cfdc1ffc7aabaf60ad9cc9b38c5fe9d19d955cc7508e7b9017ff7ad1c4d6 | R | 3,739 | 99 | library(data.table)
library(ggplot2)
library(lme4)
library(ggrepel)
library(cowplot)
library(dplyr)
source("../SM/src/custom_pvca.R")
source("../Plot_theme.R")
set.seed(42)
# Load color scheme
colors <- fread("../Plotting/colors.csv", strip.white = F)
color_v <- colors$Color
names(color_v) <- colors$ID
# Define vari... |
af75489aceed9e51ce7909ecbf393a16e3c476cca5da7ef728cca5205df9cdbc | R | 3,739 | 100 | # Here we are going to try training a model with categorical features
# Load libraries
library(data.table)
library(lightgbm)
# Load data and look at the structure
#
# Classes 'data.table' and 'data.frame': 4521 obs. of 17 variables:
# $ age : int 30 33 35 30 59 35 36 39 41 43 ...
# $ job : chr "unemploye... |
c737c7787083744e910aa685e3f1493cf23bd24c9226deffae50f5b331c7c80f | R | 3,742 | 109 | #' Checks if shinycell config data.table contains any errors
#'
#' Checks if shinycell config data.table contains any errors. It is useful and
#' reccomended to run this function if users have motified the shinycell
#' config manually. Errors can include (i) levels in scConf does not match
#' that in the Seurat/Sing... |
7189f2670dd7d3ba5e6069a4eab6430809a10c83303a81970fcb0d68be17036f | R | 3,743 | 128 | #' circosplot
#'
#' Publication-ready circos plot of DMPs/DMRs.
#'
#' @param ranges GRanges object containing at least `deltabetas`
#' and optionally `genesUniq`.
#' @param genome Genome build: `hg38`, `hg19` or `mm10`.
#' @param label_probes Optional vector of probe IDs to annotate.
#' If NULL and max_labels > 0, ... |
83a280db68d6313b3fb787c32cab60992784c7760499769b266bd398dafca815 | R | 3,749 | 153 | ---
title: "Add dominant status column to consensus SEG file with cytoband field"
output:
html_notebook:
toc: TRUE
toc_float: TRUE
author: Chante Bethell for ALSF CCDL
date: 2020
---
This notebook adds dominant status information per cytoband to the consensus SEG files prepared in `run-prepare-cn.sh` using ... |
a7e09603bed9f5bb2bce3bf1d33398013971ba9ea4e26bcf1caa047443079489 | R | 3,757 | 106 | # TODO: Add comment
#
# Author: fec
###############################################################################
library(R6)
Model <- R6Class("Model",
public = list(
initialize = function() {
private$formulaFields <- c()
private$nuOfFeatures <- 0
self$setFormulaBase()
... |
0406d550a2b0b0148863e46dc989b49b23ee615152a66676be319c9a21554023 | R | 3,770 | 98 | ##-------------------------------------##
## VIOLINS TAB ##
##-------------------------------------##
tab_VIOLINS <- tabItem(
tabName = "Violin plots",
sidebarLayout(
sidebarPanel(width = 3,
selectInput(inputId = "select_matrix_violins",
... |
682ba0abf27b3897c6e566c98a951e4753ef07c83608bb1773fd133e774a48ff | R | 3,774 | 95 | # candidate gene identification
library(igraph)
library(doParallel)
library(foreach)
library(tidyverse)
traitAnnotation = read.csv('data/traitOverview.csv')
variantsWithHPOandMP = read.csv('data/variantsCiliopathyMP.csv')
pageRankScores = readRDS('data/pagerankScores.rds')
'%notin%' = Negate('%in%')
#load open targ... |
cd5820a17dec09f76cafa46284ea855ce97bbc71da7f906ea905fb9160e90d84 | R | 3,778 | 87 | # Function for filtering peak results ++++++++++++++++++++
# Author: Meike Bielfeldt, Kai Budde-Sagert
# Created: 2025/05/17
# Last changed: 2025/05/17
get_specific_peaks <- function(df_peaks_complete = NULL,
min_index = min_index,
... |
6940e3794bae9a5df9eaa767df724192edc7abf2e53c18fcd3ffa753c8792a24 | R | 3,782 | 115 | ###############################################################
# Example script illustrating how to generate a Circos plot
# of genomic data using the circlize package.
#
# This script uses a fully simulated dataset and does NOT contain
# any real genomic coordinates or methylation values.
######################... |
3cc12220516836613ce0ab0a05075699e485867871db50ce692a91ae650b44e3 | R | 3,788 | 103 | ---
title: "Subtype Neurocytoma tumors as central or extra-ventricular"
output:
html_notebook:
toc: TRUE
toc_float: TRUE
author: Krutika Gaonkar for D3b
date: 2020
---
For, "Neurocytoma" samples detected in pathology_diagnosis, subtyping conditions as per issue [#805](https://github.com/AlexsLemonade/OpenPB... |
fcec9db627d90e7ff488db61bd592c8ffa8a7a6530bb0fed5c3f7dbd72572ef6 | R | 3,789 | 124 | ---
title: "Boxplots for H4K16ac signal in Peaks"
author: "AF"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
plot_save_as_svg <- function(plot, file_name) {
dir.create(paste0(dirname(getSourceEditorContext()$path),"/../plots"), showWarning... |
51750649f55f734b72f7f0790cd212f0a2b0646cab8491fcf881c7d3e495cba6 | R | 3,798 | 135 | ###############################################################
# Example script illustrating how to perform PCA and plot
# convex hulls for sample groups.
#
# This script uses fully simulated data only and does NOT contain
# any real study data.
###############################################################
... |
96a73f7171212afdf38028f0dd9a2e9fbd2e6e7729ec2c3bb05fcebec32ed118 | R | 3,800 | 80 | args <- commandArgs(TRUE)
run_CHETAH<-function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){
"
run CHETAH
Wrapper script to run CHETAH on a benchmark dataset with 5-fold cross validation,
outputs lists of true and predicted cell labels as csv files, as well as computat... |
e2502cb0c7696ce278205fbfa00d966b662f0b950b0149c33278f6f46ea36894 | R | 3,810 | 114 | #' Format and rename columns in a sample sheet data frame
#'
#' This function formats and renames columns in a sample sheet
#' data frame to ensure consistency and compatibility with
#' downstream analysis. It performs the following operations:
#' - Converts column names to lowercase.
#' - Renames the "samples" or ... |
0773dd5043f64d4741f014a9e026c17be4daacc39cc68658dd81659e4a650b97 | R | 3,811 | 126 | #'---
#' title: Create QC matrix
#' author: vyepez
#' wb:
#' log:
#' - snakemake: '`sm str(tmp_dir / "MAE" / "{dataset}" / "QC_matrix.Rds")`'
#' params:
#' - rnaIds: '`sm lambda w: sa.getIDsByGroup(w.dataset, assay="RNA")`'
#' input:
#' - mae_res: '`sm lambda w: expand(cfg.getProcessedDataDir() +
#' ... |
a9e53240440ef75447949e437eb9f9af35c78c83b0de7dfa08602d31db22b41c | R | 3,817 | 134 |
#
# This function generates a null distribution for state/cell-type classification by sampling cells and shuffling the
# expression values, thus generating random cells. These random cells are then scored for the supplied set of signatures.
# In this approach the cells are scored across all samples.
#
generate_null_di... |
3749b94f141ce694fbb2a3ee51e55d35babb9cd80bbbc9931d7600a24e2cd4e5 | R | 3,819 | 116 | #' Read gene sets from a GMT file
#'
#' Reads a Gene Matrix Transposed (GMT) file and returns an Annot object
#' for use with \code{enrich()} or \code{richGSEA()}.
#'
#' @param file path to a GMT file
#' @param species species name (default: "custom")
#' @param keytype gene ID type in the file (default: "SYMBOL")
#' @r... |
cc640fa45c344131f14ef821d15365783de3af148f7a16adf88240bf2b35d2e1 | R | 3,819 | 112 | #' Wrapper function to construct a STAN model for motif activity inference.
#' @description
#' This function constructs a STAN model object for motif activity inference, and is used by fit_motif_model(), bayesReact_core(), and bayesReact_parallel().
#'
#' @param model a character string specifying the model to be used ... |
51ca49ccbbd4a129e3aad6d0f8023416fbcc14c3dcaf3e310629b95fd569af18 | R | 3,820 | 81 | #needs R/4.0.0
# define the report folder from sci-RNA-seq pipeline
report_folder = "<yourworkfolder>/nobackup/output/report/"
# define the output folder for output the df_cell, df_gene and gene_count matrix
output_folder = "<yourworkfolder>/nobackup/output/report/"
suppressMessages(library(Matrix))
suppressMessages(... |
d7c2047338f6c34d3ebb2545040dbc829e7b3ef2f4d0a3a51fbee77810268679 | R | 3,820 | 113 | ################################################################################
# This data processing script transforms a MARVEL data file from the paper
# into smaller files specific to the plots being generated. This transformation
# was needed to overcome shinyapps.io limitations on disk space and memory.
#
# To ... |
d532428273829df3eeeb2ee22fa8edeb249def2a8f92029263cf835f6348d4ca | R | 3,822 | 124 | ##-------------------------------------##
## DOTPLOTS TAB ##
##-------------------------------------##
get_average_scores <- function(score, clusters, meta){
average_score <- c()
for (cluster in clusters){
average_score <- c(average_score, mean(score[meta == cluster]))
}
return(avera... |
62dc4ff8fca43e94789d8ec96c0ad15c85bb34c3c0878d0a78901c97cff91cbb | R | 3,824 | 124 | args <- commandArgs(TRUE)
name <- as.character(args[1])
setwd(name)
### Condamine 2019 Ecology Letters Trees Loading
load("EMP_DATA/FamilyAmphibiaTrees.Rdata")
load("EMP_DATA/FamilyBirdTrees.Rdata")
load("EMP_DATA/FamilyCrocoTurtleTrees.Rdata")
load("EMP_DATA/FamilyMammalTrees.Rdata")
load("EMP_DATA/FamilySquamateTr... |
2843855c1c2f310cecfcec6ae8bf0e033d685a6f111cd9abda8e526c9b84a0bd | R | 3,828 | 76 | # load libraries
library(magrittr)
library(dplyr)
library(readr)
# base directories
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git"))
analysis_dir <- file.path(root_dir, "analyses", "independent-samples")
out_dir <- file.path(analysis_dir, "results")
dir.create(out_dir, showWarnings = F, recursive = T)
# s... |
874fc2dff88c3ba612118911a31c6aa17b0bb8d2c9b855f7a2b74bd86f91b1c8 | R | 3,830 | 104 | # If need to install then uncomment below
#install.packages("BiocManager")
#install.packages("tidyverse")
#need r version 4.1.0 for this to function
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install(version = "3.13")
#BiocManager::install("ComplexHe... |
2098532708677cfce8af3d43439888ea525007f551b651ce9562fa6983e3649a | R | 3,834 | 91 | #' Plot compare heatmap of Enrichment result among DEG groups
#' @importFrom dplyr full_join
#' @importFrom dplyr arrange
#' @importFrom ggplot2 ggplot
#' @importFrom ggplot2 geom_tile
#' @importFrom ggplot2 scale_fill_gradient2
#' @importFrom ggplot2 theme
#' @importFrom ggplot2 theme_minimal
#' @importFrom ggplot2 co... |
456a3521bb24da80a3ab6a63c0ab521df62dd33e32762d17d05c8bd3f67af174 | R | 3,848 | 107 | # Load necessary libraries
library(stringr)
library(dplyr)
library(tidyverse)
library(data.table)
library(patchwork)
library(ggplot2)
library(purrr)
library(ggthemes)
library(grid)
library(rstatix)
library(ggpubr)
library(sigmoid)
library(gridExtra)
library(kableExtra)
library(DT)
# Load data
base_... |
3a98e83529568a49892589d8bbd6f94fe5bfbf29b3a06d1b2f2d7e5aa06cc6a8 | R | 3,855 | 131 | getwd()
setwd("/data/nas1/liuyiding_OD/project/01_project_147/05_VN_KEGG_GO")
Tc=fread("T cellsdeg.csv",header=T,data.table=F)
deg=subset(Tc,Tc$p_val<0.05&abs(Tc$avg_log2FC)>0.5)
DEG=fread("DESeq2.diff.tsv",header=T,data.table=F)
DEG=subset(DEG,DEG$pvalue<0.05&abs(DEG$log2FoldChange)>0.5)
old=fread("related.txt",head... |
5ee1885c97915d9de8f67bd95a12685ccedf13e2cfcfa42d47f1861769d2b450 | R | 3,858 | 130 | stringsAsFactors = FALSE
suppressMessages(library(ggplot2))
suppressMessages(library(dplyr))
suppressMessages(library(ggrepel))
suppressMessages(library(anndata))
library(reticulate)
library(tidyr)
library(writexl)
library(foreach)
library(doParallel)
library(cowplot)
library(readxl)
library(data.table)
##-----------... |
a8542644978d3c5dae55f08fc8c80a6b94b73b2dfd715b348b41e00d09d8490a | R | 3,865 | 103 |
library(Seurat)
library(ggplot2)
library(gghighlight)
library(ggbeeswarm)
library(ggpubr)
library(RColorBrewer)
library(clustree)
querySeurat <- readRDS("saved/toZenodo/mlo_resolution075_Annot.RDS")
clustAnnot <- c(0:23)
names(clustAnnot) <- c("hRgl2/immAstro","hNbDA","hProgFPM","OPC_1","VLMC","hDA1b","hRgl1","hDA1... |
000638bc6f899358e617e8ddca7431cd77d0ba71cb0effebda8ae47dbe7ef863 | R | 3,866 | 108 | #'---
#' title: Monoallelic Expression
#' author:
#' wb:
#' log:
#' - snakemake: '`sm str(tmp_dir / "MAE" / "Overview.Rds")`'
#' params:
#' - annotations: '`sm cfg.genome.getGeneVersions()`'
#' - datasets: '`sm cfg.MAE.groups`'
#' - qc_groups: '`sm cfg.MAE.qcGroups`'
#' - htmlDir: '`sm config["htmlOutp... |
90283f08d03e3002efce375a5eb32ef67a8ddc5ca225bbfc396d9a3aa333cfb0 | R | 3,867 | 101 | # Author: Sangeeta Shukla (shuklas1@chop.edu)
# Purpose: This scripts automates the seach to retrieve EFO, MONDO, and NCIT ontology codes for all cancer_groups found in the histologies.tsv file.
# This reduces the manual work to only have to review the potential edge cases where the codes may not be perfect match for t... |
dce846e8563fbea29c2f4f53298474320491f57c7ad6436313f43edb9fceeb1a | R | 3,868 | 120 | library(Seurat)
library(SeuratDisk)
library(patchwork)
source("/afs/crc.nd.edu/user/m/mzarodn2/Private/GSE274546/GBM-CARE-WT/R/GBM-CARE-WT_analysis_utils.R")
source("/afs/crc.nd.edu/user/m/mzarodn2/Private/GSE274546/GBM-CARE-WT/R/GBM-CARE-WT_CNA_utils.R")
#source("GBM-CARE-WT/R/GBM-CARE-WT_NMF.R")
source("/afs/crc.nd.... |
f0ccffb7bc7987948e25b81a2d5f5c7f5186f0358d616b5411e4ab371bc67697 | R | 3,868 | 89 | #!/usr/bin/env Rscript
# Script to plot TC context rates of reads
# Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder.
#
# This file is part of Slamdunk.
#
# Slamdunk is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free S... |
d7769f2ca77c42a9a90c7a244b53bbcbede0dd012177d202dc10e96a9d436519 | R | 3,869 | 97 | ##-------------------------------------##
## DOTPLOTS TAB ##
##-------------------------------------##
tab_DOTPLOTS <- tabItem(
tabName = "Dot Plots",
sidebarLayout(
sidebarPanel(width = 2,
selectInput(inputId = "select_matrix_dotp... |
c6b8adcaf51e870f76354065a4255da7b2af77a18c274e942bc59975d5366108 | R | 3,871 | 149 | library(tidyverse)
library(ggplot2)
library(ggridges)
library(dplyr)
library(forcats)
library(viridis)
library(tidygraph)
library(ggnetwork)
library(ggraph)
library(reshape2)
library(ggpubr)
library(colorspace)
# Custom coordinate function
coord_radar <- function(theta = "x", start = 0, direction = 1) {
theta <- ma... |
c132a131abbd198cd88b9ce4dae307a206f97da58051ae5759ff8254f422898a | R | 3,872 | 94 | prepare_palm_data <- function(scr_df,
PHASE_filter,
US_filter = "unreinforced",
out_root,
out_subdir = NULL,
overwrite = FALSE) {
stopifnot(is.data.frame(scr_df), dir.e... |
0a84dc4b658670607f131b803f2d8838e9f6e78c11c8426f065f8f1b13c4fdbc | R | 3,899 | 75 | # ==============================================================================
# U11_co_visualization.R
# UI definition for the "Multi-Molecule Spatial Co-visualization" tab (Step 6 Part 2).
#
# Purpose:
# Provides the interface for visualizing the spatial overlap of up to 3 features using RGB mapping.
#
# K... |
d3884a076b5ebffda1dc2f407d2a2bf68711cf2211d172bc9c55cb65daef10e0 | R | 3,900 | 87 | #' @title Identify Differential Features
#' @description Performs differential expression/abundance analysis between two groups using Seurat's FindMarkers.
#' Uses the Wilcoxon rank-sum test by default.
#' @param data Seurat object containing the data.
#' @param group Vector of length 2. group[1] is the Treatment g... |
b50c2ff32d43972cf2ece02d504942b546c81bc196741cbf7994b7affdaa81f6 | R | 3,904 | 119 | # function that retrieves the data of the relevant pre-computed synthetic
# dataset of wide Olink data
get_wide_synthetic_data <- function(olink_platform,
data_type,
n_panels,
n_assays,
... |
f4e916a54f8bd373c12875770fd440894f1e5cd3b6243f5342c5a8f80d70ea7a | R | 3,908 | 107 | ## ORA
library(msigdbr)
library(clusterProfiler)
ORA <- function(gene_list, pathway = "KEGG", method = "ORA", ...){
if (pathway == "KEGG"){
c2.cp <- msigdbr(species = "Homo sapiens", category = "C2", subcategory ="KEGG_MEDICUS")
pathway.df <- c2.cp %>% dplyr::select(gs_name, gene_symbol)
} else if (pat... |
944c4dd6858b61f575ae2400781957258469380b4e68a1c0cd90ce14bb1ef0bc | R | 3,918 | 80 |
##########################################################
## Define a general class to store a MOFA trained model ##
##########################################################
#' @title Class to store a mofa model
#' @description
#' The \code{MOFA} is an S4 class used to store all relevant data to analyse a MOFA mod... |
c1d991c4d3346230bd5b483a5c3ede36f00af3d4f5f631d60d8d3f1cff35d386 | R | 3,921 | 98 | #' Validate gene input for enrichment analysis
#'
#' Checks that gene input is non-empty, removes NAs and duplicates,
#' and reports mapping statistics.
#'
#' @param x gene vector or data.frame with gene rownames
#' @param annotation annotation data.frame (two-column: GeneID, Term)
#' @param func_name name of the calli... |
961597381d3ade232e25bbd30321ad885450032fd2ce9adf5ef7cc3e99a9c2d3 | R | 3,922 | 88 | library('ggpubr')
stringsAsFactors=FALSE
library(stringr)
library(gridBase)
library(gridGraphics)
library(optparse)
################################################ Comparing Counts versus FPKM (Figure 1) ############################################################################################
root_dir <- rproj... |
b5805dae57e4db9684daeae54ae72a64e0095f7feb6af0229b02b4f7df97a508 | R | 3,923 | 123 |
##-------------------------------------##
## CELL QC TAB ##
##-------------------------------------##
tab_QC_CELLS <- tabItem(
tabName = "Quality Control",
textOutput(outputId = "session_id"),
br(),br(),
actionButton(inputId = "save_session", "Save Session"),
actionButton(inputId = "... |
9ca18f55283fd9003f52a6c828f68fa750ff7cf8da3c3915df98dbd4a0e24ca6 | R | 3,925 | 124 | ---
title: "Using WHO 2016 CNS subtypes to improve CNS lymphoma harmonized diagnosis"
output:
html_notebook:
toc: true
toc_float: true
author: JN Taroni for ALSF CCDL (code) ; K Gaonkar updated for CNS lymphoma
date: 2021
---
CNS lymphoma have subtypes per the [WHO 2016 CNS subtypes](https://link.springer.c... |
fc9dd3c27bd55b23ebd10570262c5f7830b71f9fa1bbe6b57e8e8687f5669012 | R | 3,929 | 78 | ---
title: "Osprey Documentation"
author: "Georg Oeltzschner"
date: "`r Sys.Date()`"
knit: "bookdown::render_book"
site: bookdown::bookdown_site
output:
bookdown::gitbook:
config:
sharing:
facebook: false
github: yes
documentclass: book
biblio-style: apalike
link-citations: yes
colorlinks:... |
bc5a3a0aef10d60442869e1151394224bb680a6a73777304f248abb3e743b7ab | R | 3,941 | 91 | ## Creating Fibroblast species object (Fig7) with our Fibroblast scRNA-Seq data (7/22/82 wo ChP 4V&LV) and human snRNA-seq data (Yang et al.)
## Script performs conversion Human gene symbols to mouse gene symbols
## initially part of script which attempted harmony integration
##########################################... |
da575e2b92dccc81f3c26aa1c2e2223a397403fe699dcb99ff4aebc12b0ee928 | R | 3,942 | 78 | grouping_var_to_label <- function(grouping_var) {
if (grouping_var == "lambda") {
return("Speciation rate")
} else if (grouping_var == "mu") {
return("Extinction rate")
} else if (grouping_var == "cap") {
return("Carrying capacity")
} else if (grouping_var == "beta_n") {
return("Species richness... |
a0e594cc9158dd5683d1b60c74a41232e759e84a321453601ebe6a6059d53920 | R | 3,945 | 101 | ```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(WVPlots)
library(tidyverse)
library(dplyr)
library(tidyr)
library(ggplot2)
library(corrplot)
library(visreg)
library(ggseg)
library(ggsegSchaefer)
library(mgcv)
library(fastDummies)
library(lme4)
library(lmerTest)
library(car)
library(purrr)
k=3
```... |
d824f3f6d77e37bb431cf4e68507581c1ff5e59fb84b25e23bc2db9e9043a991 | R | 3,951 | 112 | # MSigDB Enrichment Analysis for Drosophila RNA-seq
# Description: Performs MSigDB-based KEGG subset enrichment for up/downregulated genes
library(readr)
library(dplyr)
library(clusterProfiler)
library(org.Dm.eg.db)
library(msigdbr)
library(stringdist)
# Input and output paths
fat_file <- "C:/Gene_Analysis/InR_Fatbod... |
022be9ebe00ef773a058dafe118b0b222d722ddcdaf9e0707f6dbb8ae18680b8 | R | 3,971 | 101 | setwd("/media/user/disk21/completeAnalysis/visium_2Jun/")
library(ggplot2)
library(ggpubr)
library(Seurat)
library(inlcolor)
l2cpm = readRDS('../visium_15Sept/l2cpmavg_15Sept.rds')
binary = readRDS('../visium_15Sept/binary_15Sept.rds')
meta = read.csv("meta_12Mar2025.csv", row.names = 1)
thres = read.csv("../visium... |
225bbf93e30221c07a685de4bafccc14520c6a1d20634cdad5751e2b4240a895 | R | 3,973 | 104 | #!/usr/bin/env RScript
args=commandArgs(trailingOnly=TRUE)
outputDir=args[1]
cond1=args[2]
cond2=args[3]
org=args[4]
corresFile=args[5]
libpath=args[6]
myPaths <- .libPaths()
myPaths <- c(libpath,myPaths)
.libPaths(myPaths)
library(clusterProfiler)
library(R.utils)
R.utils::setOption("clusterProfiler.download.metho... |
a2df30b625ea49fda2b8a10453d8f6aa149a5e82b0ca1a33f6dc3e77ffb74063 | R | 3,974 | 101 | getwd()
setwd("/data/nas1/liuyiding_OD/project/01_project_147/03_scRNAdiffanalysis")
r.deg=fread("r.deg.txt",header=T,data.table=F)
head(r.deg)
r.deg <- subset(r.deg, p_val < 0.05 & abs(avg_log2FC) > 0.5)
r.deg$threshold <- as.factor(ifelse(r.deg$avg_log2FC > 0 , 'Up', 'Down'))
dim(r.deg)
r.deg$adj_p_signi <- as.facto... |
22f7579c6c743f8940c8fbda57c0d7c87eba3a29aeb2135ad8ce6f7846d9faef | R | 3,977 | 84 | #' @title paq.validation.study
#' @description This dataset contains data which were used for validation of the Perth Alexithymia Questionnaire in the Czech Republic.
#' @format A data frame with 848 rows and 53 variables:
#' \describe{
#' \item{\code{P_DIF}}{double COLUMN_DESCRIPTION}
#' \item{\code{P_DDF}}{double... |
0688704589e5014f5d7387b562fd41407ac503f5c5ead2a5c95d8e1ca80d0ad3 | R | 3,983 | 106 | f_derivedPCA_WI_m <- function(allWI_d, thr=80, scale = "Y", method = "elbow"){
# method: "variance" uses cumulative variance threshold
# "elbow" uses elbow/scree plot detection
require(FactoMineR)
require(factoextra)
# Scale data if needed
if (identical(scale,"Y")){
... |
707882e6cff4cfd3ba3897874dea053fcb9738a066e4d4c9340ce704e44f5cb7 | R | 3,987 | 141 | #This code will run 2 way repeated ANOVA on network corr with gs
#Author Kim Kundert-Obando
#Load in needed packages
library(dplyr)
library(tidyr)
library(tidyverse)
library(broom)
library(mvtnorm)
#install.packages("datapasta")
library(datapasta)
library(dplyr)
library(tidyr)
#Read in the data
df<-read.csv("Network... |
deddc16d1b79ead00a256a3c26c08e53998c999f6f65dab930eef79331701de3 | R | 3,989 | 101 | #!/usr/bin/env Rscript
# Reproduce the repository's compact R walkthrough from the frozen derived
# tables. This intentionally uses base R so it can run on GitHub without
# restoring the substantially larger analysis environment.
repository_root <- normalizePath(
Sys.getenv("PSILOCIN_REPOSITORY_ROOT", unset = getwd... |
e741c1d320314c3a7ce72db60d80f790e2c59fbecb0b23221ed1edb5ca06d89b | R | 3,990 | 82 | run_CHETAH<-function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){
"
run CHETAH
Wrapper script to run CHETAH on a benchmark dataset with 5-fold cross validation,
outputs lists of true and predicted cell labels as csv files, as well as computation time.
Parameters
... |
80733a2e4b80592401e42fc8910880db47a7368b76a7ac872ea9d1da64c6d97a | R | 3,992 | 141 | test_that(
"osi_distibution plots works - errors",
{
osi_data <- get_example_data("example_osi_data.rds")
osi_check_log <- check_npx(osi_data) |>
suppressWarnings() |>
suppressMessages()
# osi_score = "OSICategory" error ----
expect_error(
object = olink_osi_dist_plot(
d... |
9b4e3d4f6f0a28d91e559bd654d6de08ae90415990ae48dbf4b1c49ffd4d4a0e | R | 3,994 | 134 | ## Nov 2025
## Louise Huuki-Myers
## Preform spatial registration on 4 layers from k=7 spatialDLPFC vs. human pilot layers
#### prep & load data ####
library("spatialLIBD")
library("tidyverse")
library("here")
library("sessioninfo")
## prep dirs
data_dir <- here("processed_data", "07_spatialDLPFC_registration", "01_... |
2072d8449f6208eb20843533b7083895f0baa2cf0d4aa93ebe9f5e24f47fae7f | R | 3,996 | 96 | # data from human protein atlas
library(ComplexHeatmap)
library(ggpubr)
library(tidyverse)
variantsCiliopathy = read.csv('data/variantsCiliopathies.csv')
traitAnnotation = read.csv('data/traitOverview.csv')
'%notin%' = Negate('%in%')
# load single cell consensus data ----
rnaSingleCell = read_tsv('data/rna_single... |
bb9f330d87b59777a87431940ff7b695921327e9900f08fa32a7153382d3ca97 | R | 3,996 | 100 |
######################################
## Functions to perform predictions ##
######################################
#' @title Do predictions using a fitted MOFA
#' @name predict
#' @description This function uses the latent factors and the weights to do data predictions.
#' @param object a \code{\link{MOFA}} object.... |
704bd579bca63d018ab2c499e401e6b73a9b925fbaca39cd9412bd97d5187c25 | R | 3,999 | 129 | rm(list = ls())
setwd("~/Desktop/Lab/celloracle/scortch")
library(dplyr)
library(stringr)
library(ggplot2)
library(ggrepel)
# Load data
## load fisher exact test data of all TF-TGs
raw <- read.csv("./astrocyte_fisher_test_summary_raw_pval_new.csv")
## test for an appropriate k (not so relevant to calculation given k ha... |
6f841c31b2c669458bdc0d23dd2aaa650a0acb629e6bf07eb47351c4cda230db | R | 4,004 | 107 | context("ggroc")
test_that("Ggroc screenshot looks normal", {
skip_if_not_installed("ggplot2", minimum_version = "2.4")
test_ggplot_screenshot <- function() {
print(ggroc(r.s100b.percent, alpha = 0.5, colour = "red", linetype = 2, linewidth = 2))
}
expect_ggroc_doppelganger("ggroc.screenshot", test_ggplo... |
ca7b0c3db44044f0ddce91857191756e6cd4616d62e27f9a7158261896f83125 | R | 4,005 | 96 | library(data.table);library(dplyr);library(ggplot2)
setwd('/home/lorincn/isilon/Cheng-Noah/software/ldsc/nlc_ldscores/EUR')
lddf=fread('EUR.l2.ldscore.gz') %>%
rename(rsid=SNP,chr=CHR,position=BP,ldscore=L2) %>%
as_tibble()
setwd('/home/lorincn/beegfs/lorincn/data')
bim=fread('reference_panels/1kg.v3/EUR.bim') %>% ... |
f52179520c681821d000fa4ed809b4cea0f1a76e51a65c555359569c8195bb6e | R | 4,008 | 73 | #' @title Generate code files required for shiny app (one dataset)
#' @description Generate code files required for shiny app containing only one dataset. In particular, two R scripts will be generated, namely \code{server.R} and \code{ui.R}. If users want to include multiple dataset in one shiny app, please use \code{... |
d143a32e26a7935c079edd4614cb3482ecdd58106ba1c03091a210c1056ded1b | R | 4,009 | 143 | ---
title: "Clustering via BANKSY matrix construction"
output: BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{Clustering via BANKSY matrix construction}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#... |
8bf4dca7491433e2784a88186b93c91c44d72f8c5b485b170853dab3477349d1 | R | 4,011 | 106 | library(pROC)
data(aSAH)
context("smooth")
# Define some density functions
unif.density <- function(x, n, from, to, bw, kernel, ...) {
smooth.x <- seq(from = from, to = to, length.out = n)
smooth.y <- dunif(smooth.x, min = min(x), max = max(x))
return(smooth.y)
}
norm.density <- function(x, n, from, to, bw, k... |
031d96b2b57117f7ac7d341084daad8fb0f9c1832aaa3bd14bb23449550bbca4 | R | 4,014 | 117 | #NKI- Global Component variation relates to anxiety analysis and figure
#Author: Kim Kundert-Obando for questions please reach out to me at k.rogge.obando@gmail.com
#load packages
library(ggplot2)
library(tidyr)
library(dplyr)
library(reshape2)
library(rlang)
library(sensemakr)
#loading dataframe stai
#redundant comm... |
d8ce61ce9fb374e8fbf0d2accbe911de9d5b1a7f2fbaf519252ae71e82725f31 | R | 4,029 | 135 | ################################################################################
# This script runs the Twitter AnomalyDetection algorithms on the NAB data set.
#
# You must first install the AnomalyDetection package:
# https://github.com/twitter/AnomalyDetection#how-to-get-started
#
# You must also have NAB installed ... |
c896e4f41fc7f698692f111374fe615b15c43c20f5464445ab117e2abd6e1531 | R | 4,031 | 86 | #!/usr/bin/env Rscript
library(SummarizedExperiment)
library(tximport)
args = commandArgs(trailingOnly=TRUE)
if (length(args) < 2) {
stop("Usage: salmon_tximport.r <coldata> <salmon_out>", call.=FALSE)
}
coldata = args[1]
path = args[2]
sample_name = args[3]
prefix = sample_name
tx2gene = "salmon_tx2gene.tsv"
i... |
5e626875c920fcc4b2b3405cb5044e6262d397f8b0df631f277e5fdc004c28de | R | 4,044 | 108 | #' @title Checks if shinycell config data.table contains any errors
#' @description Checks if shinycell config data.table contains any errors. It is useful and
#' reccomended to run this function if users have motified the shinycell
#' config manually. Errors can include (i) levels in scConf does not match
#' that i... |
a2d4b4032ca02bd63520819835691f5656aed094af223b84f3334cc63992e572 | R | 4,046 | 114 | #' Add a metadata to be included in the shiny app
#'
#' Add a metadata to be included in the shiny app.
#'
#' @param scConf shinycell config data.table
#' @param meta.to.add metadata to add from the single-cell metadata.
#' Must match one of the following:
#' \itemize{
#' \item{Seurat objects}: column names i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.