sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
86688ebec6d2008f65dc4b9110836e63da27ed00e5f69b1c3c4a7335b2dd5387 | R | 7,146 | 267 | #############################################################
##################### GENERATE GRAPHS #######################
#############################################################
source_dir <- "https://www.dcc.fc.up.pt/~vanessa.silva/datasets/NetF/"
## get names of all datasets
data_names <- read.table(url(pa... |
366ebac5be7558e9a8be0f1c8dc79841656622bad18533d5ad0897667d1a7cd7 | R | 7,149 | 201 |
################# PLOT TOTAL PHQ-9 SCORE BY HIV STATUS
phq9 <- alldata %>% dplyr::select(PID, q1, q2, q3, q4, q5, q6, q7, q8, q9, total,
language, HIV.status)
gplot <- ggplot(phq9, aes(HIV.status, total, color = HIV.status)) +
geom_boxplot(outlier.colour = NA) +
geom... |
eaacdf6a06276a1f020c122a0eb09e5f88d5d5a11563fbec2a70e89073e28466 | R | 7,160 | 197 | ####################################################################################
## Max Gold
## Code to perform GSVA and consensus clustering for Figure 2
####################################################################################
library(biomaRt)
library(ConsensusClusterPlus)
library(GSVA)
library(readxl... |
21325a308685d0f680affa50055938554f82332463a6eb0ad6ea3b0e0ba13039 | R | 7,224 | 249 | .add_package_version <- function(object) {
# Adds the version of the familiar package used to generate the object. This
# allows for backward compatibility.
# Look-up of the familiar version takes more time than one would expect. Use
# caching.
current_version <- rlang::env_cache(
familiar_global_env,
... |
1f758c381b43717616282f4062b750d8ef4c4e4de1de89c8951175cbbafb94db | R | 7,231 | 274 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
as_familiar_plot <- function(
p = NULL,
g = NULL,
layout
) {
fam_plot <- methods::new("familiarPlot")
if (is.null(g) && ggplot2::is_ggplot(p)) {
# Get gtable from ggplot2 object.
fam_plot@gtable <- .convert_to_grob(p)
... |
f8b3f6a639323ba6b5fc2334671be87e7f3b386300279979077875aec3f27084 | R | 7,281 | 106 | #!/usr/bin/Rscript
# Problem: due to the binary nature of edge weights in CSN networks, each sample specific network has less edges compared to those in other methods
# So, find out the average number of edges in these CSN networks, and select the top n edges in other networks to make them comparable in size
setwd('/... |
d5c8beaab384d335c0377e22c8c34c3217189a3b61b2601275ade85ba5c5ad85 | R | 7,318 | 145 | library(ape)
library(phangorn)
## read true trees
d = read.table("labels372783-0.1-40.0-1.0.in", header=FALSE)
n = length(d$V1)
## labels from the simulating script:
quartets = c("((1,2),(3,4));", "((1,3),(2,4));", "((1,4),(2,3));")
args <- commandArgs(trailingOnly = F)
process <- args[8]
intprocess <- strtoi(process)... |
65e6fc4d6cb41e5ba1f73dc8231f1c803dc72dcc369a905e2565ae30e3ce0e02 | R | 7,344 | 204 | #############################
## Processing outcome of MR automation script
## Retinol as outcome
## Dr William Reay (2023)
#############################
setwd("~/Desktop/Retinol_GWAS/MR_retinol_as_outcome/")
library(dplyr)
library(data.table)
library(ggplot2)
library(RColorBrewer)
library(ggpubr)
library(TwoSam... |
c8480085a0e0a296019ab660b15fb0e21751bd5195321fdd59a75618aeabe834 | R | 7,350 | 145 | #' agglomerate_features(ExpObj = NULL, glomby = NULL)
#'
#' Agglomerates features in a JAMS SummarizedExperiment object safely
#' @export
agglomerate_features <- function(ExpObj = NULL, glomby = NULL){
#Get appropriate object to work with
if (as.character(class(ExpObj)[1]) != "SummarizedExperiment"){
... |
68c1fce81ef3db150cf1b895506e8081dfb254385e9d0075df1912ebeffd3a1d | R | 7,352 | 213 | # Don't perform any further tests on CRAN due to time of running the complete test.
testthat::skip_on_cran()
testthat::skip_on_ci()
familiar_data_creation_unit_test <- function(outcome_type) {
if (outcome_type == "continuous") {
learner <- "glm_gaussian"
} else if (outcome_type == "binomial") {
learner <- ... |
c2aad61a62e6a73b2edb35c3006b1433cb4ca292f139aa1db28ae927fdd601ef | R | 7,358 | 237 | familiar:::test_all_metrics_available(
metrics = familiar:::.get_available_concordance_index_metrics()
)
# Skip remainder on CRAN due to runtimes.
testthat::skip_on_cran()
# power.transform and other packages are required.
if (!rlang::is_installed("power.transform")) testthat::skip()
familiar:::test_all_metrics(
... |
e24f8bdf7f2aed89442a8a906d07af379bef11bc9840d219b8f4ab6af1800914 | R | 7,400 | 216 | ---
title: "facing chicks analysis"
author: "Mirko Zanon"
date: '2023-07-19'
output: html_document
---
```{r include=FALSE}
rm(list=ls())
library(lme4)
library(tidyr)
library(plyr)
library(dplyr)
library(reshape2)
library(ggplot2)
library(ggpubr)
library(nparLD)
library(lavaan)
library(cowplot)
library(rmarkdown)
lib... |
b971e9ed6ba07555dca303277e52371b865b12c6c85c5b2aed53fb6dcb422dbb | R | 7,422 | 175 | # make overrepresentation analyses
# create
# SupplTable-S8-overrepresentation-analysis.xls
library(org.Hs.eg.db) # gene annotation, for mapping symbols to entrez/ensembl
library(clusterProfiler) # GO enrichment analysis
library(xlsx)
library(parallel)
basePath = "/data/bcu_projects/MelBrainSys_PostdocProject_Gruetz... |
12985cd681d8604c48a2f6c4373fc60e727cff2328df5e65b29660897221a12e | R | 7,423 | 139 | ##################################
# Generate Fitted curves DNA methylation and DNA methylation disorder
# as CpG islands and adjacent shores.
# Updated: 2021.05.15
# Author: Kevin A.
###################################
### Preprocessing
#### Load data
library(genomation)
library(GenomicRanges)
l... |
15dd9647a3ec59acd6ca2816f7ab6274678475925f658c19e8852134bf47294a | R | 7,441 | 160 | ---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# muxViz v3.1: The R package <img src="man/figures/logo.jpg" align="right" />
<!-- badges: start -->
[![Lifecycle: experimen... |
cf1789e50fde3801bfd4c260efab332f5e275334603bceade9591a99438d9fdb | R | 7,492 | 148 | #' get_reads
#'
#' JAMSalpha function
#' @export
get_reads <- function(opt = NULL){
setwd(opt$workdir)
#Make final readsdir
opt$readsdir <- file.path(opt$sampledir, paste0(opt$prefix, "_reads"))
flog.info("Creating directory to hold reads.")
dir.create(opt$readsdir, showWarnings = FALSE, recursiv... |
509194a11c67c524f48a1d7b4b2b7ff99f118ce7a561499a9f3ead80c6806af0 | R | 7,535 | 204 | #'% FigureS22.R
#'
#' Plots for Supplementary Figure S22.
#'
#' EEG/fMRI STUDY, DONDERS INSTITUTE, NIJMEGEN.
#' J. Algermissen, 2018-2023.
#'
#' we are here:
#' /project/3017042.02/Analyses/FiguresOutcomeLocked
# ==========================================================================================================... |
c01956eb65349fb58f215928b193907bb495f6d1175d966fc0294a9b82a4610e | R | 7,554 | 148 | #' pareto_abundance(LKTdose = NULL, max_num_taxa_to_show = 30, orderby = "Percentage", readstats = NULL, read_denominator = "Assembled", samplename = NULL, taxlevel = NULL, showrelabundtext = TRUE, showcompletenesstext = TRUE, showcompletenessline = TRUE, showcontaminationline = FALSE, showparetocurve = TRUE, rotate_pl... |
e6f7686f9ff77edb4cac725cd16460c263f872c47ab09dec1a8007aa080b8b89 | R | 7,560 | 241 | library(scapGNN)
library(data.table)
require(coop)
require(reticulate)
require(parallel)
ConNetGNN<-function(Prep_data,python.path=NULL,miniconda.path = NULL,AE.epochs=1000,AE.learning.rate=0.001,AE.reg.alpha=0.5,use.VGAE=TRUE,
GAE.epochs = 300,GAE.learning.rate = 0.01,GAE_val_ratio=0.05,para... |
c0840ea2f22be63521a8d8d38d0617aadcf09315b76a1c4885fb24d648a700e8 | R | 7,571 | 172 |
#' Network prediction module: Network-based prediction of gene expression data
#'
#' This function predicts expression levels of all genes in the data set (data) using the specified network (networkName). Only significant regulatory links (pValCutoff) that are not incoming from genes in close chromosomal proximity up-... |
ab219eadec3f967ef0348fe67a9b15a567f2cf4e3b619bf3a13a10693bae3210 | R | 7,598 | 306 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_svm_c_learners(show_general = TRUE)
)
familiar:::test_all_learners_available(
learners = familiar:::.get_available_svm_nu_learners(show_general = TRUE)
)
familiar:::test_all_learne... |
1814e85fc4847b746ea72b42ea7f0754ed876c36921fa03832f8a176122e728a | R | 7,601 | 187 | #' Import HUMAnN results to \code{TreeSummarizedExperiment}
#
#' @param file \code{Character scalar}. Defines the file
#' path of the HUMAnN file. The file must be in merged HUMAnN format.
#'
#' @param col.data a DataFrame-like object that includes sample names in
#' rownames, or a single \code{character} value definin... |
2389daabe454d2b0931af58646c3f0c3dacfc1996e7a63cbeab3a7b852d906ab | R | 7,611 | 137 | require(optparse)
require(genomation)
require(GenomicRanges)
# Input arguments
option_list <- list(
make_option(c("-i","--indir"), action="store", default=NULL, type="character",
help="Directory containing cell output files for one sample."),
make_option(c("-a","--annotationDir"), action="store", def... |
c2cca4e87132e676f484870ada0675566c0996bba729a6efe227ade1dd9cbf22 | R | 7,635 | 202 | ##############
### Script ###
##############
# Script to plot the barplots for evaluating the inference results, such as TPR, TDR, FPR, and FDR, for
# simulation study setting that vary in sample size (N=500, N=1,000, N=5,000) and base rate intensities
# (lambda=1, lambda=2, lambda=3).
#################
### Librarie... |
4d44ba4b45bef280a051b9469e7e9f679b78f6c759ccaa03c735c39ee45e2bec | R | 7,647 | 155 | #' trim_reads
#'
#' JAMSalpha function
#' @export
trim_reads <- function(opt = NULL, discardleftoverSE = FALSE, qual = 18, autodetect_phred_offest = FALSE){
#Check if reads are in tmpdir
if (opt$workdir != opt$sampledir){
readsworkdir <- file.path(opt$workdir, "reads")
} else {
readsworkdi... |
c0f863c6bfe98ea10897e1d0bf48242cc0b3604babcc020249bd587fd15c0029 | R | 7,700 | 146 | library(stringr)
library(ggplot2)
library(patchwork)
input_path='/scratch/users/banwang3/references/outputs/FABP7_centeratpromoter/sei/'
output_path='/scratch/users/banwang3/references/scripts/seifigures/'
df = read.csv(paste0(input_path,'pantro6_centeratpeak_sei_pred_lfc.txt'),sep='\t')
#idx = which(df[,paste0('chimp... |
014713a7112bc05b5b2aa8e1ad47548278d927910806fb0c5646fdd4897f0e3a | R | 7,732 | 219 | #' Calculate dysbiosis scores
#'
#' Dysbiosis scores measure how much the community of a sample differs from
#' the communities of control samples.
#'
#' @param x a \code{\link[SummarizedExperiment]{SummarizedExperiment}} object.
#'
#' @param col.var \code{Character scalar}. Specifies a variable from
#' \code{colData(x... |
f5b12d47e25fc499640f73e4b1b15ed3dcf8d7ce07192a1d018215b5f7c24e91 | R | 7,740 | 269 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarTaskNoveltyDetectorHyperparameters -----------------------------------
setClass(
"familiarTaskNoveltyDetectorHyperparameters",
contains = "familiarTask",
slots = list(
"learner" = "character",
"vimp_method" = "character",
... |
3e84ae1f4d1c6bb806799dd4b5d43af89e980314b6bffe8dfb0229753e75bcd2 | R | 7,801 | 224 | # Don't perform any further tests on CRAN due to time of running the complete test.
testthat::skip_on_cran()
testthat::skip_on_ci()
# Create a dataset using the good dataset.
data <- familiar:::test_create_small_good_data("survival")
# Train a simple linear GLM using the good dataset.
fam_model <- familiar:::test_tra... |
08c93be6a7c5e0be70973ee2c246d64febdca7cdc6511fcd76625f7b0562434f | R | 7,802 | 126 | ###############################
## FinnGen forest plot (release 8)
## Dr William Reay (2023)
###############################
library(ggplot2)
library(data.table)
library(dplyr)
library(TwoSampleMR)
setwd("~/Desktop/Retinol_GWAS/MR_all_cis_acting_SNPs/FinnGen_r8_MR/")
IVW <- fread("FinnGen_r8_retinol_MR_Ncase_over... |
8a53283012ef3e8ebaa0c536de455d861757e0ea37e84a332f35ba05d4ae0016 | R | 7,814 | 196 | ---
title: "Setbp1_Clustering_postSoup_03"
author: "Jordan Whitlock"
date: '2023-04-14'
output: html_document
---
This analysis comes after 'Setbp1_Integration_03.Rmd' and precedes 'Setbp1_MarkersCortex_05.Rmd' & 'Setbp1_MarkersKidney_05.Rmd'.
# *Single-nuclei analysis: Clustering*
* Finding Neighbors
* Clustering wit... |
d309eac40bd91a6b52c097dc9eb8b44a69bb87e5176cd4dd619d34c4886ee15f | R | 7,863 | 169 | ---
title: "story_time"
author: "Jordan Whitlock"
date: '2023-06-13'
output: html_document
---
Goal #1: Investigate expression of SET in kidney and cortex S858R samples, in order to confirm it's expression aligns with what is known in the literature or that it is not different across cell types and conditions.
Goal ... |
a5592c25658e42ea815b6d8fb80df8a9f6fc1648243c5327342f0b76a2559806 | R | 7,882 | 144 | # bulk-calc_global_and_context_CpG_PDR.R - This script takes the proportion of discordant reads
# (PDR) per CpG for one sample and calculates global and context-specific DNAme disorder
require(optparse)
require(dplyr)
require(genomation)
require(GenomicRanges)
# Input arguments
option_list <- list(
make_option(c(... |
cebdb29a65edf09ff5d3ee742ceefaeaaca70360d4bb6ab6ccefe8f510aff815 | R | 7,885 | 146 | ---
title: "Neural Networks in Phylogenetic Inference"
author: "Claudia Solis-Lemus, Leonardo Zepeda-Nunez"
output:
pdf_document:
citation_package: natbib
keep_tex: true
documentclass: article
header-includes:
- \usepackage[margin=1in]{geometry}
- \usepackage[ruled,vlined]{algorithm2e}
- \usepackage[dvi... |
3b5e3164f8edfb851e3b67af33797177b38c9ae8093d11efe0401b79ca64ea49 | R | 7,890 | 304 | ..trim_functions <- function() {
return(list(
"coef" = list(
"FUN" = stats::coef,
"with_timeout" = FALSE
),
"vcov" = list(
"FUN" = stats::vcov,
"with_timeout" = TRUE
),
"summary" = list(
"FUN" = summary,
"with_timeout" = TRUE
)
))
}
.capture_show <- fun... |
8c7b3893e7a490331ec76c58265bfad85c3ca95835793ec3648c5a8ad047e2e9 | R | 7,903 | 165 | library(stringr)
library(ggplot2)
library(ggrepel)
library(patchwork)
getCorString <- function(dataframe, x, y, category_col = NULL, labelRound = 2, method = "pearson") {
# Calculates pearson correlation coefficient and pvalue between two columns in a dataframe
# Construct category list of factors
if(!is.nu... |
f40e8627c901254b26d71df119a17db3b2eca69a0a73a6f82c11a45005fdea14 | R | 7,911 | 163 | #' Creates bar graph of relative taxonomic abundance from SummarizedExperiment object.
#' plot_bar_graph(ExpObj = NULL, glomby = NULL, absolute = FALSE, samplesToKeep = NULL, featuresToKeep = NULL, only_allow_CSBs = FALSE, groupby = NULL, label_samples = FALSE, colourby = NULL, subsetby = NULL, applyfilters = NULL, fea... |
4f2ba1b8f804296529193c9a355175eea7925bd0f78a8c249fc322b83c33e8ed | R | 7,935 | 278 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_xgboost_lm_learners(show_general = TRUE)
)
# Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
fam... |
4b4c9167ef6aeb1b50cba2a96dcab09b5369366d837c5a670f96d93b5bc50575 | R | 7,944 | 261 | # Don't perform any further tests on CRAN due to running time.
testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
for (outcome_type in c("continuous", "multinomial", "survival")) {
# Get data.
data <- familiar:::test_create_good_data(outcome_type = outcome_type)
# Select simple regression mode... |
92ca4d65a645007b49a1c0d98801ef3121b3374bbf5ff336a5198755bf3d4f86 | R | 7,953 | 249 | testthat::skip_on_cran()
testthat::skip_on_ci()
# binomial ---------------------------------------------------------------------
# Create data.table.
data <- familiar:::test_create_good_data(
outcome_type = "binomial",
to_data_object = FALSE
)
# Check that train_familiar functions correctly.
model <- familiar::tr... |
ce01c91b64c01db1a5a8edd83dc62315065aa16609898214a4281607d66bec35 | R | 7,978 | 169 | # bulk-filter_CpG_PDR.R - This script takes the proportion of discordant reads
# (PDR) per CpG for one sample and performs data filtering
require(optparse)
require(dplyr)
require(genomation)
require(GenomicRanges)
# Input arguments
option_list <- list(
make_option(c("-i","--indir"), action="store", default=NULL, ... |
134e4324a14b780f9086eaf96cbce8ebbb1dae129bab10ce5b63ba73faf6b9d1 | R | 8,002 | 134 | #' process_MAGs(opt = NULL)
#'
#' JAMSalpha function
#' @export
process_MAGs <- function(opt = NULL){
setwd(opt$sampledir)
#############################################################################
## Safe CheckM2 launcher (see evaluate_LKTs for rationale).
## Caps worker count and times out to pr... |
8a0c3ec819d7aaea8a4ba117f409dd69601d84b37ebd86fc3f22c1b2276b936c | R | 8,010 | 170 | ##################################
# Clustering of CNV and DNA methylation from scRRBS.
# Updated: 2021.05.19
# Author: Kevin J.
###################################
## Refresher on hclust:
# https://uc-r.github.io/hc_clustering
## Hints to annotate dendrogram
# https://www.r-graph-gallery.com/340-custom-your-dendrogra... |
d617e15e07be54326240e2d8f533efdbbf1b04540d0f3070d7bf89b4bec940f1 | R | 8,042 | 153 | # EEGfMRIPav_2_Preprocess_Automated
EEGfMRIPav_2_Preprocess_Automated <- function(){
#' EEGfMRIPav_2_Preprocess_Automated()
#'
#' Reads data from EEGfMRIPav_all.csv (which contains already read-in and recoded behavioral variables),
#' creates (refreshes) ordered factors,
#' creates several more convenience ... |
ce20d5cd38571edea9fc9867be8315420116b5893f0ca75c0ea998f4d109233e | R | 8,121 | 244 | #############################################################
################### Empirical Evaluation ####################
#############################################################
### auxiliary variables to store results
dataset <- "tsmodels"
data_name <- "tsmodels"
total_comb <- 7 + 2 + 3
table_eval_mean <- ... |
d91c9fd0af478e6e9958d4fffb3f8424123783b7e0485aa48eb9970019f9b3cd | R | 8,130 | 281 | # simpleCPP_test.R- Testing JAGS fits of a non-hierarchical Neural-DDM model
# in JAGS using Rjags in R assumes CPP slopes are generated from drift rates
#
# Copyright (C) 2022 Kianté Fernandez, <kiantefernan@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
66b0c3ddbfadaef3b215ae048dc7810ca383e69cac2e744a56adc8eeeafc870c | R | 8,144 | 305 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# is_available -----------------------------------------------------------------
setMethod(
"is_available",
signature(object = "familiarVimpMethod"),
function(object, ...) {
# This is a fall-back method.
return(FALSE)
}
)
# requ... |
fa8811dc29aa78d63253e9b1782439bee52f6e29412b62e393110cc8b940799b | R | 8,172 | 273 | # script for plotting median TPM expression of SETBP1 and its targets across
# tissues as a heatmap
# load libraries
suppressPackageStartupMessages({
set.seed(2178)
library(here)
library(tidyverse)
library(ComplexHeatmap)
library(stats)
library(NbClust)
source(here("src/expression_functions.R"))
})
ptm ... |
5daea67002bba063b1da403f55088f3e184cca08b9c635c2c0ec4f3d2b2f610b | R | 8,178 | 293 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_rfsrc_learners(show_general = TRUE)
)
# Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
familiar... |
ed3ab6b709673af5c4a57bdccc82f70e54bee08d9955951f1cc2fe25dc76cf2f | R | 8,180 | 216 | #############################################################
################## Experimental Evaluation ##################
#############################################################
source_dir <- "https://www.dcc.fc.up.pt/~vanessa.silva/datasets/NetF/"
## get names of all datasets
data_names <- read.table(url(pa... |
ad909b7d740719c0221c318984bb11e89060a81224c9a367773e4d2b419f4fb9 | R | 8,200 | 140 | ### Script to create edge score density plots from top 50 000 edges single sample networks ###
library(plyr)
library(ggplot2)
library(tidyverse)
library(reshape2)
library(dplyr)
library(data.table)
library(stringr)
library(ggpubr)
setwd('/home/boris/Documents/PhD/single_sample/networks')
CreateDensityPlot <- functio... |
7221044d1197f773808cd1ff800de737900337fcb92b50daf1c10a10215df9e5 | R | 8,204 | 193 | ---
title: "Automation of Inter-Rater Reliability (IRR)"
author: "Ailbhe N. Finnerty"
date: "19 March 2020"
output:
pdf_document: default
html_document: default
word_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Markdown for "IRR_Automation.R"
This is an R Markdow... |
dc63b366ef5574c6862c7965a1e1ef8f01f24d99a094ff1b71d1a440bf733f50 | R | 8,224 | 254 | #############################
## Automated MR of all retinol IVs
## FinnGen r8 data - 1141 binary phenotypes with N cases > 1000
## William Reay (2023)
#############################
library(TwoSampleMR)
library(data.table)
library(dplyr)
library(ggplot2)
setwd("~/Desktop/Retinol_GWAS/MR_all_cis_acting_SNPs/FinnGen_... |
132a71d07786f5d259c6da7950e25cea09c71865bac6b42be32e8e28c1fa06cd | R | 8,240 | 259 | ###################### BLOOD BIOMARKERS ONLY
## OVERALL CORRELATIONS
cordata <- blooddata[,2:16]
cor <- corr.test(cordata, use = "pairwise", method = "spearman")
cormat <- cor$r
diag(cormat) <- NA
mean(abs(cormat), na.rm = T)
sd(abs(cormat), na.rm = T)
range(cormat, na.rm = T)
quantile((abs(cormat)),... |
6055740ea96246f8d37718d488d1b2917d1b319f6da2c8b81a59de8e23c3b538 | R | 8,279 | 249 | #' Clustering wrapper
#'
#' This function returns a \code{SummarizedExperiment} with clustering
#' information in its colData or rowData
#'
#' @param x A
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object.
#'
#' @param assay.type \code{Character scalar}. Specifies the nam... |
d9f5ee90c83c1485d9627547ceb13100e9f7739e8910e2b3b55678740a307286 | R | 8,285 | 264 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_glmnet_ridge_learners(show_general = TRUE)
)
familiar:::test_all_learners_available(
learners = familiar:::.get_available_glmnet_lasso_learners(show_general = TRUE)
)
familiar:::te... |
656318218a008173015f49747b8d2b32fbabdb3ddcb1e52b10d8b801e6b9d724 | R | 8,313 | 166 |
updateEventsDatasetPicker = function() {
updatePickerInput(session, "events_dataset", choices = names(data$meta), selected = input$events_dataset)
updatePickerInput(session, "heatmap_dataset", choices = names(data$meta))
updatePickerInput(session, "lag_dataset", choices = names(data$meta))
}
ex... |
d0993793794e7be11086f6b7e7e4117f5fe0e9cfc6c6fe85bbc2e855b8343a07 | R | 8,358 | 300 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarDataElementRiskStratificationInfo object -----------------------------
setClass(
"familiarDataElementRiskStratificationInfo",
contains = "familiarDataElement",
prototype = methods::prototype(estimation_type = "point")
)
# extract_r... |
8c659ae39f8aa0fa17ddc716b4984e8e9fb6f879c83b43eccbbf7d02b68163ec | R | 8,380 | 304 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_ranger_learners(show_general = TRUE)
)
# Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
familia... |
952a41a9535bff360ccc5e6dad4e77cf4871080e923bef2b95c392387fd0d844 | R | 8,420 | 179 | rm(list = ls())
options(stringsAsFactors = F)
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/")
# options(BioC_mirror="https://anaconda.org/bioconda/")
options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
getwd()
setwd('C:/Users/LWH/Downloads/bioinfo/IPF&CHD&SSc')
library(sva)
library(limma)... |
529e2d65a586db52c0ae96fafafefd47c4e0e5764523b2293c1e752f0c76080f | R | 8,455 | 173 | ##################################
# Clustering of CNV and DNA methylation from scRRBS.
# Updated: 2021.05.18
# Author: Kevin J.
###################################
## Refresher on hclust:
# https://uc-r.github.io/hc_clustering
## Hints to annotate dendrogram
# https://www.r-graph-gallery.com/340-custom-your-dendrogra... |
acb3b2dfd42e5386a71f8b1f716f99d5461702b2f4862958962f83663a6bf049 | R | 8,460 | 176 | # calculates correlations between average log expression ratio and
# average log impact ratio of the altered genes on all pathways of each metastases pair
# creates SupplFigure 5 with scatter plots (SupplFigure-S5-impact-expression-correl.png)
# and Figure 4 with barplots of the correlations (Figure-4-plot-impact-exp... |
35dcacd8e817b24f41ed446478afdc13a38994e93306324c3f763b73691bc9b9 | R | 8,469 | 218 | #' Get dominant taxa
#'
#' These functions return information about the most dominant taxa in a
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object.
#'
#' @inheritParams agglomerateByVariable
#' @inheritParams getPrevalence
#'
#' @param name \code{Character scalar}. A name f... |
0d528cae06f4a27aefc323475ef12087c1a56bdf7c5ce2784a1e0d266e79010a | R | 8,476 | 165 | ##################################
# Assess the stress-associated changes in DNAme disorder/
# Updated: 2021.05.13
# Author: Kevin J.
###################################
## Working directory for this analysis.
mybasedir = "/Users/johnsk/github"
setwd(mybasedir)
###################################
# Necessary package... |
519ed58322cebde1c600cca78fc79b1a57e8442cbd7779ee126e9317f142d74d | R | 8,500 | 174 | library(stringr)
library(ggplot2)
library(ggrepel)
library(patchwork)
getCorString <- function(dataframe, x, y, category_col = NULL, labelRound = 2, method = "pearson") {
# Construct category list of factors
if(!is.null(category_col)) {
catList <- list()
for(i in category_col){
catLi... |
c9ab1534fda0e20c9dcd698219868da8fe2f926964d19fd454961b312705a645 | R | 8,520 | 171 | #' load_jamsfiles_from_system(path = ".", recursive = TRUE, onlysamples = NULL, onlyobjects = NULL, threads = 8, multithread_decomp = TRUE, multithread_load = TRUE, use_exactly_n_threads = NULL)
#' JAMSbeta function
#'
#' Loads all JAMS files from system
#' @export
load_jamsfiles_from_system <- function(path = ".", re... |
51b0744018899d74269cebcdf8a19d532bf2fc8ffcf37ec2ca141f4894030cb0 | R | 8,526 | 274 | # script for plotting median TPM expression of SETBP1 and its targets
# across tissues as a violin plot
# load libraries
suppressPackageStartupMessages({
set.seed(2178)
library(here)
library(tidyverse)
source(here("src/expression_functions.R"))
})
ptm <- proc.time() # start timer
# affected tissues
affected ... |
cd95c1499aad4d9eddfe1aa01932dd0214f14b4214329a3b3bde7844cd24257f | R | 8,543 | 273 | # script for plotting median TPM expression of SETBP1 and its targets
# across tissues as a violin plot
# load libraries
suppressPackageStartupMessages({
set.seed(2178)
library(here)
library(tidyverse)
source(here("src/expression_functions.R"))
})
ptm <- proc.time() # start timer
# affected tissues
affected ... |
a5204350a3179efabf158ace4259c3592106ac77dd739d1295e075b7b164fa6b | R | 8,559 | 262 | context("PERMANOVA")
# Sample data setup
data(GlobalPatterns, package = "mia")
tse <- GlobalPatterns
tse <- transformAssay(tse, method = "relabundance")
test_that("getPERMANOVA works on SummarizedExperiment", {
# Test basic PERMANOVA without homogeneity check
res <- getPERMANOVA(
tse, assay.type = "rel... |
52c8654ee55843910979971e601f08fc6522c77910dde0a9e46be9237768dae8 | R | 8,563 | 172 | # bam2epiallele.R - identifies concordant and discordant reads from an input BAM file generated by Bismark
# BAM file columns:
# (1) QNAME (seq-ID)
# (2) FLAG (this flag tries to take the strand a bisulfite read originated from into account (this is different from ordinary DNA alignment flags!))
# (3) RNAME (chromoso... |
5a0bb82ab71bc5fcfca6bf1038190e5fca7f775b22cb84c5ed6df41410fa130e | R | 8,610 | 152 | ### Script to create edge score density plots from top 50 000 edges single sample networks ###
library(plyr)
library(ggplot2)
library(tidyverse)
library(reshape2)
library(dplyr)
library(data.table)
library(stringr)
library(ggpubr)
setwd('/home/boris/Documents/PhD/single_sample/networks')
CreateDensityPlot <- functio... |
3e996c000223526e05d5e8d1713a2faeceb70eb554bb8c42ddbb5bd876a9dfa1 | R | 8,675 | 219 |
# test fMRI univariate effect using WB ROIs (Midbrain, LPFC)
rm(list = ls())
source('Setup.R')
usedir = dirname(getwd())
figDir = file.path(usedir,'Figs')
SubInfo = read.xlsx(file.path(usedir,'SourceData.xlsx'),'SubjectConds')
UseAggBOLD = read.xlsx(file.path(usedir,'SourceData.xlsx'),'Fig5bSFig5c')
UseDiffAggBOLD =... |
44c334c9bb3d58832dae5a7073bade4fbdf89bb8e265d7712c9c563e1a4b228a | R | 8,786 | 155 | ##############################################
# Assess DNAme disorder in spatially collected specimens
# Updated: 2021.05.15
# Author: Kevin J.
##################################################
## Objective: Use the FRONTIER data to determine relationship between disorder and spatial location.
## FRONTIER data from ... |
9790c2188839372d43cc92227d96304b2ec75b525a9253a173ce5d5ca325e968 | R | 8,829 | 255 |
rm(list = ls())
source('Setup.R')
usedir = dirname(getwd())
figDir = file.path(usedir,'Figs')
SubInfo = read.xlsx(file.path(usedir,'SourceData.xlsx'),'SubjectConds')
# load global conn data frame
dfGC = read.xlsx(file.path(usedir,'SourceData.xlsx'),'Fig2cSFig2bSFig3')
################################################... |
9d5b607b2fb53ef248ddc41c780d041bf16391ca191696cb0e51628e0cf72307 | R | 8,898 | 215 | ####################################################################################
## Max Gold
## Code to process snRNA-seq for validation cohort
####################################################################################
#############################################
## Import packages
#####################... |
c6f32b38c92d8aa3a10cbba73623ce2aad12cfb993eb435d12ebaae569847e70 | R | 8,901 | 271 | ##############
### Script ###
##############
# Run code to acquire indices of spatial neighbors for masked map of voxel locations.
# Note: Acquiring an adjacency matrix for 91x109x91 voxels would have dimensions of 902,629 x 902,629
# which is too computationally costly to compute and most importantly infeasible to... |
7777beaeeeb3b41b79e4377e873108ce520bc4f39d6250f9a3d1f925f68bc064 | R | 8,906 | 181 | ##################################
# Unsupervised clustering of tumor scRRBS data.
# Updated: 2021.06.13
# Author: Kevin J.
###################################
## Based on tutorial: https://github.com/hui-tony-zk/PDclust
## HPC working directory for this analysis.
## These files are available on Synapse stitched tog... |
84c1891dcd29b1c129406b384d0cba98ff96bab93b1151f9c140487e770b2bc1 | R | 8,914 | 186 | setwd(file.path(Sys.getenv("GIT_HOME"), "gUtils", "rtdocs"))
HI=150
WI=600
.plot_gr <- function(gro, grn) {
gro_p <- gro[strand(gro) %in% c("+","*")]
gro_m <- gro[strand(gro) %in% c("-")]
grn_p <- grn[strand(grn) %in% c("+","*")]
grn_m <- grn[strand(grn) %in% c("-")]
alpha = 0.5
g <- ggplot()
if (lengt... |
3a03222b0ffd365dda17dac49314e2ddd34c0b52c7d8763203c4bc662c3bdd20 | R | 8,915 | 195 | ##################################
# Clustering of CNV and DNA methylation from scRRBS.
# Updated: 2020.05.12
# Author: Kevin J.
###################################
## Refresher on hclust:
# https://uc-r.github.io/hc_clustering
## Hints to annotate dendrogram
# https://www.r-graph-gallery.com/340-custom-your-dendrogra... |
bb835098515ae671bff252c02b68333e8265e0f98b8584520d426873b6b5bc38 | R | 8,934 | 244 | ####################################################################################
## Max Gold
## Code to run through sn/sc-RNA-Seq clustering and signature analysis
####################################################################################
# Import packages
library(biomaRt)
library(data.table)
library(ggp... |
4db510625409d0fda74f1cdb9a5cb12543d1e0c8bff8d5d0d6b106d1002d1b89 | R | 8,977 | 184 | #### IMPORT PACKAGES ####
library(ggpubr)
library(rstatix)
library(readr)
library(dplyr)
library(lme4)
library(lmerTest)
library(lmtest)
library(reghelper)
library(sjPlot)
#### READ RAW DATA ####
df <- readRDS(file = "...raw_data.rds") # TO ADAPT
#Drop all the rows where „firstResponse” has a value of 0.
#drop all... |
29a73925b9eb05967bdf2b144685b4d6fd814a33d4b2f23e416c84a67920e9d1 | R | 8,988 | 248 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# promote_learner (model) ------------------------------------------------------
setMethod(
"promote_learner",
signature(object = "familiarModel"),
function(object) {
learner <- object@learner
if (learner %in% .get_available_naive_bay... |
989e039f44e8ab3373b1427715bcaaa93c2ed4e74f6d8487f1967fcc72b4755f | R | 9,007 | 271 | ## ---- kop_calc --------
kop <- dfm %>%
dplyr::group_by(sub,
pma,
ga,
pt,
sex,
ensembleMetastab,
ensembleEntropy,
motparam_fd_outlier_count) %>%
dplyr::summarise(meanSync = mean(e... |
9c49b42c6b118d3edd633bd47bc852870ef6af7966fdf4c17245b99e717465db | R | 9,028 | 320 | # Don't perform any further tests on CRAN due to running time.
testthat::skip_on_cran()
testthat::skip_on_ci()
verbose <- FALSE
# Create data.table.
data <- familiar:::test_create_good_data(
outcome_type = "binomial",
to_data_object = FALSE
)
# Create data assignment object.
experiment_data_assignment <- familia... |
dd09f1cdea74d0916a453fbeb11b195a55bbc001bfae8d4ec92c768c5b419539 | R | 9,077 | 301 | # nolapse_test.R - Testing JAGS fits of HDDM models without lapse process in JAGS using R2jags in R
#
# Copyright (C) 2022 Kianté Fernandez, <kiantefernan@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free... |
d8250ab54dc2cad67c330de7aa92d01164c7170e79bb00164baad99169799408 | R | 9,109 | 196 | observeEvent(input$data_dataset, {
updatePickerInput(session, "data_signal_var", choices = names(data$raw[[input$data_dataset]]))
})
signal.values = reactiveValues()
output$data_signal_dl_lag = downloadHandler(filename = \() { "lag autocorrelation.xlsx" } , content = \(file) { write_xlsx(signal.values$lag, ... |
c9f0fc74bc1973824426c1c975bdb7c7bcb37d2f56fde5c5b9987db0bd0e1601 | R | 9,110 | 187 | library(stringr)
library(ggplot2)
library(ggrepel)
library(patchwork)
getCorString <- function(dataframe, x, y, category_col = NULL, labelRound = 2, method = "pearson") {
# Calculates pearson correlation coefficient and pvalue between two columns in a dataframe
# Construct category list of factors
if(!is.nu... |
f48b8590fa06a63daf4f59bd63ca23ae2d569d0d766b61fc1ca7879331cbed35 | R | 9,131 | 305 | ---
title: "subjects_descripton_flowchart"
author: "Fernanda Hansen Pacheco de Moraes"
date: "2023-01-16"
output:
html_document:
fig_width: 8
number_sections: yes
theme: paper
toc: yes
toc_depth: 6
editor_options:
chunk_output_type: inline
---
# RMARKDOWN AND R SETUP
```{r setup, include=FALS... |
0a0b5b86b7beb5452b584e2b0d46d2e79fffe18dcc62e2c77c4cb849d0464f01 | R | 9,145 | 140 | #' print_jams_report(opt = opt)
#'
#' JAMSalpha function
#' @export
print_jams_report <- function(opt = opt, outputdir = NULL, elements = c("readplots", "taxonomy", "resfinder", "plasmidfinder", "func"), report_style = NULL){
if (is.null(report_style)){
report_style <- opt$analysis
}
QualPieColou... |
fe46e39d4dccad8800b6aa83a230b0f03898499922d2c040e0a252882166622c | R | 9,146 | 232 | #' Subsample Counts
#'
#' \code{rarefyAssay} randomly subsamples counts within a
#' \code{SummarizedExperiment} object and returns a new
#' \code{SummarizedExperiment} containing the original assay and the new
#' subsampled assay.
#'
#' @details
#' Although the subsampling approach is highly debated in microbiome r... |
53ab81914b33da1aa33886c624377a451f3c1922cc249d7f165d088379a548dc | R | 9,149 | 326 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_xgboost_tree_learners(show_general = TRUE))
# Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
fa... |
9cfc847a2ee35beef31b8463d2131841c3db5f076ca904822af30ca9e66b4815 | R | 9,173 | 158 | ---
title: "story_time"
author: "Jordan Whitlock"
date: '2023-06-13'
output: html_document
---
Goal: Investigate Gfap+ astrocytes within the context of neurodegeneration in order to determine if we are seeing a similar signature of reactive astrocytes found in Alzheimer's disease, Parkinsons, or other neurodegenerativ... |
dff51e1e6924d288f64ac6e63fdcaa8ce8e8783492af0b78b0621d6b8eceb7af | R | 9,175 | 276 | testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
# Without external validation --------------------------------------------------
data <- familiar:::test_create_good_data(outcome_type = "binomial", to_data_object = FALSE)
# Only training
results <- familiar::summon_familiar(
data = data,
expe... |
00b128a2c4535538cdf4ac821d0e6ea53295afec39a195381e2b7bb40afc2780 | R | 9,179 | 207 | # Nasopharynx data (with mm10 reference)
library(dplyr)
library(Seurat)
wd = "~/Projects/Nasopharynx/Nphx"
setwd(wd)
source("~/Projects/Organotypic_LEC/pre_processing_SS3.R")
adult_matrix = make_count_matrix_from_fc_out(
fc_dir = "./Adult/FC_OUT/combined.counts",
gtf_dir = "~/Reference/ss3/gencode.vM16.primary_a... |
d0ab9698e9e7bf4edd87e249d0b8e6732f3fe04a09488118d6881c4024b9ea1a | R | 9,267 | 382 | do.call_strict <- function(
what,
args,
quote = FALSE,
envir = parent.frame()
) {
# Only pass fully matching arguments. Side effect is that ... is always empty.
# Use with care in case arguments need to be passed to another function.
# Get arguments that can be passed.
passable_argument_names <... |
f715434a17bf4b6bfc3bc39c81e82169f55b9db9dbf725f814ff6dc53c8923b2 | R | 9,358 | 228 | ---
title: "Setbp1_Clustering_03"
author: "Jordan Whitlock"
date: '2022-09-07'
output:
html_document:
toc: true
toc_depth: 2
toc_float: true
---
This analysis comes after 'Setbp1_Integration_02.Rmd' and precedes 'Setbp1_MarkersCortex_04.Rmd' & 'Setbp1_MarkersKidney_04.Rmd'.
# *Single-nuclei a... |
eca2164992deaaa92ad89ff4ca31b6a23df5a1bd414595b643041218d3ced320 | R | 9,366 | 167 | #' Safely merges two compatible JAMS-style SummarizedExperiment objects into a single JAMS-style SummarizedExperiment object. SE objects must belong to the same analysis type, and have no Sample names in common. Ideally they should have been generated with the same version of JAMS using the same JAMS database. If the l... |
929feb6d5a41bab075e977d1d506892289885d3e64bf303eea3b102306b68806 | R | 9,427 | 256 | #' Create a phyloseq object from a \code{TreeSummarizedExperiment} object
#'
#' @inheritParams convertFromBIOM
#'
#' @param x a
#' \code{\link[TreeSummarizedExperiment:TreeSummarizedExperiment-class]{TreeSummarizedExperiment}}
#' object
#'
#' @param assay.type \code{Character scalar}. Specifies the name of assa... |
bfcfb2eb9831bde6ac1781b6b75afd82faefaac79f8f6368f0754bfe7988a9ec | R | 9,447 | 334 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarIsolationForest ------------------------------------------------------
setClass(
"familiarIsolationForest",
contains = "familiarNoveltyDetector"
)
# initialize -------------------------------------------------------------------
setMe... |
0e99b65469eaf3e75529d668cb1f6afa348835f8cb5f7b3bdbbfdc698e3e25c8 | R | 9,484 | 286 | #' Agglomerate a \code{SummarizedExperiment} based on several taxonomic ranks
#'
#' \code{agglomerateByRanks} takes a \code{SummarizedExperiment}, splits it
#' along the
#' taxonomic ranks, aggregates the data per rank, converts the input to a
#' \code{SingleCellExperiment} objects and stores the aggregated data as
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.