sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
59bf9040070e4e73298b2cf2ccb67b708788ccf64a5c540d4ea458040d23459b
R
2,318
67
### Script to read in many tables and combine them library(tidyverse) library(readr) library(stringr) library(reshape2) #adjust the path to the output of script II_filtering.sh!! files<-list.files(path="/data/share/htp/TRNP1/MPRA_full_300919/MPRA_data/deML/demult/count_summaries/counts/", pattern = ".txt") meta_data ...
f6d158b254e34d3edef0ef83372b68c987426ea5a0a1e7fcdb286c587777cf14
R
2,320
91
t2 <- fread("/groups/umcg-wijmenga/scr02/depict2/Height10/Height_genePvaluesNullGwas.txt", data.table=F) rownames(t2) <- t2[,1] t2 <- t2[,-1] collumns2 <- fread("/groups/umcg-wijmenga/scr02/depict2/Height10/Height_geneVariantCount.txt", data.table=F) t2 <- t2[collumns2[collumns2[,2] > 0, 1], ] c3 <- cor(t(t2[,1:1...
fed6464f287235fb6d03a2cdef9fba3f2239cfbc62487ab56c9b784cadad5ade
R
2,327
113
#' Reset a finished, failed, canceled, or interrupted future to a lazy future #' #' A future that has successfully completed, was [canceled][cancel] or interrupted, #' or has failed due to an error, can be relaunched after resetting it. #' #' @param x A Future. #' #' @param \ldots Not used. #' #' @return #' `reset()` r...
0004f5d1a53abb0609707ec3ba1a5cebbe84fa37cefdd5096accf895adc775ba
R
2,328
70
# this function orders cell clusters by a column in the seurat metadata. i.e. sort seurat clusters by their developmental stage, with clusters # shared between stages ordered in between those stages # col.to.sort (seurat_clusters) is the metadata column which needs to be re-arranged based on the levels in sort.by (or...
48a30fd7231e2ee0813ed8435e7a60b3f61b9bf01443371b664a4c3a687cedb8
R
2,331
60
library("optparse") library(ggplot2) library(ggpubr) library(gridExtra) library(matrixStats) library(plyr) library(data.table) # Get command line arguments option_list = list( make_option(c("-m", "--MetaBrain"), type="character", help="bin file for MetaBrain", metavar="character"), make_option(c("-e"...
9565e1af23ea2277ad6a438a80e60324a585231753bfc9ddfe87bc5f31bfb53d
R
2,334
71
```{r} source("../downstreamer_functions.r") path <- "~/Desktop/depict2/output/sweep/0kb/" files <- list.files(path, pattern = "*.xlsx") kb0 <- lapply(paste0(path, files), read.depict2) names(kb0) <- files path <- "~/Desktop/depict2/output/sweep/15kb/" files <- list.files(path, patter...
8e1fe3e07b901c3fb9ccbc08ce49c1c92789d1a88a2fcafc8fedbc0f31cbb72c
R
2,343
76
#' @tags undo-options undo-envvars #' @tags listenv #' @tags sequential multisession multicore library(future) options(future.debug = FALSE) message("*** Futures - undo R options and environment variables ...") strategies <- supportedStrategies() options(digits = 6L) Sys.setenv(R_DEFAULT_INTERNET_TIMEOUT = "300") ol...
19c0a8516dd77d89252c9f7cba0931b4e41e2188bd613ec7ce9da650f1d484c0
R
2,370
74
#!/usr/bin/env Rscript source <- "./inst/testme" if (!utils::file_test("-d", source)) { stop("Source 'testme' folder not found: ", sQuote(source)) } target <- "./tests" if (!utils::file_test("-d", target)) { stop("Target 'tests' folder not found: ", sQuote(target)) } r_path <- "./R" if (!utils::file_test("-d", r...
59933a23e1e7a2a8bb32fb3101adc5187a7ffd254a2b060f4f3c06476be82165
R
2,387
91
#!/usr/local/R-4.1.2/bin/R library(dendextend) library("optparse") library(reshape2) library(ape) #args = commandArgs(trailingOnly=TRUE) option_list = list( make_option(c("-f", "--file"), type="character", default=NULL, help="dataset file name", metavar="character"), make_option(c("-o", "--...
6227d607a0cc4543841bdb505faa361d221060b815b736b142814736f1e0b25e
R
2,397
82
library(MungeSumstats) library(tibble) library(tidyr) library(readr) library(purrr) library(plyr) library(dplyr) library(stringr) library(forcats) library(data.table) # Snakemake ## Input # path_gwas <- # c("lambert", "kunkle", "marioni", "jansen", "wightman", "bellenguez") %>% # sapply(function(x) snakemake@inpu...
6dbcaefdf5930f4347abdbab5c15c3d7434d65181fe5c9d2dd89ab87c463e567
R
2,403
82
#' @tags interrupt #' @tags detritus-files #' @tags multisession multicore library(future) options(future.debug = FALSE) strategies <- supportedStrategies() strategies <- setdiff(strategies, "sequential") ## IMPORTANT: Skip when testing with 'covr', because value() cancels the ## still-running futures when one of th...
fa708cdf85b53e137d43a8aa601f508428bedd4ddb4616434bb46aedcefd97c7
R
2,403
90
#' @tags futureAssign #' @tags sequential multisession multicore library(future) message("*** futureAssign() ...") message("*** futureAssign() - sequential w/ lazy evaluation ...") delayedAssign("a", { cat("Delayed assignment evaluated\n") 1 }) futureAssign("b", { cat("Future assignment evaluated\n") 2 }, ...
78c7419fb6d70143fea77acf37de86cde82b2e233220b3b3be6b81f432fd7f95
R
2,404
100
#srun --cpus-per-task=1 --mem=200gb --nodes=1 --qos=priority --time=168:00:00 --pty bash -i #remoter::server(verbose = T, port = 55556, password = "laberkak", sync = T) remoter::client("localhost", port = 55508, password = "laberkak") setwd("/groups/umcg-fg/tmp01/projects/genenetwork/recount3/") library(readr) c...
f2e635296f863224fdeca8ea5cb1c1eebeb22ff57956be00ba08b75a049f0d85
R
2,409
79
library(data.table) library(ggplot2) library(patchwork) source('../utils.r') source('../config.r') old_age_path <- file.path( "..", "figure-2", "inputs", "post_predictive_analysis_all_models_combined_imaging_non_imaging_age.csv") df_old <- fread(old_age_path) df_old <- df_old[evaluation == "Generalization"] ne...
e2a9e4984fb428530bfce8b8a69ab29f8ef81a45f5ee394c0aed811bfc1a38de
R
2,417
69
library(Biostrings) library(stringr) library(tidyverse) library(plyranges) library(foreach) library(doParallel) #what I will need to do: # 1) cut out blat matches with the same overlap to the human sequence and same blosum scores #quantify their differences - my guess is that they might be nearly identical and not we...
085a4092decc75334722341bdf472149f98fd5068426b861bf18411510f50c99
R
2,420
93
#' @tags futures resolved value #' @tags list listenv environment #' @tags sequential multisession multicore library(future) library(listenv) dims <- list( NULL, c(1, 6), c(2, 3), c(2, 3, 1), c(2, 1, 3, 1) ) message("*** futures() / resolved() / value() ...") for (cores in 1:availCores) { message(sprin...
4cc5fa37040ec70aa47f3fbb6da6de761f808f229f0941c32242fbb4d1ec9604
R
2,425
97
# Resolution methods ------------------------------------------------------ #' Get the resolution of GENOVA objects #' #' @param x An object from the GENOVA package #' @param ... Optional arguments (not used). #' #' @return A \code{integer} with the resolution #' @export #' #' @note If the \code{ggplot2} namespace is...
0ed2fcb1bb0384939cb3f974e57573ded92e8aa24e8f402165df80fd1f62abb1
R
2,449
103
### script to calculate read length distribution on aligned reads (BAM files) # load libs library(foreach) library(doParallel) source('functions.R') # load tool locations tool_path <- load_tool_location() # set max cores max_cores <- get_max_cores() # from functions.R registerDoParallel(makeCluster(max_cores)) # ge...
06cd7ff4c5a8a1f4170b563e51aa0b8f0392a14ca3268f23f84bf475b4ebbd1b
R
2,451
98
#' @tags dotdotdot listenv #' @tags sequential cluster multisession multicore library(future) library(listenv) for (cores in 1:availCores) { message(sprintf("Testing with %d cores ...", cores)) options(mc.cores = cores) message("*** Global argument '...' ...") sum_fcns <- list() sum_fcns$A <- function(x,...
5aeb4c6070704ca20dedf1906ccc63d16faebb3b61a86a627c5e1a98bff77ec7
R
2,455
47
library(WGCNA) # Load data load(file='rdata/normalized_data.RData') load(file='rdata/differential_expression.RData') d.test <- t(d.norm) # Check for missing values in data check.missing <- goodSamplesGenes(d.test, verbose = 3) check.missing$allOK # Plot data to check for sample outliers sampleDend <- hcl...
6b9aad62b096ab52e0ec39116c24d9c86ff7ef852bdccde97415471e33818176
R
2,456
54
#!/bin/env Rscript # # Author: Alex Eng # Date: 1/18/2018 ############################################################################### suppressPackageStartupMessages(library(argparse)) # Defining arguments and parser for command line arguments parser = ArgumentParser(description = "Calculate community robustness ...
215c764de4704f6d30e42acd49833dfe719c629fe5c8a98753c31a023f8e08b1
R
2,461
98
# Estimate Power curves ## https://www.mv.helsinki.fi/home/mjxpirin/GWAS_course/material/GWAS3.html library(dplyr) library(tidyr) library(purrr) library(janitor) library(tibble) library(glue) library(stringr) library(readr) library(forcats) library(glue) ## Snakemake ### Input adgwas_meta.path = "intermediate/gwas_...
a6e739081208eb22467b273d83eb5cc639a9f16a3102ec98e60e0527df6f6d1f
R
2,465
94
#' @tags workdir #' @tags sequential multisession multicore library(future) message("*** Futures - working directory ...") strategies <- supportedStrategies() owd <- getwd() for (strategy in strategies) { message(sprintf("- plan('%s') ...", strategy)) plan(strategy) ## The working directory should be reset, ...
2eb11e1e33eb9e07deb965620acf440625deb1954da79543562e43adfd89fa1c
R
2,467
88
#' Place a sticky-globals environment immediately after the global environment #' #' @param erase (logical) If TRUE, the environment is erased, otherwise not. #' #' @param name (character) The name of the environment on the [base::search] #' path. #' #' @param pos (integer) The position on the search path where the #' ...
e4697a3cfb27636aa0adf50b87be93aa9c8b152936bc6a1ff834936c2d413ea3
R
2,473
95
--- title: "InvCor" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) setwd("D:/UMCG/Genetica/Projects/Depict2Pgs") library(heatmap3) library(RColorBrewer) ``` ## Genes in arm: 100 number of permutation to determine correlation: 10 ```{r } numberRandomGwas=10 genesInArm=10...
4f114f6b689422210cc0a106896d88340b452fe52e25df3af9349c5b5d09c688
R
2,475
64
#!/usr/bin/Rscript # Normalize counts to TMM library(edgeR) library("optparse") library(data.table) # Get command line arguments option_list = list( make_option(c("-c", "--countsFile"), type="character", default=getwd(), help="path to input count file (e.g. merged STAR counts)", metavar="character")...
f69ed26bd53bb9d0c80ea55da315d95dd42a7a062be6837500ed12a13054e187
R
2,476
80
```{r} setwd("cellline_prediction_model") source("../downstreamer_functions.r") library(caret) sample.annot <- fread("data/sample_annotations_updated_by_patrick.csv", stringsAsFactors = F, sep="\t", header=T, data.table=F) rownames(sample.annot) <- sample.annot$Sample outcome <- sample.annot$CellLine != "" n...
fb102bf363b5e1345a916169179f12cf2aeb9ffb6674bb49b4815421d6b91ebf
R
2,481
66
#' @title Confidence intervals for model parameters #' #' @srrstats {G1.4} Function documented with roxygen2. #' @srrstats {G2.3,G2.3a} match.arg() used on "method" argument. #' @srrstats {G2.3,G2.3b} Arguments parm and method are case sensitive, as stated in #' their documentation. #' @srrstats {G2.1a} Expected data...
1fb8331bbbee2627c856eb82225748e5b38023742e85705aa5e715cf8158a113
R
2,493
75
```{r} setwd("../downstreamer_collaborations/biogen") source("../../downstreamer_main/downstreamer_functions.r") als.wo <- read.depict2("~/Desktop/depict2/collaborations/biogen/als/without_SOD1_c90rf72/2020-04-28-ALS.replication_enrichtments.xlsx") als.asia.wo <- read.depict2("~/Desktop/depict2/collaborations/biogen...
203258f3541ee83e33552689119870a22341dfd4e5e97b0a40a2d317a0fb696c
R
2,505
47
rm(list=ls()) setwd('tldr_pred_rouge_sig_testing') # copied from `significance_tests.csv` file: if(FALSE){ # AO -- \bart vs \ours R1 multi.max ao ....bart.large.20k.titles.20k.tldr..ctrl. bart.large.tldr 0.47441 0.47804 -0.46438 1.4132 0.321391 R2 multi.max ao ....bart.large.20k.titles.20k.tldr..ctrl. bart.larg...
644a8454e67a228c0be27393a8d85fb8e305cd63521ac63a890c78db5dd44537
R
2,537
76
#!/usr/bin/env Rscript ################################################ ################################################ ## LOAD LIBRARIES ## ################################################ ################################################ library(optparse) library(UpSetR) ###############...
f9b5190aeb722bf9d40bac6ac7feaf7a342a573bad092f72f8cb6c663a77a810
R
2,550
78
testme <- as.environment("testme") ## Undo options ## (a) Reset options(oopts0) ## (b) Remove added local({ added <- setdiff(names(options()), names(oopts0)) opts <- vector("list", length = length(added)) names(opts) <- added options(opts) }) ## (c) Assert that everything was undone if (!identical(options(),...
08cc75c0152ae0034dba0e5fcf4f06575dcd617439c8309b43c93b9b71b05b91
R
2,566
111
#' @export #' @keywords internal persp.PESCAn_discovery <- function( x, ... ) { mat <- x$obsexp par(mfrow = seq_len(dim(mat)[3])) # Set default arguments args <- pairlist( x = rev(as.numeric(dimnames(mat)[[1]])/1000), y = as.numeric(dimnames(mat)[[2]])/1000, z = mat, ylab = "5' (kb)", xlab...
64b9ba3c0793adcc4b005e6b669bb4ff1ff9441611f1bec5f4dcc165bc429e17
R
2,570
71
#' Discover transcription factors responsible for transition #' #' \code{discoverTFs} simulates gene perturbations recursively in order to find the transcription factors that drive the transition. #' #' @param max_depth Number of transcription factor (Depth of recursion) #' @param depth Actual depth of the simulation ...
135a44b71f51fa13e65e3482448719b874acf9ac3e42a73addd49686c080dfe2
R
2,571
84
library(yaGST) #' Get at most top 30 confident normal cells #' #' @param NES #' @param pValue #' @param FDR #' @param pval_filter #' @param fdr_filter #' @param pval_cutoff #' @param nes_cutoff #' @param nNES #' #' @return #' @export #' #' @examples top30classification <- function(NES, pValue, FDR, pval_filte...
8839d8c67482f9dacbbe478b1232df986c4261b6bd92a2c1f9d58c100b0ea343
R
2,572
120
#' @tags globals #' @tags local #' @tags listenv #' @tags sequential multisession multicore library(future) library(listenv) oopts <- c(oopts, options( future.debug = FALSE )) message("*** Globals inside local() environments ...") for (strategy in supportedStrategies()) { message(sprintf("- plan('%s') ...", stra...
56e590f19497c4e8cf19ba990d7f553f5169eccab7cf18bdc0d7cf16aa209d05
R
2,580
62
#this code reads HNv3, and celltype specific net, and make edge and node attribute table library(qpcR) hnet <- read.table('~/HumanNetv3/HumanNetv3_networks/HumanNetv3-XC_symbol_LLS.tsv', stringsAsFactors = F) #sort hnet #sort edge alphabetically net <- hnet net <- as.data.frame(t(apply(net,1,sort))) net <- net[,c(2,3...
4a9334239b1c3f513d20d031992895c027e2fc5e6de987e3e1c88a0e99c0850c
R
2,601
92
#' Takes a `ACTIONetExperiment` object and adds the reduced kernel matrix #' #' @param ace ACTIONetExperiment object. #' @param reduced_dim Dimension of SVD used for reducing kernel matrix #' @param max_iter Number of SVD iterations #' @param assay_name Name of assay to reduce. #' @param reduction_slot Name of slot to ...
80f3193853e89b4d6dda83b18ed8646de08625bccb3570eca9523f1b54ee028c
R
2,604
85
# Jansen 2019 ## Jansen, I. E. et al. Nat Genet 51, 404–413 (2019). library(MungeSumstats) library(tibble) library(tidyr) library(readr) library(purrr) library(plyr) library(dplyr) library(stringr) library(forcats) library(tabulizer) library(fuzzyjoin) ## Misc functions calc_se_from_beta_and_l95 = function(or, l95...
1931875e1dcf1bb9f09e334779b6e3be89c9e1d56cdcd91ddb8abf7c2524e8f9
R
2,609
68
## ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- source("0_Shar...
02709d1740c59b6fa296791590340fccc00528be1aba7e7f3f2f4adfd5b30f81
R
2,626
115
#' @tags futureAssign #' @tags listenv #' @tags sequential multisession multicore library(future) message("*** %<-% ...") for (cores in 1:availCores) { message(sprintf("Testing with %d cores ...", cores)) options(mc.cores = cores) for (strategy in supportedStrategies(cores)) { message(sprintf("*** %%<-%% ...
3400aea867f0d8274df4732676459d56e301e1aa502fe854c77ebdc81cd40a66
R
2,629
83
library(yaGST) #' Get at most top 30 confident normal cells #' #' @param NES #' @param pValue #' @param FDR #' @param pval_filter #' @param fdr_filter #' @param pval_cutoff #' @param nes_cutoff #' @param nNES #' #' @return #' @export #' #' @examples top30classification <- function(NES, pValue, FDR, pval_filte...
da863394c4a868c4892efade5d130be590e32c473ff571b65e9ecbd450d0b7ac
R
2,630
98
#' @tags globals recursive #' @tags sequential multisession multicore library(future) ## Test adopted from http://stackoverflow.com/questions/42561088/nested-do-call-within-a-foreach-dopar-environment-cant-find-function-passed-w options(future.debug = FALSE) message("*** Tricky globals requiring recursive search .....
2454bc254ee2dc1bc3f31fe1354928707d383c24a0f34421b8953cbb3f0629d3
R
2,652
68
#' @title Residuals of galamm objects #' #' @description Computes residuals for models fit with [galamm()] using the definitions in #' Chapter 8 of \insertCite{dunnGeneralizedLinearModels2018;textual}{galamm}. #' Define \eqn{y} as the response and \eqn{\hat{\mu}} as the model fit. Importantly, #' \eqn{\hat{\mu}} includ...
fd0b420d31b1a8691041017c0c974b2c2a2ceace58f82a8df343a90f92ed62c8
R
2,660
84
#' @tags cancel #' @tags sequential library(future) options(future.debug = FALSE) plan(sequential) ## A sequential future is resolved already when created, but canceling it ## still makes it invalid for (interrupt in c(TRUE, FALSE)) { message(sprintf("interrupt = %s ...", interrupt)) message(" Cancel a sequent...
b21c9c276f3ccec36556ca517b633c3f38fe12f6741b6040043202835e0cea59
R
2,670
85
setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs\\LudeEigen") library(readxl) read.depict2 <- function(path, potential_traits=NULL) { if (is.null(potential_traits)) { potential_traits <- excel_sheets(path) potential_traits <- potential_traits[grep("Overview", potential_traits, invert=T)] } output <-...
4b9cf7073f590f4a80204651193ba5da3e710cae6f0f45a0f254f9ee7d22c3a5
R
2,673
80
```{r} setwd("evaluating_coregulation") source("../downstreamer_functions.r") source("data/source_olivier.r") library(ggsignif) # Read reference datasets ensembl <- read.table(ensembl.file, sep="\t", header=T, row.names = 1, stringsAsFactors = F) ensembl$gene.length = ensembl$Gene.end..bp. - ensembl$Gene.start..bp. r...
fea55d0cf8f9a64c6be76c8aa1ba8bc7c8b88fe3d3aff0c455b3759d9e18fe5a
R
2,677
66
# This tests the aggregator function. # library(testthat); library(SingleR); source("setup.R"); source("test-aggregate.R") library(SingleCellExperiment) sce <- as(.mockRefData(nreps=50), "SingleCellExperiment") sce <- scrapper::normalizeRnaCounts.se(sce, more.norm.args=list(delayed=FALSE)) test_that("aggregateReferen...
a0a3038fa2e1cc87dc7f1717ec1ea77bd2ab8fcfadfa0c63b59263ba8d4e6e32
R
2,678
107
#' Title #' #' @param theta #' @param betX #' @param pi1 #' @param sig1 #' @param w8s #' @param m0 #' @param nX #' @param bn #' @param bins #' @param M #' #' @importFrom stats fft sd #' #' @return #' NOT EXPORTED @export #' @keywords internal #' #' @examples singleTrait_likelihood <- function(theta,betX,pi1,sig1,w8s,m0...
81fa754deef40f7c58e389fbe9f769a439c9899493ea500b8d17642c2ba8df70
R
2,687
90
#' Get the percentage cis-contacts genome-wide or from a region #' #' @param exp A contacts-objects or a list of them #' @param bed A bed-dataframe or a (named) list of them. #' #' @section Resolution recommendation: 500kb-1Mb #' #' @return A data.table with the sample, percentage and region. #' @export cis_trans = f...
87e3ecde2f0b8c733cd6538d03ee4c9def8b09b4ef6e118937dcd3962b555d66
R
2,690
72
#' Mock data for examples #' #' Make up some test and reference data for the various examples in the \pkg{SingleR} package. #' #' @param ngroups Integer scalar specifying the number of groups. #' @param nreps Integer scalar specifying the number of replicates per group. #' @param ngenes Integer scalar specifying the nu...
65889b554c61ecf7f792622fd66179d286b73166406b47f71d49555b229872d7
R
2,694
87
library(data.table) library(ggplot2) library(ggbeeswarm) library(patchwork) source('../config.r') source('../utils.r') DT_cond_proxy <- fread('mod22_cond_proxy.csv') DT_cond_proxy_bs <- fread('mod22_cond_proxy_bs.csv') DT_cond_target <- fread('mod22_cond_target.csv') DT_cond_target_bs <- fread('mod22_cond_target_bs.cs...
7f35d513de97311672cd480c41a1ac28472e5499dbfb7109bcee0aa620beaaa3
R
2,696
88
library(data.table) library(ggplot2) library(ggbeeswarm) library(patchwork) source('../config.r') source('../utils.r') DT_cond_proxy <- fread('mod23_cond_proxy.csv') DT_cond_proxy_bs <- fread('mod23_cond_proxy_bs.csv') DT_cond_target <- fread('mod23_cond_target.csv') DT_cond_target_bs <- fread('mod23_cond_target_bs.cs...
3dfa31a1ce2a48e115914f9978bbcd7eb29ffc77f40476e221760eeb69996c8a
R
2,713
84
#' @tags utils-internal early-signaling sequential #' @tags deprecated ## plan(..., earlySignal = TRUE) is deprecated as of future (> 1.68.0) library(future) signalEarly <- future:::signalEarly message("*** signalEarly() - no early signaling ...") plan(sequential) ## A future that is not flagged for early signalin...
051dd28a82aea20583e66a7903d85ad9a5855effa6f516ccc42c84b8b47f6261
R
2,714
96
#' @tags worker-killed #' @tags cluster library(future) library(listenv) options(future.debug = FALSE) ## IMPORTANT: Since we're killing parallel workers, some of them will not ## get a chance to clean up their R temporary folders. Here we configuring ## them to use temporary folders with this R process temporary fo...
b9f00b3d2be77af6bae32fa25067af9a18c12945a1e6fd527cb689f6042977b5
R
2,734
69
library(readxl) library(ggplot2) source("~/Documents/projects/pr_integration/wd_integration/Code/UtillityScripts/PlottingFunctions.r") library(gridExtra) make.plot <- function(trait) { ced <- data.frame(read_excel("/home/work/Documents/tmp/CeD_Z-scores_enrichtments_exHla.xlsx", sheet=trait), row.names=1) ced.ichip...
8a843a0e2fdc06e505f0c37f10823e5fe0a2c7016d21e2446079de00a893b16b
R
2,737
65
# Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #' Straw Quick Dump #' #' fast C++ implementation of dump. Not as fully featured as the #' Java version. Reads the .hic file, finds the appropriate matrix and slice #' of data, and outputs as d...
1dbe4a030ee1357be188b2efd3b3d43e19b2d30c3c098e048a9cea3a32fdf65e
R
2,753
75
```{r} setwd("evaluating_pvalues") source("../downstreamer_functions.r") #source("data/source_olivier.r") height <- read.depict2("data/height_2018_30124842_hg19/height_2018_30124842_hg19_enrichtments.xlsx") height.emp <- read.enrichments.as.list(list.files("data/height_2018_30124842_hg19/", pattern="*true*", fu...
2c13b5d9f16659189bf69b9c8f83a2f0803deff9448e7f75ff387d645fe04f29
R
2,753
73
### Data clustering #' Create clustered heatmaps of the samples #' #' @param d Input a dataframe with expression values, using the Protein IDs as rows, samples as columns. Works best if values are centered and scaled. #' @param ann_col Dataframe with groupings per sample. Rownames are the sample names, single co...
8b1f184a31d17d3336ab39b0f29ebc773f82f6cb39e25aa8a7670b047816c684
R
2,779
77
library(data.table) library(matrixStats) library(DescTools) # Read expression data from bios exp.bios <- fread("zcat exp.tmm.log2.covCorrect.freeze2.txt.gz", data.table=F) rownames(exp.bios) <- exp.bios[,1] exp.bios <- exp.bios[,-1] cn <- colnames(fread("zcat exp.tmm.log2.covCorrect...
ac85a93d0c263cef70903c33e98d7ca5070f099746528b15fcaf828abad93588
R
2,802
97
#' @tags reset sequential library(future) plan(sequential) message("*** reset() - default ...") ## Objects that are not futures are returned as-is stopifnot(identical(reset(42L), 42L)) stopifnot(identical(reset("abc"), "abc")) stopifnot(is.null(reset(NULL))) message("*** reset() - default ... DONE") message("***...
2b4bee2784e339d08416f706faece2829b9ed2a430df0e876d40016eddeb45b1
R
2,805
60
#remoter::server(verbose = T, port = 55557, password = "laberkak", sync = T) remoter::client("localhost", port = 55557, password = "laberkak") setwd("/groups/umcg-wijmenga/tmp04/projects/depict2/") library(readr) table_tmp <- read_delim("depict2_bundle/reference_datasets/human_b37/pathway_databases/gene_network/hpo_p...
16d32910c5956cc6671e97a787ca37b507be299dddd5926f848d82d99483d051
R
2,819
104
#' @importFrom beachmat initializeCpp tatami.row.nan.counts #' @importFrom SummarizedExperiment assay #' @importClassesFrom SummarizedExperiment SummarizedExperiment #' @importFrom DelayedArray DelayedArray .to_clean_matrix <- function(x, assay.type, check.missing, msg="x", num.threads=1) { if (is.null(rownames(x))...
d2508de291f4bd4303fd6dee8356c42d2e5135fac49169d5116c5c5b743e851c
R
2,828
79
library(DESeq2) library(gplots) library(tibble) args <- commandArgs(trailingOnly = TRUE) jobID <- args[1] tablePath <- args[2] inputFolder <- args[3] outputFolder <- paste("./tmp/",jobID,sep="") sampleTable <- read.csv( tablePath, sep="\t" ) for( readType in c("exonic","intronic") ) { print( paste("Analyzing ", r...
3c74badd543aa02052c6f09876b3c6fba96aea98398061de32d1f1f94fa402cc
R
2,852
98
#' An uniprocess future is a future whose value will be resolved synchronously in the current process #' #' @inheritParams Future-class #' #' @param \ldots Additional named elements passed to [Future()]. #' #' @return #' `UniprocessFuture()` returns an object of class `UniprocessFuture`. #' #' @export #' @name Uniproc...
f31a7cf1bbce6b6473a9a842af5b3d76ee14e5bcbe3f01cfe90be40daabdac47
R
2,858
82
source ("Library.R") #####melanogaster#### data= NULL for (i in 1:5) { sname <- paste("Fly",i, sep="") .data = read.xlsx("raw_data_imaging_2F.xlsx",sheetName= sname) %>% dplyr::mutate(Fly = paste(i)) %>% tidyr::gather(key = Frequency, value = response, -Frame, -Fly) .data$Frequency = str_sub(.data$Freq...
a9a9e1ddb8523282cfc09cbc20927df2d47ef663e56553a3035196f918000e2e
R
2,860
90
#' Validates an ACTIONetExperiment (ACE) object #' #' @param object ACTIONetExperiment object #' #' @importFrom BiocGenerics NCOL NROW setValidity2("ACTIONetExperiment", function(object) { NR <- NROW(object) NC <- NCOL(object) msg <- NULL # 2D value = object@rowNets for (i in seq_along(valu...
3124d2f091b6635063ac28af2b29d9057543f97254d369117a9e7a41f30ce024
R
2,872
91
#' @tags resolved #' @tags sequential multisession multicore #' @tags skip_on_cran library(future) options(future.debug = FALSE) ## Don't poll too frequently in order for these tests to not fail options(future.wait.interval = 0.1) message("*** resolved() - assert non-blocking while launching lazy futures ...") for ...
6d8a735500a0964cdfcd5709ade989d341fb990c546d6bd420adc0c279604ea3
R
2,872
73
#' @tags multithreading #' @tags multicore library(future) plan(multicore) message("*** multicore() and multi-threading ...") message("supportsMulticore(): ", sQuote(parallelly::supportsMulticore())) message("availableCores('multicore'): ", sQuote(availableCores("multicore"))) message("supports_omp_threads(): ", sQ...
6e437d460098a141728b0b2de806c39ad1ff0b39d2623b9e48cb4069b6d0ccbd
R
2,873
109
#' @tags futureOf #' @tags listenv #' @tags sequential library(future) library(listenv) message("*** futureOf() with listenv ...") message("*** futureOf() with listenv - future assignments ...") x <- listenv() x$a %<-% { 1 } %lazy% TRUE f1 <- futureOf("a", envir = x) print(f1) f2 <- futureOf(a, envir = x) f3 <- fu...
5051ff4dcd8618ed1272be087df5de8e92ad069767296e5b8c980357c5bd3ce6
R
2,880
99
--- title: "ML Code Completeness Checklist Analysis" output: pdf_document: default html_notebook: default --- This notebook contains the ML Code Completeness analysis for NeurIPS 2019 repositories. For a run & rendered version of this notebook please see: [code_checklist-analysis.pdf](code_checklist-analysis.pdf...
060d9152dc7998fbce2b40182d2bc6fc7ab9d49801ae33a7e46ea96bcec2843a
R
2,883
31
--- title: "Classification of racehorse limb radiographs using deep convolutional neural networks" author: - Costa da Silva, Raniere Gaia; Department of Infectious Diseases and Public Health, City University of Hong Kong, Tat Chee Avenue, Kowloon, Hong Kong SAR China - Mishra, Ambika Prasad; Department of Infectious Di...
025c89287e2038341895c4a1f1c7db0fb72cff96a079579f1bdf065972930468
R
2,887
105
#' @tags libPaths #' @tags detritus-files #' @tags detritus-connections #' @tags multisession #' @tags skip_on_cran covr_testing <- ("covr" %in% loadedNamespaces()) ## These tests requires multisession workers if (parallelly::availableCores() >= 2L) { library(future) options(future.debug = FALSE) normalize_l...
6d9e3d84454a4fd1d808870abb59f0cce2d3acbc6ee65a05291478931701e522
R
2,893
94
## Lambert, J.-C. et al. Nat Genet 45, 1452–1458 (2013). library(MungeSumstats) library(tibble) library(tidyr) library(readr) library(purrr) library(plyr) library(dplyr) library(stringr) library(forcats) library(tabulizer) library(fuzzyjoin) ## Misc functions calc_se_from_beta_and_l95 = function(or, l95){ logOR ...
6ca33b8e7f81f02291dd01c2ba22bf88575ea773625ab326c7f129e3e18ec99c
R
2,895
150
setwd("D:\\UMCG\\Genetica\\Projects\\Depict2Pgs") load("keyCisTransRare/key_gene_overlap_files_for_patrick.RData") row.names(hpo.gwas.link) str(key.genes) gwasPthreshold <- 0.05/nrow(gene.pvalues) gene <- rownames(gene.pvalues)[2] gene <- "ENSG00000179455" gene <- "ENSG00000173452" trait <- row.names(hpo.gwas...
89e178b8e919a2115de32958b17af42b68d28d633f3a83b8a6498d86655e54c0
R
2,898
110
#' Pre-processed genesets from the gProfiler database (Human) #' #' @format: #' SYMBOL: A list of gene x geneset indicator matrices in the sparseMatrix format (rownames are gene symbols) #' ENSEMBL: A list of gene x geneset indicator matrices in the sparseMatrix format (rownames are ENSEMBL gene IDs) #' #' @source ...
8c89fb58c98b8630aa085ed8e65384cc7ab0c579b975a0dadd887a9891657bc2
R
2,900
91
library(data.table) library(gridExtra) library(grid) library(ggplot2) library(lattice) library(viridis) zscores <- fread('2020-02-26-zsore_table.txt', header=T, na='-') zscores_topSNP <- zscores[order(zscores$qtl_FDR),] zscores_topSNP <- zscores_topSNP[!duplicated(zscores_topSNP$gene),] colnames(zscores) <- gsub(...
5d444789c295046ee8ee1afa8cd13baef2cab10936308830212fd087317a1e39
R
2,904
95
#' @tags cancel #' @tags detritus-files #' @tags detritus-connections #' @tags sequential multisession multicore cluster library(future) options(future.debug = FALSE) ## Backends to test, including cluster with interrupts disabled plans <- list() for (strategy in supportedStrategies()) { plans[[strategy]] <- list(s...
02f19a773f0796ec40b958337f26b05ca62ccbb05b62a30bec973083c27d6f4a
R
2,909
100
#' @tags invalid-owner #' @tags detritus-files #' @tags multisession library(future) options(future.debug = FALSE) ## Local functions usedNodes <- function(future) { backend <- future[["backend"]] ## Number of unresolved cluster futures workers <- backend[["workers"]] reg <- backend[["reg"]] c(used = length...
6f3e6aa955c115e340869d4566a5a8e56b2616e55c0a0017afc9b6b5554331d2
R
2,913
90
#*********************************************************************************** # Defining a function (neighbourhod) %%% #*********************************************************************************** neighbour<- function(C_Best, Min_Neuron , Max_Neuron, itrn, t...
d6e06c69e35de8f59f84bc4b881c44e03027317f697ab71907949db9fd2214f1
R
2,940
79
library(tidyverse) library(xtable) #function summarize_cor_output<-function(path_to_cov_file){ L <- readLines(paste0(path_to_cov_file)) #get the included parameters params1<-which(grepl("entries are", L)==T) params2<-which(grepl("covariances", L)==T) params<-L[(params1+1):(params2-2)] #correlations & ...
512c4cdb3b89cb2f01f6482c202993a950720d02af286566f36b64b4407f7883
R
2,941
78
#' @tags dotdotdot #' @tags sequential cluster multisession multicore library(future) message("*** Global '...' and ...future.FUN() in custom environments ...") ## BUG FIX: https://github.com/futureverse/future.apply/issues/130 for (cores in 1:availCores) { message(sprintf("Testing with %d cores ...", cores)) o...
34b4e4ec3bced1614b38e2991e7f288f8673e251a3f42d4dba307c76bc9dcef3
R
2,949
110
# LD Structure ## Assign variants to index snps library(dplyr) library(tidyr) library(purrr) library(janitor) library(tibble) library(glue) library(stringr) library(readr) library(forcats) # library(LDlinkR) ## Snakemake ### Input path_snps <- snakemake@input[["snps"]] ### Output out_ld <- snakemake@output[["ld"]] o...
4921032de782d63e73027c99807a02390c9844e7d12aa45e61a0c27db6ff2f44
R
2,956
97
library(data.table) library(ggplot2) library(ggbeeswarm) library(patchwork) source('../config.r') source('../utils.r') DT_cond_proxy <- fread('modS3_cond_proxy.csv') DT_cond_proxy_bs <- fread('modS3_cond_proxy_bs.csv') DT_cond_target <- fread('modS3_cond_target.csv') DT_cond_target_bs <- fread('modS3_cond_target_bs.cs...
73ed4bfceac43893c442bfba9326f0cb657af0d71e6f2b95193067e334963b25
R
2,963
118
test_that("Interaction between latent and observed covariates works", { formula <- y ~ type + x:response + (0 + loading | id) data <- latent_covariates load_var <- "type" lambda <- matrix(c(1, NA, NA), ncol = 1) factor <- "loading" factor_interactions <- list(~1, ~1, ~x) mod <- galamm( formula = form...
13602679ad5fe15410d39766f62fe07b15391cdd85c526e05dc77373397aba47
R
2,966
45
library(Seurat) ###load the packages library(SeuratWrappers) library(velocyto.R) Idents(rh.combined)<-"celltype" rhc <- subset(rh.combined,treat=="Ctrl") rhh <- subset(rh.combined,treat=="HFD") ##### #####run velocity rhc <- RunVelocity(object = rhc, deltaT = 2, kCells = 25, fit.quantile = 0.02,ncores = 50,spliced.ave...
c8116714563c47b93f839eee4b0492387972ff3709353255ebc2f35f8175b937
R
2,973
56
### Perform the beta binomial test to assess significance of differential expression #' Perform the beta binomial test to assess significance of differential expression #' Subsequently fits a beta uniform mixture model to match P-values with FDR values #' #' @param d Input a dataframe with the Protein IDs as row...
4fdf4f5e7eab6911063441aac2ca1eb5f509a9d7700a59df983ae138d77e3809
R
2,979
95
## Wightman, D. P. et al. Nat Genet 53, 1276–1282 (2021). library(MungeSumstats) library(tibble) library(tidyr) library(readr) library(purrr) library(plyr) library(dplyr) library(stringr) library(forcats) library(tabulizer) library(fuzzyjoin) ## Misc functions calc_se_from_beta_and_l95 = function(or, l95){ logOR...
09f4259bddd5537553422614836674b1769798c93e1e88b84bf6d35273d96e96
R
2,984
81
#Testing networks for scale-free topology using the poweRlaw package #Networks are retained given p-values above a threshold of p=0.1, #meaning that the power law is a plausible hypothesis for the data, #as described by Clauset et al. (2009), Power-Law Distributions in Empirical Data #Running this script required 1.0...
382b4b6839881df21333fe8cf1883c21c35cbbf3048005d3af7d9dc017c49154
R
3,000
56
setwd(paste0(figureDirectory, "Figure4-Meta-Information")) library(ggplot2) library(cowplot) load("metaInfoDF.RData") metaInfoDF$alive <- "" metaInfoDF$alive[metaInfoDF$Patient == "P39-Blun"] <- "*" plotLegend <- ggplot(metaInfoDF, aes(shape=TherapyTissue,y=survivalBM , x=numDifCpG,color = negScore ) ) + geom_p...
69270c0ee1a86c8c59367f1e592b6648c970f77bc7ec2c119261a5d21dc654c4
R
3,004
127
#' @tags globals tricky #' @tags listenv #' @tags sequential multisession multicore library(future) not_cran <- isTRUE(as.logical(Sys.getenv("NOT_CRAN", "FALSE"))) options(future.debug = FALSE) message("*** Tricky use cases #2 related to globals ...") for (cores in 1:availCores) { message(sprintf("Testing with %d ...
3fb22ec56c0d2cabdc5ee6aa52b5b70e09ef13d34182a06384846585044c91d1
R
3,025
85
#### function to load ssMwwGst <- function(geData, geneSet, ncore, minLenGeneSet = 15 , regulon = FALSE, filename, standardize = TRUE){ library(yaGST) if (standardize){ means <- rowMeans(geData) sds <- apply(geData, 1, sd) } # library(doMC) # registerDoMC(ncore) # ans <- foreach(ss = 1:ncol(geData)...
e5d363bd22a49df3d23ade31c41162b8390898a641907ceee5ec9b821cab892b
R
3,030
89
.columnName <- function (x, i) { paste0(x$channelNames[i], " [", x$channelUnits[i], "]") } # this function can be applied to the return value of readABF as.data.frame.ABF <- function (x, row.names = NULL, optional = FALSE, ..., sweep = NULL, type = c("all", "one"), ...
68cc5f6492afe25637fbc5040b48e9dde2296e44f80f7893f02ca340f59e859e
R
3,051
128
### script to pre-process and map/align sequencing reads # load libs source('functions.R') # load parameters conf <- load_mapping_config() # load tool locations tool_path <- load_tool_location() # set max cores max_cores <- get_max_cores() # from functions.R # get args get_dir <- commandArgs(trailingOnly = TRUE) ...
02869ce22c783e3b5e04ec17b9cff609f36ad4c4192b218139aa96cfc3daacd9
R
3,073
83
# # rnaseq.analysis.R # # Copyright (c) 2013-2013 GBIC: Danny Arends, Harm-Jan Westra, Lude Franke and Ritsert C. Jansen # last modified Jul, 2013 # first written Jun, 2013 # setwd("~/Github/systemsgenetics/eqtl-mapping-pipeline/src/main/scripts") source("helper.functions.R") setwd("~/Github/Juha/") # Load the RNA seq...
a080ee15dbdc6df7fbeadf4b9fc28acc066f696010b6094a52cc97ef0d13e498
R
3,075
115
library(BioCircos) library(RColorBrewer) # adj.dir = 'out/exp3/SEA_AD_BrainAtlas/2000/Oligo/plot/adj/central-100/0.01' adj.dir = '.' # adj.dir = "Desktop/Gerald/RitaFetalLiver/central-100/0.01" file.list = list.files(adj.dir) file.list = file.list[grep('csv',file.list)] # file.list = file.list[grep('siVAE',file.list)]...
81593dcdf1c01e7716964f4a10e87c48473ae9c262ea1f5dddd9bd6f25d77ccd
R
3,076
93
if (getRversion() >= "4.4.0") { library(future) library(parallel) parse_attach_packages <- future:::parse_attach_packages message("parse_attach_packages() - supported expressions:") exports <- list(pkg = "tools", n = 42) exprs <- list( quote(library(tools)), quote(library("tools")), quote(base...
1a3f3cf9de2084096779c7fe1d494aa35c8832798d2d9809295467301470ca8f
R
3,096
84
########################################################################################## ## Generate seurat tSNE plots for ASD baits using scRNA-seq data from Velmeshev2019 ## ## Author: Yu-Han Hsu ########################################################################################## rm(list=ls()) library(Seura...
2584a0a41b3cbd3bd3bf0eba6a888db315424e6ddf06a992d056982110cd138e
R
3,096
111
#' Converts a SummarizedExperiment object to an ACTIONetExperiment object. #' #' @param from SummarizedExperiment object #' #' @exportMethod coerce setAs("SummarizedExperiment", "ACTIONetExperiment", function(from) { ace = ACTIONetExperiment( assays = SummarizedExperiment::assays(from), rowData = from@...
2ea1108c948e563525fc600576b84e981811fd57293efb01ac2dfbd3699ae9ad
R
3,105
87
#### function to load ssMwwGst <- function(geData, geneSet, ncore, minLenGeneSet = 15 , regulon = FALSE, filename, standardize = TRUE){ library(yaGST) if (standardize){ means <- rowMeans(geData) sds <- apply(geData, 1, sd) } # library(doMC) # registerDoMC(ncore) # ans <- foreach(ss = 1:ncol(geData)...