sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f23937010fc0425fdb62b0c0f313cc50041485475c1558442cd822bded471103 | R | 4,174 | 107 | context(".estimate_dominance")
test_that(".estimate_dominance", {
test_internal_.estimate_dominance <- function(tse){
# Check that every index is calculated by checking the column names from
# colData.
# Check that the order of indices is right / the same as the order
# in the inp... |
b76040c258caf484b005ea898809af9bca3987b596f482a35c28516681681637 | R | 4,235 | 76 | library(shiny)
library(plotly)
shinyUI(pageWithSidebar(
headerPanel("Environmental Enrichment TgDyrk1A analysis"),
sidebarPanel(
# checkboxGroupInput("variablegroups", "Choose groups:","",selected="variablegroups"),
# actionLink("selectall","Select All"),
width=1
# #selectInput("variable",label = h5... |
93ea51a2bf9e57e054579e8d52d9d397a4d5cdee79e6729f4ad563694f859d7f | R | 4,242 | 114 | ################################################
## TWAS/PWAS multiple-testing correction and filtering
## Dr William Reay (2023)
################################################
library(dplyr)
library(data.table)
setwd("~/Desktop/Retinol_GWAS/TWAS_PWAS/")
Raw_df <- fread("NEW_full_coloc_METSIM_INTERVAL_TWAS_bloo... |
81abbc18db435b1a604121ca114d828af7eea3bd74063d5dc97ae4e2e44a0164 | R | 4,244 | 189 | ###################################################################
## MATLAB-like function
###################################################################
#' Return the inverse of a matrix
#'
#'
#' @param A a matrix
#' @return The inverse matrix of A, \eqn{A^{-1}}
#' @noRd
inv <- function(A) {
return(solve(A))
... |
6c1a0bbca39c48e0cbd3a5a3358f12982db8013d55a226628e105b33f5c7068d | R | 4,247 | 131 | #' Calculate quality control metrics
#'
#' These functions calculate simple quality control metrics, such as library
#' sizes, for samples or features.
#'
#' @param x a \code{\link[SummarizedExperiment]{SummarizedExperiment}} object.
#'
#' @param assay.type \code{Character scalar}. Specifies the name of assay
#' used i... |
9f04e1897269a1cfad825c66f48c94372aa7607a0d60b77aee2fc6ce1ad224f2 | R | 4,271 | 88 | ##################################
# Plot the CpG coverage and methylation across Alu and CpG island elements.
# Updated: 2021.05.12
# Author: Kevin J.
###################################
# Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
l... |
8e11dc5a73444ed14aebf6d67f3ba40bbc7cd080d7cc7498bc6da4256445b616 | R | 4,278 | 128 | # X (IV) -> HIV.status
# Y (DV) -> total PHQ-9 score
# M (mediator) -> biomarker 'conc'
# covariates: age and gender
med.df <- data.frame(
label = character(0),
estimate = numeric(0),
ci.min = numeric(0),
ci.max = numeric(0),
p.value = numeric(0),
stringsAsFactors = F
)
semdata <- blooddata
... |
b0f94b29e40430d5f90f9cdeb43813fe240e15e54ff36597cc8fc1ea6acfc0ff | R | 4,279 | 118 | ##########################################
## Retinol GWAS meta - summary statistics QC and harmonisation
## COMMON VARIANTS
## William Reay (2022)
##########################################
setwd("~/data/users/william/Meta_retinol_GWAS/")
library(dplyr)
library(data.table)
## INTERVAL raw - 11132 is max number ... |
f06b59cd97b5aeaba4609a4755ac0112eb4ff59c5c095cca201b0ac26ca5bd26 | R | 4,283 | 92 | ##############################################
# Generate a karyogram for a single-cell example
# Updated: 2020.05.29
# Author: Kevin J.
##################################################
# Working directory for this analysis on Helix.
mybasedir = "/Users/johnsk/mnt/verhaak-lab/scgp/"
datadir = "/Users/johnsk/mnt/ver... |
b6122a6ae04f40b8db623ccd21305d7f9c15059295c7cddbac322f0a231ffd9e | R | 4,284 | 87 | library(DESeq2)
library(stringr)
library(qvalue)
Aligned2 <-'human'
input_path <- paste0('/scratch/users/banwang3/celllines/analysis/ASE_norm/',Aligned2,'/')
endFile <- '_ase_normalized.txt'
output_path_normalized <-paste0('/scratch/users/banwang3/celllines/analysis/ASE_norm/',Aligned2,'/deseq2_normalized_counts/')
out... |
3cebac23ebf931ab4a66d384e0d3ebcb3f9149e54dbd8f02365d01b7bc7270bf | R | 4,285 | 91 | # events selected series preview
output$events_preview = renderPlotly({
# prepare datasets
req(input$events_series, input$events_dataset)
interval.names = c()
dataset = data.table()
for (s in input$events_series) {
.s = data$series[[input$events_dataset]][[s]]
interval.na... |
8e5c9a62f58a336f06bd304229eed9ab12f86019dfc68db69c6a5d4529abc02c | R | 4,288 | 127 | ##################################
## Heterogeneity figures - retinol lead SNPs
## Dr William Reay (2023)
###################################
setwd("~/Desktop/Retinol_GWAS/Manuscript/Nat_comm_resubmission/New_figures_or_analyses/")
library(dplyr)
library(data.table)
library(ggplot2)
## METSIM + INTERVAL
MET_1 <-... |
a997362ee3179d090e72f461150f9538f274429826c5fd3120a9bd93fcb33616 | R | 4,290 | 160 | app.version = "0.9.9"
directories = c(
# the first entry listed here will be the default one, otherwise it will be the working directory
# "name goes here"="c:/R-friendly/path/goes/here"
#"Downloads"="C:\\Users\\matthew.bridge\\Downloads"
)
default = list(
# values to interpret as missing whe... |
0f719ccf76993e3511b27a6ab2b37bea6482c1201daa24f7a8559740598b9065 | R | 4,336 | 94 | ---
title: "Setbp1_MarkersKidney_postSoup_04"
author: "Jordan Whitlock"
date: '2023-04-14'
output: html_document
---
This analysis comes after 'Setbp1_Clustering_postSoup_03.Rmd' and precedes 'Setbp1_CellTypesKidney_postSoup_05.Rmd'
# *Single-nuclei analysis: FindMarkers Kidney*
* Loading libraries
* Selecting resolu... |
a0b6688f61ba1e0bcc7180521fdae10966d2da7a0285fe7d6e0bcb033f8812a5 | R | 4,345 | 112 | #' preprocess_PEs_outcomeLocked.R
#'
#' Load .txt file output from featquery, extract relevant summary statistic,
#' rearrange conditions, save for all subjects in one .csv file.
#'
#' Requires that Run_ROI/run_ROI_PEs_2ndlevel.sh has been run and .txt files
#' are available under e.g. sub-001/GLM1/featquery_GLM2AC... |
78f103b5c6c3d7fe94f99991211ed618289d50f1f6b2c16fc2cef42e05b9533f | R | 4,373 | 126 | familiar:::test_all_vimp_methods_available(
familiar:::.get_available_concordance_vimp_method(show_general = TRUE))
# Don't perform any further tests on CRAN due to running time.
testthat::skip_on_cran()
testthat::skip_on_ci()
familiar:::test_hyperparameter_optimisation(
vimp_methods = familiar:::.get_available_c... |
86a6cbb59dd44fca782b24cc0a15bf5d168b4d9dbd5a5464a15695594e4b79b9 | R | 4,404 | 119 | library("Matrix")
CovReg=function(epsilon, distmat, kernel="exp", n.covariates=NULL, sparse=T, qtl=0.5, maxdist=NULL){
if (is.null(n.covariates)){
n.covariates=0
}
if (!is.null(qtl) & !is.null(maxdist)){ stop("Only one of qtl or maxdist should be specified.")}
if (sparse & is.null(qtl) & is.null (maxdi... |
757ca53d52cb67b670b55c431bf6ea82d0917c10a9d820b33d6b18c1c2a4ea9e | R | 4,407 | 172 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# show (familiarData) ----------------------------------------------------------
setMethod(
"show",
signature(object = "familiarData"),
function(object) {
# Make sure the data object is updated.
object <- update_object(object = o... |
31d3e928692450838d37fc2463c14372acb56bdac52b1975956573470d0719e1 | R | 4,420 | 90 | # Perform linear regression to examine the association between functional connectivity measure and handgrip strength
# Inputs to the script:
# 1) demofile: name and path of spreadsheet containing demographic, cognition and handgrip strength data
# 2) FCfile: name and path of spreadsheet containing functional connectiv... |
fd52aaac49fb9964bf108053b529bccc5490e19dbdd281175cf34bed515d3cb5 | R | 4,424 | 126 | ################# SUMMARISE DEMOGRAPHICS BY HIV STATUS FOR ALL PARTICIPANTS INCLUDED IN MRI ANALYSES
mridemo <- mridata[1]
mridemo <- unique(mridemo)
mridemo <- merge(mridemo, demodata, by = 'PID', all.x = T, all.y = F)
mridemo <- mridemo %>%
dplyr::select(PID, HIV.status,
age, gender, ethnicity... |
d431cd3254d0d27372623f75c16b58fd791b0f09706190b1f02ddfbc3a2a494c | R | 4,442 | 101 | library(DESeq2)
library(stringr)
library(ggplot2)
Aligned2='human'
all_files = list.files(paste0('/scratch/users/banwang3/celllines/analysis/ASE_norm/',Aligned2,'/'))
sub_files = all_files[grep('_ase_normalized.txt', all_files)]
#sub_files=sub_files[-grep(cell_type,sub_files)]
input_path <- paste0('/scratch/users/banwa... |
7022827518325817adeace9eb4509ca1b4f6e331cf83fa9d8cbfbccbfd6b841c | R | 4,449 | 117 | #############################
## TwinsUK retinol data QC
## Dr William Reay (2023)
#########################
library(data.table)
library(dplyr)
library(tidyr)
library(ggplot2)
library(haven)
library(readxl)
library(table1)
library(reshape2)
library(cowplot)
library(gridExtra)
setwd("~/Desktop/Retinol_GWAS/TwinsUK... |
4894df8e17d0ac58cc893a8a78b73234db9dd28ab6f57f64d3b34c2a41385e74 | R | 4,469 | 92 | ---
title: "Setbp1_targets"
output: html_document
date: '2023-02-16'
---
* Obtained gene list of targets from msigdb SETBP1 target list (https://www.gsea-msigdb.org/gsea/msigdb/human/download_geneset.jsp?geneSetName=SETBP1_TARGET_GENES&fileType=TSV). The target list stored in cheaha at '221018_Setbp1_msigdb_targets.cs... |
625da66c90bd10636d98ea449b32122a41f0a0934cfaa9597c64c18027b4a71b | R | 4,475 | 78 | ## Load results from SEM
plotdata <- read.csv("Results/Results - MRS Mediation All Parameters.csv")
plotdata <- plotdata %>%
mutate(sig = ifelse(p.fdr<0.05, "Significant", "Non-Significant"))
plotdata$parameter <- as.factor(plotdata$parameter)
## Subset for relevant parameters and re-code facet levels
plotdat... |
565aad60e7ba86dedb9911f0c8cac4ec910586f2348e1323ae95a325398e8d83 | R | 4,496 | 87 | ##################################
# Generate boxplots for tiled 10kb DNA methylation.
# Updated: 2021.05.12
# Author: Kevin J.
###################################
# Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
library(tidyverse)
library... |
8a701c846ac10e744a066baa6f9cfeaf6c5333d0b3d3a65bd7c73ce8215c6f82 | R | 4,496 | 93 | library("stringr")
library('ggplot2')
library(epitools)
align2 <-'human'
backup_path='/scratch/users/banwang3/celllines/data_backup'
input_path=paste0(backup_path,'/scratch/users/banwang3/celllines/analysis/ASE_norm/',align2,'/filtered/')
tpm<-read.csv(paste0(input_path,'TPM.txt'),sep='\t')
output_path='/scratch/users/... |
5e61f26efa157a3eb2eabe5d66e2f72bcb29e63249df02b46ade93c0c7704f1d | R | 4,500 | 162 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
setClass(
"familiarConcordanceVimp",
contains = "familiarVimpMethod"
)
.get_available_concordance_vimp_method <- function(show_general = TRUE) {
return("concordance")
}
# is_available -------------------------------------------------------... |
a84837cee483e6664e7b8ec9c9c8c42b90d385efa1d17f5d0796fbdb324a4ccd | R | 4,501 | 150 | ---
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... |
d194b70a6e88effad7844908fb615788be23aa90c5a13ffb313be46f4de82c8f | R | 4,514 | 90 | #' get_contigs
#'
#' JAMSalpha function
#' @export
get_contigs <- function(opt = NULL){
setwd(opt$workdir)
#Set working kraken db path for increased speed.
#if (opt$workdir != opt$sampledir){
# dir.create("krakendb", showWarnings = FALSE, recursive = FALSE)
# flog.info("Copying krakendb to t... |
a006c11e5e9fc0b6c99dcfff7e7028b4e01e0492c76f9de75588d9bb2f0535f5 | R | 4,517 | 178 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
setClass("familiarHyperparameterLearnerRanger",
contains = "familiarHyperparameterLearner"
)
# initialize -------------------------------------------------------------------
setMethod(
"initialize",
signature(.Object = "familiarHyperparameterLe... |
9fc3fdc2af29a28b293d4a8fecb9e23bab1c40f58ccbf3e6183a8e19a1979bd8 | R | 4,575 | 109 | # Gina Norato; gina.norato@nih.gov
rm(list=ls())
library(plyr)
library(tidyverse)
library(lme4)
library(lmerTest)
library(multcomp)
library(dplyr)
library(tidyr) # separate()
library(stringr) # str_pad()
library(ggplot2)
##### Supplemental Figure 4 #####
dat<-read.csv(file="source.data.supp.fig.4.csv"... |
e77be2ee0b5a93aa13aa6fac557bed160944469084608f08065b4812b526b6e6 | R | 4,577 | 155 | # Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
familiar:::test_plots(
plot_function = familiar::plot_shap_summary,
data_element = "shap",
shap_max_iterations = 10L,
outcome_type_available = c("continuous... |
68c453f0b2aa1efd42ff1a8f2981909c28bec7e24224acc7b12791313f498f66 | R | 4,592 | 109 | #############################
## PGS tuning comparison - RapidoPGS via finemapping
## Mixed-model with family level random intercepts and modelling increased correlation of MZ vs DZ twins
## Dr William Reay (2023)
#############################
library(dplyr)
library(data.table)
library(ggplot2)
library(lmvar)
libr... |
f0b53b9aad70197753e83a9821ffb3c16439990bf851be1c04259257c6fba904 | R | 4,594 | 158 | context("addCluster")
test_that("addCluster", {
library(bluster)
data(GlobalPatterns, package = "mia")
# Parameters validity check
expect_error(addCluster(GlobalPatterns,
KmeansParam(centers = 3),
assay.type = "error"
))
# Checking wrong by (char)
expect_error(addCluster(Glo... |
1db623af97d2226a4d25e2c0feeaefc76403549769dc631c05cf6cd2aa31c602 | R | 4,597 | 100 | ---
title: "Setbp1_MarkersKidney_04"
author: "Jordan Whitlock"
date: '2022-09-07'
output:
html_document:
toc: true
toc_depth: 2
toc_float: true
---
This analysis comes after 'Setbp1_Clustering_03.Rmd' and precedes 'Setbp1_CellTypesKidney_SoupX_01.Rmd'
# *Single-nuclei analysis: FindMarkers Ki... |
47daddeb91078561187955a087fc6aa8da770287b5cb88a6ffe8d0af39810050 | R | 4,621 | 94 | ###############################################################################################
############## ABCD: test the associations between brain CVs and cognition ####################
###############################################################################################
############ read the informati... |
87a0e8510718c4e1196145387edd4830d64760ef405fe02de1f950bac2e9be1e | R | 4,658 | 146 | library("muxViz")
library(igraph)
library(RColorBrewer)
library(viridis)
library(tictoc)
set.seed(1)
#Network setup
Layers <- 3
Nodes <- 100
layerCouplingStrength <- 0.1
networkOfLayersType <- "categorical"
isDirected <- F
colors <- brewer.pal(8, "Set2")
cat("####################################\n")
cat("# Multipl... |
dd8317487784e2b9d4fa493b88bd8c2363b5cb7ef6e28c028368a849e9f5af23 | R | 4,686 | 167 | # test_create_vimp_method (data.table) -----------------------------------------
setMethod(
"test_create_vimp_method",
signature(data = "data.table"),
function(
data,
vimp_method,
vimp_method_parameter_list = list(),
...
) {
# Convert data to dataObject.
data <- do.call(
as_data_... |
804e8f10c98c9b2ae40e93eea19dafb74f0562e7d4fa002e65b99223a5ff7c3c | R | 4,693 | 115 | # ymat : A V times N matrix (V: # of vertices, N: # of images)
# distmat : A V times V distance matrix
# cortex : A vector of vertex indices that will be included.
# : It is needed if your ymat and distmat contained medial walls that should not be included.
# : Default: NULL (a... |
79dfd82435fb2f066f8ea5934f23f0b9704f1fc493777bd6a4d6ee3ee83f8b58 | R | 4,696 | 84 | library(stringr)
library(ggplot2)
library(dplyr)
celltypes=c('CM','MN','HP','PP','SKM')
reffed='humreffed'
align2='human'
output_path='/scratch/users/banwang3/celllines/scripts/RScripts/Rplots/'
backup_path='/scratch/users/banwang3/celllines/data_backup'
df = read.csv('/scratch/users/banwang3/celllines/scripts/RScripts... |
4de8079a4b3357f17d605d76eb94fe7750a4edb0d09ad71417d044fe03342bd6 | R | 4,700 | 146 | library("muxViz")
#This dataset is provided with the "standalone" library
config.file <- "data/StarWars/StarWars_config.txt"
#This flag is important to understand if input networks are directed or not
isDirected <- F
#This flag is important to understand if input networks are weighted or not
isWeighted <- T
#Network ... |
556a8732f977fc25cec87e815496a48d1f61822d2f043a77994f953a35eb1f63 | R | 4,702 | 164 | # First test if all selectable learners are also available
familiar:::test_all_learners_available(
learners = familiar:::.get_available_knn_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:::t... |
ea620bd499da2bb8af04a012f3be29c6343787d92056aecf1478e11de51c8764 | R | 4,705 | 106 | #' Constrains a functional (non-taxonomic) JAMS-style SummarizedExperiment object which has feature-by-taxon stratification information (see JAMSbeta -u option) into a SummarizedExperiment object with BaseCounts and GeneCounts only pertaining to the wanted LKTs.
#' @param SEobj a functional (non-taxonomic) JAMS-style ... |
1a18e61bfb538c8aee4bb0189f251980d7ddbab97d69d3813f8eac7b712de218 | R | 4,727 | 165 |
rm(list = ls())
#################### Prepare ######################
source('Setup.R')
usedir = dirname(getwd())
figDir = file.path(usedir,'Figs')
source('Func_Simu.R')
my_colors <- brewer.pal(9, "GnBu")[4:8]
xlab = c("-1"=expression(rev[-1]),
"0"="rev",
"1"=expression(rev[+1]),
"2"=expre... |
3aeb21a4eb6835373a30bebb7fe7a26e853ae51fef8269883f97441a4eec6b83 | R | 4,740 | 171 | ## ---- libs --------
library(ggplot2)
library(tidyr)
library(dplyr)
library(cowplot)
library(purrr)
library(RColorBrewer)
library(knitr)
library(kableExtra)
library(janitor)
library(ggExtra)
library(stringr)
library(rjson)
library(broom)
library(plotly)
library(ggsci)
library(tidymodels)
library(shadowtext)
library(ef... |
761fe22bafb6d10407f15358e1f3b750fe3e5b3b3400f39014f3c300082f95de | R | 4,772 | 112 | library(ggplot2)
library(patchwork)
library(stringr)
library(ggpubr)
library(rstatix)
input_path='/scratch/users/banwang3/celllines/scripts/RScripts/figscripts/suppfigscripts/alexdata/interneurons/'
output_path='/scratch/users/banwang3/celllines/scripts/RScripts/Rplots/'
alldf =read.csv(paste0(input_path,'All_Interneur... |
b98b706523e2af2481168402b52d5d28dece28cb4cf85a11ac44df2faaa0c833 | R | 4,785 | 134 | familiar:::test_all_metrics_available(metrics = familiar:::.get_available_brier_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(metrics = familiar... |
7397580a59b61e374c7ba8ca1b49e4d5ea383f3740f39655f1df97ca41013d70 | R | 4,809 | 163 | ########################################
## FOXP2 overexpression in U2OS (Sacroma)
## William Reay (2023)
########################################
library(edgeR)
library(data.table)
library(dplyr)
library(tidyverse)
setwd("~/Desktop/Retinol_GWAS/Gene_priortisation/FOXP2_differential_expression/")
DF <- fread("GSE... |
608c86c2246b7ec3cd37751836dd8002fcce1d7878d0c23dc89c90f9fdabe70c | R | 4,823 | 144 | #' @name
#' utilization_functions
#'
#' @title
#' Utilization functions for \code{TreeSummarizedExperiment} objects
#'
#' @description
#' A set of utility functions designed to facilitate operations with
#' \code{TreeSummarizedExperiment} objects
#'
#' @details
#' \code{getReducedDimAttribute} is a utility function tha... |
cc469162608725f4d597ee35ead7ba3fbb2051a37a9a1b0392a744c3780e1d6f | R | 4,834 | 102 | ---
title: "Setbp1_MarkersCortex_04"
author: "Jordan Whitlock"
date: '2022-09-07'
output:
html_document:
toc: true
toc_depth: 2
toc_float: true
---
This analysis comes after 'Setbp1_Clustering_03.Rmd' and precedes 'Setbp1_CellTypesCortex_05.Rmd'
# *Single-nuclei analysis: FindMarkers Cerebral ... |
c646236ae591e9fd85056eb083b039a78b91d9f31bd6e0819da63f5fd2258754 | R | 4,846 | 145 | require(ggplot2)
require(tidyr)
require(dplyr)
require(RColorBrewer)
require(ggExtra)
require(stringr)
require(ggimage)
require(ggpubr)
require(geomnet)
require(ggrepel)
plot_brainNetMeans <- function(allTransitions,
k,
scale_fct,
ttl,
... |
98f56dc115d2176ae71b6ae54b732512dce1e7739b99348e2825ebb6f5e39173 | R | 4,872 | 147 | ################# SUMMARISE MEAN (SD) BIOMARKER CONCENTRATIONS BY HIV STATUS
summarydata <- mridata_long %>%
group_by(biomarker, region, referencing, HIV.status) %>%
summarise(n = length(PID),
mean = mean(conc),
sd = sd(conc))
write.csv(summarydata, "Results/Results - MRS Biomarker... |
7610cee32a7713b9ae0d0013583ce18ffec484af15f691d8dcb35496888525e3 | R | 4,904 | 104 | output$heatmap_plot = renderPlotly({
req(input$heatmap_dataset, input$heatmap_series)
.heatmap$plot_object = NULL
dataset = data.table()
aucs = data.table()
for (s in input$heatmap_series) {
.s = data$series[[input$heatmap_dataset]][[s]]
for (e in 1:length(data$events[... |
d71332a54e91ec4579ab81f20c9f1fb34a28aa491ebafcfaa5b2e69910b99de0 | R | 4,921 | 139 | familiar:::test_all_metrics_available(metrics = familiar:::.get_available_auc_roc_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(
metrics = fam... |
aa7a1f5f93bf77defc4215276acb9acc88ce496d81000e3b90bbc6f69ec1368a | R | 4,934 | 177 | # Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
# Test alignment of different plots, with missing data.
familiar:::test_plot_ordering(
plot_function = familiar:::plot_ice,
data_element = "ice_data",
outcome... |
bc26c6d9b94ec54bb599c526368c9ca7f5909352462118b09fd37288de4db6db | R | 4,953 | 143 | #############################
## Automated MR of all retinol IVs
## Adapted from script by Dr Dylan Kiltschewskij (2022)
## William Reay (2023)
#############################
## Load dependencies
suppressMessages(library(data.table))
suppressMessages(library(tidyr))
suppressMessages(library(dplyr))
suppressMessages(l... |
da15ccfa00ec06116691a5d2d29d3b338d70425f8504a6cc7252cb545b1b004e | R | 4,955 | 137 |
rm(list = ls())
source('Setup.R')
usedir = dirname(getwd())
figDir = file.path(usedir,'Figs')
df_motions = read.xlsx(file.path(usedir,'SourceData.xlsx'),'SFig4')
# load similarly reorganized data from global connectedness
GC_SubsTMS = read.xlsx(file.path(usedir,'SourceData.xlsx'),'GC_SubsTMS')
#####################... |
b64e05edbca839581cfc0ac83de9ced81756d00eb0671a1f272bc42350be9897 | R | 4,963 | 103 | ##################################
# Stacked barplots for stress scRNAseq with Neftel classification
# Updated: 2021.05.12
# Author: Kevin J.
###################################
## Project working directory
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
library(tidyverse)
##... |
ae7b5a08d8a6e522cefd10f18c4daf5b08967b7975ada1c7461a64fdbd0ce172 | R | 4,975 | 130 | ################################################
## TWAS/PWAS multiple-testing correction and filtering
## Dr William Reay (2023)
################################################
library(dplyr)
library(data.table)
setwd("~/Desktop/Retinol_GWAS/TWAS_PWAS/")
Raw_df <- fread("NEW_full_coloc_METSIM_INTERVAL_TWAS_bloo... |
01c538f351532efe7e13c5c6073bfda6b303e8451cb7896f3125f7cfbe8a70d9 | R | 4,980 | 157 | library("muxViz")
library(reshape2)
library(RColorBrewer)
#Or build by specifying layers
Layers <- 5
Nodes <- 100
NodeTensor <- list()
NodeTensor.cmI <- list()
NodeTensor.cmII <- list()
g.list <- list()
#Create 5 correlated layers
g.list[[1]] <- igraph::barabasi.game(Nodes, m = 1, directed = F)
#generate a second la... |
cd9e27648e635582b8a2da80073ace2ed31ed3216f3bfd2356ebe4bd96a8fd34 | R | 4,991 | 179 | library(muxViz)
library(igraph)
library(RColorBrewer)
library(viridis)
library(tictoc)
library(tidyverse)
set.seed(1)
#Network setup
Layers <- 3
Nodes <- 100
layerCouplingStrength <- 0.1
networkOfLayersType <- "categorical"
isDirected <- F
colors <- brewer.pal(8, "Set2")
cat("####################################\n... |
d2e9ea10d8708f7acd0ded4552fbb6918d14e06b535666c9819757df49c4a4e4 | R | 5,030 | 120 | ####################################################################################
################### Greneration R: qualitative repplication ########################
####################################################################################
# This is the total sample of generaiton R
# we ran the whole ana... |
3f596f3181163daeb0ccadc2ee9a02db2ebe81ce5da69b2888c020e3f8cff434 | R | 5,034 | 108 | # PID of current job: 3380544
mSet<-InitDataObjects("conc", "msetqea", FALSE)
mSet<-Read.TextData(mSet, "Replacing_with_your_file_path", "colu", "disc");
mSet<-SanityCheckData(mSet)
mSet<-ReplaceMin(mSet);
mSet<-CrossReferencing(mSet, "name");
mSet<-CreateMappingResultTable(mSet)
mSet<-PerformDetailMatch(mSet, "3-Hydro... |
e9b05feb94252b8dd79fbd04be4f07b7afa4f9d96e742d47a45eb0b3ba43f36a | R | 5,044 | 164 | ################# SUMMARISE MEAN (SD) BIOMARKER CONCENTRATIONS BY HIV STATUS
data <- gather(data = blooddata,
key = biomarker,
value = conc,
BDNF:YKL40,
factor_key = T)
data <- na.omit(data)
summarydata <- data %>... |
b2baabffbaaac38163d3f90e86827e160e2db700feb2a6752903a8801e12ba20 | R | 5,051 | 188 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
setClass("familiarHyperparameterLearnerLAGP",
contains = "familiarHyperparameterLearner",
slots = list("encoding_reference_table" = "ANY"),
prototype = list("encoding_reference_table" = NULL)
)
# initialize -------------------------------------... |
d096eb0cf21a685dbfafbccfd6bf9a395828064ab5935b384df3d50edb3b04df | R | 5,052 | 165 | testthat::skip("Testing object updates should be done manually.")
# List files in tests/old_experiments.
archive_files <- list.files(
path = "./tests/old_experiments",
pattern = ".zip",
full.names = TRUE)
# Set path to the directory where the archive should be unpacked.
archive_directory <- file.path(".", "test... |
8bd197c6c8caab755227e5b1ed02c59f7421341902bcaead735c426149db8927 | R | 5,056 | 147 | # Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
# Generic test
familiar:::test_plots(
plot_function = familiar:::plot_feature_similarity,
not_available_single_feature = TRUE,
not_available_single_sample = T... |
a547a17893e245301954a440b8dd2720e82fcd2913bb7b56e8ffceebee1c1688 | R | 5,082 | 182 | #############################################################
############# (NON)LINEAR TIME SERIES MODELS ################
#############################################################
#######################################################
#### Data Generating Processes (DGP) Functions
## SETAR(1) function generat... |
a0b106dc2cd8f5cbf22ee08c2b2a7f89cac8ca2081fb37f962541f842e6f18fb | R | 5,129 | 165 | #' @name
#' filterRPCAInput
#'
#' @title
#' Filter raw count assays before RPCA or Joint-RPCA
#'
#' @description
#' \code{filterRPCAInput()} applies Gemelli-style preprocessing filters to raw
#' count assays before robust centered log-ratio transformation and RPCA.
#'
#' The filters are intended for raw count data, not... |
15c498b4dfb0b151fe9c22a09a5869606762080d2e3370e976404a885384db8a | R | 5,132 | 109 | ##################################
# Visualize the dimensionality reduction on all 10X cells
# Updated: 2020.05.13
# Author: Kevin J.
###################################
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
# Necessary packages:
library(tidyverse)
library(Seurat)
li... |
35673f0195d990485689e21c845b8ab1d60e028bc1a31dcd47fbbb9ef46fe36d | R | 5,136 | 112 | ---
title: "02_MouseSetbp1_decoupleR_expression"
author: "Jordan Whitlock"
date: '2023-05-12'
output: html_document
---
```{r}
set.seed(2178)
library(lintr)
library(styler)
library(here)
ptm <- proc.time()
```
```{r}
load(here("data/kidney_integrated_celltypes_postSoup.Rdata"))
load(here("data/setbp1_cerebralintcellt... |
40153a879f0803a0af55c6099d9cae473143d03c3322ada3b1429c6daac6d518 | R | 5,140 | 116 | library(ggplot2)
library(patchwork)
library(stringr)
library(dplyr)
# Which genes you want to plot?
target_genes=c('NTF3','NTRK1','NTRK3','SCN1B','SCN2B','SYT2','NR1H3')
#TPM plot with hyb label
pboxplot<-function(sampleTPM,gene){
p<-ggplot(data=sampleTPM,aes(x=celltype,y=TPM))+
geom_boxplot(outl... |
e9b39818485f9be432b9f7bf76480dacec4ae9c85bee709bab7766a9d16b662c | R | 5,154 | 192 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
setClass("familiarMBoost", contains = "familiarModel")
setClass(
"familiarMBoostLM",
contains = "familiarMBoost",
slots = list(
"encoding_reference_table" = "ANY",
"feature_order" = "character"
),
prototype = list(
"encoding_r... |
d98108386441183606935197d6d8a4b69f1ef02907acf086120736863acfc6b6 | R | 5,161 | 86 | #Prepare pheno object for metagenomeSeq package
#' adjust_phenotable(opt = NULL, list.data = NULL, addtaxlevelstoisolates = NULL)
#'
#' Adjusts the metadata table into a format which can be used by the MetagenomeSeq package.
#' @export
adjust_phenotable <- function(opt = NULL, list.data = NULL, addtaxlevelstoisolates ... |
9745895e60d284b3eab34c70d97aa4e210d6c4599f57d8564e03dbdc4c005c9e | R | 5,166 | 194 | library(lmerTest)
library(psych)
reci_pre_data<-read.table("Brain_predictions_for_E2_and_PCare.txt",header=T)
para_data = read.table("Params_Neural_Utility_Model.txt",header=T)
### Generate predictions of Neural utility model ###
subjects = unique(para_data$Subject)
for (nsub in 1:length(subjects)){
sub = subjec... |
e8c6889d4bf9947b005a6355f11b25b35982fde6b41ccc2a6f45cff896786962 | R | 5,171 | 100 | library(DESeq2)
library(stringr)
library(qvalue)
Aligned2 <-'chimp'
backup_path<-'/scratch/users/banwang3/celllines/data_backup/'
input_path <- paste0(backup_path,'/scratch/users/banwang3/celllines/analysis/ASE_norm/',Aligned2,'/filtered/')
endFile <- '_ase_normalized.txt'
output_path<-paste0('/scratch/users/banwang3/c... |
ca68fc0707e2d2e9ad5adf3528563beca05435f4a44c226cc5bed04d682686ec | R | 5,179 | 107 | # Perform mediation analyses to examine the mediation effect of functional connectivity on the handgrip strength-cognition association
# In these models, functional connectivity is the mediator, handgrip strength is the predictor/independent variable and cognition is the dependent variable
# The "lavaan" package is re... |
727cbe57e81fa6a5bfe41bb3e92baef563066b8cd107edf26c745363dc8d768b | R | 5,183 | 208 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# familiarMetricConcordanceIndex -----------------------------------------------
setClass(
"familiarMetricConcordanceIndex",
contains = "familiarMetric",
slots = list("time" = "numeric"),
prototype = list("time" = Inf)
)
# Harrell's Con... |
1b471ad2c39863fae0df4fa1dcacbe2bf67af3b3d6869efdde6f427de1b7792c | R | 5,194 | 186 | # Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
results_fun <- function(t, x, model) {
predictions <- familiar::predict(
object = model,
newdata = x,
type = "survival_probability",
time = t
)
return(predictio... |
ace74bcf61be50eeeb479ba7f5d888d2117263c0593bd057b6c83aae096e20c1 | R | 5,201 | 163 | familiar:::test_all_vimp_methods_available(
familiar:::.get_available_univariate_regression_vimp_methods(show_general = TRUE)
)
familiar:::test_all_vimp_methods_available(
familiar:::.get_available_multivariate_regression_vimp_methods(show_general = TRUE)
)
# Don't perform any further tests on CRAN due to time of ... |
eb903a996b8d7b617811655e643a6142980a1322523f89b86d76331104c76645 | R | 5,209 | 178 | # Don't perform any further tests on CRAN due to time of running the complete
# test.
testthat::skip_on_cran()
testthat::skip_on_ci()
debug_flag <- FALSE
familiar:::test_plots(
plot_function = familiar:::plot_calibration_data,
data_element = "calibration_data",
not_available_all_prospective = TRUE,
not_availa... |
1b4a9b5066519c6dbf8fbcaf70862b8b9573a8620f5304b5e7b80dcf96b64822 | R | 5,214 | 79 | #' calculate_contig_depth_by_length
#'
#' JAMSalpha function
#' @export
calculate_contig_depth_by_length <- function(contigsdata = opt$contigsdata, featuredata = opt$featuredata, max_length_thresh = 2000){
contigsdata <- contigsdata[order(contigsdata$Length), ]
totlength <- sum(contigsdata$Length)
totbase... |
f764bd804f0cb69ab0a044ea2770dfb7cf7c5a1ef46c78bf45a1dd6111a21b52 | R | 5,215 | 114 | #####################################################################
############## ABCD: grid search, sparse CCA, bootstrapping #########
#####################################################################
########## load all the packages
packages <- c('psych','doParallel','permute','reshape2','PMA','caret','corr... |
642bd48d146c39fea5b7771dbc4d5063b8e268402a7687548e8bfe1581c2fe05 | R | 5,234 | 97 | #' build_compact_mag_profiles(MAGs_to_profile = NULL, list.data = NULL, normalize_length = FALSE)
#'
#' PRE-REDUCTION PASS (the memory fix). Makes ONE streaming pass over the samples referenced
#' in MAGs_to_profile, reading each sample's featuredata exactly once on the master process,
#' and emits a single COMPACT lon... |
b9ebc9f94ef2a48b32a68c4d1b8a363b5bc75017dc1353f4fae4ac73b7e16557 | R | 5,261 | 160 |
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", "starmap_e... |
54deb44683bf64b0e94e48469d87351b96b31de233ee7537913572d75598e62c | R | 5,282 | 115 | ##################################
# Visualize specific features for tumor SM012.
# Updated: 2021.05.07
# Author: Kevin J.
###################################
## Working directory for this analysis.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
###################################
# Necessary packages:
library(... |
70aa1ca14d3d1413d77389596ae12489b06d67fb99230fe10cb8d90f62cdffe5 | R | 5,290 | 119 | #' filter_host
#'
#' JAMSalpha function
#' @export
filter_host <- function(opt = NULL){
if (opt$host != "none"){
#Check if reads are in tmpdir
if (opt$workdir != opt$sampledir){
readsworkdir <- file.path(opt$workdir, "reads")
} else {
readsworkdir <- opt$readsdir
... |
6a38bd11516ad6531c9de71ddc8417d3ba72e69d9a2b0b8c5a4d7985a36ce6b1 | R | 5,306 | 100 | #' blast_databases
#'
#' JAMSalpha function
#' @export
blast_databases <- function(opt = NULL, blastanalyses = NULL, QcovThreshold = 75, HitcovThreshold = 75, PidentThreshold = 75){
#Set working directory to workdir
setwd(opt$workdir)
#Write predicted proteome to serve as query.
flog.info("Writing pr... |
e2924059e4aa783f705dadee2aab4f1aa94b4eb32f98172d4d319f509eba1c23 | R | 5,309 | 103 | ---
title: "profiling failed repair in kidney"
author: "Jordan Whitlock"
date: '2023-06-13'
output: html_document
---
Goal #1: Investigate expression of failed repair markers in kindey injury in snRNA-seq celltypes of S858R and WT.
```{r}
set.seed(2178)
library(Seurat)
library(here)
library(styler)
library(lintr)
li... |
6c8cb6c7d5e2b25cb1b49e611cd732008d033e7390a2ffb70fc0149fd2013446 | R | 5,310 | 204 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# create_instance_weights (dataObject) -----------------------------------------
setMethod(
"create_instance_weights",
signature(data = "dataObject"),
function(data, method, outcome_type = NULL, ...) {
if (is.null(outcome_type)) outc... |
5a36a1bb2f4d545a72de95767f5bc397385bf44e9cd24c3f01ea39cb32f2aeb5 | R | 5,314 | 151 | ################################
## Creatinine to retinol
## Additional sensitivity analyses
## Dr William Reay (2023)
################################
library(TwoSampleMR)
library(dplyr)
library(ieugwasr)
library(data.table)
library(ggplot2)
library(MendelianRandomization)
library(MVMR)
## Penalised and robust e... |
89a8473e16439f3459dabfd462eb4aa6a73306af64a42e3a905d1730b0e2aa30 | R | 5,356 | 114 | # Validation: Perform linear regression to examine the association between functional connectivity and cognition, additionally controlling for various nuisance covariates
# Inputs to the script:
# 1) demofile: name and path of spreadsheet containing demographic, cognition and handgrip strength data
# 2) FCfile: name a... |
3ac15616dcdc40564c28027cce96619b04bfdc14ccaaf7fd5a95d1690104bb85 | R | 5,361 | 143 | # power.transform and other packages are required for testing settings.
if (!rlang::is_installed("power.transform")) testthat::skip()
# sample_limit -----------------------------------------------------------------
testthat::test_that(
"sample_limit is correctly parsed",
{
# Unset by default
settings <- f... |
609aad1b2cc4a3a3b116ff55d1a388fc52777b466fb9386594b7e3f5f7fa4be7 | R | 5,378 | 146 | #' countfastq(fastqfile)
#' Wrapper for counting number of reads and number of bases of a fastq file in the system.
#' Returns a vector with read counts and base counts.
#' @export
countfastq <- function(fastqfile){
countargs <- c("size", fastqfile)
fastqstats <- system2('seqtk', args = countargs, stdout = TRU... |
614faf065299c0daa090d111e1b84cb5766292111881c74a4ae533f3d1612b34 | R | 5,378 | 99 | ##############################################
# Analysis of epimutation at different replication times
# Updated: 2020.06.01
# Author: Kevin J.
###############################################
# Working directory for this analysis in the SCGP project.
mybasedir = "/Users/johnsk/github/"
setwd(mybasedir)
############... |
3305de5d6bfa3465dd0581fc607e06c4e6ebef0ba1c9a0cf17ec846c1eef0ba4 | R | 5,411 | 208 | #' @include FamiliarS4Generics.R
#' @include FamiliarS4Classes.R
NULL
# test_train (generic) ---------------------------------------------------------
setGeneric(
"test_train",
function(data, ...) standardGeneric("test_train")
)
# test_train (data.table) ------------------------------------------------------
... |
8f566c730f5843c813b8a8bd07a3887a68f2a34731a69098fa2a3ab010cfa7ab | R | 5,415 | 135 | context("divergence estimates")
test_that("divergence estimates", {
skip_if_not(requireNamespace("vegan", quietly = TRUE))
data(esophagus, package="mia")
tse <- esophagus
tse_divergence <- addDivergence(tse)
# Checks that the type of output is the same as the type of input.
expect_true(typeof(tse_diverg... |
3cd795196d64b02d79c39a1b9b2df3feb32673d7268a954fe63cdfab3062cbc1 | R | 5,423 | 120 | ---
title: "03_Mouse_PANDA_ppi"
output: html_document
date: '2022-11-15'
---
# Overview:
* Generating PPI Input:
* STRING:
* The NetZoo package has a nice [wrapper function](https://netzoo.github.io/netZooR/reference/source.PPI.html), however, one cannot change the filtering threshold using the package.
* T... |
05f3ee18c36125c887653c09d306a2561f1dbdf83a70dfac1cc1e6275b56539b | R | 5,436 | 178 | .set_recalibration <- function(
object,
data,
time = NULL,
...
) {
# Suppress NOTES due to non-standard evaluation in data.table
outcome <- predicted_outcome <- NULL
# Initial empty calibration list
calibration_model_list <- list()
# Predict the outcome using the current model.
model_... |
5cc7e442172f983da290cde2f26f1363520b03dc37cb17b596a0b9b273491344 | R | 5,463 | 145 | semdata <- mridata
## Scale all biomarkers, age, and total PHQ-9 score
semdata[2:13] <- apply(semdata[2:13], 2, scale)
semdata$age <- as.numeric(scale(semdata$age))
semdata$total <- as.numeric(scale(semdata$total))
semdata$diff <- as.numeric(scale(semdata$diff))
###################### WATER REFERENCING
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.