sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
24b1fe1a398173867585a1372fa7251fdc14531114c9c5b16e623880647808fb | R | 5,118 | 130 | library(dplyr)
library(tidyr)
library(stringr)
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.edu/user... |
94620422732fec9c911582dedecaefdd95a4e92f8553e22c629c6c334f391097 | R | 5,131 | 184 | NROUNDS <- 10L
MAX_DEPTH <- 3L
N <- nrow(iris)
X <- data.matrix(iris[2L:4L])
FEAT <- colnames(X)
NCLASS <- nlevels(iris[, 5L])
model_reg <- lgb.train(
params = list(
objective = "regression"
, num_threads = .LGB_MAX_THREADS
, max.depth = MAX_DEPTH
)
, data = lgb.Dataset(X, label = iris[, 1L])
, ver... |
70da24bb905d37e7603868c9da44b254dbfd8aeacabc6f9b5d29c24e58308a63 | R | 5,133 | 128 | ########################### Ground Truth Comparison ##########################
#
# Objective: Compare IMABC and BayCANN posteriors to ground truth parameters
########################### <<<<<>>>>> #########################################
rm(list = ls()) # Clean environment
options(scipen = 999) # View data withou... |
548adad0e24815908821bc56e265dec51a61ebae3527e88a504ea8b5f7e305b0 | R | 5,138 | 164 | ########################### Unit test: IMABC and BayCANN functions ##########################
#
# Objective: Visual checks for IMABC and BayCANN functions
########################### <<<<<>>>>> #########################################
#### 1.Libraries and functions ================================================... |
728ea280d9cfa076919aec1adcf2c8bc78d8bb04dd469197c1e5455b1e05c45f | R | 5,138 | 132 | #' Central species lookup table used by all species-mapping functions.
#' Each row: common name, Bioconductor OrgDb, KEGG 3-letter code,
#' msigdbr scientific name, Reactome scientific name.
#' @return data.frame with columns: species, dbname, kegg, msigdb, reactome
.species_table <- function() {
data.frame... |
919b838b1432d886067905e25d619892d0feeb9c9097215c78add7553cf55dc4 | R | 5,144 | 151 | # Load libraries
library(ggplot2)
library(readr)
library(dplyr)
# Read the data
df <- read_csv("~/Desktop/Lab/celloracle/scortch/Astrocyte_gene_expression.csv")
# Classify DE status based on p-value < 0.05
summary_df <- df %>%
select(Gene, p_value) %>%
distinct() %>%
mutate(DE_status = ifelse(p_value < 0.05, "D... |
3d9caa36c2faa73e956b6929176a90dba0bbf98d2da01af7ae8f93c2b95843ea | R | 5,151 | 178 | ---
title: "02_Fig5"
output: html_document
date: "2025-04-01"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
# Load required libraries
library(Matrix)
library(readr)
library(Seurat)
library(tidyverse)
library(harmony)
library(cowplot)
library(patchwork)
# Load the pre-processed Seurat ... |
5dff9888b62aa2df1fede431cae8ba0e5f0050bef8a1d8c931d85817052b3155 | R | 5,159 | 199 | #' Creates a heatmap of proteins related to pathways using enrichment results
#' from `olink_pathway_enrichment`.
#'
#' @inherit olink_pathway_visualization params
#' @inherit olink_pathway_enrichment params
#'
#' @return A heatmap as a ggplot object.
#'
#' @export
#'
#' @examples
#' \donttest{
#' if (rlang::is_install... |
518b09daf438d8fcebffde1e9bc6d01ea95536fc1d2e5ce2cafe226fc7dde10b | R | 5,177 | 181 | library(igraph)
#' Find pairwise IMD between variables across datasets
#' @param x A mrf3 object
#' @param all_var A logical parameter that determines whether to compute the connections of all variables or selected variables.
#' The default is FALSE for memory saving.
#' @return A pairwise adjacency matrix between vari... |
57935bfa849d87602997e0a1299570f8e6929ad3eaad7070f8d35d64c32967d2 | R | 5,180 | 178 |
##-------------------------------------##
## SEURAT TAB ##
##-------------------------------------##
tab_SEURAT <- tabItem(
tabName = "Seurat",
textOutput(outputId = "session_id"),
sidebarLayout(
sidebarPanel(width = 2,
h4("Clustering"),
p("Run ... |
258ef7559dcce429b2d184cbba6684ddec9c5fc35ba74b98ba3506932b2a9a35 | R | 5,188 | 153 | #!/usr/bin/env Rscript
# 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 Software Foundation, either version 3 of the
... |
cee03f149d0632c23d130313eaa67540cae7cf507eeeb7bdd3212e753d34bd7d | R | 5,198 | 135 | ##-------------------------------------##
## TSNE TAB ##
##-------------------------------------##
tab_TSNE<- tabItem(
tabName = "t-SNE",
sidebarLayout(
sidebarPanel(width = 3,
radioButtons( inputId = "genesvspcs",
label = "Select ... |
f740c68f2b0b03ec00dc66f850d0e59560c65ce5d3614b1788866303cf641abd | R | 5,201 | 184 | # pROC: Tools Receiver operating characteristic (ROC curves) with
# (partial) area under the curve, confidence intervals and comparison.
# Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck,
# Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez
# and Markus Müller
#
# This program is free soft... |
7ffb72c3c8eae8ce927271a79cb9d91319ad0b1fd55157307fc86ae74ebbe4d6 | R | 5,220 | 115 | library(ggplotify)
library(data.table)
library(ggplot2)
library(stringr)
library(dplyr)
library(aplot)
library(ComplexHeatmap)
library(cowplot)
source("../Plot_theme.R")
# Load color scheme
colors <- fread("../Plotting/colors.csv", strip.white = F)
color_v <- colors$Color
names(color_v) <- colors$ID
# Load condition ... |
46bcd9c78124289e62658bb307dd0753618a5fa524c39ca4f50a83a1565ff96e | R | 5,221 | 132 | # Metadata function ------------------------------------------------------------
# function to get metadata from GSE series matrix.
my_metadata_function <- function(my_GSE){
gset <- getGEO(my_GSE, GSEMatrix =TRUE, getGPL=FALSE)
gset <- gset[[1]]
suppl_names = getGEOSuppFiles(my_GSE, makeDirectory = FALSE, ... |
69db85221b15889b1cb00da5993e13b24825fc2a1b8dde048e2362c364696f89 | R | 5,242 | 127 | # various helper functions for converting fmriprepped confounds to SPM-able ----
## get path to fmriprep confounds file from subject/run/task ----
# this gets for a single subject/run, for the main processing targets
get_raw_confounds <- function (subject, task, run) {
inject(here::here(!!!path_here_derivatives, su... |
35697fe0bff209d32d88637a10e4650c448a8eb98967a46d29818e3ec8c3486e | R | 5,250 | 109 | # Create OSI data
osi_data <- dplyr::tibble(
OSITimeToCentrifugation = c(
0.3012289, 0.060720572, 0.94772694, 0.720596273, 0.142294296,
0.549284656, 0.954091239, 0.585483353, 0.404510282, 0.647893479,
0.319820617, 0.307720011, 0.219767631, 0.369488866, 0.984219203,
0.154202301, 0.091044, 0.141906908, ... |
80807540f08e55674fd908c5e417236962be39487c23463ef2a451da79f4c884 | R | 5,253 | 197 | #' Compute inter-quartile range (IQR) of multiplied by a fixed value
#'
#' @param df Olink dataset
#' @param quant_col Character vector of name of quantification column
#' @param iqr_group Grouping for which to compute IQR for
#' @param iqr_sd Fixed value to multiply IQR with
#'
#' @return Input dataset with two additi... |
b02f94f2edbde96b34e956a5cbd55e44a765e05f668f04e599b7ec1f30736aaa | R | 5,255 | 148 | # pROC: Tools Receiver operating characteristic (ROC curves) with
# (partial) area under the curve, confidence intervals and comparison.
# Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck,
# Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez
# and Markus Müller
#
# This program is free soft... |
61de49644aad2e81cf9fa9b6018f2bf2b13470b6c0c71f6cd1d206bf6a7869ee | R | 5,257 | 145 | #! /usr/bin/Rscript --vanilla
library(MuMIn)
library(survival)
library("survminer")
source("DataSplitter.R")
source("Outcome.R")
source("MelanomeCSVParser.R")
source("FeatureReduction.R")
source("Model.R")
source("PredefinedFeatureReductionRuleSequences.R")
source("MelanomeSettings.R")
source("ModelTrainer.R")
sourc... |
05ae2bfc28ea2e69a3c2d3b79a525154c155863b48327beecced3c341c051562 | R | 5,271 | 172 | library(tidyverse)
library(bigreadr)
library(writexl)
library(readxl)
library(stringr)
source("/FunctionSet.R")
for(i in 1:nrow(all)){
name_heart<-all$heart_file[i]
name_ab<-all$ab_file[i]
name_brain<-all$brain_file[i]
heart_set<-heart_list[[name_heart]]
brain_set<-brain_list[[name_brain]]
a... |
d592d32fc2039d83ba46c8410eb5383118570a86797bb8650286eb51ff432022 | R | 5,275 | 168 | # JASP CODE
# 03_main_hypothesis
# Bayesian borrelation
jaspRegression::CorrelationBayesian(
data = NULL,
version = "0.17.2",
alternative = "twoSided",
bayesFactorReport = TRUE,
bayesFactorType = "BF10",
bfRobustnessPlot = FALSE,
bfRobustnessPlotAdditionalInfo = TRUE,
bfSequentialPlot = FALSE,
bfSequ... |
7c5278456f71b3c4e76680d6f8fae8b806bb80d8879d984ff9daa33d7d3f8fad | R | 5,278 | 133 |
rm(list=ls(all=TRUE))
library(REdaS)
for (ith in 1:35) {
result_raw_table <- read.table(paste("/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble/sub", ith,"_mri_record.txt", sep = ""), stringsAsFactors = FALSE)
num_trial = length(result_raw_table[,1])
result_table <- data.frame(sub = numeric(num_trial... |
7ebebdaeb9488fd17c1be8f719c4fd62e70dbf71810d34b959df8c0033395da4 | R | 5,281 | 151 | library(tidyverse)
library(ggrastr)
rootSupp <- "figures/supp/"
## correlate cell types
pseudotimePerCell <- readRDS("saved/pseudotime/pseudotimePerCellSlingshot.RDS")
pseudotimePerCell$samplesToPseudobulk <- str_replace_all(pseudotimePerCell$samplesToPseudobulk, "Organoids", "3D")
pseudotimePerCell$ranked <- rank... |
2b6ad7d0018959f54fbbff7da37b7e3bac9d78cb8b3059c54763277e826cefe5 | R | 5,282 | 144 |
################################################
## Functions to compare different MOFA models ##
################################################
#' @title Plot the correlation of factors between different models
#' @name compare_factors
#' @description Different \code{\link{MOFA}} objects are compared in terms of ... |
46cf8a2864fdaa56afa9a33e87acf6f270e4f8f82666ab66d7c258b0ad9601b5 | R | 5,282 | 142 | run_Garnett_CV <- function(DataPath, LabelsPath, CV_RDataPath, GenesPath, MarkerPath, OutputDir, Human){
"
run Garnett
Wrapper script to run Garnett 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.
Paramete... |
46ca3b9f3102186a269eb08d35aed6c252e5f72598c74ad69841dec06844cbbf | R | 5,286 | 158 | 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")
pathway.df <- c2.cp %>% dplyr::select(gs_name, human_gene_symbol)
} else if (pathway == "R... |
2699e45b7343e1f340b97a701ef543470da5811d3a43bfbcbbce4841b57cdaf1 | R | 5,288 | 150 | #'---
#' title: "OUTRIDER Summary: `r paste(snakemake@wildcards$dataset, snakemake@wildcards$annotation, sep = '--')`"
#' author: mumichae, vyepez
#' wb:
#' log:
#' - snakemake: '`sm str(tmp_dir / "AE" / "{annotation}" / "{dataset}" / "OUTRIDER_summary.Rds")`'
#' params:
#' - padjCutoff: '`sm cfg.AE.get("padjCuto... |
2c739ef40c50c3fcafe434f002fbce2fb47ffa092e1fc22ea93ee06b886344db | R | 5,292 | 110 | run_scPred<-function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){
"
run scPred
Wrapper script to run scPred 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
... |
c6fdb697b0aff65a3790594f6a6120dbda374f75da4540f074e686af208ce9d7 | R | 5,301 | 151 | #' Performs t-tests of transformed cell type proportions
#'
#' This function is called by \code{propeller} and performs t-tests between two
#' experimental groups or conditions on the transformed cell type proportions.
#'
#' In order to run this function, the user needs to run the
#' \code{getTransformedProps} function... |
b1bce5728bc9da99dedb1354c220027d7a5207a7f3f9cd0cb5e0179be7f32f45 | R | 5,319 | 122 | #' @title Get tract-based disconnection
#' @description This function computes tract-based disconnection measures using an MNI-registered lesion and the tract segmentations
#' obtained from the curated HCP-842 tractography atlas as described in Yeh et al., (2018 - NeuroImage).
#' @param cfg a pre-made cfg structure (as... |
7fbb0ea7b0f5c9e71fc2a2d03a291e4cee7eb9ffdc5dca34b7c621375ff4eb65 | R | 5,321 | 144 | # cooccur_function.R
# Functions for calculating co-occurence between mutations
#' Calculate Fisher's exact test for row-wise data
#'
#' Data order follows a two by two matrix, filled by rows or columns
#' (as these are equivalent). Not vectorized!
#'
#' @param w row 1 column 1 value
#' @param x row 2 column 1 value
#... |
5301a9fafd00682cabeec6cb0e661ab75b4da70ec9fb2fbdf207503c61670587 | R | 5,323 | 119 | # Author: Jo Lynne Rokita
# Function: Script to subtype MB tumors and all associated bs_ids from either MB RNA-Seq classifier results or methylation classifier results
suppressPackageStartupMessages({
library(tidyverse)
})
# root directory
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git"))
# set results ... |
1125d77a4be532b8022072ca715ad01a08a10f5cc0b3e200a95d387ebc566f5c | R | 5,327 | 89 | #' Function to process species-specific sequence data and generate the seqs and seqList objects
#' @description Function using path to a fasta file or seqs dataframe to generate the seqs and seqList objects needed by Regmex to evaluate motif counts and sequence-specific probabilities, and saves the objects as independe... |
9192f00d122e3af7f961ed8fabfd774764c30ad10db22637447d6b712acf97cf | R | 5,327 | 139 | # Prepocess raw Illumina Infinium HumanMethylation BeadArrays (450K, and 850k)
# intensities using minfi into usable methylation measurements (Beta and M values)
# and copy number (cn-values) for OpenPedCan.
# Eric Wafula for Pediatric OpenTargets
# 09/28/2022
# Load libraries:
suppressPackageStartupMessages(librar... |
a31ac4a3b1e3670c6bd82dc9c341e937b9deb97be5018a2efaa25cd1dea42bab | R | 5,330 | 136 | #' @title Initial Seurat Object Preprocessing and Filtering
#' @description Filters a Seurat object based on minimum/maximum counts and features.
#' Also adds cell identifiers based on spatial coordinates.
#' @param data Seurat object to be processed.
#' @param minFeature Numeric. Minimum number of features require... |
1078c07f4a0dd379db8ecef2a7a24a3ba69f8dde43c47d4d624f30b41214b744 | R | 5,336 | 159 | ########################### Generate BayCANN outputs #########################################
#
# Objective: Script to generate calibration target and decision outputs for
# BayCANN calibrated parameters
########################### <<<<<>>>>> ##############################################
rm(list = ls()) # Clea... |
e6d2e9f100b5f453a571e45b9601d11cd5c2e3570922a16e1d79392aabfb8a5e | R | 5,341 | 125 | library(ggplotify)
library(data.table)
library(ggplot2)
library(stringr)
library(dplyr)
library(circlize)
library(ComplexHeatmap)
library(cowplot)
library(simplifyEnrichment)
source("../Plot_theme.R")
set.seed(123)
# Load color scheme
colors <- fread("../Plotting/colors.csv", strip.white = F)
color_v <- colors$Color
... |
eeb11dadc1125d882989a2f7cd5219cbb6cd73ff560afcb1fa791fd948ad701e | R | 5,347 | 130 | #
setwd("/home/yhw/bioinfo/project-zyf/Release")
ProcessImage <- function(file, sample.n = 1000){
library("imager")
library("dplyr")
library("ggplot2")
# - 1. load image
file.type <- gsub(".*\\.", "", file)
file.name <- basename(file)
image <- load.image(file)
# convert image to grey
# gray_imag... |
c970605e7544ac51b9712d4f2cb039ce0e7800d6707ca60dd8cf7167af225292 | R | 5,349 | 176 | # Generating Example Reveal Data
set.seed(1234)
# sample identifiers
sample_id <- c(paste0("Sample_", LETTERS[1L:26L]),
paste0("Sample_A", LETTERS[1L:26L]),
paste0("Sample_B", LETTERS[1L:26L]),
paste0("Sample_C", LETTERS[1L:26L]),
paste0("Sample_D", LETTERS[... |
70181cfe06bd17128ad0b3fe9f534137835fe16b951e11b00a1b05dd9639b9ad | R | 5,350 | 108 | library(pROC)
data(aSAH)
numacc.response <- c(2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2)
numacc.predictor <- c(
0.960602681556147, 0.0794407386056549, 0.144842404246611,
0.931816485855784, 0.931816485855784, 0.97764041048215, 0.653549466997938699464,
0.796401132206396, 0.427720540184519, 0.81127802128... |
0ac9c17cc42aeaf7b5321d7f9bc4f8c844100fc55fac5bd0df7e5a4dc84c4892 | R | 5,353 | 143 |
#
rm(list=ls(all=TRUE))
# scaleFUN <- function(x) sprintf("%.2f", x)
bar_width=0.5
library(ggplot2)
library(ggpubr)
library(pracma)
library(fourierin)
library(seewave)
angle_list <- seq(0, 350, 10)
x_text = seq(1, length(angle_list)/2, length.out = 50)
freq_index_pool = seq(1, length(angle_list)/2, length.out = le... |
bbc5959b67a1e0520dc18aea673eb16ff30af6bc74f36a9f1c9a5551b1b9f647 | R | 5,354 | 102 | # Purpose: Generate tables of independent rna-seq specimens
# 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, "resul... |
249783cd8042c171ce237911440acff21648cfeb3a7b37a7a03f4dfa59e8673b | R | 5,358 | 131 | library(ComBatFamily)
library(data.table)
library(dplyr)
library(mgcv)
library(rjson)
library(stringr)
library(tidyr)
##################
# Set Variables
##################
args <- commandArgs(trailingOnly = TRUE)
dataset = args[1]
print(paste("Processing", dataset))
##################
# Set Directories
########... |
c5e393d747a8967db212f2382bf8cebf6c2f0b55dde948084d3311c69c689438 | R | 5,361 | 150 | # --------------------
# title: FigureS3 Code
# author: Hu Zheng
# date: 2026-01-01
# --------------------
library(Seurat)
library(tidyverse)
library(cowplot)
library(data.table)
source('bin/Palettes.R')
all.inte <- readRDS('../data/rds/all.inte.rds')
all.Adult <- readRDS('../data/rds/all.Adult.rds')
Adult.Ex <- read... |
1867e9d31c4db5f7f96c63fe9599110c8cdf57963f5a9ed52720408bc081e177 | R | 5,369 | 143 |
#
rm(list=ls(all=TRUE))
# scaleFUN <- function(x) sprintf("%.2f", x)
bar_width=0.5
library(ggplot2)
library(ggpubr)
library(pracma)
library(fourierin)
library(seewave)
angle_list <- seq(0, 350, 10)
x_text = seq(1, length(angle_list)/2, length.out = 50)
freq_index_pool = seq(1, length(angle_list)/2, length.out = le... |
2d8806888c656a92316bbfbe3b93b53b1af2386031650feb3c25e6c50106df86 | R | 5,369 | 162 | ---
title: "Annotate Fusion defining subtype status for LGAT biospecimens"
output: html_notebook
author: K S Gaonkar
date: 2020
---
As per [issue](https://github.com/AlexsLemonade/OpenPBTA-analysis/issues/790) we will be subtyping LGAT based on fusion in the following genes:
- LGG, KIAA1549-BRAF
contains KIAA1549-... |
ba5f11fae3f9a217cf2a3c3e404436ba60987e0673ddef7dcd6cbecc080f7c4d | R | 5,376 | 158 | ########################### Load Calibration Parameters ##########################
#
# Objective: Program to load general calibration parameters and perform Monte
# Carlo error analysis for sample size
#
# Note: If Monte Carlo standard error (MCSE) for prevalence or number of
# lesions calculated cross-section... |
44c629bb14e260477123f7212c173cc2bd422ef142deb749a3602245ed04cf3c | R | 5,401 | 165 | #' Project new data onto existing principal components
#'
#' @param X A numeric matrix to project onto the PCs, or a
#' character string pointing to a PLINK dataset.
#'
#' @param loadings A numeric matrix of right
#' eigenvectors (SNPs on rows, ndim dimensions on columns).
#'
#' @param orig_mean A numeric vector of t... |
c9013f1c56f448b2c628ebd6fa9ec635f8862b8353103d9a5c59b1e2935ca2da | R | 5,409 | 165 | ---
title: "Update subtypes using pathology-free-text-diagnosis"
output: html_notebook
---
The samples in the files below have molecular-subtyping results which are already part of the compile file `analyses/molecular-subtyping-pathology/results/compiled_molecular_subtypes.ts` so we will be updating the values for the... |
cc5dc7bd9e7b0ed6060a087501274c48d89e4a5525faf18132b1b87d9f92ee05 | R | 5,417 | 143 | args <- commandArgs(TRUE)
run_Garnett_CV <- function(DataPath, LabelsPath, CV_RDataPath, GenesPath, MarkerPath, OutputDir, Human){
"
run Garnett
Wrapper script to run Garnett on a benchmark dataset with 5-fold cross validation,
outputs lists of true and predicted cell labels as csv files, as well as comp... |
c1d24477971faaf49a4156989ffa4ca9722d5f72013dc20264fd900613b37a17 | R | 5,418 | 220 | ---
title: "CNV GISTIC Plots"
output:
html_notebook:
toc: true
toc_float: true
author: Candace Savonen for ALSF - CCDL
date: 2020
---
### Usage
This notebook can be run via the command line from the top directory of the
repository as follows:
```
Rscript -e "rmarkdown::render('analyses/cnv-chrom-plot/... |
13073d3c91761926219fc3b790216af9d39730cdc46e1ecd6602771b7cffcbdf | R | 5,452 | 208 | rm(list=ls())
library(plink2R)
set.seed(38792)
################################################################################
# Sparse CCA implementation in R
soft.thresh <- function(x, a)
{
sign(x) * pmax(abs(x) - a, 0)
}
norm.thresh <- function(x, a)
{
s <- sqrt(sum(x^2))
if(s > 0) {
x <- x / s
... |
08a72ca898d8c9bc89ddbd3363651f94cdedfc95a0af9b050a74232b115838b5 | R | 5,471 | 141 | # Load necessary libraries
library(ggplot2)
library(optparse)
library(RColorBrewer)
library("tidyverse")
option_list <- list(
make_option(c("-i", "--input"), type = "character", default = NULL, help = "Input CSV file path", metavar = "character"),
make_option(c("-o", "--output"), type = "character", default = NULL... |
03f63a52326dfae3decc9df491a633f4607371d6a4775411eab27c358ff6b5cd | R | 5,478 | 103 | # Purpose: Generate tables of independent rna-seq specimens
# 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, "resul... |
01553048343339489d12f82037fe11260df8764c7438889f79aa7191042fd316 | R | 5,484 | 90 | #' Function to process species-specific sequence data and generate the seqs and seqList objects
#' @description Function using path to a fasta file or seqs dataframe to generate the seqs and seqList objects needed by Regmex to evaluate motif counts and sequence-specific probabilities, and saves the objects as independe... |
d3aea58a19202503e2e65fd2b098b14b4e74fe408b67a085689486a63f2691c1 | R | 5,492 | 148 | # Functions for calculating tumor mutation burden
#
# C. Savonen for ALSF - CCDL
#
# 2019
#
################################################################################
########################### Setting Up Functions ###############################
##################################################################... |
50dbd5dcec21cc7d046d484e032694c63e807cabe87f7f77893aac77029ef1c9 | R | 5,504 | 158 | #based on:
#-https://testthat.r-lib.org/articles/test-fixtures.html
#-https://r-pkgs.org/testing-advanced.html#sec-testing-advanced-concrete-fixture
olink_wide_synthetic_data <- test_path("data",
"synthetic_dt_wide",
"synthetic_dt_wide.R")
s... |
ee8f77ab180edab48aef67ebe9336a5a9f785c94a709146c51c955f50c955555 | R | 5,515 | 140 |
setwd("/data/nas1/liuyiding_OD/project/01_project_147/12_CIBERSORT")
library(data.table)
library(IOBR)
library(tidyverse)
exp=freatidyverseexp=fread("log2TPM.txt",header=T,data.table=F)
exp=column_to_rownames(exp,"V1")
exp=as.matrix(exp)
im_cibersort <- deconvo_tme(eset = exp,
method = "cib... |
e57c6aeb1523cba1775a7798f461b6e004fbe3fb29c46038cd89ce36f8e4ae8d | R | 5,517 | 135 | library(ComBatFamily)
library(data.table)
library(dplyr)
library(mgcv)
library(rjson)
library(stringr)
library(tidyr)
##################
# Set Variables
##################
args <- commandArgs(trailingOnly = TRUE)
dataset = args[1]
print(paste("Processing", dataset))
##################
# Set Directories
########... |
41a03e0db05c2d68cddc71231bcd41901eb5c386e1420da1801ec7d49571a341 | R | 5,523 | 131 | ### Sub-clustering and analysis of just neurons ####
## This script performs sub-clustering and analysis on neurons subsetted from my seurat object to identify different neuronal populations and their responses to treatment.
# Code created by Lisa Blackmer-Raynolds
#Load required packages----
library(Seurat)
library(... |
da909a032a454484ab7369c3a6d7e1b14fec9e6374df911bc7c40b9d8edd8caf | R | 5,545 | 126 | #!/usr/bin/env Rscript
# Script to evaluate Slamdunk count results
#
# 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 ... |
8f969bbe1a437c72ea72d661fadf498b67bfdb8b4a22a1e68168099bd42bc77b | R | 5,547 | 135 | library(ComBatFamily)
library(data.table)
library(dplyr)
library(mgcv)
library(rjson)
library(stringr)
library(tidyr)
##################
# Set Variables
##################
args <- commandArgs(trailingOnly = TRUE)
dataset = args[1]
print(paste("Processing", dataset))
##################
# Set Directories
########... |
86e045603ae1160b261f1e1f294e643a40c1aacdaeb8af7cdc42a9e11ff476f2 | R | 5,548 | 147 | library(data.table);library(dplyr)
library(mvnfast,lib='~/isilon/Cheng-Noah/Rpkgs')
population='EUR'
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# functions
find_n=function(h2,M,R,target=0.5,alpha=0.05/18160) {
m=nrow(R) # number of tested SNPs
ix=round(m/2) # index of causal SN... |
e72c8eaae2f692b491157779ec0176a914cac08777480b2c6196c65cf0fa3062 | R | 5,553 | 165 | # olink_platforms.R ----
olink_platforms_file <- system.file("data-raw",
"olink_platforms.R",
package = "OlinkAnalyze",
mustWork = TRUE)
source(olink_platforms_file)
rm(olink_platforms_file)
# olink_wide_top_ma... |
fc6c777ca411eeb334a112f8b524532d80d7f384396f5419373ab1db6e0c4d26 | R | 5,554 | 202 | # read out current directory and set parent directory of "R scripts" folder(scr_dir) as
# main working directory; warn if R Scripts is not current working directory
getwd()
basename(getwd())
if (basename(getwd()) == "00_scripts"){
scr_dir = getwd()
setwd("./..")
main_dir = getwd()
} else {readline("Check current... |
97f501587e6f660e199b1293f020b1d417df53916f4a857f20e3bebafdd14dd5 | R | 5,556 | 131 | # Calculate probe-level methylation values quantiles for all histologies (cancer types)
# Eric Wafula for Pediatric OpenTargets
# 10/18/2022
# Load libraries
suppressPackageStartupMessages(library(optparse))
suppressPackageStartupMessages(library(data.table))
suppressPackageStartupMessages(library(tidyverse))
# Magr... |
0cfbdc3496458f64011894bdff061dac21156cf5f7ed88c609cf182253f9e2a3 | R | 5,566 | 152 |
################################################
## Functions to compare different MOFA models ##
################################################
#' @title Plot the correlation of factors between different models
#' @name compare_factors
#' @description Different \code{\link{MOFA}} objects are compared in terms of ... |
b06cd667ac29af695e33a7a82b8fdc1e879aa5c7d6c1dc7d567dfa2c4035562b | R | 5,566 | 153 | # pROC: Tools Receiver operating characteristic (ROC curves) with
# (partial) area under the curve, confidence intervals and comparison.
# Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck,
# Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez,
# Markus Müller
#
# This program is free softwar... |
1cdae2d4fb6400ab935d90d48943f007a744f5c2d63b7bb17383363060523241 | R | 5,574 | 204 | # Test check_is_list ----
test_that(
"check is list works - TRUE",
{
expect_true(
object = check_is_list(x = list("I_Shall_Pass"),
error = FALSE)
)
expect_true(
object = check_is_list(x = list("I_Shall_Pass"),
error = TRUE)
)
... |
45111f02291987ddefdbc93e2d6038a932189fc636d34bf9fdc9990b5f1d25fa | R | 5,581 | 124 | # independent-dna-samples.R
#' Generate a vector of unique samples
#'
#' The samples from this function will be unique with respect to participants
#' i.e. only no two samples will come from the same participant. The input list
#' should be pre-filtered by `experimental_strategy` and `sample_type`.
#'
#'
#' @par... |
2208fd899086874b3d6179f8f97976bc11a90dd7672278374329bc13e712f5e9 | R | 5,586 | 205 |
#' getZhouManifest
#'
#' @param plateform Type of plateform
#' @return A data.frame manifest
#' @importFrom readr read_tsv
get_zhou_manifest <- function(plateform) {
manifest <- NULL
zhou_lab_url <-
"https://github.com/zhou-lab/InfiniumAnnotationV1/raw/main/Anno/"
switch(plateform,
"IlluminaHumanMethy... |
d615a2a558887bc6b4d6115108eda46a4aa3fe031d912a7003d61f368eeec05d | R | 5,592 | 139 | context("Manuscript Figure Reproduction")
# ==============================================================================
# Helper Function: Locate Benchmark Directory
# ==============================================================================
# This function attempts to locate the 'benchmarks' directory contain... |
e849e2bd204b0397e5d5f30540ec93a1bf8049a68a8b3dc31d4f0fd66d306478 | R | 5,593 | 146 | #' Create a shinycell config data.table
#'
#' Create a shinycell config data.table containing (i) the single-cell
#' metadata to display on the Shiny app, (ii) ordering of factors /
#' categories of categorical metadata and (iii) colour palettes associated
#' with each metadata.
#'
#' @param obj input single-cell ob... |
8d8630e68aa950c9ce1b8f1649edd68d7c664e83b7ba85c0fe9a791ec0ba4179 | R | 5,603 | 221 | # readme ----
# This script uses the raw data files:
# 1. inst/extdata/npx_data2_meta.csv
# 2. inst/extdata/npx_data2.xlsx
# to generate the sample dataset data/npx_data2.rda which is used throughout
# OlinkAnalyze.
#
# As this script did not exist prior to 2024-04-08, we have stored the original
# npx_data2.rds file ... |
7eb6d1274ee6bdcf22e343b9251c429b902d95907ffecef496c21fc3959702e8 | R | 5,612 | 182 |
rm(list = ls())
install.packages("corrplot")
install.packages("igraph")
install.packages("qgraph")
install.packages("car")
install.packages("compute.es")
install.packages("effects")
install.packages("compute.es")
install.packages("ggplot2")
install.packages("multcomp")
install.packages("pastecs")
# install.packages("... |
8887ec780c12353d2881e668704406e751fa536e52a7c7d21af87aeaabfbddcf | R | 5,615 | 177 | # Generating Example Explore 3072 Data
set.seed(1234)
# sample identifiers
sample_id <- c(paste0("Sample_", LETTERS[1L:26L]),
paste0("Sample_A", LETTERS[1L:26L]),
paste0("Sample_B", LETTERS[1L:26L]),
paste0("Sample_C", LETTERS[1L:26L]),
paste0("Sample_D", LE... |
c69fdd1784284cc2808188daf5e1d79b1f9144a3febdf8565861c47c774d1a81 | R | 5,616 | 187 | ---
title: "StringDB for MSLc Primed genes"
output: html_document
date: "2025-04-16"
---
```{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"), showWarnings = FALSE)
file_save_... |
ce6793ad3f353bc6695a21194a3e50fe079b1ee62869e1a709baa4ae085beb98 | R | 5,618 | 180 | # Generating Example HT Data
set.seed(1234)
# sample identifiers
sample_id <- c(paste0("Sample_", LETTERS[1L:26L]),
paste0("Sample_A", LETTERS[1L:26L]),
paste0("Sample_B", LETTERS[1L:26L]),
paste0("Sample_C", LETTERS[1L:26L]),
paste0("Sample_D", LETTERS[1L:2... |
68194d290b8a2e884243d6619b8ad06b2cbba22606b2fcf4d293dd77168cd522 | R | 5,620 | 106 | setwd("/media/user/disk21/completeAnalysis/visium_2Jun/Figure4/")
df = read.csv("AUC.csv")
df$major = factor(df$major, levels = c('Neurons', 'Astrocyte', "Oligodendrocyte", 'Neoplastic', 'Microglia', 'Myeloid',
'Lymphoid', 'Fibroblast', 'Pericyte', 'Endothelial'))
library(resha... |
34774d6704618beb4a96b78e2eb42e8999c8cf6227e07a2117a205f40d0ab39a | R | 5,635 | 164 | ########################### Generate BayCANN Sample ##########################
#
# Objective: Program to simulate parameter inputs and model outputs for
# BayCANN model calibration
########################### <<<<<>>>>> #########################################
rm(list = ls()) # Clean environment
options(scipen =... |
c3d61215befece7ce29efd2a276be13e699fc4302dd1c9cd794b14e15297071d | R | 5,637 | 163 | # Functions for calling CN statuses of genome bins
#
# C. Savonen for ALSF - CCDL
#
# 2020
bp_per_bin <- function(bin_ranges, status_ranges) {
# Given a binned genome ranges object and another GenomicRanges object,
# Return the number of bp covered per bin.
#
# Args:
# bin_ranges: A binned GenomicRanges ma... |
3821bf5f85150fee811b1402c68364d190815d64d826058c68b64f109f4398f7 | R | 5,649 | 187 |
##-------------------------------------##
## DEA TAB ##
##-------------------------------------##
tab_DEA<- tabItem(
tabName = "Gene Ranking",
textOutput(outputId = "session_id"),
sidebarLayout(
sidebarPanel(width = 3,
h3("Differential Expression Analysis"),
... |
c98b097361677c699ad80b06a7c8131b7e62e4c1458596d48ec7663a05badd73 | R | 5,655 | 157 | test_that("learning-to-rank with lgb.train() works as expected", {
set.seed(708L)
data(agaricus.train, package = "lightgbm")
# just keep a few features,to generate an model with imperfect fit
train <- agaricus.train
train_data <- train$data[1L:6000L, 1L:20L]
dtrain <- lgb.Dataset(
train_... |
baa0d56bcd0970344726cafd1059d60fc33106a144be497249a654588678d0af | R | 5,666 | 169 | # This script subsets the focal copy number, RNA expression, tumor mutation
# burden and histologies` files to include only ATRT samples.
# 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:
#
# Rscript 'analyses/m... |
e5661ebfedf3d3e731fce51cd2001bd2a9306c56a874a30e87f407e6765e10a3 | R | 5,669 | 155 | # ──────────────────────────────────────────────────────────────
# Stats - decoding concreteness in early and late time windows
# in privative and subsective phrases
# Author: Ryan Law
# ──────────────────────────────────────────────────────────────
# ---- Setup ----
# Load required libraries
library(lme4)
library(lm... |
d06f094221713a67d61b6a14a019e4c32de8b10919b4520ddec797ddfbdc73aa | R | 5,674 | 167 | # Analysis a) to see whether an increased predicted age deviation (PAD) at baseline can differentiate
# between the clinical groups: Cognitive Normal (CN), Mild Cognitive Impaired (MCI), and Alzheimer's Disease (AD).
# This script runs an independent sample-t-test (or ANCOVA with covariates) to test for significant dif... |
e4225153b9825689c1bdd6436ef367746c92c8b185900434c05269ecdcffbc21 | R | 5,674 | 175 | #!/usr/bin/env Rscript
#'
#' Sample–sample correlation analysis using RSEM TPM expression
#'
#' This script computes and visualizes sample–sample correlations from
#' gene-level TPM expression values produced by RSEM. Expression values
#' are log2-transformed, filtered to retain expressed genes, and used to
#' calculat... |
7970937fe1b526dbb57aa6ba7a8be0250534564ba7d62c2379d37cb21ffcebf5 | R | 5,677 | 114 | ---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
# [
library(SingleCellExperiment)
library(SpatialExperiment)
data(rings)
# Order cells by group so the per-group reference keeps the same column order
spe <- rings[, order(rings$cluster)]
npcs <- 10L
lambda <- 0.2
k_geom <- 15L
# Groups are a quarter of the object, s... |
d62547df011dfe4ca35bd71e9339755d5f03929eb2c208ab5fe84d4c9ceb19af | R | 5,684 | 142 | ---
title: "Add ploidy column, status to CNVkit output"
output: html_notebook
author: J. Taroni for ALSF CCDL
date: 2019
---
The `histologies.tsv` file contains a `tumor_ploidy` column, which is tumor ploidy as inferred by ControlFreeC.
The copy number information should be interpreted in the light of this information... |
cf7cb0f38bba40b3c8564be5fdda93467e3e08b090667081559fbee781e2630b | R | 5,687 | 126 | #----Ext_11C.R------------------------------------------------------------------
#-------------------------------------------------------------------------------
# This is code to graph the in-silico activation of SELKs produced by
# ______.ipynb to generate Extended data figure 11 in Savas et al. 2025
#
# Datasets we... |
1c77db111a13edb9dd3398080ca66b26f4333fb45d748ad3b4ebf9f2456f850a | R | 5,690 | 211 | # read out current directory and set parent directory of "R scripts" folder(scr_dir) as
# main working directory; warn if R Scripts is not current working directory
getwd()
basename(getwd())
if (basename(getwd()) == "00_scripts"){
scr_dir = getwd()
setwd("./..")
main_dir = getwd()
} else {readline("Check current... |
38bd16e055cf77478a329e667f6d0a365e25619b4f74914ec410267ecf6a0781 | R | 5,690 | 145 | #' @title Create a shinycell config data.table
#'
#' @description Create a shinycell config data.table containing (i) the single-cell
#' metadata to display on the Shiny app, (ii) ordering of factors /
#' categories of categorical metadata and (iii) colour palettes associated
#' with each metadata.
#' @param obj inp... |
a90db4e9b892ccd3638e0fbbedbbd5175642729f1e550a2e68986cbcca915b38 | R | 5,694 | 143 | # pROC: Tools Receiver operating characteristic (ROC curves) with
# (partial) area under the curve, confidence intervals and comparison.
# Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck,
# Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez
# and Markus Müller
#
# This program is free soft... |
2df72f00e3eb60b30480644d250d3ca21d39fb29338b8b4eee90dd2c0468bc09 | R | 5,695 | 144 | # pROC: Tools Receiver operating characteristic (ROC curves) with
# (partial) area under the curve, confidence intervals and comparison.
# Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck,
# Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez
# and Markus Müller
#
# This program is free soft... |
c35941cb26cd1cfb4558013e6770cb11f24b23b2b213ae0e4d6d66cc3f009d88 | R | 5,699 | 167 | test_that(".params2str() works as expected for empty lists", {
out_str <- .params2str(
params = list()
)
expect_identical(class(out_str), "character")
expect_equal(out_str, "")
})
test_that(".params2str() works as expected for a key in params with multiple different-length elements", {
metr... |
6c673d6166da11fb03c531184c98b36d704ded3486f0d036516f4e8021e22220 | R | 5,700 | 184 | ---
title: "Heatmap_GO_terms_across_seeding_densities"
author: "AF"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, message=FALSE, warning=FALSE}
knitr::opts_chunk$set(echo = TRUE)
suppressPackageStartupMessages({
library(circlize)
library(ComplexHeatmap)
library(rstudioapi)
library(dplyr)
l... |
26efc4f070a8a95cca874deee6f31b64bb8ef62ca6ce0bd6b188b930270b8c91 | R | 5,706 | 130 | library(pROC)
data(aSAH)
context("are.paired")
test_that("are.paired works", {
# most basic example
expect_true(are.paired(r.wfns, r.ndka))
# Missing values shouldn't screw up
aSAH.missing <- aSAH
aSAH.missing$wfns[1:20] <- NA
expect_true(are.paired(roc(aSAH.missing$outcome, aSAH.missing$wfns), roc(aSAH.... |
f36e749d4e6cd6ea774f0f4842170ffa73aa650a496c2fdd53087f16a3c4578b | R | 5,712 | 150 | # This script converts merges consensus seg files with cnvkit WXS and freec tumor only annotated files
# for both autosomes and x_and_y. The autosomes and x_and_y files are then merged
# to generate one single file
# #### Example Usage
#
# This script is intended to be run via the command line.
# This example assumes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.