sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2ae98930bb603f5cd8ad01e27d2a67dd3e93d9244a00e380a90f49e32fc5a966
R
2,330
59
########################################################################### ## Author: Youtao Lu <luyoutao@sas.upenn.edu> ## ## Copyright (c) 2021-2023, Youtao Lu and Junhyong Kim, Department of Biology, University of Pennsylvania ## Copyright (c) 2021-2023, James Eberwine, Perelman School of Medicine, University of ...
b205648ca3ec14708f51ee01dd388928e157b4775e225cf9523f93ff98201349
R
2,335
48
# Sconda conda activate TensorFlow_CPU_01; cd /mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN/results/cross_validation_allsamples; R #!/usr/bin/R options(width=240) library(ggplot2) library(viridis) wkdir = '/mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN...
9f3f492dc123bd272dfb1b75b2ff25f3020c470bf29cfae6e4a7c374187f75d3
R
2,343
76
#' Run factR workflow #' #' @description This wrapper function will perform the core factR workflow which #' includes: #' \itemize{ #' \item{1: }{ Building CDS structures } #' \item{2: }{ Predicting NMD-sensitive transcripts } #' \item{3: }{ Translating open-reading frames } #' \item{4: }{ Quantify sequence conserv...
e1b3258aee6b9325fad92e008aa04425b8573bf6129f201a00c0f25a19494e20
R
2,347
49
#' @templateVar MODEL_FUNCTION choiceRT_ddm_single #' @templateVar TASK_NAME Choice Reaction Time Task #' @templateVar TASK_CODE choiceRT #' @templateVar MODEL_NAME Drift Diffusion Model #' @templateVar MODEL_CODE ddm #' @templateVar MODEL_CITE (Ratcliff, 1978) #' @templateVar MODEL_TYPE Individual #' @templateVar DATA...
30974a6c88e5cd8ae9166cd5e265ddf28cafe2a009cea08d362fabd1f666ccc6
R
2,348
40
#' Fit generalized linear model under the null hypothesis for imbalanced case-control unrelated samples. #' #' The \code{fit_null_glm_Binary_SPA} function is a wrapper of the \code{\link{glm}} function from the #' \code{\link{stats}} package that fits a regression model under the null hypothesis for #' imbalanced case-...
bb18ed69098cd9437caa49f2615ea782978685d713fff34e073628a5343d1913
R
2,348
76
library(tidyverse) library(ggrepel) limma_coefs <- readRDS(here::here("results/limma/limma_coefs.Rdata")) placenta_fetal_tbl <- limma_coefs %>% map(.x = ., .f = ~ filter(.x, treatment == "exposureLPS")) %>% map(.x = ., .f = ~ select(.x, -c(treatment))) %>% map(.x = ., .f = ~ mutate(.data = .x, gene_id ...
cc7ff7e0f2b354ed11aefe037c129c60f05552e136abe6e20d68b079a108f434
R
2,348
61
#'################################################################################# #'################################################################################# #' Prepare GSE179848 dataset #'################################################################################# #'#####################################...
08dbb09257d1e834de9fe3164fabff70ffc80e5508997aef8c6aca1e3ae4d08b
R
2,353
56
library(readxl) library(dabestr) library(dplyr) library(tidyr) #1. load excel or csv file containing n-NRF magnitudes "both_sites_magnitudes.csv" both_sites_magnitudes <- read.csv("both_sites_magnitudes.csv") #2. create dataframe for Exeter magnitudes separately exeter_magnitudes <- both_sites_magnitudes[both_sites_m...
89b3ef0b774bce3da8198ac73122e95809c793921ef3c10e99f7bede4cd9fdd1
R
2,354
70
args = commandArgs(TRUE) eta=as.numeric(args[1]) max_depth=as.numeric(args[2]) gamma=as.numeric(args[3]) min_child_weight=as.numeric(args[4]) nrounds=as.numeric(args[5]) data_folder=as.character(args[6]) sex_split=try(as.logical(args[7])) BrainAgeFull = function(eta, max_depth, gamma, min_child_weight, nrounds, data...
c6bed5bde0b482aef94af4ca75f348588b7f6dedff7aee6c5c2517618b33073a
R
2,357
82
library(Seurat) library(SeuratData) library(ggplot2) library(patchwork) library(dplyr) library(scatterpie) library(RColorBrewer) library(grDevices) set.seed <- 1234 file_path <- '/data/work/uniPort/Brain_SPOT/' #----------------------------------------------------------- # input data for uniPort #-----------------...
4a0902df44d36b9d9e3712474ba8c33e9f2da388a9b29e7980cdd2152a3f7d64
R
2,360
63
library(ggplot2) library(tidyverse) save_plot <- function(p, fn, w, h){ for(ext in c(".pdf", ".svg")){ ggsave(filename=paste0(fn,ext), plot=p, width=w, height=h) } } load_DEG_enrichment <- function(){ return(data.table::fread("clincial_phenotypes_enrichment_analysis_DEGs.tsv")) } memDEG <- memoise...
b958676ff28ba017388b55f69663a2113454f8a988607736e56cfff967dedfe4
R
2,363
77
# Adapted from mlbook2_prepare_data.r # Snijders and Bosker 2012 # This script reads the original data set, does minimal transformations, # and saves to /data # Note: this file preserves all information # read data library(haven) library(dplyr) project <- path.expand("~/Package/mice/multilevel/Snijders") fn <- file.pa...
1826b7bce7c0bbfb54e13c1b9789271eefa07e00ecf43fd2291552628c1dc8a8
R
2,376
68
#' Evaluate an expression in multiple imputed datasets #' #' Performs a computation of each of imputed datasets in data. #' #' @param data An object of type \code{mids}, which stands for 'multiply imputed #' data set', typically created by a call to function \code{mice()}. #' @param expr An expression to evaluate for e...
4fe9f262da6c80f9064abf3a4cc6a9f89912bb24f6c884267283a74d8a9a0f5a
R
2,376
51
#' @templateVar MODEL_FUNCTION cra_linear #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/jaeyeong-yang/}{Jaeyeong Yang} <\email{jaeyeong.yang1125@@gmail.com}> #' @templateVar TASK_NAME Choice Under Risk and Ambiguity Task #' @templateVar TASK_CODE cra #' @templateVar MODEL_NAME Linear Subjective Value...
2ce01c7f522297c2f870ea4eb108a5fcef885a95663f128ffc07364f1e171e0b
R
2,379
49
#' @templateVar MODEL_FUNCTION igt_pvl_delta #' @templateVar TASK_NAME Iowa Gambling Task #' @templateVar TASK_CODE igt #' @templateVar TASK_CITE (Ahn et al., 2008) #' @templateVar MODEL_NAME Prospect Valence Learning (PVL) Delta #' @templateVar MODEL_CODE pvl_delta #' @templateVar MODEL_CITE (Ahn et al., 2008) #' @tem...
460e87f13815330a654341dbd1e64ea2dbf6c26269be61ecdb10b713337195ba
R
2,382
49
#' Plots highest density interval (HDI) from (MCMC) samples and prints HDI in the R console. #' HDI is indicated by a red line. #' Based on John Kruschke's codes. #' #' @param sample MCMC samples #' @param ci_prob A scalar between 0 and 1, indicating the mass within the credible interval that is to be estimated. #' @pa...
908e3c98f1cf9b119b6e004e53f436a33f9bdc8b864b04b494ba63a47cf6a22e
R
2,383
47
#' @templateVar MODEL_FUNCTION banditNarm_delta #' @templateVar CONTRIBUTOR \href{https://github.com/cheoljun95}{Cheol Jun Cho} <\email{cjfwndnsl@@gmail.com}> #' @templateVar TASK_NAME N-Armed Bandit Task #' @templateVar TASK_CODE banditNarm #' @templateVar TASK_CITE (Erev et al., 2010; Hertwig et al., 2004) #' @templa...
7c59247db4d55922991b87cc57f2b2508c7dcb93993d86e447957e530985479e
R
2,388
67
#2 Merge data and clustering # Setup--------------------------------------------------------------- rm(list = ls()) ; gc() ; gc() set.seed(1234) wdir <- 'set your working directory' setwd(wdir) save.path <- 'object folder path' # load library easypackages::libraries(c('Seurat','tidyverse','harmony')) # merge object...
382632ccfb51f586963f07eaafe8c9da825dbaf8a75e10f216882285313c61c7
R
2,390
77
#Computing cell type expression with bMIND, swCAM and TCA ##load bulk-tissue data and cell-pooled reference load('rosmap_covcorrected_bulk.RData') load('props_rosmap.RData') load('rosmap_meanref.RData') bulk<-as.matrix(combat_expr) ref<-as.matrix(meanexp) sdtmp<-apply(ref,1,sd) ref<-ref[sdtmp!=0,] tmp<-...
807b7d42380937f2078b50969a9e3ab6a43f8f581b4325c069a3bd7a0f46036d
R
2,390
97
#' @export broom::tidy #' @export broom::glance #' Tidy method to extract results from a `mipo` object #' #' @param x An object of class \code{mipo} #' @param conf.int Logical. Should confidence intervals be returned? #' @param conf.level Confidence level for intervals. Defaults to .95 #' @param ... extra arguments (...
858408783f45959257205b1a715a0249fb50e0d4f0fc86c130793c59f8065a76
R
2,391
47
#' @templateVar MODEL_FUNCTION peer_ocu #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park} <\email{hrpark12@@gmail.com}> #' @templateVar TASK_NAME Peer Influence Task #' @templateVar TASK_CODE peer #' @templateVar TASK_CITE (Chung et al., 2015) #' @templateVar MODEL_NAME Other-C...
fe26f920b6a8e757f5d93e80b783d11b419027dff296209655c1bf31ecb7e824
R
2,394
51
#' @templateVar MODEL_FUNCTION cra_exp #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/jaeyeong-yang/}{Jaeyeong Yang} <\email{jaeyeong.yang1125@@gmail.com}> #' @templateVar TASK_NAME Choice Under Risk and Ambiguity Task #' @templateVar TASK_CODE cra #' @templateVar MODEL_NAME Exponential Subjective Val...
25d134e61b0e676e0517afa2fde1ba096461a3dd5f2821eea4bffa4d4e757a91
R
2,399
84
#' Cross Geom #' #' @param sig.level significance threshold. #' @inheritParams ggplot2::layer #' @inheritParams ggplot2::geom_segment #' @section Aesthetics: #' \code{geom_cross()} understands the following aesthetics (required #' aesthetics are in bold): #' \itemize{ #' \item \strong{\code{x}} #' ...
8b7efab99a5642c5352cd44990a34c013965629e3997c076b9ef16d6a052f21b
R
2,399
71
```{r} library(SONAR) library(here) library(Matrix) library(data.table) library(Seurat) library(matlabr) library(R.matlab) ``` ```{r} libd_sc_df = fread("libd_sc_df2.csv") libd_st_df = read.csv("libd_st_df.csv",row.names = 1) libd_st_coord = read.csv("libd_st_coord.csv",row.names = 1) libd_sc_labels = read.csv("libd_sc...
a699196e994e820da3020ead8e21c07d7a6fd8becda43c566c6dec13c6e8cbdc
R
2,400
50
#' @templateVar MODEL_FUNCTION prl_fictitious_multipleB #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/jaeyeong-yang/}{Jaeyeong Yang (for model-based regressors)} <\email{jaeyeong.yang1125@@gmail.com}>, \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park (for model-based regressors)} <\emai...
f172641413235bebe626986a4443489501607704d9d6aba565a7d92c52db5a58
R
2,403
90
#context("Test factR object") # setup GRanges gr1 <- GenomicRanges::GRanges( seqnames = "1", strand = rep("+", 5), ranges = IRanges::IRanges( start = c(1, 401, 801, 1001, 1301), end = c(100, 500, 900, 1100, 1400) ), transcript_id = "transcript1", gene_id = "geneA", gene_name = "...
a43091a854a98db6ee5597e82033db55835627cf7260396740cc6a8c84e509d1
R
2,406
42
#' @templateVar MODEL_FUNCTION pst_Q #' @templateVar CONTRIBUTOR \href{https://github.com/munoztd0/}{David Munoz Tord} <\email{david.munoztord@@unige.ch}> #' @templateVar TASK_NAME Probabilistic Selection Task #' @templateVar TASK_CODE pst #' @templateVar MODEL_NAME Q Learning Model #' @templateVar MODEL_CODE Q #' @tem...
e8a426a88040d6daf2f20bf1ea0d89ca4a896a2cf789ac343642327404c13595
R
2,410
49
#' @templateVar MODEL_FUNCTION banditNarm_lapse_decay #' @templateVar CONTRIBUTOR \href{https://github.com/cheoljun95}{Cheol Jun Cho} <\email{cjfwndnsl@@gmail.com}> #' @templateVar TASK_NAME N-Armed Bandit Task #' @templateVar TASK_CODE banditNarm #' @templateVar MODEL_NAME 5 Parameter Model, without C (choice persever...
41cc5a19e3ee6209a84000598c6ded5c1e0a7ec8db069c064e58f6ef0ca1be7b
R
2,413
90
############################################################################### # # Create .png files with sequence logos for provided motifs. # # AUTHOR: Maciej_Bak # AFFILIATION: University_of_Basel # AFFILIATION: Swiss_Institute_of_Bioinformatics # CONTACT: wsciekly.maciek@gmail.com # CREATED: 21-03-2020...
58c8c6c2887d10f44c95cdb8e4ff82b7dcd292af6471b5815d1a45454c0d7419
R
2,423
68
#' Walking disability data #' #' Two items YA and YB measuring walking disability in samples A, B and E. #' #' Example dataset to demonstrate imputation of two items (YA and YB). Item YA #' is administered to sample A and sample E, item YB is administered to sample B #' and sample E, so sample E acts as a bridge study....
929600e0c52aa76c013f94b8eee623390ee4ab537ff5ffbda3c25b91fd1c2891
R
2,431
66
getwd() library(ggplot2) library(ggsignif) library(ggpubr) # library(scales) # squash_axis <- function(from, to, factor) { # trans <- function(x) { # # get indices for the relevant regions # isq <- !is.na(x) & x > from & x < to # ito <- !is.na(x) & x >= to # # # apply transformation # ...
abc2175dd7351b0416f9b62525ef4c1d84936ec03394c1468d0192a902c4c4ba
R
2,437
64
library(vroom) library(dplyr) library(PLIER) # Make sure R's working directory is in the correct spot to make relative paths resolve correctly if (rstudioapi::isAvailable()) { setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) } else{ # If running as a script, finding the file is harder # https://stacko...
81aabb60d4c75245d7cf01c149659c8126f8c939644704a6c57814c81c95cff1
R
2,438
71
#### This script compares pi1 statistics with CMC library(ggpubr) library(dplyr) save_plot <- function(p, fn, w, h){ for(ext in c('.png', '.pdf')){ ggplot2::ggsave(file=paste0(fn,ext), plot=p, width=w, height=h) } } load_cmc <- function(){ fn <- here::here("input/public_results/cmc_hoffman/_m", ...
a68f7072011158a943b588f5d0e67ac45427611f9989900e401a8d9b6b384ca5
R
2,453
66
# Organize the groups order and combination based on the description # e.g. # groupdescription[1] = control # groupdescription[2] = control # groupdescription[3] = experimental # doubleton[1] = control, doubleton[2] = control # singleton = experimental # statistical analysis will be: singleton vs doubleton[1] and sing...
bf8c9ce63dd4f36cedf8e07d80d4fb4895a476f230c46b65fa1cde2fa8cc12fd
R
2,453
62
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") library("ggplot2") ## Import counts matrix cts <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/gene_counts_unfiltered.tsv", sep="\t", row.names="gene_id")) ## Import metadata coldata <- read.csv("../../../data/bernardo/processed/04.deseq2/ex...
d316303171233b65d4b52b0547224ae5ff98141cd20db84ef916a7b581703c0f
R
2,467
57
#' Cumulative hazard rate or Nelson-Aalen estimator #' #' Calculates the cumulative hazard rate (Nelson-Aalen estimator) #' #' This function is useful for imputing variables that depend on survival time. #' White and Royston (2009) suggested using the cumulative hazard to the #' survival time H0(T) rather than T or log...
32d7852a397a5bf1fb08015035d472dbec6ba575a1544658b18d135ca3edbc86
R
2,468
61
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") library("ggplot2") ## Import counts matrix cts <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id")) ## Import metadata coldata <- read.csv("../../../data/bernardo/processed...
cb9588cf300d0ce97d7ce98fd406450b7a65ffc976b763e94d04ae25d07ccde3
R
2,471
49
#' @templateVar MODEL_FUNCTION igt_pvl_decay #' @templateVar TASK_NAME Iowa Gambling Task #' @templateVar TASK_CODE igt #' @templateVar TASK_CITE (Ahn et al., 2008) #' @templateVar MODEL_NAME Prospect Valence Learning (PVL) Decay-RI #' @templateVar MODEL_CODE pvl_decay #' @templateVar MODEL_CITE (Ahn et al., 2014) #' @...
f25223503d38c3cb53cdd5e9fc9141bcce72f026752ff699e238e852e70a5449
R
2,471
64
# Differential expression analysis: MMT_D30 vs GF_D30 # per cell type within each tissue (Seurat FindMarkers, Wilcoxon test) library(Seurat) library(dplyr) output_dir <- "./" scobj <- readRDS("Brain.rds") stopifnot(all(c("subtype", "group", "Tissue") %in% colnames(scobj@meta.data))) scobj$Tissue_label <- as.charact...
654634fe817d32eda5739187bcb8f47c4882abe6c4550cffbc52917e0ec74a92
R
2,481
85
library(ggplot2) library(scales) library(ggthemes) # fig 1 set.seed(42) demog_data_camcan <- data.frame( age = c(rgamma(300, 90, 2), rgamma(320, 100, 2)), gender = c(rep("F", 300), rep("M", 320)), dataset = "cam-can" ) demog_data_tuab <- data.frame( age = c(rgamma(700, 100, 2), rgamma(639, 95, 2)), ...
f3c5adcf0e9983b2e8c5397d5d4199a78fd9be2773ad51a3d5fd984c04530bca
R
2,481
60
suppressPackageStartupMessages({ requireNamespace("rlang") requireNamespace("ggplot2") requireNamespace("cowplot") }) pc_scores_loadings_plot <- function(pca_model_info, pcx, pcy, color = NULL, color_values = NULL, loading_colname = "column", loading_label = "Feature") { sli...
b027c4e66e1db325244f64dfeceadade886041688de07e92557d9dc262f374a9
R
2,489
69
#1 Data preparation # Setup--------------------------------------------------------------- rm(list = ls()) ; gc() ; gc() set.seed(1234) wdir <- 'set your working directory' setwd(wdir) save.path <- 'object folder path' # load library easypackages::libraries(c('Seurat','tidyverse','patchwork','celda','singleCellTK','...
08d162bca94152d753a05f9d336615d187a566dc22a628fcfef39a9b62c4a8bf
R
2,491
49
#' Project on preterm and small for gestational age infants (POPS) #' #' Subset of data from the POPS study, a national, prospective study on preterm #' children, including all liveborn infants <32 weeks gestational age and/or <1500 #' g from 1983 (n = 1338). #' #' The data set concerns of subset of 959 children that s...
67cac020724b5011b8d60b8a583425cb600f02793c9d216978d1ae5bd0ed3632
R
2,491
79
#@Time : 2023/7/23 21:23 #@Author : Biao Zhang #@Email : littlebiao@outlook.com #@File : transform2seurat.r #@Description: This file is used to ... library(Matrix) library(Seurat) adata_path_isocortex <- "../../data/srrsc_mouse_human_binary/results_20_1000genes_all_came_selfloop/2023-06-23_20-31-14/embeds/figs/4_s...
ae5c3473c573d22ecec1be70a19ef750c3a6a6305c0413e7d4b3854fba99d8c6
R
2,491
49
#' @templateVar MODEL_FUNCTION banditNarm_kalman_filter #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/yoonseo-zoh/}{Yoonseo Zoh} <\email{zohyos7@@gmail.com}>, \href{https://github.com/cheoljun95}{Cheol Jun Cho} <\email{cjfwndnsl@@gmail.com}> #' @templateVar TASK_NAME N-Armed Bandit Task (modified) #'...
132a9ff0d6fc72f003ebfff4b373f21f6b6cab441d7408ef995af82c5fbb7b95
R
2,497
88
library(scatterpie) library(RColorBrewer) library(grDevices) library(Seurat) library(tidyverse) library(reshape2) set.seed <- 1234 file_path <- '/data/work/uniPort/BRCA_SPOT/' setwd(file_path) file_path <- '/data/yupines/kai/data/brca/' #----------------------------------------------------------- # input data for...
f6a13be5e4c800dafabbec9627d4b799c849290bf36ed09e7633c08f1bcdfe8d
R
2,497
77
source('~/scripts/single_cell/de.R') source('~/scripts/single_cell/atac.R') source('~/scripts/perturbator/de.R') library(Pando) library(doParallel) registerDoParallel(4) filter <- dplyr::filter select <- dplyr::select setwd('~/projects/cutntag/') #### Read data #### marks <- read_rds('data/all_marks_list_v3.4lines....
5e1a2977caf569bb72fbcbfde415eed81e1b6d19407cdd8e3e26f4688b2c32b5
R
2,510
68
#' Imputation by direct use of lasso linear regression #' #' Imputes univariate missing normal data using lasso linear regression with bootstrap. #' #' @aliases mice.impute.lasso.norm lasso.norm #' @inheritParams mice.impute.norm.boot #' @param nfolds The number of folds for the cross-validation of the lasso penalty. #...
1e77df2ad0c001637efd55a60f8958acef01041f1e114f43f857c99057920eba
R
2,514
72
#' Imputation by direct use of lasso logistic regression #' #' Imputes univariate missing binary data using lasso logistic regression with bootstrap. #' #' @aliases mice.impute.lasso.logreg lasso.logreg #' @inheritParams mice.impute.pmm #' @param nfolds The number of folds for the cross-validation of the lasso penalty....
059d81fb8820b0eaedfa18b94783e044cbb4ece35998528dc22e905ce986ee99
R
2,517
77
## This script generates plots for GSEA analysis. suppressPackageStartupMessages({ library(dplyr) library(ggplot2) }) save_plot <- function(p, fn, w, h){ for(ext in c('.svg', '.pdf')){ ggsave(file=paste0(fn,ext), plot=p, width=w, height=h) } } get_top_GO <- function(comp){ new_comp <- to...
71daf7485c82767bb30be7040d2d19912df8ffa2e1de6f224e20446bb0862836
R
2,521
74
rm(list=ls()) options(warn=1) options(stringsAsFactors=FALSE) options(digits=15) require(stringr) require(magrittr) require(R.matlab) require(ggplot2) require(xml2) require(scales) require(foreach) require(doMC) require(readr) require(abind) dir="" shelltempt=c(paste0(dir,"am_seg_train.sh")) infortab=read.table(file="s...
cf6b96330c082d4337031f69ef70e966ed291a158e02f89f0ca33e87e993dce8
R
2,525
59
#' Terneuzen birth cohort #' #' Data of subset of the Terneuzen Birth Cohort data on child growth. #' #' This \code{tbc} data set is a random subset of persons from a much larger #' collection of data from the Terneuzen Birth Cohort. The total cohort #' comprises of 2604 unique persons, whereas the subset in \code{tbc}...
038092b2d2deba0597d69cd7b5b52b90a698e8ea9e9e27851d92261f0c210beb
R
2,529
75
options(stringsAsFactors = FALSE) args <- commandArgs(TRUE) gene_name<-args[1] wkdir<-args[2] library(data.table) setwd(paste0(wkdir)) # gene_name="ABCA7" ### Load grex.geno and weight files geno_pred<- fread(paste0(gene_name, "_grex.geno"), header=TRUE) geno_pred$ID <- paste(geno_pred$CHROM, geno_pred$POS, sep = ":...
895d00736c60d8c75e66c6d561b36ce6ca1c9dc04c283788d1461a6121577ce2
R
2,543
72
## This script generates plots for GSEA analysis. suppressPackageStartupMessages({ library(dplyr) library(ggplot2) }) save_plot <- function(p, fn, w, h){ for(ext in c('.svg', '.pdf')){ ggsave(file=paste0(fn,ext), plot=p, width=w, height=h) } } get_top_GO <- function(tissue, sex){ new_tissu...
16155ae959eea51479061d4b9ef6d336e028f63a26e6ff66433f68412fc8062b
R
2,544
77
args = commandArgs(TRUE) eta=as.numeric(args[1]) max_depth=as.numeric(args[2]) gamma=as.numeric(args[3]) min_child_weight=as.numeric(args[4]) nrounds=as.numeric(args[5]) i=as.numeric(args[6]) idx=as.numeric(args[7]) data_folder=as.character(args[8]) sex_split=try(as.logical(args[9])) HyperParameterSearchCV = functio...
a256b08772daa49034fe464654b6350e44ead1ba6a579414122ef33fc3e888a4
R
2,561
51
#' @templateVar MODEL_FUNCTION igt_orl #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/nate-haines/}{Nate Haines} <\email{haines.175@@osu.edu}> #' @templateVar TASK_NAME Iowa Gambling Task #' @templateVar TASK_CODE igt #' @templateVar TASK_CITE (Ahn et al., 2008) #' @templateVar MODEL_NAME Outcome-Repr...
4570aa0550b009e504d1f8ecd65c1cbc56c36b2898a3d793e55ebc17b44d070e
R
2,563
24
#DTS script for collecting essential data from the dataset file for statistics and plots dataset.file <- file.choose() dataset.path = dirname(dataset.file) dataset.data <- yaml.load_file(dataset.file) totalflies <- length(paste(dataset.path, unlist(do.call("rbind", lapply(dataset.data$resources, '[', 4))), sep = "/")...
eb3aadb87d5bb8c825a3600b337f14f8a9771ecf3424f133b207778d8831afe6
R
2,564
59
#!/usr/bin/env Rscript #################### Differential Transcript Usage Analysis with DEXSeq library(DEXSeq) source(here::here("src/rnaseq/DTU_Analysis/stageR_DTU_significanceTesting.R")) DEXSeq_method <- function(sample_info, filtered_dm_object, design_full, sex, organism){ if(organism == 'mmusculus'){ strp <- fu...
0f584266acc6044357053319fdebfe590d180cb4e5cf2fec4bd27813b0f9c025
R
2,578
51
#' @templateVar MODEL_FUNCTION rdt_happiness #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park} <\email{hrpark12@@gmail.com}> #' @templateVar TASK_NAME Risky Decision Task #' @templateVar TASK_CODE rdt #' @templateVar MODEL_NAME Happiness Computational Model #' @templateVar MODE...
41526176d59cb0128fb6329a4801e1a235352860fb36045477a23391df0baf66
R
2,578
53
#' @templateVar MODEL_FUNCTION igt_vpp #' @templateVar TASK_NAME Iowa Gambling Task #' @templateVar TASK_CODE igt #' @templateVar TASK_CITE (Ahn et al., 2008) #' @templateVar MODEL_NAME Value-Plus-Perseverance #' @templateVar MODEL_CODE vpp #' @templateVar MODEL_CITE (Worthy et al., 2013) #' @templateVar MODEL_TYPE Hie...
abce4f496c3fac0adc6996bed5084d4758707fdc39a7279aeba1f63c412e7583
R
2,585
69
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") library("ggplot2") ## Import counts matrix cts <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/gene_counts_unfiltered.tsv", sep="\t", row.names="gene_id")) ## Import metadata coldata <- read.csv("../../../data/bernardo/processed/04.deseq2/e...
9011cbdf0380089a6528d4b59539b3609b51bec9b91c7f9f7dcb4928d307a12c
R
2,586
65
###########################Do ssGESA library(tibble) library(magrittr) library(corto) library(GSVA) library(limma) rm(list=ls()) data<-read.table(file='GSCs.tpm.150',sep='\t',header=T,row.names=1) minRowFPKM=rowMeans(data)>2 # filter by mean minNumFPKM=rowSums(data>0)>10 #Screen the number of samples whose ...
52e8c8573899cc4d6da9e413fe1feb0bd958bad5c00879a99741a522746cda09
R
2,589
43
#' @templateVar MODEL_FUNCTION pst_gainloss_Q #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/jaeyeong-yang/}{Jaeyeong Yang} <\email{jaeyeong.yang1125@@gmail.com}> #' @templateVar TASK_NAME Probabilistic Selection Task #' @templateVar TASK_CODE pst #' @templateVar MODEL_NAME Gain-Loss Q Learning Model ...
293ce993e34b8ab5fa629c539a8f14ca30e8d374e03c180328c6e3960cfe4d30
R
2,590
62
#!/usr/bin/env Rscript library(stringr) library(dplyr) source(here::here("src/shared/R-helpers/get_settings.R")) settings <- get_settings(omic = "splicing_analysis_das", stage = "das_prep", dataset_name = NULL) if(!dir.exists(settings[['output_directory']])){ dir.create(settings[['output_directory']], recursiv...
f296227e0959a474d46028db415428a6c084b7e6db714e9e69567b337fa9ac4a
R
2,593
58
#load snRNAseq count matrix (ROSMAP) library(Matrix) genenames<-read.delim('filtered_gene_row_names.txt',header=F) scdata<-readMM('filtered_count_matrix.mtx') smeta<-read.table('filtered_column_metadata.txt',header=T,sep='\t',row.names=1) scdata<-as.matrix(scdata) rownames(scdata)<-genenames[,1] colnames(scdata)...
7e8488b39adbddd9203553bb8a4efad911adf7ba4da8848a6b8ba2d431d4b89c
R
2,597
110
check.data <- function(data, method) { check.dataform(data) } check.dataform <- function(data) { if (!(is.matrix(data) || is.data.frame(data))) { stop("Data should be a matrix or data frame", call. = FALSE) } if (ncol(data) < 2) { stop("Data should contain at least two columns", call. = FALSE) } d...
b40c7c176ac06a16f56e48b2947eb6a23d32460593a2ae78b04b79327c0594f6
R
2,606
81
args = commandArgs(TRUE) eta=as.numeric(args[1]) max_depth=as.numeric(args[2]) gamma=as.numeric(args[3]) min_child_weight=as.numeric(args[4]) nrounds=as.numeric(args[5]) data_folder=as.character(args[6]) sex_split=try(as.logical(args[7])) BrainAgeCV = function(eta, max_depth, gamma, min_child_weight, nrounds, data_f...
b2ad514599bc97406d9b6f4f2db56cf16a479f2350678cca9d7970bca75ac38d
R
2,607
69
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") library("ggplot2") ## Import counts matrix cts <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/gene_counts_unfiltered.tsv", sep="\t", row.names="gene_id")) ## Import metadata coldata <- read.csv("../../../data/bernardo/processed/04.deseq2/e...
7adffe39b4742546c38042bda84e66386288a420fa4a286545ad3d67bf544019
R
2,628
77
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") ## Import counts matrix cts <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_multiple_median_cpm_1.tsv", sep="\t", row.names="transcript_id")) cts_med <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcr...
ab5921a54c598ea14158466490736fe07b5d9548b73b3006be87828a722aba5b
R
2,634
75
#'################################################################################# #'################################################################################# #' Explore replicability in gene set activity scores from different subsets and random gene sets #'#####################################################...
5756903890e4cfdbbe53f1fb9fab36d73b6afcccc7cfb4ed6f883fd1559d2e4f
R
2,637
70
#### Gene ontology semantic similarity analysis suppressPackageStartupMessages({ library(dplyr) library(ggplot2) library(GOSemSim) library(org.Hs.eg.db) }) get_semData <- function(ont){ return(godata('org.Hs.eg.db', ont=ont)) } save_img <- function(image, fn, w=7, h=7){ for(ext in c(".pdf", "....
85987079c3f42fb168cae9a9db537f629c7ede19f02346dcc63e44d07a6c4290
R
2,638
51
#' @templateVar MODEL_FUNCTION prl_fictitious_rp_woa #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/jaeyeong-yang/}{Jaeyeong Yang (for model-based regressors)} <\email{jaeyeong.yang1125@@gmail.com}>, \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park (for model-based regressors)} <\email{h...
b979f6c741e979fb419714c80f0f63d8bc9c51d7344e4cfbd0ea162818652452
R
2,642
84
# The purpose of this script is to create all data needed to support the shiny # application for accessing the data form our 2023 manuscript. # This script is dependent upon obtaining the raw nextflow nanoseq pipeline # results directory, which should be stored in data if you are using this dir # structure. If you do ...
c54cb1c82f085383d3e89725ba8dd0f51e4f90c25ca7642ecad26fb9bcecdfe4
R
2,644
77
#!/usr/bin/Rscript ## Import Libraries library("DESeq2") ## Import counts matrix cts <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_multiple_median_cpm_1.tsv", sep="\t", row.names="transcript_id")) cts_med <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcr...
647a2c7d296026cd73efb8626bbeca8550a0582d20cf68a354527f41816e7936
R
2,652
52
#' @templateVar MODEL_FUNCTION prl_fictitious_rp #' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/jaeyeong-yang/}{Jaeyeong Yang (for model-based regressors)} <\email{jaeyeong.yang1125@@gmail.com}>, \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park (for model-based regressors)} <\email{hrpar...
3018338722cacdd9cd2cf4c433dd2b4ca4d640f80327b7e37b7a71fe7a2b43c9
R
2,665
74
#!/bin/R library(MotrpacRatTraining6moData) library(data.table) library(sinew) # for each ome, copy final training-dea tables to GCP bucket public_bucket = "gs://motrpac-rat-training-6mo-extdata" # get names of all files all = system("gsutil ls gs://motrpac-data-hub/pass1b-06/analysis/**/dea/*training-dea-fdr*", inte...
be21a7af837928ce7ab1029a14712325f698558a9091bddf9aba7d8da04b9db2
R
2,667
70
## Plot contrasts between maternal and fetal placentas library(tidyverse) library(ggrepel) placentas_results <- read_rds(path = here::here("results/limma_placentas/limma_placenta_results.Rdata")) gene_names <- read_rds(here::here("results/download_gene_data/gene_names.Rdata")) %>% dplyr::select(.data = ., -...
74c509be688e7585b064f97e84fc599071c4331d2560b3b1701343422233f5bf
R
2,676
74
## This script generates the upset plot for mash sig results. library(magrittr) library(ComplexHeatmap) get_sig_de <- function(){ fn <- paste0("../../_m/", "differential_expression_region_interaction_sex_4features.txt") return(data.table::fread(fn) %>% dplyr::filter(adj.P.Val < 0.05)) } mem...
4c5c51d3b8a8e5994b6e8921b5146ed62a573431967098146d793e4f120e2944
R
2,682
95
# Convert annotation txt files to a single detections csv for use in ealuation # # To convert xml to txt run Python script annotation_xml_to_txt.py first library(tidyverse) ann_dir <- "Z://Adult_Salmon_Scales/Salmon_scale_circuli_detection/SSCD_data/detection_accuracy_analysis/sscd_detections_90_txt/" ann_path <- li...
30cd4d74709d85fb9beec25f24c6d98fde5d867209266740d0bff16b754a574f
R
2,699
71
list.of.packages <- c("jsonlite", "circlize") new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) library(jsonlite) suppressPackageStartupMessages(library("circlize")) library(circlize) pydata = jsonlite::read_json('circli...
e179874d2168b0c0827b352d3a5ce1be44049a6b444fed7d64c1762a58b11de9
R
2,705
74
## This script generates the upset plot for mash sig results. library(magrittr) library(ComplexHeatmap) get_sig_de <- function(){ fn <- paste0("../../_m/", "differential_expression_analysis_4features_sex.txt.gz") return(data.table::fread(fn) %>% dplyr::filter(adj.P.Val < 0.05)) } memDE <- m...
15c5039e5e4793ff5a0412fee8b60d540fb9188c0ed25b29acc0234ae90e2077
R
2,709
82
library(stringr) library(readxl) library(tidyverse) df <- as.data.frame(readxl::read_xls("IPA_Data_Canon.xls", col_names = TRUE)) coln = c("Canonical Pathways","All Patients", "Females", "Males") colnames(df) <- coln df<-df[-1,] df2 = head(df, 10) df_long <- pivot_longer(data = df2, cols = -...
0f3ac6fd4143c33391eef9802df032b96d03dbd9677842ee3d6ba4ea801fab5a
R
2,711
86
#' Star Geom #' #' @inheritParams ggplot2::layer #' @inheritParams ggplot2::geom_polygon #' @section Aesthetics: #' \code{geom_star()} understands the following aesthetics (required aesthetics are in bold): #' \itemize{ #' \item \strong{\code{x}} #' \item \strong{\code{y}} #' \item \code{n} #' ...
b29ffaf84fb1f83f6c28aa7e6589273e8ffc4beea69e174708a4ed2c6eb899b7
R
2,711
64
rm(list=ls()) options(warn=1) options(stringsAsFactors=FALSE) options(digits=15) require(stringr) require(magrittr) require(ggplot2) require(dplyr) require(reshape2) resdir="/Users/yuewu/Dropbox (Edison_Lab@UGA)/Projects/Bioinformatics_modeling/am_fungi_segmentation/results/run_am_seg_bigdataset/res/" setwd(resdir) inf...
a3d61b0a2e1028a9b06f306a70258b2023401d6fda6e6b4eaeea315a7ac8b206
R
2,717
67
library(tidyr) library(reshape2) library(plyr) library(dplyr) library(grid) library(gridExtra) library(Seurat) library(textTinyR) library(pbapply) current = getwd() folder = "1_calculate_pseudobulk" setwd(current) system(paste0("mkdir -p outputs/",folder,"/")) celltypes <- c("CD4_T","CD8_T","B") ## calculate pseudob...
b4688f14e0c764f99f9b39218a1f4a656f5f70c5e3a3484bcc195962d0060e6d
R
2,717
78
## This script estimates pi1 across brain regions. suppressPackageStartupMessages({ library(here) library(dplyr) library(qvalue) }) load_eqtls <- function(tissue, sex){ fn <- here("prep_eqtl_analysis/by_sex", tolower(tissue), tolower(sex), "cis_model/_m/BrainSEQ_TOPMed.signif_variants.t...
0163c0f599820d521e28a3c81f6c96e43a6da56751ac3bd51ad524e95d9e703e
R
2,729
89
### function to plot a small deltapx plot #' Title #' #' @param ffpath #' @param well #' @param zhstart #' @param zhstop #' @param frstart #' @param frstop #' @param colour #' @param ymax #' @param width #' @param height #' @param xnsecs #' @param exportPath #' #' @return #' @export #' #' @examples ggDeltaPx <- functi...
2ab92282c4f0c02f0f8dfdb48eedf7adcc09c8a16b5fa0ed58bda096f48e7ce3
R
2,737
70
# Parse all Rscript arguments parse_command_args <- function() { l <- list() a <- commandArgs(trailingOnly=T) for (arg in a) { bits <- unlist(strsplit(arg,"=")) name=bits[1] value=bits[2] l[[name]] <- value } return(l) } cargs <- parse_command_args() # Check all require...
ee3c06fe9314b3d1e628632b27da4300490c3881fffdbdd9bf37b3f829d8a047
R
2,737
91
# This script prepares recount3 data to be run through PLIER. It is based on # Qiwen and Jackie's script here: https://github.com/greenelab/rheum-plier-data/blob/05822c3a7b2e7c663d79426b1117a36dc2a0b892/recount2/2-prep_recount_for_plier.R library(tibble) library(tidyr) library(vroom) library(dplyr) library(biomaRt) li...
9e712f90cbb22a3dc19f58e52661af8fdc8ea4a0e1be1db53f74ed0b914ad04c
R
2,744
63
#' Imputation by linear discriminant analysis #' #' Imputes univariate missing data using linear discriminant analysis #' #' @inheritParams mice.impute.pmm #' @param ... Other named arguments. Not used. #' @return Vector with imputed data, of type factor, and of length #' \code{sum(wy)} #' @details Imputation of catego...
92b9a3603b7115e91b82fed7371b93c2e1bd55df9bbfe0b76b7792917d0ff107
R
2,747
80
#' Segment2 layer #' #' @inheritParams ggplot2::layer #' @inheritParams ggplot2::geom_segment #' @section Aesthetics: #' \code{geom_segment2()} understands the following aesthetics (required aesthetics are in bold): #' \itemize{ #' \item \strong{\code{x}} #' \item \strong{\code{y}} #' \item \stron...
7882c7b7785fd58644138f08cd3d13ca78ce8c50bb6fabd35dbfb5d94d09d277
R
2,757
75
#' An analytical p-value combination method using the Cauchy distribution #' #' The \code{CCT} function takes in a numeric vector of p-values, a numeric #' vector of non-negative weights, and return the aggregated p-value using Cauchy method. #' @param pvals a numeric vector of p-values, where each of the element is #'...
4fc5d2d00fbf7634302278df70a2c18b7265dd8ac4ca6e0b72eb7b30a2234d4f
R
2,800
86
#@Time : 2023/7/23 21:23 #@Author : Biao Zhang #@Email : littlebiao@outlook.com #@File : transform2seurat.r #@Description: This file is used to ... library(Matrix) library(Seurat) library(magrittr) # needs to be run every time you start R and want to use %>% library(dplyr) # alternatively, this also loads %>% a...
d651c89399b135de215dedddc44a951d2ca22a27b5d631971adba0444b2e68df
R
2,807
79
# Same seed - multiple cores - # Result: Imputations not equal between mice and parlmice test_that("PARLMICE-001: Warning and Imputations between mice and parlmice are unequal", { skip_if_not(parallel::detectCores() > 2) expect_warning(A <- parlmice(nhanes, m = 2, seed = 123)) B <- mice(nhanes, m = 2, print = FAL...
f95f050eacf9deaef5620e4b704ab9e638b5099e95eeb8b2e9a1374873c250d3
R
2,810
98
pool.vector <- function( w, dfcom = Inf, custom.t = NULL, rule = c("rubin1987", "reiter2003") ) { # rubin1987: Rubin's rules for scalar estimates # reiter2003: Reiter's rules for partially synthetic data rule <- match.arg(rule) present <- hasName(w, c("estimate", "std.error")) if (!all(present)) { ...
fe27b239ddcac882aa9435200bf28e468cb5da08984c34bfedda22fc4c35359c
R
2,815
95
# Load libraries ---------------------------------------------------------- library(tidyverse) library(here) library(GenomicRanges) library(plyranges) # Load data --------------------------------------------------------------- # PacBio filtered transcripts from Brain (SQANTI output) Classification <- list( GBA...
93087d6b8e80362431f0ad56da75b47df5550f03d8581a050e0981e46a85391a
R
2,817
62
# Set working directory --------------------------------------------------- .libPaths(c("libraries/", .libPaths())) .libPaths() libDirectory <- "libraries/" # Loading libraries ------------------------------------------------------- if (!require("pacman")){install.packages("pacman", lib = libDirectory, repos = "ht...
852c4b69e7234d09cabddc7c6099061433e5f3799cb32d22374eccb8097c6655
R
2,838
81
## Implementation of RRHO for sex-specific expression library(RRHO2) library(dplyr) get_de <- function(){ err <- 1e-320 fn <- paste0("../../summary_table/_m/", "differential_expression_schizophrenia_by_sex_4features.txt.gz") return(data.table::fread(fn) |> filter(Type == "Gen...
91e9b71679ed5e6cf3915f7bec1cba2c61f05116cb364ce97d18176f42f763ec
R
2,848
67
## Generate circlized plot suppressPackageStartupMessages({ library(dplyr) library(circlize) library(ComplexHeatmap) }) extract_bed <- function(tissue){ fn <- paste0("../../summary_table/_m/", "differential_expression_analysis_4features_sex.txt.gz") bed <- data.table::fread(fn) %...
6acaf41e56c3afc9e31e9d99ea75726b8ababd54a0501320e549cfdd162bbc91
R
2,865
51
StressGeneSets_Mouse_Temp<-list() StressGeneSets_Rat_Temp<-list() StressGeneSets_Human_Temp<-list() names(table(StressGeneSets_RatOrthologs_Symbols_NoNA$Dataset)) for(i in c(1:length(names(table(StressGeneSets_MouseOrthologs_Symbols_NoNA$Dataset))))){ StressGeneSets_Mouse_Temp[[i]]<-StressGeneSets_MouseOrthologs...