sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a6d6e2292f3bc5b4aaabfcf9fdc31d074d6d06f824301c639b47e1bd61d23e7a
R
4,508
165
library(lme4) library(dplyr) library(brms) library(foreach) library(data.table) #rds <- readRDS("/Users/michael/Downloads/meg_tf_rdf_wholebrain_rt_ri_single_sensor_RT1165") rds <- readRDS("/Users/hallquist/OneDrive/collected_letters/papers/meg/plots/wholebrain/rt/output/meg_tf_rdf_wholebrain_rt_rs_single_sensor_RT1165...
7eb3939afcae521fb0071a0d0d1022e4fdd1bb0e65f355dc4c4a311380dc3a8b
R
4,509
158
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(ggpubr) print("Libraries loaded, starting now") getFitResults <- function(opt){ rdsPath = "./rdsOutput/nebulaFits/" # Loop through each of the splits resultDF = data.frame() covarDF = data.frame() for (eachSplit in 1:(...
2ffd09ed9331378b993fc5f1616a7413d30fc09eb3c8a377bc94e3ca53f4ce68
R
4,515
180
options(bitmapType='cairo') args <- commandArgs(TRUE) dir<-args[1] inputFile<-args[2] headerSize<-as.numeric(args[3]) headerSpacing<-as.numeric(args[4]) imageWidth<-as.numeric(args[5]) imageHeight<-ceiling(imageWidth/8) yBound<-as.numeric(args[6]) transparentBGFlag<-as.numeric(args[7]) setwd(dir) dir...
1b248b84fb9b8fc0ccebdd93e839f1bb23c676c7ae8d7324052d9988d232611f
R
4,530
76
dirnames$protein <- paste0("/lustre/projects/Research_Project-MRC148213/lsl693/rTg4510/G_Merged_Targeted/B_cupcake_pipeline/4_proteogenomics/") protein = list( cpat = read.table(paste0(dirnames$protein,"5_calledOrfs/all_iso_ont_best_orf.tsv"), sep ="\t", header = T), t2p.collapse = read.table(paste0(dirnames$protei...
bb3653818d82da11d549961bb25a5e1e3e79c4e4c351fcc14ae50d545ad70b90
R
4,532
136
#' archstabms_thermo_model_results #' #' Evaluate thermo model results. #' #' @param mochi_outpath path to MoCHI thermo model fit results (required) #' @param temperature temperature in degrees celcuis (default:30) #' @param literature_free_energies path to literature free energies (default:NA) #' @param ddPCA_free_en...
b4920e0cfe3f5dd3a6f6c85a87a070a577b6b3a0ba8004cad6b9d432c0870a36
R
4,533
123
make_fake_l3_cope_feat <- function(feat_dir, contrast_names) { cope_feat <- file.path(feat_dir, "cope1.feat") stats_dir <- file.path(cope_feat, "stats") dir.create(stats_dir, recursive = TRUE, showWarnings = FALSE) for (ii in seq_along(contrast_names)) { file.create(file.path(stats_dir, sprintf("cope%d.nii...
6d577d7e74e75e049086b7878735627d799beb8f46c63416ced6209b200e3d84
R
4,537
144
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(tidyr) library(tidyverse) print("Libraries loaded, starting now") formatCellType <- function(inputColumn){ inputColumn = ifelse(inputColumn == "T_Cell", "T Cell", inputColumn) inputColumn = ifelse(inputColumn == "VSM_and_P...
1e4a23e4a2bc345684a9657ddf68a7a870f2732606ab1f78a6efa127240b8729
R
4,551
133
#' @details #' Nicolet uses some more keywords in their header file. #' They are interpreted as follows: #' \tabular{ll}{ #' description \tab giving the position of the first spectrum \cr #' z plot titles \tab wavelength and intensity axis units, comma separated \cr #' pixel size \tab interpreted as x and y step s...
89c2a06805ae4c3279d14e3953935c3f409387b23451ab63135f21461afa1078
R
4,560
151
# library(tidyverse) library(dplyr) library(tidyr) library(ggplot2) library(purrr) library(Seurat) library(tidyseurat) library(tidysc) library(sccomp) library(job) library(patchwork) library(future) options(future.globals.maxSize= 100000*1024^2) job({ oligo_adjusted_cell_type <- readRDS("/stornext/Bioinf/data/...
fe21d99ccdab2794ee3f5b9b57c5e271546d04c6e6f91854100ceae7b03743ee
R
4,577
144
#!/usr/bin/R # ---------------------------------- # Prelim plots scDRS # Updated 10/26/2022 # ---------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } source(paste0(sbindir, 'auxiliary_pseudobulk_loading_fns.R')) ...
7d0e99ef60150321ea78bdfe8fb39b5906979cebc303c1d593bcb9b92b9c45d9
R
4,581
103
library(dplyr) library(pbapply) library(data.table) library(plyr) library(openxlsx) library(broom) Mic9_AD_df <- read.table(file = "DA9_meta.csv", sep = ",", header = TRUE) #Data frame of Sample ID, DA9/CD83 status and comorbidity, demographic & clinicopathological covariates Mic9_AD_df <- Mic9_df[which(Mic9_df$upda...
e86abf19d3bdc285e639f86ab47694e9938dc441b35568efc58040b4a18faec2
R
4,584
135
# Fig 4. Survey results 1: Model performance across different modeling targets # Set up ---- # Load libraries ## uncomment the lines below to install the packages # install.packages("dplyr") # install.packages("ggplot2") # install.packages("tidyquant") library(readr) library(dplyr) library(ggplot2) library(tidyquan...
cbf886003733c54ad3c2c8ea6f8bf65f336395dd2e54b84e7f1b73d5a1bc1585
R
4,591
84
#View(paclitaxel_uct_imputed_log) names(paclitaxel_uct_imputed_log) Lipids_Final <- subset(paclitaxel_uct_imputed_log, select = c("Patientennummer", "Probe.1.oder.2","Neuropathie", "SA1P", "Sphingomyelin_331", "Sphingomyelin_431")) PatNrNeuropathy <- na.o...
b601904ab8f812ee2aa10095f928ff824e9b2a73625fa54f39a70bb156f4912f
R
4,598
158
library(testthat) # Helper to create a minimal hi_model_spec for respecify_l3_model testing make_l3_mobj <- function(formula_str = "~ 1", l3_input_mode = "per_session", subject_data = NULL) { if (is.null(subject_data)) { subject_data <- data.frame( id = rep(c("sub1", "sub2", "sub3"...
932124eccf095bfb3cfe41bb2918b5cd812ac3009515c3e0054761e849de0afc
R
4,602
124
#!/usr/bin/R # ------------------------------------------------------------ # Make a figure to show our cohort along multimodal reference. # Also plot the full ROSMAP cohort within that figure (alt) # Updated 04/26/2021 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') so...
de45daff7fbe03c0efd6c51baefd05af41b4b0b7c49fde6f6f02d982312824f1
R
4,603
152
#!R ## Compare CNVs #!/usr/bin/env Rscript library("optparse") option_list = list( make_option(c("-i", "--inputbed"), type="character", default=NULL, help="input bed from bedtools closest", metavar="character"), make_option(c("-o", "--outputbed"), type="character", default=NULL, ...
8c16da927e0987ca92018f8e1fbaa12b0c73e9e15b76d266d9c48cb23d068578
R
4,611
154
#!/usr/bin/R # ------------------------------------ # Plot specific pairs of correlations: # - score using DEGs # Updated 06/20/2023 # ------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } # Settings for plots...
3cecc7116b5f8a8cb91d36187d3b2916420c76068da3e167957184640af16381
R
4,614
149
# Need to use cluster installations of seruatDisk .libPaths('2') library(Seurat) library(SeuratDisk) library(monocle3) library(SeuratWrappers) getLitvAge = function(x){ ages = as.numeric(strsplit(x["age_group"], "-", fixed=TRUE)[[1]] ) ageMidpoint = (ages[1] + ages[2]) / 2.0 return(ageMidpoint) } # Get litvinuk...
bb2b97e9afad181c1c171cb14f0daa2a84baa1342a06a99a9ec69bb055b6a6b4
R
4,626
121
# Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #' Count number of lines in a text file #' #' @param fileName Name of file #' @keywords internal #' countlines <- function(fileName) { .Call('_lassosum_countlines', PACKAGE = 'lassosum', ...
6af42bacd5fb8b8dc2dd6debabb5b7accba181fde89b12086236d1fea95e059d
R
4,629
110
#' helper function to locate nifti inputs for each run of data #' #' @param gpa a \code{glm_pipeline_arguments} object created by setup_glm_pipeline #' @param add_run_volumes whether to lookup and add the number of volumes in each run_nifti in the run_volumes column #' @param add_dim whether to lookup and add the dimen...
768d0f67ee7b652cd19fed4eb67b4c77290e22cc32e17c735a3640a8722ee8da
R
4,634
136
library(testthat) library(dplyr) library(sccomp) test_that("get_variability_to_composition_map matches by column name", { X <- matrix(0, nrow = 2, ncol = 4) colnames(X) <- c("(Intercept)", "typehealthy", "phenotypep2", "phenotypep3") Xa <- matrix(0, nrow = 2, ncol = 4) colnames(Xa) <- c("(Intercept)", "phenot...
909275c2c26e254e547106b0b751131c1f3de73db8e959e79dd6b98184e8c3d3
R
4,643
105
## ---------- Script ----------------- ## ## Script name: ## ## Purpose of script: ## ## Author: Szi Kay Leung ## ## Email: S.K.Leung@exeter.ac.uk ## ## ---------- Notes ----------------- ## ## ## ## ## ## ---------- Source function and config files --------------- # Specific analysis related SC_ROOT <- "/gpfs/...
e8d06e99c0c9c24b0a36abcd404a38f85dd88a7686f7488c7e9c48160840ad36
R
4,644
181
options(bitmapType='cairo') args <- commandArgs(TRUE) dir<-args[1] inputFile<-args[2] inputName1<-args[3] inputName2<-args[4] headerSize<-as.numeric(args[5]) headerSpacing<-as.numeric(args[6]) imageWidth<-as.numeric(args[7]) imageHeight<-ceiling(imageWidth/8) yBound<-as.numeric(args[8]) transparentBGFlag<-...
a04f88f2c4a8c8500c870cf592682c4f758fb9b21b142ae7551251742f1d95e7
R
4,647
114
#!/usr/bin/R # -------------------------------------------------------------------------- # Calculate the fraction differences, by logistic regression + mixed effects # Updated 10/23/2020 # -------------------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bin...
53458c3b1742c05bce9347f820f57740a9c2dd7973121ff436a540cf6b40bf0e
R
4,648
127
library(dplyr) library(Seurat) library(ggplot2) library(xlsx) library(biomaRt) library(Matrix) library(progress) future::plan("multicore", workers = 4) ##########################################USER INPUT################################################################## #this can convert multiple rds file ...
2b291cf3a885c2c03474059b4cfef96b31721b123c0338aa7137ff53067faa73
R
4,660
102
#' archstabms__get_model_results_ddPCA #' #' Get model results and coefficients. #' #' @param input_folder path to input folder with model results (required) #' @param input_dt data.table with model free energy estimates (required) #' @param n_bootstraps number of bootstraps (default:10) #' @param bootstrap_prefix boo...
56d9dfd1fbab3e46ea4fa77da2e9203e1d3beeab6fc13ee86ce0b0e634fc2bfe
R
4,667
117
#' @title Computes polygenic scores as a genotype matrix multiplied by a matrix of weights #' #' @param weights The weights for the SNPs (\eqn{\beta}) #' @param bfile A plink bfile stem #' @param extract SNPs to extract (see \code{\link{parseselect}}) #' @param exclude SNPs to exclude (see \code{\link{parseselect}}) #'...
29a01f13033926bed67f9e70be5c902f202d227808bd3c799f0b945924952af1
R
4,684
189
--- title: "ANOVA stats" author: "Cazalé-Debat et al.2024" date: "mars 2024" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) rm(list=ls()) data<-read.delim("/Users/cazaledl-admin/Library/CloudStorage/OneDrive-UniversityofBirmingham/Post_doc/XP/data/courtscape/screen...
5930ef6f01abbdc95ff80d6fd63dae7cbba7bb7bf69081274b7b73f006af3783
R
4,688
95
# load the reshape2 package library(reshape2) library(dplyr) #Table interactions that are significant in at least one region ########################################################################################## setwd("D:/home_wkstn/F/Brain_region_project/LIANA/Results_aggregate_rank_magnitude_all_projid")...
2cdc3a7601bd96c13c29d17cca7f8f5459b6a4513a813c867908901c21ee9a78
R
4,693
164
# Set generic ---------------------------------------------------------------- #' `as.hyperSpec`: convenience conversion functions #' #' These functions are shortcuts to convert other objects into `hypeSpec` #' objects. #' #' @param X the object to convert. If `X` is: #' #' - a `matrix`, it is assumed to contain the s...
ec06789a36af7497f1f7f1db98de5a7a773c1668b87b7fbf97636a7a420326b8
R
4,702
151
--- title: "CLA spots selection and DE analysis" author: "Yuvarani Masarapu" date: "2023-02-01" output: html_document --- ```{r message=FALSE, verbose=FALSE, warning=FALSE, eval=FALSE} ### Loading package libraries library(Seurat) library(SeuratObject) #hdfr to read 10x hdf5r files, won't work otherwise library(hdf5r)...
ecbb4cddea82e42c2be8e4d256e47d4dd4fc5c94fb2ffec4f2c025c9e1e91ad4
R
4,721
98
#################################################################################################### ### ### File: 01_data_visualisation.R ### Purpose: Obtaining the features related to the coordinates. ### Authors: Gabriel Rodrigues Palma, Rafael Moral ### Date: 04/04/23 ### #####################################...
354468d6b115de66a65fa3823023995e8927fdf6a61c483f597ac99eca2eb712
R
4,722
185
options(bitmapType='cairo') args <- commandArgs(TRUE) dir<-args[1] inputFile<-args[2] headerSize<-as.numeric(args[3]) headerSpacing<-as.numeric(args[4]) binSize<-as.numeric(args[5]) binSizeDistance<-as.numeric(args[6]) imageWidth<-as.numeric(args[7]) imageHeight<-ceiling(imageWidth/8) yBound<-as.numeric(arg...
75bb2109b0f303451c142b144f50fce6ea036156d1a69e2fad2695c7e43f4e0b
R
4,731
121
#!/usr/bin/R # ------------------------------------------------ # Explore astrocyte changes in larger data cohort: # Updated 10/07/2021 # ------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(ggplot2) library(...
705850e5f2cbd807a6780af564c8b555814f90cb64e986d8d6fb677da051a4c4
R
4,740
157
#' @useDynLib permFDP, .registration=TRUE #' @importFrom Rcpp evalCpp NULL #' Permutation-Based FDP Method for Rejection Threshold Correction #' #' This function controls FDR using the permutation method described in our manuscript. Like the BH method above, it corrects the rejection threshold rather than the p-values...
d3101c1696735dd2775ab69ad4e960bb67058ebe05701daebf3a0a9cf495e625
R
4,745
129
#' archstabms_fit_linear_model #' #' Fit linear model to combinatorial data. #' #' @param mochi_outpath path to MoCHI thermo model fit results (required) #' @param position_offset residue position offset (required) #' @param load_mochi_data python (required) #' @param outpath output path for plots and saved objects (r...
084b8fc7431cf70dddcda71c498aae3c6c7986425e835a51f047d92dc2aeb01a
R
4,750
134
#!/usr/bin/R # ---------------------------------------------------------- # Plot the full ROSMAP cohort + our data in the context of dim. red. # Updated 02/18/2021 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_metadata.R')) lib...
5c15412954e01c47906a8eca47875d6a27c5a75a8739e3e7f264ff0719443530
R
4,761
127
#!/usr/bin/R # ---------------------- # Extract cell matrices: # Updated: 01/20/2021 # ---------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(rhdf5) library(Matrix) # Function to estimate end time of a loop: est.endtime <- function(star...
d94f23fc5ed21e40dc772571d7320d1ead59d19775883fbdc611c9e739be9547
R
4,774
96
## ----------Script----------------- ## ## Purpose: Generate plots for annotation of target genes after running FICLE ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ## --------------------------------- ## ---------- Source function and config files ----------------- # source all general scripts related to l...
c2b870ca3f3486dadb7d8686834bfcaa1a47d7c47ae0cc61d06abdd7708cfc9b
R
4,786
175
### --------------------------------------------------------------------------- ### ### read.txt.long: import measurements from .txt file ### ### Format: ### (y x) wl int ### #' @rdname DEPRECATED-textio #' @concept moved to hySpc.read.txt #' #' @param file filename or connection #' @param cols the column names spe...
2a087d8af6fe8bdea34f49769c7a653724b23c4751f60ccfd059505de48b7c37
R
4,799
113
#' Pipe operator #' #' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. #' #' @name %>% #' @rdname pipe #' @keywords internal #' @export #' @importFrom magrittr %>% #' @usage lhs \%>\% rhs #' @param lhs A value or the magrittr placeholder. #' @param rhs A function call using the magrittr semantics. #' @ret...
6f3be0cee627ada876c12a3e46650bf0fdd24969c75693c223a80f84a901577e
R
4,804
174
#### Spatially-aware k-means #### ## ------------------------------ setMethod("spatialKMeans", "ANY", function(x, coord, r = 1, k = 2, ncomp = max(k), weights = c("gaussian", "adaptive"), neighbors = findNeighbors(coord, r=r), transpose = TRUE, niter = 10L, centers = TRUE, correlation = TRUE, verbose = get...
031fe6f3aa145082666b043cfbdabf072d388e2040b8e96729b3f3968eb446ca
R
4,807
120
# 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_', ''...
aa524d7d2d2f217919be9f5c97356351eedb9d63fcddc46b72a87c4af36eb75f
R
4,807
128
#!/usr/bin/R # ------------------------------------------------------------------------ # Load the cross-module scores across all celltypes (at pseudobulk level): # Updated 11/30/2021 # ------------------------------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exis...
83ed40e69fa622ab965a3e1223c6fbe7531cf9ae0ffd9185e2999f00fc9980bd
R
4,810
151
#!/usr/bin/R # ----------------------------------------------------------------- # Plot module insets, highlighting a specific module in the network # Updated 12/08/2022 # ----------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ ...
e2c073963492d1649d0cc21e862f6fcc4fd064be789937e73a5e7680b3bd646c
R
4,815
164
#!/usr/bin/R # ------------------------------------------------------- # Plots for the integrated neuronal trajectory from DEGs: # Updated: 03/11/2022 # ------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) ...
a821728d8924a02a40cdd3a485efc246fc525eb87d564c837ba6383549147620
R
4,817
128
# ******** # 3-de.r # Code for conducting cellwise differential expression using the MAST model source("Analysis/util.r") source("Analysis/singlecell/differential-genes.R") library(Seurat) library(dplyr) library(magrittr) library(ggplot2) library(MAST) # -------- load data ----------- #x <- load_integrated() DefaultA...
7c7aa060a500a4aa9e89f97ef860f637e025f7acbeaa5dfc341312dc3175f7b9
R
4,818
93
# library(dplyr) library(stringr) library(magrittr) library(ggplot2) library(ggpubr) library(reshape2) setwd("F:\\Manuscript\\WGBS") ##peaks containing CpG datBS <- read.csv("AllSamples.CpG.removeSNP.CovFilter.MethyLevel.csv", header = T, row.names = 1) ##peaks intensity (TPM) datATAC <- read.table("F:...
f5430a6c08dd8cda25b183529ae296746b474058aa08ba82d170a0ee9120e93b
R
4,826
125
if (!require("dplyr")){ install.packages('dplyr') library(dplyr) } if (!require("lme4")){ install.packages('lme4') library(lme4) } group_member=read.table("group_membership_3group.txt", header = TRUE) colnames(group_member)[2]="membership" tot_var=read.csv("./Integ_var.csv", header = TRUE) ...
f188f889fdd5b28060d73c6ae22094c500c1fbbdb7689d49d9ab72a3b6514862
R
4,845
115
options(bitmapType='cairo') args <- commandArgs(TRUE) dir<-args[1] anchorPlotFile<-args[2] expectedPlotFile<-args[3] anchorName<-args[4] anchorStart<-as.numeric(args[5]) anchorEnd<-as.numeric(args[6]) ymin<-as.numeric(args[7]) ymax<-as.numeric(args[8]) wd<-paste(dir,sep='') setwd(wd) expectedData<-rea...
b312786e77f5c87a0863c39ffea08817ddeb505cdac079c9d0d47247973071a2
R
4,852
177
#### Spectral processing #### ## -------------------------- ## Normalization setMethod("normalize", "MSImagingExperiment_OR_Arrays", function(object, method = c("tic", "rms", "reference"), scale = NA, ref = NULL, ...) { method <- match.arg(method) if ( is.na(scale) ) { if ( method == "reference" ) { if (...
0251bfa3e387a5ab18b849db3db9fd8d0fc57483456c715a853d8b7591d8441d
R
4,853
212
# Function ------------------------------------------------------------------- # .Summary <- function(x, ..., na.rm = FALSE) { validObject(x) if ((.Generic == "prod") || (.Generic == "sum")) { warning(paste( "Do you really want to use", .Generic, "on a 'hyperSpec' object?" )) } ## dispatch also ...
6b8e5bbba1c320c70875b39a1427a8a919ef1535496d1b7f27bf100521e0381d
R
4,856
127
#!/usr/bin/env Rscript # Script to calculate median bin coverage per sample for all samples in a bincov # matrix # Note: loads entire coverage matrix into memory. This may pose a problem for # large matrices or on small-memory machines. Other workarounds exist from the # command line, but most are slower. One suggest...
34ebac9549504dbcebf2e6d6eb10fb48df45c243b6a58c4f52cf36d4a0ca3b7d
R
4,860
164
test_that("setup_l3_models refreshes and enforces the resolved producer stage", { refresh_calls <- list() enforce_calls <- list() l1_models <- structure( list(models = list(model1 = list())), class = c("l1_model_set", "list") ) l2_models <- structure( list(models = list(l2_model1 = list(l1_model_...
c421980171e89022b2f7de5719532ab5ea4c6e98ba6865e168e6167db834f4af
R
4,870
106
#' archstabms_library_design #' #' Library design. #' #' @param base_dir Base directory (required) #' @param output_dir Output directory (required) #' @param stagenum stage number (required) #' @param colour_scheme colour scheme file (required) #' @param execute whether or not to execute the analysis (default: TRUE) #...
a7ef8c66ade0ddc7af0c77b565167fe44bffa7fd70ab68241a305b2a8f48b18f
R
4,874
128
library(testthat) make_signature_test_gpa <- function() { gpa <- create_mock_gpa( n_subjects = 3, n_runs = 2, include_l2_models = TRUE, include_l3_models = TRUE ) gpa$l2_models$models$l2_model2 <- gpa$l2_models$models$l2_model1 gpa$l2_models$models$l2_model2$name <- "l2_model2" gpa$l3_model...
ce15cf1e50fb8de8f2554b2207290a8f232299e7c0a297dd668df086ada1fac1
R
4,876
154
#!/usr/bin/R # ------------------------------------------------- # Are region scores different # Updated: 06/23/23 # ------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(ComplexHeatmap) library...
d4c86649d5374fab17ae4db7d8690f00fe7250accca4da5c7d244cc193447334
R
4,882
176
#!/usr/bin/R # ------------------------------------------------------- # Plots on the ranked genes from the branched pseudotime: # Updated: 03/06/2022 # ------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) ...
de2fea256a0ab216110d0aed8c20c517cd6246461f359bba77d48aa714b39050
R
4,886
109
TimeSlots_Analyser = setRefClass( "TimeSlots_Analyser", contains = "Analyser", methods = list(initialize = function() { callSuper( description = "For each GroupingKeyWord found in the sample names, the input data is subseted. Then, for each subset, the mean values for a given time window are cal...
494b4bd407f6a7f1561d478a7e273c62a524781457307a8d74fa9ffa4a65662b
R
4,889
169
# Use SymSim to generate simlated datasets for use in DE testing and power analysis print("Starting Now") library("SymSim") source("./simFuncsDavidMod.R") library(distr) # Testing out, per vignette ngenes <- 100 true_counts_res <- SimulateTrueCounts(ncells_total=300, ngenes=ngenes, evf_type="one.population", ...
64272a55d5fc23c49b7411c0a24be114ea19701cb11ea8d5ea9eae8ce9a4eb2a
R
4,894
105
options(bitmapType='cairo') args <- commandArgs(TRUE) dir<-args[1] anchorPlotFile<-args[2] expectedPlotFile<-args[3] anchorName<-args[4] anchorStart<-as.numeric(args[5]) anchorEnd<-as.numeric(args[6]) primerPerformanceFactor<-as.numeric(args[7]) wd<-paste(dir,sep='') setwd(wd) expectedData<-read.table(...
462707719022499cc19ad882882c36cb799104565e4966dd92f2bcca61e2b64c
R
4,896
114
#' archstabms_fitness_plots #' #' Plot fitness distributions and scatterplots. #' #' @param dataset_name character dataset name (required) #' @param base_dir Base directory (required) #' @param colour_scheme colour scheme file (required) #' @param outpath output path for plots and saved objects (required) #' #' @retur...
ed86efc86070035e8492244c5161b26f535551b7ada9de7d86f80e0464b7e875
R
4,899
163
#!/usr/bin/R # --------------------------------------------------------------- # Plot module umaps and functional enrichment as indpt resources: # Updated 02/16/2022 # --------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source...
2f7902ead522b9d4dc5cca64f962f884274fecf350dd6616eec4165db4f2addf
R
4,900
98
#################################################################################################### ### ### File: 03_Merging_data.r ### Purpose: Merging the coordinate features with the EEG features. ### Authors: Gabriel Rodrigues Palma, Rafael Moral ### Date: 04/04/23 ### #######################################...
706fbf4875b8dd84a6b049eeddfe8703dcfd2e717f1de677c20c6921be15f42d
R
4,904
151
require(testthat) require(Cardinal) context("SpectralImagingExperiment") test_that("SpectralImagingExperiment accessors", { se <- SpectralImagingExperiment() expect_true(validObject(se)) se <- SpectralImagingExperiment(matrix(nrow=0, ncol=0)) expect_true(validObject(se)) set.seed(1) nr <- 20 nc <- 10 a <...
2818787533ee3137263a07666b5c34617699cf994ac9a4607c7c7441bd705b2d
R
4,907
182
--- title: "`r params$target`-targeted GCN report " subtitle: "`r params$tissue` expression data" author: "Alicia Gómez" date: "`r format(Sys.time(), '%d/%m/%y')`" output: html_document: theme: spacelab highlight: kate df_print: paged toc: yes toc_float: yes number_sections: yes params: targ...
644c73ffc668af77193599db73b1b40b4e93d427a66840c5ce037f2a7dd09a84
R
4,921
115
options(bitmapType='cairo') args <- commandArgs(TRUE) dir<-args[1] anchorPlotFile<-args[2] expectedPlotFile<-args[3] anchorName<-args[4] anchorStart<-as.numeric(args[5]) anchorEnd<-as.numeric(args[6]) primerPerformanceFactor<-as.numeric(args[7]) wd<-paste(dir,sep='') setwd(wd) expectedData<-read.table(...
919453d69d3399f0dcc0598873636805b71afecaed16470e7ab197739599693a
R
4,923
116
########################################################################################### # Load relevant packages source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") modStatus <- loadMonoclePackages() print(modStatus) source("/net/trapnell/vol1/home/readdf/trapLabDir...
dc952157d39608a7ee0f94bec1ed0985433825822b956c3292ca6bf2d373557c
R
4,940
141
#' This function generates syntax for FSL Feat .fsf files for the EVs tab of a higher-level fMRI analysis. #' It accepts a numeric design matrix whose colum names correspond to individual EVs in the model #' #' @details This allows you to generate a design matrix dynamically based on a numeric matrix that has been #' s...
d571cee001f578b59a6ac560b99a8d29af5b4779d7a3621e7066a1473e7bf291
R
4,942
103
#' Remove unwanted effects from a sccomp_tbl object #' #' @description This method removes unwanted effects from a dataset using the model estimates. For example, if you fit your data with the formula `~ factor_1 + factor_2` and use the formula `~ factor_1` to remove unwanted variation, the `factor_2` effect will be fa...
e1e1eda15c3847c8559a9745ecadf0167aa0ed90ebcfca3f946805887d1e6641
R
4,962
189
require(testthat) require(Cardinal) context("process-peaks") test_that("process peaks - SpectralImagingArrays", { path <- CardinalIO::exampleImzMLFile("processed") s <- as(readImzML(path), "SpectralImagingArrays") s2 <- peakPick(s, method="sd") s2 <- process(s2) n1 <- lengths(spectra(s, "index")) n2 <- lengt...
acd74bfac6dca610a32ffab832bb0b84d6f88209ecf67823318cebc22d159646
R
4,964
121
#' Unit tests for restricted environment cache handling #' #' Tests both approaches for using custom Stan model cache in restricted environments: #' 1. assignInNamespace - set global cache before any sccomp call #' 2. cache_stan_model - pass explicitly to sccomp_estimate, sccomp_remove_outliers, sccomp_boxplot #' #' @s...
37537c5dd74e4681ff431971d97e67e96fcb59800e882c3bace0c61419f9e51f
R
4,966
169
test_that("get_contrasts_from_spec warns and adds diagonal when no contrasts specified", { data <- data.frame( id = c("sub1", "sub2", "sub3"), session = c("ses1", "ses1", "ses1"), run_number = c(1, 2, 3), stringsAsFactors = FALSE ) mobj <- list(level = 2L) class(mobj) <- c("list", "hi_model_spe...
44fa9b28c2b9c179a204d2f6560f97df823a97eee6f2d0625f0cabae492d0327
R
4,967
129
read.cross.msg <- function(file.csv,ancfile.par2, phenofile, ancfile.par1=NULL) { ## Read MSG ancestry probabilities from file and return an R/qtl ## "cross" object. ## MSG ancestry probabilities are contained in a simple tabular ## format with individual names in first column, and labels of the ## form...
e9c3e9be062314be28e85a796c00dc9dbf8ea5fcbf212322b226493a0ac7714e
R
4,982
120
#' R6 class for a keyed data.table object that uses run-length encoding to reduce storage size #' #' @importFrom R6 R6Class #' @importFrom data.table data.table #' @importFrom checkmate assert_data_frame assert_logical #' @export rle_dt <- R6::R6Class("rle_dt", private=list( # data: keyed data.table object d...
a47bacab06d9f6ef169e22bbd71f48f92cf37015526a0b8629c5f6291f7d4224
R
4,984
135
#!/usr/bin/R # ---------------------------------------- # Plot neuron counts in entorhinal cortex: # Updated: 12/06/2021 # ---------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) library(viridis) library(ggplot2) library(ggr...
f903160d38fb02681fe8c9ce68cb6899aff1a8908c06d79bbdf9b615c93437f1
R
4,985
97
--- output: github_document title: shinyÉPICo --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) ``` <!-- badges: start --> [![License: AGPL v3](http...
991a7e1682ed8a2421898b6508fbcfd1eaa078c25bcac5f0054fe8e74ab2e027
R
4,986
114
--- title: "003_RA_gastruloid" author: "Nobuhiko Hamazaki" date: "7/15/2022" output: html_document --- ```{r} library(dplyr) library(Seurat) library(patchwork) library(ggplot2) library(stringr) library(RColorBrewer) library(tidyseurat) library(cowplot) library(Signac) library(viridis) library(ggthemes) library(network...
b1150a83c3c10b015dab40ceb9a8bb43b232549bf640f56dc95e4250c0fdf6f8
R
4,986
146
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(tidyr) library(tidyverse) print("Libraries loaded, starting now") formatCellType <- function(inputColumn){ inputColumn = ifelse(inputColumn == "T_Cell", "T Cell", inputColumn) inputColumn = ifelse(inputColumn == "VSM_and_P...
4e3945af8f5833bbdb0442bfd9bf6467613105891b080a488655b12889e3aa11
R
4,991
88
read_stat <- read.table("/lustre/projects/Research_Project-MRC148213/lsl693/rTg4510/H_Sorted_Nuclei/6_merged/merged_collapse.read_stat.txt", header = T) sampleID <- read.csv("/lustre/projects/Research_Project-MRC148213/lsl693/rTg4510/H_Sorted_Nuclei/6_merged/original_fasta/merged_sample_id.csv") read_stat <- merge(rea...
310b92d99d1bde9c4920387d0a6c91389b0fcc287247f7336c057dae6d7912ff
R
4,994
122
##POE stage <- c("40","70","115","168") tissue <- c("Br", "Li", "Mu", "Pl") library(customLayout) library(dplyr) lay <- lay_new(matrix(c(1,2,3,4,5,6,7,8,9,10,11,0,12,13,14,0), ncol=4, byrow = T), widths = c(1,1,1,1), heights = c(1,1,1,1)) lay_show(lay) a <- c() for(i in 1:4){ if(i == 3||i==4){ ...
2a287f8fa17fe5130185828f22762ae43acfc0c8ea09c60e493f27376801d880
R
4,996
131
#' Build concatenated L1 confounds for multi-run analyses #' #' Internal helper that uses stored confound column metadata to align shared #' columns and union spike regressors across runs with zero padding. #' @keywords internal #' @noRd read_l1_confound_columns <- function(gpa, id, session, run_number, lg = NULL) { ...
d6d40f70dfa229ea70805ae2dafa88008532443046449aa436d18d13edcd6ec0
R
4,997
154
#!/usr/bin/R # --------------------------------------------------------- # Replot the DEG enrichment table from the modules package: # Updated 11/27/2021 # --------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(bindir, 'm...
96016e7a3072e4339762d816909282fa5f4c528239f64feddf625828631d830d
R
5,008
80
#!/usr/bin/env Rscript ## ----------Script----------------- ## ## Purpose: Comparison of jones2024 dataset ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ## --------------------------- dirnames$jones2024 <- "/lustre/projects/Research_Project-MRC148213/lsl693/rTg4510/0_otherStudies/Jones2024/" ## ---------- c...
5b10328702763c4bbdca4d5a0b66b1477394b7a4c09074a81fb707cd4940874f
R
5,013
155
#-----------------------------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) ...
59ee26d3c61653f0661b4f2c33cf24ccb8456a4bb1ff3731e7f35b09fc2f342d
R
5,015
141
--- title: "Updating a Systematic Search" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Updating a Systematic Search} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ## **Setup** First,...
5c78fa191525a8167dd184dbce7ab2b6472084cbe012a1ce94381e82fa50213a
R
5,023
136
## HiC-Pro ## Copyleft 2015 Institut Curie ## Author(s): Nicolas Servant ## 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 3C filtering results ## rm(list=ls()...
b5e9c5b6c7a9cc3fdc90bcf167906263e43e2afea4ee1cfb3815f0d29d2b538c
R
5,046
162
#!/usr/bin/R # -------------------------------------------------- # Part of metabolic modules figures # - Systematic scan for e4-associated modules # Updated 06/20/2023 # -------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sb...
bb60590a221ddaecd5015c44572b4d44fc06352bbac9ff4e56a883805d069ec5
R
5,054
97
library(GSVA) library(Seurat) library(magrittr) library(stringr) library(ggplot2) source("/functions//pseudo_gsva_general.R") #Loading object comb_hd_cd44_pos <- readRDS("comb_hd_cd44_positive.rds") comb_hd_cd44_neg <- readRDS("comb_hd_cd44_negative.rds") #Gene set loading astro_genemark <- read.csv("/data/astro_ge...
25990e21ed7b9052ce5e8ff30767b7756116ae4b32041574564daf976d23d7d0
R
5,072
169
#!/usr/bin/R # ------------------------------------ # Plot specific pairs of correlations: # Updated 02/09/2022 # ------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } source(paste0(sbindir, 'auxiliary_pseudob...
0dd68f66de94d997185757cd91ca5096d051c82839ccb0238b7716f48876b421
R
5,075
182
test_that("function returns numeric threshold", { # Create valid test data set.seed(123) controlVals <- matrix(rnorm(30), ncol = 3, nrow = 10) testVals <- matrix(rnorm(30, mean = 1), ncol = 3, nrow = 10) intOnly <- data.frame(cbind(controlVals, testVals)) myDesign <- c(1, 1, 1, 2, 2, 2) pVals <- runif(10,...
62de5b9b2058e40478ac32beb40578e3b490db59cb8682f6b7ae48cf274cd3a3
R
5,076
147
library(monocle3) source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") source("./formattingFunctions.R") library("optparse") # Get the passed parameters option_list = list( make_option(c("-c", "--cdsRNA"), type="character", default="allCells_HM10UMI=100_mit...
266f21a32528e8644c1453596a2669a6ec4a53e1cff56c3c6862d4b3d9133648
R
5,080
138
#!/usr/bin/R # ---------------------------------------------------------- # Plot enrichments for the collated + aggregated DE results: # - Compare enrichments in same celltype, across regions. # Updated: 01/30/23 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiReg...
ec532d5bd285bc0455f2698338492bc8b9bade16f134fa4c5f13f2b0131c2708
R
5,089
89
load('PDGC_CPM_exp.RData') source('~/Workshop/18-09-12_Multicentric/codes/rfunc/ssgseaMOD.r') tableS1 = read.table('supplementary_table1.txt',header=T,sep='\t',row.names=1) PDGC_CPM_exp.f = PDGC_CPM_exp[,which(tableS1$In.house.subtype!='other')] rs = mod.analyze2(PDGC_CPM_exp.f,c('OXPHOS','PN','MES','Proneural','Class...
b6c3489eb7621ae7c776c95e7a30be346400a97ed41cb881b2ee8c11fc13a644
R
5,090
179
#### Spatially-aware Gaussian mixture models #### ## --------------------------------------------- setMethod("spatialDGMM", "ANY", function(x, coord, i, r = 1, k = 2, groups = NULL, weights = c("gaussian", "adaptive"), neighbors = findNeighbors(coord, r=r, groups=groups), annealing = TRUE, compress = TRUE, byr...
66dee3b4f53483382672e44cd379f50f1906cc07d16ae1f82b0d9296f7995a99
R
5,107
168
#!/usr/bin/R # --------------------------------------------------------- # Plots on the ranked genes from the horizontal pseudotime: # Updated: 03/09/2022 # --------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(t...
d22b1805669a3cce2103089f8025287b5894cf43c4b1d9023e603621db2d0146
R
5,109
116
splitvalidate.lassosum.pipeline <- function(ls.pipeline, test.bfile=NULL, keep=NULL, remove=NULL, pheno=NULL, covar=NULL, trace=1, split=NULL, rematch=!is.null(...
c8d41be26021a0d03d587aafa91b026c85541477f3353b4e88bfd20fe88a3d2f
R
5,110
132
#!/usr/bin/R # ---------------------------------------------------------- # Plot DEGs with highlighted enrichments # for the collated + aggregated DE results: # - Compare enrichments in same celltype, across regions. # Updated: 01/30/23 # ---------------------------------------------------------- library(cbrbase) set_...
929223b853651959823718aa13c9f1ea26ba26906a4737bae994712bfab6a965
R
5,111
158
test_that("extract_fsl_betas resolves per-cope L2 cope-file outputs", { root <- tempfile("extract_l2_cope_files_") dir.create(root, recursive = TRUE) mask_file <- file.path(root, "mask.nii.gz") RNifti::writeNifti(array(1, dim = c(2, 2, 2)), mask_file) make_l2_row <- function(cope_number, cope_name, value) {...
e79487c44770415da17539c6c7a2e18c26c97a0a544cc04f4f3a8d5f278f82cd
R
5,115
159
#!/usr/bin/R # -------------------------------------------- # Plot the expression patterns for GWAS genes: # Updated 02/21/2022 # -------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } source(paste0(sbi...