sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b2ff703b351ae9975c5aafb85b3144bcb1ba552d47017c0da6bec52379f9f7eb
R
2,665
62
## ---------- Iso-Seq whole dataset ----------------- IsoSeq_polyAErrorRate <- function(limaPath, RefinePath){ polyA <- lapply(list.files(RefinePath, pattern = "flnc.report.csv", full.names = T), function(x) read.csv(x)) polyACounts <- lapply(polyA, function(x) nrow(x)) names(polyACounts) <- list.files(RefinePat...
8d186077a48e50c67ea1b462ba92bdd22b78bd4c513d77c5872f2e8a79535797
R
2,666
68
### Ref links # http://tuxette.nathalievilla.org/?p=1696 # https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/ ## ----------------------------------------------------------------------------- # get the input passed from the shell script. args <- commandArgs(TRUE) # test if there is at least one ar...
219f98f7a02132d1bd037b7a681eefea2488f879f2d8ae3edb7181424cb859ea
R
2,674
85
--- title: "Torch tutorial" output: html_document --- # Packages ```{r} library(torch) library(torchvision) library(tidyverse) library(reshape2) library(matlib) source("./code/utils.R") source("./code/data_loader.R") source("./code/modules_2.R") ``` # Preprocessing ```{r} set.seed(20) raw <- read.csv("./data/raw.csv"...
0fbf2cd997b01cc4829ec9a5b06b3700b67e5d7b68a651682e7622cf92519a84
R
2,675
93
options(bitmapType='cairo') plotEigen <- function(x,y,plotTitle) { ymin<-min(y,na.rm=TRUE) ymax<-max(y,na.rm=TRUE) xStart<-min(x) xEnd<-max(x) ybound<-max(abs(ymin),abs(ymax)) if(ymin < 0) { ybounds<-c(-ybound,ybound) } else { ybounds<-c(0,ybound) } plot(x,y,type="n",main=plotTitl...
215b64023642416953b8eec5060dc30fa21f3e47a39c9daf0776a3a304a027b9
R
2,678
79
library(testthat) library(dplyr) # Load the testing set test_citations <- read.csv("labelled_test_set.csv") test_citations <- as.data.frame(test_citations) # Test case: No duplicates detected test_that("No duplicates detected", { test_citations_nodups <- test_citations[c(6, 21, 65),] expect_warning({ a <- de...
0646c81e9dd4870393c0f76e705b3637520008a21fb49bba2b1de0a96c7dfe38
R
2,680
64
library(testthat) library(sccomp) test_that("sccomp_identify_covariate_contrasts identifies direct covariates", { model_input <- list( X = matrix(0, nrow = 1, ncol = 2, dimnames = list(NULL, c("(Intercept)", "treatment"))), XA = matrix(0, nrow = 1, ncol = 2, dimnames = list(NULL, c("(Intercept)", "treatment"...
1c490d9d916930e28e07445efb56cd022dedce3a3c09cf5f1c05d381074361a8
R
2,683
116
#' Plot spectra matrix #' #' Plots the spectra matrix. #' #' If package \pkg{plotrix} is available, a color legend is plotted to the right. #' The right margin is set to at least 5 lines. #' @param object hyperSpec object #' @param y character giving the name of the extra data column to label the y axis. #' @param ylab...
3b93142533f985d0c81caa97107f401a13d40af23afe0d059b500931e88531dd
R
2,684
73
# Description: In this script we obtain the C>U variant lists using replicates. We keep the variants that appear in at least 2/3 replicates and set their freq to the mean of the replicates # ———————————----------—# #### Functions ---- read_cims <- function(file) { data <- read.table(file, header = FALSE) %>% as...
33cdbb31f0994495e266a7e4a593d8205fe77904d5fef17f2fceae39803f83b5
R
2,689
78
# in # data/04_DS1.ssce.Rdata # data/05_DS2_seuratLT.Rdata # data/07_DS1_pseudot_umap.Rdata # data/07_DS2_pseudot_umap.Rdata # # out # data_figs/08_density_pseudot.pdf library(ggplot2) library(SingleCellExperiment) options(bitmapType = 'cairo') # (0) Load Datasets ---- # (0.1) Load DS1 ---- (load('data/04_DS1.ss...
8a2d821a64ab6d32e264ac8d12c406a6d593763cfd10bf473b7ed736ac4fc803
R
2,689
105
library("Seurat") setwd("./Step8a.SubClusterAnalysis") ## Excitatory neurons Ex.SNC <- readRDS("Ex/Ex.Harmony.Ind.rds") Idents(Ex.SNC) <- Ex.SNC$RNA_snn_res.0.2 DimPlot(Ex.SNC) DimPlot(Ex.SNC, split.by = "orig.ident") Ex.SNC$seurat_clusters <- Ex.SNC$RNA_snn_res.0.2 Ex.SNC$Subcluster <- paste0(Ex.SNC$MajorCluster, "....
ebec98d256bf74bba2cdacaafc1ee5b349793914450769517b8397c75e8022e6
R
2,690
56
## ---------- Script ----------------- ## ## Purpose: appending input variables merged datasets ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ## ---------------------------------- # source rTg4510_ont_characterise.config.R ## ---------- Appending to existing lists ----------------- # directory paths dirna...
2e08344b54ca62e31fce274fbf95ed49be8158fa3e82935109f030e328051f44
R
2,693
89
# For the specified k, for pairs of summary scores relating to g or processing # speed, find the correlations and associated p-values. # Output: # olab,'.csv' Correlation, p-value, and p < 0.05 thresholded versions. #Set libraries. library(tidyverse) library(ggplot2) library(gridExtra) #Catches arguments. args <- ...
7fe1bf60e9a6f339089f079238f142d83216f48f4fb482dd91cb0b5b16fecbe0
R
2,711
77
# https://mllg.github.io/batchtools/articles/batchtools.html library("batchtools") setwd("./Step8b.SubCluster.DEG") reg <- makeExperimentRegistry("DEGRegistry", packages = c("MAST", "data.table", "Seurat", "lme4"), seed = 22112019) reg <- loadRegistry("DEGReg...
ba9d9eb77a513c4403fbc6f4471268c12b6c274f4bf252252517d8a7861979dc
R
2,712
79
test_that("scheduler log filenames include scheduler, job id, job name, and extra token", { log_file <- fmri.pipeline:::scheduler_log_file( "/tmp/batch", scheduler = "slurm", job_name = "3dlmer_l3 session/EV face", job_id = "%j", extra = "jobabc" ) expect_equal(log_file, "/tmp/batch/slurm-%j-...
c075aa4ace528c58da07bd18c18f617a36913ae012c07fd929fb3f014366d7b4
R
2,712
96
library(dplyr) celltype_list=c("Exc","Inh","Ast","Oli","OPC","Mic") region_list=c("AG","EC","HC","MT","PFC","TH") for (r in 1:length(region_list)){ region=region_list[[r]] ##################################### genes_list <- list() for (i in 1:length(celltype_list)){ celltype=celltype_list[[i]] wo...
cf2616df365887db84aac0317c6053a974b4814b70ca5d5d225d333c2cd5fbf1
R
2,716
96
library(dplyr) celltype_list=c("Exc","Inh","Ast","Oli","OPC","Mic") region_list=c("AG","EC","HC","MT","PFC","TH") for (r in 1:length(region_list)){ region=region_list[[r]] ##################################### genes_list <- list() for (i in 1:length(celltype_list)){ celltype=celltype_list[[i]] wo...
bbd18907dcc530ecaf9a7149a265616500d8327549ca84188a738d38af3c3bd1
R
2,726
89
# Gather cognitive tests and confounds into one file, with the addition of # gPCA, gEFA, and gCFA. # Output: # pred_all.csv Cognitive tests and confounds (i.e., Age, Gender), with the addition of gPCA, gEFA, and gCFA. #Load packages. library(tidyverse) #Set outpath. subgroup <- 'full' outpath <- paste0('../outputs/c_...
49473e7e6c00b8a85e4015927779fb0ec3679962e01e31718087005f824ddfe8
R
2,731
52
test_that("correct calculation", { pdf(NULL) # to prevent generating an empty RPlots.pdf yaml = get_testyaml_object("dir", analyser = "TimeSlots", changes ="DataSettings$CalculationWindow$Start = 1.5") ana = get_analyser_object("TimeSlots", yaml) expect_equal(ana$ana_name, "TimeSlo...
e436dc15fc8419372bf02d5ce89caa37ef4c803e66d6f84b4eaf4e57a4ac9ac5
R
2,739
110
#!/usr/bin/env Rscript # gnomAD project credits available at http://gnomad.broadinstitute.org/ # Code to perform module 00 (matrix creation) QC across all batches for gnomAD v2 #################################### #####Set parameters & load libraries #################################### args = commandArgs(trailingO...
6c3f7de8483ff8df48f7b524e74df0bce06e2d2d1667e3210dbcdb57692dcadd
R
2,743
83
args <- commandArgs(trailingOnly=T) miniscan <- args[1] # miniscan output prefix <- args[2] # load data d <- read.delim(miniscan, header=F) # number of chromosomes/contigs nchr <- length(unique(d[, 1])) # plot plot_height <- 8 * nchr / 10 pdf(paste0(prefix, ".miniscan.pdf"), width=5, height=plot_height) par(mar=c(4...
e26096688fa5d6232e99087a0712e7c20d7b13e7b05a46b907c628ae4330c227
R
2,746
98
#!/usr/bin/R # ---------------------- # Turn the cell type matrices into chunked matrices # Updated: 04/28/2022 # ---------------------- # chunksize=25 library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) library(rhdf5) library(Matrix) # Function to estimate en...
c12ddcbf291dff25bd88b9da42bc9a74faa67052a4c4fd954d8fbd2fe7b0436e
R
2,751
52
source('Analysis/util.r') library(Seurat) library(dplyr) library(magrittr) library(ggplot2) x <- readRDS("Data/Processed/alphasyn-triplication-initial-integrated.rds") meta <- data.table::fread("Results/Initial/Initial integration/doublet-finder-metadata.csv") %>% tibble::column_to_rownames("V1") meta <- meta[meta$DF....
d9a9823dae096df6a36a5f97586f7bb0756e0c7b64f394cc7f9d6a27ef93d2bd
R
2,751
69
library(pROC) library(PRROC) library(tidyverse) library(writexl) source("Functions.R") ########################################################### # This is for the predictions based on metrics. ########################################################### predictions = read_tsv("Testing_Results_Predictions.tsv") %>% ...
a62d01af6457faab59e8ded838e6e348b748c1cafed1c01b93a750a84b01531d
R
2,753
75
### Ref links # http://tuxette.nathalievilla.org/?p=1696 # https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/ ## ----------------------------------------------------------------------------- # get the input passed from the shell script args <- commandArgs(TRUE) ## --------------------------------...
264c2e544f61ce3b9fa32e581c15566e38c9e87a62e32f6439a906496cdd560c
R
2,757
121
#' Get and set the wavelength axis #' #' [wl()] returns the wavelength axis, `wl<-` sets it. #' #' The wavelength axis of a `hyperSpec` object can be retrieved and #' replaced with `wl()` and `wl<-`, respectively. #' #' When the wavelength axis is replaced, the colnames of `x@@data$spc` are #' replaced by the rounded n...
1662108cfec22d28cfccd84fbc3d6a6b0d9a704db001da649778f66a8f80f21e
R
2,767
131
# Function ------------------------------------------------------------------- .ncol <- function(x) { validObject(x) ncol(x@data) } #' Number of rows (spectra), columns, and data points per spectrum of a #' `hyperSpec` object #' #' These functions return the number of rows (spectra), columns, and/or #' data points...
226838976d658f87057dcef723b652a9e04236db5499f4047f528b6207b9f463
R
2,767
80
#!/usr/bin/R # ------------------------------------- # Set up a matrix for the differential # expression runs using Nebula + RUV # Updated: 11/24/21 # ------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) # -------------------------------...
c73c777967c781ea5644c050849af7fcd0216994f564db1fb25112949c870a06
R
2,768
105
#' @name deprecated #' @concept deprecated #' #' @title (DEPRECATED) #' Deprecated and defunct functions #' #' @description #' These \pkg{hyperSpec} functions are **deprecated** and not maintained any #' more. You should not use these. #' Currently they are present due to back-compatibility reasons and will be #...
82d012fc84030c5566b4083af55dd3786e84dfaa7a7bf7e0738b8d79bbb52f70
R
2,770
74
### Ref links # http://tuxette.nathalievilla.org/?p=1696 # https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/ ## ----------------------------------------------------------------------------- # get the input passed from the shell script args <- commandArgs(TRUE) ## ----------------------------------------...
f79dd17e87bb01c10b1937e9ebea6f847f5e2ba774072d65ddb3a4773b05c928
R
2,770
87
# STAT_TABLE.R # function that creates a summary for all fixed effect of the tested ROI with the probability intervals. # INPUT: # - model: brms-model (as created by run_model) # OUTPUT: # - ROI_table: summary for all fixed effect of the tested ROI with the probability intervals stat_table <- function(model) { # f...
6ef1ac09982263aad288119446f4a34f752d878779e6138d5d4fec7c3e6d7514
R
2,776
56
####------ Deduplicate citations WITH manual dups added function ------ #### #' #' This function performs additional deduplication with the additional of manually flagged duplicates #' @export #' @import dplyr #' @param unique_citations A dataframe containing citations after automated deduplication #' @param merge_cita...
787cdec04783ee614b7b5d801c722312dfdb56990061a8f0a21664c18276fac1
R
2,777
103
require(testthat) require(Cardinal) context("SpectralImagingArrays") test_that("SpectralImagingArrays accessors", { sa <- SpectralImagingArrays() expect_true(validObject(sa)) sa <- SpectralImagingArrays(numeric(0)) expect_true(validObject(sa)) set.seed(1) n <- 10 i <- rep(list(1:n), n) a <- replicate(n, ...
e8eb821d4981bba3ef7e854ccb51a6a62aa8c6912c8698a522de3b4da1e2dc00
R
2,777
88
#!/usr/bin/R # ---------------------------------------------------------- # Get a list of shared DEGs across regions for each ct/path: # and make plots for amt shared and consistency # Updated: 12/20/22 # -------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source...
02064f6a274ccc9bb1708e36a424dcfb9df488134643baa2ee27418ef91cc6f0
R
2,779
73
#!R #plot count of SVs stat #!/usr/bin/env Rscript library("optparse") option_list = list( make_option(c("-i", "--input"), type="character", default=NULL, help="input file, should include 5 columns representing sample_id, count_SVs, chr, svtype and size_range", metavar="character"), make_option(c("-...
f7d1cd717a3b65e8a7494acd0c052745d40aa64afdd8b06fd45614a06c640884
R
2,780
76
### Ref links # http://tuxette.nathalievilla.org/?p=1696 # https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/ ## ----------------------------------------------------------------------------- # get the input passed from the shell script. args <- commandArgs(TRUE) # test if there is at least one argument: ...
5d605c6a138775b868e1d9dc5b0f6945ee29cf6da0f56439d1bbd55cb0860639
R
2,784
84
dir_MetS_PRS <- "../../PRS-CS_UKBB_target/" dir_FOF_PRS <- "../../PRS-CS_UKBB_target/firstorder/" basedir_IP_PRS <- "../../PRS-CS_UKBB_target/individual_phenotypes/" PRS_files <- c( paste0(basedir_IP_PRS, 'BMI/', 'score_sum_indiv.profile.reformat'), paste0(basedir_IP_PRS, 'FG/', 'score_sum_indiv.profile.refor...
3f520ce5c7fbefe932bdab496453a99819da8ca07257f44bac82d2f353e6590e
R
2,785
79
## ANOVA TESTING AGE, POTENTIALLY CONFOUNDING VARIABLES AND BRAIN DATA #install packages install.packages("lme4") install.packages("tidyr") install.packages("ggplot2") install.packages("tidyverse") install.packages("haven") install.packages("ggpubr") install.packages("rstatix") install.packages("broom") install.packag...
79a6c02f4f1a4e73f5d620a726a21a90329fe1399683d51639172e9541a77376
R
2,789
67
# Title: Nested active zone area analysis # # Description: # This script performs a nested active zone area analysis. # It calculates the area of active zones within each nested bouton. # # Author: Daniel Parthier / Felicitas Brüntgens # Date: 05.10.2023 # Last modified: 10.04.2024 # Version: 1.0 # Load libraries ###...
1bf2daf62e98782a6e1e38d33001add29ea0f7dee3c57f69b5475d05e6f3f6ea
R
2,794
87
#### Estimate shared domain #### ## ------------------------------ estimateDomain <- function(xlist, width = c("median", "min", "max", "mean"), units = c("relative", "absolute"), verbose = getCardinalVerbose(), chunkopts = list(), BPPARAM = getCardinalBPPARAM(), ...) { units <- match.arg(units) width <- match.a...
fa33b063f8e02fba9bb941abea5b1656dba3452af623881e58a5467bf2486e9d
R
2,801
108
################## ### PART - 1 ### ################## rm(list=ls()) data<-read.delim("/Users/cazaledl-admin/Library/CloudStorage/OneDrive-UniversityofBirmingham/Post_doc/XP/data/motioncontrols/tracker/.txt",h=T,sep="\t",na.strings = "NA",stringsAsFactors=T) str(data) data$vel[data$vel < 4] ="" is.na(...
c6e9901d23fa03903bb50e63d344ab3d01ceb8e40adf3595bad07be161f825e3
R
2,810
100
########################################################################## ~ ### ### plot_voronoi - plot spectral maps with irregular point pattern ### ### plots intensity or extra data column over 2 extra data columns ### ########################################################################## ~ # Function -----...
be7532f9b2bcf4908bac050c1749bfbc64f3547ffaba45bf5f7753bd611f0f4a
R
2,815
72
# Title: Nested bouton complexity analysis # # Description: # This script performs a nested bouton complexity analysis. # It calculates the bouton complexity within each nested animal. # # Author: Daniel Parthier / Felicitas Brüntgens # Date: 17.04.2024 # Last modified: 19.04.2024 # Version: 1.0 # Loading libraries #...
908c357709379e0032987cf6c969fdb9f0d7c976fe1f6dded2bd2647800b1075
R
2,825
87
make_partial_feat_dir <- function(feat_dir) { stats_dir <- file.path(feat_dir, "stats") dir.create(stats_dir, recursive = TRUE) file.create(file.path(stats_dir, "cope1.nii.gz")) file.create(file.path(stats_dir, "zstat2.nii.gz")) writeLines( c( "/ContrastName1\tface-house interaction", "/Contra...
4f1b80d8c1063cfd58cb96783e6090aadbb15409521864a4b5703496f6295857
R
2,833
71
test_that("run_3dlmer_sepjobs wrapper reuses one terminal job status", { run_3dlmer_path <- source_tree_file("R", "run_3dlmer_sepjobs.R") lines <- readLines(run_3dlmer_path, warn = FALSE) expect_true(any(grepl("job_status=\\\"COMPLETED\\\"", lines, fixed = TRUE))) expect_true(any(grepl("job_status=\\\"FAILED\\...
9df5776163938f9a0171dbe3abfd3b07a5fec9a88e2c2e7ee4c84bf4b3dacac1
R
2,839
79
### Ref links # http://tuxette.nathalievilla.org/?p=1696 # https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/ ## ----------------------------------------------------------------------------- # get the input passed from the shell script. args <- commandArgs(TRUE) # test if there is at least one argument: ...
226536b4fd72d7e82d967ec3c5b81ca767560520c5af5be7734a378c5639f71d
R
2,840
76
#!/usr/bin/R # --------------------------------------------- # Load published AD DEGs from previous studies: # Updated: 07/27/23 # --------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') # source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) options(width=175) ...
c77bd77cb827dd72df8a3fccac9c6497d8fd6b4dd41424c1877dac30668c0c38
R
2,844
70
--- title: "gcVAE_processing" output: html_document --- # Process data so Alfredo can run gcVAE ```{r} source("./code/load_packages.R") all_raw <- read.csv("./data/raw.csv", header = F) all_cov <- read.csv("./data/covariates.csv") all_cov$SEX <- as.factor(all_cov$SEX) all_cov$DIAGNOSIS <- as.factor(all_cov$DIAGNOSIS)...
33e0140b9bcd830a6ed22367e11747025e4fe9a53d429654283973581d5a4ddb
R
2,852
75
## ---------- Script ----------------- ## ## Purpose: input variables for differential analysis of Iso-Seq targeted mouse transcriptome datasets ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## ---------- packages ----------------- suppressMessages(library("dplyr")) suppressMessages(library("stringr")) suppr...
8bb42ae86215c3810b11c59c6d95b4e974f578ecd9632eee38c823102dc79175
R
2,855
62
library(SeqArray) library(SeqVarTools) library(SNPRelate) library(Biobase) library(GENESIS) ##### Inputs ##### seqBED2GDS(bed.fn = "psp.bed", bim.fn = "psp.bim", fam.fn = "psp.fam", parallel=12, out.gdsfn = "psp.gds") gds <- seqOpen('psp.gds') # read samples phe <- read.csv("pheno.csv") phe$sample.id <- phe$Sample_I...
efb5078cde34e78d3613e8e0698dd27fb92b1147b7bf9bd32ac67e5218ba931a
R
2,856
88
library(readr) library(dplyr) library(tidyr) library(data.table) library(lgr) library(foreach) library(doParallel) library(dependlab) library(emmeans) #library(devtools) #install_github("UNCDEPENdLab/fmri.pipeline") library(fmri.pipeline) trial_df <- readRDS(system.file("example_files/mmy3_trial_df_selective_groupfix...
c07c01188859d7ad8c1a514f5203ff1c2a61aab9cffcf43a6c86e17f67cba35c
R
2,865
91
##### ComBat-like: # Site effect in mean/variance # Covariate effect in mean only library(reshape2) library(mvtnorm) library(invgamma) library(randomForest) library(pROC) library(ROCR) library(caret) library(Matrix) library(CovBat) source("covbat_sim_functions.R") load("animats_add.Rdata") load("covbat_sim_params.Rda...
26e3e15da3d4c48cc8fd0b056dba904f63b8ef4a7429d530cb6833913bd6f061
R
2,871
96
# For each network, delineate it in brain ROIs by color. # Output: # onehemi,'_',onelat,'_colenetwork.jpg' Brain plots for networks for one hemisphere and side. #Set libraries. library(tidyverse) library(ggplot2) library(ggseg) library(ggsegGlasser) library(scico) #Set outpath. outpath <- '../outputs/r_network/' dir....
3e2ab5ccff2fb77405a900014f2ad22c2d26aa51024b2389b79f28d24d5174a1
R
2,871
50
refMap <- read.table("/lustre/projects/Research_Project-MRC148213/lsl693/rTg4510/H_Sorted_Nuclei/6_merged/bulkSorted.rTg4510SCN_collapsed.filtered_targetgenes_filtered.gtf.refmap", header = T) srefMap <- read.table("/lustre/projects/Research_Project-MRC148213/lsl693/rTg4510/H_Sorted_Nuclei/6_merged/Sortedbulk.all_iso_o...
589366bf06781fd7f99862e58501d27e962310bf42d25623634dfbb4e6717317
R
2,871
45
--- title: output: html_document: toc: true toc_float: true --- ```{=html} <style> .list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover { background-color: #80CBC4; } </style> ``` # About <img src="updated_logo.png" align="right" width="142"/> ASySD was developed in t...
95029a4a2c2cb27f761002088828e46c0d404bbf61ccf4b1be0f1d1cf5b51ecc
R
2,880
56
library(ggpubr) library(dplyr) CR1_geno<-read.csv(file="CR1_geno.csv") cov<-read.csv(file="covariates.csv") CR1_geno<-left_join(CR1_geno,cov, by=c("sampleID"="Row.names")) m1<-lm(CR1~rs679515_dosage+updatedDX + race + gender + expired_age + PMI,data=CR1_geno) capture.output(summary(m1), file = "rs679515.output.txt") ...
ba630124631aec6acc155430893b0d77c866d9747ef9dc12cbf3f359e2dd3ead
R
2,884
103
library(colorspace) library(doParallel) library(dplyr) library(foreach) library(grid) library(httr) library(magick) library(readr) library(spacesXYZ) library(stringr) library(tibble) # This file is created by 13_Select_PMC_Images.R. articles_filepath = "PMC_Selected_Articles.tsv" # This is where the images downloaded...
147f679a974284dd226fabb023afee925ee5222bc7fe9978a9a123652c3d5238
R
2,892
98
library(dplyr) celltype_list=c("Exc","Inh","Ast","Oli","OPC","Mic") celltype_list2 = c("Ex01","Ex02","Ex03","Ex04","Ex06","Ex07","Ex08","Ex10","Ex13") region_list=c("AG","EC","HC","MT","PFC","TH") for (r in 1:length(region_list)){ region=region_list[[r]] ##################################### genes_list <...
849019b8ba906550be980d603d392c6c1b9b8a171840da7332970ac8644daf6d
R
2,898
98
library(dplyr) celltype_list=c("Exc","Inh","Ast","Oli","OPC","Mic") celltype_list2 = c("Ex01","Ex02","Ex03","Ex04","Ex06","Ex07","Ex08","Ex10","Ex13") region_list=c("AG","EC","HC","MT","PFC","TH") for (r in 1:length(region_list)){ region=region_list[[r]] ##################################### genes_list <...
cfb41f08d6293bb567a7afffd1a6361d400ef288faab2c4f01dfeb213071c215
R
2,901
91
##### Covariance only # Site effect in covariance only # Covariate effect in covariance only library(reshape2) library(mvtnorm) library(invgamma) library(randomForest) library(pROC) library(ROCR) library(caret) library(Matrix) library(CovBat) source("covbat_sim_functions.R") load("animats_add.Rdata") load("covbat_sim...
a0bfb6d4547045355246a004978351be2dfc59c35c35448533616f4738a7c842
R
2,910
74
log <- file(snakemake@log[[1]], open = "wt") sink(log) sink(log, type = "message") # Code adapted from https://github.com/chenlabgccri/CeL-ID/blob/master/Cel-ID_functions.R # 2023-05-10 Aurélien Ginolhac # DP and FREQ files from https://github.com/chenlabgccri/CeL-ID # converted to {fst} by the following: # ccle_dp <...
58dd54aad2ab4c97d3a54977604e815211b4ea4f8ba7c28a9cd6bfc1906ab394
R
2,912
75
### Ref links # http://tuxette.nathalievilla.org/?p=1696 # https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/ ## ----------------------------------------------------------------------------- # get the input passed from the shell script. args <- commandArgs(TRUE) # test if there is at least one argument: ...
8077374d7648f7de9b52aa3e8e02b1cc1394ab6c36b46f50973b44c0cd8da44d
R
2,914
107
library(monocle3) source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") source("./deHelperFunctions.R") library(DESeq2) library(ggplot2) library("optparse") # Get the passed parameters option_list = list( make_option(c("-c", "--cdsRNA"), type="character"...
9cea20cf790085fc25d69f7676407efa402e11d1a80067e2ad044d9909ef424d
R
2,918
64
# util.r library(dplyr) library(magrittr) library(Seurat) library(ggplot2) library(forcats) library(stringr) library(patchwork) library(RColorBrewer) library(grDevices) celltype.levels = c('Neuron 0', 'Neuron 5', 'CN 1', 'CN 2', 'CN 3/Photo 6', 'Inhibitory neuron 8', 'proRG 3', 'RG 4', 'RG 9', 'Astro 7') cell.broadtyp...
782156b000102b6f1fbfc57c84a82eb3ff66eefeb4fefb8c3413bf463f05e51e
R
2,920
74
group.blocks <- function(Blocks, parseselect, mem.limit=2^32*8, chunks=NULL, cluster=NULL) { #' @title Group blocks into chunks so as not to exhaust memory or hit #' matrix size ceiling #' #' @param parseselect An object returned by parseselect() #' @keywords internal ncols <- B...
2f7ad658ec1ed8f05117930486b870bbfe8e7c4c08b891f6ee9d3df137f7aa25
R
2,927
79
#!/usr/bin/env Rscript # # Command-line version of 'update_tracked_job_status' # Used for jobs submitted to 'cluster_job_submit' that are command-line only (e.g., not nested in R_batch_job) # retreive in code using: upd_job_status_path <- system.file("bin/upd_job_status.R", package = "fmri.pipeline") # example statu...
9d056105e4e27b29b62e863f643e58771b92050453a31162a0e017169c2cf8da
R
2,929
82
--- title: "MGEnrichment Analysis" author: "Jenn Kim, Annie Ciernia" date: "`r Sys.Date()`" output: html_document --- # load libraries ```{r} library(tidyverse) ``` ```{r} # Focusing on all gene lists in database except for WGCNA modules # tidy up data setwd("MGEnrichmentResults/") # provided as a zip file in github ...
cb1185fe8fb1a29a68734eba3663692588756a8b87c483633c22d0c2fc965748
R
2,934
95
log <- file(snakemake@log[[1]], open = "wt") sink(log) sink(log, type = "message") suppressPackageStartupMessages(library("Rsubread")) bams <- snakemake@input[["bams"]] annot <- snakemake@params[["annotation"]] # se should come as 0 and 1 se <- as.logical(snakemake@params[["se"]]) # se should be boolean of is each BA...
05b23e4a536219e2954f4b4c1d67b8e8839038fd970d9ea5505e85819d48cfd2
R
2,942
64
setwd("./Projects/SNCSynuclein") library("Seurat") library("tidyverse") # load the DEG files DEGFileCombind <- readRDS("Step6.DEG/DEGs/DEGFileCombind.rds") Clusters <- names(DEGFileCombind) for (i in 1:length(DEGFileCombind)){ dat <- DEGFileCombind[[i]] %>% as.data.frame() write.csv(dat, paste0("Step6.DEG/DEGs/",...
d407c4a1bede2fbbd02a4b4484d3cd5dd92658556aaf576918e607f3ee7ee668
R
2,943
123
require(testthat) require(Cardinal) context("spectrapply") test_that("spectrapply - SpectralImagingArrays", { set.seed(1, kind="default") x <- replicate(9, rlnorm(100), simplify=FALSE) t1 <- replicate(9, sort(runif(100)), simplify=FALSE) t2 <- replicate(9, sort(runif(100)), simplify=FALSE) t3 <- replicate(9, so...
8ed050b75ea43ef3a5514b8b58c9fa7b896b92a13968d29ff8630fa6523ada2e
R
2,959
113
#' @rdname spc-loess #' #' @title LOESS smoothing interpolation for spectra #' #' @description #' Spectra smoothing and interpolation on a new wavelength axis using #' [stats::loess()]. #' #' @details #' Applying [stats::loess()] to each of the spectra, an interpolation onto a new #' wavelength axis is performed. At th...
41545bde139d5283529441d8b597c8d0fec315526a9b4cde36f7a8c382a12eeb
R
2,960
117
#' Normalize numbers to interval \[0, 1\] #' #' The input `x` is mapped to \[0, 1\] by subtracting the minimum and #' subsequently dividing by the maximum. If all elements of `x` are equal, #' 1 is returned. #' #' @name normalize_01 #' #' @param x Object (e.g., vector) with values to transform. #' @param tolerance ...
15833f7501b632e99578c949251d9c910ded1c9da73acd2c01d9685dd90b6b49
R
2,964
96
# Data integration for replicability analysis # # input: # data/01_DS1x.ssce.Rdata # data/02_DS2x.ssce.Rdata # output: # data/03_DS1x_discardedNuclei.txt : 1071 discarded DS1x nuclei # data_figs/03_DS1x_DS2_umap.pdf require(batchelor) library(BiocParallel) options(bitmapType = 'cairo') # (0) Load data ---- ...
cc8c0590089ea8e9cabb142231db4e2272cfbaea672c9e5276eea60201edf9c0
R
2,964
53
library(Seurat) library(dplyr) library(tidyverse) library(magrittr) library(liana) setwd("F:/Brain_region_project/Brain_region_final_12TB/Data_for_Connectome") pbmc=readRDS("TH_merge_major_cell_type.rds") Idents(pbmc)<-"cell_type_high_resolution" pbmc=subset(pbmc,idents=c("Ast DPP10","Ast GRM3","Ast DCLK1",...
4ac2f4389579f089fbf338b8b664ac5994ac77309da0335beae2332aed43c249
R
2,967
89
--- title: "Methylation Query" author: Szi Kay Leung date: "`r Sys.Date()`" output: html_document: toc: true toc_float: true code_folding: hide --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## Files 1) rTg4510_RRBSbetaComplete.Rdata 2) Phenotype file (Transferred from "/gpf...
4ce25ca0c25c0976e3832ca5ceddd828c76547b6cfd5f2dfca882d47e4d6c65c
R
2,981
85
library('RColorBrewer') library('MAST') library('data.table') library('Seurat') library('biomaRt') library('lme4') # load the seurat object Seurat.SNC <- list() MajorCluster <- c("Ex", "In", "Olig", "OPC", "Ast", "Mic", "Vascular") for (i in 1:length(MajorCluster)){ setwd("./Step8a.SubClusterAnalysis") setwd(Majo...
ed3ad10e4fc989e75f935c77c10647d2c0261f777db8103f384e6ea9e2bbd04a
R
2,984
88
#!/usr/bin/R # ----------------------------------------------------------- # Load the UMAP coordinates parameters for modules / subsets: # Updated 11/27/2021 # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(bind...
160deeaa60b193e63d48364c811a9c40c7b136c2496c196556b508ae21cb04d0
R
2,989
106
# Set generic ---------------------------------------------------------------- #' Function evaluation on `hyperSpec` objects #' #' Function `vanderMonde()` generates Vandermonde matrices, the `hyperSpec` #' method generates a `hyperSpec` object containing the Vandermonde matrix #' of the wavelengths of a `hyperSpec` o...
f56bf1c2e1a1cf91d22f81e2f3fad188b3be412643e35176eefb7694539d4d12
R
3,001
77
############################################################################### # # # GECCO 2018 Industrial Challenge - Main Evaluation # # #...
ff231098fe863ae21afa0842113ad0c718205eb5c06e3462b643946f9190eb22
R
3,005
94
##Difference analysis of chromoatin accessibility setwd("F:\\Manuscript\\ATAC\\data\\Tissue_stage_specific") library(dplyr) library(edgeR) library(ggplot2) library(stringr) dataCount <- read.table("F:\\Manuscript\\ATAC\\data\\AllPeakList.merged.TPM.txt", header = T, row.names=1) datFilter <- select(dataCoun...
572e0e99aa184aaadd224e273371133f238f9da514acd361abbb6ae275a22dba
R
3,008
87
library(Seurat) setwd('/ArchR/scRNAseq') dir <- 'CN6_E11-5A/mm10_cur' ob <- Read10X(dir) seu <- CreateSeuratObject(ob, project = 'CN6-e115') seu <- NormalizeData(seu) seu <- FindVariableFeatures(seu) seu <- ScaleData(seu) seu <- RunPCA(seu) seu <- RunUMAP(seu, reduction = 'pca', dims = 1:50) hist(as.numeric(seu['g.eGF...
668996c08c6ad678365ac10a3bc2f39711c11e3750c4e4ce1c46cbbf4a3c3408
R
3,009
94
setwd("./Projects/SNCSynuclein") library("Seurat") library("tidyverse") library("DESeq2") library("vsn") # 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(Seu...
04f84899924ab6991a059d7a5feab1a9ea3165498d2fa1c076c6685bf6eec4c3
R
3,012
80
library(spacexr) library(spASE) library(tibble) library(data.table) library(Matrix) library(dplyr) library(tidyr) cerebellum_ref <- readRDS('../inst/extdata/reference_scrna/cerebellum_sn_ref_spacexr.rds') PATH <- '../inst/extdata/slideseq/cere3' positions1 <- fread(file.path(PATH, 'Puck_221014_23_barcode_matching.tx...
3ecd84d986b5ca9ea7e36bead3accbaa3c9fdcda3e3bab4b3d016696c0ea732e
R
3,016
89
#### VIRTUAL class for a DataFrame with key columns #### ## ----------------------------------------------------- setClass("XDataFrame", contains = c("VIRTUAL", "DataFrame"), slots = c(keys = "list")) setClass("XDFrame", contains = c("XDataFrame", "DFrame")) #### DataFrame with position information #### ## -------...
1f4c9fb82bc42d9b8261671d8da18b27b345f29fc694d0fec54da41fd7869da5
R
3,020
83
ImpulseDE2_ATACSeq <- function(comparisons, conditions, results, padj_threshold) { # Load Comparisons matCountData = read.csv(comparisons) rownames(matCountData) <- matCountData[,1] matCountData$ATACSeq <- NULL matCountData <- data.matrix(matCountData) colnames(matCountData) <- substr(colnames(...
8c43b2258d585f7616c835344e5d7f0ce21ffc42adb790b403a48dfe9a6f2dc2
R
3,024
89
calculate_performance_1 <- function(data){ asysd_result <- dedup_citations(data, keep_label = "Unique", merge_citations = FALSE) unique <- asysd_result$unique unique_to_match <- unique %>% rename(asysd_label = label) %>% mutate(asysd_label = "Unique") %>% select(asysd_label, record_id) check <- l...
7f85db1ce196ff08e767b69e66b09e15fedcf373259b60f36a0d08a5d913eebe
R
3,025
81
rm(list=ls()) library("ggalluvial") library(dplyr) load("../NMF_res/NMF_LOOV_cluster.RData") load("Wang_subtype.RData") load("Neftel_subtype.RData") load("Garafano_subtype.RData") dat <- data.frame(Wang=Wang_subtype[names(groups)],NMF=groups,stringsAsFactors=F,row.names=names(groups)) dat %>% filter(NMF != "other") ->...
4bbd2a01c245dea8f03256d0bf52460a27a83458e81033ab991d419d661921d0
R
3,026
59
#setwd("/proj/mnhallqlab/users/michael/fmri.pipeline/example_files") #load("MMClock_aroma_preconvolve_fse_groupfixed_sceptic-clock-feedback-pe_max-preconvolve_fse_groupfixed_lvl2_inputs.RData") #load("MMClock_aroma_preconvolve_fse_groupfixed.RData") setwd("/proj/mnhallqlab/projects/clock_analysis/fmri/fsl_pipeline/con...
644be0a8f0d144ff571a21afe70034cc25a05f59d867cf0c9fba2c1637a1b751
R
3,030
89
require(arrow) require(plyr) require(dplyr) require(stringr) require(tidyr) cct_vtypes = c("missense", "spliceai") pval_cols = c(score = "pv_score") tests_to_exclude = c("plof-skat", "deepripe-burden") #plof_skat and deepripe_burden is not done by Monti config = snakemake@params[["config"]] phenotype = snakemake@p...
3a2877e9ac70a7bab8292439722c1e0e91a0e647e62559e7deecfefcf461af9e
R
3,032
99
require(GenomicSEM) library(data.table) sumstat.dir <- "../../gwas/EasyQC/results/" munge.dir <- "./" log.dir <- "./logs/" dir.create(file.path(log.dir), showWarnings = FALSE) reference_file <- 'w_hm3.snplist' TG_GLGC <- paste0(sumstat.dir, "CLEANED.TG_GLGC_UKB.txt") TG_GLGC_noUKB <- paste0(sumstat.dir, "CLEANED.TG_...
36e2d15153c8f23c779d75d45cca40de5217fda7488602a1c82c4f1a71663a88
R
3,034
97
source("R/setup.R") source("R/shinyforecasts/plots.R") config <- yaml::read_yaml("config/config.yaml") dataset <- "xxx" case_id <- "xxx" case_pattern <- paste0("case_", case_id, ".parquet$") univ_folder <- paste0("data/predictions/", dataset, "_predictions_univariate/") ml_folder <- paste0("data/predictions/", datase...
7923c71ea25056e2abf23a6ac6164ee6150b4cedc0f427963577adb3c19d6384
R
3,035
106
enrichment_analysis2 <- function(geneUniverse,genesOfInterest) { #STEP1: select genes of interest geneList <- factor(as.integer(geneUniverse %in% genesOfInterest)) names(geneList) <- geneUniverse print(geneList) #suppressMessages(topGO::groupGOTerms()) #topGO::groupGOTerms(environment()) #STEP2: Ma...
342400fcfd9fbe084adb0276314750963d88f96e53d6a6e2aca652aa877da768
R
3,039
77
required_libs <- c("rjson", "tidyverse", "magrittr", "data.table", "ggpubr", "kableExtra", "rmarkdown", "argparser", "lme4", "lmerTest", "multcomp", "xtable", "tidyselect", "ggthemes", "RColorBrewer", "openxlsx") for(libb in required_libs){ lib_test <- eval(p...
a8267e54523a00b2fcce732272d2b5cca62b672092105c8031da16e48ff6f31d
R
3,043
59
#' archstabms_structure_metrics_datasets #' #' Add 3D structure metrics of multiple datasets. #' #' @param dataset_names character vector of dataset names (required) #' @param pdb_file_list list of paths to PDB files (required) #' @param base_dir Base directory (required) #' @param output_dir Output directory (require...
9df2c79428ad9bc485d8e897eae9835faff205611332f0f50e0becf6591a23a8
R
3,048
88
# Title: Nested active zone distribution analysis # # Description: # This script performs a nested active zone distribution analysis. # It calculates the 3D distance of active zones within each nested bouton. # # Author: Daniel Parthier / Felicitas Brüntgens # Date: 09.04.2024 # Last modified: 19.04.2024 # Version: 1....
e47ed8324ecf05ffb932ee07d659b30d6d78883ccd272ddcb1bd40b2f09eab87
R
3,048
105
### ----------------------------------------------------------------------------- ### ### write.txt.wide ### ### #' @rdname DEPRECATED-write_txt #' @concept deprecated #' #' @importFrom utils write.table #' @export write.txt.wide <- function(object, file = "", col...
22f4b7a7ce640cbfb0f7f97161d92dcaf3945e947b2f28cdfc425df4fb56d633
R
3,053
93
library(dplyr) library(emmeans) library(fmri.pipeline) library(readr) source("/proj/mnhallqlab/projects/clock_analysis/fmri/keuka_brain_behavior_analyses/dan/get_trial_data.R") trial_df <- get_trial_data(repo_directory = "/proj/mnhallqlab/projects/clock_analysis", dataset = "mmclock_fmri", groupfixed = TRUE) %>% dpl...
e0356b309f0fde5dabec58813ce768900836caccedde53a81426f6ea203261a5
R
3,054
84
## ----------Script----------------- ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## Date: Jan 2023 ## ## Explore the output from cupcake collapse after parameter optimisation of --max_5_diff and max_3_diff ## Output of 4_collapse_further.sh ## Format of group.txt, generated from cupcake collapse (v8.6) ## ...
ef0c5ab0b4032f32a3b6994f9fba4fc8f5ba0dfeef14d3e91768015567563c84
R
3,068
88
#' Batch deduplication for large searches #' #' This function splits citations into batches, deduplicates each batch, and binds results together into one dataframe of unique citations. #' @details The following fields will be used in `citations` (if provided): record_id, author, year, journal, doi, title, pages, volume...
00ec72a14e7a4b37d89229f47da10225258204d1970edb4b06117b9053e1573f
R
3,070
62
options(bitmapType='cairo') args <- commandArgs(TRUE) dir<-args[1] inputFile<-args[2] inputFileArray<-unlist(strsplit(inputFile, "\\/")) inputFileName<-inputFileArray[length(inputFileArray)] wd<-paste(dir,sep='') setwd(wd) data<-read.table(inputFile,header=T,sep="\t") data<-subset(data,data$loessExpect...
7815f856c844c48d9c51a6628841280d5f5dc32320416dfb6b5265f6ed96e058
R
3,070
102
#!/usr/bin/env Rscript # Helper script to clean final table of vcf vs vcf comparisons ###Set parameters options(stringsAsFactors=F) ###Helper function to clean an input overlap file cleanData <- function(dat){ #Get list of repeated VIDs repeat.IDs <- names(which(table(dat[,1])>1)) #Iterate over repeated VIDs a...