sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c4bd6ba7354b935391c22a582071593aa338455e40c50c09fb51f96065f5bd3a
R
937
18
#' @import GenomicRanges #' @import gUtils #' @import rtracklayer #' @import GenomeInfoDb #' @importFrom GenomeInfoDb seqlengths #' @importFrom data.table data.table fread rbindlist set setkey setkeyv setnames transpose as.data.table #' @importFrom stats cor loess predict quantile #' @importFrom skidb read_gencode #' @...
732603fda4b292ff2ef03deceffa2cf11977871d05df7b720e7fab20b9259f39
R
942
34
### SHELL> mpiexec -np 4 Rscript mpi_fclust3d.r library(MixfMRI, quietly = TRUE) library(EMCluster, quietly = TRUE) library(pbdMPI, quietly = TRUE) init() .FC.CT$MPI.gbd <- TRUE # .FC.CT$algorithm <- "em" # .FC.CT$model.X <- "V" # .FC.CT$ignore.X <- TRUE #.FC.CT$CONTROL$debug <- 5 set.seed(1234) ### Test toy1. X.gbd ...
6d264b693dabada3e17777ed9256875d8e5539035f84430bf24bafbc61642521
R
945
38
# 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_latest_atac_anno_...
9925954499a54b04addffc4fbb9dc7819f46bd315d29cd1f40efa9942c50fcae
R
952
31
### This file contains functions for decomposition of SIGMA of MVN. ### These will be majorly used in m.step() to update PARAM$U and PARAM$U.check. decompsigma.I <- function(full, sigma.ill = .FC.CT$CONTROL$sigma.ill){ DS <- sqrt(full) DS.check <- TRUE if(min(DS) / max(DS) < sigma.ill){ .MixfMRIEnv$cat("Chec...
70a770d48d2c4bcc2f93315bdb3d77dc7725c8eaf5375a5d2db2a58802dc8f68
R
957
20
library(ggplot2) list<-read.csv("Fig2g_DEG_EpiGene_inf.txt",sep="\t",header = F) l<-as.character(list$V1) f<-read.table("Fig2g_DEG_EpiGene_FC_and_FDR.txt",header = T) mid<-0 ggplot(f,aes(x=Region, y=Gene, size = -log10(FDR), col =logFC ))+ geom_point(alpha=1) + scale_color_gradient2(midpoint=mid, low="navy", mid="...
2a43f5e8c975d33c2d339408de94a69cf6bdb41233f4ccfb9df7e7d2942053e4
R
977
42
## ## Garcia (CSDA, 2010) ## ## gcv.score <- function(s, Lambda, DCT2y, N) { Gamma <- 1/(1 + s * Lambda^2) RSS <- sum((DCT2y * (Gamma - 1))^2) TrH <- sum(Gamma); GCVs <- RSS / prod(N) / (1 - TrH/prod(N))^2 ## print(c(s,GCVs)) GCVs } gcv.smooth2d <- function(y, interval) { if (is.nul...
9672e1e9a75ec2a5be63be14c4904ca2a1b22b79d54aa919f6dff63e60536b70
R
983
24
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) data_obj <- readRDS("./seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRoundAnnotated_cleanV2_SeuratV4_object.rds") filtere...
5e63750b70ef8578202d20f7849e64965aaca9e701e4473356b7f734fc6c294f
R
985
31
### Get the parameters parser = argparse::ArgumentParser(description="Script to Cluster scATAC data by ArchR") parser$add_argument('-I','--input', help='input arrow directory') parser$add_argument('-D','--id', help='tissue ID') parser$add_argument('-O','--out', help='out directory') args = parser$parse_args() library(...
0abecfe1181ecc658b319f2ff6ed806b391f24f4e27cca2c3d967e15d8702ed2
R
990
29
#!/bin/Rscript library(ggplot2) library(data.table) # Efficient multiprocessor data reading/writing/processing library(echolocatoR) # To fo the finemapping library(tidyverse) # For data wrangling / munging # Load some functions to make the plotting a bit easier -> https://github.com/AMCalejandro/echor_wrapperPipes s...
eb923dbf3051c528c47a16a57b6dce2834e5294234ef4591d53dd166ef5abbc4
R
1,004
38
library(dplyr) library(tibble) library(readr) library(tidyr) library(broom) library(ggplot2) library(gridExtra) library(sjPlot) library(FSA) setwd('/Users/mromano/research/mri-surv-dev/mri_surv/') ########################################## ########Now by lobe tb2 <- read_csv('./metadata/data_processed/shap_with_parce...
47ac29648f51cea2d6e4c1d434e3acb8f19bb4e6fbcb6d694c312f79461e4393
R
1,022
33
library(MixfMRI, quietly = TRUE) library(MASS, quietly = TRUE) .FC.CT$model.X <- "I" .FC.CT$CONTROL$debug <- 0 K <- 3 ### Fit toy1. set.seed(1234) X.gbd <- toy1$X.gbd X.range <- apply(X.gbd, 2, range) X.gbd <- t((t(X.gbd) - X.range[1,]) / (X.range[2,] - X.range[1,])) PV.gbd <- toy1$PV.gbd fcobj <- fclust(X.gbd, PV.gbd...
755a8d152b088619ac73f460b7030f3e033c50408b3b991d65de28afa47537c0
R
1,044
43
W.plus.y <- function(W, y, nrow, ncol){ if(!is.double(W)){ stop("W should be in double.") } if(!is.double(y)){ stop("y should be in double.") } ret <- .Call("W_plus_y", W, y, as.integer(nrow), as.integer(ncol), PACKAGE = "MixfMRI") dim(ret) <- c(nrow, ncol) ret } # End of W.plus.y(...
79be53db07ada21efab83e2a27cd4404cb991743cddb5bc8c05fba1abb7fd5e0
R
1,081
38
#------------------ # Folial allometry # 25 January 2023 #------------------ source("./common.R") # bivariate scatterplots # <<Figure 11a>> # width versus length/area my_plot_allometry( df$Log10Area.cb, df$Log10WidthMedian, df$English_name, 0, expression("Cerebellar section area (log"[10] * "mm"^2 * ")"), ex...
4778b6d4fadefee5382bd0f1456c1cc9afd1ba35bbb3b532ef7ba08b8edc09e9
R
1,089
24
# 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 data with 1st round annotations data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBneder_corrected_pos...
a4590a162bea16aa09c9e76b0e3196c004faa0181038328cf5212df225b35dea
R
1,090
25
# 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) data_obj <- readRDS("./seurat_objects/snRNA_cellBneder_corrected_postQC_scTransformed_clustered_2ndRo...
c1af544157071c4dc859fc3006f0fee1ee14a67190466345c76ad5bb221db5af
R
1,097
30
# read names of individuals indv.tab <- read.table("example_data/H3K27ac/samples.txt", header=F) # build matrix of read counts for all target regions # and individuals. Number of rows is same as number # of rows in CHT input files. One column per individual read.count.matrix <- NULL for(i in 1:nrow(indv.tab)) { in...
8b9840a89cc75e9d33b7f610610904b82c7859f1ce187cc2c4c3b00c8e52c0e2
R
1,100
38
### SHELL> mpiexec -np 2 Rscript mpi_toy_test.r library(MixfMRI, quietly = TRUE) library(EMCluster, quietly = TRUE) library(pbdMPI, quietly = TRUE) init() .FC.CT$MPI.gbd <- TRUE # .FC.CT$algorithm <- "em" # .FC.CT$model.X <- "V" # .FC.CT$ignore.X <- TRUE ### Test toy1. set.seed(1234) X.gbd <- toy1$X.gbd X.range <- ap...
a2df7b11cd090ea36faab2fa02e506d777cec07320a47e386bd733d25b9f6706
R
1,108
40
### This file contains functions for log densities of beta and normal. ### These will majorly update .MixfMRIEnv$W.gbd. logbetanorm.I <- function(PARAM, i.k){ # log of beta density. ret <- dbeta(.MixfMRIEnv$PV.gbd, PARAM$BETA[[i.k]][1], PARAM$BETA[[i.k]][2], log = TRUE) # log of normal density. ...
de05f3c8ddb760472614d4e53e3bc53f70a9f8e8f6ff6e3dcc8d07bdab73f038
R
1,123
46
#### q-value bh.fdr <- function(p){ # This function computes q-values using Benjamini and Hochberg's (1995) # approach for controlling FDR. # Author: Dan Nettleton m <- length(p) # k <- 1:m ord <- order(p) p[ord] <- (p[ord] * m) / (1:m) qval <- p for(i in (m - 1):1) { qval[ord[i]] <- min(c(qval[or...
53a8489e3c932b5affd27333834946b617fb5ef7bf9bb32af94cda2f53e65d11
R
1,138
38
#------------------- # Folding allometry # 25 January 2023 #------------------- source("./common.R") # bivariate scatterplots # <<Figure 10a>> # Cb area versus length my_plot_allometry( df$Log10Area.cb, df$Log10Length.cb, df$English_name, 0.5, expression("Cerebellum section area (log"[10] * "mm"^2 * ")"), ex...
dcaab5adf9fe1d3b68cc382c081b3adc47d06198c3674138f8cae4fc75067223
R
1,139
42
#!/usr/bin/env Rscript library(optparse) option_list = list( make_option(c("-i", "--input"), type = "character", default = "qcreport.txt", help = "Input file containing paths to germline "), make_option(c("-o", "--output"), type = "character", default = "qcreport.pdf", help = "Output panel of normals file"...
775a4c435d30f620167fa2f3bd567ddc3745db65251d526983c88fd51fce6733
R
1,146
21
library(tidyverse) df <- read_tsv("snATAC_peaks_overlaps_with_ChIPseq_consensus_peaks.txt") %>% mutate(num_non_overlaps = num_snATAC_merged_peaks - num_overlaps_with_ChIPseq_consensus_peaks) %>% select(-num_snATAC_merged_peaks) %>% pivot_longer(-cell_type, names_to = "group", values_to = "count") p <- df %>% ggplo...
3b8576c60a6fb3c7e74af37b6ba7ef1a696e50834efc1892aa0ab15391863183
R
1,147
42
# Creates some toy test data # note that for openvibe .csv you need to manually add the freq value as the last item of the two first lines. # its not done by this script. nExamples<-30; nDim<-50; # Gaussian data a<-matrix(data=rnorm(nExamples*nDim),nrow=nExamples); b<-matrix(data=rnorm(nExamples*nDim),nrow=nExample...
004a974bc4023f33545b9166188372805304a20427f9ff32ab4b22dcbd9d3808
R
1,152
41
plotfclustpv <- function(da, posterior, main = NULL, xlim = NULL, ylim = NULL){ ### Force the col.image here. col.image <- c("#000000", "#F9070E", "#0063FF", "#01B901", "#C000C5", "#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#AF0000", "#009600", "#0000FF", "#FF4500...
fb7a2c5e357d35fa9dd1722755453892aea082fd46f92329bbcb4f63224fa52b
R
1,166
41
#!/usr/bin/env Rscript library(shiny, quietly = TRUE) library(dplyr, quietly = TRUE) library(ggplot2, quietly = TRUE) library(DT, quietly = TRUE) library(leafcutter,quietly = TRUE) library(reshape2, quietly = TRUE) library(gridExtra, quietly = TRUE) library(intervals, quietly = TRUE) # needed for pretty strand arrow pl...
d99db8c75a6e9307d68f5cb31150d7c6de8e3d3baeeb485d29b3cb68cb57d6fb
R
1,176
29
library(Seurat) ############################################################### #-------------------------regions-----------------------------# ############################################################### setwd('input path') obj = readRDS('Adult.rds') obj$Region = unlist(lapply(strsplit(as.character(obj$Sample),"_")...
2461576abe8167b9f2df894a2ec0b7d912454e7ca400b68817b8c858c558c3eb
R
1,181
41
### Loading Data Sets----------------------------------------------------------------------------------------- #' Load an excel sheet as a dataframe #' #' Uses the openxlsx package function read.xlsx to read the excel sheet #' The first row is used as column names. These should not have spaces #' NA cells in excel sho...
2e0383a4128d82ab45e60165b89cdd75b632f976a5a1a36333ec493d20196b48
R
1,184
42
plotfclust <- function(da, posterior, main = NULL, xlim = NULL, ylim = NULL){ ### Force the col.image here. col.image <- c("#000000", "#F9070E", "#0063FF", "#01B901", "#C000C5", "#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#AF0000", "#009600", "#0000FF", "#FF4500",...
1d89bfbf5a24dfc81310bb99624b855e79115d1010085e2c12bc8cde67d56b1e
R
1,202
23
data<-read.table("S-Fig2b_DEG_shared_3tissue_logFC_FDR.txt") f<-c() da1<-data[,c(1,2,6)];colnames(da1)<-c("Gene","LogFC","FDR");da1$Region<-"CA" da2<-data[,c(1,3,7)];colnames(da2)<-c("Gene","LogFC","FDR");da2$Region<-"DG" da3<-data[,c(1,4,8)];colnames(da3)<-c("Gene","LogFC","FDR");da3$Region<-"NAc" da4<-data[,c(1,5,9)]...
43603c15e007b58b2052f10a54ad7fc5072216b8ae0cfc01ae9d97e51c1fc0fe
R
1,203
31
#box plot expression of Ptprn2 gene data<-read.table("Fig3f_gene_Ptprn2_expression.txt",header = T) par(las=1) a<-boxplot(data,ylim=c(250,500),main="Ptprn2", at=c(1,2,4,5),axes=F,col=c("darkgreen","purple")) axis(2) axis(1,at=c(1.5,4.5),labels = c("DG","CA")) legend(0.5,500,"METH",bty="n",pch=15,col="purple"...
606fe6a94163fe1e8ffeb0a0a215b1dca014636c75f1985974722c1f0c483f30
R
1,203
57
library(pbdMPI, quietly = TRUE) init(set.seed = FALSE) library(MixfMRI, quietly = TRUE) source("00-set_condition.r") .FC.CT$MPI.gbd <- TRUE ### Test 2d data. da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) # ret.PARA...
c297617ab4fac3f6da6a4c47d8f19338b265807588886010d7d9ff3e1fa43a17
R
1,204
57
library(pbdMPI, quietly = TRUE) init(set.seed = FALSE) library(MixfMRI, quietly = TRUE) source("00-set_condition.r") .FC.CT$MPI.gbd <- TRUE ### Test 3d data. da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) # ret.PARA...
bb4494b0f3a142bfc4b9baf9495c526870ebd0188010901394d10818e3ed7e55
R
1,242
33
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(sctransform) ## read the seurat object subset by major cell types in 1st round annotations clusters <- c("Exc", "Inh", "NonNeu") run_sctransfo...
adc72c63884d690b4855333fff4ca207d929bfac3816d479e16835cbb1428658
R
1,244
42
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # # Script performing Gene Set Enrichment Analyses from GO gene sets and HGNC gene sets # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# source("src/julien/lib/go_hgnc_lib.R") go <- function(universe,genelist) { ...
c3f0dde81d94c2de7a1e0b774eb3ac6878cb21f0570e3eb601500b290e1a3503
R
1,244
41
### SHELL> cd ../; Rscript simu_2d/create_rep.r seed <- 1234 for(i.rep in 1:25){ # mkdir rep cmd <- paste("cp -R simu_2d/ ", "simu_2d_", sprintf("%02d", i.rep), sep = "") system(cmd) # change seed cmd <- paste("cd simu_2d_", sprintf("%02d", i.rep), "/; ", "sed -...
8806b7ecf82902d60786156c6ced0f638c15e3e825d4f0f5aa7e301d3d7190d3
R
1,258
30
#' gGnome: An R API to manipulate genome graphs #' #' @importFrom parallel mclapply #' @importFrom reshape2 melt #' @importFrom VariantAnnotation readVcf info geno #' @importFrom RCurl url.exists #' @importFrom S4Vectors cbind.DataFrame #' @importMethodsFrom S4Vectors do.call elementNROWS Rle mcols mcols<- values valu...
d2a18576e56f2189f7eb97fa2eb88a11d3baec6c2d76727d8eab4afc7d3038d3
R
1,258
41
### SHELL> cd ../; Rscript simu_2d/create_rep.r seed <- 1234 for(i.rep in 1:25){ # mkdir rep cmd <- paste("cp -R simu_2d/ ", "simu_2d_", sprintf("%02d", i.rep), sep = "") system(cmd) # change seed cmd <- paste("cd simu_2d_", sprintf("%02d", i.rep), "/; ", "sed -...
8b255c62d3bbeda2782f7d50fe6e55bc2fd1e4642fd0fba6c484037311a27937
R
1,263
27
library(MixfMRI, quietly = TRUE) cbPalette <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7") myPalette <- cbPalette[c(6, 7, 2, 8, 3, 5, 4, 1)] par(mar = rep(0.1,4), mfrow = c(2, 2)) image(-shepp0fMRI, axes = FALSE, col = c(myPalette[2:1], rgb(red = 230 ...
fe8b82abed596bbce6a9ac18809478c0adc29c6225c2fd2a302b80c17d385ee4
R
1,265
37
library(MixfMRI, quietly = TRUE) library(EMCluster, quietly = TRUE) .FC.CT$model.X <- "I" .FC.CT$CONTROL$debug <- 0 K <- 3 ### Fit toy1. set.seed(1234) X.gbd <- toy1$X.gbd X.range <- apply(X.gbd, 2, range) X.gbd <- t((t(X.gbd) - X.range[1,]) / (X.range[2,] - X.range[1,])) PV.gbd <- toy1$PV.gbd fcobj <- fclust(X.gbd, P...
b2e83525f0c104162ae438119278ba10c288ade81aa2f6c2772a10712b962a72
R
1,277
32
parser = argparse::ArgumentParser(description="Script to Cluster scATAC data by ArchR") parser$add_argument('-I','--inputpath', help='input arrow directory') parser$add_argument('-D','--id', help='tissue ID') parser$add_argument('-O','--out', help='out directory') args = parser$parse_args() library(ArchR) library(BSge...
8370c4f08184973d79d559ad19915cd6a50fee64b9c81b8457fbef6e9bd4c664
R
1,284
45
library(MixfMRI, quietly = TRUE) set.seed(1234) phantom <- shepp2fMRI ### Generate 2d data. da <- gendataset(phantom = phantom, overlap = 0.01)$pval id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Test 2d data. i.k <- 4 set.seed(1234 + i.k) fcobj <- fclust(X.g...
6796af5e073a96568c6f3695da5e4ac694b777c99da5f36796cf6b13780075a6
R
1,287
41
### Controls .FC.CT <- list( algorithm = c("apecma", "em", "ecm"), optim.method = c("BFGS", "Nelder-Mead"), model.X = c("I", "V"), # independent or unstructure. ignore.X = FALSE, # if using location information. check.X.unit = TRUE, # if checking X in [0, 1]. CONTROL = list( m...
fbfdaf7dd63ec057191551aba94da8639a378d0eb8daf31eedb44663c513de0f
R
1,292
38
#!/usr/bin/env Rscript library(optparse) suppressMessages(suppressWarnings(require(VariantAnnotation, quietly=TRUE))) option_list = list( make_option(c("-i", "--input"), type = "character", default = NULL, help = "Input bps.txt.gz file"), make_option(c("-o", "--output"), type = "character", default = "graph...
49af3309b87e482b8e8137a49641a95c56400f3ce8f91c8e23117e6bad54df0e
R
1,330
29
# Generated by rstantools. Do not edit by hand. # names of stan models stanmodels <- c("bb_glm_fix_conc", "bb_glm", "dm_glm_multi_conc", "dm_glm_robust", "dm_glm") # load each stan module Rcpp::loadModule("stan_fit4bb_glm_fix_conc_mod", what = TRUE) Rcpp::loadModule("stan_fit4bb_glm_mod", what = TRUE) Rcpp::loadModu...
fb29f41c1c0ab500f7a0deeca6769fb717b88fced439930b6f10b1ddb3240cf9
R
1,331
43
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(sctransform) ## read seurat object of QC-filtered cells data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBender_corrected_QC_filteredCells_S...
2489b80d4c2070998ff6fe42681a6a2c56418ddbc59931fea8ee761bd1fddd05
R
1,367
44
### This files provides functions for output. mb.print <- function(PARAM, CHECK){ ETA <- PARAM$ETA BETA <- matrix(do.call("c", PARAM$BETA), ncol = PARAM$K) if(PARAM$p.X > 0){ MU <- PARAM$MU # SIGMA <- matrix(do.call("c", # lapply(PARAM$SIGMA, # ...
9719879aecf5654272058d73bf4ce4f4acde34a77b8ea9d8bc79e4914b4a647d
R
1,374
34
# From Michael Roberts - 2021-10-27 # This file contains a function to generate a Linear Mixed Model (LMM) and p # value statistics of comparisons of each Fixed Effect to the Control. # # Input data format: Excel file with three columns # Column 1: Response values (e.g. spikes) # Column 2: Treatment condition ...
f83900c254f1ba80042f1e9a8f07b96a9c8595760fbe264af32ed1336b4ede14
R
1,379
29
d<-read.table("S-Fig5f_DG_Gene_expression.txt") par(las=1) boxplot(as.numeric(d["Sox5",5:8]),as.numeric(d["Sox5",9:12]), as.numeric(d["Sox11",5:8]),as.numeric(d["Sox11",9:12]), as.numeric(d["Sox18",5:8]),as.numeric(d["Sox18",9:12]), as.numeric(d["Sox8",5:8]),as.numeric(d["Sox8",9:12]), a...
c2b29d469c5a8fcb60e38d9d64442b14bfd1fa5599da7ee14dd90345d22fce3b
R
1,383
50
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "Dracheva_ALS_FTD_rmLowQualitySample...
c39e564bde00d9c77772756787c5c61cc0089eb6e9a1b14ff6750b71b9ce43b5
R
1,383
50
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "Dracheva_ALS_FTD_rmLowQualitySample...
66cd166d29d6f70d16ecbe2eaa12a669969db17797bb4d6d25a1221778016e91
R
1,384
38
library(gUtils) library(gTrack) library(testthat) ## read input jab = system.file('extdata', 'jabba.simple.rds', package="gGnome") jab.gg = gG(jabba = jab) ## use just a subgraph for faster walks sg = jab.gg$copy$subgraph(seed = GRanges(seqnames = "1", ranges = IRanges(start =...
b163cfe59adc9e50dd58d1eaf9dacec7d7dd05c3e9664186d07097eb1541dabe
R
1,386
39
# 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) ## read the sctransform-normalized seurat object data_obj_sub <- readRDS("./seurat_objects/snRNA_c...
63877fed38f8f14cbeeb2b3ed01353af6e2d075b1405501421907a9f9d452c40
R
1,391
56
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, echo = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) ``` [![Build Status](https://travis-ci.org/mskilab/fragCounter.svg?branch=master)](https://travis-ci.org/msk...
4d02fc88953ab8ba5bd6bc2ceba51d9f8f253f507aa50eb55e9a635a8d385ddc
R
1,400
37
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBender_corrected_noQCFilters_scTransformed_clustered_SeuratV4_object.rds") meta_data <- data_obj_s...
910995e390df044d64ea699b152bbb5dac7bad04bb439870f9d9f7a002d9155b
R
1,413
42
### Copy some functions from "AnalyzeFMRI/R/spatial.mixture.R" since ### "AnalyzeFMRI" is archived by CRAN. cluster.threshold <- function(x, nmat = NULL, level.thr = 0.5, size.thr) { ## thresholds an array at level.thr ## calculates the number of contiguous clusters and their sizes ## answer is an array ...
5cb5438d870e7f084ab956ca9b66132b67e9b83ea0b0664ac9531044caa4c91f
R
1,415
35
library(MixfMRI, quietly = TRUE) library(RColorBrewer, quietly = TRUE) ## ## 3 phantoms with proportion of activated voxels: ## shepp0fMRI: 0.917% ## shepp1fMRI: 2.249% ## shepp2fMRI: 3.968% ## ## plotting the phantom cbPalette <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "...
b06aa8b1ba9eed391a16378b8b8b3d248e5dd243bf0877df989fa08b27024925
R
1,442
46
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 2d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results fn.in <- paste("./output/ret.", case, ".tp.new.rda", sep = "") load(fn.i...
cfcfef9437704d04c90c8a0c44aead8f855092ba236ef5b3e87e374f5edbbd47
R
1,442
46
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 3d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results fn.in <- paste("./output/ret.", case, ".tp.new.rda", sep = "") load(fn.i...
8029994b72a95f6b23a3118dc9f97097a97cb85d04dd01310e7ee676a63e54a0
R
1,443
46
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 3d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results fn.in <- paste("./output/ret.", case, ".tp.new2.rda", sep = "") load(fn....
d01f623d1b5b034cffe27412d3a5e8eb0bd269f1247fae1eb2da4b4581baa7c0
R
1,443
46
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 2d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results fn.in <- paste("./output/ret.", case, ".tp.new2.rda", sep = "") load(fn....
4b5b3daf9be28e5b57e88642d53547385018d1defdef6c04a796f751c6ad43b9
R
1,465
82
getStillImgName = function( damID, DOB, PND, ZT, min, imgFolderPath = damImgsFolder ){ thisDateTime <- getZT_DateTime(DOB, PND, ZT) thisDate <- getZTDate(thisDateTime) thisTime <- getZTHour(thisDateTime) regEx <- paste0( # "^.*", # looks for the whole file path when matching, not ...
79d6424cb21db4e957568df0d2f1c741b4629d164ab34628c92f79284558e92a
R
1,465
44
#fig5d #Drd data<-read.table("Fig5d_boxplot_Gene_Drd_expression_inNAc.txt",header = T) par(las=1) a<-boxplot(data,at=c(1,2,4,5),axes=F,col=c("darkgreen","purple")) axis(2) axis(1,at=c(1.5,4.5),labels = c("Drd1","Drd2")) legend(3,320,"METH",bty="n",pch=15,col="purple",xjust=0,cex=1) legend(3,300,"Sal",bty="n",pch=15,col...
8469c9aa3a209ea24bf61f76f04327a74c1c39a912647fd483eeec54651d4f37
R
1,468
40
# 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) ## read the sctransform-normalized seurat object data_obj_sub <- readRDS("./seurat_objects/snRNA_c...
c0c5e3a99af98b0af80345ec98002718c87981b1222b118f68cd07d8e2cf23ee
R
1,468
40
# 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) ## read the sctransform-normalized seurat object data_obj_sub <- readRDS("./seurat_objects/snRNA_c...
ff408b04eae71d2c72c3433f69a9a6aaee1095ccfa1640a82a32a1297f2e21cc
R
1,469
53
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "./Dracheva_ALS_FTD_addRNA_Glia_subs...
1b55f7aad573b7f66c148483874c724712b0740fb0f793649854e134e730cdaa
R
1,474
53
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "./Dracheva_ALS_FTD_addRNA_Neu_Inh_s...
8141755c514bb711a0df8f5c163091266d3635700b47f5c5275409fd293bb60d
R
1,474
53
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "./Dracheva_ALS_FTD_addRNA_Neu_Exc_s...
b7d694aef7e8d045d4662cab11860f839412e37f9f0b70fb4164820893c6838b
R
1,475
51
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 2d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results ret <- NULL ret.PARAM <- NULL for(i.k in K.min:K.max){ ret.PARAM[[i.k]...
4c9875f1af683a6c69b23aacfcff3fc437e3a5acca87440658d1004e67c5d862
R
1,476
40
# 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) ## read the sctransform-normalized seurat object data_obj_sub <- readRDS("./seurat_objects/snRNA_c...
618fef41bd63eb714064b9166c8092ac67be9ea03c85df71f3e2474a92da60f6
R
1,476
49
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 3d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results ret <- NULL ret.PARAM <- NULL for(i.k in K.min:K.max){ fn.in <- paste(...
d23e68e99b8f01460103e85eb018feff6e87b012b6de20fbcd9030718fb81a23
R
1,476
52
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 3d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results ret <- NULL ret.PARAM <- NULL for(i.k in K.min:K.max){ ret.PARAM[[i.k]...
232a032dbb2d67d26895dd3b0fca933691408c1b0a4425f3ab40e9f0e8c9b78d
R
1,480
49
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 3d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results ret <- NULL ret.PARAM <- NULL for(i.k in K.min:K.max){ fn.in <- paste(...
7847832a7073d885a58565cc5fe867af4fc8cb114b58cfeb18b702f976e18b2c
R
1,504
53
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "./Dracheva_ALS_FTD_addRNA_Glia_subs...
17556add88a0afc81338c4a94636903859c558a959bb2cd9636de85e9f2649a7
R
1,509
53
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "./Dracheva_ALS_FTD_addRNA_Neu_Exc_s...
a5c4a63823927f6debf3b8949899bd4bad4c6bb861d7337e1f195c0d4af5f6ca
R
1,509
53
# 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 = 1) addArchRGenome("hg38") proj <- loadArchRProject(path = "./Dracheva_ALS_FTD_addRNA_Neu_Inh_s...
a57ce037fd9754343a52249d7e65886fd8f57efe902ff6e9db4835870faff10f
R
1,510
50
library(MixfMRI, quietly = TRUE) set.seed(1234) N <- 1000 K <- 3 p.X <- 3 eta <- c(0.60, 0.30, 0.10) beta <- matrix(c(1, 1, 0.5, 6, 0.8, 4), ncol = K) # 2 * K mu <- matrix(c(0, 0, 0, -2, -2, -2, 4, 4, 4), ncol = K) # p.X * K std <- matrix(c(1, 1, 1, 2, 1, 2, 1, 2, 1), ncol = K) # p.X * K ### For toy1...
461e2aee7f0492b6e4d5df3d0653dd36020237c267e7cb873d8ad7a15a5b4043
R
1,512
53
# logging which server was used to run this script system("echo \"Running this on ### $(hostname) ### \\(* w *)/\"") # load library library(tidyverse) library(Seurat) library(scales) library(scico) library(tictoc) library(shades) # read in annotated data # data_obj_sub <- readRDS("./seurat_objects/snRNA_cellBneder_co...
5d27879951e0fea8cb6d8267799c629bd22a3e322a4c71885cdb43963904af13
R
1,512
48
library(ggplot2) library(car) library(nlme) require(multcomp) #Read in data d <- read.csv('sholl_InputData.csv') #enter path of file #loess smoothening ggplot(d, aes(x=Radius, y=Intersections, group=condition, fill=condition)) + stat_smooth(col='black', method='loess') + ylab('# Intersections') + xlab ('Distanc...
a8a0efb7c2186a2e4a0c6109a7710b3c47a81cddbab21b5db5bf347746807954
R
1,514
66
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) ...
e1b7d80576f55cb9a0aa4772bd2e9c6aadd46d394ab48812adc483d566afd09f
R
1,522
47
#!usr/bin/Rscript .libPaths("/data/kronos/kronos/acarrasco/R_libs") library(data.table) library(dplyr) library(tidyverse) ChunkFileCreator <- function(nSamples, ChunkSize) { numberSamples = nSamples totalChunks = ceiling(numberSamples/ChunkSize) Skipnumber = 0 fileNumber = 1 ChunkSize = ChunkSize columnna...
3cb1677e5cf903eb812e5ea06a55c55cbf7e42be7bd92a6130afb2e89909a29e
R
1,542
45
#!usr/bin/Rscript # Loading libraries .libPaths("/data/kronos/kronos/acarrasco/R_libs") library(dplyr) library(data.table) library(tidyverse) # Loading the sample chunks of the genetic file print("loading sample chunks of the genetic data") partone <- readRDS("part1.rds") parttwo <- readRDS("part2.rds") partthree <- ...
491d7608d6d5b06b007bc51d41fa379b8fcfe1b20e9f42d49b2d272c703c5980
R
1,543
50
### This file gives initializations. # 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) initial.em.gbd <- function(PARAM){ if(PARAM$class.method == "prob.ex...
69a32c5d1db73388c7b0c5c81de768f486fbc4f05d3e7fa4f9e0b2d54917780e
R
1,544
58
library(data.table) options(scipen = 999) # Load hg38 chromosome sizes from UCSC chr_sizes <- fread("https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.chrom.sizes", col.names = c("chrom", "size")) chr_sizes <- chr_sizes[chrom %in% paste0("chr", c(1:22, "X"))] # Centromere positions (approximate from UCSC T...
b5b2c168029737e80a6a651f660d84d2ddc218eed03a59910db92a154e6fadb9
R
1,553
71
flexSave <- function( baseName, thisFilePrefix = filePrefix, plot = last_plot(), fileType = "pdf", # fileType = "png", filePath = plotOutputFolder, width = 7, height = 7, units = "in", compType = currentCompType, shinySettings = FALSE, ... ){ if(shinySettings){ thisFileName <- baseName ...
1bb87416a08a7619e93c530d90bf52f6ba498a260f0751681538837916711a6b
R
1,577
45
library(ggplot2) acell<-read.csv('st_cell2location_res.csv',header = T,check.names = F,row.names = 1) colnames(acell)<-gsub('q05cell_abundance_w_sf_','',colnames(acell)) x=0.1 # x=0.5 stat<-apply(acell,1,function(y){ sum(y>=x) }) table(stat>0) stat<-ifelse(stat<1,1,stat) stat1<-data.frame(num=c(...
82d3c447406a026dacac9fb76eb9413d9e9baa7476efb3bc1d6d1c6e61500fe5
R
1,587
57
#!/usr/bin/env Rscript suppressPackageStartupMessages({ library(data.table) library(ggplot2) library(ggrepel) }) # Parse arguments args <- commandArgs(trailingOnly = TRUE) if (length(args) < 2) { stop("Usage: ./runtime_plot.R input.tsv output.pdf") } input_file <- args[1] output_file <- args[2] # Read data...
261513f7d325a02ad2f6e4042a05a6c97db3b389cea90842e1061a999b90985e
R
1,597
47
library(Seurat) library(dplyr) library(cowplot) library(ArchR) library(ggplot2) library(viridis) parser = argparse::ArgumentParser(description="plot for marker genes") parser$add_argument('-I','--inputfile', help='input file') parser$add_argument('-D','--id', help='tissue id') parser$add_argument('-O','--outputfile', ...
7cd4c577f954a835ffef6930fc03c67e6fd321aedc3ebd154704aa7d3752c50e
R
1,597
48
# Checks if packages are installed, and if not installs them if(!require(fastmatch)) install.packages("fastmatch") if(!require(tidyverse)) install.packages("tidyverse") # if(!require(viridis)) install.packages("viridis") if(!require(Cairo)) install.packages("Cairo") if (!require(officer)) install.packages('officer') if...
92acc7f5a4fbf0d5ab7dbfc6142bef8ae7e2f4dbd1e492f82cfcde564a128e1d
R
1,605
44
library(tidyverse) library(ArchR) set.seed(666) addArchRThreads(threads = 20) addArchRGenome("hg38") # setup input files inputFiles <- list.files("./atac_fragments", pattern = ".gz$", full.names = TRUE) names(inputFiles) <- inputFiles %>% str_replace("_atac_fragments.tsv.gz", "") %>% str_replace("./atac_fragments/", ...
152e103cc07a929f70edfcdba81dcc60aceb0c94c6b00c65f00b8fcaf7a995da
R
1,607
47
#----------------------- # Correlation structure # 25 Jan 2023 #----------------------- source("./common.R") # load imputed data load("../data/derived/fit_OU.RData") dfOU <- imp_2$estimates rownames(dfOU) <- df$Binomial_name_timetree # fit OU Y <- as.matrix(dfOU[, c("Log10Area.cb", "Log10Length.cb", "Log10Thickn...
1cc7195cb76acf065badd4cb8c09a874e64c97b295b748fe659394277d50c8cc
R
1,622
60
# read output filename and list of input filenames containing # CHT results from command line args = commandArgs(trailingOnly=TRUE) if (length(args) < 2) { usage <- "Usage:\n RScript --vanilla OUTPUT.png CHT_OUTPUT_1.txt [... CHT_OUTPUT_N.txt]" stop(paste("At least two arguments must be supplied.\n", usage), cal...
8c40ebdcb2fa2aaaa04bb88b28f6481b89e76d76141bd3943da7504ee8bce639
R
1,623
47
library(tidyverse) DE <- read_tsv("../MAST_res_level2_summary.txt") FDR_threshold <- 0.05 FC_threshold <- 1.2 genes_in_GO <- read_tsv("Astr.actin.overlap_genes.txt", col_names = "gene") # genes_in_GO <- read_tsv("Astr.potassium_ion_transport.overlap_genes.txt", col_names = "gene") DE_sub <- DE %>% filter(cond_1 =...
111dee17197ba79d32421e4cae26c1b41b73bfdd440459f80f6298e1840686fc
R
1,627
53
#!/bin/Rscript args<-commandArgs(trailingOnly=TRUE) library.path <- .libPaths() library("tidyverse", lib.loc = library.path) #Read in sample heterozygosity table sample_het <- read.table(args[1], header = TRUE) #Read in sample call rate table sample_callrate <- read.table(args[2], header = TRUE) #Calculate proporti...
90b795496b98faedaece1ed62f178f45e21c3ae1b553b0d658ba93d9f2efa6c7
R
1,629
71
# time series step = 7 #in weeks year = 365 num_year = 15 t = seq(0, year*num_year , by = step) # parameters #average infection rate beta0 = 0.09 #amplitude of sinosuoidal wave beta1_set = 0.25 #controls sinosuoidal infection phase omega = (2*pi)/365 #recovery rate gamma = 0.075 #rate of return to susc...
40b49fd7cce8ccd6d5a38afbffd9609f906dc62443c5698e7d2442e263e25a6e
R
1,633
55
library(MixfMRI, quietly = TRUE) source("00-set_condition.r") ### Test 3d data da <- eval(parse(text = paste(case, sep = ""))) id <- !is.na(da) PV.gbd <- da[id] id.loc <- which(id, arr.ind = TRUE) X.gbd <- t(t(id.loc) / dim(da)) ### Load results fn.in <- paste("./output/ret.", case, ".tp.rda", sep = "") load(fn.in) ...
cb0bb037c4ab972d81d7e76c0f5d607ecaaca677a50a5ffdc4840f4dfbb6763b
R
1,638
55
getZT_DateTime <- function ( DOB, PND = 5, # for start of lights on cycle; so the early AM during lights out will be subsequent day ZT = 9, # 0-23; 0 is lights on, either 3a or 4a depending on DST PND_byZT0 = TRUE # Just add the ZT time from the time of lights on on the indicated PND # so ZT23, for example, w...
f45b4b39c416fb6b70a47dcc594993ede3c2bea7287329863f9b3a762b2893db
R
1,642
51
# 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_latest_atac_anno_...
f7740085ad335a351132a68b524277460744eceb11aabcbf8d2e1eab7b1597be
R
1,649
27
#' JaBbA: Junction Balance Analysis #' #' @importFrom gUtils streduce si2gr seg2gr rrbind ra.overlaps ra.duplicated parse.gr hg_seqlengths grl.unlist grl.pivot grl.in grl.eval grl.bind grbind gr2dt gr.val gr.tile.map gr.tile #' @importFrom gUtils gr.stripstrand gr.sum gr.string gr.start gr.end gr.simplify gr.setdiff g...
25fddbfa760e6e0b66c32c187c52dce3e881f4d74706e085d61b3e848f5b5c01
R
1,651
57
### Perform H0: alpha = 1 & beta = 1 v.s. Ha: alpha < 1 & beta > 1. lrt <- function(PV.gbd, CLASS.gbd, K, H0.alpha = .FC.CT$LRT$H0.alpha, H0.beta = .FC.CT$LRT$H0.beta){ if((H0.alpha <= 0) || (H0.alpha > H0.beta)){ stop("It should be 0 < H0.alpha <= H0.beta.") } K.CLASS <- as.integer(max.gbd(CLASS.gbd)) ...
df7445ba4188f5f02ed8b17e21cb7549106ac8c47b9ad3a77b75feb526868a46
R
1,684
50
#!/usr/bin/env Rscript suppressMessages(suppressWarnings(require(optparse, quietly=TRUE))) option_list = list( make_option(c("-i", "--input"), type = "character", default = NULL, help = "Input bps.txt.gz file"), make_option(c("-o", "--output"), type = "character", default = "vars.lite.maf", help = "Output ...