sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ce3ee8c121cf6bcd0d2b92f21aca5fe7a6b4f0bb5ac22dc4470b92656c7b2809
R
1,722
65
context("ng_colours") test_that("ng_colour works", { expect_equal(ng_colour("night"), "#323D5A") expect_equal(ng_colour("giraffe"), NA_character_) expect_equal(ng_colour(), ng_colour_list) }) test_that("ng_palette works", { expect_is(ng_palette_d(), "function") expect_is(ng_palette_c(), "function") expect...
01612e66996ae45144870460b447c1407f55aa03c03976e69cb2bf41eb5a17ec
R
1,726
74
/home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(ggplot2) library(patchwork) set.seed(1234) library(Signac) library(GenomicRanges) pbmc=readRDS('/home/disk/database/data/scHIC/GSE130711_analysis/scATAC_pbmc.rds') pbmc$type[which(pbmc$seurat...
6f1d4e0c69375169ac5aa11aa870149130241895ea050f8a186a5a096484b32a
R
1,746
40
#' Gene expression data distribution plot #' #' This function plots the expression data distributions of the two single cell datasets (e.g. query and reference) to be compared. #' #' @param sce.E1,sce.E2 Data objects, namely E1 and E2. #' @param name.E1,name.E2 Customized names for E1 and E2. Default: \code{"E1"} and ...
bcfe8554e9aa85c0e52a1063cae57cd1600011a202006052ac5aafb3402d9697
R
1,757
40
## Norms the data within specified groups in a data frame; it normalizes each ## subject (identified by idvar) so that they have the same mean, within each group ## specified by betweenvars. ## data: a data frame. ## idvar: the name of a column that identifies each subject (or matched subjects) ## measurevar: the...
e5b05729e03e8d0dc2e62f523cce0ad6d7a11513ae73eed15c863595ee877183
R
1,757
82
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) #library(EnsDb.Hsapiens.v86) #hg38 library(EnsDb.Mmusculus.v79) library(ggplot2) library(patchwork) set.seed(1234) #############################################################i library(monocle) library(cicero) pbmc=readRDS(...
1c6bf32c3bc149496a85db4268f5c0702ea48786c61cbc64b875fdcf086a3f26
R
1,760
38
#' @title #' CBDA Spectrum plot function for Compressive Big Data Analytics #' #' @description #' This CBDA function generates histograms of the feature counts/densities as returned #' by the Accuracy and MSE metrics after the Learning/Training step. #' #' @param top Top ranked predictive models from the Learn...
b0dcead2df3a2b534fadd40c7b1d69ea347025e5750390d21d23b4f2752c09e2
R
1,776
36
#' Prediction function for FR-Match results #' #' This function takes in the \code{\link[FRmatch]{FRmatch}} output and predicts the most similar reference cluster for each query cluster. #' #' @param rst.FRmatch The \code{\link[FRmatch]{FRmatch}} output. #' @param p.adj.method P-value adjustment method for multiple hy...
3cfde57a96121061b8e9b2b8a41eb5bca5eca486e02e6facafc842a6b47c987d
R
1,784
74
library(Seurat) library(hdf5r) library(tidyverse) library(qs) library(future) library(furrr) # Directory setup --------------------------------------------------------- birds = c( "pu37bk12", "wh32br40", "bk27bk53", "or74pu64", "bu21wh41", "bu22wh42", "pk90gr56", "pk87gr53", "or37pu44", "or38pu...
6a4bd1541b941ab4da26e00550f6a6f9c608fd9b0610e98b0df8abd08de4e694
R
1,795
48
# This script takes the fsaverage space noddi surfaces for each participant, # extracts LH and RH V1 according to the Benson retinotopic atlas, and collates # ficvf and odi measures together. It also filters out diffusivity values, # keeping 1.1e-9, and averages ficvf and odi values across dir98 and dir99 # scans. The ...
7c7c228dc6d86c605fc8863869bc1a214287fe04c0ff8ccadea1ed5ae91cdc32
R
1,801
45
#!/usr/bin/env Rscript # libraries suppressPackageStartupMessages(library("argparse")) suppressPackageStartupMessages(library("data.table")) # create parser object parser <- ArgumentParser() # specifying options parser$add_argument("tableX", nargs=1, help="First table to join on (tab-delim with header)") parser$add_...
74507e051350cb5f7f66270d694a7d9a1946d885e1722cafe7958a74d80cea59
R
1,811
55
#!/usr/bin/env Rscript library(getopt) options(digits=3) Args <- commandArgs() self<-Args[4] self<-substring(self,8,nchar(as.character(self))) spec = c( 'mask' , 'm', "0", "character" ," name of brain mask image ", 'input' , 'i', "1", "character"," the input prefix ", 'dim' , 'd', "3", "character"," the i...
dda3b211718c8d7ed60736b8597213c0318ea7964be5a60ae63b9506a6bb545f
R
1,813
74
#!/usr/bin/Rscript library(caret) library(ROCR) library(xgboost) library(doMC) registerDoMC(48) args <- commandArgs(trailingOnly=TRUE) # datasets positive <- rownames(read.csv("./data/Dang.tsv", sep="\t", head=TRUE, row.names=1)) negative <- as.character(read.csv("./data/1kg_LoFT.tsv", head=FALSE)$...
eba0def9c92bdb544e3924d553bd522a25a89d6ed16ad5e2ad937bb06b6e0630
R
1,818
77
--- title: "SiT - Supplementary Figure 02" author: '[Kevin Lebrigand](mailto:lebrigand@ipmc.cnrs.fr)§, Joseph Bergenstråhle §, Kim Thrane §, Annelie Mollbrink, Pascal Barbry, Rainer Waldmann and Joakim Lundeberg' date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' abstract: 'The spatial landscape of gene expression i...
44dbbc4526b96c778827bd1dd37434db68382360e414eaef18e941755bd88ae7
R
1,821
44
context("Test .convert_common_score_to_mat") ## .convert_common_score_to_mat is correct test_that(".convert_common_score_to_mat returns reasonable values", { # load("tests/assets/test_data1.RData") load("../assets/test_data1.RData") common_score <- test_data$common_score score_1 <- test_data$score_1 score_2 ...
f4b6aacbad5dddec3f83eab739ccaaaef3fd368d6bd6086d14d55865fa495c22
R
1,823
62
library(tensorflow) library(SingleCellExperiment) library(cellassign) library(scran) input_dir = '/home/kd/Desktop/cellassign' path = input_dir #dirs = dir(input_dir) learn_rate_vec = c(1:4) #for (dir in dirs){ #print(dir) #path = paste(input_dir, dir, sep="/") C_gs = read.csv(paste(path, "C_gs.csv", s...
27d0f7cae00b17e0d8660e039c56ec085ce2289d0c9ef6e06f717aa6f2464d70
R
1,824
67
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc.isloop=readRDS('/home/disk/database/data/scHIC/GSE130711_analysis/scATAC_pbmc.rds') pbmc.isloop$type[which(pbmc.isloop$se...
e56d8974098fe4a755db94df9681b6c8adf1f6922c11cf5ed870c1f08b1c35b6
R
1,831
76
--- title: "SiT - Supplementary Figure 03" author: '[Kevin Lebrigand](mailto:lebrigand@ipmc.cnrs.fr)§, Joseph Bergenstråhle §, Kim Thrane §, Annelie Mollbrink, Pascal Barbry, Rainer Waldmann and Joakim Lundeberg' date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' abstract: 'The spatial landscape of gene expression i...
6ea8c9bd40849179bb0e50558c97c3d498d033e0a118d06b630d43dbae5528f7
R
1,842
91
# /home/toolkit/tools/R4.2.0/bin/R p p p p p library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') .getRNA<-function(pred.ref){ #pred.ref=readRDS('./ics_out/COM_pred.ref_r0.rds') LOOP2GENE=read.table("./RNA/LoopAndTSS.bed",header=F,sep='\t',row.names=NU...
e5cebfd8e2224c9706c37ff379701437abce0f24e62cfbe22dfd1fa20ab3f906
R
1,892
66
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc.isloop=readRDS('/home/disk/database/data/scHIC/GSE130711_analysis/scATAC_pbmc.rds') pbmc.isloop$type[which(pbmc.isloop$se...
a88b02975061a43ad7e98b9d84b7eb86a2474da49de5a7736a9a79b4082d62a7
R
1,900
41
library(Seurat) library(ggplot2) library(miloR) library(readxl) library(gridExtra) library(cowplot) setwd("/data/aronow/Kang/single_cell_projects/10X-Pak/integration/patient_derived_engineered/v2_filtered/") organoids = readRDS("./combined_all_organoids_filtered_v2.rds") df_cells = read.table("ctype_v6.txt", sep = "\...
7b906708781b2ef2f28231c86cef9caa3ead2fed6855b9889489b96bcf9d8717
R
1,909
83
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, echo = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, fig.path = "man/figures/" ) ``` ```{r echo=FALSE, results="hide", message=FALSE} library("badger") ``` # MetNor...
845440498e57f7c5a7384a3890a59190de60f50a4db3bf01e4e0acc6c797b7c5
R
1,912
57
context("Test .compute_distinct_score") ## .compute_distinct_score is correct test_that("(Basic) .compute_distinct_score works", { # load("tests/assets/test_data1.RData") load("../assets/test_data1.RData") score_1 <- test_data$score_1 score_2 <- test_data$score_2 common_score <- test_data$common_score ...
d130762e59c685aaf2066df8a5a2c4f562a68f1833648a4810e60c74c2bf9b0e
R
1,914
86
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) #args <- commandArgs(TRUE) #opath=args[1] source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') pbmc=readRDS('/home/disk/database/data/scHIC/GSE130711_analysis/scATAC_pbmc.rds') pbmc$type[which(pbmc$seurat_clusters %in% c...
1bdb27c2849849ce87e0be3f0b4de45e4da43dacfd78f003a8519cebc4dea664
R
1,916
79
--- title: "SiT - Supplementary Figure 06" author: '[Kevin Lebrigand](mailto:lebrigand@ipmc.cnrs.fr)§, Joseph Bergenstråhle §, Kim Thrane §, Annelie Mollbrink, Pascal Barbry, Rainer Waldmann and Joakim Lundeberg' date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' abstract: 'The spatial landscape of gene expression i...
c2131a368bb18bc758dc34f077be8370a5a0282cf4db87ff69ab257b704031fa
R
1,919
79
/home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(ggplot2) library(patchwork) set.seed(1234) library(Signac) library(GenomicRanges) pbmc=readRDS('/home/disk/database/data/scHIC/GSE130711_analysis/scATAC_pbmc.rds') pbmc$type[which(pbmc$seurat...
4f6cd40e995c82e658288c77659b803642079adfa6e172a1af13c89d03f872e7
R
1,924
52
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) print(args) arg_file = as.array(args[1]) print(arg_file) j_global=as.numeric(args[2]) alpha=as.numeric(args[3]) dataset_file = as.array(args[4]) workspace_directory=as.array(args[5]) label=as.array(args[6]) i_exp=as.numeric(args[7]) print(label) print(worksp...
18158e067150dd82e1bc9b2261b5a7f8cf80c398e17b6aab02b4258ca39900e0
R
1,926
46
## Summarizes data. ## Gives count, mean, standard deviation, standard error of the mean, and confidence interval (default 95%). ## data: a data frame. ## measurevar: the name of a column that contains the variable to be summariezed ## groupvars: a vector containing names of columns that contain grouping variable...
f38a4b782e7268a9f20dd5e32e0da4875c655f8c86c505b1bbdedc314e62122c
R
1,941
46
context("Test compute synchrony") ## tiltedCCA_decomposition is correct test_that("(Basic) compute_synchrony works", { # load("tests/assets/test_data4.RData") load("../assets/test_data4.RData") mat_1 <- test_data$mat_1 mat_2 <- test_data$mat_2 n <- nrow(mat_1) large_clustering_1 <- test_data$clustering_1 ...
6c89ae04afceb4353b8cff65f8c6fe9b97a9e7a655246c146cbea50e2fd50a8c
R
1,949
84
context("Geom testing") library(ggplot2) library(vdiffr) library(magrittr) # Define input df df <- # Use built-in demo dataset df_linear_associations %>% # Arrange by name in order to filter the first few biomarkers for more # than one studies dplyr::arrange(name) %>% # Estimate confidence intervals dpl...
dfe571d313bb7826af45568d44a80e416aa4a7a6cf6c7f94993ccb78f64e8de4
R
1,953
69
#' @title MetNormalizer_logo #' @description The MetNormalizer logo, using ASCII or Unicode characters #' @author Xiaotao Shen #' \email{shenxt@@stanford.edu} #' @param unicode Whether to use Unicode symbols. Default is `TRUE` #' on UTF-8 platforms. #' @return A ASCII log of MetNormalizer #' @export #' @import ggplot2 ...
764d11133caeed83f11eba8fef9dc5cd32ce4eda586e66227620827d9949835b
R
1,955
80
--- title: "Figure S7" output: html_notebook --- # Libraries ```{r message=FALSE, warning=FALSE, echo=FALSE,include=FALSE} rm(list = ls()) library(dplyr) library(ggpubr) library(ggplot2) library(rstatix) library(magrittr) library(knitr) library(openxlsx) ``` # Data ```{r} df.HRV <- readRDS(...
cdd554ec618629f7b9f01129d19bc02da91db9592d9f3444c2f7c7104dfd35b1
R
1,992
62
library(rstatix) # for visualization library(ggpubr) library(ggplot2) dat <- read.table('../Output/Logratio_fraction_in_behavior.txt', header = TRUE, sep = ",") # preprocess data dat$group <- as.factor(dat$group) dat$mouse <- as.factor(dat$mouse) dat$behavior <- as.factor(dat$behavior) # visualize the data bp <- gg...
d20ac0a8630230e27a20b37b1fe0be6c1fa0c4d62a0c435d84a0fb893ac6b643
R
1,996
46
library(data.table) pheno <- fread("~/muscle_targets/regenie/UKBB_maxHGS_WBLM.pheno") cov <- fread("~/muscle_targets/regenie/UKBB_maxHGS_WBLM.cov") dat <- merge(pheno,cov,by=c("FID","IID")) loco <- fread("~/muscle_targets/regenie/UKBB_maxHGS_WBLM_step1_1.loco") loco_t <- as.data.frame(t(loco[,-1])) colnames(loco_t) <...
dce8c0f81aed69a5bc0de859c24320033061df70ec9873e16981571bac119682
R
2,007
58
######################################################################################################## ## filter_cluster() ######################################################################################################## filter_cluster <- function(sce.object, filter.size, filter.fscore=NULL, filter.nomarker=...
aac58f78d2b2fe010635afd7cbfbcce78e9dd79179eaf2fe4d43577e67492160
R
2,008
90
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') .getRNA<-function(pred.ref){ #pred.ref=readRDS('./ics_out/COM_pred.ref_r0.rds') LOOP2GENE=read.table("./RNA/LoopAndTSS.bed",header=F,sep='\t',row.names=NULL,check.n...
8bf5db2204477e41f1a030371137a959ae2fbdc0e93a29c4aa04b03bd28cad1e
R
2,016
89
#/home/toolkit/tools/R4.2.0/bin/R library(Seurat) library(stringr) LIST=read.table('LIST.txt',sep='\t') pbmc=readRDS('./eQTL/scAtlas_pbmc.rds') #ORGAN=t(matrix(unlist(str_split(colnames(pbmc),'_')),nrow=2))[,1] #TYPE=colnames(pbmc)#t(matrix(unlist(str_split(colnames(pbmc),'_')),nrow=2))[,2] LOOP=read.table('./e...
26ece447b92992ddd68a7a0a5ff69a806d7d6c90028eb2958a5413cbf29d5f0a
R
2,028
66
## Attach the R image that contains the relevant functions and load packages. attach("FLICFunctions",pos=2) require(ggplot2) require(stats) ## Create the parameters used for the analysis. ## For a single well, start with the default Single Well Chamber ## set up. (but adjust as necessary) p<-ParametersClass.SingleWell...
6a38d3e08677269e00aa7a5053d0ddcb168c347f743bd5aeaebe4dbb4a362133
R
2,034
53
prepare_matrix_B <- function(ST_data, address_candidate, cell_types, lead_genes, tresh_tau, tresh_rho ){ nTypes <- length(cell_types) list_marker_genes_all_types <- vector("list", length = nTypes) for(i in 1:nTypes){ print(i) candidate_markers <- unique(unlist(read.table(paste0(address_candidate, cell_typ...
40c8fb7022670972377ff7078beaec4c358602ee4594ef986854f410e6c31b89
R
2,045
67
--- title: "Test3 overview" author: "Pierre Ekelmans" output: html_document: toc: no toc_float: yes theme: cerulean pdf_document: toc: no word_document: toc: no --- --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(ggplot2) library(dplyr) library(tidyr) source("Load...
40ac6eab2c77813cb1249c640aa36807dd4566258bc48265fec9b3694db4a0d3
R
2,051
63
library(Seurat) library(ggplot2) library(ggpubr) library(tidyverse) library(plyr) library(EnhancedVolcano) source('../functions/_global.R') source('../functions/_visualize.R') # try enhancedvolcano on a specific plot path = 'single_cell_projects/10X-Pak/integration/patient_derived_engineered/v2_filtered/DEGs/time_sam...
eae226928be5df0d3a57890a287cdcceb2d3386e4351d25acba19994c1b87c8a
R
2,056
46
load("~/Info_for_consolidation.RData") label = c("ADNI_MN2_balanced_INFERENCE") for(j_global in 1:100) { eval(parse(text=paste0("load(file= \"",workspace_directory,"CBDA_Inference_",j_global,"_",label,".RData\")"))) } eval(parse(text=paste0("save.image(\"",workspace_directory,"CBDA_Inference_",label,".RData\")"))) ev...
028136d1c1e3735a16166951816e64b1ef46a0067485e69620474771ed13cbb9
R
2,058
117
# /home/toolkit/tools/R4.2.0/bin/R setwd('/home/disk/database/data/ICS_scHIC/f01_frontalCortex/tracks/') library(Signac) library(Seurat) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(ggplot2) library(patchwork) set.seed(1234) library(Signac) library(GenomicRanges) pbmc=readRDS('/home/disk/database/data...
1ff21325a138112483fab5a6f539fc3f6a73b86e775ce176a12261204f6e4f4a
R
2,065
74
--- title: "SiT - Supplementary Figure 15" author: '[Kevin Lebrigand](mailto:lebrigand@ipmc.cnrs.fr)§, Joseph Bergenstråhle §, Kim Thrane §, Annelie Mollbrink, Pascal Barbry, Rainer Waldmann and Joakim Lundeberg' date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' abstract: 'The spatial landscape of gene expression i...
4d6e93a51fc89e0a94a45e4d9d430c108901c44eb9c9025b3aea81c24125eea8
R
2,071
68
--- title: "melas_wnn_analysis" author: "Nate Mullin" date: "1/11/2023" output: html_document --- ```{r} library(Signac) library(Seurat) library("Signac") library(tidyverse) library(ggpubr) library(EnsDb.Hsapiens.v86) library(BSgenome.Hsapiens.UCSC.hg38) library(ggrepel) library(RColorBrewer) library(scCustomize) ``` ...
5423a8ba1e961be1ba02d93cfa3ba31906daeb752417412572692cc42dbeaec0
R
2,098
63
test_that("pmQueryBuild creates simple query", { q <- pmQueryBuild(terms = "bibliometrics", language = "english") expect_true(grepl("bibliometrics\\[Title/Abstract\\]", q)) expect_true(grepl("english\\[LA\\]", q)) expect_true(grepl("AND", q)) }) test_that("pmQueryBuild handles multiple terms with OR", { q <-...
861da393503aae36c4542bf61d3980df7fd1d176c7a5357b408fb694dd212f2e
R
2,098
95
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) #library(EnsDb.Hsapiens.v86) #hg38 library(EnsDb.Mmusculus.v79) library(ggplot2) library(patchwork) set.seed(1234) #############################################################i library(monocle) library(cicero) pbmc=readRDS...
18cac19c0eebd1a36f30b66e112d4a193685aa886932e297f8fa58a6d5d01c7c
R
2,100
65
## Create asymmetry value for each Davi130 region ## ## Conduct one-sample t-test for hemispheric asymmetry ## library("reshape2") library("broom") library("readr") library("dplyr") library("ggplot2") library("lsr") library("stringr") # read in Davi ROI data # # data is a csv file with cols - Name, Age, ...
1706c2d395d36302531e58cdd3212c296ce4d9378e75f7242eb6e8b8b2156fee
R
2,108
104
.getSub<-function(TAG){ ################### LOOP=fread(paste0("./ics_out/this.out.",TAG),header=F,sep='\t',select=c(1))$V1 SSN=fread(paste0("./ics_out/this.out.",TAG),header=F,sep='\t',select=c(2:(ncol(pbmc)+1))) SSN=as.matrix(SSN) rownames(SSN)=LOOP colnames(SSN)=colnames(pbmc) ########## #CICERO_LOOP=fread(paste...
30f58a7ab652389077de4b4c67874d94017606c68336731b88bb714c018d1239
R
2,128
43
##' Create curve info object #' #' @param curvedata a dataframe or tibble with columns "lm1", "lm2" and "ptswanted". #' @param n_fixed a number indicating how many landmarks are fixed anatomical landmarks #' @return output contains the necessary information to subsample curves, and the identity of each curve for slidin...
f00d745fd59182fab05122f32bd3c31b83a8e035fcb49991e66f52869657500e
R
2,135
35
library(data.table) library(dplyr) gencode <- fread("/edgehpc/dept/compbio/human_genetics/users/yhuang5/ALS_progression/GTAC_ChiaYen/gencode.v39.annotation.gtf.gz",skip = 1,header = F) gwas_catalog <- fread("/edgehpc/dept/compbio/human_genetics/users/yhuang5/muscle_targets/regenie/efotraits_EFO_0006941-associations-20...
3738eface0e6f09458a83ed73fb6291d615ba1ba6bac213ab4cb45ce1dc2d924
R
2,142
64
# Helper functions for analysis with Seurat library(dplyr) library(Seurat) library(SeuratDisk) library(pheatmap) library(stringr) library(grid) # Integrated analysis: standard workflow integrated.analysis <- function(combined.seurat, scale = FALSE){ if (scale){ combined.seurat <- ScaleData(combined.seurat, verb...
62c63eeee019f872f72fee5fb30a2f5a9bbfb206b14ce5c3f356df1488ce96eb
R
2,153
47
library(tximport) library(DESeq2) library(stringr) library(openxlsx) setwd('/data/aronow/Kang/induced_neuron/ChangHui_RNAseq_fastq/isoform_RSEM/rsem_transcripts/differential_v2_DEG/') source_folder = '/data/aronow/Kang/induced_neuron/ChangHui_RNAseq_fastq/isoform_RSEM/rsem_transcripts/transcripts/' # load data df_sam...
538019c09d9f31aa78b80ea933a1655339e4a75c07fb88558cd5c3d541b7a8a3
R
2,154
36
library(ggsci) position_levels = c("ra", "arco", "hvc", "ncl", "lman", "nido", "x", "stri", "fieldl", "ov", "meso") position_pretty_levels = c("RA", "Arco", "HVC", "NCL", "LMAN", "Nido", "Area X", "Striatum", "Field L", "Ovoid", "Meso") position_colors = c('#a6cee3','#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','...
4dab8bc2629d22ee531407d2e0d9d12444d2161bb85bdb14a94d9b0d59415c52
R
2,159
46
#!/usr/bin/env Rscript # Writes webApp/cnlib.R: the verbatim source of every cancerCellNet function # the PACNet web app calls, directly or indirectly. Web-specific patches are # applied by hand afterwards and marked with "# PACNet-web:" comments. # # Usage (from repo root): Rscript tools/vendor_cnlib.R <cancerCellNet ...
7a007ef923437a4059d4850588fa919f0e6e850eb9ec2dbc027a321626ee6f8a
R
2,176
60
library(Seurat) library(SeuratWrappers) library(monocle3) library(ggplot2) library(ggridges) library(dplyr) library(ggridges) library(cowplot) source('../Figures/functions/_global.R') samples = c('Cre-d160', 'Flp-d160') organoid.list = list() for (i in 1:2) { sample = samples[i] organoid.counts = Read10X_h5(past...
026f69f7a2e6c4defe52f9ef865087fbf4d6981722b8ca94319199f9717b5e17
R
2,204
62
#' Count the number of documents returned by a query #' #' It counts the number of documents that a query returns from the NCBI PubMed database. #' #' @param query is a character. It contains a search query formulated using the Entrez query language. #' @param api_key is a character. It contains a valid API key for the...
342980f177817dfaf985311ffc960cca7ccf7f9671dfdcc6e37ffa675b59c819
R
2,205
88
context("plot_all_NG_biomarkers") library(ggplot2) library(vdiffr) library(magrittr) df <- df_linear_associations %>% left_join( select( df_NG_biomarker_metadata, name, machine_readable_name ), by = "name" ) test_that("plot_all_NG_biomarkers produces file ", { tmp <- tempfile()...
ab6d82a8078b59278e870ec70766c9b1c0199fd3ecc2cc6cfd6e1424ed415c07
R
2,210
92
--- title: "OverlapStats" author: "Gian" date: "2022-07-01" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) set_factors <- function(df) { df$Subject <- as.factor(df$Subject) df$Hemi <- as.factor(df$Hemi) df$Patch <- as.factor(df$Patch) df$Cond <-...
c6658e79099eebb50a483ce438e58aa381526996221a1dfe5824f81eccd67908
R
2,234
54
#' Compute the differential expression across each pair of cell types #' #' @param seurat_obj seurat object #' @param assay name of assay in the \code{seurat_obj} #' @param idents variables name inside \code{seuart_obj} that contains the cell-type information (or clustering information) for each cell #' @param slot slo...
fd67aae6fa5c9b72471b11291d3105cee774b6056524cd68795437536f5dfc25
R
2,253
53
load_ui <- function() { local({ owd <- setwd(file.path(repo_root, "webApp")); on.exit(setwd(owd)) source("ui.R", local = TRUE)$value }) } ui_html <- function() paste(as.character(htmltools::renderTags(load_ui())$html), collapse = "\n") count <- function(pattern, x) lengths(regmatches(x, gregexpr(pattern, x,...
62ba9a9d390ec96ec528816102ae84b19ba81e1aee523ae1acbacf296001b0e2
R
2,282
49
library(Seurat) library(ggplot2) source('../functions/_global.R') source('../functions/_visualize.R') # load data for integrated organoid samples donor = readRDS('../../donor_reintegrate/donor_reintegrated.rds') donor = donor[, donor$cellclass_draft_v2 %in% cellclass_ordered_v2] donor$cellclass_draft_v2 = factor(dono...
71b3aead9756873fba24990db2369cc8e82cef0ff3fc3b37c2c30d02cf85adf5
R
2,291
64
######################################################################################################## ## FRtest_subsamp() ######################################################################################################## FRtest_subsamp <- function(samp1, samp2, subsamp.size, subsamp.iter, return.all=FALSE, ....
ee7522199d8971ba88c56b09cb86a163cffd51b8bac8d8717e2be1bc8a0cdc1f
R
2,312
71
# CoDa analysis of fractions spent in each of 8 behaviors require(data.table) require(compositions) require(npmv) library(plyr) library(rstatix) # for visualization require(ggplot2) library(ggpubr) # load data set dat <- read.table("../Output/Mouse_behavior_data_set_controls.csv",header = TRUE, sep = ",") dat <- wi...
65e631215415591ecec4491177430ca727d8b9c19808c8f685db8280a9ce6a0f
R
2,330
64
library(Seurat) library(SeuratWrappers) library(SeuratDisk) library(monocle3) library(ggplot2) library(ggridges) library(dplyr) library(ggridges) library(cowplot) # find trajectory of d101 only organoids organoids = readRDS("../../v2_filtered/combined_all_organoids_filtered_v3.rds") donor = organoids[, organoids$sourc...
9dd05394aa0ba70f993758e534e1224bd25e4cc01bd15d0b7d01984f82705ff9
R
2,340
53
## multi-class classification library(SuperLearner) set.seed(843) N <- 100 # outcome Y <- sample(c("A", "B", "C"), size = N, replace = TRUE, prob = c(.1, .5, .4)) # variables X1 <- rnorm(n = N, mean = (as.numeric(Y == "A") + .5*(as.numeric(Y == "C"))), sd = 1) X2 <- rnorm(n = N, mean = (as.numeric(Y == "B")), sd = 1)...
f22d436b4544504c185c8eeb315896f24e5f3f881c61564815138a1e98481eb5
R
2,392
46
library(Seurat) library(ggplot2) source('../functions/_global.R') source('../functions/_visualize.R') # umap for combined organoids can be found in /data/aronow/Kang/single_cell_projects/10X-Pak/integration/patient_derived_engineered/v2_filtered/visualize/visualize.R # umap for donor donor = readRDS('../../donor_rein...
54da836ee1ea020b2f50cd1b339de8ae3051d40b9f16eaef40d2aadd53f379f3
R
2,419
62
#!/usr/bin/env Rscript library(ggplot2) library(readr) library(dplyr) library(purrr) library(tidyr) library(stringr) args <- commandArgs(trailingOnly = TRUE) df_crispro <- read_csv(args[1]) formula <- "position" if(length(args) == 2) formula <- args[2] df_ctrl <- df_crispro %>% filter(control == ...
5d20395fcde539554b647454420fef659f839ee61b52ef0021652a443fc65f25
R
2,428
53
make.slouch.simmap.AIC.table<-function(simmap.output,num.it){ #,model.type,pred.type,num.sp,prev.output=NULL){ #Code to create or update a table from slouch output #Format for calling function: make.slouch.table(Slouch output,type of model,type of predictor variable, #sample size,previous make.slouch output ...
fcd883eb761b9aca67be6b7b7f2b4676add1c4d78960d67b694e1d7819174080
R
2,443
73
#' Extract references from PubMed XML records #' #' Walks a result returned by \code{\link{pmApiRequest}} or #' \code{\link{pmFetchById}} and pulls the \code{<ReferenceList>} block out of #' every record. Returns one row per cited \code{<Reference>}, carrying the #' source PMID, the free-text citation, and (when presen...
6d6e6bdd944d36a4f3e15b05d80a72d453b24027880e6374eadb0e59822e4f04
R
2,449
53
##' Interactively Make Landmark Synonymy Table #' #' @param target_spec a p x 3 matrix of 3d landmark data for the template or specimen that has the correct landmarking scheme #' @param original_spec a matrix of 3d landmarks representing the landmarking scheme to be changed #' @param description a character vector givi...
9016009062721ab8e4e791078afe8690964e062c9ef7143b3dd75236360e9dad
R
2,471
50
context("Test postprocess distinct variable selection") ## postprocess_distinct_variable_selection is correct test_that("postprocess_distinct_variable_selection works", { # load("tests/assets/test_data2.RData") load("../assets/test_data2.RData") mat_1 <- test_data$mat_1 mat_2 <- test_data$mat_2 n <- nrow(ma...
5084a0e0a4d57be7a81a6cca5593dc6d7e982b11b6ae1e55cec9d729050da5c3
R
2,479
69
## STEP 1 - DATA CLEANING ## This is just an example with the MRI dataset "NeuroIm1.txt" # Set the working directory for the R Code development setwd("~/Desktop/R") ## Retrieve the dataset (edit the directory where the dataset is located) #NeuroIm1 = read.table("NeuroIm1.txt", header = TRUE) NeuroIm1 = read.table("Neu...
ece456b4fcdb8290e0fb38623782ee30c2a7b7ed5b66983fc5f0d21ed8ff96cf
R
2,529
52
context("Test fine tuning") ## fine_tuning is correct test_that("(Basic) fine_tuning works", { # load("tests/assets/test_data1.RData") load("../assets/test_data1.RData") mat_1 <- test_data$mat_1 mat_2 <- test_data$mat_2 n <- nrow(mat_1) large_clustering_1 <- test_data$clustering_1 large_clustering_2 <- ...
f590831ceb3ed9a4f018c79dbfc9f996550875da756074269f7fa2600de46aef
R
2,531
40
--- title: "Variable Importance" author: "Andrew Soncrant" date: "April 18, 2017" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) knitr::opts_knit$set(root.dir = "~/GitHub/CBDA/Pipeline/DISTRIBUTED/BINOMIALdataset/TEST") library(party) library(ggplot2) ``` # Variable Importance...
17f9bfd76ec8006339f8cd3a29db6c8014351a45a75f7d98916c3be7f901aeee
R
2,545
90
TAG='200k' # /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) #args <- commandArgs(TRUE) #opath=args[1] source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') COL_LIST=list(DType=c('scATAC'='indianred1','scHIC'='royalblue1'), CType=c('Astro'='red','MG'='g...
5b8759ed97922b648a4948b5a81388e8d56b6c6328992037dd837a143d2adbd3
R
2,545
90
TAG='300k' # /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) #args <- commandArgs(TRUE) #opath=args[1] source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') COL_LIST=list(DType=c('scATAC'='indianred1','scHIC'='royalblue1'), CType=c('Astro'='red','MG'='g...
69840820ec8abfcee39f5576567e6c848e22d680b224636375200c4f64e33376
R
2,545
90
TAG='400k' # /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) #args <- commandArgs(TRUE) #opath=args[1] source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') COL_LIST=list(DType=c('scATAC'='indianred1','scHIC'='royalblue1'), CType=c('Astro'='red','MG'='g...
8201c2731a437c02e1e7b9ed59365a9302cafc150796fab265b4bb7796000de1
R
2,545
90
TAG='100k' # /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) #args <- commandArgs(TRUE) #opath=args[1] source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') COL_LIST=list(DType=c('scATAC'='indianred1','scHIC'='royalblue1'), CType=c('Astro'='red','MG'='g...
3e838bc10db6fb8355a61fbdaed1efd8b5b8dd61ddf3c5d1903416d6f343ab98
R
2,591
72
############################# ##### Load in Libraries ##### ############################# print("loading libraries") library(crayon, lib.loc = "/Shared/IVR/apvoigt/programs/R-4.1.0/bin/PACKAGES/") library(backports, lib.loc = "/Shared/IVR/apvoigt/programs/R-4.1.0/bin/PACKAGES/") library(withr, lib.loc = "/Shared/IVR/a...
7922431985a2a3298e2790a66c66eaef8ae3bdca060af680fc58d197e4723d89
R
2,616
89
#' Generate orthogonal matrices correspond to an SBM #' #' @param B_mat symmetric matrix #' @param membership_vec vector of positive integers #' @param centered boolean, where if \code{TRUE}, one less dimension #' is provided but the singular vectors are centered #' #' @return matrix #' @export generate_sbm_orthogonal ...
6092bbd6e593166c1421fc59e7f586d11f4daf0ba3ffcda21644b1ce0fd0252e
R
2,622
61
#' Compute the synchrony based on Tilted-CCA #' #' @param input_obj \code{multiSVD} class, after applying \code{tiltedCCA_decomposition()} #' @param anchor_modality numeric of \code{1} or \code{2}, denoting which modality the synchrony is computed on #' #' @returns a matrix with \code{n} cells and 2 columns, which one ...
a550918640f0a8267f1eb841df743148ec82c4aec42f3c9f7b1cf3fd843ade81
R
2,622
117
/home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) library(ggplot2) library(patchwork) set.seed(1234) library(Signac) library(GenomicRanges) setwd('/home/disk/database/data/ICS_scHIC/f04_multi') pbmc=readRDS('scATAC_pbmc.rds') Idents(pbmc)=pbmc$type DimPlot(pbmc) UMAP=pbmc@...
6901322087c09f36894d808aae10ae64c99524b08f9edb5cab18a824b6d27a58
R
2,626
52
setwd("~/Documents/NIH-grant/SOCR/PilotTest") #load("CBDA_SL_M10000_miss0_n60_80_k15_30.RData") #load("CBDA_SL_M10000_miss0_n60_80_k30_50.RData") #load("CBDA_SL_M10000_miss10_n60_80_k15_30.RData") load("CBDA_SL_M10000_miss10_n60_80_k30_50.RData") #load("CBDA_SL_M10000_miss20_n60_80_k15_30.RData") #load("CBDA...
bb242f78be6f67f4f111b4dcd672cf81ca65eba19c335b1dfcc675989a893dbe
R
2,637
59
#### Trajectory Inference (TI) #### #Convert Seurat object into sce sce <- as.SingleCellExperiment(obj, assay = "RNA") #You can set the root and/or endpoint, default is NULL sce <- slingshot(sce, reducedDim = 'UMAP', clusterLabels = colData(sce)$seurat_clusters, start.clus = "5", end.clus = "1", approx_points = 100...
9663b1d4b198a7027cab7588670a5a069de4a0523e74e5e25ccb65f57325aecc
R
2,652
61
#' Cluster size plot #' #' This function plots the cluster sizes of the two single cell datasets (e.g. query and reference) to be compared. #' #' @param sce.E1,sce.E2 Data objects, namely E1 and E2. #' @param decreasing Boolean variable if the cluster sizes should be sorted in decreasing order. Default: \code{TRUE}. #...
36059cae43e0657f54f9aa668fffe476276ecb9036f1441b645ae16e71d57858
R
2,653
91
library(rstatix) # for visualization library(ggplot2) library(ggpubr) dat <- read.table('../Output/Classical_measures.txt', header = TRUE, sep = ",") # fraction in inner region dat <- as.data.frame(dat[,c('day','group','mouse','fraction_inner')]) dat$group <- as.factor(dat$group) dat$day <- as.factor(dat$day) dat$mo...
c886f33c9641af752ddd6c4cb5597a67c01152d038391d1aa3a9c5fd7f2a6fa6
R
2,674
68
# load environment library(Seurat) library(ggplot2) library(ggpubr) library(tidyverse) library(plyr) source('../../functions/_global.R') source('../../functions/_visualize.R') # load data path = '../v2_filtered/trajectory/' time_points = c('d22', 'd50', 'd101') donors = list() for (i in 1:length(time_points)){ time...
960a9144bd93bed8ee67ab38cfdc33a575e9e09f0169289a5a7b127d1918ed8a
R
2,675
67
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) label=as.array(args[1]) workspace_directory=as.array(args[2]) print(label) print(workspace_directory) filename_specs <- file.path(workspace_directory,paste0(label,"_info.RData")) print(filename_specs) load(filename_specs) #workspace_directory <- "/ifs/loni/...
366b4eaff48bb4274a8149fc8111bc226739df61ddecf5119e0f45b3762c22fb
R
2,689
53
library(ggplot2) source('../functions/_global.R') source('../functions/_visualize.R') # load data df_cells = read.table('../../../v2_filtered/ctype_v6.txt', sep = '\t', header = 1, row.names = 1) df_cells = df_cells[df_cells$cellclass_draft_v2 %in% cellclass_ordered_v2,] df_cells$cellclass_draft...
73b3494130370c83bb878309df50f078091a56945a5f761aebba84a555f134dd
R
2,705
101
# Observer Model (Alternation Frequency) - 2022 library(tidyverse) # Add function to shift down vector n rows and replace with NA shiftdown <- function(x, n){ c(rep(NA, n), head(x, -n)) } # Main function CountEventAlternation <- function(s, omega = Inf){ # Store input sequence in dataframe df <- enframe(s, ...
f160a3dc4cf2f1c10654745603fa9b915d0d0a6af3f76118f01551d19cc414b2
R
2,709
119
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) #library(EnsDb.Hsapiens.v86) #hg38 library(EnsDb.Mmusculus.v79) library(ggplot2) library(patchwork) set.seed(1234) #############################################################i library(monocle) library(cicero) pbmc=readR...
b90cf916230680e45e4b364efd935844cef54d84ab62a6b13f379d6bda827901
R
2,715
60
# Integrate bird and mouse samples # Directories where to load and save data datadir <- "./data/seurat/" savedir_seurat <- "./data/seurat/" savedir_anndata <- "./data/anndata/" source("./src/seurat_utils.R") # integrated.analysis & packages # Separately treat exc and inh neurons for (selected_class in c('GABAergic', ...
84f83872cd17903fb3c850561fa7632769c2b967cb6df281fe37dd133767af3e
R
2,732
83
library(lme4) library(MuMIn) library(lmerTest) changeDirection <- function(df,form){ colnumber=which(colnames(df)=='DistanceBin') for (sub in unique(df$ID)){ for (hemi in unique(df$Hemi)){ for (cond in c('C','I')){ mask=df$ID==sub & df$Cond==cond & df$Hemi==hemi if (sum(mask)>0){ ...
12cb54959967d0420117a7fdd44a94ba879f47255d2fc1bf134ce602464ad1ff
R
2,737
184
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) #library(EnsDb.Hsapiens.v86) #hg38 library(EnsDb.Mmusculus.v79) library(ggplot2) library(patchwork) set.seed(1234) opath='/home/disk/database/data/ICS_scHIC/fxx_spatial/' fpath=paste0('/home/disk/database/data/ICS_scHIC/fxx_sp...
4ab78e24b5caad3c4072e1ca823cd9d5e996d8b408e21fecaa326abeb890f0d3
R
2,764
145
--- title: '' output: html_document params: address_input: "~/Celloscope/example/data/" address_results: "~/Celloscope/example/" --- ```{r, echo=FALSE} library(stringr) library(data.table) library(ggplot2) library(grid) library(gridExtra) ``` ```{r, echo=FALSE} source("~/Celloscope/code/functions.R") ...
8f61b26c0e54d0d48157096bd8fcc23ae1f8ced9c31a66dbec8252e5b875c84e
R
2,772
74
# Combine the thickness and noddi information into single dataframes. for the # vision ROIs, average data within each ROI. for full-V1, add the grouping for # the bar ROIs. add demographic information such as diagnosis, disease onset, # etc. and save to new files for analysis library(janitor) library(tidyverse) # dem...
4ec24636c5f9053fe29bb758a855deb314fb9a35aae09276ae4ca5ac30e4f403
R
2,777
68
#' Non-zero expression plot #' #' A function that calculates and plots "\% expressed per marker gene per cluster" for the input data object. #' \% = number of cells that express the marker gene in the cluster / cluster size. #' #' @param sce.object A \code{FRmatch} input data object. See example in \code{\link[FRmatch...
43b4ac239d3de6eb8495162371bf028234be3ddadd2094929faabc3ad94b52ee
R
2,778
62
#hicdc+ for normalization # # Usage # screen # bsub -n 2 -W 100:00 -R 'span[hosts=1] rusage[mem=64]' -Is /bin/bash # /home/bin/R # source("/epiphany/data_preparation/hicdcplus_norm_sig.R") # nolint library(HiCDCPlus) ###################################### # Step 0. Define arguments # #######################...
60570d5599200a13f9e30fe45e7eb494af809d4616f925e6493276ac1a6460bd
R
2,799
65
# Set the directory path where the RDS files are located dir_path <- "path/to/the/folder" # List all the RDS files in the directory file_list <- list.files(path = dir_path, pattern = "\\.rds$") # Create an empty list to store the R objects obj_list <- list() # Loop through each file and read them into the l...
00bf91486fc544a2d6aefe1071d4dd37f015e268c20bdceb511a68dff0793f0b
R
2,839
70
## ----Installation of the CBDA package, eval = FALSE---------------------- # # Installation from the Windows binary (recommended for Windows systems) # install.packages("/filepath/CBDA_1.0.0.zip", repos = NULL, type = "win.binary") # # Installation from the source (recommended for Macs and Linux systems) # ins...