sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
cd1fd092d0723e9cfb32e608743ee6a266838999c66f8b9963552f28036cd66b | R | 9,507 | 177 | #!/usr/bin/Rscript
library(data.table)
library(dplyr)
library(limma)
library(stringr)
library(ggplot2)
library(tidyr)
library(EnhancedVolcano)
library(biomaRt)
library(edgeR)
library(ggpubr)
library(parallel)
library(purrr)
setwd('/home/boris/Documents/PhD/single_sample/')
cn_dat <- fread('/home/boris/Documents/PhD... |
e787ec4cc4521bd302a7dfba65c63680480879e8e1dd3704c329ad51f37b8801 | R | 9,529 | 251 | #############################################################
############# CLUSTERING - AUXILIARY FUNCTIONS ##############
#############################################################
n_reps <- 10
##############################################################
## AUXILIARY FUNCTIONS - PCA
##########################... |
7e355aa9a302e24b556d377009e1a6f424b668207aa8dd9343c86931bbc6742a | R | 9,551 | 145 | #!/usr/bin/Rscript
library("data.table")
library("funkyheatmap")
library(ggplot2)
library(dplyr, warn.conflicts = FALSE)
library(tibble, warn.conflicts = FALSE)
data("dynbenchmark_data")
data <- data.frame(
"Tools" = c('SSN', 'LIONESS', 'iENA', 'CSN', 'SSPGI', 'SWEET'),
"Aggregate_network" = c('Yes', 'Yes', 'No... |
28fbde32f80325eb525344ac3733c30bd235efeac5704d7baad6f6e325a17eea | R | 9,557 | 171 | #!/usr/bin/env Rscript
# =============================================================================
# Acceptance tests for the stereoseq_mini_mouse_eyeball fixture.
# =============================================================================
suppressMessages({
library(reticulate); library(rhdf5); library(data... |
dd68f9853a7d0e7c5de3fa23110f25aa1dfba56d1e8eaff986cdb957a20df360 | R | 9,561 | 171 | #' get_contig_coverage(opt = NULL, markduplicates = FALSE, align_as_unpaired_reads = TRUE)
#'
#' JAMSalpha function
#' @export
get_contig_coverage <- function(opt = NULL, markduplicates = FALSE, align_as_unpaired_reads = TRUE){
setwd(opt$workdir)
#Only get coverage from reads if contigs were actually assemble... |
cae6cf1899f6acef88a08a84c75158594d809b44508f27ea9f6c594f294794f2 | R | 9,600 | 247 |
library(DESeq2)
library(GenomicRanges)
library(qvalue)
library(apeglm)
library(dplyr)
library(ggplot2)
library(gplots)
library(gridExtra)
#library(Rtsne)
library(reshape)
library(scales)
#library(VennDiagram)
#library(Seurat)
library(graphics)
#library(MultiPhen)
library(stringr)
#if (length(args)<6... |
502a4716d6c7452d059ad7bd4071c1701c81742fac330094b036648eabe6dd6b | R | 9,654 | 110 | ---
title: "README"
author: "Jordan Whitlock"
date: "`r Sys.Date()`"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# snRNA-seq quality control and pre-processibn
## Purpose:
All scripts in `seurat_scripts`were used for Quality control and processing of snRNA-seq data ... |
d4f4f8a597f35c8aa06380d85a88fe21169d363d4216f4833c1371146bea732e | R | 9,696 | 347 | ---
title: "mia: Microbiome analysis tools"
date: "`r Sys.Date()`"
package: mia
output:
BiocStyle::html_document:
fig_height: 7
fig_width: 10
toc: true
toc_float: true
toc_depth: 2
number_sections: true
vignette: >
%\VignetteIndexEntry{mia}
%\VignetteEngine{kn... |
eb77e5f8762193d2b2207b7576a0c79ee9affe4ee90e8f6b06fb4812044f0bb7 | R | 9,716 | 183 | rm(list=ls())
Sys.setenv(LANGUAGE = "en") #显示英文报错信息
getwd()
setwd('C:/Users/LWH/Downloads/bioinfo/IPF&CHD&SSc')
# source("CIBERSORT.R")
# devtools::install_github("omnideconv/immunedeconv", upgrade = T, force = T)
library(quadprog)
library(immunedeconv)
library(dplyr)
library(biomaRt)
library(ggplot2)
library(ggpubr)
... |
3e2b06b82326cd3e16a749d2eaa8819b85ce5f5c5d4769f52611b8f3f7d2c3cd | R | 9,782 | 194 | ##############################################
# Assess single cell stress scores in 10X data.
# Updated: 2021.05.17
# Author: Kevin J.
###############################################
# Working directory for this analysis in the SCGP project.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
#####################... |
4f10512b023fc4ba62022e631bd5680e8a94cc983287157cfcc13ac1bbf5a0a9 | R | 9,808 | 368 | #' @include PredictionTable.R
.get_available_stratification_methods <- function() {
return(c("median", "fixed", "optimised", "mean", "mean_trim", "mean_winsor"))
}
.find_survival_grouping_thresholds <- function(object, data) {
if (!object@outcome_type %in% c("survival")) {
..error_reached_unreachable_code(p... |
4ed2091618a1339acab525a8b35fc19dfbedbd0661b979722e52452b5eec968e | R | 9,811 | 153 | #' ExpObjVetting(ExpObj = NULL, samplesToKeep = NULL, featuresToKeep = NULL, glomby = NULL, variables_to_fix = NULL, only_allow_CSBs = FALSE, class_to_ignore = NULL, featuresToKeep_warn_frac = 0.2, featuresToKeep_error_frac = 0.5, featuresToKeep_size_floor = 10)
#'
#' Performs vetting of a SummarizedExperiment object f... |
7cc33b545bc14818f2525117eb1fd1d078499e116b88ea59fe5b97227848f9a7 | R | 9,859 | 352 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_xgboost_dart_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()
f... |
c171b6473a5be07f814412093c016faded4ea521282598ada289135a2919cb36 | R | 9,865 | 218 | testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
data <- familiar:::test_create_good_data(outcome_type = "binomial", to_data_object = FALSE)
data[101L:150L, "batch_id" := "test"]
# With unpooled collections ----------------------------------------------------
# Set evaluate_top_level_only to FAL... |
05ba1c48a5d5266507e85a0c8920bca8d746508cd20907df67d4350b54b859a1 | R | 9,869 | 334 | familiar:::test_all_metrics_available(
metrics = familiar:::.get_available_regression_metrics()
)
# Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
# power.transform and other packages are required.
if (!rlang::is_installed("power.t... |
901e23a64b1fc426fae916c8f52c537a876c0d00f04dda9c2f6453884f467baf | R | 9,878 | 194 | ##################################
# Plot the DNAme and methylation across genomic elements
# Updated: 2021.05.14
# Author: Kevin J.
###################################
# Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
library(tidyverse)
li... |
eb87cd943a7fc37073794b894d6a7dc8ce1dbe9324b4289c1e6df03c08105144 | R | 9,890 | 250 | ##################################
# Analyze transcriptional diversity differences amongst subclones.
# Updated: 2021.05.19
# Author: Kevin J.
###################################
## Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
library(ti... |
69135a036b3339d29a7ee6a3477819921270d62f7e99fdc8913c181845f72c23 | R | 9,924 | 261 | #' Estimate divergence
#'
#' Estimate divergence against a given reference sample.
#'
#' @inheritParams addDissimilarity
#'
#' @param x a \code{\link[SummarizedExperiment]{SummarizedExperiment}} object.
#'
#' @param assay_name Deprecated. Use \code{assay.type} instead.
#'
#' @param reference \code{Character scalar}. A ... |
4b9f6e1384fcde4f8e1bfb306840c98e192b87604485fde201ae977398940525 | R | 9,930 | 183 |
shinyFileChoose(input, "data_unaligned_file", root=c(`Working Directory`='.', getVolumes()()), filetypes=c("csv", "xlsx"))
observeEvent(input$data_unaligned_time_unit, {
if (input$data_unaligned_time_unit == "freq") {
shinyjs::hide("data_unaligned_time")
shinyjs::show("data_unaligned_frequ... |
820e68222b855285195739f437f9de1716af64e594a66707409daa32c5079eef | R | 9,953 | 319 | # Build compact demo objects (.rda) for IBDMDB examples/vignettes.
#
# Produces:
# data/ibdmdb.rda (ibdmdb)
#
# Source raw inputs from inst/extdata and pre-process for speed/size.
#
# This script is for DEVELOPERS only. It is NOT run during R CMD check.
message("== IBDMDB demo data preparation ==")
# -------------... |
e863a68cae6851efee3c2144e26a6326e9c8e65805c66a5d289aa1b28875b3ec | R | 9,980 | 150 | #' multiple_subsetting_sample_selector(SEobj = NULL, phenotable = NULL, subsetby = NULL, compareby = NULL, cats_to_ignore = "N_A")
#'
#' Application for subsetting a phenotable into up to three tiers of subsets within subsets. Returns a named list. The first element, named "Subsets_stats" is a data frame of the compare... |
6865ac469348b8356f201f06bc39392046d09af8a0bd1905864f300b500fb2f9 | R | 9,997 | 246 | ---
title: "02_Setbp1_Community_Identification"
author: "Jordan Whitlock"
date: '2023-06-28'
output: html_document
---
Goal: Determine what Community Number TF Setbp1 is contained in for every single cell type in both tissues. This is needed for Jaccard Similarity Index (JI) comparisons between Setbp1 communities in f... |
6a28d92c4526127ce126fa6bad2c809c6ec436e7797e89eb0e8e45e26742dce1 | R | 10,025 | 246 | ###########################
## RapidoPGS - Retinol PGS tuning and association
## William Reay (2023)
###########################
library(dplyr)
library(data.table)
library(ggplot2)
library(lmvar)
library(ComplexHeatmap)
library(circlize)
library(ggpubr)
library(caret)
setwd("~/Desktop/Retinol_GWAS/TwinsUK_app/E120... |
8e5ad04f18a26180b5d943f3af4429c177be915ab4f021db41bb9e8c7a1bd6af | R | 10,038 | 340 | ##################################################
# Global variables
##################################################
#This is to avoid pushing a button and starting all the other ones..
btnImportNetworksValue <- 0
#Other variables
fileInput <- NULL
LAYERS <- 0
multilayerEdges <- NULL
isolatedNodes <- vector("list... |
ae952f07659066e3c4fabd778e11858b9c25f8f3045db826a73b004df6a2b10c | R | 10,067 | 200 | #############################################################
##################### GENERATE GRAPHS #######################
#############################################################
## load datasets
load(url("https://www.dcc.fc.up.pt/~vanessa.silva/datasets/NetF/Data/ts_models.RData"))
###########################... |
56dfcc00f3aea2af1697721261d5d3dcddcf1c8f20e5476a0cead1df8e25eb52 | R | 10,068 | 222 |
observeEvent(input$data_baseline_model, {
if (input$data_baseline_model == "exp") {
shinyjs::hide("data_baseline_linear")
shinyjs::show("data_baseline_exp")
} else if (input$data_baseline_model == "lin") {
shinyjs::show("data_baseline_linear")
shinyjs::hide("data_baseline... |
165bf0f92b072808ecc192b80e41e370fb69fe3d81b2f72359cee587a7aabff2 | R | 10,105 | 269 |
### Image reg functions ####
#' @name trakem2_rigid_transf_extract
#' @title trakem2_rigid_transf_extract
#' @description Extract rigid registration transformation values from FIJI TrakEM2 xml file. Generated through register_virtual_stack_slices.
#' @param inputstring string read in from TrakeEM2 xml file
#' @keywo... |
b83ecc4ba207bc2d72b37712812b7c0fead3be6bf455be6338037ad026977dc7 | R | 10,109 | 137 | #' compute_readcounts(opt=opt)
#'
#' JAMSalpha function
#' @export
compute_readcounts <- function(opt = opt){
##Aggregate counts
#Start by aggregating counts which will always be present
rawbases <- sum(subset(opt$fastqstats, Reads %in% opt$rawreads)[]$Bases)
NAssbases <- sum(subset(opt$fastqstats, Re... |
e1caa219b919196ba7c5edf2b1b6e08150457f27e406bf5a4454bb6e1dd0a427 | R | 10,131 | 358 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
#' @include Clustering.R
#' @include ClusteringMethod.R
NULL
# add_feature_info_parameters (singularClusteringObject, dataObject) -----------
setMethod(
"add_feature_info_parameters",
signature(
object = "singularClusteringObject",
data = "... |
81efe838dc349fc71381a679b6f1064163f639aba4e01929997d94a5c4065ebe | R | 10,137 | 285 | #' decontam functions
#'
#' The \code{decontam} functions \code{isContaminant} and
#' \code{isNotContaminant} are made available for
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' objects.
#'
#' @inheritParams getDissimilarity
#' @inheritParams getDominant
#'
#' @param seqtab,... |
8ee5b2baeff7ba05ac007e5eef62ee321c7b0735193481bedd5fd00fed1709a3 | R | 10,285 | 353 | .get_palette <- function(
x = NULL,
palette_type,
n = NULL,
invert = FALSE,
use_alternative = FALSE,
diverge_to_white = TRUE
) {
# Check whether the provided palette is known, a set of colours, or a default.
if (is.null(x)) {
colours <- .get_default_palette(
n = n,
palett... |
666a0523373f95ee13e0417c6949e8b6520e02310a7473a0495b7203bd133ac8 | R | 10,295 | 291 | ---
title: "Multilayer community detection"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Multilayer community detection}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "../man/f... |
70d753762259f7d350a93d7422538957ce4386859bd071a3dca87c0ad2f0af23 | R | 10,296 | 229 | testValidFilters = function() {
.ft = as.data.table(excel_to_R(input$events_filters))
if (nrow(.ft) == 0) return(T)
.valid = logical(nrow(.ft))
for (n in 1:nrow(.ft)) {
if (.ft[n, rule] %in% c("drop first N events", "drop last N events", "keep first N events", "keep last N events")) {
... |
3b847edfd940bd1da3554361e7d71c83c7f8b3fce91988e163475e99b811fb82 | R | 10,299 | 272 | ---
output: github_document
---
<!-- index.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/"
)
```
# muxViz <img src="man/figures/logo.jpg" align="right" />
<!-- badges: start -->
... |
785653523472a88dc9cba2cb6fdfb651e66cc86abe1bc0804459fa74a74fd310 | R | 10,332 | 319 | ---
title: "Setbp1_Integration_postSoup_03"
author: "Jordan Whitlock"
date: '2023-04-14'
output: html_document
---
This analysis follows 'Setbp1_QC_postSoup_01.Rmd'.
### Loading in all required libraries
```{r}
set.seed(2178)
library(devtools)
library(magrittr)
library(SingleCellExperiment)
library(readr)
library(dpl... |
6d6e4830e58fa4996bf4cd3e13a1fb2e4999930df3d8fa187388c2a22c5889e6 | R | 10,363 | 230 | suppressPackageStartupMessages({
library(edgeR)
library(DESeq2)
})
args = commandArgs(trailingOnly=TRUE)
# Add in real counts file, lists of selected samples for C0, C1
if (length(args)<5) {
stop("Usage: sigtest.R [cond0 expr table] [cond1 expr table] [real counts file] [outname] [op:use DESeq? (0/1)]
... |
603074555dfef197f474f419553721855db31651bc2930bf1f0fb64255a4fe22 | R | 10,383 | 283 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# promote_vimp_method ----------------------------------------------------------
setMethod(
"promote_vimp_method",
signature(object = "familiarVimpMethod"),
function(object) {
# Extract vimp_method.
method <- object@vimp_method
i... |
b1e6496159827c3c3c0bcc2ad74c5780c9370de9e6a2d44591eb9ded99c24e41 | R | 10,436 | 232 |
#' Data loader module: Load data set
#'
#' This function loads a data set (e.g. gene expression, gene copy number) from a given file. The data set must contain the following columns: Gene, Chromosome, Loctcation, Measurements_1, ..., Measurements_N. Gene column: unique gene names. Chromosome column: chromosome entry o... |
4a4a0ba14f050af8c433205bb9335c6ada42f3a50f99d591fa1e408b82b8f5ce | R | 10,460 | 185 | #!/usr/bin/env Rscript
# =============================================================================
# Acceptance tests for the visiumhd_mini_crc fixture.
#
# 1. internal consistency: h5 == mtx, positions == barcodes, 8 / 16 um and the
# cell matrix are exact aggregates of the 2 um bins, geojson == cells
# 2. fide... |
ae25dce126e354615ed99b9d63f82320aced59378c3165d0af88be5b9c39d53e | R | 10,546 | 418 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarDataElementCalibrationInfo object ------------------------------------
setClass(
"familiarDataElementCalibrationInfo",
contains = "familiarDataElement",
slots = list("outcome_type" = "ANY"),
prototype = methods::prototype(
est... |
6022514f938eb872000acde2e3b4cff67ea8b5c01bb15dc28fb58e3900cf7884 | R | 10,575 | 273 | #' @name
#' getPERMANOVA
#'
#' @title
#' Calculate PERMANOVA (Permutational Multivariate Analysis of Variance)
#'
#' @description
#' These functions perform PERMANOVA to assess the significance of group
#' differences based on a specified dissimilarity matrix. The results can be
#' returned directly or added to metadat... |
9f2ec4c75dfad43314aa890db399fc29c6d170ac365c1b6e59e39c78fb3dcb7b | R | 10,588 | 237 | #' assemble_contigs
#'
#' JAMSalpha function
#' @export
assemble_contigs <- function(opt = NULL){
#Obtain reads to use for assembly
opt <- get_reads(opt = opt)
#Filter and trim reads
opt <- trim_reads(opt = opt)
#Eliminate host reads if applicable
opt <- filter_host(opt = opt)
#Check if... |
9a9273afdbc2483c9d21ee7ebb9d2ed29c66d260483fa69ff9180e46a2663b90 | R | 10,631 | 260 |
library(Giotto)
# createGiottoInstructions(python_path = '/your/path')
## Giotto 0.3.5 ##
## mini-test Visium Brain Giotto 0.3.5 ##
## !! change this directory path !!:
#temp_dir = '/path/to/your/temporary/directory/results'
temp_dir = getwd()
## 1. giotto object ####
expr_path = system.file("extdata", "visium_DG... |
1288f586b38aa9b7d337c869927b2e14e0c490373855b6a2088d44574f4a78c2 | R | 10,636 | 204 | ##############################################
# Assess the differences in gene expression and cell states based on stress exposure for HF2354
# Updated: 2021.05.13
# Author: Kevin J.
###############################################
# Working directory for this analysis in the SCGP project.
mybasedir = "/Users/johnsk/... |
bcea0b05228ff149ff4ff61785af38af92974539c93839604102bab0e9797fba | R | 10,638 | 338 | # recovery_test.R - Testing JAGS fits of HDDM models in JAGS using R2jags in R
# This hierarchical model is usuaully appropriate for trials with intermixed experimental conditions
#
# Copyright (C) 2022 Kianté Fernandez, <kiantefernan@gmail.com>
#
# This program is free software: you can redistribute... |
345ad25d1f565d2950a492cb701d8f75dbf37e5905f9a905dcc6e5f0e75a04a4 | R | 10,647 | 363 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarTaskTrainNovelty -----------------------------------------------------
setClass(
"familiarTaskTrainNovelty",
contains = "familiarTask",
slots = list(
"vimp_method" = "character",
"learner" = "character",
"vimp_table_fil... |
79c7ead8c84186e3e84c721eb3d00bda615458062f70df4f6177a164fca11110 | R | 10,652 | 236 | # violin plots of impact log2-ratios, Suppl. Figure S4
# cluster heatmaps of log-ratio impacts on pathways, Figure 3
# Suppl. Table S7: log-impact and log-expression per pathway
# Suppl. Table S9: expression impact quadrants shared pathways
library(ggplot2)
library(gridExtra)
library(pheatmap)
library(scales) # for wr... |
8dc4d2278664f9d3fb7cdbb5b56d15fe937410272bfb1965bbafb2c965e09130 | R | 10,656 | 257 | # calculates for each metastases pair
# average impacts log-ratios (brain/extra-cranial) on pathways
# median impact log-ratios of all altered genes on all genes
# average impacts log-ratios on each gene
#
#
# from the altered genes of all met. pairs
# as basis for other scripts
# saved for later: metPairs-i... |
7e983ef359cdbce1c77cfc28b76d07eb16f519bb28bae1d21cac1b9715e177a5 | R | 10,714 | 410 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarCoxPH object ---------------------------------------------------------
setClass("familiarCoxPH",
contains = "familiarModel",
slots = list("encoding_reference_table" = "ANY"),
prototype = list("encoding_reference_table" = NULL)
)
#... |
b549f7991b3da23648b5b0ec2673dd3a7bd254fea0feb050aee727a097402b55 | R | 10,754 | 234 |
#' @title calculateHVG
#' @name calculateHVG
#' @description compute highly variable genes
#' @param gobject giotto object
#' @param expression_values expression values to use
#' @param method method to calculate highly variable genes
#' @param reverse_log_scale reverse log-scale of expression values (default = FALSE)... |
4bf1188b60a7dcf1046e57ea7eb4198cc24b06c976287b0921f8c7f4be88f373 | R | 10,771 | 437 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarDataElementHyperparameters object ------------------------------------
setClass(
"familiarDataElementHyperparameters",
contains = "familiarDataElement",
prototype = methods::prototype(
detail_level = "hybrid",
estimation_ty... |
97af873a33f34baa6a771d84858a5c6ea6a8b1aa4b17435ed640ed5bbb571e71 | R | 10,794 | 261 | ##################################
# Determine whether there is a difference in DNAme + DNAme disorder based on ecDNA.
# Updated: 2020.05.06
# Author: Kevin J.
###################################
# Working directory for this analysis in the SCGP project.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
########... |
8b7898edded4756127ee5d89534640c573292b7fb89cc644d641d7d74265ff72 | R | 10,804 | 204 | ##############################################
# Assess the differences in gene expression and cell states based on stress exposure for HF3016
# Updated: 2021.05.13
# Author: Kevin J.
###############################################
# Working directory for this analysis in the SCGP project.
mybasedir = "/Users/johnsk/... |
28fbcbdf201b5a6aab7e573c6926641eef84f0b55f46782d10db90648b18c459 | R | 10,811 | 353 | ---
title: "Isolate Functional Report"
subtitle: "`r params$sample_name`"
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
pdf_document:
toc: true
toc_depth: 3
number_sections: true
fig_width: 10
fig_height: 6
latex_engine: xelatex
keep_tex: false
geometry: margin=0.75in
fontsize: 10pt
... |
9c0efcc72b7959daa22cf746d2488c32436db0080407dfcc57ba17109fdca289 | R | 10,814 | 344 | ##############
### Script ###
##############
# Run BSGLMM (=Bayesian Generalized Linear Mixed Model) (Code for Simulation Study)
#################
### Libraries ###
#################
library(hutils)
library(brglm2)
library(MASS)
library(logOfGamma)
#################
### Constants ###
#################
# Number of ... |
1ac1df6754a62afd18925de4a78b9d086648171babd651ac4f1c2061093cee0e | R | 10,858 | 232 | ################ COVID-19 ###################
fc<-fread("./data/apply/COVID-19/covid19_KatherineA.Overmyer_2021_tableS1.csv")
gene<-fread("./data/apply/COVID-19/lung_tsne2d_hier-clust_maxclust120_gwasseed-clust-eps0.5pts6.csv")
step1=fread("./data/apply/COVID-19/step1.csv")
magma<-fread("./data/apply/COVID-19/COVID... |
d2422dae8a772ab6df308caa87d32f8c46d78520cdd443e048ad64ee19337472 | R | 10,927 | 118 | #' Exports counts and featuredata in a SummarizedExperiment vector into a single spreadsheet.
#' @param expvec list of JAMS-style SummarizedExperiment objects.
#' @param expvec_analysis_spaces String specifying the name(s) of the JAMS-style SummarizedExperiment object(s) to be exported into Excel. If NULL, will inclu... |
6b592d92f09d40e64daecefbc2e99f954a86a010a78d5cec8946e49d71e7170d | R | 10,949 | 312 | # This function can be used to unify the group id vector. It can be any
# kind of vector, but this converts it to factor.
.norm_f <- function(
i, f, dim.type = c("rows","columns"), empty.rm = FALSE, ...){
if(!.is_a_bool(empty.rm)){
stop("'empty.rm' must be TRUE or FALSE.", call. = FALSE)
}
d... |
6e3c3015a5ea46bab7def8c5bd195a0232b075ae563b904d4f9cbf637017229e | R | 10,975 | 223 | ##################################
# Determine the DNAme and DNAme disorder between cell states.
# Updated: 2020.05.16
# Author: Kevin J.
###################################
# Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
library(tidyvers... |
9833797ef58df559dd47dd6fd41746e9b271b1b5979b8800b7def5505ac313bf | R | 10,989 | 313 | testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
# With external validation -----------------------------------------------------
data <- familiar:::test_create_good_data(outcome_type = "binomial", to_data_object = FALSE)
data[101L:150L, "batch_id" := "test"]
# Training + external validation
res... |
1235a2291ce5c7adc0dfd4637eeea103e4158f3486741b66ddd36090dd0e4644 | R | 11,040 | 388 | familiar:::test_all_vimp_methods_available(
familiar:::.get_available_rfsrc_vimp_methods(show_general = TRUE))
familiar:::test_all_vimp_methods_available(
familiar:::.get_available_rfsrc_default_vimp_methods(show_general = TRUE))
# Don't perform any further tests on CRAN due to time of running the complete
# test.... |
60018b8f9542ac6928fb1297e78a74c1f2a678c27adf54d1ec6e7251e941781c | R | 11,049 | 293 | #' Import Mothur results as a \code{TreeSummarizedExperiment}
#'
#' This method creates a \code{TreeSummarizedExperiment} object from
#' \code{Mothur} files provided as input.
#'
#' @param assay.file \code{Character scalar}. Defines the file
#' path of the feature table to be imported. The File has to be in
#' \... |
310b265b4994b6f9224d942b1b0e314ebb7c39128b7550fa829511b43a1b3be5 | R | 11,065 | 239 | context("agglomerate")
test_that("agglomerate", {
gr <- GRanges("chr1",rep("1-6",11))
df <- DataFrame(n = c(1:11))
mcols(gr) <- df
grl <- splitAsList(gr,1:11)
mat <- matrix(1:110, nrow = 11)
xtse <- TreeSummarizedExperiment(assays = list(mat = mat),
rowRanges... |
241409e8dbf9190bca9e967067eb97b31472618f721888fe63904a53a77d1d14 | R | 11,172 | 329 | familiar:::test_all_vimp_methods_available(
familiar:::.get_available_univariate_mutual_information_vimp_method(show_general = TRUE))
familiar:::test_all_vimp_methods_available(
familiar:::.get_available_multivariate_mutual_information_vimp_method(show_general = TRUE))
# Don't perform any further tests on CRAN due... |
65bff70c65642dd0000f544a89e2bf3f9e429d17eb1082f8a17cf9bfbbdddcb1 | R | 11,190 | 476 | #' @include FamiliarS4Generics.R
NULL
# require_package (character) --------------------------------------------------
setMethod(
"require_package",
signature(x = "character"),
function(
x,
purpose = NULL,
message_type = "error",
...
) {
# Pass to .require_package
return(invisible... |
26592dd31c343a85a32e8c0e250d563b8367611e75e5db0bbb4c0680848b4704 | R | 11,220 | 344 | #' Apply a function by feature or sample group
#'
#' @name applyByModule
#'
#' @description
#' applyByModule provides a convenient method to apply the same operation on
#' multiple, possibly overlapping groups of features or samples, representing
#' for example functional microbial modules or sample categories, respec... |
21445f8e6916bbb51805f434120220ec3088cf1f992c47749b400ecd20657820 | R | 11,237 | 255 | ##################### Housekeeping genes ##################
brain<-fread("./result/brain_perplexity40_tsne2d_hier-clust_maxclust127.csv")
tsne_result=brain[,-1]
tsne_result$housekeeping<-as.factor(tsne_result$housekeeping)
tsne_result2=tsne_result[which(tsne_result$housekeeping==1), ]
p<-ggplot(tsne_result,aes(t... |
e0ddc89a28ce85c17b574d7051ddc32a82a8103f1028f0b29720209f929ab937 | R | 11,244 | 302 | #################################################################
############## ABCD: training test with residualization #########
#################################################################
########## load all the packages
packages <- c('psych','doParallel','permute','reshape2','PMA','caret','corrplot','group... |
480d0154a520845143b336959aac2dafbf014ef05dfa4d9b7d497e50c6cfe2f4 | R | 11,252 | 209 | #!/usr/bin/env Rscript
# =============================================================================
# Acceptance tests for the xenium_mini_lung_cancer fixture.
# All six must pass for the fixture to be usable by GiottoAgent / Giotto Suite.
# ===========================================================================... |
90fdbe16d3c881c6b6cb30c0825361d67468188ffa8db36e33d45e4c05abef0d | R | 11,263 | 322 | # Helper function to extract tree and align matrix with tree nodes
.get_tree_and_linked_mat <- function(
x, mat, tree = NULL, tree.name = "phylo", node.label = node_lab,
node_lab = NULL, index_name = "phylogenetic", ...){
# Input check
# If tree is NULL, then we must have TreeSE object that has ... |
2454be4e1bcd019c59e7caa3ef968fa2f0ad8e3c6af26c749157422e9e8d4453 | R | 11,267 | 256 | ##################################
# Examine the DNAme disorder summarized at the gene-level
# Updated: 2021.05.13
# Author: Kevin J.
###################################
# Working directory for this analysis in the SCGP project.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################... |
9bf825892500acf2f7be567348e5b99de262ea93fe3c44e20556bb0fa09e51e2 | R | 11,272 | 414 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarKNN ------------------------------------------------------------------
setClass(
"familiarKNN",
contains = "familiarModel"
)
# initialize -------------------------------------------------------------------
setMethod(
"initialize"... |
9037d00dd82f33bcc0d440197d25ad46f3cd71532d03c5287bcff46fb08a32b0 | R | 11,287 | 203 | library(Seurat)
library(scclusteval)
library(harmony)
#https://github.com/crazyhottommy/scclusteval
#https://crazyhottommy.github.io/EvaluateSingleCellClustering/5k_pbmc.html
RandomSubsetData <- function(object, rate, random.subset.seed = NULL, ...){
ncells <- nrow(object@meta.data)
ncells.subsample <- ... |
66748d472e13f5b066ba0a669f6684ab97250b73187b04d64783840e7a34edc2 | R | 11,347 | 227 | 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... |
d7a157747876928de05a3f2d1baaf59f4e4e8a213bf9801b515aae07570443c6 | R | 11,374 | 391 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarTaskLearnerHyperparameters -------------------------------------------
setClass(
"familiarTaskLearnerHyperparameters",
contains = "familiarTask",
slots = list(
"learner" = "character",
"vimp_method" = "character",
"use_... |
d88a40115f4cd6b31bf8a9229c693c627972f41d955bb330b225738fb2065b34 | R | 11,385 | 250 | #############################
## Processing outcome of MR automation script
## Retinol as exposure
## Dr William Reay (2023)
#############################
setwd("~/Desktop/Retinol_GWAS/MR_all_cis_acting_SNPs/")
library(dplyr)
library(data.table)
library(ggplot2)
library(RColorBrewer)
library(psych)
library(ggpub... |
6d2bb8a301ce99736b75256c068c878df1977f879956d646d13a8a9cd7d8bbd7 | R | 11,402 | 207 | #!/usr/bin/Rscript
library(data.table)
library(dplyr)
library(limma)
library(stringr)
library(ggplot2)
library(tidyr)
library(EnhancedVolcano)
library(biomaRt)
library(edgeR)
library(ggpubr)
library(parallel)
library(purrr)
setwd('/home/boris/Documents/PhD/single_sample/')
cn_dat <- fread('/home/boris/Documents/PhD/s... |
600a6fba1d7587db5469d7a9c5a12639f341fb943e0cb2763817db12f8a3031e | R | 11,405 | 290 | ##############
### Script ###
##############
# Script to perform posterior predictive checks, including calibration plots.
#################
### Libraries ###
#################
library(ggplot2)
library(data.table)
library(oro.nifti)
library(ggpointdensity)
#################
### Constants ###
#################
set.... |
5201f360632b2ab1fa9f9b486637939bf1ddbd70fb1ee12ca82cee143b07d4fb | R | 11,458 | 331 | #######################################################################
############## important functions used in the project ################
#######################################################################
######################################################
####### Read the rs-fMRI matrices and vectorize... |
3ff0b311a30b851132fd3c6d4f4417a88267da81f7ee84f0c736640b0003bc7e | R | 11,469 | 330 | #!/usr/bin/Rscript
library(stringr)
setwd('/home/boris/Documents/PhD/single_sample/networks')
######################################################################################################
#### Main figure: NSCLC, SCLC, MBL and GBM IntOGen drivers
###########################################################... |
40acfa1de09ad61d0668abcfab855267f268ea6c6616c8bcdd4ac353d02611a6 | R | 11,606 | 331 | #' Dirichlet-Multinomial Mixture Model: Machine Learning for Microbiome Data
#'
#' These functions are accessors for functions implemented in the
#' \code{\link[DirichletMultinomial:DirichletMultinomial-package]{DirichletMultinomial}}
#' package
#'
#' @param x a numeric matrix with samples as rows or a
#' \code{\link[S... |
34934754d8beb636741a42ed08a58523e7b3f5aff43fb63e4a0eeaa0fc7f17af | R | 11,659 | 307 | ---
title: "04_TF_activity_kidney"
author: "Jordan Whitlock"
date: '2023-06-07'
output: html_document
---
# Setup
```{r load-libraries-functions}
library(ComplexHeatmap)
library(circlize)
library(here)
library(readr)
library(purrr)
library(styler)
library(dplyr)
library(gprofiler2)
library(Seurat)
library(tidyr)
librar... |
3b2e9836d1da1dca3c63cf4543ed6b90cbef64eb3c0f4c443f6c0c2c2b57457e | R | 11,669 | 288 | ---
title: "03_TF_activity_cortex"
author: "Jordan Whitlock"
date: '2023-06-07'
output: html_document
---
# Setup
```{r load-libraries-functions}
library(ComplexHeatmap)
library(circlize)
library(here)
library(readr)
library(purrr)
library(styler)
library(dplyr)
library(gprofiler2)
library(Seurat)
library(tidyr)
librar... |
5978c7e98021756abda7e9a5dbdd62e21d0eaa81ade851ed034175036ecefd86 | R | 11,686 | 513 | .check_dots_is_parameter <- function(dots, call = rlang::caller_env()) {
if (length(dots) > 0L) {
# Find unmatched arguments.
unmatched_args <- setdiff(dots, .get_all_parameter_names())
if (length(unmatched_args) > 0L) {
..error(
paste0(
"Configuration: one or more function... |
e2500625d7527220e1c72a04375aae2204f5e9ecbeba94cd3522201fa9e3496b | R | 11,687 | 209 | #!/usr/bin/Rscipt
#### Script to calculate network characteristics of the single sample networks ####
## Start with aggregate networks ##
library(igraph)
library(data.table)
library(reshape)
library(reshape2)
library(ggplot2)
library(dils)
# For local run
base <- '/home/boris/Documents/PhD/single_sample/networks/'
... |
b4006d55d657a7a73611df76e05ad4d76724c1731ce622c371062e21f0bfda22 | R | 11,711 | 298 | ##############################################
# Generate stacked barplots for supplementary materials
# Updated: 2021.02.06
# Author: Kevin J.
##################################################
# Working directory for this analysis in the SCGP-analysis project.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
#... |
87c07ae3aaed25677ab3b8458be776fda54e3673b7a5fe165f996f64284581da | R | 11,714 | 245 | context("merge")
test_that("merge", {
# .check_f
expect_error(mia:::.norm_f(),
'argument "f" is missing')
expect_error(mia:::.norm_f(6),
'argument "f" is missing')
expect_error(mia:::.norm_f(6,5),
"'f' must be a factor or character vector")
f <- fac... |
002b9a5dfe1421b2e6144f0634de3d3243ebec3662f7f44699c3a08e6258dca4 | R | 11,718 | 423 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarDataElementUnivariateAnalysis object ---------------------------------
setClass(
"familiarDataElementUnivariateAnalysis",
contains = "familiarDataElement",
prototype = methods::prototype(
detail_level = "ensemble",
estimati... |
0821af2d749278dfbaa57f94964b1762afd9986e51018e6875499c8c3f556203 | R | 11,738 | 286 | library(data.table)
library(stringr)
library(scales)
library(Rfast)
library(ggplot2)
library(MOFA2)
## give path to python executable
reticulate::use_python(python = "/Users/zhangtong/Documents/002_software/anaconda3/bin/python")
args = commandArgs(trailingOnly=TRUE)
cell_metadata_file = args[1]
heterogeneity_data_f... |
dd5ff3dad940cda12d3b68bd42c7014ac7bf0b9a301a14cdab61b9de681cfcb0 | R | 11,843 | 319 | ---
title: "Knowing Neurons Users"
author: "Peris-Yague et al. 2023"
date: "17/6/2023"
output:
github_document:
toc: true
html_document:
df_print: paged
pdf_document: default
word_document: default
---
```{r echo=FALSE, results='hide', message=FALSE, warning=FALSE}
chooseCRANmirror(graphics=FALSE, in... |
871115198344b61d27cc10873478e6c9f1d461f638e1c8593cc8bb10c1c9047f | R | 11,874 | 306 | ##################################
# Generate boxplots for sample-specific global DNAme disorder (annot. with bulk features).
# Updated: 2021.05.12
# Author: Kevin J.
###################################
# Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
######################... |
af7efcb20b51b1d59ff8de6eca264788a6bc6e63aa042213e23744ab139b2a5e | R | 11,961 | 281 | # EEGfMRIPav_0_CreateBarPlots.R
# Various functions for aggregation and bar plotting.
# =============================================================================================== #
#### Create percentiles ####
create_percentiles <- function(data, varName, nPerc = 5, perSub = F){
#' Create new variable of per... |
c121592366a51ebf0c98a11c4106a2e8934b329bc67de0b673f38c1e78dc3d5a | R | 11,971 | 480 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarDataElementConfusionMatrix object ------------------------------------
setClass(
"familiarDataElementConfusionMatrix",
contains = "familiarDataElement",
prototype = methods::prototype(
value_column = "count",
grouping_column... |
abe1c4acb073990476c765bf2bbf1c3efbe69067d4d983a810c6a746f8ee15c7 | R | 11,983 | 421 |
.get_available_data_elements <- function(
check_has_estimation_type = FALSE,
check_has_detail_level = FALSE,
check_has_sample_limit = FALSE,
check_has_n_important_features = FALSE,
check_from_prediction_table = FALSE,
check_from_data_object = FALSE
) {
# All data elements.
all_data_elem... |
3ea36b2900ad0b59f2a04a7641b04f464bda052597c7c9e97c54d09f96288709 | R | 12,068 | 351 | #' Import QIIME2 results to \code{TreeSummarizedExperiment}
#'
#' Results exported from QIMME2 can be imported as a
#' \code{TreeSummarizedExperiment} using \code{importQIIME2}. Except for the
#' \code{assay.file}, the other data types, \code{row.file},
#' \code{refseq.file} and \code{tree.file}, are optional, but are ... |
723abab17a0ea6945d3a4d2c5251260db2c45c2c805f3019b3b95ffd7ad2d166 | R | 12,089 | 244 | ##############################################
# Results from linear mixed effects model.
# Updated: 2020.06.02
# Author: Kevin J.
##################################################
## Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
## Load... |
34554e645548fd7beed7645de31518404e298ad85b56b31520a5afa08b03db5f | R | 12,094 | 276 | #' EEGfMRIPav_6_EEG_Behavior_outcomelocked
#'
#' Fit mixed-effects models testing whether trial-by-trial EEG power changes over time
#' and whether effects of behavioral variables interact with time
#' as reported in Supplementary Material S14.
#' Interactive script, run step-by-step, NOT in one Go.
#'
#' Requires t... |
b4a8c026403c61c7c27bcd240394d25f6510288a64a556f9c8138ad62724bac6 | R | 12,117 | 238 | # bulk-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 (chr... |
5e91811595a1401e1de76e7b74fb96f083fff408128377090b9ec71122138551 | R | 12,137 | 317 |
#' Network inference module: Get network connections
#'
#' This function determines learned links between genes in the given network (networkName). These links comprise all incoming and outgoing activator and/or inhibitor links of each individual gene. Also direct gene copy number effects are reported. Only links with... |
19aae518c98d9723face45f36787aa23618a5f44a6144d978017b91d22f8475e | R | 12,163 | 213 | #!/usr/bin/Rscript
library(data.table)
library(dplyr)
library(limma)
library(stringr)
library(ggplot2)
library(tidyr)
library(EnhancedVolcano)
library(biomaRt)
library(edgeR)
library(ggpubr)
library(parallel)
library(tidyverse)
library(reshape2)
library(purrr)
setwd('/home/boris/Documents/PhD/single_sample/')
#######... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.