sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
307c56397b09e4e4d3f38f22f976535d55e172cbeba972bcb7ab1bc9af45ed1e
R
2,124
60
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) library(stringr) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_me...
7c46610ed0ca76dab92bdd19c1de489a2aeb4480901fe09394eefd470c05eb86
R
2,131
84
# load the counts of each sample DMSO<-read.table(file = "DMSO_gene_count.tsv",header = TRUE,row.names = 1) Riluzole<-read.table(file = "Riluzole_gene_count.tsv",header = TRUE,row.names = 1) DMSO_Riluzole<-cbind(DMSO,Riluzole) DMSO_Riluzole<-DMSO_Riluzole[-(60672:60682),] # rename the colname to the group name grou...
f4802dce73ada94f268850bc4dcded6be609362f2601552095221d8cbb69b72f
R
2,131
84
# load the counts of each sample DMSO<-read.table(file = "DMSO_gene_count.tsv",header = TRUE,row.names = 1) imatinib<-read.table(file = "imatinib_gene_count.tsv",header = TRUE,row.names = 1) DMSO_imatinib<-cbind(DMSO,imatinib) DMSO_imatinib<-DMSO_imatinib[-(60672:60682),] # rename the colname to the group name grou...
201460386e59e5a82bdf1ebd111231f1d66bb226a262a1918ef2fc75408e3a15
R
2,132
67
library(monocle3) library(tricycle) library(SingleCellExperiment) library(scater) library(cowplot) library(ggplot2) library(here) tabula_muris <- readRDS(here("tabula_muris/data/10x_tabula_muris_annotated.rds")) tabula_muris_sub <- tabula_muris[!is.na(fData(tabula_muris)$ensembl_id_trimmed),] rownames(tabula_muris_s...
ffa50df462a5aacbf462cc679f6e1e443c9cb6e4be1b94ff94f200b2e136e7da
R
2,133
87
# 05/23/2023 Fengyao Yan # Apply NNLS deconvolution on patient 2224 data. library(tidyverse) library(ggplot2) library(nnls) library(glmnet) library(Metrics) library(data.table) data_folder <- '../../data/2224' data_raw <- '../../data/raw' dat<-fread(paste(data_raw, '/selected_gtex_top_1_NT_1_fc_3_data.csv', sep=''),...
e6d1ff20e42141e7602111a0fc2a2b2c6476a802e30165c6d7abc14153304847
R
2,141
60
## The following script creates the ../inst/extdata/tcga_cohort.txt.gz dataset ## Requires TCGAmutations R package (https://github.com/PoisonAlien/TCGAmutations) and Agilent sureselect target_regions BED file (https://kb.10xgenomics.com/hc/en-us/articles/115004150923-Where-can-I-find-the-Agilent-Target-BED-files-) #Ge...
161058f62bea9e2df3b6e8e09ffa3ee3ff3e883059c877870ded4266f4c0df6e
R
2,145
84
# load the counts of each sample DMSO<-read.table(file = "DMSO_gene_count.tsv",header = TRUE,row.names = 1) rapamycin<-read.table(file = "rapamycin_gene_count.tsv",header = TRUE,row.names = 1) DMSO_rapamycin<-cbind(DMSO,rapamycin) DMSO_rapamycin<-DMSO_rapamycin[-(60672:60682),] # rename the colname to the group nam...
6abb8d6dfcee34a2d4eee2fd998ff38bbcb0a1d53fa1b2310575d1bc67b35911
R
2,145
74
library(BPCells) library(Seurat) options(Seurat.object.assay.version = "v5") library(stringr) library(purrr) Sys.setenv("_R_USE_PIPEBIND_" = TRUE) projdir <- here::here() rdir <- file.path(projdir, "package/R") import::from(.from = "utils.R", .directory = rdir, setupLogging, closeLogging) ## library(future) ## pla...
c820aebf8ad31ec5bb04c46ff6a91bae0ac4de4cf2e52f22a703024f86ac87f9
R
2,145
84
# load the counts of each sample DMSO<-read.table(file = "DMSO_gene_count.tsv",header = TRUE,row.names = 1) Metformin<-read.table(file = "Metformin_gene_count.tsv",header = TRUE,row.names = 1) DMSO_Metformin<-cbind(DMSO,Metformin) DMSO_Metformin<-DMSO_Metformin[-(60672:60682),] # rename the colname to the group nam...
86a88ca2e94a86eb2f036ab2b43c3b97b515966b91c8c5c4a7d5e1d9923d551e
R
2,151
84
################################################################## # LC snRNA-seq analyses: build SCE object from Cell Ranger outputs # Lukas Weber, Oct 2022 # using code by Matthew N Tran and Leonardo Collado-Torres ################################################################## # run in interactive session on JHP...
c732350bc6840c2f2def2fc20d07050d9b36dadd649c1df0c1db30180fc5290a
R
2,152
59
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
cc71a1ce68d196cc7d2db4f86fafed5a84e3952bab70581c5ae26ae6a14d8ef4
R
2,154
57
# Load library library(tidyverse) library(rpart) library(rpart.plot) # Load data df<-read.csv(file.choose(), header=TRUE) # csv file is 5 columns with headers: sex; drug; genotype; region; L_effect. # each row is experimental replicate. #L_effect is [DA] in isradipine normalised to control # tidy data ...
49a60b2765dfde4822c7a9ef9f9060fe885f623b83b15a3ceb6578019bb727c9
R
2,155
66
# This script is prepared by Sai. library(Matrix) library(monocle3) # should be cicero for monocle3 # devtools::install_github( # "cole-trapnell-lab/cicero-release", ref = "monocle3") library(cicero) projdir <- here::here() rscdir <- file.path(projdir, "src/main/resource") args <- commandArgs(trailingOnly = TRUE) Ce...
893b0f5000c19de2de7916ea05588ed024dc572f4f0e112991f5408379d04b30
R
2,158
59
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
316ed720d9163c1e15e857adb783c76d04d0ec177ad3620db79a2170e1d4b768
R
2,159
22
#' 178 Signatures for Normal Brain Cell Types #' #' Signatures were derived from 7 publications (below). Clusters were taken from each publication, and differentially expressed genes were computed for each cluster using scalop::dea. If the publication had subclusters, then scalop::dea was computed for that subcluster a...
01fe21b1e91af1b69837eccc44d04c6d043f04782c32793ea8468726c4658e54
R
2,163
63
library(ggplot2) library(tidyverse) mse_dots <- data.frame(matrix(ncol=4, nrow=0)) colnames(mse_dots) <- c('tissue', 'mse', 'n_gene', 'model') mse_nnls <- read.csv('../../data/cmp/mse_all_cmp_nnls.csv', row.names = 1) mse_deep <- read.csv('../../data/cmp/cmp_res/mse_all_cmp_deep.csv', row.names=1) mse_nnls <- mse_nn...
ffbc75c9b1055f90ef2e461422f25a64bd965aac714d43649751bf6adce7beef
R
2,163
59
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
f0461d659d645f521e8cb71a555dc353900bc60f8874c429dbb44756d1b2be32
R
2,167
94
################################################# # LC Visium analyses: normalization and logcounts # Lukas Weber, Oct 2022 ################################################# # module load conda_R/4.2 # Rscript filename.R # file location: # /dcs04/lieber/lcolladotor/pilotLC_LIBD001/locus-c/ library(here) library(Spa...
f1275d7ed0bc8e1ab3911057e545df32b150bb41dea63cb0d0d8ef4cf2916038
R
2,167
60
# this script will compare the cnv burden between celltype annotations in the aggregated atac object library(data.table) library(dplyr) library(tidyr) library(here) library(stringr) library(tidyr) # get library_ids from aggregation file aggcsv <- read.csv(here("ckd","cellranger_atac_aggr","outs","aggregation_csv.csv"...
254a95ff3c5d4ace04b95e7cffe1e9f0ccd8fb63127391a63ce689c62b0216d6
R
2,170
62
# Install required packages if not already installed if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") if (!requireNamespace("IRanges", quietly = TRUE)) BiocManager::install("IRanges") # Load required packages library(dplyr) library(stringr) library(fuzzyjoin) librar...
06abd4c1c25af84df8f04b4b9e77dedfb7cbd561c3a0eff92c78591cf509180f
R
2,173
61
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
c02a4c1abbfa60d955b8568e013d886b9f98f4aac737107d601950df218e26ac
R
2,179
82
gierer.f <- function(rgc.dat, tec.dat, nterm = 16, #number of terminals of each RGC. epsilon = 0.005, # rate of growth of r kappa = 0.00000, # rate of decay of r p0.fn=2 #which energy term to use, p0db ...
0edc23aa70046b884f360ab770fa15f6dd79117f75f2117a097fe018365e67fe
R
2,193
66
library(monocle3) library(tricycle) library(SingleCellExperiment) library(scater) library(cowplot) library(ggplot2) library(here) tabula_muris <- readRDS(here("tabula_muris/data/smartseq2_tabula_muris_annotated.rds")) pData(tabula_muris)$tissue <- pData(tabula_muris)$sample tabula_muris_sub <- tabula_muris[!is.na(f...
54cf57d1e134ddadf62f0d31ad0bec04db986aa50f2e340251914a40e865fad2
R
2,195
60
library(STRINGdb) string_db <- STRINGdb$new( version="10", species=10090,score_threshold=0, input_directory="" ) data(diff_exp_example1) example1_mapped <- string_db$map( diff_exp_example1, "gene", removeUnmappedRows = FALSE) hits <- example1_mapped$STRING_id[1:80] enrichmentGO <- string_db$get_enrichment( hits, ...
82edd1b39ca8b51e8ed64cce82f048bae7cb95010f68ca0ff9f3573b40fcb860
R
2,197
50
#' Function to get consensus sequences from BAM alignments #' #' @param ref path to reference genome #' @param bam path to BAM alignment file #' @param call whether to call variants #' @param index whether to index the VCF variant file output #' @param cons whether to generate consensus sequence #' @param suffix suffi...
145cbedaa12d6ccb5061989aa44b58f4df0fa8de5f4995a9ab157728ea5e5235
R
2,204
60
library("methylKit") file.list = list("input_test1.myCpG.txt", "input_test2.myCpG.txt", "input_control1.myCpG.txt", "input_control2.myCpG.txt") myobj=methRead( file.list, sample.id=list("test 1","test 2","control 1","control 2"),assembly="hg18",pipeline="amp",treatment=c(1,1,0,0)) pdf('output_statist...
86f9aead951a9cfe941ede0b60f9ecc8d3f8285a87185ebde05e130c4cff5564
R
2,210
63
# roc curves for HLA-I, # DePTH trained on Emerson 2017 and testted on Emerson 2017 # random forest trained on Emerson 2017 and tested on Emerson 2017 library(ggplot2) library(pROC) # load scores from DePTH pos_depth_file = "HLA_I_all_match_test_pos_20.csv" neg_depth_file = "HLA_I_all_match_test_neg_20.csv" df_po...
b484efb627ce209361c072066657d87cd8c13c20a76e341b45c696b245ac8fca
R
2,222
34
#' @title Fraction of a Cell's Expression Level Coming From Mitochondrial Genes #' @description Often used as a QC parameter for cells in scRNA-seq data. The higher the fraction of mitochondrial expression (i.e. of expression coming from mitochondrial genes), the higher the implied level of stress a cell is in and by...
5541376d80674aa63da57a2c65bfb06b28678088d0d11771eb9c9e9022b464f1
R
2,223
62
################################################################################ # Glm analysis for percentage # Pauline Spéder # 06-09-2023 ################################################################################ library(readxl) library(tidyverse) library(ggbeeswarm) library(emmeans) # Import data --------...
3f624df60ac114e6162a137a1084dcf023942b421c714a98902e77b91e95c584
R
2,227
84
# this file is the second part for getting p-value cutoff for FDR 0.05 args = commandArgs(trailingOnly = TRUE) eval(parse(text=args[[1]])) library(parallel) library(doParallel) library(doRNG) library(foreach) nCore = 4 #nCore = Sys.getenv("SLURM_CPUS_ON_NODE") nCore registerDoParallel(cores=nCore) options(mc.core...
78d7af0abd873be935a5ad0b5c43b467c3de7230f41a68f0701952aa5c3a7776
R
2,229
42
#' @title Grouped Reorder and Ungroup #' @description Keep desired groups together but reorder members within each group. E.g. If cells from multiple samples are being reordered, samples can be kept together and cells reordered within. Option to also reorder the order of groups or samples, such that groups with simil...
38275a0dc2e3576f6fa59f179c89310c429d119999cccb66f3e218e715116ce2
R
2,237
62
#05/23/2023 Fengyao Yan #Plot the scatter plots for predicted tissue fractions for Gtex semi-silico data. library(ggplot2) library(tidyverse) library(data.table) data_t <- fread('../../data/gtex/true_gtex_nnls.csv', data.table=FALSE) data_p <- fread('../../data/gtex/pred_gtex_nnls.csv', data.table=FALSE) data_t <- d...
98dbf326c0b33e8650407a99da62bd1c5b426f9b416cafe203bbaeddd43bac04
R
2,240
58
####╔═════ ═════╗#### ####💠Stats helpers💠#### ####╚═════ ═════╝#### cli_h2("┗ [SCRIPTS] Loading stats functions") #------------------------------------# ####🔺Summarizing data or a model #### #------------------------------------# distribution_summary <- function(data, dvs, between = "Condition") { data ...
ec21ea7ea5ca878e58201acc67335ae4df90448628691efe5ed1fbe32f98eb6c
R
2,259
94
SyntheticNet<-function(filename){ library(mclust) library(igraph) print(filename) A=read.csv(filename, header = TRUE, sep = ",", quote = "") A=as.matrix(A) A=A[,c(2:dim(A)[2])] B=matrix(0,dim(A)[1],dim(A)[2]) B[which(A=="True")]=1 colnames(B)=c(1:dim(B)[2]) rownames(B)=colnames(B) #This is now a 01 n...
563b3176979a41b40953d8360b5e24ad39b6cdc37b32e9a2e334f459f6635469
R
2,261
50
#' Write an output Slurm submit script #' #' Generate an Slurm submit script for the given workflow #' @param prefix Prefix for output, to be prepended to outputs #' @param resultnames List of names for the expected outputs #' @param modelfile Name of the model file that contains the processVoxel command #' @param desi...
e317a142e73b164563436ef464108e460304563992fa8673b9e4084c4f003aa2
R
2,262
29
######################################################## ## Define CIFTI template made in Connectome Workbench ## ######################################################## glasser_template.path <- "/ncf/hcp/data/analyses/myelin/parcellations/Q1-Q6_RelatedValidation210.CorticalAreas_dil_Final_Final_Areas_Group_Colors.32k...
9e300eefa764d68b9f29e116c43bc81945c30a33d7539b9e6545ec0661af0806
R
2,265
75
#!/usr/bin/env Rscript # to run locally: # SCRATCH1=/mnt/g/scratch # docker run -it \ # --workdir $HOME \ # -v /mnt/g/ckd:$HOME/ckd \ # -v $HOME:$HOME \ # -v $SCRATCH1:$SCRATCH1 \ # -e SCRATCH1="/mnt/g/scratch" \ # p4rkerw/sctools:R4.1.0 # # to run interactively on the RIS compute1 cluster: # export LSF_DOCKER_VOLUMES=...
c8d48be750a9ed48eba45c076c9100b2883e6469a5d1db038052d0e74db6b0af
R
2,266
61
library(AUCell) library(readxl) library(tidyverse) library(here) ## main Seurat package snRNA-seq pacakges library(Seurat) library(SeuratDisk) library(future) library(BiocParallel) library(doParallel) DATADIR = 'data/tidy_data/AUCell_gene_set_activities' here(DATADIR,c( 'loom', 'regulon')) %>% sapply(dir.create) ###...
ff37e1e87d3439c834c00e064c743aca9a105b293b377c5081c5c90e8f9b2099
R
2,270
71
#' Transform the 'TreeSummarizedExperiment' object to 'microtable' object of 'microeco' package. #' #' @param tse a TreeSummarizedExperiment object <doi:10.12688/f1000research.26669.2>. #' @param ... parameter passed to microtable$new function of microeco package, such as auto_tidy parameter. #' @return microtable obje...
9ce451732bfece2e3e7ae7307a0ff336763d40092c1f8e61299da453e7aeb4ed
R
2,273
48
m0 = readr::read_csv('FACS/Brain_Non-Myeloid-counts.csv') annotation0 = readr::read_csv('annotations_facs.csv') # set gene rownames # note re the ~2k gene ~names suffixed with 'Rik': # https://bioinformatics.stackexchange.com/questions/3205/what-are-riken-genes # they are new genes without proper gene names yet m = as...
73d74f5b644e2c4761518756c43c593ca822b50af8d9e97b1c38ba5418123195
R
2,282
44
#' @title Filter Out Lowly-Correlated Genes from Signature(s) #' @description This function removes signature genes whose expression level is poorly correlated to the signature score. This is relevant if the signatures themselves were defined from a different dataset, as might be the case in applying single-cell si...
94ff6ec64931e6988e79c6c0d48fbc2fcf38bd523fb9f204aae54e133e0bd90d
R
2,283
47
library(gifti) library(R.matlab) library(RNifti) library(ciftiTools) ciftiTools.setOption('wb_path', '/Users/askeller/Documents/workbench/') library(ggplot2) PFNs_hardparcel<-read_cifti('/Users/askeller/Documents/Kellernet_PrelimAnalysis/hardparcel_group.dscalar.nii') map_predacc_PC1_lh <- PFNs_hardparcel$data$corte...
8e05cb0c06e07781cdea736f7b7df264f64e24f41baedd6f10de4b79e54c3ec0
R
2,289
62
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) library(stringr) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_me...
c9ae04090ef4bda6852020de5646ca84c43a5503b4e252b392c5cd4247970d70
R
2,294
98
--- title: "Clusters" author: "Sergey Naumenko" date: "`r Sys.Date()`" output: html_document: code_folding: hide df_print: paged highlight: tango theme: default number_sections: true toc: true toc_float: collapsed: true smooth_scroll: f...
a4152b6346d51d2bc7950e71bcbeec3b22db6a4e731aaf83e743efeefedc4a62
R
2,296
74
# Author: Luisa Cutillo community.significance.test <- function(graph, Nodeids, ...) { if (is.directed(graph)) stop("The graph is not undirected") subgraph <- induced.subgraph(graph, Nodeids) in.degrees <- degree(subgraph) out.degrees <- degree(graph, Nodeids) - in.degrees res=wilcox.test(in.degrees, out.degr...
0c31686e06298ddc26bb097241f07af0b6ebd17c57e46b8d49c2bdcdac572a8b
R
2,298
63
# this code gets the side-by-side violin plots based on the scores on # test positive pairs, test negative pairs, Szeto 2021 54 pairs library(ggplot2) library(ggpubr) library(pROC) theme_set(theme_classic()) results_dir = "../results/ensemble_scores/" res_emerson_szeto_folder = "HLA_I_all_match_szeto/" res_emerson...
1daae36d2f86ca8eeedbff0f26f184f8a70b39b1ad6682895f6dc5686e0583b8
R
2,298
55
# %% Plot results nice(r) library(R.matlab) library(tidyverse) library(ggpubr) library(ggsignif) source("C:\\Users\\user\\Desktop\\brain_stuff\\ggplot_theme_Publication-master\\ggplot_theme_Publication-2.R") setwd("C:\\Users\\user\\Desktop\\brain_stuff\\philipp\\sleeppaper\\data") restacws <- readMat("restacws.mat")$a...
1fab8b5413b9c122727408e96790eacb59a883ba3b369d725d98a3f906549f99
R
2,299
55
#' @title Extract substrings between delimiters by position #' @description substri() splits each element in 'x' into substrings and returns the desired substring(s). 'sep' defines the delimiters separating the strings into substrings, such that the input data between the matches become the fields themselves. 'pos' de...
d03d2b054a89b6f3767a8c9e080f1900ff4487ee8fd635b7eb82eb0b5929e1bc
R
2,300
78
##################################################################### # LC analyses: spot-level deconvolution using cell2location: plotting # Lukas Weber, Apr 2022 ##################################################################### library(SpatialExperiment) library(here) library(ggplot2) library(viridis) # direc...
ef12b4e46e4866d9e6074a019e26e9cabeaf993b1d089699f3cb49409bb93644
R
2,300
63
# roc curve for DePTH trained on mcpas and tested on mcpas # in comparison with CLAIRE on mcpas library(ggplot2) library(pROC) # load scores from DePTH trained on McPAS training data and prediction on McPAS testing data # (only with HLA-I alleles that we have pseudo sequence information for) DePTH_neg_score_file = ...
babdc0d520e42bb04476d78379a0974d242607a135091749a5ebf474ce0f824c
R
2,301
55
library(susieR) set.seed(1) args = commandArgs(trailingOnly = TRUE) # [1] is summary statistics,[2] is LD matrix, [3] is the true causal file, [4] is number of causal snps, # [5] is output subsets file name, [6] is output set file name, [7] is accuracy (sensitivity) file name, # [8] is set size file name, [9] is the n...
9d17266c9819b063f175994a2f87d7280d6102e9e8cd3e600789cb3bf5fb4e35
R
2,305
58
############################################################# # Generate Figure 2A ############################################################# library(ggplot2) library(scales) library(ggpubr) setwd("D:\\PhD\\Lab\\Project_3_SVG\\Figures\\") Input_data <- read.csv(".\\Data\\Manuscript_2D_Simulation_Pattern...
82862cd2484ed38eb49463bfb7356e23d4e1250f4651c27ac6fc7e6ea7134cd0
R
2,313
61
#Sparklines expression of cdh3, clic3, ntf3, snap25 in mens/nens/glia library(SingleCellExperiment) library(monocle3) library(scrattch.vis) library(scuttle) library(here) library(dplyr) source(here("scripts/accessory_functions/prep_sparklines_data.R")) cds <- readRDS(here("6month_LMMP.rds")) cell_types_to_keep <-...
43d8b61a96491f7a83e2cd89218e816b592878fe9344eb3fc8a87165e6ce22ea
R
2,314
61
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
7ee5fd6a57943e6a36509732f79da17c4d23776f38437d9171afc15f17c1d5fe
R
2,322
60
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
1b91d01e228901e77f096d29b07b1b72bbec8a86fc601be8092903f2893b3e71
R
2,323
83
require("categoryCompare") require("Homo.sapiens") require("KEGG.db") do.GOEA = function(cls,univ) { univ = subset(select(Homo.sapiens, keys=univ, columns=c("ENTREZID"), keytype="SYMBOL"),!is.na(ENTREZID)) geneLists = vector(mode = "list",length = length(cls)) names(geneLists) = names(cls) for (i in 1:length(g...
892cd213f0f85cb3b7be36d98ff3cafd5bbb497456a4be1133488776793de8c4
R
2,340
82
# this script will analyze degs for pathway enrichment library(clusterProfiler) library(enrichplot) library(ggplot2) library(org.Hs.eg.db) library(openxlsx) library(RColorBrewer) library(DOSE) library(here) library(dplyr) library(gridExtra) # create a plot dir plots <- here("ckd","figures") dir.create(here(plots)) s...
0339747fc4313a59e4b9f03e93fbb3f4c2ceb9b2a675563f3915bd4f983d6a54
R
2,357
58
# Gregory Way 2017 # PanCancer Classifier # scripts/gestalt_pathway_analysis.R # # Performs Overrepresentation Pathway Analyses (ORA) # # Usage: Run in command line # # Rscript --vanilla scripts/gestalt_pathway_analysis.R # # Output: # ORA results for Ras Classifier Genes (all genes and positive/negative genes) li...
1546f00910522c4451cf9a9cdd1c650e784dd849abb7a68726090ebbeee62cd5
R
2,357
91
#!/usr/bin/env Rscript # this script will preprocess aggregated snATACseq data # counted and aggregated by cellranger-atac v2.1 without library normalization # # to run locally # counts=/mnt/g/cellranger_atac_counts # project=/mnt/g/ckd # SCRATCH1=/mnt/g/scratch # docker run -it \ # --workdir $HOME \ # -v $project:$HOM...
8f7fb84277143a7434cc5264789047191c6844b176d768efe4a9d6d610a4a467
R
2,357
60
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
0653cbadce875130b15d6558153924432179f6f378e43036e36dd5cf9b5af238
R
2,360
68
#----------------------------------------------- # LICENSE #----------------------------------------------- # Copyright 2019 Novartis Institutes for BioMedical Research Inc. # Licensed under the GNU General Public License, Version 3 (the "License"); # you may not use this file except in compliance with ...
1e41591d10ce09859360b8445a845c4c243b6f6c9be1692fda5bfc6e6e1c05d2
R
2,360
80
# var2char <- function(v1) { # deparse(substitute(v1)) # } # retrieve vector of clust ids (with cell names -- column names in x) # with option to return as a dataframe of two columns: cell and clust # x can be expression matrix of genes by cells # common to use reduced dims instead of genes # eg. (50) PCs by cells...
b1b31a1eb240fe03d2d2a5c5b7c5f717c87bb1e9ff82a33fa49a8e42affe5a16
R
2,366
64
## Author: Youtao Lu <luyoutao@sas.upenn.edu> ## Copyright (c) 2017-2023, Youtao Lu and Junhyong Kim, Department of Biology, University of Pennsylvania ## Copyright (c) 2017-2023, James Eberwine, Perelman School of Medicine, University of Pennsylvania ## All Rights Reserved. ## This Source Code Form is subject to th...
1f0e1568c2138b3d1cd25680bcbe4985fe48f95cb366c279a86628cb622d1636
R
2,369
61
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
8f9c2fc547b60d9f8a3f01986d39cea3e0a0d2da18192a28db38490d76445d98
R
2,373
46
library(misha) library(ggplot2) library(cowplot) library(ggrastr) theme_set(theme_cowplot()) gsetroot('/home/hpc/bonev/trackdb/mm10/') options(gmultitasking = F) options(gmax.data.size = 5e7) ins_tracks <- c("hic.ES.ins_250","hic.NPC.ins_250") for (track in c(ins_tracks)){ ### Create vi...
24f7d23515b16beeb2f9bd02efab369a88cf97aa74227c0d59f9acb57e51662d
R
2,375
64
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) library(stringr) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_me...
93e52a392644df3fe0f0d6fc4657dba5f54a1a4d303d0013f0f5db731d419c4c
R
2,380
80
# this file writes out the associated (TCR, HLA) pairs based on p values # from v allele level TCR into a csv file of # the associated pairs and corresponding p values data_dir = "../../data/intermediate_data/" pvalues_big_list = readRDS(paste0(data_dir, "pvalues_big_list.rds")) pvalues = unlist(pvalues_big_list) ...
4906e8c230b3a221e34ae40de9e37465895107c14d04052aa9db484888a28d04
R
2,386
43
#' Extract nucleotide counts for targeted variants from BAM files #' @description bamreadcounts queries a BAM file at specific genomic positions and returns nucleotide counts (A, T, G, C) as well as insertion and deletion counts at each position. Function name is an homage to https://github.com/genome/bam-readcount #' ...
9a2befa653edd2fe114aa779c5e147035573415bc4f331f1dbc452cfeea728ef
R
2,398
61
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
a322ff2f48bd5f82a693a17897dea9549bb2b286988989a22415cd4f2b9035f8
R
2,402
80
#!/usr/bin/env Rscript # This script expects one filename to be passed, the parameter file. # This parameter file (which is just a R script) must stores the values of # 3 variables: # # rgc.file # sc.file # op.file # # Other parameters (e.g. kappa, epsilon) can be set. # ## The name of the paramfile is used as the p...
b9fc93513f7e1c5e0856859b7ef26c484af81510e33332ff39c0d12f4e13c3bd
R
2,406
88
library(Seurat) library(dplyr) library(patchwork) library(rhdf5) library(hdf5r) library(Matrix) library(igraph) library(SeuratObject) library(RcppCNPy) library(reticulate) np <- import("numpy") library(utils) dir<-paste0('../datasets/time/') t<-c('2000','4000','8000','16000','32000','64000') for ( i in 1:length(t)) {...
c2a0c567f2a1a28a7826fe0f0632dad3b3f5b40b371e4c978150909d4250e94c
R
2,410
62
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
64eb7ec45acbabf6dcc5acb8cd8077357e5ced32a72bc8f2ee377083c69323e3
R
2,411
62
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
30e283268810868dbcc7afb5b957abbcf3bfce31777ea6f5b3a5c6081be37724
R
2,412
53
library(tidyverse) library(ggplot2) library(ggpubr) library(patchwork) ### Load performance results------------ landmarks <- data.table::fread('../results/LatentDimAnalysis/validation_results.csv') colnames(landmarks)[1] <- 'fold' landmarks <- landmarks %>% mutate(feature_space = 'landmarks') allgenes <- data.table::...
723d226557dfa40cacd17232171ceeb6b23f81fa735acf57e23ce7a607655cd0
R
2,423
63
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
26624fbbb89f0331be6635ce13804a61e0ddebb565aa8fddc2aaa11fda2243df
R
2,424
117
--- title: "Averge of predicted scores from 20 models" author: "Si Liu" date: "`r Sys.Date()`" output: html_document: theme: journal highlight: tango toc: true toc_depth: 3 toc_float: collapsed: true smooth_scroll: false number_sections: false code_folding: hide df_print: ...
dd2675a0e3a596411be19e75255436dc0b572afd7a6ba9dc71fbec0770a91c9c
R
2,426
109
############################################### # LC Visium analyses: identify SVGs using nnSVG # Lukas Weber, Oct 2022 ############################################### # qrsh -pe local 10 -l mem_free=5G,h_vmem=6G,h_fsize=200G -now n # module load conda_R/4.2 # Rscript filename.R # file location: # /dcs04/lieber/lcoll...
f087a49c4b7281724ebf203294749935a7caf3aaa7e632c527f36a56ed30294f
R
2,426
63
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) library(stringr) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classifi...
84b7796a9fd078adc363f5d20a40a6dcae1ff607e5cd36bccbc24e1b427d74f0
R
2,432
58
#' From a file containing a table with gene and disease information generates a \code{molecularComorbidity} #' object for comorbidity analysis #' #' Given a file with gene and diseases, the \code{dataframe2molecularcomorbidity} #' generates a \code{molecularComorbidity} object. #' #' @param filePth The file name and wi...
001bf3f9f9183773ff8272c27ffe93aaf932ea124116757e8254a779f6b7d524
R
2,434
59
# roc curve for DePTH trained on Emerson 2017 and testted on Emerson 2017 library(ggplot2) library(pROC) # load scores from DePTH trained on McPAS training data and prediction on McPAS testing data # (only with HLA-I alleles that we have pseudo sequence information for) DePTH_neg_score_file = "HLA_I_full_mcpas_neg_...
3013e69b8ee32276627c209658d9a2947704483d7ef2d5314d9b97a7b370e92a
R
2,445
62
"pwr.norm.test" <- function (d = NULL, n = NULL, sig.level = 0.05, power = NULL, alternative = c("two.sided","less","greater")) { if (sum(sapply(list(d, n, power, sig.level), is.null)) != 1) stop("exactly one of d, n, power, and sig.level must be NULL") if (!is.null(d) && is.character(d)) ...
211310c315665eee40484d002bd2ab132e1c1070e90ae9898e5b89721a929d04
R
2,448
102
##################################################### # LC snRNA-seq analyses: SCE object for ExperimentHub # Lukas Weber, Oct 2022 ##################################################### library(here) library(SingleCellExperiment) # ---------------- # Load SCE objects # ---------------- # load SCE objects from prev...
0f1b51e3492a5d278ff6a3c0282757fabf520a992baa0af77a3347d969279e62
R
2,455
64
#' Reorder an x or y axis within facets #' #' Reorder a column before plotting with faceting, such that the values are ordered #' within each facet. This requires two functions: \code{reorder_within} applied to #' the column, then either \code{scale_x_reordered} or \code{scale_y_reordered} added #' to the plot. #' This...
866f5c715debaeb7e38311fb181443185a2ce15687b464ea6889e547bd49af80
R
2,457
74
suppressPackageStartupMessages({ library(caret) library(doParallel) library(e1071) library(scran) library(bluster) library(scater) }) # First method, KNN classifier doKKnn_simple_union <- function(train.sce, train.cellTypes, test.sce, test.cellTypes, anchor = NULL){ cat("do KkNN union classification \...
cbded0e565ad8496bf3223ac8110ca0ff73cf388fb577ed5ac985217957c84b8
R
2,457
60
"pwr.p.test" <- function (h = NULL, n = NULL, sig.level = 0.05, power = NULL, alternative = c("two.sided","less","greater")) { if (sum(sapply(list(h, n, power, sig.level), is.null)) != 1) stop("exactly one of h, n, power, and sig.level must be NULL") if (!is.null(h) && is.character(h)) ...
ab165ec00477d60e0c2fcff42d45c97b10cc603cdead416ded46ec566ff208f2
R
2,467
66
############################################################# # Generate Supplementary Figure 4D # Plot 3D plots of Discrete 3D patterns ############################################################# library(plotly) library(scales) library(plot3D) InputData <- read.csv("..\\Data\\discrete\\Discrete_900by10_widt...
b07df44fe56401412c99ac20138ed97c31db49db00620b9035799419efd211bc
R
2,469
84
#TimesVector # #Created by Inuk Jung on 2016-08-3. #Copyright (c) 2016 Inuk Jung. All rights reserved. # #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at you...
747c18a7719bf696c2b6a8ddd193156ecc230b4c840d7b7de97447d87e7b826e
R
2,474
65
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
7d9d518329545edd13490b791c8f21aa57b53dfeaf320c7f4fb7029a8ee0f4b5
R
2,478
85
##################################################################### # LC analyses: spot-level deconvolution using cell2location: plotting # Lukas Weber, Apr 2022 ##################################################################### library(SpatialExperiment) library(here) library(ggplot2) library(viridis) # direc...
d9a0c1af0ec4d6d12048a18099e34e860462133b0cec32e21788da74f9c0d3f9
R
2,479
50
DESeq_wrap = function(data = data.phenotype.clean, genes = data.gene.count.clean, effects = NULL, formula = NULL, alpha = 0.05, estimate_disp = TRUE, detail = FALSE, lfc = 1){ if(is.null(effects) & is.null(formula)){stop("Must specify either a list of additive effects or a character string specifying a formula")} ...
9fbfc3961e76c3d74e8d879bfccec9183ee5c89fd6a681f974f4d05a998d77f6
R
2,481
85
##################################################################### # LC analyses: spot-level deconvolution using cell2location: plotting # Lukas Weber, Apr 2022 ##################################################################### library(SpatialExperiment) library(here) library(ggplot2) library(viridis) # direc...
35e48ebe32bc3132a601a708886901f5424d840977653d38e323316cf98d5946
R
2,484
65
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
ecd4bfc263507c8986be4f368e2505844381985564a1658964057c3f725c0cdb
R
2,484
80
#TimesVector # #Created by Inuk Jung on 2016-08-3. #Copyright (c) 2016 Inuk Jung. All rights reserved. # #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at you...
4fe48268a647a71de63843f516c53eeba1cb63587b49b560e273bc68d217f8e8
R
2,485
65
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
8039694f0d24455c20736ca00af15410a24aaa03ef7fbd26f1ab66b751680660
R
2,495
65
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classification_methods/doEva...
561f3478ae69690626e4aee2f0d7494a2f6d3831ffab8da4fafc66ea910e5a33
R
2,497
66
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) library(stringr) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classifi...
80f7e24409e3548923b723e52ec5a3e53fa23e32524ee1d86a15991e9a35f68b
R
2,505
57
# Seurat label transfer wrapper script. # Following from here: https://satijalab.org/seurat/articles/spatial_vignette.html # See the section 'Integration with single cell data' library(Seurat) library(dplyr) label_transfer <- function(st_expr_df, sc_expr_df, sc_labels) { ###### Performs Seurat label transfer from t...
a955c1d45a3425b421046a399bdbe71cdfda03a5e1652dee8252d6f7160267e2
R
2,511
66
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) suppressPackageStartupMessages({ library(SingleCellExperiment) library(Seurat) library(glue) library(stringr) source("../../Utils/utils.R") source("../../Utils/Feature_selection_methods/Traditional/doDE.R") source("../../Utils/Classifi...
98a75124db6c8b4afac120846fe4d1dd1b555437371165becd07c24b9c23a522
R
2,514
67
#========================================================================= # # Copyright NumFOCUS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/license...
a7ecd601cf6c36cdb831ddf5f494111432afd718b4e5de03d711d51f43b3bfdd
R
2,522
62
--- title: "QC of Library Cloning" author: "Stephen P Plassmeyer" date: "4/14/2021" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) source('../../../code/mpra_tools/mpra_tools.r') ``` # Load and Format Data ```{r} compiled_counts <- fread('../../../data/compiled_counts/asd3u...