sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c8b612c4a5dba4d7bf3a33c4c9cb252f3d4770079afc8121fefbd509d5f205ab
R
2,846
82
# This script was adapted from a script provided by the Intergalactic Utilities Commission (IUC) # Load packages ----------------------------------------------------------- suppressPackageStartupMessages({ library(dplyr) library(ggplot2) library(ggrepel) }) setwd(dirname(rstudioapi::getActiveDocument...
1e79b615d8fa64155edbe573f4290f9cc264434c8449c231ad90b89639f20e26
R
2,875
93
### This file gives an extend initialization. initial.em.gbd.extend <- function(PARAM){ N.all <- PARAM$N.all N.gbd <- PARAM$N.gbd K <- PARAM$K p.X <- PARAM$p.X ### For the 1st cluster. gcenter.X <- colMeans.gbd(.MixfMRIEnv$X.gbd) gcenter.PV <- 0.5 ### For the rests. id.PV.gbd <- which(.MixfMRIEnv$P...
500f1a8888eca12bf5330f04144a3edd0c90c06baf3702bdd03f004cc8dc74e2
R
2,877
99
library(tidyverse) library(ArchR) library(Seurat) set.seed(666) addArchRThreads(threads = 1) addArchRGenome("hg38") # proj <- loadArchRProject(path = "Dracheva_ALS_FTD_addRNA/") # # meta_data <- getCellColData(proj) %>% # as.data.frame() %>% # rownames_to_column("cell_id") %>% # as_tibble() # # # Exc # meta_da...
c9c46d58b3fe3a00f3caf1bca141341d0f43ceb88b94867223aca8678e29598e
R
2,881
49
library(Seurat) library(dplyr) library(cowplot) library(ArchR) library(ggplot2) ###Figure2a#### rds = readRDS('Save-ArchR-Project.rds') cellColData = data.frame(rds@cellColData) cellColData[,1][cellColData[,1] == 'adult_hindbrain_PL2011260025'] = 'Rho-1' cellColData[,1][cellColData[,1] == 'adult_hindbrain_...
33e6248791a702f25d866827df57b323cf3d4fbc98781445b8fb124db6212736
R
2,882
93
### This file gives a qnorm extend initialization. initial.em.gbd.qnorm.extend <- function(PARAM){ N.all <- PARAM$N.all N.gbd <- PARAM$N.gbd K <- PARAM$K p.X <- PARAM$p.X ### For the 1st cluster. gcenter.X <- rep(0, p.X) gcenter.PV <- 0 ### For the rests. id.PV.gbd <- which(.MixfMRIEnv$PV.gbd < PAR...
f0ee59af14505f1691326e9c07e8b976cc73be778a9794fbd03f6c28e4cd3d17
R
2,901
49
library(Seurat) library(dplyr) library(cowplot) library(ArchR) library(ggplot2) ###Figure2b#### rds = readRDS('Save-ArchR-Project.rds') cellColData = data.frame(rds@cellColData) cellColData[,1][cellColData[,1] == 'adult_hindbrain_PL2011260025'] = 'Rho-1' cellColData[,1][cellColData[,1] == 'adult_hindbrain_...
08fbb18e64391edc11df1a6a9ba589f0734ab0409814aac5b80e5e9446f1de88
R
2,904
117
library("ggplot2") library("gtools") library("graphics") library("pastecs") args <- commandArgs() #print(args) outdir <- args[6] print(outdir) baffile <- args[7] print(baffile) sample <- unlist(strsplit(baffile,"/")) print(sample) sample <- unlist(strsplit(sample[length(sample)],"_"))[1] print(sample) f2 <- function(...
34f56707f14d95501a7efedbea02afb5e5995c5a3f1e6d7058c7ba10112c88f8
R
2,929
70
#-------------------------------------- # Compare length and area measurements # to surface and volume measurements # 25 Jan 2023 #-------------------------------------- source("./common.R") # select variables fw <- data.frame( `Binomial_name_timetree` = character(), `English_name` = character(), `Log10Brain...
87a9bdee9dc1cff3e5e83362c7185c7ea5218d762fa5725cbeb0cc90a0737b75
R
2,931
82
library(faux) library(lme4) Ntests<-1000 #tolal N of SNPs tested NSims <-10000 #make Nsims at least 10 times more than N tests # We define a df to store the results for the intercept only model and the model with random slopes too res_slopes<-as.data.frame(matrix(ncol=2, nrow=NSims)) names(res_slopes)<-c("B","P") ...
41d31b597417cf470f5c72ee6e0a004f4074bead124689f64a8780451b43c813
R
2,932
111
# packagelist <- c('remotes','tictoc','utils') # missingpackages <- packagelist[!packagelist %in% installed.packages()[,1]] # if (length(missingpackages)>0){install.packages(missingpackages)} # if (packagelist[!'osfr' %in% installed.packages()[,1]]){remotes::install_github("centerforopenscience/osfr")} # packagelist <-...
7b5909649f843ec8db09cc9377e05b67ec34359b1bce265a7e7a8ffae1d6bfdf
R
2,936
98
library(tidyverse) library(ArchR) library(Seurat) set.seed(666) addArchRThreads(threads = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "Dracheva_ALS_FTD_addRNA/") meta_data <- getCellColData(proj) %>% as.data.frame() %>% rownames_to_column("cell_id") %>% as_tibble() # Neunons meta_data_neu <- me...
b42597ca1bd7b6d5e00feb6f75c68d75576e33966ff0f309736bea6ba71e3401
R
2,936
90
# init ---------------------------- library(languageserver) library(dplyr) library(tibble) library(readr) library(tidyr) library(lme4) library(lmerTest) library(broom) library(emmeans) library(ggplot2) library(gridExtra) library(sjPlot) setwd('C://Users/micha/Sync/Research/mri-pet/mri_surv/') ########################...
0ea416439a5448910985a046675ab086363835ec705f5c4c80095f3a8101a7d2
R
2,944
100
library(tidyverse) library(ArchR) library(Seurat) set.seed(666) addArchRThreads(threads = 1) addArchRGenome("hg38") # proj <- loadArchRProject(path = "Dracheva_ALS_FTD_addRNA/") # # meta_data <- getCellColData(proj) %>% # as.data.frame() %>% # rownames_to_column("cell_id") %>% # as_tibble() # # # Inh # meta_da...
1c3ba17082bb358d76049f2e5d8b5ba3f3a7e3f5f8335f8b0c483d5871b4a7bc
R
2,952
73
#------------------------------------ # Compare folial with measures # to folial width measures from # Sultan and Braitenberg (although # they do not denote the same thing) # 25 Jan 2023 #------------------------------------ source("./common.R") # select variables fw <- data.frame( `Binomial_name_timetree` = chara...
a34d6cffda28bf1856f15847a61694c1b78e4150dcda79b88af318dd0ad0d4b2
R
2,977
97
### Perform H0: alpha_1/(alpha_1 + beta_1) == alpha_2/(alpha_2 + beta_2) vs ### Ha: alpha_1/(alpha_1 + beta_1) != alpha_2/(alpha_2 + beta_2) lrt.betamean <- function(PV.gbd, CLASS.gbd, K, proc = c("1", "2")){ K.CLASS <- as.integer(max.gbd(CLASS.gbd)) if(K.CLASS > K){ stop("CLASS.gbd and K are not match...
c8609b434032c5d0a757b5f6926e5a56c31bcb8682ea8967a42c1d433814a5e4
R
2,978
102
#------------------ # Phylogenetic PCA # 25 Jan 2023 #------------------ source("./common.R") # All phenotypes #---------------- # load imputed data load("../data/derived/fit_OU.RData") dfOU <- imp_2$estimates rownames(dfOU) <- df$Binomial_name_timetree # fit mvgls variables <- c( "Log10BodyWeight", "Log10BrainWe...
781791f45589ccf7b73b5495748ecd2b1b3b82483cfd50b7b046727805b7bccb
R
2,979
98
### This file gives a simple initialization. initial.em.gbd.simple <- function(PARAM){ N.all <- PARAM$N.all N.gbd <- PARAM$N.gbd K <- PARAM$K p.X <- PARAM$p.X ### For the 1st cluster. gcenter.X <- colMeans.gbd(.MixfMRIEnv$X.gbd) gcenter.PV <- 0.5 ### For the rests. id.PV.gbd <- which(.MixfMRIEnv$PV...
ec2adddf12db0810fe1aac087d10a1cde516ff84258f38067bfcb50700924842
R
3,009
63
#!/usr/bin/env Rscript library(optparse) library(leafcutter) arguments <- parse_args(OptionParser(usage = "%prog [options] counts_file groups_file cluster_significance_file", description="LeafCutter differential splicing plotting tool. Required inputs:\n <counts_file>: Intron usage counts file. Must be .txt or .txt.gz...
b2e0e87dfcb06a27375b9418cce059f3b40be96dac524b99635c6828c509f37a
R
3,011
79
library(Seurat) library(Matrix) seed <- 2020 set.seed(seed) # read data matrix # after reading, suppose the data matrix is saved in 'data' # add col and row names for seurat object colnames(data) <- as.character(1:dim(data)[2]); colnames(data) rownames(data) <- as.character(1:dim(data)[1]); rownames(data) ...
3e1f487835f74336294055433a0fe0cce2c6ce8378a124a14f909b48dace2f63
R
3,035
52
data<-read.table("S-Fig5d_Drd_Egr_Gene_expression_inNAc.txt") #Drd1~Egr1 c<-round(cor(as.numeric(data["Egr1",]),as.numeric(data["Drd1",]),method ="pearson"),2) plot(as.numeric(data["Egr1",1:8]),as.numeric(data["Drd1",1:8]),pch=20, xlim=c(0,200),ylim=c(0,350),xlab="Egr1",ylab="Drd1",main=paste0("Cor: ",c), col...
ace99cc875109c9700c15466264618c652b5eae50636aa34da9e60c3dbe00c6b
R
3,048
110
### This file contains files for estimating parameters emperically. # x <- rbeta(1000, 0.5, 2) # (m <- mean(x)) # (v <- var(x)) # (alpha <- 1/v * (m^2 - m^3 - m * v)) # (beta <- (1 - m) / m * alpha) # alpha / (alpha + beta) # alpha * beta / (alpha + beta)^2 / (alpha + beta + 1) # M1 <- mean(x) # M2 <- mean(x^2) # (alph...
40470f66a7bb64fe56d91ce55f7eab74a422ef34ddf6987b111294d99914880a
R
3,051
86
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(scales) library(viridis) library(scico) library(shades) df <- read_tsv("./GO_webgestalt_results_affinity_rmRedundant_toPlot.tsv") %>% mutate( types...
797642e6d8de1d72e75901536547bf0a46ecc8e183c6f79a5a74924fa6ed4b36
R
3,060
99
### This file gives a qnorm simple initialization. ### This function uses qnorm.X.gbd and qnorm.PV.gbd to compute distance. initial.em.gbd.qnorm.simple <- function(PARAM){ N.all <- PARAM$N.all N.gbd <- PARAM$N.gbd K <- PARAM$K p.X <- PARAM$p.X ### For the 1st cluster. gcenter.X <- rep(0, p.X) gcenter.PV...
87d3672627a7f1acad26799beb3167d6947971799f10408035dc1e4c03ed1fef
R
3,070
60
library(pheatmap) library(ggplot2) library(stringr) co <- c('#3361A5','#3164AB','#3067B1','#2F6AB7','#2E6EBE','#2C71C4','#2B74CA','#2A78D1','#297BD7','#287EDD','#2682E4','#2585EA','#2488F0','#238CF3','#218FF4','#2092F5','#1F96F6','#1E99F7','#1C9CF8','#1B9FF9','#1AA3FA','#18A6FB','#17A9FC','#16ADFD','#14B0FE','#16B...
cbfc6ebfa648c4b3a5eec57a145d89c87c1b3c7e1f504b98523f1fec0938e108
R
3,118
103
context("unit testing fragCounter operations") library(fragCounter) library(data.table) library(GenomeInfoDb) ### Making small BAM # cd /gpfs/commons/groups/imielinski_lab/projects/PurityPloidy/Flow/Remix_Bams/HCC1143_1_5_4 1020 # samtools view -H downsample.bam > header_downsample.sam # samtools view downsample.bam ...
4432e557e601469ae84d8ccc6089b497da042cb0daff92f8a683a9e2e1bedc6f
R
3,149
80
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(tictoc) # read in annotated data data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAn...
f6e2210feeae2e4d4b72e7991fc594f225079b7c73058ef4ead0e53e6682cfc3
R
3,151
85
#!/usr/bin/env Rscript library(optparse) option_list = list( make_option(c("-i", "--input"), type = "character", default = NULL, help = "Input asqg file from snowman run --write-asqg or sga"), make_option(c("-c", "--inputcc"), type = "character", default = NULL, help = "Input cc file from snowman run --wr...
f79601a9d54fb2764ef9643ee58eae95b30f22134ab1062cf78cff28a54113c1
R
3,178
116
### compute correlation # dim(da.ts) = 40 x 5 x 10 cba.cor.2d <- function(da.ts, da.m = NULL, adj.dist = TRUE, fun.sim = stats::cor){ dim.da.ts <- dim(da.ts) dim.da <- dim.da.ts[-length(dim.da.ts)] dim(da.ts) <- c(prod(dim.da.ts[-3]), dim.da.ts[3]) ### Build inside brain ids id.inside <- 1:prod(dim.da) ...
96b4dd90d4cc6af3af7d6f9bab9af18ece87a58d2f1f8d72055f6677dee97be0
R
3,180
126
library(tidyverse) library(BSgenome.Hsapiens.UCSC.hg38) library(EnsDb.Hsapiens.v86) library(doParallel) library(devtools) library(Signac) library(Seurat) library(bayestestR) library(Pando) rename <- dplyr::rename filter <- dplyr::filter data(motifs) data(phastConsElements20Mammals.UCSC.hg38) data(SCREEN.ccRE.UCSC.hg3...
54805ae2e9964ff043553e37a280478c7bfd49fb202ae46a6bbf16a05a85623b
R
3,202
68
#' Beta binomial GLM likelihood ratio testing #' #' We recommend using \code{\link{dirichlet_multinomial_glm_anova}} instead, but this is here for comparison. #' #' @param ys numerator counts #' @param ns denominator counts #' @param xFull matrix of covariates for full model. First column must be ones. #' @param xNul...
cf87b4861cd47dcf449a6fe587fc76cb0475c1b1f8b82f0be409c8d64cf5fcd9
R
3,214
102
### This file gives a prob extend initialization. initial.em.gbd.prob.extend <- function(PARAM){ N.all <- PARAM$N.all N.gbd <- PARAM$N.gbd K <- PARAM$K p.X <- PARAM$p.X ### For the 1st cluster. gcenter.X <- rep(0, p.X) gcenter.PV <- 0 ### For the rests. id.PV.gbd <- which(.MixfMRIEnv$PV.gbd < PARAM...
1f8b219b046290641c8bb09f125edf5d0abffd660d33ee185c3b1aa46b17de70
R
3,228
66
files<-list.files(path="Fig1f",pattern="overlap") NAc_list<-read.table(paste0("Fig1f/",files[3])); DG_list<-read.table(paste0("Fig1f/",files[2])); CA_list<-read.table(paste0("Fig1f/",files[1])); SVZ_list<-read.table(paste0("Fig1f/",files[4])); #ATAC CA<-read.table("Fig1f/Fig1f.ATAC_Control_CA_vs_other.txt") DG<-read.ta...
727dbefeb45c7b01902db21dfd7ed5409b6f24122dd2291f82161cd519d2c32d
R
3,236
65
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) rna <- read_tsv("MAST_res_level2_summary.txt") plot_FC_cor <- function(selected_cell_type, selected_region, FDR_threshold, FC_threshold){ message(paste0("Processing...
7964ab9106c943e671a93818737f3d55dc53ba82824f6e5dc1aac4f978b1c12a
R
3,236
118
getSymAndString <- function(colVar){ colSym <- ensym(colVar) colName <- as.character(colSym) return( list( "symbol" = colSym, "string" = colName ) ) } selectIfExists <- function( df, colVar ){ var <- enquo(colVar) info <- getSymAndString(!! var) info$string df %>% select_i...
f42d1d93d393f1e5b97f5c18de39e1b7fb768cb84e18c509989020ec971dcd4e
R
3,245
109
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(ArchR) library(Seurat) set.seed(666) addArchRThreads(threads = 16) addArchRGenome("hg38") proj <- loadArchRProject(path = "Dracheva_ALS_FTD_addRNA_cellBender...
2fb674010d630a3d7b3000eecb70ea49aca419b2f79b21218a8856a02e115a65
R
3,282
75
--- title: "Installation" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Vignette Title} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- The prerequisites for LeafCutter are * [samtools](http://samtools.sourceforge.net/) should be available on your PATH * [regtools](https://r...
02d52a3e840aaf8c7a0b52450d6a1f166e3d5730b329c9918debce66569448de
R
3,303
105
library(tidyverse) library(readxl) library(fs) # Manolis ALS single cell DE genes list, June 2021 submission ver. file_1 <- "./Manolis_ALS_single_cell_DE_C9_ALS_June2021_submission.xlsx" file_1_sheets <- excel_sheets(file_1) %>% set_names() file_1_DE <- map_dfr( file_1_sheets, ~ read_excel(path = file_1, sheet =...
1e1f5b181be30e893498a2a1cc3afe02806fce2617e1a98b1bab6ae7122df29b
R
3,317
112
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(ArchR) library(Seurat) library(BSgenome.Hsapiens.UCSC.hg38) library(ComplexHeatmap) library(viridis) library(circlize) set.seed(666) addArchRThreads(threads = ...
6b43e40946a38ce2a5924d8cbbef25d3760cad19456fbc66f7545bed0df15af4
R
3,328
96
library(JaBbA) library(gUtils) library(gGnome) library(testthat) jj = system.file("extdata", "junctions.rds", package = "JaBbA") sg = system.file("extdata", "segs.rds", package = "JaBbA") cf = system.file("extdata", "coverage.txt", package = "JaBbA") ## save stuff as bw cf.bw = system.file("extdata", "coverage.bw", p...
83e7b5ca9bcf3a77834c75bba9aa0e9f94a13235faf9973e479a3bfa64b4deab
R
3,336
94
library(JaBbA) library(gUtils) library(gGnome) library(testthat) jj = system.file("extdata", "junctions.rds", package = "JaBbA") sg = system.file("extdata", "segs.rds", package = "JaBbA") cf = system.file("extdata", "coverage.txt", package = "JaBbA") test_that(desc = "Testing LP JaBbA with .bw coverage input", ...
d3e004517aed87bad9626a13633aa09252674e16bf1d40d45db50f599afb3ac8
R
3,360
93
#!/bin/Rscript # Loading packages .libPaths("/mnt/rreal/RDS/RDS/acarrasco/R_libs") library(MASS) library(nlme) library(Matrix) library(lme4) library(memoise) library(dplyr) library(tidyr) library(stringr) library(here) library(tidyverse) library(data.table) # Loading data - #Modify this so that I can take data from s...
ccf015819d8260edc3e652fef39ffc0a7d270d14c5619f69eda98ba24c78b3b8
R
3,374
113
# load things ----- library(dplyr) library(tibble) library(readr) library(tidyr) library(reshape2) library(stringr) if (Sys.info()["sysname"] == "Linux") { setwd("~/Research/mri-surv-dev/mri_surv/") } else { setwd("C://Users/micha/Sync/Research/mri-pet/mri_surv/") } tb <- read_csv("./metadata/data_raw/MCIADSub...
32d9c9b8d0b08b1d2b1096bf77bece16530ec1561eab02b3e4442e2634ee8c42
R
3,389
84
### Get the parameters parser = argparse::ArgumentParser(description="Script to QC scATAC data by ArchR") parser$add_argument('-I','--inputFiles', help='input fragment file') parser$add_argument('-D','--id', help='sample ID') parser$add_argument('-T','--filtertss', help='tss threhold') parser$add_argument('-F','--filte...
2c71cc5303402c35c82b986d728faf02bf815bf4ba0d8069ba25a6fe37bf894a
R
3,397
69
#!/usr/bin/env Rscript ## source all the required packages source.all <- function() { githome <- Sys.getenv('GIT_HOME') if (!nchar(githome)) githome <- '/xchip/gistic/Jeremiah/GIT' suppressMessages(suppressWarnings(require(ff, quietly=TRUE))) suppressMessages(suppressWarnings(require(VariantAnnotation, q...
11e76cba247ab8a428adc8c2826b6b861de58074360a0f765fc66e77f76bd01c
R
3,402
124
# init ---------------------------- library(dplyr) library(tibble) library(readr) library(tidyr) library(broom) library(ggplot2) library(gridExtra) library(sjPlot) library(FSA) setwd('C://Users/micha/Sync/Research/mri-pet/mri_surv/') ########################################## ########Now by lobe tb2 <- read_csv('./me...
1377ef8321f4e4c5a8410a688f355ea517dbb5ab65e4b169027d7b356ceb4cab
R
3,406
72
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(sctransform) library(scales) # read in clustered data, leiden clustering r = 1 data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBender_corre...
a3ba8aef82b7759976d6633e9d7722d5b8e9590eaaf974fe4327e4b3bafce73f
R
3,436
98
library(tidyverse) library(readxl) library(writexl) df <- read_tsv("./MAST_res_level2_summary.txt") df_ALS_motor <- df %>% filter(cond_1 == "ALS", cond_2 == "Control", region == "MCX", cell_type != "Exc_unknown") %>% select(-cond_1, -cond_2, -region, -num_cells_cond_1, -num_cells_cond_2) %>% mutate( ...
68cbd4b5e3fe4574cccd6522c51a224f5abd03cb5a0c7fa1971919ca96f10ac3
R
3,449
78
#-------------------------------------- # Compare length and area measurements # to surface and volume measurements from Ashwell # 31 Jan 2023 #-------------------------------------- source("./common.R") # select variables fw <- data.frame( `Binomial_name_timetree` = character(), `English_name` = character(), ...
851fa6e5f3ca76cfdf7cde743cfd71e3eadc28fe61e3fd16b7cc48da76d692fd
R
3,460
109
### This file gives a prob simple initialization. ### This function uses qnorm.X.gbd and qnorm.PV.gbd to compute distance, ### but selects new rest centers proportional to qnorm.PV.gbd. initial.em.gbd.prob.simple <- function(PARAM){ N.all <- PARAM$N.all N.gbd <- PARAM$N.gbd K <- PARAM$K p.X <- PARAM$p.X ###...
e05cd04e241394bdf5794b262a06b55103d6b315e2d95768a525050aa8b3fd5c
R
3,477
90
library(Seurat) library(readxl) library(ggplot2) library(SpaGene) library(dplyr) library(tidyverse) library(RColorBrewer) def_plotLR<-function(expr,location,normalize=TRUE,topn=floor(0.2*dim(location)[1]),knn=8,LRpair=c("Ptn","Ptprz1"),pt.size=2,alpha.min=0.1,max.cut=0.95){ if (sum(rownames(expr) %in% LRpai...
fb52a2c8765beea1a618982c3b86c3393e5a742fe79a5dd25c39a63e2d5235ad
R
3,510
100
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(sctransform) library(scales) library(harmony) library(ggrastr) ## read the sctransform-normalized seurat object data_obj_sub <- readRDS("./seur...
5f777170704bdb3300d9dd6806d082083f96733c64bcb433ca3e3db8b71fd9a6
R
3,536
121
### compute correlation # dim(da.ts) = 46 x 55 x 43 x 105 cba.cor.3d <- function(da.ts, da.m = NULL, adj.dist = TRUE, fun.sim = stats::cor){ dim.da.ts <- dim(da.ts) dim.da <- dim.da.ts[-length(dim.da.ts)] dim(da.ts) <- c(prod(dim.da.ts[-4]), dim.da.ts[4]) ### Build inside brain ids id.inside <- 1:prod(d...
80edbcd2c804ba13ad48160e93096b987aaa98db2970d29d3aebaf7d998f65b4
R
3,550
90
library(Seurat) library(Matrix) library(scDesign) # read data matrix # after reading, suppose the data matrix is saved in 'data' # add col and row names for seurat object colnames(data) <- as.character(1:dim(data)[2]) rownames(data) <- as.character(1:dim(data)[1]) # Seurat preprocessing data.seurat <- Crea...
e2e4b2d1e1551252887547c940b992ec58323ce68a8ba55f428f7c6f41ee0988
R
3,558
107
### For general methods. fclust <- function(X.gbd, PV.gbd, K = 2, PARAM.init = NULL, min.1st.prop = .FC.CT$INIT$min.1st.prop, max.PV = .FC.CT$INIT$max.PV, class.method = .FC.CT$INIT$class.method[1], RndEM.iter = .FC.CT$CONTROL$RndEM.iter, algorithm = .FC.CT$algorithm[1], model.X = .FC.CT$mo...
80cdffb9740e9a7f0bc8cf185bd4ee4a143d88ba4d893cd7fa916dd5e8380665
R
3,560
122
library(tidyverse) library(ArchR) set.seed(666) addArchRThreads(threads = 16) addArchRGenome("hg38") proj <- loadArchRProject(path = "Dracheva_ALS_FTD_rmLowQualitySample/") getAvailableMatrices(proj) proj <- filterDoublets(ArchRProj = proj) proj <- addIterativeLSI(ArchRProj = proj, useMatr...
2e513289d389e787ff6860192127da3fd2a4891f1b3fadc40b60607adf00188f
R
3,610
108
#Sys.setlocale("LC_ALL","Chinese") setwd("E:/cTBS_HDDM_RTanalyses") install.packages("lme4") install.packages("lmerTest") library(lme4) library(lmerTest) ## Exp 2 iTBS # Left iTBS, consonant, quiet D <- read.csv("Exp2_iTBS_D_L_C_Q_rawdata.csv") D$turn_type<-factor(D$turn_type,levels=c("Sham","Left iTBS...
0fb54ed61d7edc92061173556d42ebe79d2f8c563e51de26cb02bca00dbe8ea8
R
3,623
144
library(data.table) library(tidyverse) library(mpra) library(magrittr) library(config) ####################### # LOADING ENV & FUNCS # ####################### # loading config and getting wd config <- config::get(file = "where_the_config_file_is_stored/config_scz.yml") current_wd <- str_c(config$scz_file_foldername) ...
4cb3ac187d3a22c966edff421b98845de531fd131e1e390c81042ce9dbcf50cc
R
3,627
87
#### Thank you for using our code, wish you all the best! #### #### Key parameters to generate different scenario of Homo-Area can be found in line 36——42 #### #### Clear the work space rm(list=ls()) library(Matrix) library(CMP) options(warn =-1) set.seed(110) #### Prepare the material for Simulation # M...
4ebc531e57b9d73e0da78ddd23a6777faeee8ff5880c4941c771e8a9f137898f
R
3,634
105
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(ggrastr) library(ggrepel) snRNA <- read_tsv("MAST_res_level2_summary.txt") FDR_threshold <- 0.05 FC_threshold <- 1.2 # FC_threshold <- 2 snRNA_cell_types <- ...
ebe10e77e6e53958659b6db6bf948e2c615735b3aa47763cb3a36d8db5a0c2f5
R
3,698
76
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(sctransform) library(scales) # read in full dataset with 1st round annotation data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBneder_corre...
82cc07e8545729bc70404aba1101f9ef8757fe18b9f0fb9cbf0885f13b32bc18
R
3,714
169
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(ArchR) library(Seurat) library(BSgenome.Hsapiens.UCSC.hg38) library(viridis) library(scico) set.seed(666) addArchRThreads(threads = 16) addArchRGenome("hg38") ...
7756eba67d6228120e6070323519a8f9cacaf894f37aa745c2f6a54d40987dbb
R
3,760
106
require(tidyverse) setwd('~/Dropbox/Apps/ShareLaTeX/CogSci 2019/code/') source(file='transmit/R/transmit.R') alphabet_length <- 4 symbols <- c('A','B','C','D') codebook <- construct_codebook(symbols) timesteps <- 1000 #Basic idea here is to pick a distribution, then send INDIVIDUAL messages using that distribution, a...
973139f1a5596a881ca303a2fd764f64d75d31261dd78413566eb3b700a36b25
R
3,783
111
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(pheatmap) library(viridis) library(scico) df <- read_tsv("./snRNA_vs_bulkRNA_FC_correlation_stat_summary.txt") region_relabel <- c( "MCX" = "motor cortex",...
82793b173c50b1c4c04d4dbc2454e4ee5676d1a61813daa36a85b8d1529b35bb
R
3,797
111
--- title: "Models" author: "Jonas Simon Fleck" date: "5/17/2022" output: html_document --- ```{r, echo = FALSE, message=FALSE} knitr::opts_chunk$set(message = FALSE, warning = FALSE) ``` Pando provides various regression models and modeling options that can be used for GRN inference. This vignette gives an overview ...
bcab0af6af230aa285ddff468ce3107515e14354ec172888c133bdcd039c052f
R
3,797
124
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(DESeq2) library(variancePartition) # read in pseudobulk grouping metadata sample_info <- read_tsv("./pseudobulk_group_metadata.tsv") # read the pseudobulk cou...
243ae4d9d5af30b8d324372aefb38c397b95897e49f1c7c02f6b9a404e564b78
R
3,800
110
# plot-baseline-v2.R # # Successor to plot_baseline(). Uses helpers from plot-slices-core.R to # remove duplication with before_after_v7. Adds optional per-slice color # and shape mapping for stable visual identity across run_id and mode # changes. # # Backward-compatible signature: every original argument is preserved...
7dfb5da5d8d38cfb4e039ccab12fbcfd7bf1ee2cefb7f5436c2c6e3258b333fb
R
3,810
102
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(plotly) library(htmlwidgets) rna <- read_tsv("MAST_res_level2_summary.txt") cell_types <- rna %>% distinct(cell_type) %>% filter(!cell_type %in% c("Exc_un...
42e84a7f52c8f9d0791fd0a1bb89de6519affaf23d69b561f6500ef4a79fc9bd
R
3,832
158
#' @rdname initiate_grn #' @export initiate_grn initiate_grn <- function(object, ...){ UseMethod(generic = 'initiate_grn', object = object) } #' @rdname find_motifs #' @export find_motifs find_motifs <- function(object, ...){ UseMethod(generic = 'find_motifs', object = object) } #' @rdname infer_grn #' @expor...
ddbc6a73b27ba47f907c147a77c8f8d750974bf18e4c9ac19ae251d5dde1259b
R
3,834
107
library(tidyverse) library(forcats) library(pheatmap) library(viridis) library(scico) library(RColorBrewer) library(BuenColors) library(qvalue) library(dendsort) res <- read_tsv("./ldsc_results/ldsc_res_ALS_FTD_latest_snATAC_anno_withOverlapAnnot_summary.txt") group_order <- c( "Exc_superficial_MCX_ALS", "Exc_super...
3bdf68b8dbb4fa15a248040c77cac78bc2e79e42fa70785f390d7bf91a753a9d
R
3,850
141
library(tidyverse) library(ArchR) library(Seurat) set.seed(666) addArchRThreads(threads = 8) addArchRGenome("hg38") proj <- loadArchRProject(path = "Dracheva_ALS_FTD_addRNA_addPseudobulkRep/") # pairwise test # sanity checks to compare between cell types marker_oligo_vs_astro <- getMarkerFeatures( ArchRProj = pr...
05fda2b0f14b10c8285b1125a93327f47f3e3877781cbeab65d95a8c498c9c68
R
3,875
105
"%&%" <- function(a,b) paste(a,b, sep = "") library(tidyverse) library(data.table) library(phyloseq) library("microbiome") library(ggplot2) library(cowplot) library(vegan) "%ni%" <- Negate("%in%") library(microbiomeutilities) library(ggdendro) library(RColorBrewer) library(metagenomeSeq) #FHS #Bring in the Meta Data...
999822ac6546ad6aea4e39dbcf0b31f38fede418a77bf8de36f2c77c789ff2b3
R
3,907
91
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(miloR) library(SingleCellExperiment) library(scater) library(Seurat) library(tidyverse) library(patchwork) data_obj_sub <- readRDS("./seurat_objects/snRNA_postQC_scTransformed_cl...
556bdef154959402163d434596efdff6b37e07905a54560da55f579f0506e54c
R
3,925
146
runif.bcast <- function(n, min = 0, max = 1){ ret <- as.double(runif(n, min, max)) if(.MixfMRIEnv$MPI.gbd){ ret <- pbdMPI::spmd.bcast.double(ret, double(1)) } ret } # End of runif.bcast(). rexp.bcast <- function(n, rate = 1){ ret <- as.double(rexp(n, rate)) if(.MixfMRIEnv$MPI.gbd){ ret <- pbdMPI::s...
731ad26e63d510ac9007b313937232eb051bed82a3cf5055187ce29628d27a6b
R
3,933
121
#!/nfs/sw/R/R-3.6.1/bin/Rscript ################################################################################ ### COPYRIGHT ################################################################## # New York Genome Center # SOFTWARE COPYRIGHT NOTICE AGREEMENT # This software and its documentation are copyright (2023) by...
7a6cb11e77fbe30f19e1c324d35d3f58a645cf48bc54876720224c34ef598549
R
3,941
87
# icc's D --------------------------------------------------------------- library("vcd") library("irr") library("tidyr") library("readr") library("dplyr") library("reshape2") # load table with individual ratings tb.handed <- read_csv('/Users/mromano/research/mri-surv-dev/mri_surv/metadata/data_raw/MCIADSubtypeAssessme...
d8a133d1e5bc4f746b4e8dd100da21bd7c69192ebea9e73d19664a6473146034
R
3,949
98
#-------------------------------------- # Load data, reformat it and configure # globally used variables # 25 January 2023 #-------------------------------------- # read phenotypes cb_area_length <- read.csv("../data/derived/csv/01_cb_area_length.csv", row.names = 1) ctx_area_length <- read.csv("../data/derived/csv/...
49597b41c8e3fe657a151f192f3a59345dc5395b412566145e3b30432d841bfb
R
3,976
132
test_that("decoding a signal", { codebook <- construct_codebook(c('A', 'B', 'C')) signal <- encode_signal( codebook=codebook, symbol = 'A', signal_power = 10, duration_in_seconds = 10 ) signal_plus_noise <- add_channel_noise( codebook = codebook, ...
9402ab4ba3c98398fb665765584efbb55e0539edb825bac3a9bbc3657670a2ea
R
4,008
142
### DEPRECATED FOR NOW, but keep this file library(ggplot2) library(SurvMetrics) library(caret) library(survival) library(pec) library(tidyverse) clean_col <- function(data, dtcol) { data[, dtcol] <- str_remove_all(data[, dtcol], "\\[") data[, dtcol] <- str_remove_all(data[, dtcol], "\\]") split_str <- i...
c0b17ad493673d48cd5e3c0d77b046599aea58e954b0c11d56ee038906d8efd7
R
4,031
114
#!/bin/Rscript ## DESCRIPTION ## # This is the workflow to automate the finemapping from echocolocatoR # This script takes a txt file with the following informations # RS_PATH # SS_path ## Example usage #Rscript FINEMAPPING.R [path_to_metadata_file.txt] # Activate echoR conda env #system("conda activate echoR") #...
e8e80098d44daed439790a9256fb1f6837c2a40d736e29f8a4d5756d4d57839e
R
4,032
142
########################################################################### ## The following function solves a linear or quadratic program (LP|QP). #' @name Rcplex2 #' @rdname internal #' @title Rcplex2 #' @description #' #' Modification of Rcplex which takes in mipcontrol parameters. #' #' #' @export Rcplex2 <- func...
36950e4025bd35fd2599f02305232b3b7652e04b3c5bde48912b5d234b598607
R
4,041
108
options("width"=240) phantom <- c("shepp0fMRI", "shepp1fMRI", "shepp2fMRI") overlap <- c("0.01", "0.1", "0.25", "0.50", "0.75", "0.95") min.1st.prop <- c("0.975") max.PV <- c("0.05") model <- c("I") prefix <- "simu" ret.summary <- NULL ret.summary.org <- NULL K.min <- 2 K.max <- 8 for(i.phantom in 1:length(phantom)){...
dec1c5e8707cecdf930b14439a5ed8a5d87d9ddb37c55d78b1616300dc2ac495
R
4,041
119
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(pheatmap) library(viridis) library(scico) library(pdfCluster) library(ggrastr) # data_obj <- readRDS("./seurat_objects/snRNA_cellBneder_correct...
46b03e95dba5f70273c54e11a45c027976f69afd2a073e3e02aab3c27602102a
R
4,049
132
### This file contains major functions for ECM iterations. ### CM-step. cm.step.gbd.ETA.1st <- function(PARAM){ ### MLE For ETA[c(1, K)]. w <- 1 - sum(PARAM$ETA[-c(1, PARAM$K)]) tmp <- w * .MixfMRIEnv$Z.colSums[c(1, PARAM$K)] / sum(.MixfMRIEnv$Z.colSums[c(1, PARAM$K)]) if(tmp[1] <= PARAM$min.1st.prop)...
ee9d50de5e496a223a3bb0528336eb195f4e86e74b55287fb4cf2b650ca2c3b9
R
4,080
142
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(scDist) data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnotated_SeuratV4_object....
969226fb714b37066d559501ffab389f35609c7d1397ada583ce4e24daf17168
R
4,144
152
context('Tests for utility functions') library(testthat) library(GenomicRanges) library(matrixStats) library(doParallel) library(Pando) #### find_peaks_near_genes #### test_peaks <- GRanges( ranges = IRanges( start = c(10, 20, 30, 40, 45), end = c(15, 22, 33, 45, 46)), seqnames = 'chr1' ) ...
5d92725972d187673c58a2cb25abe872ab79a57649a1606570c914350e1f95f9
R
4,155
119
#!/nfs/sw/R/R-3.6.1/bin/Rscript ################################################################################ ### COPYRIGHT ################################################################## # New York Genome Center # SOFTWARE COPYRIGHT NOTICE AGREEMENT # This software and its documentation are copyright (2023) by...
75ac19ba29a3b7de4ab1117d836f7ced5162da7146e8b920ceca2c1bf3057bcf
R
4,168
146
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(scDist) data_obj_sub <- readRDS("../seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnotated_SeuratV4_object....
6f7a7ff590d84f0490984056d396bb240e30149c34fddda4514eb2a972537345
R
4,171
155
--- title: "9. ForestPlots" author: "AMCalejandro" date: "31/3/2022" output: html_document --- ```{r} library(forestplot) library(dplyr) library(tidyverse) # To load in memory the function to get the forestplots source("utils/utils.R") ``` # rs36082764 ```{r} SNP_cohort = tibble( mean = c(-0.66, -0.66, -0.26, ...
103db6325381b7b05e584fad3466a1f56c2b4bd8822cfa0394ae6e3b6fdea6a1
R
4,175
118
#' Benjamini-Hochberg FDR correction #' @param p P-values #' @return Adjusted p-values (q-values) #' @export bh=function(p) { q=p; q[!is.na(p)]=p.adjust(pmin(p[!is.na(p)],1),method="fdr"); q } bfc=function(p) min(p,na.rm=T)*sum(!is.na(p)) #' logistic (sigmoid) function #' @param g The log odds #' @return 1/(1+e^-g) ...
b8e580e97099c49c094269acca334d13c159f9afac57c092c57cb89fe029e9b5
R
4,205
146
########################################################################### ## The following function solves a linear or quadratic program (LP|QP). #' @name Rcplex2 #' @rdname internal #' @title Rcplex2 #' @description #' #' Modification of Rcplex which takes in mipcontrol parameters. #' #' #' @export Rcplex2 <- func...
3f6d89e6c58d551a55c8b3642fe707b6690c53e016e1a9fdd8c93298d206e5be
R
4,251
162
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(ArchR) library(viridis) library(scico) library(ggrepel) library(shades) library(ggrastr) library(ggbeeswarm) library(circlize) library(cowplot) set.seed(666) a...
6b824865fd6ce6a2bfa1d75e5d88ceab2160e92ca99ac30a38a46fea33661cf0
R
4,267
72
library(ArchR) library(ggplot2) library(gridExtra) library(Rtsne) library(clusterProfiler) setwd('output path') ###Figure3e#### proj = readRDS('Save-ArchR-Project.rds') cellColData=as.data.frame(proj@cellColData) cellColData[,1][cellColData[,1] == 'adult_hindbrain_PL2011260025'] = 'Rho-1' cellColData[,1...
c2bf80a16b7ebb8e6d22c96593e24dee203a1f8f0a7f27bd4bffa1a06bd88e69
R
4,270
131
library(igraph) library(Matrix) library(IRanges) library(ggplot2) # read OBO format and return an igraph with all "is_a" relations read.obo <- function(obo.file) { pat <- "^([^:]+) *: *(.*)$" obo <- readLines(obo.file) obo <- obo[grepl("^\\[",obo) | grepl(pat,obo)] obo <- DataFrame( section = cumsum(grep...
a8263a4891af5bcaccde14df9f681be034e7f802c152e01887f8c70a2d7d5db0
R
4,289
111
library(dplyr) library(lme4) library(lmerTest) library(sjPlot) library(ggplot2) #read data, transform and recode variables dat <- read.delim("Data_Eyesize.txt") dat <- dat %>% mutate_at(vars(fishid,line,rep), factor)%>% mutate(line = recode(line, sc = 'Control', ss = 'Selection')) #calculate eye size in relation...
5a0cd38f4ce145ac3e5a36b357add23c9bcb35e80c4a58313859d455830cbc27
R
4,379
108
plot_baseline <- function(df, slice_summary, group_summary, yresult, ylabel, slice_colors, plotType, scaleYtype, hide_xlabels = FALSE, plot_y_min, plot_y_max, forceYticks = NULL, ...
32b4c2f8f46995af58638ddb7b8996e896fe2864263fcc5c2d3110c94274da0c
R
4,400
163
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(ggpubr) library(ggbeeswarm) # read in data df <- read_tsv("./MCX_ALS_vs_Control_JessWesternBlot_protein_quantification_batch_May2023.txt") %>% mutate(diagnos...
59179a90e95a09b3cd5deb32ca59a989c53eda3b0a9ea121022b10618602b207
R
4,409
196
getLMM_model <- function(df, formula){ mod <- lmer( formula , df ) return(mod) } getLMM_ANOVA <- function(mod, asDF = TRUE){ ANOVA <- anova(mod) if(asDF){ ANOVA <- ANOVA %>% as.data.frame() %>% rownames_to_column("effect") } return(ANOVA) } printLMM_summary <- function(mod){ pr...
73a0e83534714114a49694fbeab860f38824f370831ab2bf912b72a5ecdbeb29
R
4,425
95
#' @title Deviance Residual Transformation on Gene Count Matrix #' @description Performs deviance residual transformation (proposed in Townes et al., 2019) #' and converts given raw gene count matrix into a continuous matrix with quantities #' analogous to z-scores and approximately follow a normal distribution. #' @pa...
d060b429651e96d38f2fee2634aea4a3753d5b5f2fa9fcda904e766b461f233f
R
4,482
149
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(ArchR) library(Seurat) library(BSgenome.Hsapiens.UCSC.hg38) set.seed(666) addArchRThreads(threads = 16) addArchRGenome("hg38") proj <- loadArchRProject(path ...
e8518b024cc211643e9cda7bb4e03cb78b612e8e8dd8490639749a19337625d1
R
4,499
105
# edited from geom_errorbar # https://github.com/tidyverse/ggplot2/blob/main/R/geom-errorbar.R # https://stackoverflow.com/questions/27585776/error-bars-for-barplot-only-in-one-direction #' @export #' @rdname geom_linerange geom_meanbar <- function(mapping = NULL, data = NULL, stat = "identit...