sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
a9e6ada9be309333938256f52f0d6513b312078a9e747ffb747bf9da576f620e
R
2,206
91
#!/usr/bin/env R # Author: Sean Maden # # Description: # # Notes: #---------- # load data #---------- bulk.dpath <- file.path("dcs04/lieber/lcolladotor/deconvolution_LIBD4030", "Human_DLPFC_Deconvolution/processed-data", "01_SPEAQeasy/") list.files(bulk.dpath) # [1] ...
2a93dbd0d9db6a205f77102913ae6719a8a02b08378b81f3f60d25b8bf20fde9
R
2,207
57
# ******************************** # GWAS data processing # ******************************** if (!require("here")) { install.packages("here") library("here") } if (!require("magrittr")) { install.packages("magrittr") library("magrittr") } if(!require("tidyverse")) { install.packages("tidyverse") library("t...
aaed9604b03a517b1aad64b6d10e17772d8371f4ea1fd344f2560fcea77c0640
R
2,207
48
library(optparse) op_list <- list( make_option(c("-l", "--input_loom"), type = "character", default = NULL, action = "store", help = "The input of aucell loom file",metavar="rds"), make_option(c("-m", "--input_meta"), type = "character", default = NULL, action = "store", help = "The metadata of Seurat object",metava...
84efb5737d9fbd7ae518cd1e267cc7ccf5a7e994ae343aaf693eaf5e869ae7d3
R
2,219
58
library(feather) # RNA-seq data path data_loc = '/data/rnaseqanalysis/shiny/facs_seq/Mm_VISp_14236_20180912' # Project path project_path <- file.path(getwd(),'..','..','..','assets','aggregated_data') # Annotation data anno_feather_path <- file.path(data_loc,'anno.feather') anno_feather_data <- read_feather(anno_fea...
f94de235b84768d47055035392b5453499095fcff03e4cf2a745649751f2cf78
R
2,219
34
#' SRAtoSNP #' #' In case of analyzing SRA file, it is also possible to use the following function that performs step 1-4 in one function #' @param File The Path to the SRA File #' @param Library_Type "Paired" or "Single" #' @param TopHat_Threads Number of threads used for the alignment #' @param Transcripts_An...
3b5af3fe0decdb15688ec007d0e9db77d50b02085175f32f746c069a7a407f6a
R
2,220
68
library(survival) library(R2nparray) ixd = list(c(20,1), c(50,1), c(50,2), c(100,5), c(1000,10)) res = list() for (ix in ixd) { fname = sprintf("results/survival_data_%d_%d.csv", ix[1], ix[2]) data = read.table(fname) time = data[,1] status = data[,2] entry = data[,3] exog = data[,4:dim(data...
2c0ce5e8385a19081b0d42b8b8878dd56823154fb6601f1239a28b31544ffec0
R
2,226
55
#' dmrff.stats #' #' Calculate statistics for a set of genomic regions. #' #' Warning! Ensure that the order of the CpG sites corresponding to the the rows of `methylation` #' match the order of the CpG sites corresponding to the other variables, #' e.g. `estimate` and `chr`. #' #' @param regions Data frame of genomic...
f8e4da06aaceca52b7dce3c8d468a7419b48b9b14526eb4ffc6952b68d516aa7
R
2,231
58
## EWAS functions for FANS dataset ## # Cell-type EWAS Cell <- function(row, pheno){ if(age.group=='Fetal'){ full.model <- lmer(row ~ NewCellType + Age + Sex + Plate + (1|Individual_ID), data=pheno, REML = FALSE) null.model <- lmer(row ~ Age + Sex + Plate + (1|Individual_ID), data=pheno, REML = FALSE) } els...
a5162bf1c5542111ff64bf59ba17ec1bde67d52f471a3143d401cb9746f970b7
R
2,235
47
# classify Sex using cellXY library(speckle) library(SingleCellExperiment) library(CellBench) library(cellXY) library(CellBench) library(BiocStyle) library(scater) library(qs) library(Seurat) library(rlang) # might have to reinstall library(caret) # might have to reinstall # only get samples that have male,...
5594073a6060948bec431fcf0b51a1b11443554c6d05bed7f92d5d1a0ddf420e
R
2,240
52
rm(list=ls()) source('load_libraries.R') source('scripts/aux_functions.R') # Read autism gene data; repeat for other two autism_genes = read.csv("data/SFARI-Gene_genes_01-23-2023release_03-02-2023export.csv", sep = ",") %>% filter(gene.score == 1 | syndromic == 1) %>% .$gene.symbol %>% unique() # read disease g...
4f50113e5237390d9ed1951156b42fdd06c546c530c94e65a6b2d1eef9531e0a
R
2,242
83
#!/usr/bin/env Rscript # Function for importing BAM file and calc accuracy import_bam_get_accuracy <- function(bamfile) { bam <- GenomicAlignments::readGAlignments(bamfile, use.names = TRUE, param = ScanBamParam(tag = c("NM", "...
dbea5f55a7e6931d058f113df5b8090dd1756cbe9517ce99c3a96b07640eae8e
R
2,242
68
# ---------------------------------------------------------------------------- # Libraries and setup ---- library("argparse") library("ggplot2") library("tidyverse") library("Seurat") # Command line arguments ---- parser <- ArgumentParser(description = "Differential expression analyses") parser$add_argument('--seura...
4164174f887a73c268e4868b88411d6477bdc0d0b71701ee2248138c523a3b55
R
2,243
69
library(here) library(tidyverse) library(SingleCellExperiment) library(sessioninfo) library(data.table) library(Matrix) rse_gene_path = here("processed-data", "rse", "rse_gene.Rdata") sce_in_path = here( "processed-data", "13_PEC_deconvolution", "sce_CMC_initial.rds" ) sce_out_path = here( "processed-data", "1...
44b1e6e5ff0f3c18e7780dce5d1b378ad780aec4f3f880ad7a46a50d2d0e36b5
R
2,250
59
## Run Age linear regression on postnatal bulk samples at the bulk fetal dDMPs ## library(data.table) #1. Load data =================================================================================================================== load(paste0(MethylationPath,"EPICBrainLifecourse.rdat")) betas <- epic.betas phen...
f6f23ced75c805bb64d556744f9399199cac9446c6849e67d7c09f03d581b7c8
R
2,252
78
#fit a scDesign3 model and save it #automatically use log Library size and cell type as covariate #load arguments #1: sce data set #2: new coldata #3: output file name #4: number of cores to use args <- commandArgs(trailingOnly = TRUE) options(warn = -1) sce_file <- args[1] new_coldata_file <- args[2] output_header ...
e814990169f99448d9e0ab4352cfd7ef03c1cba1290568b30370afd2634297b3
R
2,253
60
# load packages require(tidyverse) require(Seurat) # load Seurat object (pre-doublet identification) sdata.align <- readRDS('sdata_align_snRNA-seq_prelim.rds') # set Idents (resolution = 0.5) Idents(sdata.align) <- sdata.align$seurat_clusters <- sdata.align$integrated_snn_res.0.5 # rename Idents in full dataset sdat...
849a00e0fad42f2621a7b7d48a1b517ee4b0d768d3109c1c5895bbbe5a8a3c4b
R
2,255
52
# GNU General Public License v3.0 (https://github.com/IanevskiAleksandr/sc-type/blob/master/LICENSE) # Written by Aleksandr Ianevski <aleksandr.ianevski@helsinki.fi>, June 2021 # # Functions on this page: # auto_detect_tissue_type: automatically detect a tissue type of the dataset # # @params: path_to_db_file - DB file...
e2a476929c699c934eec6398a6f8988c774f3fe042467bdb889cb39e43ef33d9
R
2,255
54
library(Seurat) library(future) set.seed(1234) setwd("/ALS_multiome") # Define sample names and their corresponding metadata sample_names <- c(paste0("CTRL", 1:6), paste0("C9ALSFTLD", 1:6), paste0("C9ALSnoFTLD", 1:3), paste0("sALSnoFTLD", 1:8)) snRNA_diagnosis <- c(rep("control", 6), rep("C9ALS", 9), rep("sALS", 8)) ...
1a490389ca54b1866a4f08244e1912acdcb66028bf245234757f89488eb88c3a
R
2,262
67
## Plot MAGMA results ## library(ggplot2) # bulk fetal MAGMA results bulkRes_ASD <- read.table(paste0(bulkPath, "ASD2019_ageReg_fetalBrain_MAGMA.gsa.out"), header=T) bulkRes_SCZ <- read.table(paste0(bulkPath, "SCZ_ageReg_fetalBrain_MAGMA.gsa.out"), header=T) # FANS fetal MAGMA results fansRes_ASD_N <- read.table(p...
567b702422e24afa6c57a4ed8c3bd3ac447357db80ac014d069c94dd5c78eae7
R
2,262
77
##### # Script for predicting methylation classes using MARLIN # as in Steinicke, Benfatto, et al., manuscript in preparation # # The script takes in input multiple files (one for each sample) containing the # methylation calls of CpGs restricted to positions of probes in our reference. # Values are binarized and missi...
af9451ccebc9a9bbabc3f39002c7ab6fdc8046df470c4ce229cae8bec11513bf
R
2,262
81
#!/usr/bin/env R # # Get marker genes from snRNAseq data. Uses scran::findMarkers to find marker # genes for clusters (e.g. cell types). # # library(scran) library(SingleCellExperiment) #----------- # set params #----------- celltype.varname <- "cellType_broad_k" #---------- # set paths #---------- # sce object pa...
e136fb9698cb9ddcbdbcc789f776ec13e9a4a9a36cd0f89781ab5d31f2c9379c
R
2,268
68
#!/usr/bin/env Rscript # date: 1/9/2023 by Hongjian Jin @ St Jude Children's Research Hospital library(optparse) option_list <- list( make_option(c("-d", "--dataDir"), type="character",default=".", help="character. fastq_screen output directory ") ,make_option(c("-o", "--output"), type="character", default=NA,...
66179b57c1de3320f6df03ad1b98c91e4f11b2a059d0ea2a61db0b5a205ea4fd
R
2,272
72
library("SummarizedExperiment") library("edgeR") library("variancePartition") library("purrr") library("here") library("jaffelab") library("sessioninfo") #### Set up #### ## dirs # plot_dir <- here("plots", "09_bulk_DE", "08_DREAM_library-type") # if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) ## d...
9675091315fc99ccf676e8b987cc67dbff4a3d314c7ac2df504f92afab181dd8
R
2,279
61
observeEvent(input$sideBarTab, { if (input$sideBarTab == "route" && is.null(GLOBAL_VALUE$positiveDetail)) { # 詳細データけんもねずみ GLOBAL_VALUE$positiveDetail <- fread(paste0(DATA_PATH, "positiveDetail.csv")) } }) output$infectedRouteRegionSelector <- renderUI({ pickerInput( inputId = "infectedRouteByRegionPi...
0b81f9fd213ad86e555e10b4c48e57ac65cb1ab295540fddee4c6f3ca6ad5b45
R
2,283
70
--- title: "Label fields" description: > Assign categorical UK Biobank fields the labels from the showcase schema. output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Label fields} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( co...
8bea1f1bc67a60291bd31ebadc949163648154a8193cc23a72eec90f259e041d
R
2,288
78
## ## Generate a volcano plot from a data frame of genes, fold changes (log-scale), and p-values. ## plot_volcano = function(stats_df, gene_col, fc_col, p_col, fc_cutoff = 0, p_cutoff = 0.05, ...
055c1fc4ab6109ab43295e8f332d3e0a8cee0082a87b46a9f20adbc4301b0e6a
R
2,292
47
# Compare the social perceptual evaluations between GPT4 Vision and humans in the video experiment temp0 pilot data # Severi Santavirta 15.5.2024 ##--------------------------------------------------------------------------------------------------------------------------------------------------------------------------...
dbfe12574b4a58ec4c091a29309f2a6fde3b37dd6b2b51c26c9645b37008d897
R
2,295
78
```{r} library(kronos) library(tidyverse) library(ggplot2) ``` Import dataset ```{r} library(readxl) bigdata_yjl_ht_new <- read_excel("C:/Users/U177202/PhD/Experiments_thesis/Youth_Jet_Lag_Experiment_2/YJL_Exp2_Microarrays/YJL_Exp2_KRONOS/YJL_Exp2_circadian_clock/YJL_Exp2_circadian_clock_ht_extra/bigdata_yj...
225245dc2c831278caf8a27d74f903175d05798ce27149e143698c00e5812fac
R
2,299
77
# ´ÓdevCEÀïɸѡºÍ´óÄÔ·¢ÓýÏà¹ØµÄ»ùÒò£¨ÓÃdevCEËùÓеĻùÒò×öGO£¬ÌôÑ¡Éñ¾­·¢ÓýpathwayÀïµÄ£©£¬¼ì²âÆäCEÊÇ·ñËæ·¢ÓýPSIϽµ # ÓÃinterproscan¼ì²âCEÓ°ÏìµÄdomain # ɸѡdevCEÀï°üº¬GGAµÄ setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(readxl) library(biomaRt) library(curl) # get human brain down ...
3cb49953c1859751e07949719e8a9efe205020882799afcfa3d96a0117ed4d12
R
2,307
70
# library("purrr") library("here") library("jaffelab") ## move file to make names compatable w/ SPEAQeasy ## all basenames for fastq files must be unique file_dir <- here("raw-data", "bulkRNA") raw_data_files <- list.files(file_dir, recursive = TRUE) message("All unique basenames: ", !any(duplicated(basename(raw_data...
9b0ab07d9dcd7107c931c8eb96ad97f193d52d85da433f702fed2929a92684a6
R
2,314
53
#' Edit_dbSNP_Files #' #' Before LOH analysis, the dbSNP files need to be edited using the Edit_dbSNP_Files function (done only once): #' @param Directory the directory were the files are, one GTF file per chromosome #' @param File_Name the files name, without the number of the chromosomes #' @param Organism "Human" or...
3f79c9961567b8ded2805993c82611fa00d279c5667f9be0271c07cf1d6680c3
R
2,319
53
#' Calculate statistics for the first-tier mapping #' #' Calculate statistics for the first-tier mapping #' #' @param seu Modified query Seurat object from \code{mapToMB()}. #' @param group.by Name of one metadata column to group cells by. #' #' @return A matrix of 37 rows. Each column corresponds to one group speci...
1801dc4974fdc8a44250f063d582e5d37b8058b125a32493c1d405b1b0dc07d5
R
2,320
65
data(datafls) #now do an MC3 sampling over the growth data 'datfls' with 1000 burn-ins, #9000 iterations (ex burn-ins), #and retaining the best 100 models (besides overall MC3 frequencies) invisible(readline("hit <Return> to do estimate a short BMA MC3 sampling chain.")) mfls =bms(X.data=datafls,burn=1000,iter=9000...
0cee1373123ef954f869451bee688db139dcfb1f935636574187263c2f12f088
R
2,325
67
# filter_tcr_genes ---- filter_tcr_genes <- function(markers){ markers %>% dplyr::filter(! grepl("^TR[ABG][VDJ]", gene)) } # make_pseudobulk - wrapper with corrections for when a category has no counts # for any gene ---- make_pseudobulk <- function(obj, idents){ gp_by = unique(c("Sample", "beta_aa",...
5244823c95099ab28e53d80fce47afc0e1f5d2189784e78c5524523ee62c32d5
R
2,329
43
context("compareRhythms_model_select") load("test_data_ma.rda") exp_design_batch <- cbind(exp_design, batch = ifelse(seq(nrow(exp_design)) %% 2, "a", "b"), stringsAsFactors=TRUE) test_that("model selection works for default params", { results <- compareRhythms(ex...
5e670ebbefa3cd827f076522385d4d1d087e750ca2874656e69cdaf0dda04216
R
2,330
72
# plot ASoC peaks # need to overlay 3 data tracks # Siwei 1 March 2019 # init library(Gviz) # data("cpgIslands") library(rtracklayer) library(BSgenome) library(BSgenome.Hsapiens.UCSC.hg38) library(TxDb.Hsapiens.UCSC.hg38.knownGene) library(ensembldb) library(org.Hs.eg.db) library(grDevices) library(gridExtra) ########...
0740cd1ff77ac6d4ba341f40f7bd5dbbd02a1551bd29c38298570fbd7829a40f
R
2,338
54
################################################################################ # Script to plot from .csv files the regional brain maps of connectivity to the # disease epicenters after stratifying by cognition and symptoms ################################################################################ # Co...
71347f9c5ec30f6ba5a0bb902d82c314d556f0be6093f1fc3eadb6c89bd14faa
R
2,344
79
compute_circ_params <- function(y, t, period) { inphase <- cos(2 * pi * t / period) outphase <- sin(2 * pi * t / period) X <- stats::model.matrix(~inphase + outphase) fit <- stats::lm.fit(X, t(y)) amps <- 2 * sqrt(base::colSums(fit$coefficients[-1, ]^2)) phases <- (atan2(fit$coefficients[3, ], fit$coef...
ccb9d60c6531d5950d833025e21336a8c1c73d14e4876f85e27eb5d0d45d863b
R
2,346
76
#read GRNs, find coreg matrix, find modules using WGCNA rm(list=ls()) set.seed(123) source('load_libraries.R') source('aux_functions.R') detect_delimiter = function(filepath) { first_line = readLines(filepath, n = 1) if (grepl("\t", first_line)) { return("\t") } else if (grepl(",", first_line)) { retur...
dc1b1dc64b05ed523ab7574c98d79672de2552a9394be807f3a93c091f8c89a4
R
2,346
98
library(FKF) library(KFAS) options(digits=10) # Observations df <- read.csv("clark1989.csv", header=FALSE) lgdp = log(df$V1[5:nrow(df)]) unemp = (df$V2 / 100)[5:nrow(df)] # True parameters params <- c( 0.004863, 0.00668, 0.000295, 0.001518, 0.000306, 1.43859, -0.517385, -0.336789, -0.163511, -0.072012 ) # Dimens...
6c9ad3285b2c1c7ebacc3166a1946542d552401f3f337811f8c75eda9f4ab9c8
R
2,348
68
library(data.table) source(file = "01_Settings/Path.R", local = T, encoding = "UTF-8") data <- fread(paste0(DATA_PATH, "SIGNATE COVID-2019 Dataset - 罹患者.csv")) dt <- data[ !is.na(受診都道府県) & 発症日 != "" & 確定日 != "", .(受診都道府県, 発症日 = as.Date(発症日), 確定日 = as.Date(確定日)) ] dt[, 発症から診断までの平均日数 := round(as.numeric(mean(確定日 -...
229513d8a96d52c010260c5c7c35810859f03206ecf791c62f8418361b251412
R
2,362
87
library("SummarizedExperiment") library("edgeR") library("limma") library("purrr") library("here") library("jaffelab") library("sessioninfo") #### Set up #### ## dirs plot_dir <- here("plots", "09_bulk_DE", "04_DE_library-type") if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) ## dirs data_dir <- her...
5914441a9b2c01b65ede4af34026215eea3ce0dfef48076e7a9cea17c353946e
R
2,367
51
column( width = 5, style = "padding:0px;", userBox( title = userDescription( title = i18n$t("新型コロナウイルス"), subtitle = i18n$t("Coronavirus disease 2019 (COVID-19)"), image = "ncov.jpeg", backgroundImage = "ncov_back.jpg" ), width = 12, closable = FALSE, ...
7b1bd7660905169ce850465cac818e6876cf11926fed2ef8476cf7bb288e3e69
R
2,372
91
## UCR length distribution setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(dbplyr) library(ggplot2) UCR_location <- read.table(file = "01-data/UCR_raw/UCR_location_refseqid.txt", sep = "\t", header = TRUE) lwd_pt <- .pt*72.27/96 p1 <- ggplot(data = UCR_location, mapping...
e155b345b47651455b68145c78213028d4ea1781b115ed2b64c75ad8f94ef143
R
2,377
61
# First run main.R until definition of Selles et al. Mixed Model (M_mm) # this scripts store prediction performance of the selles mixed model applied at # different times post-stroke weeks <- c(1, 6, 13) names <- c("Week 1", "Week 6", "Week 13") perf_wks_mm <- data.frame() baseline_ARAT <- test_xgb %>% group_by(N...
deac54a0bdff2bae01aa64cd5027f59cba2d6f767fd69137914fa117f22f73e1
R
2,384
65
# load packages require(tidyverse) require(Seurat) require(monocle3) # load data sdata.P25 <- readRDS('sdata_align_snRNA-seq_singlet.rds') sdata.P25 <- DietSeurat(sdata.P25, assays = 'RNA') # set Idents to cluster labels Idents(sdata.P25) <- sdata.P25$cluster_label # load gene names table gene.names <- read_csv('gen...
dd838b25fc899c7e1b20979067bbb5d2084bc80371965d769d56b9b9cea11126
R
2,386
67
library(tidyverse) library(fgsea) # load in function to get ranked gene list source("../riboseq/helpers.R") set.seed(123) slamseq_hl <- read_tsv("processed/2023-08-22_i3cortical_slamseq_grandr_kinetics.tsv") # i3 cortical cryptic ale containing genes cryptic_ale_gene_lists <- read_rds("../riboseq/processed/gsea_ribo...
70198c6b67a68e5b8477973c77824b4da8eedfdf331a1fa95ce8003dbe4e87b3
R
2,387
50
library(KFAS) options(digits=10) # should run this from the statsmodels/statsmodels directory setwd('~/projects/statsmodels-0.9/statsmodels/') dta <- read.csv('datasets/macrodata/macrodata.csv') source('tsa/statespace/tests/results/kfas_helpers.R') # We use the following two observation datasets obs <- (diff(log(data...
9ffde4176cb989d97986216a0549e0e6af019b0063d2dcf0f86eaccd801cc264
R
2,392
54
## 2. WGCNA - block wise modules ## library(WGCNA) library(data.table) #1. Load data used in GPMethylation ============================================================================================= load(paste0(dataPath, "FetalBrain_Betas_noHiLowConst.RData")) betas <- betas.dasen #2. Betas pre-processing ====...
656b176f10d612a29f314d41b692a289d30b66c2c10d7a452082f7635026b60c
R
2,393
72
# Siwei 20 May 2021 # Genotyping to find het individuals on rs10792832 site # init library(readr) library(readxl) library(factoextra) # load data ## load 60 MGS samples MGS_60_ID <- read_excel("60_MGS_ID.xlsx") ## load in genotype data (each row is a sample) ## column 1-6 are not part of the genotyping data ## genot...
a578f30ab1cf72d9575d2ad538fc124f2b1ed73096e915d079656e77ed4b7d33
R
2,397
96
# ͳ¼Æintergenic UCRÖ÷ÒªºÍÄÄЩcCREsÖØµþ setwd(dir = "D:/R_project/UCR_project/") options(stringsAsFactors = FALSE) rm(list = ls()) library(tidyverse) library(ggplot2) library(stringr) library(VennDiagram) cCREs_overlap_intergenic_UCR <- read.table( file = "02-analysis/36-Encode_screen_cCREs/cCREs_overlap_intergeni...
4334dc04609f1fa6f17ae5f6a78ecd8373c32af25e2f50f737eface8edbd8d25
R
2,398
69
#' dmrff.pre #' #' Construct an object for including this dataset in a DMR meta-analysis. #' #' Warning! Ensure that the order of the CpG sites corresponding to the the rows of `methylation` #' match the order of the CpG sites corresponding to the other variables, #' e.g. `estimate` and `chr`. #' #' @param estimate Ve...
4c2d15df3df68b765421688a19d7b7258d5a36392d1638ba53e593191727c49e
R
2,398
72
#File to identify differentially expressed genes in a type of excitatory neurons. library(Seurat) library(stringr) library(dplyr) library(limma) library(doParallel) library(foreach) samps = readRDS("samps_CA3.RDS") # Sample names. prot_df = readRDS("prot_PSD_df_CA3.RDS") # Dataframe of protein detected per sa...
cf9a9f4f18b94649142e434bcc09f780e8ce097a4f291e2a027baa268db28b19
R
2,399
47
options(BioC_mirror="https://mirrors.westlake.edu.cn/bioconductor") options("repos" = c(CRAN="https://mirrors.ustc.edu.cn/CRAN/")) if(!require(installr))install.packages('installr') if(!require(devtools))install.packages('devtools') if(!require(stringr))install.packages('stringr') if(!require(BiocManager))install.packa...
b7a0776408c75df3341f7b09d5c6e15a7e6844f691b051853e175294638d3d9f
R
2,401
69
#!/usr/bin/env Rscript #### Seurat CCA integration of MBPM_scn/MBM_sc/MBM_sn/MPM_sn with anchors, dims and cohort provided #### Author: Jana Biermann, PhD library(dplyr) library(Seurat) print(Sys.time()) anchor <- as.numeric(commandArgs()[6]) #2000 anchors dims <- as.numeric(commandArgs()[7]) #MBPM_scn:50; MBM_sc:...
1f992f3e1f258076e0cf516b88c97a9b90ad8e77e1af14d0dcba7213a2345e68
R
2,402
84
## Louise Huuki-Myers Jan 2025 ## select highly variable genes from snRNA-seq data to test methods ## part of deconvolution benchmark reviews Round 2 library("SingleCellExperiment") library("tidyverse") library("scran") library("here") library("sessioninfo") data_dir <- here("processed-data", "06_marker_genes", "09_H...
33f9e7799d57af90f81ee3b7cdbb19459da16346275c91111c622e372d68c057
R
2,404
61
#' EditVCF #' #' Edit the VCF (Variant Call Format) file, Creates file with SNPs data at the BAM directory called variantTable.csv #' @param vcfdir #' @param base_name The Path of to the BAM Directory, also the VCF file #' @param Organism "Human" or "Mouse" #' @param out_dir "temp directory #' @export #' @return None ...
cb1711526d1d30fd259816caa5ecfdde849e70a6d99d5cd816a065fe439782bf
R
2,409
52
if(T){ load("report01/02.merge/COGA.merged.list.allPeaks.Rdat") RNA.list = dd.list # Assays(RNA.list[[1]]) cat("================ Normalization ===================\n") # normalize and identify variable features for each dataset independently RNA.list <- lapply(X=RN...
b70edcec9c89d100468f4d2674ea3237cd7b5196651b6e936120e22e232570a8
R
2,411
75
library(GenomicFeatures) library(GenomicAlignments) library(GenomicRanges) library(Rsamtools) library(dplyr) # --- Load annotation and extract TSS/PAS --- gtf_file <- "data/referance/dmel-all-r6.43.gtf" txdb <- makeTxDbFromGFF(gtf_file) tx <- transcripts(txdb, columns=c("tx_name")) tss <- promoters(tx, upstream=0, do...
9f4856a32c9c529178047a07e04e79ee2eb388d2966f07f692085e11b66aecd6
R
2,413
65
#' dmrff.candidates #' #' Identify candidate differentially methylated regions from EWAS summary statistics. #' #' @param estimate Vector of EWAS effect estimates #' (corresponds to rows of \code{methylation}). #' @param p.value Vector of p-values. #' @param chr Feature chromosome (corresponds to rows of \code{methylat...
404f5d2613e432781cafbbaea7b4997408487ea74d335cd1b38cf1d043b7cecd
R
2,424
52
#!/usr/bin/env Rscript ### title: Global analysis of integrated object ### author: Jana Biermann, PhD print(Sys.time()) library(Seurat) library(dplyr) library(ggplot2) library(gplots) '%notin%' <- Negate('%in%') colBP <- c('#A80D11', '#008DB8') colSCSN <- c('#E1AC24', '#288F56') #### UMAPs seu <- readRDS('data/M...
e3f6b68f3423330a014eac62cbbaf5c130e9fa1cf7ceb9efe0af9789fbf0a99f
R
2,425
85
# Siwei 08 Jun 2022 # plot h2 and enrichment for LDSC results # init library(readxl) library(readr) library(ggplot2) library(RColorBrewer) # load data combined_output <- read_delim("combined_output.txt", delim = "\t", escape_double = FALSE, col_names = FALSE, trim_ws = TRUE) df_to_p...
cfba266d44f80c71723a9572258ea90078f04351ed758d85d6ce408cad6a4218
R
2,432
61
suppressPackageStartupMessages(library(optparse)) option_list = list( make_option(c("-b", "--iclip_bedgraph"), type='character', help="iCLIP bedgraph (iCount)"), make_option(c("-g", "--intron_set"), type='character', help='mapped introns'), make_option(c('-o','--outfile'), type ...
fbf6f301c5a56e6c0d3e0d509c064334fb46d4d057c93969d4f1f418ab691bd5
R
2,433
69
forecast.density <- function (PI_list,alpha){ # Plot forecast densities for bootstrap prediction intervals. These plots can be # interpreted as probability density functions of possible outcomes. Accepts # list with PIs. # Arguments: # <PI_list> a list with percentiles and future data points for 1 to...
f2e00f91b24750fb52f0a44f14875e46dde0975c07d51407ef1a2eb0cf5f52fd
R
2,435
81
#generate magma expression data set in podaman container #parameters: #1: path of the sce #2: path of the gene set directory #3: output file directory #4: temporary intermediate file path + header (will be removed later) args <- commandArgs(trailingOnly = TRUE) options(warn = -1) #argument data_path <- args[1] gs_dir...
1cf143e499e5fa3f3ed9a37e6a98397f7a026658429c12bc32d3a23291bbf303
R
2,438
68
library(KFAS) options(digits=20) # should run this from the statsmodels/statsmodels directory dta <- read.csv('datasets/macrodata/macrodata.csv') obs <- diff(data.matrix(dta[c('realgdp','realcons','realinv')])) obs[1:50,1] <- NaN #obs[20:70,2] <- NaN #obs[40:90,3] <- NaN #obs[120:130,1] <- NaN #obs[120:130,3] <- NaN ...
239ad861917463bc67f912d66d79ace752770b7d0b972619d98a3b34392f4b81
R
2,439
92
# Copyright (c) 2011, Roger Lew BSD [see LICENSE.txt] # This software is funded in part by NIH Grant P20 RR016454. # This is a collection of scripts used to generate C-H comparisons # for qsturng. As you can probably guess, my R's skills are not all that good. setwd('D:\\USERS\\roger\\programming\\python\\developmen...
bda107c0d0119b1c48d294a0ccad6cc16c0d36474537454eec3a0a852b13fe7b
R
2,445
60
suppressMessages(library(ggplot2)) setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") load("enrichment.rdata") se <- (enrichment$high - enrichment$low) / (2*1.96) z <- enrichment$estimate/se p <- exp(-0.717*2 - 0.416*z^2) enrichment$p <- p enrichment$lp <- -log10(p) #save(enrichment, file = "enrichment_p.rdata"...
972f6eb655bb8739b0996de8f0bbbd4ff52b1215c6d58d72771f1ff4d3a100a3
R
2,447
76
--- title: "EIB_behav_EIB_effect_on_meanRT" author: "Barbara Cassone" date: "AUTOMATIC" output: html_document --- ```{r echo=FALSE, message=FALSE} if(!require("pacman")) install.packages("pacman") library(pacman) p_load("reshape2","ez","dplyr","lme4","lmerTest", "rmarkdown", "lattice", "ggplot2", "emmeans") ...
3e9e6313473ef43bf5e2a1bb29f39c0652da03a51294f47ea3bae998ee1bda24
R
2,451
76
--- title: "EIB_behav_EIB_effect_on_dprime" author: "Barbara Cassone" date: "AUTOMATIC" output: html_document --- ```{r echo=FALSE, message=FALSE} if(!require("pacman")) install.packages("pacman") library(pacman) p_load("reshape2","ez","dplyr","lme4","lmerTest", "rmarkdown", "lattice", "ggplot2", "emmeans") ...
448785bc405208541218834251fa8c57a3255cca72135907db238d35604c20d4
R
2,451
71
nm <- 1 # number of measurements to included per patient mmn <- 7 # maximum measurement number to included per patient # extract measurement(s) from test set to evaluate the XGB and MM on eval_xgb <- test_xgb %>% group_by(Number) %>% slice_min(Days, n=mmn) %>% slice_max(Days, n=nm) %>% arrange(Number, Days) %...
43d8e9eeb05144452c1975b0728cc39c2da8745f49f16975263b4735f42f9f9d
R
2,467
67
#get_proxy <- function(snp = "rs10001", r2_threshold = 0.8, build = "37", pop = "EUR") #{ # stopifnot(build %in% c("37","38")) # # # Create and get a url # server <- ifelse(build == "37","http://grch37.rest.ensembl.org","http://rest.ensembl.org") # ext <- paste0("/ld/human/",snp,"/1000GENOMES:phase_3:", pop) # u...
77ce0168517fb5b8bf7fd0c1506a6cd1cab537f53e5c7edc789fcfd7ac8da290
R
2,469
79
# GSE173754 # U937 vs PBMC rm(list = ls()) setwd(dir = "D:/R_project/UCR_project/") library(tidyverse) library(ggplot2) library(ggrepel) lwd_pt <- .pt*72.27/96 GSE173754 <- read_tsv(file = "02-analysis/08-PBMC_U937_DEG/GSE173754.top.table.tsv") GSE173754 <- GSE173754 %>% mutate(Type = as.factor(ifelse(log2FoldCha...
0c826023dea90f244201659382a0d67bb7423fb9ff5ccaf73b522f9bc70c0a82
R
2,472
70
library(KFAS) options(digits=10) # should run this from the statsmodels/statsmodels directory dta <- read.csv('datasets/macrodata/macrodata.csv') obs <- diff(log(data.matrix(dta[c('realgdp','realcons','realinv')]))) #T <- t(matrix( # c(-0.1119908792, 0.8441841604, 0.0238725303, # 0.2629347724, 0.4996718412, -0...
8a3766f61b0e9e2a503ad9e2abd37f1719cb68b4a58e709a16ee5fd99dff41b7
R
2,475
81
# Immune-related 3-lncRNA signature with prognostic connotation in a multi-cancer setting # ÎÄÕÂÀïʹÓÃLncRNAs2Pathways½øÐи»¼¯·ÖÎö£¬½øÐÐÁËһЩµ÷Õû£¬ÎÒ¿´¿´Îҵĸ»¼¯·ÖÎö½á¹ûÊÇ·ñÐèÒªµ÷Õû setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(ggplot2) library(plyr) library(LncPath) library(stringr) # Set parame...
bfc8f7b3db0e0237c554eff781432e46fdd48e4bd90e6f8170b18c1f16ecb6a1
R
2,477
57
#' This script installs all required libraries automatically #' Please install libraries manually if it was not possible to install an library automatically #' Missing libraries are listed in missing_packages.txt #' To install an library please use following two command: #' install.packages("name of the missing library...
68b46ffaccb031ce56c4e34d66e894a98a167859b09962fbae3a83bd104079eb
R
2,482
64
#### Filter indel calls using unmerged bam #### # For ds calls, keep 1/1 in unmerged bam; for ss calls, keep 1/0 or 0/1 (i.e. filter out 0/0 or ./.) # - input: indel_calls # - output: filtered_calls options(stringsAsFactors = FALSE) library(stringr) # Parse arguments args <- commandArgs(trailingOnly=TRUE) input_f <- ...
caa9a2368f06bc34d3baab3ec172235c96ce689b8081ce12659fe1a18c3fc468
R
2,482
55
create_feature_count_table = function(feature_count_folder, suffix = ".Aligned.sorted.out.bam"){ library(data.table) # feature counts gives you feature coutns and summariues, make sure that all the files end in this pattern # _featureCounts_results.txt feature_count_files = grep(list.files(path=feature_count_...
c9200ba5cdaeacf7d0d43fb496d2d47dad41810da0f37cd13b83a59084e59523
R
2,485
49
## Singh AK et al: Proteins with amino acid repeats constitute a rapidly evolvable and human-specific essentialome ##This file contains all scripts for plotting. #1. Plotting all ggplot2 plots ##Note: Add hash to the lines which are not required when plotting any specific plot. df=read.table(pipe("pbpaste"),header=TRU...
8c61ecf0863936685562ed6439360b8f7f9e65c9646a6199db88743e662e5ac6
R
2,486
94
library("SummarizedExperiment") library("edgeR") library("limma") library("purrr") library("here") library("jaffelab") library("sessioninfo") #### Set up #### ## plot dir plot_dir <- here("plots", "09_bulk_DE", "05_DE_library-prep") if(!dir.exists(plot_dir)) dir.create(plot_dir, recursive = TRUE) ## data dirs data_...
e9245ffb9490931e239bd21a1c48adf45c0fb3ec9652ef1be701de8a271a490f
R
2,486
58
## 5. WGCNA - run pathway analysis on WGCNA nonlinear modules ## library(WGCNA) library(data.table) library(missMethyl) #1. Load data used in GPMethylation =============================================================================================== load(paste0(dataPath, "FetalBrain_Betas_LOOZ_EX3_noHiLowconst_n...
4df943d9a0cbb8af01acdc201e15ade439588d1813d281a777f07a79096774c7
R
2,488
99
output$todayConfirmed <- renderUI({ if (length(HAS_TODAY_CONFIRMED) > 0) { elements <- list() for (i in 1:length(HAS_TODAY_CONFIRMED)) { elements[[i]] <- suppressWarnings(boxLabel( paste( i18n$t(names(HAS_TODAY_CONFIRMED[i])), "+", HAS_TODAY_CONFIRMED[i] ), ...
2b686f821f69a437d2334559987279ddfa943a225ce46f31c175fdf219196be1
R
2,492
84
library(twice) library(dplyr) library(ggpubr) library(Rtsne) data("hg38rmsk_info") data("hmKZNFs337") load("data/mayoTEKRABber_balance.RData") mayo_meta <- read.csv("data/selectSample.csv") cbeCtrlCorr <- mayoTEKRABber$cbeControlCorr cbeADCorr <- mayoTEKRABber$cbeADCorr cbeDE <- mayoTEKRABber$cbeDE tcxCtrlCorr <- may...
7300adf297b3e17a81429d9e14d1a916d963fd0b24b296509e5bb38fbec0d05a
R
2,492
109
#!/usr/bin/env Rscript print("##################################") print("# ArchR: Fragments -> Arrow file #") print("##################################") ################################################################################ library("optparse") parser <- OptionParser( prog = "createArrow_unfiltered.R", ...
5506030213eb58de42d0297c4c7741fb9c1eb30d7c2d76fb34ec12ad01ae9f83
R
2,496
67
setwd("osmFISH_AllenVISp/") library(Seurat) library(ggplot2) osmFISH <- readRDS("data/seurat_objects/osmFISH_Cortex.rds") osmFISH.imputed <- readRDS("data/seurat_objects/osmFISH_Cortex_imputed.rds") allen <- readRDS("data/seurat_objects/allen_brain.rds") genes.leaveout <- intersect(rownames(osmFISH),rownames(...
998993d9625e25334870862e238d01fd914cecb9808514315bb544954c0115a7
R
2,496
67
setwd("osmFISH_Ziesel/") library(Seurat) library(ggplot2) osmFISH <- readRDS("data/seurat_objects/osmFISH_Cortex.rds") osmFISH.imputed <- readRDS("data/seurat_objects/osmFISH_Cortex_imputed.rds") Zeisel <- readRDS("data/seurat_objects/Zeisel_SMSC.rds") genes.leaveout <- intersect(rownames(osmFISH),rownames(Ze...
0c81e090e9d13dafc3dcd8be92281a43266438bfa4531467b8717791e81088eb
R
2,497
64
# ************************************************* # Preprocessing steps for Tabula muris dataset # ************************************************* if(!require("Seurat")) { install.packages("Seurat") library("Seurat") } if (!require("here")) { install.packages("here") library("here") } if (!require("magritt...
c997e82fa892cfec2c4b781236f16210ceb68fbd899ea08aece032f21aa43c30
R
2,498
86
# Siwei 15 Mar 2024 # Make Ast plots # make plots for Alena library(readr) library(ggplot2) library(readxl) library(stringr) # Alena_table <- read_excel("Alena_table.xlsx") Alena_table <- read_delim("~/backuped_space/Siwei_misc_R_projects/R_MG_17/Ast_GREAT_enrich_100.tsv", delim = "\t", escape_double ...
9ff492cb764680010324d01ec361b892cf937a5315af2b6ff1c66b24840855a6
R
2,499
67
setwd("osmFISH_AllenSSp/") library(Seurat) library(ggplot2) osmFISH <- readRDS("data/seurat_objects/osmFISH_Cortex.rds") osmFISH.imputed <- readRDS("data/seurat_objects/osmFISH_Cortex_imputed.rds") allen <- readRDS("data/seurat_objects/allen_brain_SSp.rds") genes.leaveout <- intersect(rownames(osmFISH),rownam...
b64b38b4aa8fe47172bfc991b3adc65a9924de75ac9f7aa597a7940c31c2f7fb
R
2,499
78
--- title: "EIB_behav_EIB_effect_on_accuracy" author: "Barbara Cassone" date: "AUTOMATIC" output: html_document --- ```{r echo=FALSE, message=FALSE} if(!require("pacman")) install.packages("pacman") library(pacman) p_load("reshape2","ez","dplyr","lme4","lmerTest", "rmarkdown", "lattice", "ggplot2", "emmeans"...
432f719c950ea8faf8007cae7b221d84d18728cde337331fcb60b0f42cab91e5
R
2,507
74
# ****************************************** # Analysis of the Tabula sapiens dataset # ****************************************** if (!require("here")) { install.packages("here") library("here") } if (!require("magrittr")) { install.packages("magrittr") library("magrittr") } if (!require("tidyverse")) { i...
5758ae1698cd7bfcb04e7d8d2f59f4e77817cc184dc7b889a103a7d64716e576
R
2,515
75
#' Batch convert SLEAP H5 files into DeepLabCut-like CSVs #' #' This function loads a directory containing H5 files generated from SLEAP. #' It processes the first track in the CSV (assuming single-animal) and rearranges #' the tracked points to match the style of that in DeepLabCut. Generated CSVs #' are all saved to...
374b0b4362f0414390d0db009bcb9a6ea572e03cd4833abed852af931e91ba17
R
2,518
76
# setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) human_psi <- read.table(file = "01-data/19-Development_alternative_splicing/human.psi", sep = ",", header = TRUE) print(colnames(human_psi)) ## brain brain_human_psi <- human_psi[, c(grep(pattern = "Brain", colnam...
5685f449755f8921c61c0ec24a129c10ee7184b82853e7777ac4c4e84b003555
R
2,528
84
#' Get cancer registry data for specific codes #' #' @author Luke Pilling #' #' @name get_cancer_registry #' #' @noRd get_cancer_registry <- function( codes, ukb_dat, verbose = FALSE ) { start_time <- Sys.time() # Check input if (verbose) cli::cli_alert_info("Searching cancer registry data for {length(unique...
e835f455f957fb83988f20a7dc9156680fef594645accaa02e494cbf094f6b5c
R
2,530
46
library(tidyverse) library(DESeq2) dir <- "/GPFS/Magda_lab_temp/maitenat/illumina_circ/ciriquant/bsj_files" KO_filenames <- list.files(dir, pattern = "Adar2KO", full.names = TRUE) WT_filenames <- list.files(dir, pattern = "WT", full.names = TRUE) filenames <- c(KO_filenames, WT_filenames) counts <- map(filenames, fu...
7cc32843c822e2ad0219ce7d086a28d1f8771727414cd6fbc98bfff1f3ceb2a2
R
2,535
58
#Make plots (part 1) ############################################################################################### #Load libraries library(Seurat) library(tidyverse) #Create directory to store plots dir.create("4_plots", showWarnings=T) #Load mapped Seurat data with reductions df = LoadSeuratRds("3_integrated_samp...
73d43a5e7c26b7b385b36f69f918eeb70b48f352a48832de75a64bc150af44f7
R
2,543
97
# Siwei 04 Mar 2024 # Plot Fig.5B # init #### { library(readxl) # library(edgeR) library(stringr) library(ggplot2) # library(data.table) library(reshape2) library(RColorBrewer) } # func #### # GET EQUATION AND R-SQUARED AS STRING # SOURCE: https://groups.google.com/forum/#!topic/ggplot2/1TgH-kG5XMA ...
06a7e52bf59e4b0b0f729d9691f9dd9a18b2296d2860d1f6f1dbbf9f12230d9d
R
2,544
63
# Load necessary library library(igraph) # Define the full set of nodes all_nodes <- paste0("G", 1:100) # Define the file names input_files <- paste0("DATA/SERGIO-Data/Interaction1_100_", 1:4, ".txt") output_files <- paste0("RESULTS/SimulationDataPreprocess/adj_matrix_G100_", 1:4, ".txt") # Process each file for (i...
c1a58d4c73043a081b026c42ea92dd85591780e713ef04a9e9469afa6c29bddc
R
2,546
74
library(bulkAnalyseR) library(ggplot2) library(dplyr) source_folder <- expr_matrix <- file.path(source_folder, "07.Expr_matrix/expr_matrix.csv") metadata <- file.path(source_folder ,"metadata.csv") output_dir <- file.path(source_folder, "08.Bulkanalyser") gtf_path <- "GRch38_p113.gtf" gtf <- read.table(gtf_path, he...
c35a6d4680898244e3d493d6647dbf4a171ec958e7a469fd2f48817e40a8a24a
R
2,550
68
library(tidyverse) library(DESeq2) # isoform-level counts for fracseq data fracseq_counts <- read_tsv("processed/fracseq/2024-04-30_summarised_pas.counts.tsv") # At least for part of the analysis, want to try to compare the proportion of total isoform expression in each fraction # As comparing across samples/fraction...