sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
88c7aea77cbf8c2759dfa942df7cc77ca65ae6754a53167e2acbd51369c44e12 | Quarto | 7,193 | 233 | ---
title: "Comparing Visium and Slide-seq"
format:
gfm:
toc: true
editor: source
---
```{r}
library(dplyr)
library(tidyr)
library(ggplot2)
library(xtable)
library(latex2exp)
library(rtracklayer)
library(ggthemes)
library(tibble)
gencode <- import('results/gencode.vM10.annotation.gff3.gz')
xchr_genes <- uniqu... |
6afd6c2a1a0663d89cfd0a10819ce444e64640f9486e57071877227d6019d41e | Quarto | 7,896 | 119 | ---
title: Onboarding
author:
- Denis Engemann
- Jörg Hipp
- Joseph Paillard
- Pilar Garces
- David Hawellek
format:
html:
code-fold: false
jupyter: python3
bibliography: ../references.bib
---
> Morlet wavelets designed for power-spectral analysis of M/EEG
Analysis of M/EEG signals in the f... |
a1f3744b61b6370de91b7ba851623a59ad5c81a7dd9cd226669a1e051e03f496 | Quarto | 11,948 | 390 | ---
title: "Plotting X-chromosome genes to see if any escape XCI"
format:
gfm:
toc: true
editor: source
---
```{r}
library(spacexr)
library(spASE)
library(dplyr)
library(Matrix)
library(data.table)
library(rtracklayer)
library(tibble)
library(ggplot2)
library(ggthemes)
```
```{r}
# Read in gencode to grab xchr... |
82ca544a79f138893a2a5d3f2b2c65641cf92d1d58f14f6193e97ce157264b7a | Quarto | 12,054 | 376 | ---
title: "Simulations"
format:
gfm:
toc: true
editor: source
---
```{r}
library(Matrix)
library(spacexr)
library(spASE)
library(ggplot2)
library(dplyr)
library(tidyr)
library(Rfast)
library(data.table)
library(ggthemes)
library(latex2exp)
library(wesanderson)
source('../R/spase_sim_utils.R')
```
# Load in d... |
08a135e0ab872cf3217fb914f8ddd4256c6544fd539b14da7ca1523220794305 | Quarto | 12,908 | 333 | ---
title: "Mathematical Deep Dive"
author:
- Denis Engemann
- Joseph Paillard
- Jörg Hipp
format:
html:
code-fold: true
jupyter: python3
bibliography: ../references.bib
---
> Definition and parameterization of Morlet wavelets
### Background and setting
Despite the popularity and extensive use of M... |
0e40105b96b3417901b7e55046dcb8e8ccc875734a207552d1d772e891f965c6 | Quarto | 21,484 | 577 | ---
title: "Overall results summary figures"
format:
gfm:
toc: true
editor: source
---
```{r}
library(spacexr)
library(spASE)
library(dplyr)
library(ggplot2)
library(data.table)
library(viridis)
library(gplots)
library(rtracklayer)
library(Matrix)
THRESHOLD = 500
```
```{r}
# Read in gencode to grab xchr gen... |
6c4df9f4e7771cbfb763fcbaf8826fa236acfc24674804c9ea0128b8a7822936 | Quarto | 24,689 | 726 | ---
title: "Cell type and X-chromosome figures"
format:
gfm:
toc: true
editor: source
---
```{r}
library(spacexr)
library(spASE)
library(dplyr)
library(Matrix)
library(data.table)
library(rtracklayer)
library(tibble)
library(ggplot2)
library(ggthemes)
library(ggridges)
```
# Load in data
# Cell type
## Ce... |
247cb1f53367dd2c2d52b97cdf2e57d3d3edd354aa7c65feaa3a4c3bb4095872 | R | 27 | 2 |
ecf.dir <- "../ecf_files/" |
7157f85c2fec74f0129348dfe241d2e67d42ac50892a0da7948a0a6f71b207ff | R | 40 | 1 | # creating a .R works and i can save it
|
f0c069eadf9e1970e072dbbcf0a2802d7976452dab1d80c075352d812e1b0a81 | R | 48 | 1 | # saves R file correctly but didn't open a .Rmd
|
5f265cc7bef0d4fd0d0e545509851fcf0995647a61147e0a18556b4c6d2805f6 | R | 56 | 4 | library(testthat)
library(sccomp)
test_check("sccomp")
|
e71b4b7cade5bf2360cd485d0a38b1931370aca200951acef094b1ca9ed6ffe6 | R | 58 | 4 | library(testthat)
library(permFDP)
test_check("permFDP")
|
91a5383f52252b0c89c28908cba4aa06fde24391df62e64f40dc5aa954c05dd3 | R | 59 | 3 | library(testthat)
library(lassosum)
test_check("lassosum")
|
42afc5f9dcb72cfd53bc76ba1a01c151ccb4f48d29d7ce7d9f4eaaf2da9f29a1 | R | 60 | 4 | library(testthat)
library(Cardinal)
test_check("Cardinal")
|
b7d488ff562471a80f2679e94f8864e8545e3a2546a32d19642b9bfa5e46a17a | R | 64 | 4 | library(testthat)
library(shinyepico)
test_check("shinyepico")
|
23f2fa7d53bd0a127e1b85c8d012692636e5ca569d7cfb801fcd4acc3da7f3d8 | R | 68 | 8 | ---
title: "CATE estimation"
output: html_document
---
```{r}
```
|
3ad780f4b6a210ebdc70885d71421f4d4d21c23226e2d0cea193d241fc01ede2 | R | 68 | 4 | library(testthat)
library(NosaAnalysis)
test_check("NosaAnalysis")
|
b5bc1703a675a0e2b94810f06ecd7775569f2d24c0f21d8e8741c80b2ae62073 | R | 84 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'WC_UKB.ecf')) |
f9ab2bd16a12d92a7fe3cd0714cf26fbe110d0db2205845d2098e3d917707e1a | R | 85 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'T2D_MVP.ecf')) |
8ef6fe3e60cfa363977d626e983743ecf98a3d3ba8bda8a61e8ac45fc2131f95 | R | 87 | 4 | # Title : TODO
# Objective : TODO
# Created by: sitarapersad
# Created on: 5/14/21
|
00d989e6c583b2f50d9b78c2f61a2afa044c3a7729b0e17671184b705f5a3e23 | R | 89 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'TG_GLGC_UKB.ecf')) |
0dcadd7438ac89d61ef4a13d1d63d05b1230700251b7e2ea61e5360ac9693518 | R | 89 | 5 | validate <- function(...) {
#' @rdname validate
#' @export
UseMethod("validate")
}
|
6571c961145818ca297c3e5405dc3a7fed427d8b69e5e44bf5e0b1febd4cc1ef | R | 90 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'WC_GIANT2015.ecf')) |
b91aa39a1e0f476d7715a619d30cdd71f46f7c4ac8d4256cac8a29cde8bce2cb | R | 90 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'HDL_GLGC_UKB.ecf')) |
a53b5b3782fba8382bb1745c1a33267f1018dc1917e6feb83d966ec1baee8593 | R | 91 | 3 | source("global_variables.R")
ibrary(EasyQC)
EasyQC(paste0(ecf.dir, 'T2D_Finngen_r7.ecf')) |
f78d4e0b28020d0fdb88fe1bdfcc4e0be3a06e617e1c37b52b135f880fb25fe1 | R | 91 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'TG_GLGC_noUKB.ecf')) |
1eee645273622639568ca21f17e8b71f8a1d88cec588987955a27745325957ef | R | 92 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'HTN_Finngen_r7.ecf')) |
1db5ae74fb49162dff6b859c92ece5c27bb6b0a67fba44cb814f2aee15a5d128 | R | 93 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'BMI_GIANT2018.ecf'))
|
5bfa2475258143c3094b38f581e4c5d017db8c8d0cef9fc97586f9f2d3bd94dd | R | 93 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'BMI_GIANT2015.ecf'))
|
8078d2c8b481433a2ac081f83b261208e1f8924b7f71d2ed871b9e9dd41fd260 | R | 93 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'T2D_Mahajan2022.ecf')) |
0b4ce8b87027b4c65cc5a3d89b64112d8c011ab9fdade7e934fae6c2ca637bdb | R | 94 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'HDL_GLGC_noUKB.ecf'))
|
1e674a30d5284f56fd002b76aa2e185c7a25521312ca8ef6038286773e5a4e31 | R | 94 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'HTN_UKB_Watanabe.ecf')) |
37b7ad9033211649031d5d8bada302891b56c5526b80ee3a8973f37d8ca126ec | R | 97 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'FG_MAGIC_A1asEffect.ecf')) |
1fd753073ce2c07081861df873e6fd1e672d516e741f3f3704bb034ae0dd23f9 | R | 98 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'T2D_meta_FinngenR7_MVP.ecf')) |
d444d569ea621849602c847c87fa431a04cc67bf05996c86f3f47575bab5fe67 | R | 100 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'HTN_meta_FinngenR7_UKB.ecf')) |
1860973292eaf563a5eca9d64ad19ad69639a68b5061c190516adc72800bb797 | R | 104 | 5 | splitvalidate <- function(...) {
#' @rdname splitvalidate
#' @export
UseMethod("splitvalidate")
}
|
2e86e912ce4ecbce6d8062badc8ffae4f361900e07a5acc06ced28ce2011260d | R | 106 | 5 | pseudovalidate <- function(...) {
#' @rdname pseudovalidate
#' @export
UseMethod("pseudovalidate")
} |
0c4651853738fb08f57b432fb51c6b7d5639350dd05fb0c612a83be0e468c77c | R | 108 | 3 | # C. Beleites
# run all tests attached to objects
hySpc.testthat::unittest("hyperSpec", standalone = FALSE)
|
f2275d6090a63972d4a8a193c36518a9b5b17acd957ba8fcd17b64875633fdaf | R | 110 | 3 | source("global_variables.R")
library(EasyQC)
EasyQC(paste0(ecf.dir, 'T2D_meta_FinngenR7_Mahajan2022_MVP.ecf')) |
09802cded9bb5ebecadf3ebde1bf3494f3534ec33bf3235205b2928e4bd573ec | R | 127 | 5 | source("R/setup.R")
t1_mlife_eicu() %>%
readr::write_delim("evaluation/tables/table1.csv",
delim = ";") |
b4ff8653ab42e6310800f4722772125fef38448be96bca9ca69497282c51d1b6 | R | 152 | 8 |
skip_cmdstan <- function() {
skip_on_cran()
skip_if_not_installed("cmdstanr")
if (!stan_cmdstan_exists()) {
skip("CmdStan not found.")
}
}
|
11f256bd6d008ea9d642e1ec34d141fcf3fe2244fbbd6f01739040594edfc1d9 | R | 161 | 6 | y<-c(1,2,3,4,5)
x<-circular(y, units = "hours", template = "clock24")
summary(x)
plot(x)
arrows.circular(mean.circular(x),rho.circular(x),col=2)
rayleigh.test(x) |
22d393c26b292503e2691170c2084e1c5f86ecfef9b6993f93762b723af12cc4 | R | 186 | 8 | rscript_executable <- function() {
executable <- if (identical(.Platform$OS.type, "windows")) {
"Rscript.exe"
} else {
"Rscript"
}
file.path(R.home("bin"), executable)
}
|
680a0dc3be394d18055461a8697a1effd81fc4d18b29fb32f9623f33aa9b09ef | R | 194 | 5 | not.a.file <- function(scalar_character) {
#' A function to protect a single SNP id from being interpreted as a file
attr(scalar_character, "not.a.file") <- TRUE
return(scalar_character)
} |
253c1a5742a38c5c2a002a6e56a01a8b3c85d7bc8dbf03a8351501574089bdf7 | R | 206 | 6 | kinship<-read.csv(file="plink2.rel",sep="",header=F)
id<-read.csv(file="plink2.rel.id",sep="")
colnames(kinship)=id$IID
rownames(kinship)=id$IID
write.table(kinship,file="kinship.txt",sep="\t",quote=F)
q()
|
80532d31edea9d636d465ba65c9c04846a765571c826d95f7e54943fbd7f6dca | R | 209 | 5 | clean <- function(x) {
as.numeric(stringr::str_replace_all(stringr::str_extract(x, '[0-9,]*'),
pattern = ',',
replacement = ''))
}
|
3e135217ef28fa180e52feebec70e54c1c9714638be05155e211b1805d4602c4 | R | 213 | 13 | #' expit function
#'
#'
#' @description literally just the expit function
#'
#' @param x the number to expit
#' @return the expited version of x
#'
#' @export
expit <- function(x) {
return(exp(x)/(1+exp(x)))
}
|
f11247630746cc90af4595d9cd2029c122d827d313b8eb5ca365d0e106327e06 | R | 219 | 10 | test_that("the retired external Bush 2011 backend is rejected", {
expect_error(
voxelwise_deconvolution(
niftis = character(0),
TR = 1,
algorithm = "bush2011_external"
),
"one of"
)
})
|
ae04b11f51b72a4b92e2ddac2772ab32ac73af0f663afca825cb34e4d4a9b248 | R | 237 | 14 | expit <- function(x) {
expx <- exp(x)
return(expx/(1+expx))
}
dexpit <- function(x) {
expitx <- expit(x)
return(expitx*(1 - expitx))
}
texpit <- function(x) {
expitx <- expit(x)
return(expitx*(1 - expitx)*(1 - 2*expitx))
}
|
5834ee45ced7f3ae7c4edbc2117fc898ebdd8f69748edc34760662efe849457f | R | 247 | 16 |
library(ggplot2)
csvPath = "./plots/Vascular_Endothelium_fix_Anatomical_Site,Age,Sex_rand_Donor_HM10UMI=100_mito=10Scrub=0.2noPackerMNN=sampleNameK=40addAllTypes_MMresult/Vascular_Endothelium_SexM_Table.csv"
myCSV = read.csv(csvPath)
|
6673da9d33cc96ae96532659ed3b0c4d513ea46d7b34a3a1c1e7ed7adbafa66b | R | 257 | 7 | write.table2 <- function(...) {
options <- list(...)
if(is.null(options$quote)) options$quote <- F
if(is.null(options$row.names)) options$row.names <- F
if(is.null(options$col.names)) options$col.names <- F
do.call("write.table", options)
} |
a827f4ee6c4a587d8ae31f22a78480f8542f9d8c9ea679d5d7204ebc95f7409b | R | 259 | 7 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
csc_tocsr <- function(n_row, n_col, Ap, Ai, Ax) {
.Call('_Azimuth_csc_tocsr', PACKAGE = 'Azimuth', n_row, n_col, Ap, Ai, Ax)
}
|
276b40394a2f5dfd447b9bb9abdbffa8c8d6b423e9dd84e523f9475617b90ff6 | R | 264 | 15 |
.onLoad <- function(libname, pkgname) {
shiny::addResourcePath(
prefix = "images",
directoryPath = system.file(
"images",
package = "shinyepico"
)
)
}
.onUnload <- function(libname, pkgname) {
shiny::removeResourcePath("images")
}
|
b4eafb0ebd1f9c4b365589eb652f67abd49bcf21d93b4ea4e66515039c0f33bd | R | 270 | 9 | #' lassosum: A package for carrying out LASSO regression using GWAS summary statistics
#'
#' @docType package
#' @name lassosum
#' @importFrom Rcpp evalCpp
#' @importFrom Matrix Diagonal t
#' @importFrom data.table fread setkey as.data.table
#' @useDynLib lassosum
NULL
|
3fbcd11b667966b74cc184c8f2be2b8e04f091a46fb6536691292661e94d5af7 | R | 272 | 17 | #fig11_mcnemar.r
# for alpha beta incidence
M <-
matrix(c(31, 6, 35, 98),
nrow = 2,
dimnames = list("res" = c("T", "F"),
"shuf" = c("T", "F")))
print("corrected and uncorrected:")
mcnemar.test(M)
mcnemar.test(M,correct = FALSE)
|
ba2ae2845e72babd3f293c0a4dca4168b692e62a86e4b73aa140a15cc1b8b181 | R | 273 | 6 | #' @title Function to read a text file
#' @keywords internal
read.table2 <- function(file, header=F, data.table=F, check.names=TRUE, ...) {
return(data.table::fread(file, header=header, data.table=data.table,
check.names=check.names, ...))
}
|
356d043dfbef7f0c435b0f68209ef887f91a9e75703e61d02fc8bce37e017fe0 | R | 296 | 9 | completeLibraryRanges <- readRDS("~/output/completeLibraryRanges.rds")
completeLibraryRanges["X7795"] #MNM030
completeLibraryRanges["X29938"]
completeLibraryRanges["X39803"] #MNM027
completeLibraryRanges["X10648"] #MNM028
completeLibraryRanges["X31994"] #MNM029
completeLibraryRanges["X86867"]
|
9376b54e3f6333d84fdc4fc4beff78d0d09490659efd2b23fa636e21f8c25ef7 | R | 302 | 13 | library(data.table)
library(dplyr)
### MetS
trait <- "MetS.KoGES"
file_in <- "leadSNPs.MetS.KoGES.txt"
df <- fread(file_in, sep="\t", data.table= F, nThread = 1)
write.table(df$rsID,
paste0("leadSNP_list.", trait, ".txt"),
sep="\t", row.names = F, quote = F, col.names = F
)
|
1c10b15e1d9200d15491dc67c0274ce951348c8cb88df403b22a763289955d7b | R | 312 | 15 | ## <----------------- LOAD LIBRARIES
library(qvalue)
## <----------------- FUNCTIONS
##
## <--------------- MAIN
args <- commandArgs(trailingOnly=TRUE)
obs_p <- abs(as.numeric(args[1]))
null_p <- matrix(abs(as.numeric(args[-1])), ncol=1)
as.numeric(unlist(empPvals(stat=obs_p, stat0=null_p, pool=FALSE)))
|
e78e579d4fb6ca231808c14ab3d251b132114e187b6915ffecf82046e3da2e05 | R | 319 | 12 | test_that('pgs' , {
n <- nrow.bfile("test")
p <- ncol.bfile("test")
X <- genotypeMatrix("test.bed", n, p,
integer(0), integer(0), integer(0), integer(0), 1)
expect_equal(sum(X), 27)
j <- rnorm(p)
sum(pgs("test",j))
beta.coef <- matrix(rnorm(p*3), p, 3)
system.time(a <- pgs("test", beta.coef))
})
|
f8e9ccb5a83be1a78d67f0492c65dcedcf61963bd1ded4ecfb2bd953c7d93b71 | R | 321 | 9 | source("R/setup.R")
# load configurations
config <- yaml::read_yaml('config/config.yaml')
# execute the forecast pipeline on the internal test set
forecast_results <- run_forecast_pipeline(dataset = "test",
config=config,
re_do = c())... |
3a5cd8a9f39ee615711d802c2a1a0ae07ccf4385fd922cf90e6725e0281addc5 | R | 322 | 13 |
#' archstabms__get_codons
#'
#' Split nucleotide sequence into codons.
#'
#' @param nt_seq nucleotide sequence string (required)
#'
#' @return Vector of codons
#' @export
archstabms__get_codons <- function(
nt_seq){
return(apply(matrix(unlist(strsplit(nt_seq, "")), ncol = 3, byrow = T), 1, paste0, collapse = ""))
... |
ef4574d1be70a16ef2ba9b5bad743d296125f1f10c3cd8f5f4a442d03dd850fc | R | 327 | 9 | source("R/setup.R")
# load configurations
config <- yaml::read_yaml('config/config.yaml')
# execute the forecast pipeline on the external EICU dataset
forecast_results <- run_forecast_pipeline(dataset = "eicu",
config = config,
re_do ... |
6d23a86715ca209f3e84e94f3fe1775c1c3e58e8b5d07897a9d9d81b98a1135c | R | 345 | 21 | .paste_names <- function(...) {
if (nargs() == 1L & is.list(..1)) {
dots <- ..1
} else {
dots <- list(...)
}
names <- names(dots)
names <- sapply(
names,
function(x) {
if (nchar(x) > 0L) {
sprintf("%s = ", x)
} else {
""
}
}
)
paste(names, dots, coll... |
3426b7a4462b783b28c70c704559757e99a837730d514ea4eba155600864247a | R | 348 | 17 | #' Field conversion codes for pubmed imports
#'
#' @docType data
#' @author Kaitlyn Hair \email{kaitlyn.hair@ed.ac.uk}
"field_codes_pubmed"
#' Field conversion codes for Web of Science imports
#'
#' @docType data
#' @author Kaitlyn Hair \email{kaitlyn.hair@ed.ac.uk}
"field_codes_wos"
#' Exmaple citation data
#'
#' @d... |
72b1ab00f6b9a78faa6eebfadbb119dad64923a12f49f4fc5a00a63da687107e | R | 360 | 15 |
#' archstabms__calculate_angle
#'
#' Calculate angle between vectors in degrees
#'
#' @param a vector a (required)
#' @param b vector b (required)
#'
#' @return angle in degrees
#' @export
archstabms__calculate_angle <- function(
a,
b){
acos((a[1]*b[1] + a[2]*b[2] + a[3]*b[3])/(sqrt(a[1]^2 + a[2]^2 + a[3]^2) * sq... |
2305180dbda1f391e8c7a8640fa689bb241314586ae530b6e5638f9753adc255 | R | 363 | 12 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_hippo_1.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
myfit <- scase(
maternal_counts_matrix,
paternal_counts_matrix,
min.cells = 2^7, cores=8, verbose=T
)
saveRDS(... |
e3af008865fef851a0fbf049f6007c2b691ce1ab46c925685f277943277e4e0c | R | 363 | 12 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_hippo_2.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
myfit <- scase(
maternal_counts_matrix,
paternal_counts_matrix,
min.cells = 2^7, cores=8, verbose=T
)
saveRDS(... |
728e4da81e2ea6365bcee0ad4ffd67ccac33cdd61e95320e042943c4bf621442 | R | 365 | 15 | options(bitmapType='cairo')
# http://www.burns-stat.com/pages/Working/perfmeasrandport.pdf
args <- commandArgs(TRUE)
wd<-args[1]
pvalueString<-args[2]
pvalues<-unlist(strsplit(pvalueString,","))
pvalues<-as.numeric(pvalues)
stouffers.pvalue<-pnorm(sum(qnorm(pvalues)) / sqrt(length(pvalues)))
print(paste... |
85fcb955e3f154362b40801e715e406621f05acb7e5c837f05b518c745f8ec6b | R | 367 | 12 | library(tidyverse)
all<-read.csv(file="combined.count.csv",header=F)
colnames(all)=c("count","cluster","cellType","feature")
all$combined<-paste(all$cellType,all$cluster,sep="_")
wide = all %>%
spread(feature, count)
wide[is.na(wide)]<-0
rownames(wide)=wide$combined
wide<-wide[-3]
wide$sum=wide[,3]+wide[,4]
... |
a19747d278db7fbedd13e001e2546ad46e45f8aca1ec05e0e50ed47133b1c5ec | R | 370 | 12 | # This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files
libr... |
f4b918bed579af1e0cbf5b9040747c7ef1b3c3f2be3ec1e02b79e8cceaeb56a3 | R | 370 | 13 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_cere_3.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
myfit <- scase(
maternal_counts_matrix,
paternal_counts_matrix,
min.cells = 2^7, cores=8, verbose=F
)
saveRDS(m... |
2a93cf1f6662c86f54480a47466089d077096454107bfcff39d5f6bac1c4cd1e | R | 373 | 15 |
#' archstabms__fraction_folded
#'
#' Calculate fraction folded in 2-state model.
#'
#' @param folding_energy folding energies for 2-state model (required)
#' @param RT constant (default:0.001987*(273+24))
#'
#' @return Fraction folded
#' @export
archstabms__fraction_folded <- function(
folding_energy,
RT = 0.00198... |
323c32ee8c12df423e260cc1f0db7b17e597ccef3f24e1917937f241b28c05a2 | R | 377 | 21 | options(bitmapType='cairo')
args <- commandArgs(TRUE)
inputFile<-args[1]
correlationMode<-args[2]
if(!exists(correlationMode)) {
correlationMode<-"pearson"
}
if((file.info(inputFile)[[1]][1]) > 0) {
tmpData<-read.table(inputFile,header=TRUE,sep="\t")
r<-cor(tmpData$score_1,tmpData$score_2,method... |
531ff8817e2594d0729208934ede54d658c0fbde44fa34e379cdff9316594cc2 | R | 382 | 13 | logical.vector <- function(positions, size) {
#' @title Function to create a logical vector based on position and
#' size, i.e. total length of vector
#' @description It's basically the reverse of base::which()
#'
#' @param positions Positions to extract
#' @param size Length of logical vector
#' @expo... |
7c8fc4596eee3215cd0ecfaf57f81d360ae86a88365b4dcf2a852da04d5a877f | R | 386 | 12 | # This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files
libr... |
28cac279c47c7767029afbbd499b3ce418f933a0c63f7444f2b8ec8e8c3045f6 | R | 392 | 35 | # (PART) A
# [Chapter 1](https://pzhao.org) {#cha1}
## Section 1.1 {#sec1.1}
$$f(k) = {n \choose k} p^{k} (1-p)^{n-k}$$
## Section 1.2 {#sec1.2}
$$\begin{array}{ccc}
x_{11} & x_{12} & x_{13}\\
x_{21} & x_{22} & x_{23}
\end{array}$$
# Chapter 2
## Section 2.1
- Item 1
- Item 2
+ Item 2.1
* Item 2.2
## Sec... |
60bb4092aaf19847ac690a1b9a9c8bf6ead5b4277a788ccb88ed958a213fe329 | R | 434 | 10 | data<-read.csv(file="p.txt",sep="\t",header=F)
colnames(data)=c("comp","p")
data$adj.BH<-p.adjust(data$p, method = "BH")
data$adj.BY<-p.adjust(data$p, method = "BY")
data$adj.holm<-p.adjust(data$p, method = "holm")
data$adj.hochberg<-p.adjust(data$p, method = "hochberg")
data$adj.hommel<-p.adjust(data$p, method = "homm... |
8efc62496fc73f78c0c97b3ad87a5b0f7182c2090597b28f019bde0b4104d2d8 | R | 443 | 22 |
detect <- function(dataset){
## Predict event as random guess with 50% probability
probability <- runif(1)
event <- probability > 0.5
## return prediction
return(event)
}
destruct <- function(){
## remove global variables
## delete files
}
getOutline <- function(){
competitor.name <- "Max Muste... |
26b192f88d5560e0a50026ac7498894e716b5aed4019eeab463939ccfa260dfa | R | 445 | 9 | test_that("no metadata sheet", {
nsr <- NosaResultLoader$new()
expect_error(expect_output(nsr$loadNosaResults("files", sheet_p = list())), "The metadata sheet must be included")
})
test_that("reads 'Spike Detection' sheet with different tables", {
nsr <- NosaResultLoader$new()
expect_output(nsr$loadNosaResults... |
a3c1d64e6af460d37cd99985b1cae344af8aa6343e0eddd33164cc0e8c12b5c1 | R | 445 | 19 | #' @title Internal function to parse extract
#'
#' @param keep A boolean vector of which position to keep
#' @keywords internal
#'
selectregion <- function(keep) {
pos.keep <- which(keep)
end <- pos.keep[-1]
start <- pos.keep[-length(pos.keep)]
diff.keep <- end - start
skip <- diff.keep > 1
starts <- c(st... |
e07fcc35684d5d99160f731c787f3d46886e5ac09900e6b83e65c4c9f525ac20 | R | 445 | 17 | # This code only needs to be run once.
install.packages(c("colorspace", "doParallel", "foreach", "knitr", "grid", "magick", "pROC", "spacesXYZ", "tidyverse", "xml2", "yardstick"), repos="https://cloud.r-project.org")
library(colorspace)
library(doParallel)
library(foreach)
library(grid)
library(knitr)
library(magick)
... |
a21b9cf9da46b25325ff25c9d3946f12cfbeb186958ba44e861b753eaebb7a32 | R | 449 | 7 | library("circlize")
data.frame <- read.csv(file = 'plot_chord_data.csv')
color.data <- read.table(file = 'plot_chord_cmap.csv', sep=',', comment.char='')
grid.col <- as.character(color.data[["V2"]])
names(grid.col) <- as.character(color.data[["V1"]])
chordDiagram(data.frame, self.link = 2,grid.col=grid.col, directiona... |
57baa090fe236b839fdef0870dfc85305eef068050c132658bc9691a6b72e52d | R | 454 | 18 | ## Nicolas Servant
## Install R packages for HiC-Pro
p1 <- require("RColorBrewer")
p2 <- require("ggplot2")
p2.1 <- packageVersion("ggplot2") >= '2.2.1'
p3<-require("grid")
if (! p2.1){
stop("Error : ggplot2 version must be > 2.2.1 ")
}
if(p1 & p2 & p3){
message("R packages loading with success")
}else{
... |
392d34b938c4b9d14a23bd162b6e44f84bc655a5afacada90b64f810f7ad3de4 | R | 461 | 16 | parseblocks <- function(vec) {
#' @keywords internal
if(is.factor(vec)) vec <- as.integer(vec)
vec <- as.integer(factor(vec, levels=unique(vec)))
blocks <- unique(vec)
stopifnot(blocks == sort(blocks))
stopifnot(min(blocks) == 1)
stopifnot(max(blocks) == length(blocks))
rle <- rle(vec)
endvec <- cums... |
c8142c592d00d4eb22690a6679071f3ab9e8cdeafdc369521f8aadcea125af0b | R | 464 | 13 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_mix_5_visium.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
myfit <- scase(
maternal_counts_matrix,
paternal_counts_matrix,
min.cells = 2^7, cores=8, verbose=T
)
myf... |
760ea1dd1e0fdfcc57c63f564e1c9db67b01f58ddad6c91d9d1be0454cff05b7 | R | 467 | 19 | ---
title: "Breathe Easy Analysis Summary"
output: html_document
---
This R Markdown document includes all figures generated from this run of the Breathe Easy Pipeline in the form of a webpage (.html).
```{r, results='asis', fig.height=4, fig.width=15, echo = FALSE}
files <- list.files(path = args$Output, pattern =... |
2799df0642f48fe8e89001090955d5ead3daf45527c4eb1879612733a60e4efe | R | 471 | 14 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_cere_3.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
coords <- res@originalSpatialRNA@coords
coords$bead <- rownames(coords)
coords <- coords[c('bead','x','y')]
myfit <-... |
b5cd8b41c53ed0c7d32217cde72936d8a409f10d9301065fb2da124b6332ad55 | R | 471 | 13 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_hippo_3.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
myfit <- scase(
maternal_counts_matrix,
paternal_counts_matrix,
min.cells = 2^7, cores=8, verbose=T
)
myfit <-... |
7c533b6f8266fd35fb1c6b3e323829e437bc0da9fb81ffcbf64752d547d22ae6 | R | 474 | 13 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_cere_4_visium.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
coords <- res@originalSpatialRNA@coords
coords$bead <- rownames(coords)
coords <- coords[c('bead','x','y')]
m... |
8720ffbda9daebbade3fb4a074156571c9aceef85a687970875dbbddd2803548 | R | 475 | 21 |
zero_to_A <- c()
A_to_T <- c()
for (tcut_idx in 1:10){
message("Running analysis with cutoff ", tcut_idx)
source("analysis_clean.R")
source("analysis_conversion1.R")
#get info from nn model:
tmp <- c(Tcut, tau_cut, nn$n, nn$nevent, summary(nn)$coef[5:7,5])
zero_to_A <- rbind(zero_to_A, tmp)
source("an... |
693ed00081d27379e3af02981cb60fc25b74414b8aae5fa8e6d3feead61552f4 | R | 478 | 12 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_hippo_2.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
coords <- res@originalSpatialRNA@coords
coords$bead <- rownames(coords)
coords <- coords[c('bead','x','y')]
myfit <... |
a1280d8b4c35c811b39cb9d35a9699c99a770636524837a8fde84a40e677c29a | R | 486 | 17 |
#' archstabms__fraction_bound
#'
#' Calculate fraction bound in 3-state model.
#'
#' @param folding_energy folding energies for 3-state model (required)
#' @param binding_energy binding energies for 3-state model (required)
#' @param RT constant (default:0.001987*(273+24))
#'
#' @return Fraction bound
#' @export
archs... |
4bde037bd79f1e1bc76e26fd6ecad06a6ff592c03c3e57a6bc3f3ce65419ee28 | R | 487 | 13 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_hippo_1.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
coords <- res@originalSpatialRNA@coords
coords$bead <- rownames(coords)
coords <- coords[c('bead','x','y')]
myfit <... |
1875162f2d6e1dd0d8a10e77ceb1310ac6b0101445847dbbeb7ad966bbc051c4 | R | 490 | 14 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_hippo_3.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
coords <- res@originalSpatialRNA@coords
coords$bead <- rownames(coords)
coords <- coords[c('bead','x','y')]
myfit <... |
8a8f131a0763aae2d4c1754cbc87d51ffe3a4992df3eed49f20739231ab6e9ee | R | 490 | 16 | library(data.table)
library(dplyr)
file_pheco_cov <- "KoGES_MetS_pheno_covar_table.txt"
df <- fread(file_pheco_cov, sep=" ", data.table=F, nThread=1) %>%
mutate(MetS = ifelse(MetS == 1, 0, 1),
MetS = ifelse(MetS == 2, 1, 0))
write.table(dplyr::select(df, FID, IID, MetS),
file = "koges.phe... |
45ea6ccf4c604a379adca593452c98709df52fec2d22a4b18ff4bcb406c3fdda | R | 500 | 14 | library(spacexr)
library(spASE)
res <- readRDS('results/rctd_mix_5_visium.rds')
maternal_counts_matrix <- res@originalSpatialRNA@maternalCounts
paternal_counts_matrix <- res@originalSpatialRNA@paternalCounts
coords <- res@originalSpatialRNA@coords
coords$bead <- rownames(coords)
coords <- coords[c('bead','x','y')]
my... |
459a7edac7867190674bf3c5c895f904bf1fc6873898349e5ff22ce32489b66b | R | 507 | 30 | AAtoDNA <- function(inAA,species="hsa",fullOPT=FALSE,optIt=1){
humanCodon <- read.table(header = TRUE,
stringsAsFactors = FALSE,
text="AA DNA
A gcc
C tgc
D gac
E gag
F ttc
G ggc
H cac
I atc
K aag
L ctg
M atg
N aac
P ccc
Q cag
R cgg
S agc
T acc
V gtg
W tgg
Y tac")
inAA <- toupper(as.cha... |
d2fd8fc2ebb01cc5e4a19352a6e76de31f1ba4585e70346762de2d825c5938c7 | R | 508 | 32 |
# install.packages("gt")
library(gt)
library(tidyverse)
library(webshot)
# webshot::install_phantomjs()
# Read in a csv giving sample data
sampleTable = "./inputFiles/Heart_Sample_Data.csv"
# Output as an aesthetically nice table
sampleDF = read.csv(sampleTable)
myTable = sampleDF %>% gt() %>%
tab_header(
... |
f9cf7e02a69668258db1e8348396989d2a84ca0ddc69c4d862bd0b5ef68c67f2 | R | 514 | 20 | options(bitmapType='cairo')
args <- commandArgs(TRUE)
wd<-args[1]
valueString<-args[2]
replicateMean<-as.numeric(args[3])
replicateStdev<-as.numeric(args[4])
values<-unlist(strsplit(valueString,","))
values<-as.numeric(values)
subsetMean<-mean(values)
subsetSd<-sd(values)
standardError<-(replicateStde... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.