sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
7d1bfcd364cbdd23308ab7e7182695aacccb423a3552f240826a32e3db054159
Quarto
20,364
574
Perform DEG analysis using WM score as a covariate ```{r setup} rm(list=ls()) library(limma) library(ggplot2) library(VennDiagram) outDir <- "/home/zhijiany/workdir/2026/0402_AD_PaperReviews/out/3.DEG_w_covariate" dir.create(outDir, recursive = TRUE, showWarnings = FALSE) dataDir <- "/home/zhijiany/workdir/2026/040...
6201c2fb4cfd9deef328f1e117f12fded430fd310d6bf9446da3d191d84dd1f7
Quarto
20,635
743
--- title: "Fig-2D: T4 Window - Tail Regression" author: "Andrea Mariossi" format: html: embed-resources: true toc: true toc-location: left toc-depth: 5 code-fold: false code-line-numbers: true page-layout: article grid: sidebar-width: 100px body-width: 2000px margin-...
7ef3c5011b54222254019982a6a1426cc6647b91708ac82305fa6290404b35b6
Quarto
21,587
502
--- title: "PPRT Survival Analysis" description: "To evaluate if there is a significant difference in **overall** survival between the PPRT intervention and control group" date: last-modified date-format: "[Last Updated:] MMM DD, YYYY" format: html: self-contained: true title-block-banner: true title-bl...
4e681daa8cfcf026442227ae3774d65db733770e3fef57e94bf0fef1a030931a
Quarto
22,626
731
--- title: "Endodermal strand experiments" author: "Andrea Mariossi" format: html: code-fold: false embed-resources: true engine: knitr editor: visual grid: sidebar-width: 100px body-width: 2000px margin-width: 100px gutter-width: 3.5rem execute: fig-align: center fig-format: png editor_options...
ec8955bbdfc7d13a81e9141fe93f934c4665f263bebdefaa43a9ad960d125c10
Quarto
23,083
746
--- title: "Fig-S5H_thr_RT-qPCR_nkx2.1-KD" author: "Andrea Mariossi" format: html: embed-resources: true toc: true toc-location: left toc-depth: 5 code-fold: false code-line-numbers: true page-layout: article grid: sidebar-width: 100px body-width: 2000px margin-width...
e06f98d83b0626df091f4f2122a23c82e1a33dfd24f5bc4350dfaac787a54c3b
Quarto
25,315
812
--- title: "Fig-2BC_tail regression- T4 & T3" author: "Andrea Mariossi" format: html: embed-resources: true toc: true toc-location: left toc-depth: 5 code-fold: false code-line-numbers: true page-layout: article grid: sidebar-width: 100px body-width: 2000px margin-wi...
31d23d96a1cd4ffb9a61eaa0670f1fa0b1e15ec201f7b9ee59b5630b9965b6d8
Quarto
27,388
843
--- title: "Fig-4D_rescueExp_photoreceptor" author: "Andrea Mariossi" format: html: embed-resources: true toc: true toc-location: left toc-depth: 5 code-fold: false code-line-numbers: true page-layout: article grid: sidebar-width: 100px body-width: 2000px margin-widt...
2df98276bb4628f864db18a4248f41564bf9d29613bb102b2e6c8d93c68bdec0
Quarto
29,672
1,011
--- title: "T4 Tail Regression Analysis" author: "Andrea Mariossi" format: html: embed-resources: true toc: true toc-location: left toc-depth: 5 code-fold: false code-line-numbers: true page-layout: article grid: sidebar-width: 100px body-width: 2000px margin-width: 1...
df12a4b1340f282abb0eb76232956926b5e5a3f9fa94a3aed7593c72c6902257
Quarto
30,253
898
--- title: "Perchlorate and T4 rescue" author: "Andrea Mariossi" format: html: embed-resources: true toc: true toc-location: left toc-depth: 5 code-fold: false code-line-numbers: true page-layout: article grid: sidebar-width: 100px body-width: 2000px margin-width: 100...
7b98146f4d111a012d104532da7c3f1fe7632e957e334760d9ee17312d61d721
Quarto
36,122
1,053
--- title: "Fig-4C_OEexp_photoreceptor" author: "Andrea Mariossi" format: html: embed-resources: true toc: true toc-location: left toc-depth: 5 code-fold: false code-line-numbers: true page-layout: article grid: sidebar-width: 100px body-width: 2000px margin-width: 10...
21726c10dcf9e11a1bc65ffab39bb4df9a068d87d16f1946d8f54d44860395a5
R
5
1
NULL
01fe6a0c52a2317ad79b67b2e74ec4571d629332f090d58406907c83a172150a
R
18
1
library(httptest)
224ab2be1de4fe5e510570b01a903ec6f58824436bf463145eaa8e3056ecec1f
R
25
1
#' @param run_id Run ID.
b852b94d205222ff9bbe3be5223fa2f1b4940d50b5153f994800a846c0531f33
R
29
3
.onLoad <- function(...) { }
7a51852a9f976dc4201c18395be88a6f4e013f64a4e8c101f4e6fdee3bc38bf1
R
34
2
library(sesame) sesameDataCache()
a36c85606947264a2d98ac57df261d919c07031720686575b9884cc84d2f6261
R
34
1
source("testthat.R", echo = TRUE)
924d11d5c2516c093a3fb6e9693f0d2934417b65279897efbcbc2e9cdf8ffbd5
R
41
1
.globals <- new.env(parent = emptyenv())
168f04e89cb10fc2afc36cd84f32dc9e749d47aa187c211212b7a991470fcc1e
R
44
5
context("Test helpers") library(Scillus)
813c6f1bc8af5a380e9a38dad58424047a7ede172a69b299d52f85a12af1ad37
R
45
3
library(conos) testthat::test_check("conos")
f005114900355e1390113c02aad052cacfdfa063b0135eb0000c912d2ebd1641
R
50
4
library(testthat) library(bhr) test_check("bhr")
0dd83c8a47b1ea9693b0987a869bd53c6a0cbffc05c0d768ba00c21c82c095e3
R
52
4
library(testthat) library(COSG) test_check("COSG")
457e171f40123132d7751c7c92bf20b9af83d96b7340e58128ac752a0eceb629
R
53
4
library(testthat) library(ArchR) test_check("ArchR")
b61defd86a4cec973208ea4304502d94ac6d05cdda23380c5cb47ad237866791
R
54
4
library(testthat) library(fancr) test_check("fancr")
0e604a95642713e4a27002cbe717abce97e3133c86ef5731eaa6dd7c69b8687a
R
56
4
library(testthat) library(sleuth) test_check("sleuth")
a17f2f93cc26140dd10409927497e8404b43580618ea8241781b58b65f61f917
R
58
4
library(testthat) library(Scillus) test_check("Scillus")
33b8c6ea85dd17de0e6c71288c22d95e40d08edbb1797bc704f91f8979138a17
R
66
3
test_that("multiplication works", { expect_equal(2 * 2, 4) })
7bd1f78dcf40df64604c650437f9cbaf3dbf8bd556717007131215be849ef002
R
66
4
library(testthat) library(spatialLIBD) test_check("spatialLIBD")
2cf48c08eb304c91509de6b4f5b18d8610f6bc6ab4cf982f785a44145438ec29
R
70
4
library(testthat) library(ggVennDiagram) test_check("ggVennDiagram")
0d5fd598742b5428ec741c50756924e4619c79a16b970c9c2f465eca6bd210ad
R
72
4
library(testthat) library(MetaNeighbor) test_check("MetaNeighbor")
1777dbe324efa48c8b4d6ed369c97e21ec651fffd3b55e5ab5fb200381bc35b8
R
75
3
.onLoad <- function(lib, pkg) { library.dynam("TitanCNA", pkg, lib) }
5b6d389a627127de3268c1faa4568579f483beed9b89ee25c17d8996f03d5147
R
87
2
utils::globalVariables(c("mm_hs", "pathways.hallmarks", "exhaust_genes", "cc.genes"))
aae50836c403a37bdee708042d2288a8d965e226d6d2cec35a258edcef3518be
R
100
6
require(ggplot2) require(stringr) require(R.matlab) require(cowplot) require(gsubfn) require(rjson)
b43586ca804d3d8760513cc8206463385a1d5cc84f9b2a1609f56df411d98ada
R
102
6
#' Import venn shape coordinates #' #' @return a data frame vensets = function(){ venn::getSets() }
98424272c29c1e83bab3eda27ea5451afbafc01856b1a61ef9fefc1968af743d
R
108
5
#' Default databases by organism #' #' @format Named character vector #' @source GEO number "defaultDbNames"
98e1ea4a4c1eaeb1272e1a55b90ed1482bd1b70871ac7329315c43d7e43de372
R
111
7
#' @keywords internal "_PACKAGE" ## usethis namespace: start #' @import Matrix ## usethis namespace: end NULL
781df8b9380491c8ad745eebcb217ff8ebe9e715554c354578df961eac890794
R
114
5
#' Small pre-processed data from Pagoda2, two samples, each dimension (1000, 100) #' "small_panel.preprocessed"
bd5cdca93959c68a68d744fd7ce2c6cf5da178400531f4a8229ef1d9bc2b71c3
R
114
5
test_that("plot_chains", { vdiffr::expect_doppelganger("chain_plots", plot(samples_LNR, selection = "mu")) })
0ffc4f5030c338a88787d5baa1f5719fc63d36d27e18fd4b9369f7d15a57b8ff
R
118
6
library(nichenetr) library(tidyr) library(dplyr) library(testthat) test_check("multinichenetr", filter = "pipeline")
cf93695cf13375893d917d6134d2cde4a0b1f5ffccd24e63534a11b7f30542d8
R
121
7
#' @keywords internal "_PACKAGE" ## usethis namespace: start #' @importFrom magrittr %>% ## usethis namespace: end NULL
bfc5963028daa28a82300f0eab5c133d053fac053315673e983e83ad4c7ee78c
R
122
5
is_binary_column <- function(x) { vec <- as.vector(na.omit(x)) check <- all(vec %in% c(0, 1)) return(check) }
c4eb51e24b025210a7d71a254f053b6aeef0cf8669c6a34eb32dafccc0b2e0ae
R
124
8
#' @importFrom rlang %||% rlang::`%||%` #' @importFrom purrr %>% purrr::`%>%` #' @importFrom zeallot %<-% zeallot::`%<-%`
ef406368b6427cab1636b0bf1b3f00f97a18f20fa18af959862d88ca0ef0fba9
R
131
4
test_that("pairs_posterior", { vdiffr::expect_doppelganger("pairs_plot", pairs_posterior(samples_LNR, selection = "sigma2")) })
8317e89058970c1ee313fde1257cf73b3fc76a8f16ad42fa2561cd74e9b65b6c
R
138
6
if (requireNamespace("lintr", quietly = TRUE)) { context("lints") test_that("Package Style", { # lintr::expect_lint_free() }) }
813362a859e46806b02a404c41595b99d0727e184f73d5cf398298e30982b133
R
140
10
--- title: "About" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- Describe your project.
efcde0c2b070e06a2a790fde0a97fc3c4db93598350e3abe9b425b25c0b66417
R
142
4
# Install MLflow for R files <- dir(".", full.names = TRUE) package <- files[grepl("mlflow_.+\\.tar\\.gz$", files)] install.packages(package)
93ff3683bb118c94cd06899a9d9016125e3adcba0981db284ee5c8194cbf0818
R
148
5
check_package_available <- function(pkg) { if(!requireNamespace(pkg, quietly = TRUE)) { stop("Please install suggested package: ", pkg) } }
d36b5c6dc934519073ed64c702c3bb33f738e83a8d8264e0743d99bb70d905dc
R
155
5
library(testthat) library(malevnc) # tests currently assume MALEVNC_DATASET=VNC withr::with_envvar(new=c('MALEVNC_DATASET'="VNC"), test_check("malevnc"))
112fa0a8bf38b7a34ff6a9fe6c13a1fa4a7ef1e8c4acc30d33b33db3b6574c53
R
161
7
despars.lasso.est<-function (x, y, Z, betalasso) { b <- crossprod(Z, y - x %*% betalasso)/nrow(x) + betalasso if (ncol(b) == 1) b <- as.vector(b) b }
cfcc739c36ed9828be2cf4ae7189244cebcb563d8b4e5acecd528eb0913734df
R
161
3
if(requireNamespace('spelling', quietly = TRUE)) spelling::spell_check_test(vignettes = TRUE, error = FALSE, skip_on_cran = TRUE)
90071b0b0756982ff398f4895842192ac747516856a2833f4137f37ced1846ab
R
164
6
score.rescale<-function (Z, x) { scaleZ <- diag(crossprod(Z, x))/nrow(x) Z <- scale(Z, center = FALSE, scale = scaleZ) return(list(Z = Z, scaleZ = scaleZ)) }
c9f0606e1a37b64c38887dd03316f48a5df6d39111b87364a272beb934b8f0f3
R
166
4
BiocManager::install(c("WGCNA", "devtools", "org.Hs.eg.db")) install.packages('msigdbr', repos = 'https://cloud.r-project.org') install_github('jdrudolph/PerseusR')
074fad3f7a35d46b474a171dce237b46518d63d6ce640f0ab6aecd0b58e8c915
R
169
6
test_that("ann data can be created.", { data("x") data("y") ann=Create_SAHA_object(query = x,db = y,data_type = "Markers") expect_equal(typeof(ann),"S4") })
041ae6645b65cd8cb7638daf294a2fc641cc1400d8b7132539185fcf335ea8d7
R
176
4
test_that("fanc_partner_summary works", { expect_s3_class(fanc_partner_summary(fanc_latestid("648518346494405175"), partners = 'outputs'), "data.frame") })
80b3dd492c364fb0ca16fb35a5e906e56a4d6454c43f17847f5ef979c0202f8f
R
179
4
# Custom color palette library(RColorBrewer) library(viridis) custom_magma <- c(colorRampPalette(c("white", rev(magma(323, begin = 0.15))[1]))(10), rev(magma(323, begin = 0.18)))
99b4afe6e428e5147255c1506b99361807debe783294b698c9d5f54d6c18a850
R
187
6
score.getZforlambda.unitfunction<-function (i, x, lambda) { glmnetfit <- glmnet(x[, -i], x[, i]) prediction <- predict(glmnetfit, x[, -i], s = lambda) return(x[, i] - prediction) }
5fab70714d6ac036616a37ace17eeff04072274eee6ab006e60a234230e08e33
R
190
10
#' Cantor pairing number for unique mapping #' #' @param dir: target directory #' #' @return save function #' #' @export cantor_pairing <- function(x, y) { (x + y) * (x + y + 1) / 2 + y }
1c113330ca78ac3de67be17699c5743757467214ee996eab10b7c833700a6b3f
R
197
6
rm(list=setdiff(ls(),'params')) basedir <- params$basedir setwd(basedir) # create directories for each set of analyses in advance dir.create(paste(params$opdir,'diffmodel/',sep=''),recursive=TRUE)
71a83e3b9c8570580b26e008aa059de8bca058fd66e741a69dd97901a80020ea
R
202
8
#' @keywords internal "_PACKAGE" # The following block is used by usethis to automatically manage # roxygen namespace tags. Modify with care! ## usethis namespace: start ## usethis namespace: end NULL
889bdb5c181351e378210c0625f4da860473e75677a189d710a3d211bc407bde
R
209
7
.onLoad <- function(libname, pkgname) { try(choose_malevnc_dataset(dataset = getOption("malevnc.dataset"), set=TRUE)) # TODO make MANC<->manc/JRCVNC2018U bridging registrations available invisible() }
42da4a290d73c953b22f56a58e814017eda57ee77a68092fb0e7eeaad0a8ff95
R
210
10
preprocess.group.testing<-function (N, cov, conservative) { if (conservative) { NULL } else { zz <- mvrnorm(N, rep(0, ncol(cov)), cov) scale(zz, center = FALSE, scale = sqrt(diag(cov))) } }
6a7af85df6b8d9db23ce302abb5162205ae424ff0b9ba4d1c5d995cfaabf36b1
R
211
9
mlflow_is_verbose <- function() { nchar(Sys.getenv("MLFLOW_VERBOSE")) > 0 || getOption("mlflow.verbose", FALSE) } mlflow_verbose_message <- function(...) { if (mlflow_is_verbose()) { message(...) } }
7f7ff27a472a8ab6f87656d6de4b88033ab09fec0d149213b4e2910395c815ee
R
217
14
shinyUI( navbarPage("premessa", tabPanel("Panel editor", fluidPage( fluidRow( uiOutput("paneleditorUI") ) ) ) ) )
728e81caef6f148441de8ce11cbe40d2db26d216f30ff8d9b937ed0d379d65c6
R
219
7
test_that("manc_xyz2bodyid works", { withr::local_options(choose_malevnc_dataset('VNC', set = F)) skip_if_not(nzchar(Sys.which('curl'))) expect_equal(manc_xyz2bodyid(c(24581, 35523, 62688)), 10000L) }) dr_manc()
9b04fe8a4293fab4e80e6ea6d60459e88eafd224c13953b189c0076c5b6b6d4d
R
220
11
# #' Pipe operator # #' # #' See \code{magrittr::\link[magrittr]{\%>\%}} for details. # #' # #' @rdname pipe # #' @keywords internal # #' @export # #' @usage lhs \%>\% rhs # #' @name %>% #' @importFrom magrittr %>% NULL
f1612952ef585fb72f2381717a75f3500f5c51884c38c943b7fe128caeb64a18
R
220
8
PowerUniv<-function (U, V) { n <- dim(V)[1] x <- as.numeric(max(abs(U))) TER <- as.numeric(1 - pmvnorm(lower = c(rep(-x, n)), upper = c(rep(x, n)), mean = c(rep(0, n)), sigma = V)) return(TER) }
4f3a4895e3dbc09a2eec33d96b204fabc6620bd4281be085c06ad8d41b8f101a
R
226
6
RNGkind("L'Ecuyer-CMRG") set.seed(123) test_that("profile_plot", { vdiffr::expect_doppelganger("profile_plot", profile_plot(get_data(samples_LNR), get_design(samples_LNR)[[1]], credint(samples_LNR, probs = .5)[[1]])) })
7cfdd9a6a7e9ddd45563a6d0df37721deacad18b37c6e0f287dd7ff15a034431
R
232
10
#!/usr/bin/env Rscript packs <- c("qqman","optparse","data.table","R.utils") for (p in packs) { if( !require(p, character.only = T)) { print(p) install.packages( p, repos = c(CRAN = "http://cran.r-project.org") ) } }
9fbd6d523972dedfaa61d10406d0e7e804a173fbdd43f16458a2c86029e629c5
R
232
21
#' @export #' #' rownames.from.1st.col <- function(x) { x <- data.frame(x[,-1], row.names = x[,1]) return(x) } #' @export #' #' luniq <- function(x) length(unique(x)) #' @export #' #' dup <- function(x) x[duplicated(x)]
5f6488bbdc3c4e3c9236a201b1a8cff7733424a7be089efb5107ad826ae33edf
R
233
7
test_that("plot 4d Venn", { genes <- paste("gene",1:1000,sep="") set.seed(20210408) x <- list(A=sample(genes,300),B=sample(genes,525),C=sample(genes,440),D=sample(genes,350)) p <- ggVennDiagram(x) expect_is(p, "ggplot") })
ef70b179055068ed86d2bdb6dac1974b3ca7e856d0b247738341dda7e340d73f
R
242
7
context("test-fetch-all.R") test_that("read_ng_dump works", { expect_is(d <- read_ng_dump('testdata/read_ng_dump/'), 'ng_raw_list') expect_length(d, 3L) expect_named(d, c("000000000003500b", "0000000000035042", "0000000000035008")) })
dd11674ddec98f4db6c4637d671fd744ba0ce64dd2a30849693efb89039b601c
R
248
7
context("test pandaToCondorObject function") test_that(" pandaToCondorObject works or not", { suppressWarnings(load("./testDataset.RData")) condor.obj <- pandaToCondorObject(T4Panda_subset) expect_equal(condor.obj$edges, T4Condor$edges) })
239a576ebf1ffaa4fbb74494dd56fa1e25c7edc11fc6b264af16302df7101381
R
249
10
context("test pandaDiffEdges() result") test_that("pandaDiffEdges() works or not", { suppressWarnings(load("./testDataset.RData")) diffPanda <- pandaDiffEdges(T4Panda_subset, T10Panda_subset) expect_equal(diffPanda,T4T10diffPanda) })
e905c59cfc0037dbcdf7c7d0aff5914509d1d7b7994fd4530a4cbe753147012c
R
250
7
context("test panda.to.alpaca function") test_that(" panda.to.alpaca works or not", { suppressWarnings(load("./testDataset.RData")) alpaca <- pandaToAlpaca(T4Panda_subset,T10Panda_subset,NULL,verbose = F) expect_equal(alpaca, T4T10Alpaca) })
d1420a9a4183b9103e4495e069dcb18ecff928a0b60bf17dab79db9aae544bff
R
253
6
test_that("plot_pars", { RNGkind("L'Ecuyer-CMRG") set.seed(123) vdiffr::expect_doppelganger("density_plots", plot_pars(samples_LNR, selection = "sigma2")) vdiffr::expect_doppelganger("density_alpha", plot_pars(samples_LNR, all_subjects = T)) })
4a2552bfafde8dd6f56a6eee71b4684675f1e4426867aa1404ad2c83293af4d3
R
256
11
Sum<-function (U, CovS) { if (all(abs(sum(U)) < 1e-20)) pTsum <- 1 else { a <- rep(1, length(U)) Tsum <- sum(U)/(sqrt(as.numeric(t(a) %*% CovS %*% (a)))) pTsum <- as.numeric(1 - pchisq(Tsum^2, 1)) } pTsum }
ad9bb074201bb4c6d150f45401b65624f7caea052d04209b0ba641452eacf811
R
260
13
#' #' #' @param #' #' @return #' #' @export nested_xgboost_cox_cv_harrell <- function(x) { pred <- predict(x$model, x$matrix) time <- xgboost::getinfo(x$matrix, "label") index <- ifelse(time > 0, 1, 0) intsurv::cIndex(abs(time), event = index, pred) }
66db3db8d0a849795da6634e57a7e9af8f79b555a802e465c80dfeef72e1d936
R
261
11
test_that("Test PlotInteractionMatrix", { mat <- matrix(1:25, nrow = 5, ncol = 5) colnames(mat) <- paste0("C", 1:5) rownames(mat) <- paste0("C", 1:5) expect_silent(PlotInteractionMatrix(mat)) expect_error(PlotInteractionMatrix(1:10)) })
8b81a276da8eeff139b96f40ff6c5e32bbed8bcfe4c1a8590a8c5c489193a3fc
R
262
10
#' @keywords internal "_PACKAGE" # The following block is used by usethis to automatically manage # roxygen namespace tags. Modify with care! ## usethis namespace: start ## usethis namespace: end if (getRversion() >= "2.15.1") { utils::globalVariables(".") }
20397b7ed4246a3c09905acfe5c55e3f767051276ffd73e7621829aeaaae881b
R
263
11
#' @keywords internal #' @import fafbseg #' @import nat.flybrains #' @import bit64 "_PACKAGE" # The following block is used by usethis to automatically manage # roxygen namespace tags. Modify with care! ## usethis namespace: start ## usethis namespace: end NULL
94cd0d1874eea6aa5c2b9601004cbed40f1ea95aa9afd0ddff399f4bc15b13db
R
266
10
context("lints") test_that("mlflow package conforms to lintr::lint_package() style", { if (nchar(Sys.getenv("COVR_RUNNING")) > 0) { skip("No linting during code coverage") } # removing lint check until lint is cleaned up # lintr::expect_lint_free() })
aaf8cfca8a1d30909659a78d5cb7e8b6fc5845009aa57c5ed3bf8af0e48f210a
R
268
14
#' Launch Reactor Data Shiny App #' #' @return a shiny app #' @export launch_app = function(){ check_package("shiny") app = system.file( "shiny", "shinyApp.R", package = "ggVennDiagram", mustWork = TRUE ) if(interactive()) shiny::runApp(app) }
db44589c25644a814356f90e9af5db56ebd570452b71e8f907461d721c332f19
R
269
7
test_that("flywire_sirepo_file", { skip_if_not_installed('git2r') expect_s3_class( flywire_sirepo_file("https://github.com/flyconnectome/flywire_annotations/supplemental_files/Supplemental_file3_summary_with_ngl_links.csv", read = T), "data.frame" ) })
4f10d7365345820cb66246885c245a2257f1cf6ae396c2745edf071151613e79
R
270
13
#' #' #' @param #' #' @return #' #' @export nested_xgboost_cox_cv_concordance <- function(x) { pred <- predict(x$model, x$matrix) time <- xgboost::getinfo(x$matrix, "label") index <- ifelse(time > 0, 1, 0) intsurv::cIndex(abs(time), event = index, pred)$index }
9bf3f812e88c465403e337176fe0d6d0deed040ebc0a1a3fe47ef03f997d2a03
R
274
9
test_that("Test ComputeSpatialInteractionMatrix", { coords <- readRDS(system.file("extdata", "MouseBrainCoords.rds", package = "SpNeigh" )) interaction_matrix <- ComputeSpatialInteractionMatrix(coords) expect_true(is.matrix(interaction_matrix)) })
db3ba2095e0be25e4ae7575da7492176fc86eda71f78e6ed589dbdb01a13b66e
R
283
5
# Make sure the current working directory is 'mlflow/R/mlflow' print(R.version) install.packages('remotes') saveRDS(remotes::dev_package_deps(".", dependencies = TRUE), "depends.Rds", version = 2) writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), "R-version")
2d2b3ea46cc557ff27feaeca8206dbd8450c0eb641d842476c68e15512dd3438
R
285
13
test_that("Test plotInteractionMatrix", { mat <- matrix(1:25, nrow = 5, ncol = 5) colnames(mat) <- paste0("C", 1:5) rownames(mat) <- paste0("C", 1:5) p <- plotInteractionMatrix(mat) expect_s3_class(p, "ggplot") expect_error(plotInteractionMatrix(1:10)) })
b04148d643fe754754d54a3c3f7c9a0bc89f2ba233a4bdc92a15cb2c597d0a5d
R
286
13
library(mlflow) # read parameters column <- mlflow_log_param("column", 1) # log total rows mlflow_log_metric("rows", nrow(iris)) # train model model <- lm(Sepal.Width ~ iris[[column]], iris) # log models intercept mlflow_log_metric("intercept", model$coefficients[["(Intercept)"]])
cf03d58c99776fad9d7967ce0d014325b277fb49f8fd765232d45620d2495490
R
288
3
imgurl <- "data-raw/logo.png" sticker(imgurl, p_size=19, s_x=1, s_y=1.16, s_width=.63, p_y = 0.49, h_color = "#91c36f", h_fill = "#eaf4e4", package = "CroCoNet", p_color = "#385723", p_family = "sans", h_size = 0.6, p_fontface = "bold", filename="inst/figures/CroCoNet_logo.png")
9484ee76357a7374c8d326ca10377a33b71e35631f14b9166eed9ea30e241c7c
R
289
7
test_that("url shortening works", { skip_if_offline() expect_is(lu <- malevnc::flyem_expand_url('https://neuroglancer-demo.appspot.com/#!gs://flyem-user-links/short/2023-12-15.090703.json'), 'character') expect_length( flyem_shorten_url(c(lu,lu), title=c("test1", "test2")), 2) })
9ca506f17c1ad362eaf01f670ff96febb22df1c645e2acd43dcad6a086a5c5b0
R
289
4
test_that("plot_relations", { vdiffr::expect_doppelganger("plot_relations_cred", plot_relations(samples_LNR, only_cred = TRUE, plot_cred = TRUE)) vdiffr::expect_doppelganger("plot_relations_mean", plot_relations(samples_LNR, plot_means = TRUE, only_cred = FALSE, plot_cred = TRUE)) })
719f398b7811efec822333050d7db27dbc7192a0a13f6579b186ad921f8ab78a
R
290
9
test_that("Venn methods work", { sets <- list(A=1:5,B=3:9,C=c(1,3,5,7,9,11)) sets <- lapply(sets, as.character) venn <- Venn(sets = sets) expect_equal(discern_overlap(venn), c("3","5")) expect_equal(discern_overlap(venn,1:2), c("4")) expect_equal(overlap(venn), c("3","5")) })
015ec2f112f5f0529360072634642ec815e9c5ed52dfd371853aaf9c2d8d1a59
R
293
9
require(GenomicAlignments) cigar.sum <- function(cigar) { cigar.df <- t(as.data.frame(explodeCigarOpLengths(cigar, ops=CIGAR_OPS))) colnames(cigar.df) <- unlist(explodeCigarOps(cigar, ops=CIGAR_OPS)) rownames(cigar.df) <- NULL cigar.df <- as.data.frame(cigar.df) return(cigar.df) }
be032d9b36c9f358ee524d16c3d114bd34c033dc035c23afdc2b7d06227d91af
R
295
13
#' #' #' @param #' #' @return #' #' @export shap_rename <- function(obj, dict) { features <- obj$X %>% colnames colnames(obj$X) <- ifelse(features %in% names(dict), dict[features], features) colnames(obj$S) <- ifelse(features %in% names(dict), dict[features], features) invisible(obj) }
098663e7863592ad5f5237216c9b81aeea888812685f30b49716ae7e1db88cd0
R
296
9
calcMforcolumn<-function (x, j, lambdas) { glmnetfit <- glmnet(x[, -j], x[, j], lambda = lambdas) predictions <- predict(glmnetfit, x[, -j], s = lambdas) Zj <- x[, j] - predictions Znorms <- apply(Zj^2, 2, sum) Zxjnorms <- as.vector(crossprod(Zj, x[, j])^2) return(Znorms/Zxjnorms) }
ac33d8da6a2cba5901e4137cc6265e53fadaedd81becbb60978c06e1f06a90fd
R
297
7
#load libraries library(enrichR) library(dplyr) #load data and configure Neuron.DEG <- read.table("D:/PEA/DE_S#NA#NA_G#group#APPPS1vsAPPPS1D10_A#NA_C#Neuron.txt", header = TRUE, row.names = NULL, encoding = "UTF-8") colnames(Neuron.DEG)[colnames(Neuron.DEG) == "row.names"] <- "gene_symbol"
d5178eab3036e33815a1cb8d83d6a68ab40353866b82468f04567d96a3f0454a
R
297
8
ssGSEA.project.dataset(input.ds = "XXX.gct", output.ds = "customSets_ssGSEA", gene.sets.dbfile.list = "customSets.gmx") rc.toPlot <- calculate_zscore(toPlot) round(mean(rowMeans(rc.toPlot)),2) round(mean(rowVars(rc.toPlot)),2) writeLines(capture.output(sessionInfo()), "sessionInfo.txt")
e0401624e8d59257047f60257a5b17302b216f1646a5acae0b78d1fe240cd2bb
R
297
5
## Colors from Lukas M Weber adjusted for the purple background libd_layer_colors <- c("#F0027F", "#377EB8", "#4DAF4A", "#984EA3", "#FFD700", "#FF7F00", "#1A1A1A", "transparent", "#666666") names(libd_layer_colors) <- c(paste0("Layer", seq_len(6)), "WM", "NA", "WM2") use_data(libd_layer_colors)
0d3b9c5b2c67a72114422a781e41a58c07e0254a5c6d37004d7373e9ebdb5cab
R
300
10
context("test OTTER result") test_that("otter function works", { suppressWarnings(load("./testDataset.RData")) # Run OTTER algorithm otterW <- otter(W, P, C, Iter = 1, lambda = 0.0035, gamma = 0.335) expect_equal(as.integer(otterW*10**10)/10**10, as.integer(gt*10**10)/10**10) })
9ac85bbc86c8cd49a2d17c81532187e4edc0b8aa23b3b0a985a1057325a81ae0
R
304
15
test_that("multiplication works", { bl=list(userMatrix = structure( c( -1,0,0,0, 0,0.3420201,0.9396926,0, 0,0.9396926,-0.3420201,0, 0,0,0,1 ), .Dim = c(4L, 4L) ), FOV = 0) expect_equal(manc_view3d(returnparams = TRUE), bl, tolerance = 1e-4) })
96a90c62d255fc7915099ae181780e6e7d51c1cace77a3e227654adc61aea6cd
R
305
4
#' @param client (Optional) An MLflow client object returned from \link[mlflow]{mlflow_client}. #' If specified, MLflow will use the tracking server associated with the passed-in client. If #' unspecified (the common case), #' MLflow will use the tracking server associated with the current tracking URI.