sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ae69349eb0fce365a18471d75ab82406fdaf5345a420bb9b3071edfd8d6605f7
R
5,146
88
library(data.table) library(dplyr) library(moloc) library(foreach) library(doParallel) moloc <- function(i){ Phe1_moloc_dat <- Phe1_dat %>% filter(Phenotype == moloc_pairs[i, exposure]) Phe2_moloc_dat <- Phe2_dat %>% filter(Phenotype == moloc_pairs[i, outcome]) com_SNP <- Reduce(intersect, list(Phe1_moloc_dat$SNP, ...
46d8ebc584c400a17a58ec07d4675c3f9b7e002d1748b331887085ac03cb303c
R
5,147
88
library(data.table) library(dplyr) library(moloc) library(foreach) library(doParallel) moloc <- function(i){ Phe1_moloc_dat <- Phe1_dat %>% filter(Phenotype == moloc_pairs[i, exposure]) Phe2_moloc_dat <- Phe2_dat %>% filter(Phenotype == moloc_pairs[i, outcome]) com_SNP <- Reduce(intersect, list(Phe1_moloc_dat$SNP, ...
8d8cf194ac02661b459b0919702632e4481819bae5a67c100f2834cbabbb077b
R
5,154
135
#!/usr/bin/R # ------------------------------------------------------------ # Make a figure to show our cohort along multimodal reference. # and add ABC scores to it as well # Updated 11/29/2023 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste...
d284b7d67fe97002582956a83469b91bfd50d66694f9d96da8ddb037e2172869
R
5,155
107
## ---------- Script ----------------- ## ## Purpose: perform differential isoform usage analysis on mouse rTg4510 ONT and Iso-Seq targeted datasets ## Adapted tappAS DIU analysis scripts ## https://github.com/ConesaLab/tappAS/blob/master/scripts/DIU.R ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## --------...
cbfff22115ae617b5c6d1c1d275d11df0bd48aaf3563e8027467d07c21e9980b
R
5,167
120
library(Seurat) library(ggplot2) library(sctransform) library(ggpubr) library(DoubletFinder) library(loomR) library(patchwork) library(SeuratData) library(SeuratDisk) data <- Read10X(data.dir = "/data/breadhea/qwang178/NOMIS/scRNA/Drop8/cellranger_outputs/sample_1/outs/filtered_feature_bc_matrix/") data <- CreateSeura...
928c1a8f6ca43676c670594d01e493a1c5c4b3b61087d7be59176a547c032b2a
R
5,172
168
#!/usr/bin/R # ------------------------------------------------------------------- # Compute pathway enrichments for differences subtypes in a celltype: # Updated 12/02/21 # ------------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'lo...
22c4f65f5f2217ee9bd05b4c42b5194175408f5d82440351d562bd7fd438d16a
R
5,175
150
# common functions for reproducible reporting # - Bayesian framework R/brms interface to Stan # - editable vector figures in PowerPoint # - estimates P-values with emmeans #source("/opt/fix-rstudio.R") #Sys.setenv(TZ="CET") require("tidyverse") require(readxl) # normal Excel input require("openxlsx") # for normal w...
9c4795d03701f316be5065901058f47c068c60739af33e455105b96a6340bd11
R
5,182
129
library("Seurat") library("tidyverse") library("ggpubr") library("purrr") library("biomaRt") ############# step1: load the Single cell experiment objects ############# setwd("./") Seurat.SNC.Single.Double <- readRDS("Step1.DataIntegration/Seurat.SNC.Single.Double.rds") setwd("./Step2.QC") ## QC for doublet identific...
91247728bb21d5cc035d270785510c257ab061776a4a5f264b8aa897b5b8111f
R
5,184
154
#!/usr/bin/R # --------------------------------------------------- # Plot composition differences in a heatmap for Exc: # Updated 03/16/2022 # --------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) library(ggplo...
abf3f6e35d7544076816c46be2ee1f643689a7fb35c92ffd7dbfa22702ffd15b
R
5,186
159
#!/usr/bin/R # --------------------------------------------------------- # Calculate and plot the module enrichments for covariates: # Updated 11/28/2021 # --------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, '...
724d1a9d8d8e2aa84c26d009bf9929c36d643a2c473bdb22ce85c39ec1e0b262
R
5,188
175
#' Expand scalar, vector, matrix or similarly shaped `hyperSpec` object to matrix #' #' Helper function for `hyperSpec` arithmetics. #' #' A row- or column vector or #' a matrix of size 1 x n or n x 1 or #' a hyperSpec object with 1 row or 1 wavelength will be expanded #' along the size-1-dimension. #' #' Dimensions th...
d6e34ceb7ce12d56796c4a7569fb1dd1804071b1d1e30fd19fd2b791b3c2c279
R
5,193
180
#!/usr/bin/R # --------------------------------------------------- # Plot selected points on the glial (astrocyte) umap; # Also plot module expression for these points # Updated 01/25/2023 # --------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta"))...
89a99da32f2d3e315520c32e493e8287b65db153399e5df1c2776c6049e820ae
R
5,196
134
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Linnarsson lab Database analysis # Patrick S. Hosford, December 2023 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #Required R packages require(Seurat) require(tidyverse) require(umap) require(ggplot2) require(loomR) requi...
54f565db87eb0edbd768074f93442544de425ae6d9c3a163e1d84d1619e15418
R
5,200
173
#' helper function to create/update project configuration json file in gpa output directory #' #' @param gpa a glm_pipeline_arguments object #' @param job_sequence a list with named logicals indicating whether #' that part of the pipeline was submitted or not #' (currently fi...
65cc815865c256643f5e0fe32d219d12018800b09034eb034f38c9c8e570e772
R
5,200
164
#!/usr/bin/R # ----------------------------------------------------- # Look at DEGs for fatty acid metab genes for LA expts. # Updated: 09/18/23 # ----------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidy...
344eb4fb10704c7acf9db69e6fd13a21a4ed7a4e94b0f3838dad230046e63a02
R
5,206
103
library(Seurat) library(dplyr) library(patchwork) setwd('/scRNA') ##### # Integrated analysis ##### data.dirs = c('CN6_E10-5A/mm10_cur','CN6_E11-5A/mm10_cur', 'scRNA_CN7_e10-5/rep1_6-12-17/negOnlyCells', 'scRNA_CN7_e10-5/rep1_6-12-17/posOnlyCells', 'scRNA_CN7_e10-5/rep3_9-1...
bbb664a309b4ed15ab6a6615f9e9772d5040d1b450d606ae6b72a40a8ed7aa4e
R
5,209
140
################################################################################ # SCRIPT TO CALCULATE THE AVERAGE OF THE DIFFERENT BRAIN VOLUME REGIONS BETWEEN # BOTH HEMISPHERES, LEFT AND RIGHT (LH & RH), FROM A .CSV FILE. ################################################################################ # Co...
142e1c641ea781ac8533a823053195c839aeead0c5d082e04a5b6c4f4ea12c88
R
5,214
140
#' archstabms_ddPCA_singlebackground_linear_model #' #' Linear model from single mutant effects (in WT background) from shallow ddPCA data. #' #' @param mochi_outpath path to MoCHI thermo model fit results (required) #' @param ddpca_outpath path to ddPCA data (required) #' @param position_offset residue position offse...
5fd9d7daef353d31a3be26f791c97df092401ffbb4896cb76614f4019eb52140
R
5,220
176
#' @name DEPRECATED-read.spc.Kaiser #' @concept moved to hySpc.read.spc #' #' @title (DEPRECATED) #' Import functions for Kaiser Optical Systems `.spc` files #' #' @description #' #' These data input functions are **deprecated** and they will be removed in #' the next release of \pkg{hyperspcc} package. #' Now f...
1c555ff1bf0787a355ff4cbd3b8a10d68627c0a69cb1af43d768cf319095ca81
R
5,221
109
cct_combine_pvals = function(test_results, cct_vtypes = c("missense", "spliceai")) { cct_combined_pvals = tibble() for (vtype in cct_vtypes) { this_cols = grep(paste0(vtype, "-"), names(test_results), value = TRUE) # use score pvalue to checkt if the p-value from the combined vartype + plof test...
3da554bd20e0ff66610f0432299cb5231913265067c4a0fede30a0c6410ff3af
R
5,243
175
### -------------------------------------------------------------------------- ### ### plot_c - plot timeseries, concentration, ... ### ### C. Beleites #' Calibration plots, timeseries plots, and depth-profiles #' #' Calibration- and timeseries plots, depth-profiles and the like #' `plot_c` plots intensities of a ...
dec2ca6d8fd3e4113bd980b81551bdfbe85a2a7950d6adf5ee6b276e688c17f2
R
5,255
105
# check samples where DMP is upregulated p1 <- RRBS_completebetas %>% filter(position == "chr18:32431597") %>% reshape2::melt() %>% left_join(., RRBS_Phenotype[,c("Sample_ID", "Genotype", "Age_months")], by = c("variable" = "Sample_ID")) %>% filter(Age_months == "8") %>% mutate(value = ifelse(is.na(value),...
5d68b3068a730122c5ba45944c90b1c5987fa4fdcef7a982e74c42cc2f898acf
R
5,258
174
library(ggplot2) library(dplyr) library("optparse") library(stringr) print("Libraries loaded, starting now") # Get the passed parameters option_list = list( make_option(c("-m", "--modelNotes"), type="character", # default="_fix_Anatomical_Site_rand_Donor_HM10UMI=100_mito=10Scrub=0.2noPackerMNN=sampleNameK=...
d85b24725cf364315ccad3545412c03d439d92f0b94d639822362207747bd067
R
5,260
120
## infercnv ## get the genome position of each gene from gtf file wget https://github.com/broadinstitute/infercnv/blob/master/scripts/gtf_to_position_file.py ./ ###################################################### Run_infercnv.R begin rm(list = ls()) library(Seurat) library(infercnv) setwd("Couturier_scRNA/GBM_res") ...
e24ad12252ba264fb51c2c52fbf35a569355377b9e89028da669474d123360f1
R
5,261
136
#' archstabms_ddPCA_linear_model #' #' Linear model from from shallow ddPCA data. #' #' @param mochi_outpath path to MoCHI thermo model fit results (required) #' @param ddpca_outpath path to ddPCA data (required) #' @param position_offset residue position offset (required) #' @param load_mochi_data python (required) #...
e8b919c2b100d8eb421d7d209903226b9ce4aff06a803949ce4560dc81f32d67
R
5,265
170
#!/usr/bin/R # ------------------------------------------------------ # Run Nebula on e4 interaction with selected genes only: # - Used for Oli-M7 + Opc-M9 test # Updated: 06/27/23 # ------------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_m...
36fc274ce72ca12f89f12690ecad6f6d17a813ae6e1567d03ebaf302e4a4b72b
R
5,277
110
# STAT_MODEL_TYPE2.R # This is the main code that runs the second type of model, namely to compare the # cortical activity during a freezing event to a voluntary stop and to a successful # event of the same type as the freezing event (e.g., turning freeze vs stop vs successful turn). # INPUT: # - data_FOG.csv (create...
06186543bf9fd3ecf26940773b15a5fa413e4c4ab05f0238529739b9b1867585
R
5,278
146
#!/usr/bin/env Rscript # create OPNMF brain parcellations by projecting W matrix onto volume space # args = commandArgs(trailingOnly=TRUE) ### Arguments #### # 1: Species of OPNMF output - "chimip" or "human" # # 2: relative path and name of GM mask used in creating OPNMF data matrix and OPNMF solutions # # Utilisi...
a6f69992d612a28e64029d7244497d1d39cff2e6aac1e893969099da0e97c03e
R
5,278
175
#!/usr/bin/R # -------------------------------------------------------------- # Score cells in all regions/EC for now using the internal DEGs: # Updated: 12/31/2021 # -------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata....
e94921e41e82ea4cef0eada841d1f92081438db36c7cae4ccc1df0a6c78d5ebe
R
5,282
169
#!/usr/bin/R # --------------------------------------------------------- # Auxiliary functions for cross-module matrices / networks: # Updated 11/30/2021 # --------------------------------------------------------- library(cbrbase) library(tidyr) library(viridis) library(ComplexHeatmap) library(circlize) library(igraph...
2fa6075ee0ddc4d231c21ac77ea64a5f64ac6e9081872920078b18b499da012d
R
5,287
138
#' plot #' #' @description This function plots a summary of the results of the model. #' #' @importFrom dplyr filter select #' @importFrom magrittr equals #' #' @param x A tibble including a cell_group name column | sample name column | read counts column | factor columns | Pvalue column | a significance column #' @par...
ba3e0b5c0b326e752245171d8064af7b975c3db34237384ff7f74106e4d1256e
R
5,309
132
setwd("/Volumes/projects_herting/LABDOCS/Personnel/Devyn/ABCD-AIR_RSI/OHBM 2023/analyses/") library(tidyverse) library(readr) library(dplyr) library(psych) library(skimr) long_df <- read_csv("/Volumes/projects_herting/LABDOCS/Personnel/Devyn/ABCD-AIR_RSI/OHBM 2023/dataset/20230428_long_df.csv") long_df <- long_df %>%...
c5def56dfe4d564faf3dce2d6dc2818ad746f11502fec6c782d3604a29b8e9f2
R
5,312
192
library(jsonlite) library(lme4) library(lattice) library(lmerTest) library(MuMIn) library(performance) library(rstudioapi) library(xtable) library(emmeans) library(car) library(tibble) library(dplyr) library(ggplot2) # ---------------------------------------------------------------------- # Configuration and data loa...
fe2d30977dae5e53beeb1a269158e4fee7e325cad9d93ccebfef63f0c31f6a05
R
5,314
129
#' archstabms__saturation_library_design #' #' Saturation combinatorial mutagenesis library design. #' #' @param pdb_file path to PDB file (required) #' @param pdb_chain_query query chain id (default:A) #' @param pdb_chain_target target chain id (default:B) #' @param colour_scheme colour scheme file (required) #' @par...
e592e2b5e69c362cb80f4620dd034b0803a6b4e92dfc23173fd6d0b76e2c8f86
R
5,319
98
## ---------- Script ----------------- ## ## Purpose: project-related functions for characterising ONT mouse targeted transcriptome datasets ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ----------Plot colours----------------- label_colour <- function(genotype){ if(genotype == "WT"){colour = wes_palette(...
7b6ccd9f1021bd6e10f88b9486993737d7af8d325790709e340fa87424a0a6e0
R
5,325
140
#!/usr/bin/R # ---------------------------------------------------------- # Why does AG have more up DEGs than other regions (4a?) # Updated: 10/25/23 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) l...
d31d7b64de082ad904dfd14fe2a8baca8ebb171cc3da75658aaff570045856d3
R
5,331
165
#Second Script to Launch load("sctransv2_pd_cond.Rdata")#output of "1_raw_PD_processing.R" #install.packages("HGNChelper") lapply(c("dplyr","Seurat","HGNChelper"), library, character.only = T) system('wget https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/gene_sets_prepare.R') system('wget https://...
fa57953fa0cfb195d5b48b1bc47aa7c2c4e3599d15d40da4e2617dd6017b777a
R
5,339
88
library(ggplot2) library(ggseg) library(ggpubr) library(extrafont) thickness_plot_0_1_data = read.csv('[your directory]/thickness_0_1_t.csv', check.names = FALSE) thickness_plot_0_1_data = thickness_plot_0_1_data[thickness_plot_0_1_data[, 'p-value'] < 0.05, ] thickness_plot_0_1_data$importance = -log10(thickness_plot_...
b634ec31122b423330f4376cbb3e8e201c4e93429021cb1e02f03d2d80461667
R
5,360
159
#-----------------------------Identification of tissue-specific and developmental stage-specific expressed genes--------------------------------------- # #1. It was performed in separate periods to screen out tissue-specific expressed genes setwd("F:\\ATAC\\processFiles\\RNA-tissue_specific0711") library(dplyr) ...
5aec43fe35d640bfaebcb9d43d2426bd662d0147d986913b91582bb6d168b2de
R
5,361
133
setwd("./Projects/SNCSynuclein") library("Seurat") library("tidyverse") # load the Seurat object Seurat.SNC.final <- readRDS("Step5.FinalClustering/Seurat.SNC.final.rds") # normalize the data before plotting DefaultAssay(Seurat.SNC.final) <- "RNA" Seurat.SNC.final <- NormalizeData(Seurat.SNC.final, assay = 'RNA') ##...
3d56969f33019dde81398f451cdb1951967357243705d0655edcb2ef3ba9772a
R
5,364
142
## HiC-Pro ## Copyleft 2015 Institut Curie ## Author(s): Nicolas Servant, Eric Viara ## Contact: nicolas.servant@curie.fr ## This software is distributed without any guarantee under the terms of the GNU General ## Public License, either Version 2, June 1991 or Version 3, June 2007. ## ## Plot R1/R2 Pairing results ## ...
ee799ad3aa3040645148053bee0859de84ff1a3da37df9d5d69f616cd093648c
R
5,370
147
#!/usr/bin/R # ------------------------------------------------------------------------- # Determine consistent up / down patterns for each covariate # Determine unique subtypes of DEGs for each pathology / AD measurement # Plot coeff. + clusters of these DEGs across EC neurons # Updated: 12/06/2021 # -----------------...
bb91453faf0d3356698a8424f74f22b8d65b830de8bbad0850f55a6f95dddff1
R
5,371
156
# For the expanded sample, conduct EFA and CFA and retrieve scores and loadings. # Adapts code from: # https://github.com/adolphslab/HCP_MRI-behavior/blob/master/intelligence.ipynb # Output: # dubois_efa_load.csv EFA loadings. # dubous_efa_scores.csv EFA scores. # dubois_cfa_load.csv CFA loadings. # dubous_cfa_scores.c...
8ff69d034fd8c5cbbc7a7cf1944ef419451489cd812784e980dfa4d473605c82
R
5,388
142
#!/usr/bin/env Rscript # Helper script to clean VCF stats output from collectQC.sh ###Set master parameters options(stringsAsFactors=F) ###Load optparse require(optparse) ###List of command-line options option_list <- list( make_option(c("-N", "--nsamp"), type="integer", default=NULL, help="number o...
964f8456ce44c12efda1b28a2cea03ec4c3e5fcd798f11d7cf3c51a27625d41c
R
5,390
168
#' Impute missing data points #' #' Replace `NA`s in the spectra matrix by interpolation. With #' less than 4 points available linear interpolation of the 2 neighbor points #' is used. For larger numbers of neighbor points, smoothing interpolation is #' performed by [stats::smooth.spline()]. #' #' @param spc hyperSpec...
5b98d7ee95a584b4b4b837d24e77b8f261b574557d9cdda5b72ccbbf11daa309
R
5,398
141
#!/usr/bin/R # ----------------------------------------------------------- # Plot top DEGs that are consistent or unique across regions: # Updated: 02/17/22 # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata....
c30540dfabc5a440cf86ead992a4d80b74c513b21459ad95e6a16a2a91a6787b
R
5,400
106
formulateStats <- function(dat, gene){ df <- dat[["norm_counts"]] %>% filter(isoform %in% dat[["anno_res"]][["isoform"]]) %>% group_by(isoform, associated_gene, time, group) %>% dplyr::summarize(mean_norm_counts = mean(normalised_counts)) %>% mutate(group = ifelse(group == "CONTROL","WT","TG"), ...
559484c9e88a8971649ed920d337ac74cd4ce47d72766015990143148496a7cc
R
5,401
141
#!/usr/bin/R # -------------------------------------------------------- # Plot the aggregated DE results across different methods: # - Adding DESeq2 results, + make aggregate datasets # Updated: 11/02/23 # -------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') sourc...
87b3139dce24624efa6c4fade8e2078b730ad5fcfa47804ba248fbe7535af148
R
5,401
174
# split_train_test <- function(data_list, train_prop = 0.9) { # if (train_prop == 1) { # return(list(train = data_list, test = NULL)) # } # # n <- nrow(data_list[[1]]) # train_index <- sample(1:n, floor(n * train_prop)) # test_index <- (1:n)[-train_index] # # train_list <- lapply(data_list, functi...
5c4747bb004621ccd9123837d0daedb459957de9e417d2cf098ef6f28a3a98ac
R
5,409
90
#!/usr/bin/env Rscript ## ----------Script----------------- ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## proteogenonomics analysis following paper review ## process merged (ONT + Iso-Seq) targeted data after collapsing by protein ORF following G.Shenkyman pipeline ## re-determined reference isoform usi...
b534df356a6f40e94b7114b0a9f75bc5a5f82b4e537eb263c60275fcb0c9dc6b
R
5,415
147
### --------------------------------------------------------------------------~ ### ### read.txt.wide ### ### Format: ### x y ... int (wl1) int (wl2) ... int (wl p) z ... ### #' @rdname DEPRECATED-textio #' @concept deprecated #' #' @title (DEPRECATED) #' Import `hyperSpec` objects from ASCII (text) files #...
da637c6b3407a49a3980b5a27ca168a0398d54a3e9de27f64f8c61afcf5a5907
R
5,431
84
`%!in%` = Negate(`%in%`) segregate_tappasresults <- function(output_tappas, type){ # tappas ouput with p values for each regression coefficient dat = output_tappas # apply Rsquared threshold at 0.5 dat = dat %>% filter(`p-value` < 0.05) %>% filter(`R-squared` > 0.5) if(type == "IsoSeq"){ ### model...
1777e3bfdd8f4f9781a3276a858bd1da0e0070a3e12cecbf842d124de4f6ea68
R
5,432
138
#!/usr/bin/env Rscript # args = commandArgs(trailingOnly=TRUE) print("Starting Now") library("SymSim") source("/net/trapnell/vol1/home/readdf/trapLabDir/fibrosis/results/2020_12_29_SymSim_Power_Work/simFuncsDavidMod.R") library(distr) source("/net/trapnell/vol1/home/readdf/trapLabDir/fibrosis/results/HeirarchalDE_Meth...
8666b84e2b09a4995c1b81fc1b62795f127c51ddd1b30984672250793e31adfb
R
5,454
188
--- title: "Subclustering astro" author: "Shahzad" date: '2023-11-01' output: html_document --- ```{r} library(dplyr) library(Seurat) library(patchwork) ``` ```{r} #Create astrocyte object (astro) for subcluster analysis astro <- (subset(gswt, idents =c("Astrocyte"))) astro ``` ```{r} #Visualize astro object featur...
7678caebb03cd1fcf17d13397847f6c2ee03203707d6045565b807e14675414d
R
5,456
133
test_that("input and output dirs are fine", { path <- tempdir() on.exit(unlink(path)) expect_true(check_directories(input_dir = path, output_dir = paste0(path, "/result"))) }) test_that("result dir already exists", { path <- tempdir() on.exit(unlink(path)) withr::local_te...
7b5aa4ff6a820534f99f1ed6b60ab18f4cbc15aecaf3a4e563da57803813c632
R
5,479
120
library(dplyr) library(pheatmap) library(dtwclust) Tis_spe <- read.csv("C:\\Users\\qjp\\Desktop\\RNA-Tissue_specific.genes.csv", header = T) ##RNA-seq data Exp <- read.csv("F:\\RNA\\RawTables\\OriginalRef\\GeneCountMatrix.tpmUnit.csv", header = T, row.names = 1) %>% select(., contains("70")) Exp_Mean <- data...
65812c2657744228e7dedff2e36bf603da4779d1c8f0812a38ecac3973b7e87d
R
5,483
144
#This script integrate E6.5-8.5 mouse embryo dataset (Pijuan-sala et al., 2019) with human gastruloids (Moris et al., 2020) #Link to Pijuan datasets are provided in https://shendure-web.gs.washington.edu/content/members/hGastruloid_website/public/ #Human gastrloid datasets from this paper are provided at National Cente...
309b1ea578944e08f694ce8957037081d9c1b24c046b7337f7e1cd6ba2d06a12
R
5,495
198
library(jsonlite) library(lme4) library(lattice) library(lmerTest) library(MuMIn) library(performance) library(rstudioapi) library(xtable) library(emmeans) library(car) library(tibble) library(dplyr) library(ggplot2) # ---------------------------------------------------------------------- # Configuration and data loa...
d98c5a2d2559f809aefc08c9fcc6f7f47d8820a0da036581726741b88482f423
R
5,501
112
# test output directory selection for sub/ses paths test_that("get_output_directory uses software-specific sub/ses directories", { gpa <- create_mock_gpa() gpa$output_locations$feat_sub_directory <- file.path("{gpa$output_directory}", "feat_l1", "sub-{id}") gpa$output_locations$feat_ses_directory <- gpa$output_l...
ed40105d3cd820d0fd036a5ce851e7f036c99391eed87a5bcd365654daef7fed
R
5,507
119
# Load info table label_df = read.csv('[your directory]/cluster_label.csv', check.names = FALSE) dk_label = read.csv('[your directory]/dk.csv', check.names = FALSE) # brain region dictionary dk_label = dk_label[complete.cases(dk_label), ] dk_label$label = gsub('lh_', '', dk_label$label) dk_label$label = gsub('rh_', ''...
d0fc5130f56f76f3008b1b429153f83e68b76b139d02c0cb057c0b539acf4cb2
R
5,512
190
### --------------------------------------------------------------------------- # FIXME: update examples #' Export `hyperSpec` objects to ASCII (text) files #' #' These functions write `hyperSpec` objects to text files. #' #' @rdname write_txt #' @aliases write_txt_long #' #' @param file Filename or connection to writ...
9f4b4586c2ca6e660eca0220d367bcc47c5e25c8c8e0f8479a6426931bd2dd2a
R
5,520
136
#################################################################################################### ### ### File: 01_obtaining_coordinate_data.R ### Purpose: Obtaining the features related to the coordinates. ### Authors: Gabriel Rodrigues Palma, Rafael Moral ### Date: 31/03/23 ### ##############################...
73402bd4ac2d4893e3b7e3e09618114358010b829d8e47cfd1eed68f597c4cc4
R
5,528
193
#### Write MSI data file(s) #### ## ----------------------------- writeMSIData <- function(object, file, ...) { ext <- tools::file_ext(file) if ( tolower(ext) %in% c("ibd", "imzml") ) { writeImzML(object, file, ...) } else if ( tolower(ext) %in% c("img", "hdr", "t2m") ) { writeAnalyze(object, file, ...) } els...
071601815b96ba515c6d8c6344e75ae7c8e12aebcab5d6023b4f5e4916bf5487
R
5,530
129
#' Calculate Residuals Between Observed and Predicted Proportions #' #' @description #' `sccomp_calculate_residuals` computes the residuals between observed cell group proportions and the predicted proportions from a fitted `sccomp` model. This function is useful for assessing model fit and identifying cell groups or s...
a3a7a2499560035cda46ab5013034c678ad9f196a542de126805beff5914337f
R
5,542
114
library(tidyverse) library(yardstick) metrics_data = read_tsv("eLife_Metrics.tsv") %>% filter(!is_duplicate) ############################################### # Compare the metrics against the curated # labels. ############################################### curated_data_training = read_tsv("Image_Curation_1-5000.ts...
f21985abc9a99cb8c0da9fc6e70f31227af28e30c0890902965d089c78fe433c
R
5,545
175
#!/usr/bin/env Rscript # Tim.load(lassosum) library(lassosum) args <- lassosum:::parseargs(include.others = FALSE) opts <- args #### Options specific to standalone version #### standalone.opts <- c("nthreads", "data", "n", "pval", "beta", "OR", "pheno", "covar", "out", "lassosum.pipeline", "pseu...
4b8e5d0dafb70f13c3c3722df7b8296266a402bbb477ab3ea7874efb247bd5d6
R
5,550
132
library(Rcpp) library(stringr) library(arrow) library(yardstick) library(ggplot2) library(gdata) library(dplyr) library(tidyr) library(logger) FitLinearModel <- function(data_list, all_x_cols, model_name = "") { log_info("Fitting model") model_formula = paste0("y ~ ", paste(all_x_cols, collapse = " + ")) ...
4367e0096ffd2a31a59851c3229f24302d54b2e8504d281e9640304aa011e2e1
R
5,557
137
#!/usr/bin/env Rscript # Talkowski SV pipeline downstream analysis helper script # Make list of all nonredundant pairs of batches from an input list of batches ###Set global parameters options(stringsAsFactors=F,scipen=1000) ################### ###HELPER FUNCTIONS ################### #For any two batches, find mo...
d1d4c5b1719e464a63696722176374deb2c8ba15a352ca29e3b21d2d71a4feff
R
5,558
127
# Title: Nested active zone density analysis # # Description: # This script performs a nested active zone density analysis. # It calculates the area of active zones within each nested bouton. # # Author: Daniel Parthier / Felicitas Brüntgens # Date: 05.10.2023 # Last modified: 19.04.2024 # Version: 1.0 # Load librar...
7b34880bcfcdc30ee79aca380d960da0f647f4f70716dee843fbb8ec8bcc43d2
R
5,574
144
redoProcessing <- function(inputCDS, useMNN=TRUE, mnnCategory="sample"){ set.seed(7) inputCDS <- monocle3::estimate_size_factors(inputCDS) inputCDS <- preprocess_cds(inputCDS) if (useMNN){ inputCDS = align_cds(inputCDS, alignment_group = mnnCategory) } inputCDS = reduce_dimension(inputCDS) re...
b056fbce8afd68d7642320123575e36ccee6d9701263827c4e62b84cf96492ef
R
5,577
204
#!/usr/bin/R # ------------------------------------------------ # Classify DEGs as individual vs. region-specific: # Updated: 03/29/22 # ------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(ggpl...
f8f6ed3fa2e75bc70140979c1c6585cef8b49e62176e48c8651d9628db970657
R
5,585
184
#' @name spc-bin #' @title Wavelength binning #' #' @description #' In order to reduce the spectral resolution and thus gain signal to noise #' ratio or to reduce the dimensionality of the spectral data set, the #' spectral resolution can be reduced. #' #' @details #' The mean of every `by` data points in the spectra i...
cf099ff763cc73a2fbdab977f2468f60ed8a1210d8ec9d247a9b93cedd83ae93
R
5,596
143
#!/usr/bin/R # -------------------------------------- # Aggregate the DE results for selgenes: # Updated: 02/24/22 # -------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) print(version) options(width=175) # Direc...
b8b0da1741c1cced46ae7fa19f5e3f77c22c75a140b6639bac4a872800deebdc
R
5,603
104
# ************* # 1b-celltype-annotation.r # Note: these codes are for exploratory data analysis -- you can ignore this script. source("Analysis/util.r") library(Seurat) library(dplyr) library(ggplot2) library(magrittr) library(data.table) file.dir = 'Results/Initial/Initial integration/' # Load result of integratin...
5786d8416c322a67802cd3ffb9eade8d97f34195a8ce431aed13a4cd2942b2df
R
5,614
113
# RUN_MODEL.R # This function runs the actual bayesian model for the given data with or without averaging it over channels belonging to the same ROI # INPUT: # - data_input: subset of data for a given condition (see: stat_modeltype1/2.R) # - brm_form: formula for the Bayesian analysis (see brmsformula) # - ROI_hemi: RO...
5fca61e0a7219fab899a73bd3cdac339b74c096c64cd03df79ab71917d770e12
R
5,630
127
# boxplots for weight changes # Jenn Kim # load libraries library(tidyverse) library(cowplot) theme_set(theme_cowplot()) library(nlme) library(lsmeans) library(plotrix) # load data data <- read.csv("BehaviorCohort_BodyWeights.csv") data <- as.data.frame(data) data$LPS.Treatment <- factor(data$LPS.Treatment, levels=c...
f3b9bcc6da0e5f3fa1b3c52936c127d436e91496336333bbfafe28f5e44e453a
R
5,637
154
#' Get the index of equations in a string vector #' #' @param eq_begin the beginning index of an equation #' @param eq_end the end index of an equation #' #' @return a index vector get_eqloc <- function(eq_begin, eq_end){ eq <- eq_begin[1]:eq_end[1] if(length(eq_begin) > 1) { for(i in 2:length(eq_begin)) eq <- ...
0fd29f951b479797810d872585e10438553888a596c6215ef3233acfb87b1c94
R
5,639
159
#!/usr/bin/R # ------------------------------------------ # Aggregate the DEGs runs for multiple runs: # Updated: 01/04/22 # ------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(ggplot2) library(ggpub...
a58690663bca096f63a24e0df00f9e5cc0fe595b69e41010fdb945a46ed3c6ea
R
5,644
168
--- title: "R interface" output: html_document: toc: true toc_depth: 3 toc_float: collapsed: false css: custom.css --- [**pmlbr**](https://github.com/EpistasisLab/pmlb) provides the following user-facing functions and variables in the R environment. For installation instructions or a high-level...
3ce6924f69d2d8956e5b2412feb1fd6c446ba3350784754cbdbd3ee64aa88f48
R
5,655
168
library(ROGUE) library(Seurat) library(tidyverse) library(ggplot2) library(clusterProfiler) fig.path <- "/home/pauling/projects/04_SEmodel/07_NC_revision/02.figures/10.brain" my.co <- c("#FF8C00", "#D02090", "#FFE7BA", "#00B2EE","#00C5CD", "#B0E2FF", "#FF83FA","#9FB6CD", "#AB82FF", "#FFC1C1","#00868B","#FF4040", "#3C...
d86da58fac4602c3e3880b1b6141df306a1697cc68e738f2140daadb4ae7d23d
R
5,663
149
# Tests for the feat_killed trap logic generated by run_feat_sepjobs. # # The trap must: # 1. Iterate all_odirs (every output directory for the job) # 2. Skip directories that already have .feat_complete # 3. Write .feat_fail only to directories that are still in-flight or not started if (identical(.Platform$OS....
fee49db43cdc3997cf260274bdcaebc5c41775a2bf8006c9b830f205ea548e8b
R
5,667
179
# For the specified k, for pairs of summary scores relating to g or processing # speed, conduct bivariate normality tests, plot scatterplots, and plot QQ plots. # Output: # binormtest_p.csv Bivariate normality test p-values for variable pairs. # binormtest_pthres.csv Bivariate normality test p-values for significant l...
de9f403404c31a9dcba9753951b8d765bc33ad0e1c511870ebe23eb15f898845
R
5,674
131
--- title: "m6a UMAP plots" output: html_document: df_print: paged --- In this document we integrate the RNA abundance and methylation data obtained from bullseye in single-cell DART data. ```{r echo = FALSE, message = FALSE, warning = FALSE, eval = FALSE} library(tidyverse) # Mutant reads mut_filename <- "/G...
8e099ce942589140e781e5729069a73c48246cfd68640d96173cc7fac45f1463
R
5,677
188
# Faux cell data generation function ----------------------------------------- #' @rdname faux_cell #' @aliases faux_cell generate_faux_cell #' @docType data #' #' @title Faux cell dataset for testing & demonstration #' #' @description #' This is a synthetic data set intended for testing and demonstration. #' Functio...
552fdeb8dfc577c581c8343319b2f5b8f673169b0b9fc488dd9832ba16b9d806
R
5,688
168
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(tidyr) library(tidyverse) library(RColorBrewer) print("Libraries loaded, starting now") monocle_theme_opts <- function() { theme(strip.background = element_rect(colour = 'white', fill = 'white')) + theme(panel.border =...
a5a58f9d35e92e6152cf371fc2ef242ebff1d49829f8daee3948612625198287
R
5,688
139
#' #' Creates a yaml file storing the parameters that are used for the analysis of the NOSA software results #' and returns these parameters. #' #' @param yc A yaml class object created by YAMLClass$new(). #' @param dirs List with the paths to the input and result directories and the sheet names to be read in. #' @para...
3e2ac5b8a72600b24e4c58d5bcccdf25a00bc3f8cce6423ce8d6f06999f26231
R
5,691
176
#!/usr/bin/R # ---------------------------------- # Run Nebula on selected genes only: # Updated: 02/23/22 # ---------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) library(Matrix) # For nebula: library(nebula) library(DESeq2) l...
4e41e87432e0cf7705c45fadfc03766739617bfa04ae7a5c6a126257c69f1f13
R
5,693
129
# load the reshape2 package library(reshape2) library(dplyr) setwd("D:/home_wkstn/F/Brain_region_project/LIANA/Analysis_aggregate_rank_magnitude_all_projid/Sign_interaction_table") table=read.csv("Sign_interaction_table.csv",row.names=1) #########################################################################...
39ab95d410a9e5c113af66a685f027eeac479398f840642f6d12c143c56a9e9f
R
5,714
168
#!/usr/bin/R # ------------------------------------------------ # Plot DEG overlap with modules for different vars # Updated 11/04/2023 # ------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } libra...
38946261639f821d22c537347c37618e0c326824da9714a0ce34220c3446a5b0
R
5,716
110
## ---------- Script ----------------- ## ## Purpose: input variables for ONT targeted mouse transcriptome datasets ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) suppressMessages(library("dplyr")) suppressMessages(library("stringr")) ## ---------- Directory and input files ----------------- dirnames <- list...
d463c4010e1df042f9cbae40fe260647d229afb8a1f82c272ed45e94e86e0e1f
R
5,720
156
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(msigdbr) library(fgsea) library(tidyr) library(tidyverse) print("Libraries loaded, starting now") # Get the passed parameters option_list = list( make_option(c("-m", "--modelNotes"), type="character", # default="_fix_...
b2623835ab4c50bb728d9abd365225121135e0d2726039a0c55f39b9ea725a01
R
5,754
156
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(msigdbr) library(fgsea) library(tidyr) library(tidyverse) print("Libraries loaded, starting now") # Get the passed parameters option_list = list( make_option(c("-m", "--modelNotes"), type="character", # default="_fix_...
157131a647a68f85813a159145a2cde4f136550a241ce250ed056a40e3abe97d
R
5,756
181
library(ggplot2) library(dplyr) library("optparse") library(stringr) print("Libraries loaded, starting now") # Get the passed parameters option_list = list( make_option(c("-m", "--modelNotes"), type="character", # default="_fix_Anatomical_Site_rand_Donor_HM10UMI=100_mito=10Scrub=0.2noPackerMNN=sampleNameK=...
4f6717955b899a86276032a77004633024072c01843effc59d55b16b871ae6cb
R
5,757
171
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(msigdbr) library(fgsea) library(tidyr) library(tidyverse) print("Libraries loaded, starting now") # Get the passed parameters option_list = list( make_option(c("-m", "--modelNotes"), type="character", # default="_fix_Anatomical_Site...
d8a39c112b9cb2c1d02e5ba590b20d701e3ebe896ebb939ab018c93930b18a36
R
5,759
126
library(ggplot2) library(Seurat) setwd("D:/Mouse_data_integration") pbmc=readRDS(file="Astrocytes_integrated_all.rds") #write.csv(pbmc@meta.data,file="Astrocytes_integrated_all_metadata.csv") data=read.csv("Astrocytes_integrated_all_metadata_addition.csv",row.names=1) pbmc=AddMetaData(pbmc,data) #saveRDS...
6c9422f2e1a3b58cb3a24c172ceadb4492560071881d93085e12828d470121b1
R
5,762
171
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(msigdbr) library(fgsea) library(tidyr) library(tidyverse) print("Libraries loaded, starting now") # Get the passed parameters option_list = list( make_option(c("-m", "--modelNotes"), type="character", # default="_fix_Anatomical_Site...
a446f98cce12fff1baab58895205960653800e17915a3a788f4a3f1265030102
R
5,798
191
# Function ------------------------------------------------------------------- #' Create label from units for wavelength axis #' #' This function takes the name of units for wavelength axis and creates an #' R expression which can be used as a label for `@wavelength` axis for #' `hyperSpec` object. #' #' @param unit (...
b29cf2b9fa38a8b74cc1b8edeeee6b18241428e3ed6cc61d42339f59cfaaf9fc
R
5,802
170
#' Loads predictions from univariate and ML models #' from directories containing parquet files #' and adds some useful columns #' @param cases_per_dataset The number of cases per dataset (internal/eicu) to display #' @return A beautiful dataframe containing forecasts from different models. .load_predictions <- functio...
650c37ccd9413ace225dc8378c27b0dddfa873f30ccd7de70b46e09ef08c03f2
R
5,804
149
#' archstabms_ddPCA_biophysical_model #' #' Biophysical model from shallow ddPCA data. #' #' @param mochi_outpath path to MoCHI thermo model fit results (required) #' @param temperature temperature in degrees celcuis (default:30) #' @param ddpca_outpath path to ddPCA data (required) #' @param position_offset residue p...
31121abf6dd1cbb9d9cab9872c5acafc9aa1992c7479d7081c134da3cfa4d045
R
5,806
163
#!/usr/bin/R # --------------------------------------------------------------- # Plot volcano plots for extended data for aggregated DE results: # Updated: 12/10/21 # --------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/lo...