sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
f935febabbc3755e487d295cbd3f6ddc244b2d3fd1f691997ff95515fcc7420e | R | 5,719 | 168 | # Scripts to create symbol and ensembl_id gene lists for exAM
# Symbol list is from: SI Table 22 from Marsh et al., 2022 \doi{10.1038/s41593-022-01022-8}.
# Gene List & Symbol Updates ------------------------------------------------------------------
# Changed Hist2h2aa4 to H2ac19 as new symbol was not updating for... |
7901d92e6096296d694c7b224243a0edeb51413b5e1d1fa3bd6187023b117c38 | R | 5,731 | 187 | ############################################################
## Main Figure 2
############################################################
## Load helper functions
source("path/to/function_definition.R")
## Packages
library(tidyr)
library(ggrepel)
library(writexl)
library(foreach)
library(doParallel)
library(cowplot... |
fca834c37c60709bbc8e846912417397c268342c283bfe01dbb70526366f9266 | R | 5,733 | 133 | # K. S. Gaonkar 2019
# Standardizes fusion calls from callers [STARfusion| Arriba]. The output will
# have the following columns
# "Sample" Unique SampleIDs used in your RNAseq dataset
# "LeftBreakpoint" Genomic location of breakpoint on the left
# "RightBreakpoint" Genomic location of breakpoint on the right
# "Fusio... |
9655df9820310f9279a0fe95d203d9b4ed8e1673ea21a8e7665280f2fcb23acf | R | 5,735 | 102 |
##########################################################
## 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... |
285f1a20fa6e96720ac970025c4cef44cf7c096e9d104437fa992f5e4ed70d16 | R | 5,737 | 192 | ############################
## iTReX runner functions ##
## Author: Yannick Berker ##
############################
# Consider distributing these into the .R files where they are used
#' @import shiny
#' @importFrom dplyr %>% do filter group_by mutate rename_with summarize ungroup
# https://ggplot2.tidyverse.org/artic... |
0e42f746aefc9cd8f37b28bcb31ff813751bbacfcac40086523317bfaa50234a | R | 5,747 | 135 | #!/usr/bin/env RScript
library(DESeq2)
library(limma) #removeBatchEffect
library(ggplot2)
library(optparse)
# Getting options from command line
option_list = list(
make_option(c("-e", "--expMatrix"), type="character", default=NULL,
help="expression matrix file path", metavar="character"),
make_option... |
40d00adf234ed415787903ec863c703d2d2b533e091b9eb01ace99fdaddebc08 | R | 5,747 | 130 | # Code to generate Figure 1 of the Jokura et al 2024 Ctenophore apical organ connectome paper
# source packages and functions ------------------------------------------------
source("analysis/scripts/packages_and_functions.R")
# load cells -------------------------------------------------------------------
balancer ... |
59aaae2267ea169cdfb5a27cad816d3c23843d9b64a4fd24bb38829bcee16045 | R | 5,756 | 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... |
23f1fd7e1ba9db56336404bbedf982ff7448882fe02c765d289e494bc589f904 | R | 5,761 | 181 | ########################### Run IMABC ##########################
#
# Objective: Program to run IMABC based on vignette at
# https://github.com/c-rutter/imabc
# See here for documentation: https://github.com/c-rutter/imabc/tree/a58a3b7c8db18948ff87fb6be55c6175399f41a2
########################### <<<<<>>>>> #######... |
287097a8c965be2e32f393685e623e95dc1f2634350e2672cdd8287895ba4cc4 | R | 5,762 | 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... |
f2e1549d9fd7748f973e0555a6611d72642f52e1bed5b6c00332d02e27be5b6a | R | 5,762 | 163 | library(ggplot2)
library(ggrepel)
library(ggnewscale)
library(patchwork)
library(scales)
library(dplyr)
library(tidyr)
library(forcats)
library(stringr)
library(tibble)
library(readr)
library(purrr)
library(broom)
library(broom.mixed)
library(lme4)
library(ineq)
library(pheatmap)
library(RColorBrewer)
library(Matrix)
l... |
50877310bdd886f68b523dabb8a9679ef309ea36d1fb3be2bc15e865a25de5df | R | 5,765 | 150 | #!/usr/bin/env Rscript
# Command line argument processing
args = commandArgs(trailingOnly=TRUE)
if (length(args) < 5) {
stop("Usage: dupRadar.r <input.bam> <annotation.gtf> <strandDirection:0=unstranded/1=forward/2=reverse> <paired/single> <nbThreads> <R-package-location (optional)>", call.=FALSE)
}
input_bam <- a... |
7aad53ca5b99fc8256ae0b050e1dbd3242545fc272a48a6b3f71f25e34a6f3fd | R | 5,767 | 150 | splicetype="SE" #type of alternative splicing, e.g., SE, A3SS, A5SS, MXE, IR
counttype="JCEC" #JCEC (junction count + exon body count) or JC (junction count only)
##################
#Input parameters#
##################
# inputpath="./02_PSI_value_quantification/01_Get_PSI_from_rMATS_output/example_input" ... |
c525c2feaf30825cb540f72a68f9aa9d4bcb04f5e6c67ebd4ee0e8aeacf8ad07 | R | 5,776 | 143 | ---
title: "tICA_Clustering"
author: "AZ"
date: "`r Sys.Date()`"
output: html_document
---
This script performs hierarchical clustering of temporal independent components (tICA) extracted from movie-driven fMRI data in marmosets and humans. The aim is to identify functionally related networks within each species by gr... |
42a63dbd91c811eb12cb3cbf5b629f9eba2f133f7329295d7df7b4628f1a94fe | R | 5,777 | 180 | # 4. Pathological Stages
# Generates visualizations and analyzes associations between pathological staging and genetic variants
# Project: Clinical features, genetics, and pathology in a large series of movement disorder cases: a retrospective multi-ancestry brain bank cohort study
# Last updated in October 2025
####... |
c81a644ea39c4bb403aadf5b5d29e08a81fa318e915293ca531eba5fe30a3c01 | R | 5,779 | 194 | ---
title: "Task_Names"
author: "HannahSavage"
date: "2022-12-16"
output: html_document
---
## SET ENV
```{r setup, include=FALSE}
library(readxl)
library(dplyr)
library(tidyverse)
library(ggplot2)
library(reshape)
library(scales)
library(sjmisc)
library(scatterpie)
library(showtext)
library(psych)
library(tidyr)
libr... |
d647c77c8f7b8188a5066cf39c35c50af9be79d7d4e962327b4e32e35e55ae7c | R | 5,794 | 131 | ##' @importFrom ggplot2 ggplot
##' @importFrom ggplot2 aes
##' @importFrom ggplot2 geom_bar
##' @importFrom ggplot2 element_text
##' @importFrom ggplot2 geom_text
##' @importFrom ggplot2 theme
##' @importFrom ggplot2 scale_fill_gradient
##' @importFrom ggplot2 xlab
##' @importFrom ggplot2 ylab
##' @importFrom ggplot2 y... |
a079ecfc405227f7ea649c53fedcbde0267f7732f74d8558e3a336e9e53b5691 | R | 5,795 | 173 | # --------------------
# title: FigureS12 Code
# author: Hu Zheng
# date: 2026-01-01
# --------------------
library(Seurat)
library(tidyverse)
library(hdWGCNA)
library(cowplot)
library(patchwork)
library(enrichR)
library(GeneOverlap)
library(ggpointdensity)
library(Biorplot)
source('bin/Palettes.R')
source('bin/inclu... |
8abb062b805325463502efe489d1336f133450c5ae9aeb24a4f85dfa67c81b26 | R | 5,805 | 160 | rm(list=ls(all=TRUE))
library(data.table);library(dplyr);library(ggplot2);library(magrittr);library(tidyr)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
setwd('/mnt/isilon/w_gmi/chengflab/Cheng-Noah/manuscripts/druggable_genes/MAGMA_simulations')
magma_df=fread('output/type1_error/mag... |
5dba47831e051046559b01895b7648985f5e327d60f16a98c4fa6ea6a4efba7c | R | 5,806 | 163 | # script to check if synapse morphology looks different in the big ANN vs small
# generates a series of two panel images, where the left panel is from ANNQ1Q2Q3Q4
# and the left panel is ANNQ1Q2 or Q3Q4
source("analysis/scripts/packages_and_functions.R")
skid_Q1234 <- 2496955
skid_Q12 <- 2436172
skid_Q34 <- 2436531
... |
ed284a73bdf92bb517098bceaa661fc8511bb4f1155a856a806b9c95b2b91828 | R | 5,815 | 223 | # readme ----
# This script uses the raw data files:
# 1. inst/extdata/npx_data1_meta_original.csv
# 2. inst/extdata/npx_data1_original.xlsx
# to generate the sample dataset data/npx_data1.rda which is used throughout
# OlinkAnalyze.
#
# As this script did not exist prior to 2024-04-08, we have stored the original
# n... |
72372143ff8bcf78062d87dc35c0a2aea75719b0597894e62cb81be88a33a0e3 | R | 5,826 | 128 |
##-------------------------------------##
## Pseudobulk TAB ##
##-------------------------------------##
tab_PSEUDO <- tabItem(
tabName = "Pseudobulk",
textOutput(outputId = "session_id"),
sidebarLayout(
sidebarPanel(width = 4,
h3("Convert to pseud... |
f4785fcc4e593ca105edbeea6fe2ac12f83d7e5858bc00cd4cde3c83f8850431 | R | 5,833 | 127 | #' Impute zeroes and perform a centered log-ratio (CLR) transformation
#' @description Microbiome data is compositional. When compositional data is examined using non-compositional methods, many problems arise.
#' Performing a centered log-ratio transformation is a reasonable way to address these problems reasonably we... |
4f0d6b844643ee8530e38df3fc4c94809fe0e7b8df1e0bde2591ab628bc2013b | R | 5,843 | 165 | ---
title: "Biodiscvr: Synthetic Data Case Demo"
date: "`r Sys.Date()`"
toc-title: "Overview"
output:
rmarkdown::html_vignette:
toc: true
number_sections: true
vignette: >
%\VignetteIndexEntry{Biodiscvr: Synthetic Data Case Demo}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r ... |
78483afb4dc9c43695b3b23f7426240b61d2bbf03a2c419183f2d0f3d4ba0dca | R | 5,845 | 171 | data(agaricus.train, package = "lightgbm")
data(agaricus.test, package = "lightgbm")
train <- agaricus.train
test <- agaricus.test
test_that("Feature penalties work properly", {
# Fit a series of models with varying penalty on most important variable
var_name <- "odor=none"
var_index <- which(train$data@Dimnames... |
a9b53de814c5e64ec771fccc79a42b05c218a12a5589ad90e1b316cb4b1ff678 | R | 5,849 | 229 | #' @export randomized_ddd_fixed_age_cap
randomized_ddd_fixed_age_cap <- function(dists, cap, age, model) {
params <- generate_params(dists)
result <- dd_sim(c(unlist(params), cap), age = age, ddmodel = model)
return(result)
}
#' @export randomized_ddd_fixed_la_mu_age
randomized_ddd_fixed_la_mu_age <- function(... |
83eaf49a0cffd536d02d1f30a13173a7b58714d833c8823c50f3717ae47230fa | R | 5,857 | 131 | #!/usr/bin/env Rscript
# combinefile <- commandArgs(trailingOnly = TRUE)
# # print(c("combinefile: ", combinefile))
# print(combinefile)
###### EANMDflagcount_reverse.R v1.04
##### Written by Kaining Hu 2022-08-23
library(getopt)
spec <- matrix(
c("Output", "o", 1, "character", "Output prefix",
#"Rank", "r", 1... |
86d665ceb9cce009fb30008be506b8b8569b0c06e3a0ed91968c598a0dde14d0 | R | 5,865 | 153 | #' Load Datasets from a Structured Directory
#'
#' Scans a root directory for subdirectories, each representing a dataset.
#' Within each dataset subdirectory, it attempts to load specific CSV files
#' ('data.csv' and 'data_suv_bi.csv').
#'
#' @param root_path Character string. The path to the main directory containing... |
0552ca5fb424702330c7c99dd3126b43d56499fd43f4468cfa3d9c2ac31197ed | R | 5,875 | 208 | # 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... |
0d6a2ab9aea006d4e6cd0da53506652b16562721b3933d6c98f85fdcf14bc8d3 | R | 5,877 | 135 | # Import libraries
# Make sure to install.packages("X") first
library(eegUtils)
library(readxl)
library(reshape2)
library(readxl)
library(openxlsx)
library(zoo)
library(eegkit)
# Names of the 4 time events in the input data
# Note the input data from Emotiv has been exported to Excel. Recordings made using EmotivPRO c... |
996211bad71d1fe7119e92407d8c3d6dd4056ddc0cfdecb9282a4eaf0be38d78 | R | 5,879 | 135 | ---
title: "Supplemental Information"
subtitle: "A midbrain basis for emotion: Representations of naturalistic looming threat in the human superior colliculus"
output:
word_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE)
require(targets)
require(tidyverse)
requ... |
dd13d5ba4d69591d1a4564b910a19a72a4f0f27452aa601e66f96a51d2e9dd1f | R | 5,880 | 186 | ################################# Fig.1k
p_clusters <- DimPlot(
reduced_all, reduction = "umap", group.by = "seurat_clusters",
label = TRUE, repel = TRUE, label.size = 3
) +
theme_bw(base_size = 11) +
theme(panel.grid = element_blank())
ggsave(
filename = file.path(out_dir, "UMAP_clusters.svg"),
plot = p_c... |
a30bd9225174b9f3f811f64319ef2901de430fc861a29e74ef7d6896a7c077d9 | R | 5,881 | 111 | # ==============================================================================
# U10_visualization.R
# UI definition for the "Single Molecule Spatial Imaging" tab (Step 6 Part 1).
#
# Purpose:
# Provides the interface for exploring the spatial distribution of individual molecules (Genes or Metabolites).
# A... |
42e6bb34eb04a6055aeeaefdaa8b6adc4ee2262dc649079687c26e309549a96b | R | 5,882 | 151 | # Description: Generates a Reactome-style schematic for insulin signaling genes,
# showing significance and direction of regulation across OSNs and Fatbody.
# Load libraries
library(DiagrammeR)
library(DiagrammeRsvg)
library(rsvg)
library(readr)
library(pdftools)
# ---- Load and prepare input ----
core <- read_csv(".... |
77f6b08fbed2d003049cf95080c9c65421f72e3d216d05dc000086572ac22e9c | R | 5,884 | 186 | ################################# ED. Fig.1l
p_clusters <- DimPlot(
reduced_all, reduction = "umap", group.by = "seurat_clusters",
label = TRUE, repel = TRUE, label.size = 3
) +
theme_bw(base_size = 11) +
theme(panel.grid = element_blank())
ggsave(
filename = file.path(out_dir, "UMAP_clusters.svg"),
plot =... |
f7d1963e789abd864e9da80bf48a7d7c7c469e9f028720fef1eee2a4b41f5726 | R | 5,886 | 157 | ######################################################################
#
# This script is used to visulize the results in Figure 5
#
#
# Liang Qunjun 2023-12-09
library(tidyverse)
library(bruceR)
library(ggstatsplot)
library(ggridges)
library(psych)
library(RColorBrewer)
library(emmeans)
library(ggeasy)
... |
9663b56a6278e961255abfbb18798fb44cd2b5631ac24788c673c6db13e75e61 | R | 5,911 | 182 | # bed_to_segfile.R
#
# Josh Shapiro for CCDL 2020
#
# Purpose: Convert the bed file output from the CNV consensus workflow to a seg file
#
# Option descriptions
# -i, --cnv_file : path to the cnv consensus file
# -o, --output_file : path for output file
# --segmean-method : method for combining seg.mean values. Defau... |
770663b26c510527696c3137d9a07eced30b18443eba9c5a450166dea7d7910d | R | 5,912 | 176 | ###############################################
# Filter DE genes by raw p-value and fold change
# Criteria:
# pvalue < 0.05
# |fold change| >= 1.5 (i.e., |log2FC| >= log2(1.5))
# Inputs:
# DE_all_outputs_subsetNorm_allpairs/Tables/LR_by_comparison/*.tsv
# DE_all_outputs_subsetNorm_allpairs/Tables/WH_by_compar... |
c5c27f69f5e19f8b9f267e8d5efc1ed94da602118d99317c69b3ec69762dd442 | R | 5,913 | 142 | options(Seurat.object.assay.version = "v3") # use old Seurat object version
library(Seurat)
library(ggplot2)
library(reticulate)
setwd("/home/ubuntu/PDSCRBNG/03_04_24_Figure_3")
source("~/PD_project_analysis/manuscript_scripts/MV_utils.R")
color_palette_cluster_DaN <- c("SOX6+/CALB1- Mature" = "#006400",
... |
99cc1bafff704f20f928535ff67d3c3ddea1bab034b183702f3ec83a4b9b3a25 | R | 5,915 | 181 | # bed_to_segfile.R
#
# Josh Shapiro for CCDL 2020
#
# Purpose: Convert the bed file output from the CNV consensus workflow to a seg file
#
# Option descriptions
# -i, --cnv_file : path to the cnv consensus file
# -o, --output_file : path for output file
# --segmean-method : method for combining seg.mean values. Defau... |
0bf09971a09e6de5c0714b199c43673243997bcc24555214d22bcf04ec9969f7 | R | 5,916 | 132 | #'---
#' title: Results of FRASER analysis
#' author: Christian Mertes
#' wb:
#' log:
#' - snakemake: '`sm str(tmp_dir / "AS" / "{dataset}--{annotation}" / "08_results.Rds")`'
#' params:
#' - workingDir: '`sm cfg.getProcessedResultsDir() + "/aberrant_splicing/datasets/"`'
#' - padjCutoff: '`sm cfg.AS.get("padj... |
87a0c3539adf891bc402db1074c84a74a18c1e6a6094cf12cc1dacc0be0be0f8 | R | 5,920 | 169 | ---
title: "2024_02_main_hypothesis_non_monotonic"
output: html_document
date: "2024-02-05"
author: A.Klimesch
references: Datacamp course "Generalized Linear Models in R"; OpenAI. (2023). ChatGPT (February 2024 version) [Large language model]. https://chat.openai.com/chat
---
```{r setup, include=FALSE}
knitr::opts_c... |
575d18c3e79321394dab6cb7b98b4776bc5ebeed7e6d4305397c932fbc3b29eb | R | 5,927 | 219 | #' Check presence of columns in dataset.
#'
#' @description
#' Check if the input dataset (tibble or ArrowObject) \var{df} contains columns
#' specified in \var{col_list}. \var{col_list} supports both exact matches of
#' column names and alternative column names. In the latter case, alternative
#' column names are elem... |
894d490ddd52d0c47085784059ac302602cc137965367863a2e9c9b6c432e32f | R | 5,936 | 176 | #' @title Process Spatial Coordinates and Features
#' @description Merges feature expression data with spatial coordinates.
#' Optionally rescales expression values to [0,1] for visualization.
#' @param combined_matrix Feature expression matrix (features x samples).
#' @param meta.data Data frame containing 'x' and... |
5af2a77627391c27667e4b3788755504fc8ccc828c9df5870b09577e200157fc | R | 5,944 | 272 | ```{r}
library(Seurat)
library(data.table)
library(MungeSumstats)
Raw_data <- Read10X(data.dir = '/path/to/matrix')
rownames(Raw_data) <- gsub("ensg", "ENSG", rownames(Raw_data))
metadata = fread('/path/to/metadata.csv')
l1 <- metadata$anatomical_division_label #Desired features for annotation level
l2 <- metadata$bra... |
b453bbfb391767e6a0459c033e2da1566eadd0df43cd51a704bb075b6ebb7236 | R | 5,947 | 199 | # function to get the format specifications for wide files
get_format_spec <- function(data_type) {
format_spec <- olink_wide_spec |>
dplyr::filter(.data[["data_type"]] == .env[["data_type"]])
return(format_spec)
}
# Compute num of rows of output df
olink_wide2long_rows <- function(n_panels,
... |
709c0624ad4c0ef851e67edfe270e09164730ffa36afa1d07ff5561fb1eb22ee | R | 5,953 | 146 | ##-------------------------------------##
## UMAP TAB ##
##-------------------------------------##
tab_UMAP <- tabItem(
tabName = "UMAP",
sidebarLayout(
sidebarPanel(width = 3,
radioButtons( inputId = "genesvspcs_umap",
label = "Us... |
2e0cf6c56b45d6db93eaa64fb6523cf40d4c600f1deede56c6f94be07b2f92eb | R | 5,955 | 187 |
##-------------------------------------##
## GSEA TAB ##
##-------------------------------------##
tab_GSEA <- tabItem(
tabName = "GSEA",
sidebarLayout(
sidebarPanel(width = 2,
h4("Gene Set Enrichment Analysis"),
... |
9962ed59732b916e81f7806a7129f60a2a90f51d3020effdf3d02ad47fc06836 | R | 5,957 | 128 | # mofa_visualization.R
library(MOFA2)
library(ggplot2)
library(ggpubr)
library(ggrepel)
# === Load the trained MOFA model ===
MOFAobject <- load_model("../model/MOFA_model.hdf5")
# === 1. Data Overview ===
plot_data_overview(MOFAobject) + theme(text = element_text(size = 14))
# === 2. Variance Explained ===
## 2A.... |
4f231c592522ca9ee95b6ad20c6b3b31bda3ac7596e855e3de962bae0f5dabef | R | 5,966 | 109 | ################################################################################
# pTDT (polygenic Transmission Disequilibrium Test) Analysis
# Calculate pTDT deviation and test significance with ANCOVA adjustment
################################################################################
library(tidyverse)
libra... |
1747a6ad92aed69d506a60834a51ee5b2231f2cb0160840806a855d8508aec03 | R | 5,967 | 131 |
# Comparative GO Term Enrichment Chord Diagram for OSNs and Fatbody
# Load required libraries
library(tidyverse)
library(circlize
# Load and combine data
osns <- read_csv("data/GO_O.csv") %>% mutate(Tissue = "OSNs")
fatbody <- read_csv("data/GO.csv") %>% mutate(Tissue = "Fatbody")
go_combined <- bind_rows(o... |
7634197100b1b268f853f8c5b9e1c5cb5eed4a76a73c8bb45f05e165662e36cf | R | 5,976 | 149 | # clusters related to ciliopathies
# Libraries ----
library(tidyverse)
library(ComplexHeatmap)
library(doParallel)
library(circlize)
library(igraph)
library(ggraph)
library(clusterProfiler)
'%notin%' = Negate('%in%')
# Load files ----
PPIClusters = read.csv('data/PPIFullNetworkClusters.csv') #clusters
pageRankSc... |
9b86c8b2cb586075baef5b78345d5c5669f5fcc1aa50a171d6eb43795dbbaad2 | R | 5,977 | 194 | #' Performs univariate canonical correlation analysis, i.e., ANOVA of all
#' phenotypes on each SNP.
#'
#' @param X An n by p numeric matrix, or a character string pointing to a
#' PLINK dataset
#'
#' @param Y An n by k numeric matrix of phenotypes.
#'
#' @param standx Character. One of "binom" (zero mean, unit varian... |
1adb567e39f54c4abdb2f2723997170a59ebc87ec336a06887d78aee08d041db | R | 5,978 | 121 | ---
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%"
)
# [ 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 ... |
f722d9fe4decd0015821ef5d777bffa8f4d28b78178d9d3cff0a9b2a91df3329 | R | 6,020 | 127 | library("dplyr")
library("purrr")
library("tidyverse")
library("bigreadr")
library("writexl")
library("stringr")
library("readxl")
# Main function to perform cross-organ association analysis
# Performs linear regression between imaging traits from different organs
assoc_3<-function(pheno_ab,pheno_heart,pheno... |
6ac68f123561b87bd9895e57f21992b02f46dd781611d6e50285def5b26d123e | R | 6,025 | 173 | # JN Taroni for ALSF CCDL 2021
# Adapted from Laura Egolf (analyses/chromothripsis/03-plot-chromothripsis-by-histology.Rmd)
#
# Create a panel with a barplot counting the number of samples with
# chromothripsis per cancer group
library(tidyverse)
library(ggpubr)
#### Directories --------------------------------------... |
e3a45235be8e5e73499df6c5363a81b5d73cc4210fa9aa3b4b058856b706a090 | R | 6,031 | 148 | #' Flip orientation of PAF alignments.
#'
#' This function takes loaded PAF alignments using \code{\link{readPaf}} function and flips
#' the orientation of PAF alignments given the desired 'majority.strand' orientation (Either '+' or '-').
#'
#' @param force Set to \code{TRUE} if query PAF alignments should be flipped.... |
0a010f7ed90b186fcbca4d0169bae61e7170029a8eb6e6509c5717c4432a2b49 | R | 6,037 | 154 | splicetype="SE" #type of alternative splicing, e.g., SE, A3SS, A5SS, MXE, IR
counttype="JCEC" #JCEC (junction count + exon body count) or JC (junction count only)
##################
#Input parameters#
##################
# inputpath="./02_PSI_value_quantification/01_Get_PSI_from_rMATS_output/example_input" ... |
b43992078b7bf371d975c5235677763a2ba78b0bc7215a28f075b414a492d6d5 | R | 6,039 | 105 | ---
title: "HCPD Final Sample Selection"
author: "Audrey Luo"
output:
html_document:
code_folding: show
highlight: haddock
theme: lumen
toc: yes
toc_depth: 4
toc_float: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(data.table)
library(dplyr)
library(purrr)
lib... |
97a84deee16022cfc2b4014b4f17c857b20f7d17b512deb82c030d0d867cdadb | R | 6,056 | 133 | # Run Jin for D3b
# Generate correlation plots of TP53 vs. NormEXTEND and breakpoint density
library(tidyverse)
library(readxl)
library(ggpubr)
## Define directories
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git"))
data_dir <- file.path(root_dir, "data")
analyses_dir <- file.path(root_dir, "analyses")
sc... |
5ea6958f34c7b7ad518247e46919b868cb65432070341bea7ecb2df0e946641f | R | 6,062 | 106 | # Post-freeze sensitivity: recover current HGNC symbols from the older source annotation.
# Frozen primary tables, memberships, rankings and classifications are never modified.
.libPaths(c(normalizePath('.Rlib'), .libPaths()))
suppressPackageStartupMessages({library(fgsea); library(jsonlite); library(digest)})
source('... |
1f98ded5a47e1b05b1e8aa8ffd1c52460faf5f170f8266ac81b0472dcf71e0fa | R | 6,069 | 131 | #!/usr/bin/env Rscript
# Script to compute half-lifes from SlamSeq data
# Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder, Bhat Pooja
#
# 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
# publis... |
bfc4f9276ba83248312b4796d8dfe3867f2b1a598123c9addd36a4b7e5314161 | R | 6,075 | 109 | # Author: Komal S. Rathi
# R version of 01-make_notebook_RNAandDNA.py (Author: Teja Koganti)
# script to map DNA and RNA samples to a participant and assign disease group
# load libraries
suppressPackageStartupMessages({
library(tidyverse)
library(optparse)
})
# Parse command line options
option_list <- list(
m... |
0a09170308993be5ded048604f49f242d96f92c657549eeaa70032847c460ecd | R | 6,078 | 209 | library(xgboost)
library(randomForestSRC)
library(mixOmics)
library(PMA)
library(RGCCA)
library(PRROC)
library(doParallel)
library(tidyverse)
library(plyr)
library(gbm3)
library(pROC)
#### Functions for variable selection evaluation
get_all_imp <- function(dat, keep.list, ...) {
## MRF
imd <- sim.fn.mrf3.m(dat =... |
4c36e0d984fab85a5977b6f48ce9e90de78fd9af239baab1466c4b3c19f767b2 | R | 6,080 | 107 | #––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––#
# MACAQUE VS MARMOSET - DISTRIBUTED WORKING MEMORY #
#––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––#
#––––––––––––––––––––––––––––––––––––––––––––––––––––#
# ... |
5cb437e32300c4ee26abc1a6f19e4acfaa9a720fb9ca61e2bad5b902931ebba2 | R | 6,081 | 107 | #' Pathway Enrichment analysis for different level function
#' @importFrom dplyr filter left_join
#' @importFrom rlang sym
#' @param x vector contains gene names or dataframe with DEGs information
#' @param kodata KEGG annotation data
#' @param level pathway level ("Level1", "Level2", or "Level3")
#' @param pvalue cuto... |
8aee2849cc908399a503bd72ef08be34c2d9b0ba188afb0918b357b1f01ed994 | R | 6,081 | 178 | #!/usr/bin/env Rscript
# Paired differential expression analysis using DESeq2.
#
# Design:
# ~ subject + condition
#
# This corresponds to a paired comparison where each subject has
# matched samples across conditions.
suppressPackageStartupMessages({
library(argparse)
library(data.table)
library(DESeq2)
li... |
d8a97b86b51dba59fdb9e3845f2f05c24666aaf1bd6e6be983e4ab6b0966a2e2 | R | 6,083 | 193 | #!/usr/bin/env Rscript
#'
#' t-SNE visualization of RNA-seq samples using RSEM TPM values
#'
#' This script performs an exploratory t-SNE analysis of RNA-seq samples
#' based on gene-level TPM expression values produced by RSEM. Expression
#' values are log2-transformed, filtered to retain expressed genes, scaled
#' pe... |
3c498c19f2abb5126752888aaf1cd98b56441c8256e581efe3051bd767c9d6b0 | R | 6,084 | 247 | #' Calculate Delta betas between two groups
#'
#' @param betas array of betas values
#' @param design design matrix
#' @param cmtx contrast matrix
#' @param contrast_name column
#'
#' @importFrom MatrixGenerics rowMeans
#'
#' @return vector
get_delta_betas <- function(betas, design, cmtx, contrast_name) {
score <- a... |
74b3cd846412debefeb171098a18e968aa898eb7c563aba84a7fe7b9af7913e5 | R | 6,104 | 188 | setwd("") # your wd
library(anndata)
library(Matrix)
library(CellChat)
library(patchwork)
library(future)
ad <- read_h5ad("your_file.h5ad")
counts <- Matrix::t( Matrix::Matrix(ad$X, sparse = TRUE) ) # genes × cells
rownames(counts) <- ad$var_names # gene symbols
colnames(counts... |
62b2657179f2b567baaffb1ff7732d9c6e6fd0262cb4baf4c9ce3fa67732f9d6 | R | 6,126 | 170 | hypomap = readRDS('f:/hypoMap.rds')
head(hypomap@meta.data)
colnames(hypomap@meta.data)
table(hypomap@meta.data$Dataset)
Moffit10x = subset(hypomap,subset = Dataset == 'Moffit10x')
table(Moffit10x$Sample_ID)
table(Moffit10x$Sex)
POA_2postive <- subset(Moffit10x, subset = Esr1 > 0)
POA_2postive <- subs... |
88eeddbe6b0a43f3dbebff779e23cfacf66ce1693ac12af653d187969d419076 | R | 6,132 | 165 | ##Calculation position UV vs dark area preference each hour
## We modified the analysis from Gentile et al. 2013 which I quote:
## "‘Entrainment Index’ (EI = ratio of total activity occurring during a 6 h window over the activity "
# " during the entire warm phase or over the entire 24 h [LL 20°C : 29°C, because... |
138f861f871bdd8588c309275b09f49d380444c501e026046a24c012edb66396 | R | 6,139 | 188 | ---
title: "Identify samples suitable for the RNA-Seq batch correction module"
output: html_notebook
author: Eric Wafula for Pedaitric Open Target
date: 2022
---
To run and fully test the `rnaseq-batch-correct` module in continuous integration, we must ensure that there are examples in the RNA-Seq gene expression coun... |
f38f2fd065acf79fc862290fc5e9bfbb61073f552be9a4aed3026b2044a3c06d | R | 6,142 | 168 | skadi <- function(x, y,
max.distance = 1,
method = "spearman",
grubbs.threshold = 0.05,
diagnostic.plot = T,
euclid.outlier.check = F,
give.uncorrected.p.value = F,
xlab = "x",
... |
839159cc84770d482ba5d35b2b2232bb45bc3d505b0ba905770502cc3deb3012 | R | 6,155 | 146 | library(stringr)
library(circlize)
library(ComplexHeatmap)
library(ggplot2)
library(cowplot)
source("../Plot_theme.R")
set.seed(123)
# Load miRNA target predictions
overlap <- read.csv("comp_Single-cell/Predicted_Targets_Context_Scores.default_predictions.mouse.75perc_weighted_context_score.csv", sep = "\t")
overlap ... |
7a3afebeeecb751b92d212f9dc23fe0e268e6a0820ad4104620b05544f472de9 | R | 6,178 | 240 | #This code will directly compare FC-anxiety associations before and after component regression
#with a linear mixed model and compute FDR corrections
#Author Kim Kundert-Obando
#set up dataframes for analysis
df_stai<-read.csv("nki_data_stai.csv")
df_demo<-read.csv("nki_data_dem.csv")
df_raw<-read.csv("non_regre... |
a26caaa56f8837d37e28694a5740365f621653052cfb86d2d846975df107406e | R | 6,183 | 123 | ################################################################################
#
# File name: trajectory_inference.R
#
# Authors: Jacek Marzec ( jacek.marzec@accelbio.pt )
#
# Biocant Park,
# Parque Tecnológico de Cantanhede,
# 3060-197 Cantanhede
#
##########################################################... |
4f90c87a5b461fa04d12b263bd90f0e52645018638366c331c0282829855cc33 | R | 6,206 | 196 | ---
title: "Heatmap Day14 DOWN genes"
author: "AF"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
suppressPackageStartupMessages({
library(circlize)
library(ComplexHeatmap)
library(rstudioapi)
library(dplyr)
library(clusterProfiler)
library(... |
815f3f7ab8bee7435222c1787e2ad310db60ceeee805432b07f12d9bf241c4ef | R | 6,219 | 150 | #' Generate code files required for shiny app (multi datasets)
#'
#' Generate code files required for shiny app containing multiple datasets. In
#' particular, two R scripts will be generated, namely \code{server.R} and
#' \code{ui.R}. Note that \code{makeShinyFiles} has to be ran prior to
#' generate the necessary ... |
226513ea1c38d85207b090e09ae853a82d996bf737913566045e6f2b48f5d1de | R | 6,226 | 214 | # 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... |
7e3bb96b0a9c6c83f690aa742858e0ff9cd7cfcea74326977a751ed18b710ff8 | R | 6,233 | 114 | #' KEGG Pathway Enrichment analysis function
#' @importFrom dplyr filter
#' @importFrom rlang sym
#' @param x vector contains gene names or dataframe with DEGs information
#' @param kodata GO annotation data
#' @param ontology KEGG
#' @param pvalue cutoff pvalue
#' @param padj cutoff p adjust value
#' @param organism o... |
859fd21f21437d3f2fd6dbfabda15900bbd9c49987c86cc51698580a058fb250 | R | 6,236 | 217 | # v-fold cross-validation
# (copied from rsample package, with edits for >7-class classification)
#' @import rsample
#' @importFrom tidyselect vars_select
#' @importFrom rlang enquo
vfold_cv <- function(data, v = 10, repeats = 1, strata = NULL, breaks = 4,
...) {
if(!missing(strata)) {
s... |
856c51c79f7aefe83687c964dc4f37529ccb553fa480c95adffed7d912a64e3d | R | 6,247 | 171 | library(dplyr)
library(gratia)
library(mgcv)
library(parallel)
library(rjson)
library(stringr)
library(tidyr)
library(NEST)
##################
# Set Variables
##################
args <- commandArgs(trailingOnly = TRUE)
dataset = args[1]
tract = args[2]
print(paste("Running NEST for", dataset, tract))
###########... |
dd7bd401e2fa7d99f6c22287175872db8615372a19a20b3ca8d24e1231fea751 | R | 6,257 | 214 | # 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... |
2ae4b333e98d5b4baf5486adc1655cea6f48cacfbb08b247c2384f8637ed396c | R | 6,264 | 91 | ################################################################################
# Single Gene Burden Test Analysis
# Binomial test comparing variant carriers in cases vs controls
################################################################################
library(tidyverse)
library(biomaRt)
library(openxlsx)
## ... |
a2ee9c99a67ef17b681c4c59ddc079c6d53cd243c9ccc45cc61433c8c7c2aa26 | R | 6,265 | 170 | # prioritization of disease genes
# set paths to files ----
variant_file = 'test_genes.txt' # put file path for your seed genes here
# example file:
# ENSG00000169126
# ENSG00000185658
# ENSG00000167131
# ENSG00000105479
# ENSG00000198003
# ENSG00000157856
# PageRank score calculation ----
getPageRank ... |
ce5a629952e05259807c87c07c56fc00ae6979bee6a08b24d11150da8ca09258 | R | 6,271 | 169 | # Load packages ----
library(shiny)
library(shinydashboard)
library(dplyr)
library(tidyr)
library(ggplot2)
library(ggprism)
library(shinythemes)
library(googlesheets4)
# Load datasets of AIRE dependant genes
AIREdep = read.csv2("data/TRA_AIRE_dependency.csv")
# Load datasets of gene expression in mouse and human
gene_... |
438fa1570af2bf785365168ec60c3df6c6e5c7c48204330f6683dbcdd07ad67e | R | 6,272 | 201 | # S. Spielman for ALSF CCDL & Jo Lynne Rokita for D3b, 2022-3
#
# Makes a pdf panel of forest plot of survival analysis on HGG samples
# with molecular subtype as predictors
library(survival) # needed to parse model output
library(tidyverse)
# Establish base dir
root_dir <- rprojroot::find_root(rprojroot::has_dir(... |
7320eb0c015821bda36fad5c751341c5c087289a54680915474bdff64cc0c6b1 | R | 6,280 | 217 | #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#################### GGPLOT2/THEMES ####################
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#' Unrotate x axis on VlnPlot
#'
#' Shortcut for thematic modification to unrotate the x axis (e.g.... |
55480161f742b7899b62fb4b1036ea451961b55d1e1670759f13357e08e11a3a | R | 6,290 | 170 | ## ----------------------------------------------------------------
## Kappa-related helper functions
## ----------------------------------------------------------------
#' Compute kappa statistic between two gene sets
#' @param x comma-separated gene string
#' @param y comma-separated gene string
#' @param geneall v... |
d3abdfaaf35805b4d9db73ed4d292f4a4970f0c6c8a9f72896325111ef35340b | R | 6,305 | 187 | library(e1071)
library(kernlab)
library(caret)
library(data.table)
library(tidyverse)
getwd()
set.seed(123)
setwd("/data/nas1/liuyiding_OD/project/01_project_147/06_machine")
data=fread("log2TPM.txt",header=T,data.table=F)
data=column_to_rownames(data,"V1")
group=c(rep("Healthy",40),rep("Spesis",20))
com=fread("com.txt... |
0e509b85090a851606694ca41ab0672de91924409f814b745b4acdd65c473135 | R | 6,316 | 96 | #!/usr/bin/env Rscript
library(optparse)
library(leafcutter)
arguments <- parse_args(OptionParser(usage = "%prog [options] counts_file groups_file", description="LeafCutter differential splicing command line tool. Required inputs:\n <counts_file>: Intron usage counts file. Must be .txt or .txt.gz, output from clusteri... |
a7b88ba6515b6ea80fd8031936c5de03684fdf647d50e7444eee37d93bbf3d66 | R | 6,318 | 179 | library(RRHO2)
library(dplyr)
library(ggplot2)
library(ggrepel)
library(cowplot)
library(RColorBrewer)
# Neurons--------
res_Wbo2 <- read.csv("Figure_3/results/iN1_neuron.csv", row.names = 1)
res_I27 <- read.csv("Figure_3/results/iN2_neuron.csv", row.names = 1)
res_1019 <- read.csv("Figure_3/results/iN3_neuron.csv",... |
a19064eb57939005cfda211d8f8d7da7f342c58f6ed500a98ebdfeb3c80dad54 | R | 6,319 | 239 | test_that(
"olink_wilcox - works - non-paired Mann-Whitney U Test",
{
# Load reference results
# tests are skipped if files are absent
reference_results <- get_example_data(filename = "reference_results.rds")
skip_if_not_installed(pkg = "broom")
skip_on_cran()
# tibble ----
check_log ... |
8a9f155dec27a17d6a62fda1c4b90c4ab20eaf50a149aff3fb1cdbe6a7267adc | R | 6,349 | 182 | # --------------------
# title: FigureS10 Code
# author: Hu Zheng
# date: 2026-01-01
# --------------------
library(Seurat)
library(tidyverse)
library(cowplot)
library(ggrepel)
library(ggpubr)
library(RColorBrewer)
library(ggsci)
library(Biorplot)
source('bin/Palettes.R')
source('bin/includes.R')
Adult.Ex <- readRDS... |
e1146d4f250540eb3361fde21fca8274336a953846e312996843a978637dedd9 | R | 6,353 | 145 | #' @title Calculate contribution scores for each view in each sample
#' @description This function calculates, *for each sample* how much each view contributes to its location in the latent manifold, what we call \emph{contribution scores}
#' @name calculate_contribution_scores
#' @param object a trained \code{\link{MO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.